Skip to content
Back to skills

Phx Document

ASecurity

'Use when asked to document Elixir code: add or fill in @moduledoc and

  • 559 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 5, 2026
ai-agentsawsgitapidatabaseperformancedocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 29, 2026

npx -y skills add oliver-kriska/claude-elixir-phoenix --skill phx-document --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Phx Document?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Phx Document
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/oliver-kriska-phx-document-7e2f3f8e/badge)](https://www.skillsdirectory.com/skills/oliver-kriska-phx-document-7e2f3f8e)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: phx-document
description: 'Use when asked to document Elixir code: add or fill in @moduledoc and
  @doc for modules and functions. Documents tested code only; may add a README section
  or ADR. Not for docs lookup or audits.'
---

# Document

Generate documentation for newly implemented features.

## Usage

```
/skill:phx-document .claude/plans/magic-link-auth/plan.md
/skill:phx-document magic link authentication
/skill:phx-document  # Auto-detect from recent plan
```

## Iron Laws

1. **Never remove existing documentation** — Existing docs may reflect design intent that isn't obvious from code alone; update rather than replace
2. **@moduledoc on every public module** — Undocumented modules accumulate quickly and create onboarding friction for new team members
3. **ADRs capture the "why", not the "what"** — Code shows what was built; ADRs explain why this approach was chosen over alternatives
4. **Match @doc to function's public API** — Document parameters, return values, and edge cases; callers shouldn't need to read the implementation
5. **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."
A full audit of unchanged coverage produces nothing to add.

1. **Identify** new modules from recent commits or plan file
2. **Check** documentation coverage (`@moduledoc`, `@doc`)
3. **Generate** missing docs using templates
4. **Add** README section if user-facing feature
5. **Create** ADR if architectural decision was made
6. **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

```text
/skill:phx-plan → /skill:phx-work → /skill:phx-review
       ↓
/skill:phx-document  ← YOU ARE HERE (optional, suggested after review passes)
```

## References

- `references/doc-templates.md` — @moduledoc, @doc, README, ADR templates
- `references/output-format.md` — Documentation report format
- `references/doc-best-practices.md` — Elixir documentation best practices
- `references/documentation-patterns.md` — Detailed documentation patterns

Files in this skill

  • SKILL.md3 KB
  • references/doc-best-practices.md600 B
  • references/doc-templates.md1.1 KB
  • references/documentation-patterns.md6.9 KB
  • references/output-format.md803 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…