l-linkify
Find linkable keywords in an article and attach external links. Use when: (1) User wants to add links to an article, (2) User says 'linkify', 'find links', 'add links to article', (3) After writing or...
Linkify Workflow
Find linkable keywords in the latest article, search for their URLs, and apply the links. Also detect references to Takazudo’s own Claude Code resources (skills, agents, commands) and link them to the public claude-resources repository at a pinned commit hash.
Arguments
--auto: Skip user confirmation and automatically apply all 1st candidates plus all matched Claude Code resource references. 2nd candidates are skipped entirely.
Steps
1. Identify the target article
Determine which article to process:
- Check
git diff --name-onlyfor uncommitted changes inblog/src/articles/ordoc/docs/articles/ - Check
git log --oneline -10 --diff-filter=AM -- blog/src/articles/ doc/docs/articles/for recently added or modified articles - If the user specified an article, use that
- If multiple candidates exist or the target is unclear, ask the user
Read the full content of the target article.
2. Extract external link candidates
Analyze the article content and identify keywords/terms that would benefit from external links. Skip terms that are already linked in the article.
Present candidates in two groups:
1st candidates (natural to link - well-known tools, libraries, frameworks, APIs, services directly discussed in the article):
- e.g., framework names, library names, specific API references, tools mentioned by name
2nd candidates (optional - general concepts, companies, standards that readers likely already know):
- e.g., well-known companies, common programming concepts, broadly known services
For each candidate, briefly note what it is (e.g., “official site”, “GitHub repo”, “API docs”).
3. Detect Claude Code resource references
Scan the article for references to Takazudo’s own Claude Code resources, which live in the public repo https://github.com/Takazudo/claude-resources.
Reference patterns to detect:
- Slash commands / skills: tokens like
/commits,/test-wisdom,`/verify-ui`. The slug after/may match either a skill (skills/<slug>/SKILL.md) or a top-level command (commands/<slug>.md). - Agents: phrases like
code-reviewer エージェント,frontend-developer agent, or bare agent slugs in code spans. Match againstagents/<slug>.md.
Resolve resources via gh api:
# Available skills (directories under skills/)
gh api repos/Takazudo/claude-resources/contents/skills --jq '.[] | select(.type=="dir") | .name'
# Available top-level commands (files under commands/)
gh api repos/Takazudo/claude-resources/contents/commands --jq '.[] | select(.type=="file") | .name | rtrimstr(".md")'
# Available agents (files under agents/)
gh api repos/Takazudo/claude-resources/contents/agents --jq '.[] | select(.type=="file") | .name | rtrimstr(".md")'
Build a set of valid slugs. Match each reference in the article against this set. Drop references that don’t match — those are not Takazudo’s resources (e.g., third-party slash commands, generic words).
Resolve the pinned commit hash once per run:
gh api repos/Takazudo/claude-resources/commits/HEAD --jq '.sha'
Store this hash. The repo changes frequently, so all generated URLs MUST embed this writing-time hash so the article stays valid after future repo changes.
URL templates (substitute <HASH> with the resolved sha):
- Skill:
https://github.com/Takazudo/claude-resources/blob/<HASH>/skills/<slug>/SKILL.md - Command:
https://github.com/Takazudo/claude-resources/blob/<HASH>/commands/<slug>.md - Agent:
https://github.com/Takazudo/claude-resources/blob/<HASH>/agents/<slug>.md
If a slash-command slug matches both a skill and a command, prefer the skill (skills are the more common authoring target).
4. Ask the user (or auto-apply)
If --auto was passed: Skip this step. Proceed with all 1st candidates from step 2 and all matched Claude Code resources from step 3. Do not present 2nd candidates at all.
Otherwise: Present three groups — 1st candidates (external), 2nd candidates (external), and matched Claude Code resources — and ask the user which to link. Wait for the user’s reply before proceeding.
5. Search for URLs and apply external links
Use WebSearch to find the official/canonical URL for each approved external keyword. Prefer:
- Official project websites over Wikipedia
- GitHub repos for libraries/packages
- Official API documentation pages for API references
- npm/PyPI pages only if no official site exists
After finding all URLs, immediately apply markdown links to the first occurrence of each keyword in the article without asking for confirmation. Use standard markdown link syntax: [keyword](url).
- Only link the first occurrence of each keyword
- For inline code keywords like
`globalShortcut`, use[`globalShortcut`](url) - Do not modify code blocks or frontmatter
6. Apply Claude Code resource links and insert the Note block
For each approved Claude Code resource match:
- Replace the first occurrence of the reference in the article body with a markdown link using the URL template from step 3.
- Preserve inline-code style: a
/commitstoken written as`/commits`becomes[`/commits`](url). Plain text tokens stay plain text. - Do not modify code blocks, frontmatter, or any existing Note block.
Insert (or update) the Note block if one or more Claude Code resources were linked.
Placement: immediately after the ## 概要 section, before the next ## heading. If a <Note> block referencing claude-resources already exists in that location, update its bullet list to include any newly linked resources (de-duplicate by URL).
Format (matches existing articles’ convention):
<Note>
この記事で紹介しているスキルやスクリプトは [claude-resources](https://github.com/Takazudo/claude-resources) リポジトリで公開している。リポジトリは頻繁に更新されるため、記事中のリンクは特定のコミットハッシュに固定してある。最新版とは異なる場合がある。
- [/skill-name](https://github.com/Takazudo/claude-resources/blob/<HASH>/skills/skill-name/SKILL.md)
- [agent-name](https://github.com/Takazudo/claude-resources/blob/<HASH>/agents/agent-name.md)
</Note>
Bullet label conventions:
- Skills and commands: lead with the slash form, e.g.
[/test-wisdom](...) - Agents: use the bare slug, e.g.
[code-reviewer](...) - Always use the same
<HASH>resolved in step 3 for every URL in the article (consistency across the whole article)
After applying, briefly report: external links added (keyword → URL), Claude Code resources linked (slug → URL), and whether the Note block was inserted or updated.