Detects when high-level project documentation is stale based on code/config changes and generates update suggestions
Detects stale documentation by analyzing git diffs and generates update suggestions. Triggers when code changes affect CLAUDE.md, README.md, or other project docs, flagging sections that need updates for APIs, features, and configuration changes.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-docs@fractaryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/apply-updates.shscripts/check-consistency.shscripts/generate-suggestions.shPurpose: Detect when high-level project documentation (CLAUDE.md, README.md, etc.) is stale based on recent code changes and generate update suggestions.
Architecture: Operation-specific skill (Layer 3) - analyzes git diff and compares against documentation content.
Created: 2025-12-02 - Addresses documentation maintenance gap in FABER workflows. </CONTEXT>
<CRITICAL_RULES>
Non-Destructive Analysis
Change Detection Focus
Target Documents
Script Usage
šÆ STARTING: Documentation Consistency Check
Targets: {target_list}
Base: {base_ref} ā Head: {head_ref}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Check required parameters:
targets: Array of target document paths (optional, uses defaults)base_ref: Git reference for comparison base (optional, default: main)head_ref: Git reference for comparison head (optional, default: HEAD)mode: Operation mode (optional, default: confirm)Default targets:
DEFAULT_TARGETS=("CLAUDE.md" "README.md" "docs/README.md" "CONTRIBUTING.md")
Invoke check-consistency.sh:
./skills/doc-consistency-checker/scripts/check-consistency.sh \
--base "$BASE_REF" \
--head "$HEAD_REF" \
--output-format json
The script analyzes the git diff and categorizes changes:
API Changes (High Priority):
Feature Changes (High Priority):
Architecture Changes (High Priority):
Configuration Changes (Medium Priority):
Documentation Changes (Low Priority):
{
"changes": {
"api": [
{"file": "src/routes/auth.ts", "type": "added", "summary": "New /auth/login endpoint"}
],
"features": [
{"file": "src/commands/new-cmd.md", "type": "added", "summary": "New slash command"}
],
"architecture": [],
"configuration": [
{"file": ".env.example", "type": "modified", "summary": "New API_KEY variable"}
],
"documentation": []
},
"files_changed": 15,
"lines_added": 342,
"lines_removed": 45
}
For each target document that exists:
for target in "${TARGETS[@]}"; do
if [[ -f "$target" ]]; then
echo "š Checking $target..."
# Read current content
content=$(cat "$target")
# Identify sections that may need updates
check_sections "$target" "$CHANGES_JSON"
fi
done
For CLAUDE.md, check:
For README.md, check:
For CONTRIBUTING.md, check:
{
"status": "stale | current",
"targets_checked": 4,
"targets_stale": 2,
"stale_documents": [
{
"path": "CLAUDE.md",
"sections_affected": ["Architecture", "Directory Structure"],
"changes_requiring_update": [
{
"change_type": "feature",
"file": "plugins/docs/skills/doc-consistency-checker/",
"impact": "New skill added - update Directory Structure section"
}
],
"priority": "high"
}
],
"current_documents": ["README.md", "CONTRIBUTING.md"]
}
Invoke generate-suggestions.sh:
./skills/doc-consistency-checker/scripts/generate-suggestions.sh \
--target "$TARGET_PATH" \
--changes "$CHANGES_JSON" \
--output-format diff
For each stale document, generate:
--- CLAUDE.md
+++ CLAUDE.md
@@ -45,6 +45,8 @@ plugins/
āāā docs/ # Documentation management
ā āāā agents/ # docs-manager agent
ā āāā skills/ # Document operations
+ā ā āāā doc-consistency-checker/ # NEW: Documentation staleness detection
ā āāā commands/ # User commands
š Documentation Update Suggestions
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š CLAUDE.md (2 sections affected):
1. Directory Structure
+ Add doc-consistency-checker skill entry
2. Common Development Tasks
+ Add consistency checking workflow
Apply these updates? (y/n/edit)
Invoke apply-updates.sh:
./skills/doc-consistency-checker/scripts/apply-updates.sh \
--target "$TARGET_PATH" \
--updates "$UPDATES_JSON" \
--backup true
ā
COMPLETED: Documentation Consistency Check
Targets Checked: {count}
Status: {current/stale}
Updates Applied: {count}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Next: Review applied changes
</WORKFLOW>
<CHANGE_DETECTION_RULES>
New Files in Key Directories
Configuration Changes
API/Interface Changes
Dependency Changes
Test Coverage Changes
Documentation in Subdirectories
Internal Refactoring
</CHANGE_DETECTION_RULES>
<SCRIPTS> This skill uses 3 scripts in skills/doc-consistency-checker/scripts/:check-consistency.sh:
generate-suggestions.sh:
apply-updates.sh:
All scripts return structured JSON. </SCRIPTS>
<OUTPUTS> **Check Response (Stale)**: ```json { "success": true, "operation": "check", "status": "stale", "targets_checked": 4, "targets_stale": 2, "stale_documents": [ { "path": "CLAUDE.md", "sections_affected": ["Directory Structure", "Common Development Tasks"], "priority": "high", "changes_count": 3 } ], "current_documents": ["README.md", "CONTRIBUTING.md"], "changes_analyzed": { "api": 0, "features": 2, "architecture": 1, "configuration": 0 } } ```Check Response (Current):
{
"success": true,
"operation": "check",
"status": "current",
"targets_checked": 4,
"targets_stale": 0,
"message": "All target documents are up to date with recent changes"
}
Suggest Response:
{
"success": true,
"operation": "suggest",
"suggestions": [
{
"target": "CLAUDE.md",
"section": "Directory Structure",
"action": "add",
"content": "ā āāā doc-consistency-checker/ # Documentation staleness detection",
"context_line": "ā āāā skills/ # Document operations",
"priority": "high"
}
],
"total_suggestions": 3
}
Apply Response:
{
"success": true,
"operation": "apply",
"updates_applied": 3,
"files_modified": ["CLAUDE.md"],
"backups_created": ["CLAUDE.md.backup.2025-12-02"]
}
Error Response:
{
"success": false,
"operation": "check",
"error": "No git repository found",
"error_code": "NOT_GIT_REPO"
}
</OUTPUTS>
<ERROR_HANDLING>
FABER Release Phase:
docs-manager Agent:
doc-validator Skill:
<BEST_PRACTICES>
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.