phx-document
Document tested Elixir APIs; may update README/ADRs. Not for docs lookup,
它会碰到什么
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
Document
Generate documentation for newly implemented features.
Usage
$elixir-phoenix:phx-document .claude/plans/magic-link-auth/plan.md
$elixir-phoenix:phx-document magic link authentication
$elixir-phoenix:phx-document # Auto-detect from recent plan
Iron Laws
- Never remove existing documentation — Existing docs may reflect design intent that isn't obvious from code alone; update rather than replace
- @moduledoc on every public module — Undocumented modules accumulate quickly and create onboarding friction for new team members
- ADRs capture the "why", not the "what" — Code shows what was built; ADRs explain why this approach was chosen over alternatives
- Match @doc to function's public API — Document parameters, return values, and edge cases; callers shouldn't need to read the implementation
- DO NOT add @doc to untested code — documentation implies a stable contract; document only after tests confirm the function behaves as described
What Gets Documented
| Output | Description |
|--------|-------------|
| @moduledoc | For new modules missing documentation |
| @doc | For public functions without docs |
| README section | For user-facing features |
| ADR | For significant architectural decisions |
Workflow
Step 0: Pre-check (avoid no-op runs)
Run git diff --name-only HEAD~5 | grep '\.ex$' | head -20 to check for new .ex files.
If NO new .ex files were added (only modifications), skip the full
audit and report: "No new modules — documentation coverage unchanged."
This prevents 35-message analysis sessions that conclude "PASS" with
zero output (confirmed: session bb0a0454 wasted ~2K tokens on no-op).
- Identify new modules from recent commits or plan file
- Check documentation coverage (
@moduledoc,@doc) - Generate missing docs using templates
- Add README section if user-facing feature
- Create ADR if architectural decision was made
- Write report to
.claude/plans/{slug}/reviews/{feature}-docs.md
When to Generate ADRs
| Trigger | Create ADR |
|---------|-----------|
| New external dependency | Yes |
| New database table | Maybe (if schema non-obvious) |
| New OTP process | Yes (explain why process needed) |
| New context | Maybe (if boundaries non-obvious) |
| New auth mechanism | Yes |
| Performance optimization | Yes |
Integration with Workflow
$elixir-phoenix:phx-plan → $elixir-phoenix:phx-work → $elixir-phoenix:phx-review
↓
$elixir-phoenix:phx-document ← YOU ARE HERE (optional, suggested after review passes)
References
references/doc-templates.md— @moduledoc, @doc, README, ADR templatesreferences/output-format.md— Documentation report formatreferences/doc-best-practices.md— Elixir documentation best practicesreferences/documentation-patterns.md— Detailed documentation patterns
想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。
它属于哪个仓库
targets/codex/skills/phx-document/SKILL.md同一个仓库里的其他技能
同名技能的其他版本
有 5 个不同仓库或目录里都有叫 phx-document 的技能。它们内容并不相同,别混用:
- oliver-kriska/claude-elixir-phoenix — Generate @moduledoc/@doc for tested Elixir features; may update their
- oliver-kriska/claude-elixir-phoenix — Generate @moduledoc/@doc for tested Elixir features; may update their
- oliver-kriska/claude-elixir-phoenix — Generate @moduledoc/@doc for tested Elixir features; may update their
- oliver-kriska/claude-elixir-phoenix — Generate @moduledoc/@doc for tested Elixir features; may update their