/git-plugin:git-derive-docs [--rules] [--prd] [--adr] [--prp] [--all] [--since=<date>] [--depth=<N>]from git-plugin
Analyzes git commit history to derive ADRs, rules, PRDs, and PRPs from commit patterns. Use when finding documentation gaps, detecting unrecorded decisions, or generating skeleton docs from existing codebase history.
Ships in git-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
| 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 . -path '*/.claude/rules/*' -maxdepth 3 -type ffind . -maxdepth 3 \( -path '*/docs/prds/*' -o -path '*/docs/adrs/*' -o -path '*/docs/prps/*' \) -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.
Run the data-gathering script once. It aggregates file-naming patterns
(top directories + added-file extensions), tallies commit-convention frequency
(CONV_<type>=<count>), and detects dependency/migration signals
(DEP_MANIFEST_COMMITS, MIGRATION_COMMITS, REFACTOR_COMMITS), plus existing
doc coverage (DOCS_*):
bash "${CLAUDE_SKILL_DIR}/scripts/git-derive-docs.sh" --home-dir "$HOME" --depth "$DEPTH" --since "$SINCE"
Parse STATUS= and ISSUES: from the output. Pass --since (precedence) or
--depth (default 200). The structured rollup replaces the raw git log
pipes the rest of this skill used to run inline.
The script already aggregated the convention signals: read the CONV_<type>
frequency tally (commit-message conventions), the DIR_<n>=<path> /
EXT_<name>=<count> entries (file-naming patterns), and DOCS_* (existing
coverage). Cross-reference with existing .claude/rules/ to avoid duplicates —
the script reports current rule-file counts under DOCS__CLAUDE_RULES.
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. The script already detected
the deterministic dependency/migration signals — read DEP_MANIFEST_COMMITS
(commits touching dependency manifests), MIGRATION_COMMITS (migrate/switch/
replace/upgrade language), and REFACTOR_COMMITS (restructure/reorganize/
redesign language) from Step 1's output. For the specific commit subjects behind
a non-zero count, drill in with a targeted log:
# Infrastructure-change commits (for context behind the signal counts)
git log --oneline -$DEPTH -- 'docker*' 'Dockerfile*' '.github/workflows/*' 'terraform/*' 'k8s/*'
Cross-reference with existing docs/adrs/ (the script reports the count under
DOCS__DOCS_ADRS) to avoid duplicates. Judging whether a flagged commit
represents a real architectural decision worth an ADR stays with you.
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:derive-plans for PRDs and ADRs/blueprint:prp-create for PRPsReport:
/docs:generate --changelog for changelog generation from commitsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
52 skills in this plugin
/deadbranchdeadbranch CLI for stale-branch cleanup — dry-run preview, TUI or non-interactive delete, protects main/develop/WIP. Use when asked to clean up branches, prune branches, or remove stale branches./external-pr-trustAuthorship as a precondition of merging — bot vs stranger classification, what a merge executes, the merge-guard hook. Use when bulk-merging PRs, or when a merge is denied for a non-self author./gh-cli-agenticgh CLI commands with JSON output for agents. Use when querying PRs, issues, runs, or repo metadata; inspecting PR checks; fetching failed CI logs; or mapping a github.com URL to an API call./git-api-prGitHub API PR creation without local git. Use when submitting file changes as a PR without local commits — quick fixes, typos, config updates, or bypassing local git state./git-branch-namingBranch names: type prefix (feat/, fix/, chore/), issue number, kebab-case. Use when picking a name for a new branch or setting a repo's branch-naming convention./git-branch-pr-workflowBranch management and PR workflows — git switch/restore, GitHub MCP. Use when creating branches, opening PRs, or working with feature branches.npx claudepluginhub laurigates/claude-plugins --plugin git-pluginOther plugins' skills for the same job