claude-blueprint 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blueprint",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Architecture Decision Records with teeth — 39 commands, 21 agents, 15 architecture paradigms. DDD bounded contexts, DCAR forces evaluation, reflexion model conformance, epistemic status tracking, Wardley strategic analysis, C4 diagrams, ATAM tradeoff analysis, risk heat maps, cross-repo federation, and configurable governance tiers. All with a cranky senior engineer persona.",
5
5
  "author": {
6
6
  "name": "pragnition"
package/README.md CHANGED
@@ -173,6 +173,8 @@ This is a lightweight [domain-specific language](https://en.wikipedia.org/wiki/D
173
173
  | Command | Agent(s) | Purpose |
174
174
  |---------|----------|---------|
175
175
  | `/blueprint:init` | cartographer | Bootstrap blueprint onto an existing codebase — scan `.planning/`, `.research/`, CLAUDE.md, package files, git history for existing decisions, create ADR directory with template and lifecycle docs, infer ADRs, generate ARCHITECTURE.md |
176
+ | `/blueprint:quickstart [stack]` | — | Generate 5-8 foundational ADRs from pre-built templates for a stack (react-node, python-fastapi, nextjs, go-api, generic). Auto-detects stack from package manifest. |
177
+ | `/blueprint:onboard` | — | 5-minute architecture walkthrough for new team members — key decisions, domain structure, governance mode, health status, what to read first |
176
178
 
177
179
  `/blueprint:init` is the "day one" command. It reads every available source of architectural context — GSD planning artifacts, research files, CLAUDE.md conventions, dependency manifests, even early git commit messages — classifies discovered decisions by impact, and produces the full documentation suite in a single atomic commit. Think of it as an archaeological dig that turns implicit decisions into explicit records.
178
180
 
@@ -252,21 +254,29 @@ The eli5 commands exist because ADRs are written for the people who make decisio
252
254
  | `/blueprint:status` | — | Governance dashboard — terminal summary + interactive HTML with knowledge graph, timeline, metrics, and debt table |
253
255
  | `/blueprint:health` | — | Self-diagnostic — 8 consistency checks (index sync, supersession chains, graph integrity, staleness) with auto-repair |
254
256
  | `/blueprint:hooks` | — | Configure automatic triggers — pre-commit guard, retro-suggest, architecture-sync, dependency-watch, periodic-health |
255
- | `/blueprint:hooks install all` | — | Enable all 5 automation hooks in one command |
257
+ | `/blueprint:hooks install all` | — | Enable all automation hooks in one command |
258
+ | `/blueprint:nudge` | — | Check 10 governance staleness thresholds and surface overdue actions |
256
259
 
257
260
  `/blueprint:status` is the control room. It renders a terminal summary with ADR counts, governance health metrics, fitness coverage, and a text relationship graph — then generates and opens a self-contained HTML dashboard in your browser. The HTML has four tabs: a **force-directed knowledge graph** (nodes = ADRs colored by status, edges = relationships styled by type, click to explore), a **decision timeline**, **governance metrics with history sparklines**, and a **decision debt table**. Zero external dependencies — works offline.
258
261
 
259
262
  `/blueprint:health` is `fsck` for your ADR system. It validates internal consistency across 8 dimensions: directory structure, index-to-file sync, ADR content completeness, supersession chain integrity (bidirectional links, no cycles), relationship graph consistency (no orphans, no self-references), config freshness, cross-reference validity, and staleness (ADRs older than 12 months without review). Fixable issues get an auto-repair offer.
260
263
 
261
- `/blueprint:hooks` closes the adoption gap. Five configurable hooks embed blueprint into the development workflow so architectural governance happens automatically:
264
+ `/blueprint:hooks` closes the adoption gap. Ten hooks embed blueprint into the development workflow so architectural governance happens automatically:
262
265
 
263
266
  | Hook | When it fires | What it does | Default |
264
267
  |------|--------------|-------------|---------|
265
- | `guard` | Before any commit | Check staged files against ADR invariants | Off (opt-in) |
266
- | `retro-suggest` | After fix workflows | Suggest `/blueprint:retro` | On |
268
+ | `guard` | Before Write/Edit | Check staged files against ADR invariants | Off (opt-in) |
269
+ | `retro-suggest` | After git fix commits | Suggest `/blueprint:retro` | On |
270
+ | `bugfix-retro` | After `rapid:bug-fix`, `gsd:debug` | Suggest `/blueprint:retro` for plugin-driven fixes | On |
271
+ | `feynman-evidence` | After `feynman:deepresearch`, `feynman:lit` | Link research to existing ADRs or suggest new ones | On |
272
+ | `gsd-rapid-adr` | After `gsd:plan-phase`, `rapid:execute-set`, etc. | Detect undocumented architectural decisions | On |
273
+ | `agent-adr` | After GSD/RAPID agent completion | Review agent output for architecture choices | On |
267
274
  | `architecture-sync` | After ADR transitions | Suggest updating ARCHITECTURE.md + fitness functions | On |
268
275
  | `dependency-watch` | Package file changed | Suggest `/blueprint:new` for new dependencies | On |
269
- | `periodic-health` | Every 20 sessions | Suggest `/blueprint:health` + `/blueprint:debt` | On |
276
+ | `planning-watch` | PLAN.md or .planning/ changed | Detect architectural decisions in planning artifacts | On |
277
+ | `periodic-nudge` | ~Every 20 sessions | Check governance staleness, suggest `/blueprint:nudge` | On |
278
+ | `session-sweep` | Session end | Scan conversation for undocumented architectural decisions | On |
279
+ | `skill-refresh` | Skills or agents modified | Suggest reinstalling to update CLAUDE.md | On |
270
280
 
271
281
  Hooks suggest rather than block (except `guard`, which is opt-in precisely because it blocks). The goal is to make architectural governance a natural part of the workflow, not a gate that slows development.
272
282
 
@@ -357,13 +367,13 @@ npm link
357
367
  claude-blueprint install --global
358
368
  ```
359
369
 
360
- The installer deploys 39 skills, 21 agents, and 8 config files to `~/.claude/commands/blueprint/`, and inserts a managed section into `CLAUDE.md` with the command reference.
370
+ The installer deploys 42 skills, 21 agents, 9 config files, and 10 hooks to `~/.claude/commands/blueprint/`, and inserts a managed section into `CLAUDE.md` with the command reference.
361
371
 
362
372
  ## Architecture of Blueprint Itself
363
373
 
364
374
  ```
365
375
  blueprint/
366
- ├── skills/ 39 skill files
376
+ ├── skills/ 42 skill files
367
377
  │ ├── blueprint.md Thin router
368
378
  │ ├── init.md Bootstrap from existing codebase
369
379
  │ ├── help.md Contextual command reference
@@ -402,8 +412,14 @@ blueprint/
402
412
  │ ├── govern.md Governance tier configuration
403
413
  │ ├── status.md Governance dashboard + knowledge graph
404
414
  │ ├── health.md Self-diagnostic with auto-repair
405
- └── hooks.md Automatic trigger configuration
406
- ├── agents/ 19 agent definitions
415
+ ├── hooks.md Automatic trigger configuration
416
+ ├── quickstart.md Stack-specific ADR bootstrapping
417
+ │ ├── nudge.md Periodic governance health checks
418
+ │ ├── onboard.md New developer architecture walkthrough
419
+ │ └── persona/SKILL.md Shared persona (preloaded via skills field)
420
+ ├── hooks/
421
+ │ └── hooks.json 10 pre-built governance hooks
422
+ ├── agents/ 21 agent definitions
407
423
  │ ├── persona.md Shared senior engineer personality
408
424
  │ ├── adr-researcher.md
409
425
  │ ├── adr-devils-advocate.md
@@ -433,7 +449,8 @@ blueprint/
433
449
  │ ├── contexts.toml DDD bounded contexts
434
450
  │ ├── evidence.toml Epistemic status tracking
435
451
  │ ├── radar.toml Technology Radar (created on first use)
436
- └── governance.toml Governance mode (created on first use)
452
+ ├── governance.toml Governance mode (created on first use)
453
+ │ └── quickstart-templates.toml Pre-built ADR stubs for 5 stacks
437
454
  ├── docs/
438
455
  │ ├── ARCHITECTURE.md Bird's-eye codemap (matklad style)
439
456
  │ └── adr/ 34 self-referential ADRs
@@ -442,7 +459,7 @@ blueprint/
442
459
  └── .claude-plugin/ Plugin registration metadata
443
460
  ```
444
461
 
445
- Blueprint practices what it preaches: each skill is focused, the router is thin, domain knowledge is in config (not code), and agents have single responsibilities. 39 commands, 21 agents, 8 config files, 41 ADRs.
462
+ Blueprint practices what it preaches: each skill is focused, the router is thin, domain knowledge is in config (not code), and agents have single responsibilities. 42 skills, 21 agents, 9 config files, 10 hooks, 41 ADRs.
446
463
 
447
464
  ## Intellectual Heritage
448
465
 
@@ -493,6 +510,37 @@ Blueprint v2 adds 15 commands derived from a comprehensive survey of 20+ archite
493
510
  | ThoughtWorks Technology Radar | `/blueprint:radar` | Technology adoption lifecycle |
494
511
  | TOGAF + Advice Process | `/blueprint:govern` | Configurable governance tiers |
495
512
 
513
+ ## v2.0.2: Developer Experience
514
+
515
+ v2.0.2 focuses on reducing friction — wider on-ramps without changing the destination.
516
+
517
+ ### New Commands
518
+
519
+ | Command | What It Does |
520
+ |---------|-------------|
521
+ | `/blueprint:quickstart [stack]` | Generate 5-8 foundational ADRs from pre-built templates. Auto-detects stack from package manifest. Presets: react-node, python-fastapi, nextjs, go-api, generic (27 ADR stubs total). |
522
+ | `/blueprint:onboard` | 5-minute architecture walkthrough for new developers — key decisions, domain structure, governance mode, health status, what to read first. |
523
+ | `/blueprint:nudge` | Check 10 governance staleness thresholds and surface overdue actions. Runs automatically via SessionStart hook (~1-in-20 sessions). |
524
+
525
+ ### Enhancements
526
+
527
+ | Change | What It Does |
528
+ |--------|-------------|
529
+ | `--format` on `/blueprint:fitness` | Output fitness functions as GitHub Actions (`--format github-actions`), GitLab CI (`--format gitlab-ci`), or justfile (`--format justfile`) — not just shell scripts. |
530
+ | Context-first `/blueprint:list` | ADRs grouped by bounded context by default when contexts are defined. `--flat` for the original numbered list. |
531
+
532
+ ### Cross-Plugin Integration (10 hooks)
533
+
534
+ Blueprint now runs as a background architecture conscience across the plugin ecosystem:
535
+
536
+ - **GSD/RAPID phase completion** → detect undocumented architectural decisions
537
+ - **GSD/RAPID agent output** → review for technology choices and pattern selections
538
+ - **`rapid:bug-fix` / `gsd:debug`** → suggest `/blueprint:retro` for root cause analysis
539
+ - **Feynman research completion** → link findings to existing ADRs or suggest new ones
540
+ - **Planning artifact changes** → detect architectural decisions in PLAN.md / .planning/
541
+ - **Session end** → sweep conversation for undocumented decisions
542
+ - **Periodic nudge** → governance staleness check every ~20 sessions
543
+
496
544
  ## License
497
545
 
498
546
  MIT
@@ -0,0 +1,227 @@
1
+ # Blueprint Quick-Start Templates
2
+ # Pre-built ADR starter sets for common technology stacks.
3
+ # Each stack defines 5-8 foundational ADRs that every project of that type needs.
4
+
5
+ # --------------------------------------------------------------------------
6
+ # react-node: React + Express/Node.js
7
+ # --------------------------------------------------------------------------
8
+ [stacks.react-node]
9
+ label = "React + Node.js"
10
+ detect = ["react", "express", "react-dom"]
11
+
12
+ [[stacks.react-node.adrs]]
13
+ title = "Use React for frontend UI"
14
+ context = "The project needs a component-based UI framework for building interactive interfaces. React's ecosystem maturity and hiring pool make it a strong default for teams already committed to JavaScript."
15
+ recommended = "React"
16
+ alternatives = ["Vue", "Svelte", "Angular"]
17
+ category = "Technology Choice"
18
+
19
+ [[stacks.react-node.adrs]]
20
+ title = "Use Express for API server"
21
+ context = "The backend needs an HTTP framework to handle routing, middleware, and request lifecycle. Express is the most widely adopted Node.js framework with extensive middleware ecosystem."
22
+ recommended = "Express"
23
+ alternatives = ["Fastify", "Koa", "Hono"]
24
+ category = "Technology Choice"
25
+
26
+ [[stacks.react-node.adrs]]
27
+ title = "Use TypeScript across frontend and backend"
28
+ context = "Shared language across the stack reduces context-switching and enables code sharing. Type safety catches a class of bugs at compile time that would otherwise surface in production."
29
+ recommended = "TypeScript (strict mode)"
30
+ alternatives = ["JavaScript with JSDoc", "JavaScript without types", "TypeScript (lenient)"]
31
+ category = "Developer Experience"
32
+
33
+ [[stacks.react-node.adrs]]
34
+ title = "Use JWT for API authentication"
35
+ context = "The API needs a stateless authentication mechanism that works across services. JWTs allow the frontend to authenticate without server-side session storage, though token revocation requires additional infrastructure."
36
+ recommended = "JWT with refresh tokens"
37
+ alternatives = ["Session cookies", "OAuth2 with opaque tokens", "API keys"]
38
+ category = "Security"
39
+
40
+ [[stacks.react-node.adrs]]
41
+ title = "Use PostgreSQL as primary database"
42
+ context = "The application needs a relational store for structured data with ACID guarantees. PostgreSQL offers strong JSON support for semi-structured data alongside traditional relational capabilities."
43
+ recommended = "PostgreSQL"
44
+ alternatives = ["MySQL", "MongoDB", "SQLite"]
45
+ category = "Data Storage"
46
+
47
+ [[stacks.react-node.adrs]]
48
+ title = "Use Docker for local development and deployment"
49
+ context = "Development environment parity with production reduces works-on-my-machine issues. Container-based deployment simplifies CI/CD pipelines and infrastructure provisioning."
50
+ recommended = "Docker with docker-compose"
51
+ alternatives = ["Native installs", "Nix", "Vagrant"]
52
+ category = "Infrastructure"
53
+
54
+ # --------------------------------------------------------------------------
55
+ # python-fastapi: Python + FastAPI
56
+ # --------------------------------------------------------------------------
57
+ [stacks.python-fastapi]
58
+ label = "Python + FastAPI"
59
+ detect = ["fastapi", "uvicorn", "pydantic"]
60
+
61
+ [[stacks.python-fastapi.adrs]]
62
+ title = "Use FastAPI for HTTP API framework"
63
+ context = "The project needs a modern Python web framework with automatic OpenAPI documentation and async support. FastAPI's Pydantic integration provides request validation with minimal boilerplate."
64
+ recommended = "FastAPI"
65
+ alternatives = ["Flask", "Django REST Framework", "Litestar"]
66
+ category = "Technology Choice"
67
+
68
+ [[stacks.python-fastapi.adrs]]
69
+ title = "Use SQLAlchemy for database access"
70
+ context = "The application needs an ORM that supports both high-level model declarations and low-level SQL when needed. SQLAlchemy's unit-of-work pattern and migration support via Alembic are well-proven."
71
+ recommended = "SQLAlchemy 2.0 with Alembic"
72
+ alternatives = ["Tortoise ORM", "SQLModel", "Raw asyncpg"]
73
+ category = "Data Access"
74
+
75
+ [[stacks.python-fastapi.adrs]]
76
+ title = "Use Pydantic for data validation and serialization"
77
+ context = "API request/response validation needs to be explicit and produce clear error messages. Pydantic v2's Rust-backed core provides fast validation and integrates natively with FastAPI."
78
+ recommended = "Pydantic v2"
79
+ alternatives = ["attrs + cattrs", "marshmallow", "Manual validation"]
80
+ category = "Data Validation"
81
+
82
+ [[stacks.python-fastapi.adrs]]
83
+ title = "Use pytest as testing framework"
84
+ context = "The project needs a testing framework that supports fixtures, parametrization, and async test cases. pytest's plugin ecosystem and fixture injection model reduce test boilerplate."
85
+ recommended = "pytest with pytest-asyncio"
86
+ alternatives = ["unittest", "nose2", "ward"]
87
+ category = "Testing"
88
+
89
+ [[stacks.python-fastapi.adrs]]
90
+ title = "Use PostgreSQL as primary database"
91
+ context = "The application needs a relational store with strong typing and JSON support. PostgreSQL's feature set covers most use cases without needing a separate document store."
92
+ recommended = "PostgreSQL"
93
+ alternatives = ["MySQL", "SQLite", "CockroachDB"]
94
+ category = "Data Storage"
95
+
96
+ [[stacks.python-fastapi.adrs]]
97
+ title = "Use Poetry for dependency management"
98
+ context = "Python dependency management needs lock files and virtual environment isolation. Poetry provides deterministic builds and a standardized pyproject.toml-based workflow."
99
+ recommended = "Poetry"
100
+ alternatives = ["uv", "pip + pip-tools", "PDM"]
101
+ category = "Developer Experience"
102
+
103
+ # --------------------------------------------------------------------------
104
+ # nextjs: Next.js fullstack
105
+ # --------------------------------------------------------------------------
106
+ [stacks.nextjs]
107
+ label = "Next.js Fullstack"
108
+ detect = ["next", "react", "@next/font"]
109
+
110
+ [[stacks.nextjs.adrs]]
111
+ title = "Use Next.js as fullstack framework"
112
+ context = "The project needs server-side rendering, static generation, and API routes in a single framework. Next.js provides file-based routing and multiple rendering strategies without requiring a separate backend."
113
+ recommended = "Next.js (App Router)"
114
+ alternatives = ["Remix", "Nuxt", "SvelteKit"]
115
+ category = "Technology Choice"
116
+
117
+ [[stacks.nextjs.adrs]]
118
+ title = "Use Server Components as default rendering strategy"
119
+ context = "Most pages benefit from server-side data fetching and reduced client JavaScript. React Server Components allow composing server and client rendering at the component level."
120
+ recommended = "Server Components by default, Client Components opt-in"
121
+ alternatives = ["Client-side rendering throughout", "Full SSR with hydration", "Static generation only"]
122
+ category = "Architecture Pattern"
123
+
124
+ [[stacks.nextjs.adrs]]
125
+ title = "Use Prisma for database access"
126
+ context = "The application needs type-safe database queries with migration support. Prisma's generated client provides autocomplete and compile-time query validation from a declarative schema."
127
+ recommended = "Prisma"
128
+ alternatives = ["Drizzle ORM", "Kysely", "Raw SQL with pg"]
129
+ category = "Data Access"
130
+
131
+ [[stacks.nextjs.adrs]]
132
+ title = "Use Tailwind CSS for styling"
133
+ context = "The project needs a styling approach that scales with the component model and avoids CSS specificity conflicts. Utility-first CSS co-locates styles with markup and eliminates dead CSS through purging."
134
+ recommended = "Tailwind CSS"
135
+ alternatives = ["CSS Modules", "styled-components", "vanilla-extract"]
136
+ category = "UI Framework"
137
+
138
+ [[stacks.nextjs.adrs]]
139
+ title = "Use Vercel for deployment platform"
140
+ context = "Next.js features like ISR, middleware, and edge functions work best on Vercel's infrastructure. Self-hosting is possible but requires additional configuration for feature parity."
141
+ recommended = "Vercel"
142
+ alternatives = ["AWS with SST", "Cloudflare Pages", "Self-hosted with Docker"]
143
+ category = "Infrastructure"
144
+
145
+ # --------------------------------------------------------------------------
146
+ # go-api: Go API service
147
+ # --------------------------------------------------------------------------
148
+ [stacks.go-api]
149
+ label = "Go API Service"
150
+ detect = ["go.mod"]
151
+
152
+ [[stacks.go-api.adrs]]
153
+ title = "Use standard library net/http for HTTP routing"
154
+ context = "Go 1.22+ provides pattern-based routing in the standard library, reducing the need for third-party routers. Fewer dependencies means less supply-chain risk and easier upgrades."
155
+ recommended = "net/http with Go 1.22+ routing"
156
+ alternatives = ["Chi", "Gin", "Echo"]
157
+ category = "Technology Choice"
158
+
159
+ [[stacks.go-api.adrs]]
160
+ title = "Use structured logging with slog"
161
+ context = "The service needs structured, leveled logging for observability. Go's slog package (standard library since 1.21) provides a consistent logging interface without external dependencies."
162
+ recommended = "slog (standard library)"
163
+ alternatives = ["zerolog", "zap", "logrus"]
164
+ category = "Observability"
165
+
166
+ [[stacks.go-api.adrs]]
167
+ title = "Use sqlc for database query generation"
168
+ context = "The service needs type-safe database access without the overhead of a full ORM. sqlc generates Go code from SQL queries, keeping SQL as the source of truth while providing compile-time type safety."
169
+ recommended = "sqlc"
170
+ alternatives = ["GORM", "sqlx", "Ent"]
171
+ category = "Data Access"
172
+
173
+ [[stacks.go-api.adrs]]
174
+ title = "Use PostgreSQL as primary database"
175
+ context = "The service needs a relational store with strong concurrency support. PostgreSQL's MVCC model and feature set make it the default choice for Go services."
176
+ recommended = "PostgreSQL"
177
+ alternatives = ["MySQL", "CockroachDB", "SQLite"]
178
+ category = "Data Storage"
179
+
180
+ [[stacks.go-api.adrs]]
181
+ title = "Use Docker for containerized deployment"
182
+ context = "Go produces static binaries ideal for minimal container images. Multi-stage Docker builds produce images under 20MB, simplifying deployment and reducing attack surface."
183
+ recommended = "Docker with multi-stage builds"
184
+ alternatives = ["Systemd units", "Kubernetes-native buildpacks", "Nix"]
185
+ category = "Infrastructure"
186
+
187
+ # --------------------------------------------------------------------------
188
+ # generic: Stack-agnostic foundational decisions
189
+ # --------------------------------------------------------------------------
190
+ [stacks.generic]
191
+ label = "Stack-Agnostic Foundations"
192
+ detect = []
193
+
194
+ [[stacks.generic.adrs]]
195
+ title = "Select primary database engine"
196
+ context = "Every non-trivial application needs persistent storage. The choice between relational and document databases affects schema evolution, query patterns, and operational complexity for years."
197
+ recommended = "PostgreSQL"
198
+ alternatives = ["MySQL", "MongoDB", "SQLite"]
199
+ category = "Data Storage"
200
+
201
+ [[stacks.generic.adrs]]
202
+ title = "Define authentication and authorization strategy"
203
+ context = "The application needs to verify user identity and enforce access control. Build-vs-buy and protocol choice (OAuth2, SAML, API keys) shape security posture and integration complexity."
204
+ recommended = "OAuth2 with OIDC provider"
205
+ alternatives = ["Session-based auth", "API keys", "Custom JWT implementation"]
206
+ category = "Security"
207
+
208
+ [[stacks.generic.adrs]]
209
+ title = "Choose deployment and hosting strategy"
210
+ context = "The application needs a deployment target that balances cost, operational complexity, and scaling needs. This decision constrains infrastructure choices for the project lifetime."
211
+ recommended = "Container-based (Docker) on managed platform"
212
+ alternatives = ["Serverless functions", "VM-based deployment", "PaaS (Heroku/Render)"]
213
+ category = "Infrastructure"
214
+
215
+ [[stacks.generic.adrs]]
216
+ title = "Define testing strategy and coverage expectations"
217
+ context = "The project needs a testing approach that catches regressions without slowing development. The testing pyramid shape and coverage thresholds affect both confidence and velocity."
218
+ recommended = "Testing pyramid with 80% unit, 15% integration, 5% E2E"
219
+ alternatives = ["Testing trophy (more integration)", "E2E-heavy approach", "Contract testing focus"]
220
+ category = "Quality Assurance"
221
+
222
+ [[stacks.generic.adrs]]
223
+ title = "Choose CI/CD pipeline platform"
224
+ context = "The project needs automated build, test, and deployment pipelines. The CI/CD platform choice affects developer workflow, deployment frequency, and integration with other tooling."
225
+ recommended = "GitHub Actions"
226
+ alternatives = ["GitLab CI", "CircleCI", "Jenkins"]
227
+ category = "Infrastructure"
package/hooks/hooks.json CHANGED
@@ -1,6 +1,19 @@
1
1
  {
2
2
  "description": "Blueprint architecture governance hooks. Pre-commit guard is opt-in (disabled by default). All others suggest actions without blocking.",
3
3
  "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "matcher": ".*",
7
+ "hooks": [
8
+ {
9
+ "type": "prompt",
10
+ "prompt": "Periodic governance health nudge. This fires at session start — to avoid noise, only act roughly every 20 sessions: pick a random number 1-20 and only proceed if it equals 1. If proceeding: read config/state.toml (relative to the blueprint skill directory) and check the [last_operations] timestamps. If any operation has never been run (empty string) or exceeds its staleness threshold (evidence_audit >90d, audit >60d, evaluation >90d, drift >30d, risk_assessment >90d, reflect >60d, strategic_map >180d), output a single concise line: 'Governance checks overdue. Run /blueprint:nudge for details.' If all timestamps are current or you decided to skip this session, stay completely silent — produce no output at all.",
11
+ "timeout": 5
12
+ }
13
+ ],
14
+ "_comment": "Periodic health nudge — lightweight governance staleness check (roughly every 20 sessions)"
15
+ }
16
+ ],
4
17
  "PreToolUse": [
5
18
  {
6
19
  "matcher": "Write|Edit",
@@ -18,14 +31,60 @@
18
31
  "PostToolUse": [
19
32
  {
20
33
  "matcher": "Bash",
34
+ "hooks": [
35
+ {
36
+ "type": "command",
37
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/retro-suggest.js\"",
38
+ "timeout": 5
39
+ }
40
+ ],
41
+ "_comment": "Retro-suggest after fix commits only (ADR-0034). Uses deterministic script instead of prompt to avoid LLM false positives on non-commit Bash commands."
42
+ },
43
+ {
44
+ "matcher": "Skill",
21
45
  "hooks": [
22
46
  {
23
47
  "type": "prompt",
24
- "prompt": "If the command output indicates a bug fix was just applied (commit message contains 'fix', 'bugfix', 'hotfix', or 'patch'), suggest: 'Run /blueprint:retro to check if this fix warrants an ADR.' Do not block — just suggest.",
48
+ "prompt": "Check if the skill that just completed was a bug-fix workflow: rapid:bug-fix, gsd:debug, gsd:quick (with fix-related arguments). If so, suggest: 'A bug was just fixed. Run /blueprint:retro to classify the root cause and check if this warrants an ADR.' Do not block.",
25
49
  "timeout": 5
26
50
  }
27
51
  ],
28
- "_comment": "Retro-suggest after fix workflows (ADR-0034)"
52
+ "_comment": "Retro-suggest after RAPID/GSD bug-fix workflows"
53
+ },
54
+ {
55
+ "matcher": "Skill",
56
+ "hooks": [
57
+ {
58
+ "type": "prompt",
59
+ "prompt": "Check if the skill that just completed was a Feynman research skill: feynman:deepresearch, feynman:lit, feynman:compare, feynman:audit. If so, check if the research topic relates to any existing accepted ADR (technology choices, architecture patterns, design decisions). If it does, suggest: 'This research is relevant to [ADR-NNNN]. Run /blueprint:evidence set ADR-NNNN L1 to upgrade its evidence level, or update the ADR references section.' If the research covers a topic with no existing ADR, suggest: 'This research could support a new architectural decision. Run /blueprint:new --research \"[topic]\" to formalize.' Stay silent if the research has no architectural relevance.",
60
+ "timeout": 10
61
+ }
62
+ ],
63
+ "_comment": "Feynman research → ADR evidence pipeline"
64
+ },
65
+ {
66
+ "matcher": "Skill",
67
+ "hooks": [
68
+ {
69
+ "type": "prompt",
70
+ "prompt": "Check if the skill that just completed was a GSD or RAPID planning/execution skill. Specifically look for: gsd:plan-phase, gsd:execute-phase, gsd:discuss-phase, gsd:autonomous, rapid:plan-set, rapid:execute-set, rapid:discuss-set. If one of these just completed successfully, check whether the work involved architectural decisions (new technology choices, pattern selections, API designs, data model changes, deployment strategies, infrastructure choices). If architectural decisions were made during the phase but no ADR was created, suggest: 'Architectural decisions were made during this phase. Run /blueprint:new to document them, or /blueprint:scope to check which bounded context is affected.' Be specific about which decisions you detected. If no architectural decisions were made (e.g., pure UI work, content changes, test additions), stay silent.",
71
+ "timeout": 10
72
+ }
73
+ ],
74
+ "_comment": "Cross-plugin integration: suggest ADRs after GSD/RAPID phase completion"
75
+ }
76
+ ],
77
+ "SubagentStop": [
78
+ {
79
+ "matcher": "gsd-executor|gsd-planner|gsd-phase-researcher|rapid-executor|rapid-planner|rapid-research",
80
+ "hooks": [
81
+ {
82
+ "type": "prompt",
83
+ "prompt": "A GSD or RAPID agent just completed. Review its output for architectural decisions that should be documented as ADRs. Look for: new dependencies added, database/cache/queue choices, API pattern selections, module boundary definitions, deployment topology changes, authentication strategy decisions. If you find undocumented architectural decisions, suggest: 'The [agent] made architectural choices that should be recorded. Run /blueprint:new \"[specific decision topic]\" to document.' Only suggest for genuinely architectural decisions — not implementation details.",
84
+ "timeout": 10
85
+ }
86
+ ],
87
+ "_comment": "Detect architectural decisions made by GSD/RAPID agents"
29
88
  }
30
89
  ],
31
90
  "Stop": [
@@ -41,6 +100,19 @@
41
100
  "_comment": "Architecture-sync after ADR transitions (ADR-0034)"
42
101
  }
43
102
  ],
103
+ "SessionEnd": [
104
+ {
105
+ "matcher": ".*",
106
+ "hooks": [
107
+ {
108
+ "type": "prompt",
109
+ "prompt": "Session is ending. Review the conversation for architectural decisions that were made but never documented as ADRs. Look for: technology choices (databases, frameworks, libraries), pattern selections (REST vs gRPC, monolith vs microservices), data model designs, deployment strategy changes, authentication decisions, API design choices, module boundary definitions. If you find undocumented architectural decisions, output a brief summary: 'Undocumented architectural decisions from this session:\\n- [decision 1] → /blueprint:new \"[topic]\"\\n- [decision 2] → /blueprint:new \"[topic]\"\\nRun these in your next session to formalize.' If no architectural decisions were made, stay silent.",
110
+ "timeout": 15
111
+ }
112
+ ],
113
+ "_comment": "Session-end sweep for undocumented architectural decisions"
114
+ }
115
+ ],
44
116
  "FileChanged": [
45
117
  {
46
118
  "matcher": "package\\.json|requirements\\.txt|pyproject\\.toml|Cargo\\.toml|go\\.mod",
@@ -52,6 +124,28 @@
52
124
  }
53
125
  ],
54
126
  "_comment": "Dependency-watch on package changes (ADR-0034)"
127
+ },
128
+ {
129
+ "matcher": "PLAN\\.md|RESEARCH\\.md|ROADMAP\\.md|\\.planning/",
130
+ "hooks": [
131
+ {
132
+ "type": "prompt",
133
+ "prompt": "A GSD or RAPID planning artifact was modified. If the changes include architectural decisions (technology choices, pattern selections, data model designs, deployment strategies), suggest: 'Planning artifacts contain architectural decisions. Run /blueprint:new to formalize them as ADRs before execution begins.' Only suggest for genuinely architectural content.",
134
+ "timeout": 5
135
+ }
136
+ ],
137
+ "_comment": "Detect architectural decisions in GSD/RAPID planning artifacts"
138
+ },
139
+ {
140
+ "matcher": "skills/.*\\.md|agents/.*\\.md",
141
+ "hooks": [
142
+ {
143
+ "type": "prompt",
144
+ "prompt": "A Blueprint skill or agent definition was modified. If a new skill was added or a skill was renamed, suggest: 'Run the Blueprint installer to update the CLAUDE.md command reference: npx claude-blueprint install --global' Only suggest if the change adds, removes, or renames a skill — not for content edits to existing skills.",
145
+ "timeout": 5
146
+ }
147
+ ],
148
+ "_comment": "Auto-refresh CLAUDE.md when skills are added or renamed"
55
149
  }
56
150
  ]
57
151
  }
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ // PostToolUse:Bash hook — suggest /blueprint:retro after fix commits.
3
+ // Deterministic script replaces prompt-based hook to avoid false positives
4
+ // where the LLM would explain its reasoning on non-matching commands.
5
+
6
+ let input = '';
7
+ const timeout = setTimeout(() => process.exit(0), 5000);
8
+ process.stdin.setEncoding('utf8');
9
+ process.stdin.on('data', chunk => input += chunk);
10
+ process.stdin.on('end', () => {
11
+ clearTimeout(timeout);
12
+ try {
13
+ const data = JSON.parse(input);
14
+ const toolName = data.tool_name || '';
15
+ const toolInput = data.tool_input || {};
16
+ const toolOutput = data.tool_output || '';
17
+
18
+ // Only match git commit commands
19
+ const cmd = toolInput.command || '';
20
+ if (!cmd.match(/\bgit\s+commit\b/)) {
21
+ process.exit(0);
22
+ }
23
+
24
+ // Only match if commit succeeded and message contains fix keywords
25
+ const output = typeof toolOutput === 'string' ? toolOutput : JSON.stringify(toolOutput);
26
+ if (/\b(fix|bugfix|hotfix|patch)\b/i.test(output) && !output.includes('nothing to commit')) {
27
+ const result = {
28
+ hookSpecificOutput: {
29
+ hookEventName: "PostToolUse",
30
+ additionalContext: "A bug fix was just committed. Consider running /blueprint:retro to classify the root cause and check if this warrants an ADR."
31
+ }
32
+ };
33
+ process.stdout.write(JSON.stringify(result));
34
+ }
35
+ // Otherwise: zero output = silent pass-through
36
+ } catch (e) {
37
+ process.exit(0);
38
+ }
39
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-blueprint",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "type": "module",
5
5
  "description": "Architecture Decision Records with teeth — lifecycle management, 15 architecture paradigms, DDD context scoping, DCAR forces evaluation, reflexion models, Wardley mapping, C4 diagrams, ATAM tradeoff analysis, and 19 specialized agents for Claude Code.",
6
6
  "bin": {
package/skills/fitness.md CHANGED
@@ -5,6 +5,15 @@ description: >
5
5
  that enforce architectural invariants as CI-runnable checks. Use when: "generate fitness
6
6
  functions", "architecture tests", "enforce invariants", "create architecture guards",
7
7
  "fitness functions from adrs", or after accepting ADRs with structural constraints.
8
+ arguments:
9
+ --format:
10
+ type: string
11
+ default: shell
12
+ choices: [shell, github-actions, gitlab-ci, justfile]
13
+ description: >
14
+ Output format for generated fitness functions. "shell" (default) generates standalone
15
+ bash scripts and test files. "github-actions" generates a .github/workflows/architecture.yml
16
+ workflow. "gitlab-ci" generates a .gitlab-ci.yml job. "justfile" generates a just recipe.
8
17
  ---
9
18
 
10
19
  # Architecture Fitness Functions
@@ -103,14 +112,119 @@ Create `tests/architecture/conftest.py` (or equivalent) with shared utilities:
103
112
  - `find_files(pattern, directory)` — glob for structural checks
104
113
  - `assert_no_violations(violations, adr_id, message)` — standard assertion
105
114
 
106
- ### Step 4: Present and Commit
115
+ ### Step 4: Generate Output Format
116
+
117
+ Apply the requested `--format` (default: `shell`). See the **Output Formats** section below
118
+ for the exact templates and rules for each format.
119
+
120
+ Always generate the test files from Steps 2–3 first, then wrap them in the CI/runner format.
121
+
122
+ ### Step 5: Present and Commit
107
123
 
108
124
  Show the user:
109
125
  - How many ADRs produced fitness functions
110
126
  - List of generated test files
111
- - How to run them: `pytest tests/architecture/` or equivalent
127
+ - Which output format was used and what files were created
128
+ - How to run them: `pytest tests/architecture/` or equivalent (for shell/justfile),
129
+ or "push to trigger CI" (for github-actions/gitlab-ci)
130
+
131
+ Commit: `test(architecture): generate fitness functions from [N] ADRs [format: <format>]`
132
+
133
+ ## Output Formats
134
+
135
+ After generating test files (Steps 1–3), wrap them in the requested output format.
136
+ If `--format` is omitted, default to `shell`.
137
+
138
+ ### `--format shell` (default)
139
+
140
+ Current behavior. Generate test files and a runner script at `tests/architecture/fitness.sh`:
141
+
142
+ ```bash
143
+ #!/usr/bin/env bash
144
+ set -euo pipefail
145
+
146
+ echo "=== Architecture Fitness Functions ==="
147
+ # Run the test suite for the detected framework
148
+ # e.g., pytest tests/architecture/ or go test ./tests/architecture/...
149
+ <detected_test_command>
150
+
151
+ echo "All architecture fitness functions passed."
152
+ ```
153
+
154
+ No additional CI wrapper is generated. The user runs or integrates this script manually.
155
+
156
+ ### `--format github-actions`
157
+
158
+ Generate a GitHub Actions workflow file at `.github/workflows/architecture.yml`:
159
+
160
+ ```yaml
161
+ name: Architecture Fitness
162
+ on: [push, pull_request]
163
+ jobs:
164
+ fitness:
165
+ runs-on: ubuntu-latest
166
+ steps:
167
+ - uses: actions/checkout@v4
168
+ - name: Set up runtime
169
+ # Include language-specific setup (actions/setup-python, actions/setup-node, etc.)
170
+ # based on the detected test framework from Step 2.
171
+ <setup_step>
172
+ - name: Install dependencies
173
+ run: <install_command>
174
+ - name: Run architecture fitness functions
175
+ run: bash tests/architecture/fitness.sh
176
+ ```
177
+
178
+ **Rules:**
179
+ - Always generate `tests/architecture/fitness.sh` alongside the workflow (the workflow calls it).
180
+ - Detect the project language and add the appropriate setup action (`actions/setup-python@v5`,
181
+ `actions/setup-node@v4`, `actions/setup-go@v5`, etc.).
182
+ - Add dependency installation (`pip install -r requirements.txt`, `npm ci`, `go mod download`).
183
+ - If dependencies cannot be detected, omit the install step and add a YAML comment:
184
+ `# TODO: add dependency installation for your project`.
185
+
186
+ ### `--format gitlab-ci`
187
+
188
+ Generate a GitLab CI job. If `.gitlab-ci.yml` already exists, append the job. If not, create it.
189
+
190
+ ```yaml
191
+ architecture-fitness:
192
+ stage: test
193
+ script:
194
+ - bash tests/architecture/fitness.sh
195
+ rules:
196
+ - changes:
197
+ - "src/**/*"
198
+ - "docs/adr/**/*"
199
+ ```
200
+
201
+ **Rules:**
202
+ - Always generate `tests/architecture/fitness.sh` alongside the job definition.
203
+ - Adjust the `rules.changes` paths to match the project's actual source and ADR directories
204
+ (read `state.toml` for the ADR path, detect `src/`, `lib/`, `app/`, etc. for source).
205
+ - If appending to an existing `.gitlab-ci.yml`, do not duplicate stages — check whether
206
+ `test` is already in the `stages:` list.
207
+ - Add language-specific `image:` if detectable (e.g., `image: python:3.12`, `image: node:20`).
208
+
209
+ ### `--format justfile`
210
+
211
+ Generate a `just` recipe. If a `justfile` already exists, append the recipe. If not, create one.
212
+
213
+ ```just
214
+ # Architecture fitness functions — generated by blueprint:fitness
215
+ # Re-run /blueprint:fitness --format justfile after ADR changes.
216
+ architecture-test:
217
+ #!/usr/bin/env bash
218
+ set -euo pipefail
219
+ echo "=== Architecture Fitness Functions ==="
220
+ <detected_test_command>
221
+ echo "All architecture fitness functions passed."
222
+ ```
112
223
 
113
- Commit: `test(architecture): generate fitness functions from [N] ADRs`
224
+ **Rules:**
225
+ - If appending to an existing `justfile`, add a blank line separator before the new recipe.
226
+ - Do not duplicate the recipe if `architecture-test` already exists — replace it in-place.
227
+ - The recipe body uses bash via the shebang so it works identically to the shell format.
114
228
 
115
229
  ## Updating Fitness Functions
116
230
 
package/skills/list.md CHANGED
@@ -4,13 +4,14 @@ description: >
4
4
  List all ADRs with status, date, and contextual next-action suggestions. Use when:
5
5
  "list adrs", "show decisions", "what adrs do we have", "decision status", "show accepted
6
6
  decisions", "any proposed adrs?", "list deferred". Supports filtering by status, context,
7
- view, and evidence level.
8
- Examples: "/blueprint:list", "/blueprint:list --context=payments", "/blueprint:list --view=physical".
7
+ view, and evidence level. Defaults to context-grouped display when bounded contexts are defined.
8
+ Examples: "/blueprint:list", "/blueprint:list --flat", "/blueprint:list --context=payments", "/blueprint:list --view=physical".
9
9
  ---
10
10
 
11
11
  # List ADRs
12
12
 
13
13
  Display all ADRs in a summary table with contextual suggestions for next actions.
14
+ Defaults to context-grouped display when bounded contexts are defined; use `--flat` for the traditional flat-numbered table.
14
15
 
15
16
  ## Process
16
17
 
@@ -21,7 +22,7 @@ Display all ADRs in a summary table with contextual suggestions for next actions
21
22
  2. If no directory cached, detect: `docs/adr/` → `docs/decisions/` → `adr/` → `decisions/`
22
23
  3. Glob for all ADR files (`[0-9][0-9][0-9][0-9]-*.md`)
23
24
  4. For each file, extract: number, title (from heading), status, date proposed, date decided
24
- 5. Read `contexts.toml` — extract context assignment per ADR
25
+ 5. Read `contexts.toml` — extract context assignment per ADR (Config Resolution Protocol: check `config/` then `{adr_directory}/.state/`)
25
26
  6. Read `evidence.toml` — extract evidence level per ADR
26
27
  7. Extract Views metadata if present
27
28
 
@@ -33,7 +34,65 @@ Supports multiple filter types:
33
34
  - **By view:** `--view=physical` — show only ADRs tagged with the physical view (Kruchten 4+1)
34
35
  - **By evidence level:** `--evidence=L0` — show only ADRs with unverified evidence
35
36
 
36
- ### Step 3: Display Table
37
+ ### Step 3: Determine Display Mode
38
+
39
+ Decide between context-grouped and flat display:
40
+
41
+ 1. If `--flat` flag is passed → use **flat display** (Step 4B)
42
+ 2. If `contexts.toml` exists AND defines at least one `[contexts.*]` section → use **context-grouped display** (Step 4A)
43
+ 3. Otherwise → use **flat display** (Step 4B)
44
+
45
+ ### Step 4A: Context-Grouped Display (default when contexts exist)
46
+
47
+ When bounded contexts are defined and `--flat` is not passed, group ADRs by their context assignment.
48
+
49
+ **Building the groups:**
50
+ 1. For each `[contexts.*]` section in `contexts.toml`, collect ADRs listed in its `governed_adrs` array
51
+ 2. Collect ADRs listed in `cross_cutting_adrs` into a "cross-cutting" group
52
+ 3. Any ADR not appearing in any context's `governed_adrs` or in `cross_cutting_adrs` goes into an "unmapped" group
53
+ 4. Sort groups: named contexts alphabetically by context key, then "cross-cutting", then "unmapped" (if non-empty)
54
+ 5. Within each group, sort ADRs by number ascending
55
+
56
+ **Rendering:**
57
+
58
+ ```
59
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
60
+ ADR LIST — grouped by bounded context
61
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
62
+
63
+ ## context-key (N ADRs)
64
+ | # | Title | Status | Evidence |
65
+ |------|------------------------------------|----------|----------|
66
+ | 0001 | Use ADRs for decisions | Accepted | L2 |
67
+ | 0004 | Lifecycle as state machine | Accepted | L1 |
68
+ ...
69
+
70
+ ## another-context (N ADRs)
71
+ | # | Title | Status | Evidence |
72
+ |------|------------------------------------|----------|----------|
73
+ ...
74
+
75
+ ## cross-cutting (N ADRs)
76
+ | # | Title | Status | Evidence |
77
+ |------|------------------------------------|----------|----------|
78
+ ...
79
+
80
+ ## unmapped (N ADRs)
81
+ | # | Title | Status | Evidence |
82
+ |------|------------------------------------|----------|----------|
83
+ ...
84
+ ```
85
+
86
+ - Use the context key (e.g., `lifecycle`, `analysis`) as the group heading
87
+ - Show ADR count in parentheses after the context key
88
+ - Omit the "unmapped" group entirely if there are no unmapped ADRs
89
+ - If a filter is active (status, evidence, view), apply it within each group and omit empty groups
90
+ - If `--context=X` filter is active, show only that single context group (skip context-grouped layout and show a single table for that context)
91
+ - Show total count at the bottom: "Total: N ADRs across M contexts"
92
+
93
+ ### Step 4B: Flat Display (default when no contexts, or `--flat`)
94
+
95
+ Show the original flat-numbered table sorted by ADR number:
37
96
 
38
97
  ```
39
98
  | # | Title | Status | Context | Evidence | Date |
@@ -45,7 +104,7 @@ Supports multiple filter types:
45
104
 
46
105
  If filtering, show the filter: "Showing [N] [status] ADRs (of [total] total)"
47
106
 
48
- ### Step 4: Contextual Suggestions
107
+ ### Step 5: Contextual Suggestions
49
108
 
50
109
  Append a `▶ Suggested next actions` section using the same rules as `/blueprint:help` Step 3:
51
110
 
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: blueprint:nudge
3
+ description: >
4
+ Periodic health nudge — checks project governance timestamps in state.toml and surfaces
5
+ reminders for overdue operations. Use when: "nudge", "what governance checks are overdue?",
6
+ "health nudge", "what should I run?", "governance reminders", or triggered automatically
7
+ via the SessionStart hook roughly every 20 sessions.
8
+ ---
9
+
10
+ # Periodic Health Nudge
11
+
12
+ Checks governance operation timestamps and surfaces a prioritized reminder list for
13
+ anything overdue. The quiet voice that says "hey, you haven't checked X in a while."
14
+
15
+ ## Shared Context
16
+
17
+ Read from parent `blueprint/` skill directory:
18
+ - `state.toml` — last operation timestamps (Config Resolution Protocol: check `config/` then `{adr_directory}/.state/`)
19
+ - `config/lifecycle.toml` — valid statuses (for Deferred ADR check)
20
+ - `relationships.toml` — ADR graph
21
+
22
+ ## Process
23
+
24
+ ### Step 1: Resolve Config and Read State
25
+
26
+ 1. Locate `state.toml` via Config Resolution Protocol:
27
+ - Check `config/state.toml` in the blueprint skill directory
28
+ - Fall back to `{adr_directory}/.state/state.toml`
29
+ 2. Read `[last_operations]` section — extract all timestamps
30
+ 3. Parse each timestamp as a date (empty string = never run)
31
+ 4. Compute days since each operation relative to today
32
+
33
+ ### Step 2: Locate ADR Directory
34
+
35
+ Auto-detect adr_directory from `state.toml` or scan for:
36
+ `docs/adr/` → `docs/decisions/` → `adr/` → `decisions/`
37
+
38
+ ### Step 3: Apply Nudge Rules
39
+
40
+ Evaluate each rule against the timestamps. A rule fires if the operation was never run
41
+ (timestamp is empty) or exceeds its staleness threshold.
42
+
43
+ | Rule | Operation Key | Threshold | Nudge Message |
44
+ |------|--------------|-----------|---------------|
45
+ | Evidence audit stale | `last_evidence_audit` | >90 days | "Evidence may be stale. Run `/blueprint:evidence`" |
46
+ | Compliance audit stale | `last_audit` | >60 days | "Run `/blueprint:audit` to verify ADRs are followed" |
47
+ | Architecture evaluation stale | `last_evaluation` | >90 days | "Run `/blueprint:evaluate` for a health check" |
48
+ | Drift check stale | `last_drift` | >30 days | "Run `/blueprint:drift` to check erosion trajectory" |
49
+ | Risk assessment stale | `last_risk_assessment` | >90 days | "Run `/blueprint:risk` to update the risk heat map" |
50
+ | Reflexion model stale | `last_reflect` | >60 days | "Run `/blueprint:reflect` for conformance check" |
51
+ | Strategic map stale | `last_strategic_map` | >180 days | "Run `/blueprint:map` to check strategic alignment" |
52
+ | Deferred ADRs aging | (scan ADR files) | >6 months deferred | "Deferred decisions aging. Run `/blueprint:debt`" |
53
+ | No fitness functions | (check for fitness test files) | existence check | "Run `/blueprint:fitness` to generate architecture tests" |
54
+ | ARCHITECTURE.md stale | (check file mtime) | >6 months old | "Run `/blueprint:architect` to refresh the codemap" |
55
+
56
+ ### Step 4: Check for Deferred ADR Aging
57
+
58
+ 1. Read all ADR files in the ADR directory
59
+ 2. Find any with status `Deferred`
60
+ 3. Check the `Date proposed` or `Date deferred` field
61
+ 4. If any Deferred ADR is older than 6 months, fire the deferred nudge rule
62
+
63
+ ### Step 5: Check for Fitness Functions
64
+
65
+ 1. Look for fitness function test files (typically in `tests/fitness/`, `test/fitness/`,
66
+ or referenced in `state.toml` under `last_trace`)
67
+ 2. If no fitness function files exist at all, fire the fitness nudge rule
68
+
69
+ ### Step 6: Check ARCHITECTURE.md Staleness
70
+
71
+ 1. Look for `docs/ARCHITECTURE.md` or `ARCHITECTURE.md` in the project root
72
+ 2. If it does not exist, fire the architecture nudge
73
+ 3. If it exists, check its last modification date via git log:
74
+ ```bash
75
+ git log -1 --format="%ai" -- docs/ARCHITECTURE.md ARCHITECTURE.md 2>/dev/null
76
+ ```
77
+ 4. If older than 6 months, fire the architecture nudge
78
+
79
+ ### Step 7: Display Results
80
+
81
+ Sort all fired nudges by staleness (most overdue first — "never run" operations sort
82
+ to the top, then by days overdue descending).
83
+
84
+ Display as a prioritized checklist:
85
+
86
+ ```
87
+ ## Governance Nudges
88
+
89
+ [ ] Evidence audit: never run — "Evidence may be stale. Run /blueprint:evidence"
90
+ [ ] Architecture evaluation: 142 days overdue — "Run /blueprint:evaluate for a health check"
91
+ [ ] Compliance audit: 73 days overdue — "Run /blueprint:audit to verify ADRs are followed"
92
+ [ ] Drift check: 45 days overdue — "Run /blueprint:drift to check erosion trajectory"
93
+ ```
94
+
95
+ If **no rules fire**, output:
96
+
97
+ ```
98
+ All governance checks are current.
99
+ ```
100
+
101
+ ### Step 8: Update State
102
+
103
+ Set `last_nudge` in `state.toml` `[last_operations]` to today's date (`YYYY-MM-DD`).
104
+
105
+ ## Hook Integration
106
+
107
+ This skill can be triggered:
108
+ - **Manually:** `/blueprint:nudge`
109
+ - **Automatically:** Via the `SessionStart` hook (roughly every 20 sessions)
110
+ - **From other skills:** Any skill can suggest running `/blueprint:nudge` when it detects staleness
111
+
112
+ ## Output Format
113
+
114
+ - Terminal: markdown checklist as shown above
115
+ - Keep output concise — this is a nudge, not a full report
116
+ - Each nudge line should include: the check name, how overdue it is, and the command to run
117
+ - Never block the user — nudges are suggestions, not gates
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: blueprint:onboard
3
+ description: >
4
+ Walk a new team member through the project's architecture in 5 minutes. Summarizes
5
+ key decisions, active contexts, governance mode, and what to read first. Use when:
6
+ "onboard me", "I'm new", "explain the architecture", "what should I know?",
7
+ "new developer walkthrough".
8
+ ---
9
+
10
+ # Onboard — 5-Minute Architecture Walkthrough
11
+
12
+ Give a new developer everything they need to understand this project's architecture
13
+ in a single, scannable briefing. No digging through files. No asking around. One
14
+ command, full picture.
15
+
16
+ ## Step 1: Read Project State
17
+
18
+ Read from parent `blueprint/` skill directory and project root:
19
+
20
+ - `state.toml` — ADR directory location, last operations (audit, evaluation dates)
21
+ - `relationships.toml` — how many ADRs exist, how connected they are
22
+ - `contexts.toml` — bounded contexts and owners
23
+ - `evidence.toml` — overall evidence health (L0/L1/L2 counts)
24
+ - `governance.toml` — current governance mode
25
+ - `docs/ARCHITECTURE.md` (if exists) — extract the codemap summary
26
+ - All accepted ADR files — count, titles, categories, severity
27
+
28
+ If `state.toml` does not exist or the ADR directory is empty (no ADRs found), skip
29
+ to the **No ADRs** fallback at the bottom.
30
+
31
+ ## Step 2: Generate the Onboarding Briefing
32
+
33
+ Produce the briefing in this exact format:
34
+
35
+ ```
36
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
37
+ BLUEPRINT ► NEW DEVELOPER ONBOARDING
38
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
39
+
40
+ Welcome. Here's what you need to know about this project's architecture.
41
+
42
+ ## The Big Picture
43
+ [2-3 sentence summary from ARCHITECTURE.md codemap, or from the highest-severity ADRs]
44
+
45
+ ## Key Decisions ([N] total ADRs)
46
+ [Top 5 most important ADRs by severity — title + 1-line summary of the decision]
47
+
48
+ 1. ADR-NNNN: [title] — [decision in one sentence]
49
+ 2. ...
50
+
51
+ ## Domain Structure
52
+ [From contexts.toml — list bounded contexts with owners]
53
+ - [Context]: [description] (owner: [name], [N] ADRs)
54
+
55
+ ## Governance
56
+ Mode: [lightweight/advised/governed/formal]
57
+ [1-sentence explanation of what this means for the new developer]
58
+
59
+ ## Health Status
60
+ Last audit: [date or NEVER]
61
+ Last evaluation: [date or NEVER]
62
+ Evidence health: [L2/L1/L0 counts]
63
+ Decision debt: [N] deferred decisions
64
+
65
+ ## What to Read First
66
+ 1. docs/ARCHITECTURE.md — bird's-eye codemap
67
+ 2. docs/adr/[most important ADR] — the foundational decision
68
+ 3. docs/adr/[second most important] — the key technology choice
69
+
70
+ ## Quick Commands for New Developers
71
+ - /blueprint:eli5 — plain English explanation of all decisions
72
+ - /blueprint:eli5 N — explain a specific ADR
73
+ - /blueprint:list — see all architectural decisions
74
+ - /blueprint:scope list — see which team/context owns what
75
+ - /blueprint:diagram — generate architecture diagrams
76
+ ```
77
+
78
+ ### Field rules
79
+
80
+ - **The Big Picture**: If `ARCHITECTURE.md` exists, pull the first 2-3 sentences from its
81
+ codemap or overview section. If it does not exist, synthesize from the highest-severity
82
+ accepted ADRs.
83
+ - **Key Decisions**: Sort accepted ADRs by severity (critical > high > medium > low). Show
84
+ the top 5. If fewer than 5 exist, show all. Each entry is the ADR number, title, and
85
+ the core decision condensed to one sentence.
86
+ - **Domain Structure**: If `contexts.toml` has no entries, show "No bounded contexts defined
87
+ yet. Run `/blueprint:scope discover` to infer them from the codebase."
88
+ - **Governance**: Read the mode from `governance.toml`. Explain what it means practically:
89
+ - `lightweight` — "You can propose and accept ADRs without approvals."
90
+ - `advised` — "You must seek advice before proposing ADRs (Advice Process)."
91
+ - `governed` — "ADRs require N approvals before acceptance."
92
+ - `formal` — "ADRs go through phase-based gates with formal review."
93
+ If `governance.toml` does not exist, default to "lightweight".
94
+ - **Health Status**: Pull last audit/evaluation dates from `state.toml` operations. Count
95
+ deferred ADRs for decision debt. Pull evidence level counts from `evidence.toml`.
96
+ - **What to Read First**: Pick the two most important ADRs (highest severity, or earliest
97
+ foundational decisions if severities are equal). Always list `ARCHITECTURE.md` first if
98
+ it exists; if it does not, note "Not yet generated. Run `/blueprint:architect` to create it."
99
+
100
+ ## Step 3: No ADRs Fallback
101
+
102
+ If no ADRs exist, show this shorter message instead:
103
+
104
+ ```
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
+ BLUEPRINT ► NEW DEVELOPER ONBOARDING
107
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
108
+
109
+ This project hasn't recorded any architectural decisions yet.
110
+
111
+ That's not necessarily bad — but it means tribal knowledge is the only
112
+ documentation of why things are the way they are.
113
+
114
+ ### Get Started
115
+ Run `/blueprint:init` to bootstrap the ADR system. It will:
116
+ - Scan your codebase for existing architectural patterns
117
+ - Infer decisions that have already been made implicitly
118
+ - Create the ADR directory structure and initial records
119
+
120
+ ### Why Bother?
121
+ - New developers (like you) won't have to ask "why did we do it this way?"
122
+ - Decisions won't get relitigated every quarter
123
+ - The architecture stays intentional instead of accidental
124
+
125
+ Run `/blueprint:init` and then `/blueprint:onboard` again for the full briefing.
126
+ ```
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: blueprint:quickstart
3
+ description: >
4
+ Generate foundational ADR starter sets for common technology stacks. Creates 5-8 Proposed ADRs
5
+ covering decisions every project of that type needs to make. Auto-detects stack from project
6
+ manifest files if no argument given.
7
+ Examples: "/blueprint:quickstart react-node", "/blueprint:quickstart python-fastapi",
8
+ "/blueprint:quickstart" (auto-detect).
9
+ ---
10
+
11
+ # Quick-Start ADR Generator
12
+
13
+ Generate a set of foundational Architecture Decision Records for a technology stack, giving the
14
+ project a decision baseline from day one.
15
+
16
+ ## Shared Context
17
+
18
+ Before starting, read these files from the blueprint skill directory:
19
+
20
+ - `config/quickstart-templates.toml` — stack definitions and ADR stubs
21
+ - `config/lifecycle.toml` — valid statuses (generated ADRs start as Proposed)
22
+ - `config/taxonomy.toml` — decision categories, severity levels
23
+ - `config/state.toml` — ADR directory location (if previously detected)
24
+ - `config/relationships.toml` — existing ADR relationships (for impact awareness)
25
+ - `agents/persona.md` — your personality
26
+ - `docs/adr/template.md` — the ADR template format (from the ADR directory)
27
+
28
+ ## Directory Detection
29
+
30
+ If `state.toml` has an `adr_directory`, use it. Otherwise detect:
31
+ 1. `docs/adr/` (preferred)
32
+ 2. `docs/decisions/`
33
+ 3. `adr/`
34
+ 4. `decisions/`
35
+
36
+ If found, update `state.toml` with the detected path.
37
+
38
+ ## Arguments
39
+
40
+ The skill accepts a single optional argument: a stack identifier.
41
+
42
+ Valid stack identifiers are the keys under `[stacks.*]` in `config/quickstart-templates.toml`
43
+ (e.g., `react-node`, `python-fastapi`, `nextjs`, `go-api`, `generic`).
44
+
45
+ If no argument is provided, auto-detect the stack (see below).
46
+
47
+ ## Process
48
+
49
+ ### Step 1: Determine the Stack
50
+
51
+ If the user provided a stack identifier argument:
52
+ 1. Look it up in `config/quickstart-templates.toml` under `stacks.<identifier>`.
53
+ 2. If not found, list available stacks and ask the user to pick one.
54
+
55
+ If no argument was provided, auto-detect:
56
+ 1. Check for `package.json` in the project root. If found, read its `dependencies` and
57
+ `devDependencies` keys. Match dependency names against each stack's `detect` array.
58
+ 2. Check for `requirements.txt` or `pyproject.toml` in the project root. If found, scan for
59
+ package names matching `detect` arrays.
60
+ 3. Check for `go.mod` in the project root. If found, match against stacks with `go.mod` in
61
+ their `detect` array.
62
+ 4. If multiple stacks match, pick the most specific one (most `detect` hits). If tied, present
63
+ the options and ask the user to choose.
64
+ 5. If nothing matches, fall back to `generic` and inform the user.
65
+
66
+ ### Step 2: Determine Next ADR Sequence Number
67
+
68
+ Glob `[0-9][0-9][0-9][0-9]-*.md` in the ADR directory to find existing ADRs. The next sequence
69
+ number is `max(existing) + 1`, or `0001` if no ADRs exist yet. Each generated ADR increments
70
+ the sequence by one.
71
+
72
+ ### Step 3: Present the ADR Plan
73
+
74
+ Before writing anything, present the full list of ADRs that will be generated. Format as a
75
+ numbered table:
76
+
77
+ ```
78
+ Stack: {stack.label}
79
+
80
+ The following ADRs will be generated as Proposed:
81
+
82
+ | # | ADR ID | Title | Category | Recommended |
83
+ |------|-----------|------------------------------------|--------------------|---------------------|
84
+ | 1 | ADR-NNNN | {title} | {category} | {recommended} |
85
+ | 2 | ADR-NNNN | {title} | {category} | {recommended} |
86
+ | ... | ... | ... | ... | ... |
87
+
88
+ Shall I generate these? You can remove items by number, or say "go" to proceed.
89
+ ```
90
+
91
+ Wait for user confirmation. If the user removes items, adjust. Do NOT proceed without explicit
92
+ confirmation.
93
+
94
+ ### Step 4: Generate ADR Files
95
+
96
+ For each confirmed ADR stub from the template, create a full ADR file following the template at
97
+ `docs/adr/template.md`. Expand each stub into a complete ADR:
98
+
99
+ **Filename:** `{NNNN}-{kebab-case-title}.md` in the ADR directory.
100
+
101
+ **Populate the template as follows:**
102
+
103
+ - **Title line:** `# ADR-{NNNN}: {title}`
104
+ - **Status:** `Proposed`
105
+ - **Date proposed:** today's date (YYYY-MM-DD)
106
+ - **Date decided:** *(leave blank)*
107
+ - **Deciders:** `quickstart generator — requires team review`
108
+ - **Category field in metadata:** use the `category` from the stub
109
+ - **Context section:** expand the 2-sentence context from the stub into a proper paragraph.
110
+ Add relevant technical details — why this decision matters for the specific stack, what
111
+ forces are at play. Keep it to 3-5 sentences.
112
+ - **Options Considered:** create an entry for the `recommended` option and each `alternative`.
113
+ For each option, write 2-3 bullet-point pros and 1-2 bullet-point cons. These should be
114
+ genuinely useful, not filler.
115
+ - **Decision:** fill in the DCAR template sentence with the recommended option, but note that
116
+ this is a quickstart default pending team review.
117
+ - **Rationale:** 2-3 sentences on why the recommended option is the default. Be honest about
118
+ tradeoffs.
119
+ - **Consequences (Positive):** 2-3 items
120
+ - **Consequences (Negative):** 1-2 items (every decision has downsides; don't pretend otherwise)
121
+ - **Consequences (Risks):** 1-2 items
122
+ - **References:** leave as `- (pending research)`
123
+
124
+ ### Step 5: Update State
125
+
126
+ After writing all ADR files:
127
+
128
+ 1. Update the ADR index if one exists (check for `index.md` or `README.md` in the ADR directory).
129
+ 2. Report what was created:
130
+
131
+ ```
132
+ Generated {N} Proposed ADRs for stack "{label}":
133
+
134
+ ADR-NNNN: {title} → {filepath}
135
+ ADR-NNNN: {title} → {filepath}
136
+ ...
137
+
138
+ Next steps:
139
+ - Review each ADR with your team
140
+ - Run /blueprint:review {N} to challenge any decision before accepting
141
+ - Run /blueprint:transition accept {N} once the team agrees
142
+ - These are quickstart defaults — override the recommended option if your context differs
143
+ ```
144
+
145
+ ## Important Rules
146
+
147
+ - **Never auto-accept.** All generated ADRs must be Proposed status. The team decides.
148
+ - **Never skip confirmation.** Always present the plan and wait for the user to confirm.
149
+ - **Be honest in pros/cons.** Every option has real tradeoffs. Do not write marketing copy.
150
+ - **Respect existing ADRs.** If an existing accepted ADR already covers a topic, skip that
151
+ stub and note the overlap to the user.
152
+ - **Use the persona.** You are a cranky senior engineer. Be direct, opinionated, and useful.
153
+ The quickstart defaults are your recommendations, but you respect that the team might
154
+ disagree.
package/src/claude-md.js CHANGED
@@ -7,32 +7,65 @@ const SECTION = `${BEGIN}
7
7
  ## blueprint
8
8
 
9
9
  Architecture Decision Records with teeth. Cranky senior engineer persona.
10
+ 39 skills, 21 agents, 15 architecture paradigms.
10
11
 
11
- ### Commands
12
+ ### Core Commands
12
13
 
13
14
  | Command | What it does |
14
15
  |---------|-------------|
15
16
  | \`/blueprint:help\` | Full reference + contextual suggestions |
16
- | \`/blueprint:list\` | ADR table + next actions |
17
+ | \`/blueprint:list\` | ADR table with context, evidence, and filters |
17
18
  | \`/blueprint:new "topic"\` | Create ADR (add \`--research\` for evidence) |
18
- | \`/blueprint:review N\` | Devil's advocate challenge before acceptance |
19
+ | \`/blueprint:advise "topic"\` | Architecture Advice Process before proposing |
20
+ | \`/blueprint:challenge N\` | DCAR forces evaluation — weigh arguments |
21
+ | \`/blueprint:review N\` | Devil's advocate adversarial challenge |
19
22
  | \`/blueprint:transition accept N\` | Accept / reject / defer / deprecate |
20
23
  | \`/blueprint:search "term"\` | Find decisions by topic |
21
- | \`/blueprint:impact N\` | Check for cross-ADR conflicts |
24
+
25
+ ### Analysis
26
+
27
+ | Command | What it does |
28
+ |---------|-------------|
29
+ | \`/blueprint:impact N\` | Cross-ADR conflict detection |
22
30
  | \`/blueprint:audit\` | Verify codebase follows accepted decisions |
31
+ | \`/blueprint:reflect\` | Reflexion model — formal conformance check |
32
+ | \`/blueprint:evidence\` | Audit epistemic status + temporal validity |
33
+ | \`/blueprint:tradeoff\` | ATAM utility tree — sensitivity + tradeoff points |
34
+ | \`/blueprint:risk\` | Risk heat map (complexity × churn ÷ governance) |
35
+ | \`/blueprint:trace\` | ADR-to-fitness-function traceability |
23
36
  | \`/blueprint:retro\` | Post-fix retrospective (band-aid or systemic?) |
37
+
38
+ ### Strategic & Governance
39
+
40
+ | Command | What it does |
41
+ |---------|-------------|
42
+ | \`/blueprint:scope\` | DDD bounded context scoping for ADRs |
43
+ | \`/blueprint:map\` | Wardley Map — strategic build-vs-buy analysis |
44
+ | \`/blueprint:radar\` | Technology Radar (Adopt/Trial/Assess/Hold) |
45
+ | \`/blueprint:govern\` | Configure governance mode (lightweight → formal) |
24
46
  | \`/blueprint:evaluate\` | 5-agent architecture evaluation team |
25
- | \`/blueprint:rearchitect "topic"\` | Research + supersede a decision |
26
47
 
27
- ### Architecture Evaluation Dimensions
48
+ ### Documentation
49
+
50
+ | Command | What it does |
51
+ |---------|-------------|
52
+ | \`/blueprint:architect\` | Generate/update ARCHITECTURE.md |
53
+ | \`/blueprint:diagram\` | Auto-generate C4 diagrams from ADR graph |
54
+ | \`/blueprint:eli5\` | Plain English explanation of ADRs |
55
+ | \`/blueprint:export arc42\` | Export to arc42 12-section format |
56
+ | \`/blueprint:views\` | Tag ADRs with 4+1 architectural views |
57
+ | \`/blueprint:digest\` | Non-technical stakeholder summary |
58
+ | \`/blueprint:timeline\` | Architecture evolution narrative |
28
59
 
29
- | Dimension | Command |
30
- |-----------|---------|
31
- | Structural consistency | \`/blueprint:evaluate consistency\` |
32
- | Bug surface mapping | \`/blueprint:evaluate bugs\` |
33
- | Long-term maintainability | \`/blueprint:evaluate maintainability\` |
34
- | Testing strategy | \`/blueprint:evaluate testing\` |
35
- | Conway's Law alignment | \`/blueprint:evaluate conways\` |
60
+ ### Continuous Governance
61
+
62
+ | Command | What it does |
63
+ |---------|-------------|
64
+ | \`/blueprint:fitness\` | Generate CI-runnable architecture tests |
65
+ | \`/blueprint:drift\` | Detect gradual architecture erosion |
66
+ | \`/blueprint:debt\` | Track decision debt + evidence expiry |
67
+ | \`/blueprint:guard\` | Pre-commit invariant check |
68
+ | \`/blueprint:federate\` | Cross-repo ADR aggregation |
36
69
  ${END}`;
37
70
 
38
71
  export async function updateClaudeMd(claudeMdPath) {