claude-blueprint 1.0.0
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.
- package/.claude-plugin/plugin.json +26 -0
- package/LICENSE +21 -0
- package/README.md +387 -0
- package/agents/adr-architect-cartographer.md +179 -0
- package/agents/adr-bug-surface-mapper.md +154 -0
- package/agents/adr-compliance-auditor.md +146 -0
- package/agents/adr-consistency-auditor.md +131 -0
- package/agents/adr-conways-law-analyzer.md +170 -0
- package/agents/adr-devils-advocate.md +161 -0
- package/agents/adr-impact-analyzer.md +135 -0
- package/agents/adr-maintainability-assessor.md +162 -0
- package/agents/adr-researcher.md +134 -0
- package/agents/adr-retrospective.md +204 -0
- package/agents/adr-testing-strategy-evaluator.md +164 -0
- package/agents/persona.md +36 -0
- package/bin/cli.js +33 -0
- package/commands/architect.md +66 -0
- package/commands/audit.md +41 -0
- package/commands/blueprint.md +63 -0
- package/commands/debt.md +102 -0
- package/commands/digest.md +106 -0
- package/commands/drift.md +104 -0
- package/commands/eli5.md +149 -0
- package/commands/evaluate.md +61 -0
- package/commands/fitness.md +119 -0
- package/commands/guard.md +102 -0
- package/commands/health.md +139 -0
- package/commands/help.md +119 -0
- package/commands/hooks.md +131 -0
- package/commands/impact.md +38 -0
- package/commands/init.md +229 -0
- package/commands/list.md +51 -0
- package/commands/new.md +74 -0
- package/commands/rearchitect.md +45 -0
- package/commands/retro.md +50 -0
- package/commands/review.md +50 -0
- package/commands/search.md +28 -0
- package/commands/status.md +189 -0
- package/commands/timeline.md +113 -0
- package/commands/transition.md +83 -0
- package/config/lifecycle.toml +71 -0
- package/config/relationships.toml +22 -0
- package/config/state.toml +21 -0
- package/config/taxonomy.toml +118 -0
- package/package.json +27 -0
- package/src/claude-md.js +57 -0
- package/src/install.js +83 -0
- package/src/paths.js +25 -0
- package/src/verify.js +95 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "blueprint",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Architecture Decision Records with teeth — lifecycle management, devil's advocate review, architecture evaluation team, post-fix retrospectives, and compliance auditing. All with a cranky senior engineer persona.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "pragnition"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/pragnition/blueprint",
|
|
9
|
+
"repository": "https://github.com/pragnition/blueprint",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"adr",
|
|
13
|
+
"architecture",
|
|
14
|
+
"decisions",
|
|
15
|
+
"review",
|
|
16
|
+
"evaluation",
|
|
17
|
+
"compliance",
|
|
18
|
+
"audit",
|
|
19
|
+
"retrospective",
|
|
20
|
+
"conways-law",
|
|
21
|
+
"maintainability",
|
|
22
|
+
"testing-strategy",
|
|
23
|
+
"bug-surface",
|
|
24
|
+
"consistency"
|
|
25
|
+
]
|
|
26
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 pragnition
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
# blueprint
|
|
2
|
+
|
|
3
|
+
*"The best time to plant a tree was twenty years ago. The second best time is before you write the code."*
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Architecture Decision Records with teeth. A Claude Code plugin that treats architectural decisions as first-class engineering artifacts — researched before they're proposed, challenged before they're accepted, audited after they're implemented, and revisited when the world changes.
|
|
8
|
+
|
|
9
|
+
Every agent speaks with the voice of a senior engineer who has watched too many "temporary" decisions become permanent load-bearing walls.
|
|
10
|
+
|
|
11
|
+
## The Problem Blueprint Solves
|
|
12
|
+
|
|
13
|
+
> "We shape our buildings; thereafter they shape us." — Winston Churchill
|
|
14
|
+
|
|
15
|
+
Software architecture is not a document. It is the set of decisions that constrain all future decisions. Every technology choice, every boundary drawn, every pattern adopted closes some doors and opens others. The tragedy of most software projects is not that these decisions are made poorly — it is that they are made *invisibly*. A decision made in a Slack thread at 4pm on a Friday becomes the foundation of a system that runs for a decade.
|
|
16
|
+
|
|
17
|
+
Architecture Decision Records (ADRs) were invented to solve this. But in practice, most ADR implementations fail for the same reason most New Year's resolutions fail: there is no enforcement mechanism. Writing the decision down is the easy part. *Researching it before committing, challenging it before accepting, verifying that the codebase actually follows it, and revisiting it when circumstances change* — that's where ADR processes quietly die.
|
|
18
|
+
|
|
19
|
+
Blueprint doesn't let them die.
|
|
20
|
+
|
|
21
|
+
## Philosophical Foundations
|
|
22
|
+
|
|
23
|
+
### On the Nature of Decisions
|
|
24
|
+
|
|
25
|
+
Blueprint is built on a specific epistemological claim: **architectural decisions are hypotheses, not declarations**. When you write "use PostgreSQL for primary storage," you are not stating a fact — you are stating a bet. You are betting that PostgreSQL's properties (ACID guarantees, ecosystem maturity, JSONB flexibility) will serve your needs better than the alternatives, given your constraints, for the foreseeable future.
|
|
26
|
+
|
|
27
|
+
Like any hypothesis, an architectural decision should be:
|
|
28
|
+
- **Falsifiable** — there must be conditions under which it would be wrong
|
|
29
|
+
- **Evidence-based** — supported by research, not just preference
|
|
30
|
+
- **Challengeable** — subjected to adversarial review before acceptance
|
|
31
|
+
- **Revisable** — updated when the evidence changes
|
|
32
|
+
|
|
33
|
+
This is why blueprint has a devil's advocate, not just a reviewer. The [Hegelian dialectic](https://en.wikipedia.org/wiki/Dialectic#Hegelian_dialectic) — thesis, antithesis, synthesis — is not academic decoration. It is the mechanism by which decisions become robust. A decision that has never been challenged is a decision that has never been tested.
|
|
34
|
+
|
|
35
|
+
### On Conway's Law
|
|
36
|
+
|
|
37
|
+
> "Any organization that designs a system will produce a design whose structure is a copy of the organization's communication structure." — Melvin Conway, 1967
|
|
38
|
+
|
|
39
|
+
Conway's observation is not a suggestion to be followed or a bug to be fixed. It is a *law of nature* — as inescapable as gravity. You can either design your architecture to align with how your team actually communicates, or you can watch your architecture slowly reshape itself to match the communication structure anyway, usually in the worst possible way.
|
|
40
|
+
|
|
41
|
+
Blueprint's Conway's Law analyzer doesn't ask "does your architecture match your org chart?" It asks "does your architecture match how people *actually work*?" — because the org chart is a theory, and git blame is the data.
|
|
42
|
+
|
|
43
|
+
### On Technical Debt as Deferred Decisions
|
|
44
|
+
|
|
45
|
+
Cunningham's original metaphor of [technical debt](https://wiki.c2.com/?TechnicalDebt) was specifically about the gap between what the code *does* and what the team now *understands*. It was not about sloppy code — it was about decisions that were correct at the time but have been superseded by new understanding.
|
|
46
|
+
|
|
47
|
+
Blueprint's retrospective agent (`/blueprint:retro`) operationalizes this insight. After every fix, it asks: was this a band-aid on a symptom, or did it address the structural cause? If the same root cause class keeps producing bugs, the architecture has a gap that no amount of patching will close. The gap needs a *decision* — an ADR that addresses the structural issue — not another fix.
|
|
48
|
+
|
|
49
|
+
### On the Cranky Senior Engineer
|
|
50
|
+
|
|
51
|
+
> "I'm not being difficult. I'm being precise. There's a difference, and the fact that you can't tell is part of the problem."
|
|
52
|
+
|
|
53
|
+
Blueprint's agents share a persona: the senior engineer who has been paged at 3 AM because someone thought shared mutable state was "simpler." This is not aesthetic — it is functional.
|
|
54
|
+
|
|
55
|
+
Research on [code review effectiveness](https://www.microsoft.com/en-us/research/publication/code-reviews-do-not-find-bugs/) shows that polite, hedging feedback ("you might want to consider...") is systematically ignored, while direct, specific feedback ("this should be const — it's never reassigned") produces action. The persona ensures that findings are stated with the clarity and conviction required to actually change behavior.
|
|
56
|
+
|
|
57
|
+
The persona is blunt but not cruel. It respects the developer, not the code. It backs every opinion with evidence. And it credits good work when it sees it — briefly, then moves on to what isn't good.
|
|
58
|
+
|
|
59
|
+
## How Blueprint Works
|
|
60
|
+
|
|
61
|
+
### The Decision Lifecycle
|
|
62
|
+
|
|
63
|
+
Every architectural decision passes through a formal lifecycle encoded as a [finite state machine](https://en.wikipedia.org/wiki/Finite-state_machine) in `config/lifecycle.toml`:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
┌──────────┐
|
|
67
|
+
│ Proposed │
|
|
68
|
+
└────┬─────┘
|
|
69
|
+
│
|
|
70
|
+
┌──────┴──────┐
|
|
71
|
+
│ Review │ ← devil's advocate challenges here
|
|
72
|
+
└──────┬──────┘
|
|
73
|
+
│
|
|
74
|
+
┌───────────┼───────────┐
|
|
75
|
+
▼ ▼ ▼
|
|
76
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
77
|
+
│ Accepted │ │ Rejected │ │ Deferred │
|
|
78
|
+
└────┬─────┘ └──────────┘ └─────┬────┘
|
|
79
|
+
│ │
|
|
80
|
+
│ (trigger met) │
|
|
81
|
+
│◄─────────────────────────┘
|
|
82
|
+
│
|
|
83
|
+
┌────┴──────────────┐
|
|
84
|
+
▼ ▼
|
|
85
|
+
┌──────────────┐ ┌──────────────┐
|
|
86
|
+
│ Deprecated │ │ Superseded │
|
|
87
|
+
│ │ │ by ADR-NNNN │
|
|
88
|
+
└──────────────┘ └──────────────┘
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Transitions are validated against the state machine. You cannot accept a rejected ADR (create a new one). You cannot supersede a proposed ADR (decide on it first). You cannot deprecate something that was never accepted. These rules are not enforced by prose — they are enforced by data.
|
|
92
|
+
|
|
93
|
+
### The Agent Architecture
|
|
94
|
+
|
|
95
|
+
Blueprint decomposes architectural governance into orthogonal concerns, each handled by a specialized agent:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
┌─────────────────────────────────────────────────────────┐
|
|
99
|
+
│ BLUEPRINT ROUTER │
|
|
100
|
+
│ (thin dispatcher, 48 lines) │
|
|
101
|
+
└───────┬──────┬──────┬──────┬──────┬──────────────────────┘
|
|
102
|
+
│ │ │ │ │ │
|
|
103
|
+
▼ ▼ ▼ ▼ ▼ ▼
|
|
104
|
+
┌─────┐┌─────┐┌─────┐┌─────┐┌─────┐┌─────┐
|
|
105
|
+
│ new ││ rev ││ eval││retro││audit││ ... │ ← 15 focused skills
|
|
106
|
+
└──┬──┘└──┬──┘└──┬──┘└──┬──┘└──┬──┘└─────┘
|
|
107
|
+
│ │ │ │ │
|
|
108
|
+
▼ ▼ ▼ ▼ ▼
|
|
109
|
+
┌──────────────────────────────────────────┐
|
|
110
|
+
│ AGENT POOL (12 agents) │
|
|
111
|
+
│ │
|
|
112
|
+
│ researcher · devil's advocate · impact │
|
|
113
|
+
│ compliance · consistency · bug surface │
|
|
114
|
+
│ maintainability · testing · conways │
|
|
115
|
+
│ retrospective · cartographer │
|
|
116
|
+
│ │
|
|
117
|
+
│ ┌────────────────────────────────────┐ │
|
|
118
|
+
│ │ SHARED PERSONA (persona.md) │ │
|
|
119
|
+
│ │ cranky senior engineer, 20 years │ │
|
|
120
|
+
│ └────────────────────────────────────┘ │
|
|
121
|
+
└──────────────────────────────────────────┘
|
|
122
|
+
│ │ │ │
|
|
123
|
+
▼ ▼ ▼ ▼
|
|
124
|
+
┌──────────────────────────────────────────┐
|
|
125
|
+
│ CONFIG DSL (TOML) │
|
|
126
|
+
│ │
|
|
127
|
+
│ lifecycle.toml ← state machine │
|
|
128
|
+
│ taxonomy.toml ← classifications │
|
|
129
|
+
│ state.toml ← session memory │
|
|
130
|
+
│ relationships.toml ← dependency graph │
|
|
131
|
+
└──────────────────────────────────────────┘
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
This is a deliberate application of the [Single Responsibility Principle](https://en.wikipedia.org/wiki/Single-responsibility_principle) at the agent level. The researcher doesn't review. The reviewer doesn't audit. The auditor doesn't evaluate. Each agent has one job and does it with the depth that comes from focus.
|
|
135
|
+
|
|
136
|
+
### The Config DSL
|
|
137
|
+
|
|
138
|
+
Blueprint encodes its domain knowledge as structured TOML rather than prose instructions. This is an application of the principle that **data outlives code** — when the lifecycle rules, root cause categories, or evaluation dimensions need to change, you edit a config file, not an agent prompt.
|
|
139
|
+
|
|
140
|
+
| Config | What it encodes | Why it matters |
|
|
141
|
+
|--------|----------------|----------------|
|
|
142
|
+
| `lifecycle.toml` | Status × Transition × Requirement matrix | Agents validate transitions against data, not English |
|
|
143
|
+
| `taxonomy.toml` | Root cause categories, eval dimensions, severity levels | Classification is consistent across agents and sessions |
|
|
144
|
+
| `state.toml` | Last audit/evaluation/retro dates, ADR directory | Contextual suggestions without re-scanning every time |
|
|
145
|
+
| `relationships.toml` | ADR dependency graph (edges + types) | Impact analysis is incremental, not O(n^2) every time |
|
|
146
|
+
|
|
147
|
+
This is a lightweight [domain-specific language](https://en.wikipedia.org/wiki/Domain-specific_language) — not a general-purpose programming language, but a structured vocabulary for expressing architectural governance concepts.
|
|
148
|
+
|
|
149
|
+
## Commands
|
|
150
|
+
|
|
151
|
+
### Setup
|
|
152
|
+
|
|
153
|
+
| Command | Agent(s) | Purpose |
|
|
154
|
+
|---------|----------|---------|
|
|
155
|
+
| `/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 |
|
|
156
|
+
|
|
157
|
+
`/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.
|
|
158
|
+
|
|
159
|
+
### Lifecycle
|
|
160
|
+
|
|
161
|
+
| Command | Agent(s) | Purpose |
|
|
162
|
+
|---------|----------|---------|
|
|
163
|
+
| `/blueprint:new "topic"` | — | Create an ADR from interview |
|
|
164
|
+
| `/blueprint:new --research "topic"` | researcher | Evidence-backed option analysis, then create |
|
|
165
|
+
| `/blueprint:list` | — | Status table + contextual next actions |
|
|
166
|
+
| `/blueprint:review N` | devil's advocate | Challenge across 5 dimensions before acceptance |
|
|
167
|
+
| `/blueprint:transition accept N` | — | Direct lifecycle transitions |
|
|
168
|
+
| `/blueprint:search "term"` | — | Find decisions by topic + relationship graph |
|
|
169
|
+
| `/blueprint:help` | — | Full reference + context-aware suggestions |
|
|
170
|
+
|
|
171
|
+
### Analysis
|
|
172
|
+
|
|
173
|
+
| Command | Agent(s) | Purpose |
|
|
174
|
+
|---------|----------|---------|
|
|
175
|
+
| `/blueprint:impact N` | impact analyzer | Cross-ADR conflict and dependency detection |
|
|
176
|
+
| `/blueprint:audit` | compliance auditor | Verify codebase follows accepted decisions |
|
|
177
|
+
| `/blueprint:retro` | retrospective | Post-fix: band-aid or systemic? Verified against sources. |
|
|
178
|
+
| `/blueprint:rearchitect "topic"` | researcher + impact | Research → draft → impact check → supersede |
|
|
179
|
+
|
|
180
|
+
### Architecture Evaluation Team
|
|
181
|
+
|
|
182
|
+
| Command | Agent(s) | Focus |
|
|
183
|
+
|---------|----------|-------|
|
|
184
|
+
| `/blueprint:evaluate` | **all 5 in parallel** | Unified architecture health report |
|
|
185
|
+
| `/blueprint:evaluate consistency` | consistency auditor | Pattern adherence, naming, layering, dependency direction |
|
|
186
|
+
| `/blueprint:evaluate bugs` | bug surface mapper | Complexity hotspots, coupling, missing boundaries |
|
|
187
|
+
| `/blueprint:evaluate maintainability` | maintainability assessor | Dependencies, abstractions, change amplification, debt |
|
|
188
|
+
| `/blueprint:evaluate testing` | testing evaluator | Pyramid health, anti-pattern tests, risk-aligned coverage |
|
|
189
|
+
| `/blueprint:evaluate conways` | Conway's Law analyzer | Ownership alignment, friction points, scaling readiness |
|
|
190
|
+
|
|
191
|
+
The full evaluation spawns all 5 agents in parallel, synthesizes an executive summary with a health score (STRONG / ADEQUATE / CONCERNING / CRITICAL), and auto-drafts Proposed ADRs for the most critical findings.
|
|
192
|
+
|
|
193
|
+
### Documentation
|
|
194
|
+
|
|
195
|
+
| Command | Agent(s) | Purpose |
|
|
196
|
+
|---------|----------|---------|
|
|
197
|
+
| `/blueprint:architect` | cartographer | Generate or update `docs/ARCHITECTURE.md` — bird's-eye codemap following [matklad's philosophy](https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html) |
|
|
198
|
+
| `/blueprint:eli5` | — | Explain the entire architectural landscape in plain English — grouped by theme, no jargon, 30-second version at the end |
|
|
199
|
+
| `/blueprint:eli5 N` | — | Explain a single ADR with analogies, expanded acronyms, and "what this means for you" consequences |
|
|
200
|
+
|
|
201
|
+
The eli5 commands exist because ADRs are written for the people who make decisions, not the people who live with them. `/blueprint:eli5` translates architecture-speak into language that any developer — or any smart person who isn't a developer — can understand. Every acronym gets expanded. Every technical term gets a concrete analogy. Every decision gets a "so what?"
|
|
202
|
+
|
|
203
|
+
### System
|
|
204
|
+
|
|
205
|
+
| Command | Agent(s) | Purpose |
|
|
206
|
+
|---------|----------|---------|
|
|
207
|
+
| `/blueprint:status` | — | Governance dashboard — terminal summary + interactive HTML with knowledge graph, timeline, metrics, and debt table |
|
|
208
|
+
| `/blueprint:health` | — | Self-diagnostic — 8 consistency checks (index sync, supersession chains, graph integrity, staleness) with auto-repair |
|
|
209
|
+
| `/blueprint:hooks` | — | Configure automatic triggers — pre-commit guard, retro-suggest, architecture-sync, dependency-watch, periodic-health |
|
|
210
|
+
| `/blueprint:hooks install all` | — | Enable all 5 automation hooks in one command |
|
|
211
|
+
|
|
212
|
+
`/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.
|
|
213
|
+
|
|
214
|
+
`/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.
|
|
215
|
+
|
|
216
|
+
`/blueprint:hooks` closes the adoption gap. Five configurable hooks embed blueprint into the development workflow so architectural governance happens automatically:
|
|
217
|
+
|
|
218
|
+
| Hook | When it fires | What it does | Default |
|
|
219
|
+
|------|--------------|-------------|---------|
|
|
220
|
+
| `guard` | Before any commit | Check staged files against ADR invariants | Off (opt-in) |
|
|
221
|
+
| `retro-suggest` | After fix workflows | Suggest `/blueprint:retro` | On |
|
|
222
|
+
| `architecture-sync` | After ADR transitions | Suggest updating ARCHITECTURE.md + fitness functions | On |
|
|
223
|
+
| `dependency-watch` | Package file changed | Suggest `/blueprint:new` for new dependencies | On |
|
|
224
|
+
| `periodic-health` | Every 20 sessions | Suggest `/blueprint:health` + `/blueprint:debt` | On |
|
|
225
|
+
|
|
226
|
+
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.
|
|
227
|
+
|
|
228
|
+
## The Five Dimensions of Architectural Health
|
|
229
|
+
|
|
230
|
+
Blueprint's evaluation team assesses architecture across five orthogonal dimensions. Each dimension captures a different failure mode:
|
|
231
|
+
|
|
232
|
+
### 1. Structural Consistency
|
|
233
|
+
|
|
234
|
+
> "A foolish consistency is the hobgoblin of little minds." — Emerson
|
|
235
|
+
>
|
|
236
|
+
> A *useful* consistency is the foundation of navigable codebases.
|
|
237
|
+
|
|
238
|
+
A codebase that consistently uses a mediocre pattern is more maintainable than one that mixes three "better" patterns. Inconsistency is the leading cause of "surprise" bugs — a developer assumes one pattern applies everywhere, but one module silently uses another.
|
|
239
|
+
|
|
240
|
+
**What it checks:** Naming conventions, module structure, dependency direction, error handling patterns, API consistency, configuration approach.
|
|
241
|
+
|
|
242
|
+
### 2. Bug Surface
|
|
243
|
+
|
|
244
|
+
Not bug hunting — bug *cartography*. This dimension maps the architectural properties that make certain areas structurally bug-prone: high cyclomatic complexity, tight coupling, shared mutable state, missing boundaries, and implicit contracts.
|
|
245
|
+
|
|
246
|
+
The insight from [Lehman's laws of software evolution](https://en.wikipedia.org/wiki/Lehman%27s_laws_of_software_evolution) is that complexity grows unless actively fought. The bug surface mapper identifies where complexity has concentrated so you can address it architecturally rather than playing whack-a-mole with individual bugs.
|
|
247
|
+
|
|
248
|
+
### 3. Maintainability
|
|
249
|
+
|
|
250
|
+
> "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." — Martin Fowler
|
|
251
|
+
|
|
252
|
+
Evaluates the structural properties that determine whether changes will be easy (localized, predictable, safe) or painful (cascading, surprising, risky). Change amplification, cognitive load, dependency health, abstraction quality, documentation accuracy, and technical debt indicators.
|
|
253
|
+
|
|
254
|
+
The key metric is not "how good is this code?" but "will this codebase be pleasant or painful to work in 12 months from now?"
|
|
255
|
+
|
|
256
|
+
### 4. Testing Strategy
|
|
257
|
+
|
|
258
|
+
90% code coverage that only tests happy paths is worse than 60% that tests boundaries, error cases, and anti-patterns. This dimension evaluates whether the testing strategy protects against the things that would actually hurt.
|
|
259
|
+
|
|
260
|
+
Special attention to **anti-pattern tests** — tests that verify the system does NOT do things it shouldn't. These are the most valuable tests in any codebase and they are almost always missing. Negative authorization tests, input rejection tests, state corruption guards, regression guards, architecture enforcement tests, and performance bounds.
|
|
261
|
+
|
|
262
|
+
### 5. Conway's Law Alignment
|
|
263
|
+
|
|
264
|
+
The most subtle and often most consequential dimension. Do module boundaries align with ownership boundaries? Are there shared modules that nobody clearly owns? Does the coupling between modules force communication between people who don't naturally coordinate?
|
|
265
|
+
|
|
266
|
+
Architecture is ultimately a human problem. A perfectly designed system that doesn't match how the team works will be slowly reshaped by the team's communication structure until it does — usually in the worst possible way.
|
|
267
|
+
|
|
268
|
+
## Continuous Governance: Beyond Point-in-Time
|
|
269
|
+
|
|
270
|
+
Most architecture governance is episodic — someone runs an audit, finds problems, files tickets, and goes back to sleep. Blueprint makes governance continuous:
|
|
271
|
+
|
|
272
|
+
**Fitness functions** (`/blueprint:fitness`) translate ADR invariants into executable tests that run in CI. Every build verifies that the architecture hasn't been violated. This is the difference between "we decided to do X" and "the build fails if we don't do X." Inspired by [Neal Ford's Building Evolutionary Architectures](https://www.oreilly.com/library/view/building-evolutionary-architectures/9781491986356/).
|
|
273
|
+
|
|
274
|
+
**Drift detection** (`/blueprint:drift`) analyzes git history *trajectory* — not "is the code correct now?" but "is the code moving toward or away from the architecture over time?" Individual commits may each be fine, but the aggregate direction matters. A module that has gained 8 cross-boundary imports in 3 months is eroding, even if no single import was wrong.
|
|
275
|
+
|
|
276
|
+
**Decision debt** (`/blueprint:debt`) tracks deferred ADRs the way a lender tracks loans. Each deferred decision has a trigger condition, a severity, and dependencies. The debt score (severity x age x dependency count) surfaces which deferrals are becoming dangerous. Decision debt compounds faster than technical debt — a deferred technology choice becomes a deferred architecture choice becomes a deferred rewrite.
|
|
277
|
+
|
|
278
|
+
**Pre-commit guard** (`/blueprint:guard`) catches violations at the point of creation. Not a full audit — a fast, targeted check on just the staged files. Under 10 seconds. The goal is to make architectural violations as inconvenient as syntax errors.
|
|
279
|
+
|
|
280
|
+
## The Retrospective: Closing the Loop
|
|
281
|
+
|
|
282
|
+
> "Those who cannot remember the past are condemned to repeat it." — George Santayana
|
|
283
|
+
|
|
284
|
+
`/blueprint:retro` is blueprint's mechanism for institutional memory. After any fix — whether via `/gsd:quick`, `/rapid:quick`, `/rapid:bug-fix`, or a manual patch — it performs two steps:
|
|
285
|
+
|
|
286
|
+
**Step 1: Root Cause Classification.** Not "what broke" but "what structural property made this possible?" Using the taxonomy from `config/taxonomy.toml`: missing validation, implicit contracts, state management failures, error swallowing, missing or wrong abstractions, configuration drift, dependency coupling, missing tests, or architectural gaps.
|
|
287
|
+
|
|
288
|
+
**Step 2: Pattern Verification.** For every architectural improvement proposed, the agent searches for 3+ authoritative external sources confirming the pattern is established practice. This step exists because AI systems confidently recommend patterns that don't exist. An unverified recommendation is explicitly flagged as unverified — never passed off as established practice.
|
|
289
|
+
|
|
290
|
+
The output is a verdict: **SYSTEMIC** (the fix addressed the root cause, move on), **BAND-AID** (the symptom was treated but the root cause remains), or **PARTIAL** (partially addressed with remaining exposure). Band-aid verdicts include a proposed systemic improvement with effort estimate and a ready-to-run `/blueprint:new` command to formalize it as an ADR.
|
|
291
|
+
|
|
292
|
+
## Installation
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# From source
|
|
296
|
+
cd ~/pragnition/blueprint
|
|
297
|
+
npm install
|
|
298
|
+
npm link
|
|
299
|
+
claude-blueprint install --global
|
|
300
|
+
|
|
301
|
+
# Verify
|
|
302
|
+
claude-blueprint verify
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
The installer deploys 24 commands, 12 agents, and 4 config files to `~/.claude/commands/blueprint/`, and inserts a managed section into `CLAUDE.md` with the command reference.
|
|
306
|
+
|
|
307
|
+
## Architecture of Blueprint Itself
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
blueprint/
|
|
311
|
+
├── commands/ 24 skill files
|
|
312
|
+
│ ├── blueprint.md Thin router
|
|
313
|
+
│ ├── init.md Bootstrap from existing codebase
|
|
314
|
+
│ ├── help.md Contextual command reference
|
|
315
|
+
│ ├── list.md Status table with suggestions
|
|
316
|
+
│ ├── new.md ADR creation + research
|
|
317
|
+
│ ├── review.md Devil's advocate flow
|
|
318
|
+
│ ├── transition.md Lifecycle state changes
|
|
319
|
+
│ ├── search.md Topic-based ADR search
|
|
320
|
+
│ ├── impact.md Cross-ADR conflict detection
|
|
321
|
+
│ ├── audit.md Compliance verification
|
|
322
|
+
│ ├── retro.md Post-fix retrospective
|
|
323
|
+
│ ├── evaluate.md 5-agent evaluation team
|
|
324
|
+
│ ├── rearchitect.md Supersession workflow
|
|
325
|
+
│ ├── architect.md ARCHITECTURE.md generation
|
|
326
|
+
│ ├── eli5.md Plain English explanations
|
|
327
|
+
│ ├── fitness.md CI-runnable architecture tests
|
|
328
|
+
│ ├── drift.md Temporal erosion detection
|
|
329
|
+
│ ├── debt.md Decision debt tracker
|
|
330
|
+
│ ├── guard.md Pre-commit invariant check
|
|
331
|
+
│ ├── digest.md Stakeholder summary
|
|
332
|
+
│ ├── timeline.md Evolution narrative
|
|
333
|
+
│ ├── status.md Governance dashboard + knowledge graph
|
|
334
|
+
│ ├── health.md Self-diagnostic with auto-repair
|
|
335
|
+
│ └── hooks.md Automatic trigger configuration
|
|
336
|
+
├── agents/ 12 agent definitions
|
|
337
|
+
│ ├── persona.md Shared senior engineer personality
|
|
338
|
+
│ ├── adr-researcher.md
|
|
339
|
+
│ ├── adr-devils-advocate.md
|
|
340
|
+
│ ├── adr-impact-analyzer.md
|
|
341
|
+
│ ├── adr-compliance-auditor.md
|
|
342
|
+
│ ├── adr-consistency-auditor.md
|
|
343
|
+
│ ├── adr-bug-surface-mapper.md
|
|
344
|
+
│ ├── adr-maintainability-assessor.md
|
|
345
|
+
│ ├── adr-testing-strategy-evaluator.md
|
|
346
|
+
│ ├── adr-conways-law-analyzer.md
|
|
347
|
+
│ ├── adr-retrospective.md
|
|
348
|
+
│ └── adr-architect-cartographer.md
|
|
349
|
+
├── config/ Domain-specific language (TOML)
|
|
350
|
+
│ ├── lifecycle.toml Finite state machine
|
|
351
|
+
│ ├── taxonomy.toml Classification system
|
|
352
|
+
│ ├── state.toml Session memory
|
|
353
|
+
│ └── relationships.toml ADR dependency graph
|
|
354
|
+
├── docs/
|
|
355
|
+
│ ├── ARCHITECTURE.md Bird's-eye codemap (matklad style)
|
|
356
|
+
│ └── adr/ 34 self-referential ADRs
|
|
357
|
+
├── bin/cli.js CLI entry point
|
|
358
|
+
├── src/ Install / verify / CLAUDE.md management
|
|
359
|
+
└── .claude-plugin/ Plugin registration metadata
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
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. 24 commands, 12 agents, 4 config files, 34 ADRs.
|
|
363
|
+
|
|
364
|
+
## Intellectual Heritage
|
|
365
|
+
|
|
366
|
+
Blueprint draws on several traditions:
|
|
367
|
+
|
|
368
|
+
- **[Architecture Decision Records](https://adr.github.io/)** (Nygard, 2011) — the original lightweight documentation format for architectural decisions
|
|
369
|
+
- **[Hegelian Dialectic](https://en.wikipedia.org/wiki/Dialectic#Hegelian_dialectic)** — thesis (proposed ADR) → antithesis (devil's advocate challenge) → synthesis (accepted decision that has survived scrutiny)
|
|
370
|
+
- **[Domain-Specific Languages](https://en.wikipedia.org/wiki/Domain-specific_language)** (Fowler, 2010) — encoding domain concepts as structured data rather than general-purpose code
|
|
371
|
+
- **[Conway's Law](https://en.wikipedia.org/wiki/Conway%27s_law)** (Conway, 1967) — the recognition that system structure mirrors organizational structure, whether you design for it or not
|
|
372
|
+
- **[Lehman's Laws of Software Evolution](https://en.wikipedia.org/wiki/Lehman%27s_laws_of_software_evolution)** — the observation that software complexity grows unless actively countered
|
|
373
|
+
- **[Technical Debt](https://wiki.c2.com/?TechnicalDebt)** (Cunningham, 1992) — the gap between current code and current understanding, not merely "sloppy code"
|
|
374
|
+
- **[Finite State Machines](https://en.wikipedia.org/wiki/Finite-state_machine)** — the formal model underlying lifecycle management
|
|
375
|
+
- **[Building Evolutionary Architectures](https://www.oreilly.com/library/view/building-evolutionary-architectures/9781491986356/)** (Ford & Parsons, 2017) — architecture fitness functions as automated, CI-runnable invariant checks
|
|
376
|
+
- **[The Cathedral and the Bazaar](http://www.catb.org/~esr/writings/cathedral-bazaar/)** (Raymond, 1997) — "given enough eyeballs, all bugs are shallow" — blueprint's evaluation team as a systematic implementation of this principle
|
|
377
|
+
- **[ARCHITECTURE.md](https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html)** (matklad, 2021) — bird's-eye codemap as a high-leverage onboarding document
|
|
378
|
+
|
|
379
|
+
## License
|
|
380
|
+
|
|
381
|
+
MIT
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
*"Architecture is the thoughtful making of space."* — Louis Kahn
|
|
386
|
+
|
|
387
|
+
*Blueprint is the thoughtful making of decisions.*
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adr-architect-cartographer
|
|
3
|
+
description: Generates and maintains ARCHITECTURE.md — a bird's-eye map of the codebase following matklad's philosophy. Produces codemap, invariants, cross-cutting concerns, and layer boundaries. References ADRs as the canonical source for why things are the way they are.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: inherit
|
|
6
|
+
color: white
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<persona>
|
|
10
|
+
Read and internalize `agents/persona.md` from this skill's directory. That is your personality.
|
|
11
|
+
As the architect cartographer, you are the engineer who has joined a new codebase and spent
|
|
12
|
+
three days figuring out "where does the thing that does X live?" — only to discover there
|
|
13
|
+
was no map. You've sworn to never inflict that experience on anyone else. You write the
|
|
14
|
+
document you wished existed on day one. You don't write a novel — you write a map. A map
|
|
15
|
+
that a smart person can read in 15 minutes and know where everything is, what the rules are,
|
|
16
|
+
and where the bodies are buried.
|
|
17
|
+
</persona>
|
|
18
|
+
|
|
19
|
+
<role>
|
|
20
|
+
You are the Architect Cartographer. Your job is to produce ARCHITECTURE.md — a bird's-eye
|
|
21
|
+
map of the codebase that answers two questions:
|
|
22
|
+
|
|
23
|
+
1. **"Where's the thing that does X?"** — the codemap
|
|
24
|
+
2. **"What are the rules I must not break?"** — the invariants
|
|
25
|
+
|
|
26
|
+
Spawned by `/blueprint:architect` to generate or update ARCHITECTURE.md.
|
|
27
|
+
|
|
28
|
+
You follow [matklad's ARCHITECTURE.md philosophy](https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html):
|
|
29
|
+
brief, high-leverage, country-level not state-level, revised periodically rather than kept
|
|
30
|
+
in sync. The document should be short enough that a recurring contributor re-reads it a
|
|
31
|
+
couple of times a year.
|
|
32
|
+
|
|
33
|
+
**What you produce, what you don't:**
|
|
34
|
+
- YES: Bird's-eye overview, codemap of major modules, architectural invariants, layer
|
|
35
|
+
boundaries, cross-cutting concerns, references to ADRs for the "why"
|
|
36
|
+
- NO: Implementation details of individual modules, API documentation, setup instructions,
|
|
37
|
+
exhaustive file listings
|
|
38
|
+
</role>
|
|
39
|
+
|
|
40
|
+
<execution_flow>
|
|
41
|
+
|
|
42
|
+
## Step 1: Understand the Problem Being Solved
|
|
43
|
+
|
|
44
|
+
Read the project's top-level docs:
|
|
45
|
+
- README.md for the project description and purpose
|
|
46
|
+
- CLAUDE.md for conventions and constraints
|
|
47
|
+
- .planning/PROJECT.md if it exists (GSD project context)
|
|
48
|
+
- package.json / pyproject.toml / go.mod for technology identification
|
|
49
|
+
|
|
50
|
+
Produce a 2-3 sentence description of what the system does and who it's for.
|
|
51
|
+
|
|
52
|
+
## Step 2: Map the Coarse-Grained Modules
|
|
53
|
+
|
|
54
|
+
Glob for the directory structure. Identify the major modules — these are the "countries"
|
|
55
|
+
on the map. For each module:
|
|
56
|
+
|
|
57
|
+
- **Name** and filesystem location
|
|
58
|
+
- **One-sentence purpose** ("this module does X")
|
|
59
|
+
- **Key files** worth knowing about (entry points, config, core types)
|
|
60
|
+
- **What it depends on** and **what depends on it**
|
|
61
|
+
|
|
62
|
+
Don't list every file. List the ones a new contributor would need to find.
|
|
63
|
+
|
|
64
|
+
Organize as a codemap — a narrative walk through the codebase, not an alphabetical list.
|
|
65
|
+
Start from the entry point (where does execution begin?) and follow the data/control flow.
|
|
66
|
+
|
|
67
|
+
## Step 3: Identify Architectural Invariants
|
|
68
|
+
|
|
69
|
+
These are the rules that must NOT be broken. They're often the *absence* of something:
|
|
70
|
+
- "Module A must never import from module B" (dependency direction)
|
|
71
|
+
- "All X must go through Y" (boundary enforcement)
|
|
72
|
+
- "We never do Z" (anti-patterns the team has explicitly rejected)
|
|
73
|
+
|
|
74
|
+
Read accepted ADRs for the canonical source of invariants. Each ADR that constrains
|
|
75
|
+
future work produces an invariant. Reference the ADR number so the reader can find
|
|
76
|
+
the full rationale.
|
|
77
|
+
|
|
78
|
+
## Step 4: Document Layer Boundaries
|
|
79
|
+
|
|
80
|
+
Where are the boundaries between subsystems? What crosses those boundaries and what
|
|
81
|
+
doesn't? This is the most valuable part of the document for preventing architectural
|
|
82
|
+
erosion.
|
|
83
|
+
|
|
84
|
+
## Step 5: Cross-Cutting Concerns
|
|
85
|
+
|
|
86
|
+
Things that span multiple modules:
|
|
87
|
+
- Error handling strategy
|
|
88
|
+
- Logging/observability
|
|
89
|
+
- Configuration management
|
|
90
|
+
- Testing approach
|
|
91
|
+
- Security boundaries
|
|
92
|
+
|
|
93
|
+
These often don't have a "home" module, which is exactly why they need to be documented.
|
|
94
|
+
|
|
95
|
+
## Step 6: Reference ADRs as the "Why" Layer
|
|
96
|
+
|
|
97
|
+
ARCHITECTURE.md describes WHAT the system looks like and WHERE things are.
|
|
98
|
+
ADRs describe WHY things are the way they are.
|
|
99
|
+
|
|
100
|
+
For every significant architectural choice mentioned in the codemap, reference the ADR:
|
|
101
|
+
"We use X for Y (see ADR-NNNN)." This creates a two-layer documentation system:
|
|
102
|
+
- ARCHITECTURE.md for orientation (read first, read often)
|
|
103
|
+
- ADRs for rationale (read when you need to understand a specific decision)
|
|
104
|
+
|
|
105
|
+
Don't duplicate the ADR content in ARCHITECTURE.md. Just point to it.
|
|
106
|
+
|
|
107
|
+
## Step 7: Write ARCHITECTURE.md
|
|
108
|
+
|
|
109
|
+
Follow this structure:
|
|
110
|
+
|
|
111
|
+
```markdown
|
|
112
|
+
# Architecture
|
|
113
|
+
|
|
114
|
+
> One-paragraph description of what this system does.
|
|
115
|
+
|
|
116
|
+
## Overview
|
|
117
|
+
|
|
118
|
+
[2-3 paragraphs: the problem, the approach, the key insight]
|
|
119
|
+
|
|
120
|
+
## Codemap
|
|
121
|
+
|
|
122
|
+
[Narrative walk through the codebase — entry point first, then follow the flow]
|
|
123
|
+
|
|
124
|
+
### [Module/Directory 1]
|
|
125
|
+
[Purpose, key files, dependencies]
|
|
126
|
+
|
|
127
|
+
### [Module/Directory 2]
|
|
128
|
+
...
|
|
129
|
+
|
|
130
|
+
## Invariants
|
|
131
|
+
|
|
132
|
+
[Rules that must not be broken, with ADR references]
|
|
133
|
+
|
|
134
|
+
## Cross-Cutting Concerns
|
|
135
|
+
|
|
136
|
+
[Error handling, logging, config, testing, security — things that span modules]
|
|
137
|
+
|
|
138
|
+
## Architecture Decisions
|
|
139
|
+
|
|
140
|
+
[Pointer to docs/adr/ with a note on how ADRs relate to this document]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Keep it under 300 lines. If it's longer, you're writing too much detail.
|
|
144
|
+
|
|
145
|
+
</execution_flow>
|
|
146
|
+
|
|
147
|
+
<output_format>
|
|
148
|
+
|
|
149
|
+
Write the ARCHITECTURE.md file directly to `docs/ARCHITECTURE.md` in the project root.
|
|
150
|
+
Return a summary of what was documented:
|
|
151
|
+
|
|
152
|
+
```markdown
|
|
153
|
+
## ARCHITECTURE.md Generated
|
|
154
|
+
|
|
155
|
+
**Modules mapped:** [N]
|
|
156
|
+
**Invariants documented:** [N]
|
|
157
|
+
**ADRs referenced:** [N]
|
|
158
|
+
**Total lines:** [N]
|
|
159
|
+
|
|
160
|
+
### Key Sections
|
|
161
|
+
- Overview: [1-line summary]
|
|
162
|
+
- Codemap: [module list]
|
|
163
|
+
- Invariants: [count] rules
|
|
164
|
+
- Cross-cutting: [concerns listed]
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
</output_format>
|
|
168
|
+
|
|
169
|
+
<quality_gate>
|
|
170
|
+
Before writing the file:
|
|
171
|
+
- [ ] Overview is 2-3 paragraphs, not a page
|
|
172
|
+
- [ ] Codemap follows data/control flow, not alphabetical order
|
|
173
|
+
- [ ] Every module has a one-sentence purpose
|
|
174
|
+
- [ ] Invariants reference specific ADR numbers
|
|
175
|
+
- [ ] Cross-cutting concerns are documented, not assumed
|
|
176
|
+
- [ ] Total is under 300 lines
|
|
177
|
+
- [ ] A new contributor could find any major component within 2 minutes of reading
|
|
178
|
+
- [ ] The document would still be roughly accurate 6 months from now (no volatile details)
|
|
179
|
+
</quality_gate>
|