Zenn記事の執筆ワークフローを実行します。インタビュー形式で内容を深掘りし、完全な草稿を生成し、編集者Agentで批評・推敲します。
Generates Zenn articles through interviews, research, drafting, and editor review.
/plugin marketplace add kokuyouwind/claude-plugins/plugin install zenn-writer@kokuyouwind-plugins[記事スラッグ]This command supports the entire Zenn article writing process, from user interviews to draft creation and review.
Check the project configuration to determine the language for interviews and article content.
Language determination logic:
Note: Command instructions and internal processing remain in English regardless of the determined language.
Check if an article slug (argument) was provided when the command was executed.
The article slug becomes part of the filename (e.g., 20240101-article-slug.md).
Use the AskUserQuestion tool to deeply explore the article content. Ask questions from the following perspectives:
Required question items:
Interview tips:
Use the WebSearch tool to research existing topics used on Zenn.dev.
zenn.dev topics list
Identify appropriate topics related to the article content (max 5). Present candidates to the user and get confirmation.
If the slug was not provided as an argument:
Use the Bash tool to create the article file with Zenn CLI and date prefix.
Step 1: Check package.json for available scripts
First, check if the project has npm scripts defined in package.json:
# Check if package.json has a new:article script
if grep -q '"new:article"' package.json 2>/dev/null; then
# Use npm script if available
npm run new:article -- --slug [article-slug]
else
# Fall back to npx command
npx zenn new:article --slug [article-slug]
fi
Step 2: Add date prefix to filename
# Get current date in YYYYMMDD format
DATE_PREFIX=$(date +%Y%m%d)
# Rename the file to include date prefix
mv articles/[article-slug].md articles/${DATE_PREFIX}-[article-slug].md
This creates an article file with a date prefix (e.g., 20240101-slug.md) in the articles/ directory.
Note: The command first checks for project-specific npm scripts and uses them if available, falling back to direct npx commands if not.
Propose article structure based on interview content.
Recommended structure (following writing-guidelines.md):
Present structure to the user and get approval. Adjust if needed.
Read the created article file with the Read tool, then update frontmatter with the Edit tool.
Items to update:
title: Title confirmed in interviewemoji: Propose emoji suitable for the articletype: Set to "tech" (technical article)topics: Set researched topics (array format)published: Keep as false (draft state)publication_name: Set to "leaner_dev"Generate article body based on interview content and approved structure.
Writing guidelines (following writing-style-guide.md):
:::message) for supplementary info:::details) for detailed infoImportant notes:
Use the Edit tool to add body content below the frontmatter.
Use the Bash tool to run textlint for quality checking (if textlint is configured in the project).
Step 1: Check for lint script and run textlint
# Check if package.json has a lint script
if grep -q '"lint"' package.json 2>/dev/null; then
# Use npm script if available
npm run lint articles/[generated-filename].md
else
# Fall back to npx command if textlint is available
npx textlint articles/[generated-filename].md 2>/dev/null || echo "textlint not available, skipping"
fi
Step 2: Auto-fix errors if possible
If errors or warnings appear:
# Check if package.json has a lint:fix script
if grep -q '"lint:fix"' package.json 2>/dev/null; then
# Use npm script if available
npm run lint:fix articles/[generated-filename].md
else
# Fall back to npx command
npx textlint --fix articles/[generated-filename].md 2>/dev/null || echo "Auto-fix not available"
fi
Note: The command checks for project-specific npm scripts first, then falls back to npx. If textlint is not available, the step is skipped automatically.
Use the Task tool to launch the editor agent.
Launch the editor agent to review and revise the article from these perspectives:
- Is the structure and logical flow appropriate?
- Are there any technical accuracy issues?
- Is Zenn syntax used correctly?
Make necessary revisions based on the editor agent's feedback.
Inform the user of:
npm run preview if available in package.jsonnpm run dev if availablenpx zenn preview/images/[article-filename-without-extension]/ directory)published: true)The workflow automatically detects and uses appropriate commands:
npm run new:article, npm run lint)npx zenn new:article, npx textlint)This approach ensures compatibility with various Zenn project setups while maintaining functionality.
This command is a long workflow. Report progress to the user at each step completion and get confirmation before proceeding to the next step.
/write-article my-first-zenn-article
or
/write-article
Executing this command runs the entire process from interview to draft creation and review.