l-tag-attach-to-article
Tag Attachment Workflow
Attach appropriate tags to a recently added or updated blog article.
Steps
1. Identify the target article
Determine which article to tag:
- Check
git diff --name-onlyfor uncommitted changes inblog/src/articles/ - Check
git log --oneline -10 --diff-filter=AM -- blog/src/articles/for recently added or modified articles - If multiple candidates exist or the target is unclear, ask the user which article to tag
2. Read the article content
Read the full content of the target article MDX file. Understand its topic, technologies mentioned, and key themes.
3. Read the tag list
Read doc/docs/overview/tags.md and parse the "タグ一覧" section to get all available tag IDs and their labels.
4. Suggest tags
Based on the article content, suggest appropriate tags from the existing tag list. Follow these rules:
- Maximum 7 tags per article: Never suggest more than 7 tags. More than 7 tags are not allowed in general.
- Pick tags from the article content: Only tag based on what the article actually discusses, not loosely related topics.
- Prefer broader tags over overly specific ones: If a tag is too specific or niche, remove it from the candidates.
- Check the full tag list: Consider whether existing tags cover the concept, or whether tags should be combined.
- Exception for very long articles: If the article is very long and genuinely covers many distinct topics, exceeding 7 tags is acceptable. Apply this exception sparingly.
Present the suggested tags to the user with both the tag ID and label, plus a brief explanation for each choice. Always show tags in the format id — label (e.g., claude-code — Claude Code, ai-writing — AI執筆) so the user can see what each tag means at a glance.
5. Propose new tags if needed
If the article covers topics not well represented by existing tags:
- Propose new tag IDs and labels following the conventions in the tag doc (ASCII kebab-case ID, appropriate label format)
- Explain why the existing tags are insufficient
- Wait for user approval before adding new tags
6. Apply tags to the article
Update the article's frontmatter tags: array with the approved tags. Place the tags array in the frontmatter in a natural order (most specific/important first).
Example frontmatter format:
tags:
- claude-code
- ai
- workflow
7. Update the tag doc if new tags were added
If new tags were approved and added, update doc/docs/overview/tags.md:
- Insert the new tags in the correct alphabetical position within the "タグ一覧" section
- Use the
- id — labelformat consistent with existing entries