empiricaai/empirica/code-docs-align
Claude Code and agent skill by empiricaai/empirica
- community
Checking that the SKILL.md file is still in the repository.
Use when the user says '/code-docs-align', 'check if docs match code', 'verify docstrings', 'find stale comments', 'audit TODOs', 'check ref-doc accuracy', 'documentation accuracy', or wants to verify that documentation, docstrings, comments, and ref-docs actually reflect the current state of the code. This skill bridges /code-audit (code quality) and docs-assess (doc coverage) by checking ACCURACY — do the docs match what the code actually does?
Install
npx vskill@latest install empiricaai/empirica/code-docs-alignSKILL.md
Code-Docs Alignment: Documentation Accuracy Investigation
Verify that documentation matches code. Find stale, misleading, or phantom docs.
This skill is purely noetic — it discovers mismatches between documentation and code. It does NOT fix anything. The output (findings, goals, unknowns) feeds into the Empirica workflow for praxic remediation.
Why this matters: For AI-based workflows and enterprise evaluation, stale documentation is worse than missing documentation — it actively misleads. /code-audit checks code quality. docs-assess checks doc coverage. This skill checks the gap: do the docs match the code?
How to Run
Phase 0: PREFLIGHT
Open a transaction before investigating.
No canned vector values. This skill used to print a fixed block — know: 0.2, uncertainty: 0.7 and so on — for you to submit verbatim. That teaches the one habit the whole measurement layer exists to prevent: reporting numbers you did not assess. A pasted vector set is not a low reading, it is a fabricated one, and it corrupts the calibration record more than skipping the transaction would.
Assess where you genuinely are. If you have already read the docs you are about to audit, know is not 0.2, and saying so is the point.
If you were already grounded before opening — you read the target first — declare claims in PREFLIGHT with grounding read (or ran with scope and count) and proceed straight to praxic. No CHECK needed; see /epistemic-transaction.
Phase 1: Scope
Determine what to check. If the user specified a target, use it. Otherwise, check the current project root.
Log the scope:
Phase 2: Docstring Accuracy (AST-based)
For each high-priority file (recently changed or large), read and compare signatures against docstrings. This requires AI judgment — parse the code, read the docstring, check alignment.
What to Check
For each function/method with a docstring:
- Parameters: Compare function signature params against docstring Args section
- Phantom param: documented but not in signature → finding (impact 0.6)
- Missing param: in signature but not documented → finding (impact 0.3)
- Wrong type: docstring type doesn't match annotation → finding (impact 0.4)
- Returns: Compare return annotation against docstring Returns section
- Wrong return type/description → finding (impact 0.6)
- Return documented but function returns None → finding (impact 0.6)
- Raises: Compare actual raise statements against docstring Raises section
- Stale raises (documented but never raised) → finding (impact 0.5)
- Undocumented raises (raised but not in docstring) → finding (impact 0.3)
- Behavioral claims: Does the docstring describe what the function ACTUALLY does?
- "Validates X" but no validation code → finding (impact 0.7)
- "Returns None if not found" but actually raises → finding (impact 0.7)
Impact Scoring
| Mismatch Type | Impact | Rationale | |
|---|---|---|---|
| Phantom param (in docstring, not in code) | 0.6 | Actively misleading | |
| Missing param (in code, not in docstring) | 0.3 | Incomplete but not misleading | |
| Wrong return description | 0.6 | Actively misleading | |
| Stale raises clause | 0.5 | Moderately misleading | |
| Behavioral mismatch | 0.7 | Dangerously misleading |
Logging
Phase 3: Inline Comment Staleness
Scan for comments that reference patterns, functions, or behaviors that no longer exist.
What to Check
- References to removed code:
- Comments mentioning function/class names that no longer exist in the codebase
- "See also X" where X was deleted
- References to files that were moved or removed
- Contradicted behavior:
- "This uses bare except for safety" in files where bare excepts were already fixed
- "Temporary workaround" for code that's been in place >6 months
- "TODO: remove after migration" where migration is complete
- Stale section headers:
# --- Legacy handlers ---where the legacy code was removed- Module-level docstrings describing features that were split elsewhere
Detection Strategy
Logging
Phase 4: TODO/FIXME Audit
Audit every TODO and FIXME in the codebase. Each one is either stale (work done), active (untracked work), or deferred (consciously parked).
What to Check
For each:
- Is the described work already done? → stale TODO → finding (impact 0.4)
- Is it untracked work that should be a goal? → active TODO → unknown
- Was it consciously deferred? → check decision-log → skip if already recorded
- Is it a stub placeholder? → finding (impact 0.2) if the stub has been fleshed out
Logging
Phase 5: Ref-Doc Alignment
For each registered reference document, check whether the symbols (functions, classes, file paths) it mentions still exist in the codebase.
What to Check
For each ref-doc:
- Read the document
- Extract mentioned file paths, function names, class names
- Verify each still exists in the codebase
- Check if code examples still work (syntax, imports)
- Flag dead references
Impact Scoring
| Issue | Impact | Rationale | |
|---|---|---|---|
| Dead file path reference | 0.7 | Document points to nothing | |
| Dead function/class reference | 0.6 | Symbol was renamed/removed | |
| Stale code example | 0.5 | Example won't work if copied | |
| Outdated architectural claim | 0.7 | Misleads about system structure |
Logging
Phase 6: Plugin Meta-Check
Check SKILL.md files, CLAUDE.md, and plugin configuration for references to CLI commands, flags, or workflows that may have changed.
What to Check
- CLI commands in SKILL.md files:
``bash empirica --help # Get current command list `` Cross-reference against commands mentioned in all SKILL.md files.
- Flags in CLAUDE.md:
Check that CLI flags mentioned in the system prompt still exist.
- Hook references:
Verify that hook scripts reference valid tools and events.
Logging
Phase 7: Triage + Goal Creation
Categorize all findings and group into remediation goals.
Finding Tags
| Tag | Meaning | |
|---|---|---|
phantom-param | Documented param doesn't exist in code | |
missing-param | Code param missing from documentation | |
stale-todo | TODO describes work that's already done | |
dead-ref-doc | Ref-doc references code that doesn't exist | |
stale-comment | Comment describes removed/changed behavior | |
wrong-raises | Docstring raises section doesn't match code | |
meta-drift | SKILL.md/CLAUDE.md references stale commands | |
behavioral-mismatch | Docstring claims don't match actual behavior |
Goal Creation
Group related findings into actionable goals:
Goal sizing: one goal = one praxic transaction. Full sizing guidance is in /epistemic-transaction — it owns the transaction lifecycle, and this text had drifted into three homes with three different wordings.
Phase 8: Summarize
Present the alignment audit results:
- Scope — files checked, ref-docs checked, TODOs audited
- Docstring accuracy — phantom params, missing params, wrong returns/raises
- Comment staleness — stale comments found and categorized
- TODO status — stale vs active vs deferred
- Ref-doc health — dead references, outdated examples
- Meta accuracy — SKILL.md/CLAUDE.md drift
- Goals created — remediation plan
- Unknowns remaining — ambiguous cases needing human judgment
Output Contract
After /code-docs-align completes, the following artifacts exist in the Empirica DB:
| Artifact Type | Purpose | |
|---|---|---|
| Findings (impact-scored) | Documentation-code mismatches, stale content | |
| Unknowns | Ambiguous cases requiring human judgment | |
| Decisions | Conscious choices to keep certain doc patterns | |
| Goals | Remediation work packages for praxic agents |
Key Design Principle
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingempirica/plugins/claude-code-integration/skills/code-docs-align/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/empiricaai/empirica/code-docs-align)