Blueprint derive plans

From laurigates/claude-plugins · View interactive version

Blueprint derive plans is an AI agent skill from the GitHub repository laurigates/claude-plugins. 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.

How to use this skill

Skill file

/blueprint:derive-plans

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.

When to Use This Skill

| 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 |

Context

Parameters

Parse these from $ARGUMENTS:

Default behavior without flags: Standard analysis (last 200 commits with scope estimation).

For detailed templates, manifest format, and report examples, see REFERENCE.md.

Execution

Execute this retroactive documentation generation workflow:

Step 1: Verify prerequisites

Check the values in Context:

  1. If git repository = "NO" → Error: "This directory is not a git repository. Run from project root."
  2. If total commits = "0" → Error: "Repository has no commit history"
  3. If Blueprint initialized = "NO" → Ask user: "Blueprint not initialized. Initialize now (Recommended) or minimal import only?"

Step 2: Determine analysis scope

Parse $ARGUMENTS for --quick or --since:

  1. If --quick flag present → scope = last 50 commits
  2. If --since DATE present → scope = commits from DATE to now
  3. Otherwise → Present options to user:

Use selected scope for all subsequent git analysis.

Step 3: Analyze git history quality

For commits in scope, calculate:

  1. Count total commits: git log --oneline {scope} | wc -l
  2. Count conventional commits: git log --format="%s" {scope} | grep -cE "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)\(?.*\)?:" || echo 0
  3. Calculate percentage and assign quality score (see REFERENCE.md)

Report: "Git history quality: {score}/10 ({percentage}% conventional commits)"

Step 4: Extract features and architecture decisions

Using methods from REFERENCE.md:

  1. Extract feature boundaries from conventional commit scopes
  2. Identify architecture decisions (migrations, major dependencies, breaking changes)
  3. Find issue references and future work items (TODOs, skipped tests)
  4. Identify release boundaries from git tags

Collect findings in structured format for user confirmation.

Step 5: Analyze codebase and existing documentation

  1. Use Explore agent to analyze architecture: directory structure, components, frameworks, patterns, entry points, data layer, API layer, testing structure
  2. Extract dependencies from manifest files (package.json, pyproject.toml, Cargo.toml, go.mod, etc.)
  3. Read and extract from existing documentation: README.md, docs/, ARCHITECTURE.md, DESIGN.md, CONTRIBUTING.md
  4. Detect future work: TODOs in code, open GitHub issues, skipped tests

Step 6: Clarify project context with user

Ask for clarifications via AskUserQuestion. For the full question templates

(problem statement, target users, project phase, stakeholder scale), see

REFERENCE.md.

  1. Project purpose (if not clear from README): present the inferred description for confirmation, or ask the user to provide one
  2. Target users: developers, end users, or both — steers the PRD's framing
  3. Project phase: MVP / active development / maintenance / planning major changes — sets feature-vs-stability emphasis
  4. Stakeholders: scale (solo / small team / larger org / OSS community) → drives the depth of the PRD's stakeholder matrix (see REFERENCE.md)
  5. Feature confirmation: present {N} features extracted from git for review/prioritization
  6. Architecture rationale: for each identified decision, ask the main driver
  7. Generation confirmation: show the summary below and ask if ready to generate

For the confirmation step, present:

Step 7: Generate documents

Create directory structure: mkdir -p docs/prds docs/adrs docs/prps

For each document type, use templates and patterns from REFERENCE.md:

  1. Generate PRD as docs/prds/project-overview.md
  1. Generate ADRs as docs/adrs/{NNNN}-{title}.md (one per decision)

${CLAUDE_SKILL_DIR}/../../templates/adr-template.md (Context, Decision,

Consequences, Options Considered, Related ADRs), filled as described in

REFERENCE.md § ADR Template

/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.

  1. Create ADR index at docs/adrs/README.md

(the five-section template), not MADR

  1. Generate PRPs as docs/prps/{feature}.md (one per future work item)

Step 8: Update manifest and report results

  1. Update docs/blueprint/manifest.json with import metadata: timestamp, commits analyzed, confidence scores, generated artifacts

Step 8.5: Offer GitHub issues for generated docs (optional)

For 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:

  1. Create the issue with title [{PRD-NNN}] {Project Name}.
  2. Add the issue number to the doc's github-issues frontmatter.
  3. Record it in the manifest id_registry (documents[ID].github_issues and the github_issues map).

Skip silently when no gh remote is configured or the user declines.

Step 9: Update task registry

Run the jq update in REFERENCE.md on docs/blueprint/manifest.json.

  1. Create summary report: REFERENCE.md.
  1. Prompt user for next action: REFERENCE.md.

Agentic Optimizations

| 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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.