git-plugin/skills/git-derive-docs/SKILL.md
Derive ADRs, rules, PRDs from git commit history. Use when finding doc gaps, detecting unrecorded decisions, deriving conventions from commits, or generating skeleton docs.
npx skillsauth add laurigates/claude-plugins git-derive-docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Use this skill when... | Use the alternative when... |
|---|---|
| Mining git history for undocumented rules, PRDs, ADRs, or PRPs | Use git-cli-agentic for one-shot porcelain queries against the history |
| Generating skeleton documentation from commit-message patterns | Use git-commit-workflow to set conventions BEFORE the history accrues |
| Detecting architectural decisions or feature work that was never recorded | Use github-issue-writing to file fresh issues from the gaps you find |
| Auditing whether .claude/rules/ and docs/{prds,adrs,prps}/ reflect actual practice | Use git-triage to triage the open issues and PRs surfaced during the audit |
git branch --show-currentgit rev-list --count HEADgit log --format='%ai' --max-count=1find .claude/rules/ -maxdepth 1 -type ffind docs/prds/ docs/adrs/ docs/prps/ -maxdepth 1 -type fgit log --format='%s' --max-count=20--rules: Derive .claude/rules/ from commit patterns (conventions, naming, tooling)--prd: Detect features implemented without requirements documentation--adr: Detect architecture decisions made without decision records--prp: Detect implementation work done without planning documentation--all: Run all detection categories (default if no flags specified)--since=<date>: Limit analysis to commits after date (e.g., --since=2025-01-01)--depth=<N>: Number of commits to analyze (default: 200)--dry-run: Report findings without creating files--refinements: Focus on plan refinement detection (approach changes, reverts, rework)Analyze git commit history to identify documentation gaps.
Parse flags to determine which categories to analyze. Default to --all if no category flags provided.
Set analysis depth:
# Use --since if provided, otherwise --depth (default 200)
git log --format='%H %s' --since="$SINCE" 2>/dev/null || git log --format='%H %s' -$DEPTH
Analyze commit patterns for implicit conventions:
# File naming patterns
git log --diff-filter=A --name-only --format='' -$DEPTH | sort | uniq -c | sort -rn | head -20
# Commit message conventions
git log --format='%s' -$DEPTH | grep -oP '^\w+(\([^)]+\))?' | sort | uniq -c | sort -rn
# Tool/config patterns
git log --oneline -$DEPTH -- '*.config.*' 'tsconfig*' 'biome.json' '.eslintrc*' 'pyproject.toml' 'Cargo.toml'
# Test file conventions
git log --diff-filter=A --name-only --format='' -$DEPTH -- '*.test.*' '*.spec.*' '*_test.*' | head -20
Cross-reference with existing .claude/rules/ to avoid duplicates.
Find features built without requirements documentation:
# Feature commits without PRD references
git log --format='%H %s' -$DEPTH | grep -iE '^[a-f0-9]+ feat' | head -20
# Large additions (new feature directories)
git log --diff-filter=A --name-only --format='%H---' -$DEPTH | awk '/^[a-f0-9]+---/{hash=$0;next}{if(hash)print hash,$0}'
# Cluster commits by directory to find feature groups
git log --format='' --name-only -$DEPTH | grep -oP '^[^/]+/[^/]+' | sort | uniq -c | sort -rn | head -15
Cross-reference with existing docs/prds/ to avoid duplicates.
Find architecture decisions without documentation:
# Dependency changes
git log --oneline -$DEPTH -- 'package.json' 'Cargo.toml' 'pyproject.toml' 'go.mod'
# Migration/replacement commits
git log --format='%H %s' -$DEPTH | grep -iE 'migrate|switch|replace|upgrade|from .+ to'
# Infrastructure changes
git log --oneline -$DEPTH -- 'docker*' 'Dockerfile*' '.github/workflows/*' 'terraform/*' 'k8s/*'
# Refactors indicating architectural shifts
git log --format='%H %s' -$DEPTH | grep -iE 'refactor.*to|restructure|reorganize|redesign'
Cross-reference with existing docs/adrs/ to avoid duplicates.
Find implementation work without planning docs:
# Sequential implementation commits
git log --format='%s' -$DEPTH | grep -iE 'step [0-9]|part [0-9]|phase [0-9]|wip'
# Multi-file coordinated changes
git log --format='%H %s' -$DEPTH | while read hash msg; do
files=$(git diff-tree --no-commit-id --name-only -r "$hash" 2>/dev/null | wc -l)
[ "$files" -gt 5 ] && echo "$files files: $msg"
done | sort -rn | head -10
# Feature branches
git branch -a --format='%(refname:short)' | grep -iE 'feat|feature|implement'
Cross-reference with existing docs/prps/ to avoid duplicates.
Find approach changes not documented:
# Reverts and reworks
git log --format='%H %s' -$DEPTH | grep -iE 'revert|redo|rework|rethink|redesign'
# "Actually" commits (approach corrections)
git log --format='%H %s' -$DEPTH | grep -iE 'actually|instead|better approach|try different'
# High-churn files (approach unclear, iterated heavily)
git log --format='' --name-only -$DEPTH | sort | uniq -c | sort -rn | head -15
# Short-lived implementations (created then significantly changed)
git log --format='%H %ai %s' -$DEPTH | grep -i 'refactor' | head -10
Compile findings into a prioritized report:
## Documentation Gaps Report
Generated: <date>
Commits analyzed: <N>
Period: <first> to <last>
### High Priority
[Items with strong evidence and high impact]
### Medium Priority
[Items with moderate evidence]
### Low Priority
[Minor patterns or old history items]
For each accepted finding:
Rules: Create/update .claude/rules/<name>.md with:
PRD/ADR/PRP: Generate skeleton documents in appropriate directories. If blueprint commands are available, suggest using:
/blueprint:prd for PRDs/blueprint:adr for ADRs/blueprint:prp-create for PRPsReport:
/docs:generate --changelog for changelog generation from commitstools
Scaffold a new ComfyUI custom-node repo (pyproject, CI, release-please, vitest+pytest, JS extension skeleton) in the picker/gesture vein. Use when bootstrapping or init-ing a comfyui node pack.
tools
Orchestrate a ComfyUI node pack from idea to registry: scaffold, create + seed the repo, open the gitops adoption PR. Use when releasing or spinning up a new comfyui node pack.
testing
macOS EndpointSecurity/EDR high CPU & battery drain. Use when Kandji ESF / XProtect pegs a core; trace the exec storm via powermetrics + eslogger.
development
odiff pixel-by-pixel image diffing. Use when comparing screenshots, detecting visual regressions, diffing before/after PNGs, asserting golden images.