Documentation consistency enforcement - prevents drift between README.md and actual codebase state. Auto-activates when updating docs, committing changes, or working with skills/agents/commands.
Auto-activates when you update docs, commit changes, or work with skills/agents/commands to prevent documentation drift. Reminds you to keep README.md counts and cross-references synchronized with actual files.
/plugin marketplace add akaszubski/autonomous-dev/plugin install autonomous-dev@autonomous-devThis skill is limited to using the following tools:
Layer 4 Defense Against Documentation Drift
This skill auto-activates to remind you to maintain documentation consistency when working on:
Automatically activates on keywords:
All counts in README.md must match reality:
# Count actual skills
ls -d plugins/autonomous-dev/skills/*/ | wc -l
# Count actual agents
ls plugins/autonomous-dev/agents/*.md | wc -l
# Count actual commands
ls plugins/autonomous-dev/commands/*.md | wc -l
# ✅ Verify README.md shows these exact counts
grep -E "[0-9]+ Skills" plugins/autonomous-dev/README.md
grep -E "[0-9]+ (Specialized )?Agents" plugins/autonomous-dev/README.md
grep -E "[0-9]+ (Slash )?Commands" plugins/autonomous-dev/README.md
These files MUST show the same counts:
README.md (primary source)docs/SYNC-STATUS.mddocs/UPDATES.mdINSTALL_TEMPLATE.md.claude-plugin/marketplace.json (metrics section)templates/knowledge/best-practices/claude-code-2.0.mdBefore mentioning a skill, verify it exists:
# Get list of actual skills
ls -1 plugins/autonomous-dev/skills/
# ❌ NEVER reference:
# - engineering-standards (doesn't exist)
# - Any skill not in the above list
Update marketplace.json whenever counts change:
{
"metrics": {
"agents": 8,
"skills": 12,
"commands": 21,
"hooks": 9
}
}
This skill is Layer 4 of the consistency enforcement strategy:
Location: tests/test_documentation_consistency.py
What it does: Automatically fails CI/CD if documentation is out of sync
Checks:
Run:
pytest tests/test_documentation_consistency.py -v
Location: agents/doc-master.md
What it does: doc-master agent has explicit checklist to verify consistency before creating docs.json artifact
Checks:
Location: hooks/validate_docs_consistency.py
What it does: Validates documentation consistency before file modifications
Note: Integrated into unified_pre_tool.py hook. Can be annoying, so it's optional. Use for critical repositories.
Location: skills/consistency-enforcement/SKILL.md
What it does: Auto-activates to remind you about consistency when working on docs
Triggers: Keywords like "readme", "commit", "skill", "agent", "command", "update"
What happens:
# You create new skill
mkdir skills/new-skill-name
# Write skill content...
# ❌ EASY TO FORGET: Update documentation!
Correct workflow:
# 1. Create skill
mkdir skills/new-skill-name
# 2. Update README.md
# Change "X Skills" to "Y Skills" (where Y = X + 1)
# Add skill to categorized table
# 3. Update cross-references
# - docs/SYNC-STATUS.md
# - docs/UPDATES.md
# - INSTALL_TEMPLATE.md
# - .claude-plugin/marketplace.json (metrics.skills)
# - templates/knowledge/best-practices/claude-code-2.0.md
# 4. Run tests to verify
pytest tests/test_documentation_consistency.py -v
# ✅ Now all counts match!
What happens:
# You update README.md skill count
# "9 Skills" → "12 Skills"
# ❌ EASY TO FORGET: Update other docs!
Correct workflow:
# 1. Update README.md
# "9 Skills" → "12 Skills (Comprehensive SDLC Coverage)"
# 2. Update ALL cross-references
grep -r "9 skills\|9 Skills" plugins/autonomous-dev/*.md plugins/autonomous-dev/docs/*.md
# 3. Update each file found
# - SYNC-STATUS.md: "9 skills" → "12 skills"
# - UPDATES.md: "All 9 skills" → "All 12 skills"
# - INSTALL_TEMPLATE.md: "9 Skills" → "12 Skills"
# 4. Update marketplace.json
# "skills": 9 → "skills": 12
# 5. Run tests to verify
pytest tests/test_documentation_consistency.py -v
# ✅ All documents now consistent!
What happens:
# You remove old skill
rm -rf skills/deprecated-skill
# ❌ EASY TO FORGET: Update counts AND remove references!
Correct workflow:
# 1. Remove skill
rm -rf skills/deprecated-skill
# 2. Update README.md count
# "12 Skills" → "11 Skills"
# Remove skill from table
# 3. Update all cross-references
# (Same as Scenario 2)
# 4. Search for skill references
grep -r "deprecated-skill" plugins/autonomous-dev/
# 5. Remove all references found
# 6. Run tests to verify
pytest tests/test_documentation_consistency.py -v
# ✅ Skill removed, all docs updated!
What happens:
# You're about to commit documentation changes
git add README.md docs/SYNC-STATUS.md
# ❌ EASY TO FORGET: Verify consistency!
Correct workflow:
# 1. Run consistency validation
python plugins/autonomous-dev/hooks/validate_docs_consistency.py
# 2. If checks fail, fix issues
# 3. Re-run validation
python plugins/autonomous-dev/hooks/validate_docs_consistency.py
# 4. When all checks pass, commit
git commit -m "docs: update skill count to 12"
# ✅ Consistent documentation committed!
Before committing documentation changes, verify:
pytest tests/test_documentation_consistency.py -v# Count skills
ls -d plugins/autonomous-dev/skills/*/ | wc -l
# Count agents
ls plugins/autonomous-dev/agents/*.md | wc -l
# Count commands
ls plugins/autonomous-dev/commands/*.md | wc -l
# Find skill count mentions
grep -E "[0-9]+ Skills" plugins/autonomous-dev/README.md
# Find agent count mentions
grep -E "[0-9]+ (Specialized )?Agents" plugins/autonomous-dev/README.md
# Find command count mentions
grep -E "[0-9]+ (Slash )?Commands" plugins/autonomous-dev/README.md
# Find all skill count mentions across docs
grep -r "skills" plugins/autonomous-dev/*.md plugins/autonomous-dev/docs/*.md | grep -E "[0-9]+"
# Check marketplace.json
cat .claude-plugin/marketplace.json | grep -A 5 '"metrics"'
# Run consistency tests
pytest tests/test_documentation_consistency.py -v
# Run only README checks
pytest tests/test_documentation_consistency.py::TestREADMEConsistency -v
# Run only cross-document checks
pytest tests/test_documentation_consistency.py::TestCrossDocumentConsistency -v
# Run only marketplace.json checks
pytest tests/test_documentation_consistency.py::TestMarketplaceConsistency -v
# Run pre-commit validation script
python plugins/autonomous-dev/hooks/validate_docs_consistency.py
# If validation passes (exit code 0), safe to commit
echo $?
Documentation drift is insidious:
Or worse:
With 4-layer defense:
Result: Documentation always matches reality 🎯
This skill works with:
Cross-reference pattern:
documentation-guide for HOW to write docsconsistency-enforcement for WHEN to update docsgit-workflow for HOW to commit doc changes# Run tests with verbose output
pytest tests/test_documentation_consistency.py -v
# Read the assertion error - it tells you exactly what's wrong
# Example: "README.md shows 9 skills but actual is 12"
Check: Did you update ALL cross-references?
# Find all skill count mentions
grep -r "[0-9]+ skills" plugins/autonomous-dev/*.md plugins/autonomous-dev/docs/*.md
# Each file should show the SAME count
# Check current metrics
cat .claude-plugin/marketplace.json | grep -A 5 '"metrics"'
# Count actual resources
ls -d plugins/autonomous-dev/skills/*/ | wc -l
ls plugins/autonomous-dev/agents/*.md | wc -l
ls plugins/autonomous-dev/commands/*.md | wc -l
# Update marketplace.json to match
vim .claude-plugin/marketplace.json
Option 1: Fix the inconsistency (recommended)
python plugins/autonomous-dev/hooks/validate_docs_consistency.py
# Read output, fix issues
Option 2: Skip hook (NOT RECOMMENDED)
git commit --no-verify
# Only use in emergency!
Version: 1.0.0 Type: Knowledge skill (auto-activates) Priority: Critical (prevents documentation drift) See Also: documentation-guide, git-workflow, project-management
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.