Blueprint init

From laurigates/claude-plugins · View interactive version

Blueprint init is an AI agent skill from the GitHub repository laurigates/claude-plugins. Initialize Blueprint Development structure. Use when bootstrapping docs/blueprint/ with manifest, PRD/ADR/PRP directories, and feature tracking for the first time.

How to use this skill

Skill file

Initialize Blueprint Development in this project.

When to Use This Skill

| Use this skill when... | Use blueprint-upgrade instead when... |

|---|---|

| The project has no docs/blueprint/manifest.json yet | The project already has a manifest at an older format version |

| You're bootstrapping a new project's PRD/ADR/PRP directories | You're migrating v1.x→v2, v2→v3, or v3.x→v3.y |

| You want to enable feature tracking and decision detection from scratch | Use blueprint-derive-plans to populate PRDs/ADRs/PRPs after init |

| You're configuring task scheduling for the first time | Use blueprint-execute instead when you want auto-detection of next step |

Execution

Execute this blueprint initialization workflow:

Step 1: Check if already initialized

Step 1a: Detect monorepo context

Format_version 3.3.0+. Ancestor manifest found → child; descendant manifests found → root; neither → standalone (no workspaces block). Walk/scan rules are in references/monorepo-workspaces.md.

When an ancestor root is detected, ask whether to register as a child workspace using the prompt in references/monorepo-workspaces.md.

Step 2: Ask about feature tracking

Use AskUserQuestion with the Step 2 prompt in references/prompts.md.

If "Yes" selected:

a. Search for markdown files in the project that contain requirements, features, or user stories

b. Auto-detect the most likely source document based on content analysis

c. Create docs/blueprint/feature-tracker.json from template using the detected source

d. Set has_feature_tracker: true in manifest

Step 3: Ask about document migration

Search for existing markdown documentation files across the project (excluding standard files like README.md, CHANGELOG.md, CONTRIBUTING.md, LICENSE.md, CODE_OF_CONDUCT.md, SECURITY.md). The find command is in references/document-migration.md.

If no documentation files found: skip this step silently.

If documentation files found (e.g., REQUIREMENTS.md, ARCHITECTURE.md, DESIGN.md, docs in non-standard locations), measure cross-reference density before recommending migration — migrating a doc rewrites its path and breaks every reference to it. Run the per-doc reference-count loop in references/document-migration.md, then:

Ask with the migration prompt in references/document-migration.md (AskUserQuestion).

If "Yes" selected: classify, move, rename, and report each doc per references/document-migration.md.

Step 4: Ask about maintenance task scheduling

Use AskUserQuestion with the Step 4 prompt in references/prompts.md (Prompt / Auto-run safe / Fully automatic / Manual only).

Store selection for task_registry defaults:

The same selection sets automation.autonomy_level (the ADR-0020 level

model — what actually executes the auto_run contract):

the SessionStart probe; due agent tasks surface as drift findings)

agent tasks in-session; interaction_mode defaults to quiet)

Step 4a: Ask about generated-rules output path

Only prompt when .claude/rules/ already exists and contains files (i.e., hand-authored rules that pre-date blueprint). Skip silently in fresh repos and use the default.

Detect existing content and ask with the Step 4a prompt in references/prompts.md (AskUserQuestion).

Store the chosen path in structure.generated_rules_path in the manifest (defaults to .claude/rules/ when unset). This keeps blueprint-generate-rules and blueprint-derive-rules from clobbering hand-curated rule files (issue #1043).

Step 5: Ask about decision detection

Use AskUserQuestion with the Step 5 prompt in references/prompts.md.

Set has_document_detection in manifest based on response.

If enabled: resolve $RULES_DIR and copy the document-management rule per references/rules-setup.md.

Step 6: Create directory structure

Execute the creation explicitly so the directories exist even when no document migration happened in Step 3:

mkdir -p docs/blueprint/work-orders/completed
mkdir -p docs/blueprint/work-orders/archived
mkdir -p docs/adrs
mkdir -p docs/prds
mkdir -p docs/prps

Documents live at top-level docs/, not docs/blueprint/ — why, plus the resulting trees: references/directory-layout.md.

Step 7: Create `manifest.json`

v3.4.0 schema — canonical filename is docs/blueprint/manifest.json, no dot prefix. Write the template in references/manifest-template.md, filling each [...] placeholder from the answers in Steps 1–5. Fill created_by.blueprint_plugin with the plugin version (not the format version):

jq -r .version "${CLAUDE_SKILL_DIR}/../../.claude-plugin/plugin.json"

Note: Include feature_tracker section only if feature tracking is enabled.

For a monorepo child or root (Step 1a), append the workspaces block from references/monorepo-workspaces.md; a standalone blueprint omits it.

Step 8: Create initial rules

Write them under the resolved $RULES_DIR (the Step 4a

generated_rules_path, default .claude/rules/) — never a hardcoded

.claude/rules/ — so they sit alongside, not on top of, rulesync-managed or

hand-authored rules (issue #1675):

RULES_DIR=$(jq -r '.structure.generated_rules_path // ".claude/rules/"' docs/blueprint/manifest.json)
mkdir -p "$RULES_DIR"

Step 8a: Register the rules just written in `generated.rules`

This step is not optional. /blueprint:sync and the SessionStart drift probe

detect staleness by comparing a registered record's content_hash against the file on

disk, so a rule written here but never registered is invisible to both: a

local edit is undetectable, a revised template never propagates, and sync

reports clean over a set it cannot see. Nothing surfaces as an error

(issue #2331).

Register every rule Step 8 actually wrote — pass only the filenames that

exist (document-management.md only when decision detection was enabled in

Step 5):

bash "${CLAUDE_SKILL_DIR}/../../scripts/register-generated-rules.sh" \
  --source "blueprint-init" \
  development.md testing.md document-management.md

The script records the plugin version from its own plugin.json, so the call carries no --plugin-version.

Check REGISTERED= and STATUS=OK in the script's output before continuing. The record shape and manifest key form are in references/rules-setup.md.

Step 9: Handle `.gitignore`

Step 10: Report

Print the initialization report in references/report-templates.md.

Step 11: Prompt for next action

Use AskUserQuestion with the Step 11 prompt in references/prompts.md.

Based on selection:

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.