blueprint-plugin/skills/blueprint-derive-plans/SKILL.md
Derive PRDs, ADRs, PRPs from git history, docs, and codebase. Use when onboarding a project to blueprint, generating a PRD or ADRs retroactively, or extracting features from conventional commits.
npx skillsauth add laurigates/claude-plugins blueprint-derive-plansInstall 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.
Retroactively generate Blueprint documentation (PRDs, ADRs, PRPs) from an existing established project by analyzing git history, codebase structure, and existing documentation.
Use case: Onboarding established projects into the Blueprint Development system when PRD/ADR/PRP documents don't exist but the project has implementation history.
| Use this skill when... | Use alternative when... | |------------------------|-------------------------| | Project has git history but no PRDs/ADRs/PRPs | Starting a brand new project with no history | | Onboarding an established project to Blueprint | Creating a fresh PRD from scratch with user guidance | | Need to extract features from commit history | Project lacks conventional commits and clear history | | Want to document architecture decisions retroactively | Decisions are already fully documented |
git rev-parse --git-dirfind . -path '*/docs/blueprint/*' -maxdepth 3 -name 'manifest.json' -type fgit rev-list --count HEADgit log --reverse --format=%ai --max-count=1git log --max-count=1 --format=%aifind . -maxdepth 1 \( -name 'package.json' -o -name 'pyproject.toml' -o -name 'Cargo.toml' -o -name 'go.mod' -o -name 'pom.xml' \) -type f -print -quitfind . -maxdepth 2 \( -name "README.md" -o -name "ARCHITECTURE.md" -o -name "DESIGN.md" \)Parse these from $ARGUMENTS:
--quick: Fast scan (last 50 commits only)--since DATE: Analyze commits from specific date (e.g., --since 2024-01-01)Default behavior without flags: Standard analysis (last 200 commits with scope estimation).
For detailed templates, manifest format, and report examples, see REFERENCE.md.
Execute this retroactive documentation generation workflow:
Check context values above:
/blueprint:init, then continue with this step 1mkdir -p docs/prds docs/adrs docs/prpsParse $ARGUMENTS for --quick or --since:
--quick flag present → scope = last 50 commits--since DATE present → scope = commits from DATE to nowUse selected scope for all subsequent git analysis.
For commits in scope, calculate:
git log --oneline {scope} | wc -lgit log --format="%s" {scope} | grep -cE "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)\(?.*\)?:" || echo 0Report: "Git history quality: {score}/10 ({percentage}% conventional commits)"
Using methods from REFERENCE.md:
Collect findings in structured format for user confirmation.
Ask for clarifications via AskUserQuestion. For the full question templates
(problem statement, target users, project phase, stakeholder scale), see
REFERENCE.md.
For the confirmation step, present:
Create directory structure: mkdir -p docs/prds docs/adrs docs/prps
For each document type, use templates and patterns from REFERENCE.md:
Generate PRD as docs/prds/project-overview.md
Generate ADRs as docs/adrs/{NNNN}-{title}.md (one per decision)
/blueprint:adr-relationships to detect same-domain conflicts and
/blueprint:adr-validate to enforce bidirectional supersede consistency.
Do not re-implement conflict scoring here — those skills own it.Create ADR index at docs/adrs/README.md
Generate PRPs as docs/prps/{feature}.md (one per future work item)
docs/blueprint/manifest.json with import metadata: timestamp, commits analyzed, confidence scores, generated artifactsFor the generated PRD (and optionally each PRP), prompt with AskUserQuestion
whether to open a tracking GitHub issue. See
REFERENCE.md for the prompt template and
the gh issue create command. When the user accepts:
[{PRD-NNN}] {Project Name}.github-issues frontmatter.id_registry (documents[ID].github_issues and the github_issues map).Skip silently when no gh remote is configured or the user declines.
Update the task registry entry in docs/blueprint/manifest.json:
jq --arg now "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
--arg sha "$(git rev-parse HEAD 2>/dev/null)" \
--argjson analyzed "${COMMITS_ANALYZED:-0}" \
--argjson created "${DOCS_GENERATED:-0}" \
'.task_registry["derive-plans"].last_completed_at = $now |
.task_registry["derive-plans"].last_result = "success" |
.task_registry["derive-plans"].context.commits_analyzed_up_to = $sha |
.task_registry["derive-plans"].context.commits_analyzed_count = $analyzed |
.task_registry["derive-plans"].stats.runs_total = ((.task_registry["derive-plans"].stats.runs_total // 0) + 1) |
.task_registry["derive-plans"].stats.items_processed = $analyzed |
.task_registry["derive-plans"].stats.items_created = $created' \
docs/blueprint/manifest.json > tmp.json && mv tmp.json docs/blueprint/manifest.json
Create summary report showing:
Prompt user for next action:
| Context | Command |
|---------|---------|
| Check git status | git rev-parse --git-dir 2>/dev/null && echo "YES" \|\| echo "NO" |
| Count commits | git rev-list --count HEAD 2>/dev/null \|\| echo "0" |
| Conventional commits count | git log --format="%s" \| grep -cE "^(feat\|fix\|docs)" \|\| echo 0 |
| Extract scopes | git log --format="%s" \| grep -oE '\([^)]+\)' \| sort \| uniq -c |
| Fast analysis | Use --quick flag for last 50 commits only |
For detailed templates, git analysis patterns, document generation examples, and error handling guidance, see REFERENCE.md.
development
Debug HTTP APIs: trace requests, inspect headers. Use when a request fails: check status first.
documentation
Render architecture diagrams from text sources. Use when documenting system topology.
tools
Inspect JSON payloads and extract nested fields. Use when parsing API responses.
tools
--- name: no-description allowed-tools: Read --- # No Description This skill has no description and must be dropped with a warning.