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,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blueprint:guard
|
|
3
|
+
description: >
|
|
4
|
+
Pre-commit architecture guard — checks if staged changes violate any accepted ADR invariant
|
|
5
|
+
before committing. Fast, targeted check on just the files being changed. Use when: "guard
|
|
6
|
+
this commit", "check before commit", "architecture guard", "pre-commit check", or configure
|
|
7
|
+
as an automatic pre-commit hook.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Pre-Commit Architecture Guard
|
|
11
|
+
|
|
12
|
+
Fast, targeted invariant check on staged files. Not a full audit — just "do these specific
|
|
13
|
+
changes violate any accepted ADR?"
|
|
14
|
+
|
|
15
|
+
Catches violations at the point of creation, not after the fact.
|
|
16
|
+
|
|
17
|
+
## Shared Context
|
|
18
|
+
|
|
19
|
+
Read from parent `blueprint/` skill directory:
|
|
20
|
+
- `config/state.toml` — ADR directory
|
|
21
|
+
- `config/lifecycle.toml` — to identify accepted statuses
|
|
22
|
+
|
|
23
|
+
## Process
|
|
24
|
+
|
|
25
|
+
### Step 1: Identify Staged Changes
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git diff --cached --name-only
|
|
29
|
+
git diff --cached --stat
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
If nothing is staged, check unstaged changes instead and note the difference.
|
|
33
|
+
|
|
34
|
+
### Step 2: Map Changes to ADRs
|
|
35
|
+
|
|
36
|
+
For each changed file, determine which ADRs govern it:
|
|
37
|
+
|
|
38
|
+
- Read all accepted ADRs
|
|
39
|
+
- Match changed file paths against ADR scopes:
|
|
40
|
+
- ADR about database → governs files in `models/`, `repositories/`, `migrations/`
|
|
41
|
+
- ADR about API design → governs files in `api/`, `routes/`, `handlers/`
|
|
42
|
+
- ADR about testing → governs files in `tests/`
|
|
43
|
+
- ADR about architecture patterns → governs files matching the pattern's scope
|
|
44
|
+
|
|
45
|
+
If no ADRs govern the changed files, report "No architectural constraints apply to
|
|
46
|
+
these changes" and exit.
|
|
47
|
+
|
|
48
|
+
### Step 3: Fast Invariant Check
|
|
49
|
+
|
|
50
|
+
For each relevant ADR, check the diff (not the whole codebase) for violations:
|
|
51
|
+
|
|
52
|
+
- **Dependency direction:** Does the diff add an import that violates the rule?
|
|
53
|
+
- **Technology constraint:** Does the diff introduce a forbidden technology?
|
|
54
|
+
- **Pattern enforcement:** Does the diff bypass a required pattern?
|
|
55
|
+
- **Naming convention:** Does the diff introduce inconsistent naming?
|
|
56
|
+
|
|
57
|
+
Read only the diff, not the entire file. This must be fast — under 10 seconds
|
|
58
|
+
for a typical commit.
|
|
59
|
+
|
|
60
|
+
### Step 4: Report
|
|
61
|
+
|
|
62
|
+
**No violations:**
|
|
63
|
+
```
|
|
64
|
+
✓ Guard passed — [N] ADRs checked against [M] changed files
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Violations found:**
|
|
68
|
+
```
|
|
69
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
70
|
+
BLUEPRINT ► GUARD: VIOLATIONS FOUND
|
|
71
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
72
|
+
|
|
73
|
+
| File | ADR | Violation |
|
|
74
|
+
|------|-----|-----------|
|
|
75
|
+
| [file] | ADR-NNNN | [what the diff does wrong] |
|
|
76
|
+
|
|
77
|
+
Fix these before committing, or run /blueprint:new to formally
|
|
78
|
+
change the decision if the violation is intentional.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Hook Integration
|
|
82
|
+
|
|
83
|
+
To run automatically before every commit, suggest the user add a hook:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# .git/hooks/pre-commit or via settings.json hook
|
|
87
|
+
claude -p "Run /blueprint:guard on the currently staged changes"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Or via Claude Code settings.json:
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"hooks": {
|
|
94
|
+
"PreCommit": [{
|
|
95
|
+
"type": "command",
|
|
96
|
+
"command": "claude -p 'blueprint:guard'"
|
|
97
|
+
}]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Note: This is a suggestion, not automatic. The user decides whether to enable it.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blueprint:health
|
|
3
|
+
description: >
|
|
4
|
+
Self-diagnostic for the blueprint ADR system. Checks internal consistency: broken
|
|
5
|
+
supersession chains, index sync, orphaned references, missing relationship edges,
|
|
6
|
+
stale config, template drift. Use when: "blueprint health", "check adr health",
|
|
7
|
+
"validate adrs", "is the adr system consistent?", "health check", or when things
|
|
8
|
+
seem off.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Blueprint Health Check
|
|
12
|
+
|
|
13
|
+
Validates the ADR system's internal consistency and offers to repair issues found.
|
|
14
|
+
Think of it as fsck for your architecture decisions.
|
|
15
|
+
|
|
16
|
+
## Shared Context
|
|
17
|
+
|
|
18
|
+
Read from parent `blueprint/` skill directory:
|
|
19
|
+
- `config/state.toml` — cached paths
|
|
20
|
+
- `config/lifecycle.toml` — valid statuses
|
|
21
|
+
- `config/relationships.toml` — graph to validate
|
|
22
|
+
|
|
23
|
+
## Process
|
|
24
|
+
|
|
25
|
+
### Step 1: Run All Checks
|
|
26
|
+
|
|
27
|
+
Execute these checks in order, collecting findings:
|
|
28
|
+
|
|
29
|
+
**1. ADR Directory Structure**
|
|
30
|
+
- [ ] ADR directory exists at detected path
|
|
31
|
+
- [ ] `template.md` exists
|
|
32
|
+
- [ ] `README.md` exists with index table
|
|
33
|
+
- [ ] File naming follows `NNNN-kebab-case.md` pattern
|
|
34
|
+
- [ ] Sequence numbers are contiguous (no gaps, no duplicates)
|
|
35
|
+
|
|
36
|
+
**2. Index Sync**
|
|
37
|
+
- [ ] Every ADR file has a corresponding row in README.md index
|
|
38
|
+
- [ ] Every index row points to an existing file
|
|
39
|
+
- [ ] Status in index matches status in the ADR file
|
|
40
|
+
- [ ] Dates in index match dates in the ADR file
|
|
41
|
+
- [ ] Index is sorted by ADR number
|
|
42
|
+
|
|
43
|
+
**3. ADR Content Validity**
|
|
44
|
+
- [ ] Every ADR has the required Metadata table (Status, Date proposed)
|
|
45
|
+
- [ ] Status is a valid value from `lifecycle.toml`
|
|
46
|
+
- [ ] Every ADR has Context, Options Considered, Decision, Consequences sections
|
|
47
|
+
- [ ] At least 2 options were considered (not just the chosen one)
|
|
48
|
+
- [ ] Consequences has both Positive and Negative subsections
|
|
49
|
+
|
|
50
|
+
**4. Supersession Chain Integrity**
|
|
51
|
+
- [ ] Every "Superseded by ADR-NNNN" points to a real ADR
|
|
52
|
+
- [ ] The target ADR has "Supersedes ADR-MMMM" pointing back (bidirectional)
|
|
53
|
+
- [ ] No circular supersession chains
|
|
54
|
+
- [ ] Superseded ADRs have status "Superseded"
|
|
55
|
+
- [ ] Superseding ADRs have status "Accepted" or "Proposed"
|
|
56
|
+
|
|
57
|
+
**5. Relationship Graph Consistency**
|
|
58
|
+
- [ ] Every node in `relationships.toml` corresponds to a real ADR file
|
|
59
|
+
- [ ] Every edge references existing nodes
|
|
60
|
+
- [ ] No duplicate edges
|
|
61
|
+
- [ ] Edge types are valid (from the edge_types definition)
|
|
62
|
+
- [ ] No self-referencing edges
|
|
63
|
+
|
|
64
|
+
**6. Config Freshness**
|
|
65
|
+
- [ ] `state.toml` adr_directory matches actual location
|
|
66
|
+
- [ ] `state.toml` timestamps are plausible (not in the future)
|
|
67
|
+
- [ ] `relationships.toml` has nodes for all existing ADRs
|
|
68
|
+
- [ ] `lifecycle.toml` statuses cover all statuses used in ADRs
|
|
69
|
+
- [ ] `taxonomy.toml` categories cover all categories used in ADRs
|
|
70
|
+
|
|
71
|
+
**7. Cross-Reference Integrity**
|
|
72
|
+
- [ ] ADRs that reference other ADRs (e.g., "see ADR-0003") point to real ADRs
|
|
73
|
+
- [ ] Referenced ADRs are not Rejected (referencing rejected decisions is suspicious)
|
|
74
|
+
- [ ] `docs/ARCHITECTURE.md` ADR references (if file exists) point to real ADRs
|
|
75
|
+
|
|
76
|
+
**8. Staleness Detection**
|
|
77
|
+
- [ ] No accepted ADR is older than 12 months without a review (flag as "consider revisiting")
|
|
78
|
+
- [ ] `docs/ARCHITECTURE.md` last updated within 6 months (if it exists)
|
|
79
|
+
- [ ] Deferred ADRs older than 6 months flagged as "may be forgotten"
|
|
80
|
+
|
|
81
|
+
### Step 2: Report
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
85
|
+
BLUEPRINT ► HEALTH CHECK
|
|
86
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
87
|
+
|
|
88
|
+
## Results
|
|
89
|
+
|
|
90
|
+
| Check | Status | Issues |
|
|
91
|
+
|--------------------------|--------|--------|
|
|
92
|
+
| Directory structure | ✓ | 0 |
|
|
93
|
+
| Index sync | ⚠ | 2 |
|
|
94
|
+
| ADR content validity | ✓ | 0 |
|
|
95
|
+
| Supersession chains | ✓ | 0 |
|
|
96
|
+
| Relationship graph | ⚠ | 3 |
|
|
97
|
+
| Config freshness | ✓ | 0 |
|
|
98
|
+
| Cross-references | ✓ | 0 |
|
|
99
|
+
| Staleness | ⚠ | 1 |
|
|
100
|
+
|
|
101
|
+
Overall: 5 issues found (0 critical, 3 warnings, 2 info)
|
|
102
|
+
|
|
103
|
+
## Issues
|
|
104
|
+
|
|
105
|
+
⚠ INDEX-001: ADR-0029 status in index (Accepted) doesn't match
|
|
106
|
+
file (Proposed). Fix: update index row.
|
|
107
|
+
|
|
108
|
+
⚠ INDEX-002: ADR-0031 missing from README.md index.
|
|
109
|
+
Fix: add index row.
|
|
110
|
+
|
|
111
|
+
⚠ GRAPH-001: 12 ADRs have no nodes in relationships.toml.
|
|
112
|
+
Fix: run /blueprint:impact on each to populate.
|
|
113
|
+
|
|
114
|
+
⚠ GRAPH-002: Edge ADR-0003 → ADR-0008 exists but reverse not declared.
|
|
115
|
+
Fix: add bidirectional edge.
|
|
116
|
+
|
|
117
|
+
⚠ GRAPH-003: Node ADR-0099 in graph but no file exists.
|
|
118
|
+
Fix: remove orphaned node.
|
|
119
|
+
|
|
120
|
+
ℹ STALE-001: ADR-0001 accepted 8 months ago, never reviewed.
|
|
121
|
+
Suggestion: revisit or confirm still valid.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Step 3: Offer Repair
|
|
125
|
+
|
|
126
|
+
For each fixable issue, offer to repair automatically:
|
|
127
|
+
|
|
128
|
+
- Index sync issues → update README.md index
|
|
129
|
+
- Missing graph nodes → add nodes for all existing ADRs
|
|
130
|
+
- Orphaned graph nodes → remove nodes with no file
|
|
131
|
+
- Status mismatches → update index to match file (file is authoritative)
|
|
132
|
+
- Missing bidirectional edges → add the missing direction
|
|
133
|
+
|
|
134
|
+
Ask: "Fix [N] repairable issues?" (Yes / No / Let me pick)
|
|
135
|
+
|
|
136
|
+
### Step 4: Commit Repairs
|
|
137
|
+
|
|
138
|
+
If repairs were made:
|
|
139
|
+
`docs: repair ADR system health — [N] issues fixed`
|
package/commands/help.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blueprint:help
|
|
3
|
+
description: >
|
|
4
|
+
Show the full ADR command reference with contextual suggestions based on current ADR state
|
|
5
|
+
and conversation history. Use when: "adr help", "what adr commands are there?", "what can I
|
|
6
|
+
do with adrs?", "help with adrs".
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# ADR Help
|
|
10
|
+
|
|
11
|
+
Display the full command reference with context-aware next-action suggestions.
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
### Step 1: Detect Current State
|
|
16
|
+
|
|
17
|
+
1. Read `config/state.toml` from the parent `adr/` directory for ADR directory location
|
|
18
|
+
2. If no directory cached, detect: `docs/adr/` → `docs/decisions/` → `adr/` → `decisions/`
|
|
19
|
+
3. Glob for all ADR files (`[0-9][0-9][0-9][0-9]-*.md`)
|
|
20
|
+
4. Extract status from each ADR (count Proposed, Accepted, Rejected, Deferred, Deprecated, Superseded)
|
|
21
|
+
5. Read `config/state.toml` for last audit/evaluation/retro dates
|
|
22
|
+
6. Scan recent conversation history for architectural topics being discussed
|
|
23
|
+
7. Check if application code exists (glob for source files beyond wireframes/docs)
|
|
24
|
+
|
|
25
|
+
### Step 2: Display Command Reference
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
29
|
+
ADR ► COMMAND REFERENCE
|
|
30
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
31
|
+
|
|
32
|
+
## Lifecycle
|
|
33
|
+
|
|
34
|
+
/blueprint:new "topic" Create a new ADR from interview
|
|
35
|
+
/blueprint:new --research "topic" Research options first, then create ADR
|
|
36
|
+
/blueprint:list List all ADRs with status + suggestions
|
|
37
|
+
/blueprint:review N Challenge + review a Proposed ADR
|
|
38
|
+
/blueprint:transition accept N Accept an ADR (no challenge)
|
|
39
|
+
/blueprint:transition reject N Reject a Proposed ADR
|
|
40
|
+
/blueprint:transition defer N Defer a Proposed ADR
|
|
41
|
+
/blueprint:transition deprecate N Deprecate an Accepted ADR
|
|
42
|
+
/blueprint:search "term" Find ADRs about a topic
|
|
43
|
+
|
|
44
|
+
## Analysis
|
|
45
|
+
|
|
46
|
+
/blueprint:impact N Check ADR for conflicts with other decisions
|
|
47
|
+
/blueprint:audit Verify codebase follows accepted ADRs
|
|
48
|
+
/blueprint:retro Post-fix retrospective — band-aid or systemic?
|
|
49
|
+
/blueprint:rearchitect "topic" Research + replace an existing decision
|
|
50
|
+
|
|
51
|
+
## Architecture Evaluation Team
|
|
52
|
+
|
|
53
|
+
/blueprint:evaluate Run all 5 evaluators in parallel
|
|
54
|
+
/blueprint:evaluate consistency Pattern adherence, naming, layering, deps
|
|
55
|
+
/blueprint:evaluate bugs Complexity hotspots, coupling, boundaries
|
|
56
|
+
/blueprint:evaluate maintainability Dependency health, abstractions, tech debt
|
|
57
|
+
/blueprint:evaluate testing Test pyramid, anti-pattern tests, coverage
|
|
58
|
+
/blueprint:evaluate conways Team-architecture alignment, ownership
|
|
59
|
+
|
|
60
|
+
## Setup
|
|
61
|
+
|
|
62
|
+
/blueprint:init Bootstrap blueprint onto existing codebase
|
|
63
|
+
|
|
64
|
+
## Documentation
|
|
65
|
+
|
|
66
|
+
/blueprint:architect Generate/update ARCHITECTURE.md (matklad style)
|
|
67
|
+
/blueprint:eli5 Explain an ADR or the whole landscape in plain English
|
|
68
|
+
/blueprint:eli5 N Explain a single ADR — no jargon, all analogies
|
|
69
|
+
|
|
70
|
+
## Continuous Governance
|
|
71
|
+
|
|
72
|
+
/blueprint:fitness Generate CI-runnable architecture tests from ADRs
|
|
73
|
+
/blueprint:drift Detect gradual architecture erosion over time
|
|
74
|
+
/blueprint:debt Track deferred decisions and overdue triggers
|
|
75
|
+
/blueprint:guard Pre-commit check against ADR invariants
|
|
76
|
+
|
|
77
|
+
## Reporting
|
|
78
|
+
|
|
79
|
+
/blueprint:digest Non-technical stakeholder summary (1-page)
|
|
80
|
+
/blueprint:timeline Narrative evolution of architectural decisions
|
|
81
|
+
|
|
82
|
+
## System
|
|
83
|
+
|
|
84
|
+
/blueprint:status Governance dashboard + knowledge graph (browser)
|
|
85
|
+
/blueprint:health Self-diagnostic — check ADR system consistency
|
|
86
|
+
/blueprint:hooks Configure automatic blueprint triggers
|
|
87
|
+
/blueprint:hooks install all Enable all automation hooks
|
|
88
|
+
|
|
89
|
+
## Meta
|
|
90
|
+
|
|
91
|
+
/blueprint:help This reference + contextual suggestions
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Step 3: Display Contextual Suggestions
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
98
|
+
▶ SUGGESTED NEXT ACTIONS
|
|
99
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Apply these rules in order (show up to 3 suggestions):
|
|
103
|
+
|
|
104
|
+
1. **Proposed ADRs exist:** "You have [N] Proposed ADR(s) awaiting review: [titles]. Run `/blueprint:review [N]` to challenge and decide."
|
|
105
|
+
2. **Conversation discussed an architectural topic without an ADR:** "This conversation discussed [topic] — consider `/blueprint:new \"[topic]\"` to document the decision."
|
|
106
|
+
3. **Application code exists, no recent audit:** "You have [N] accepted ADRs and application code. Run `/blueprint:audit` to check compliance."
|
|
107
|
+
4. **Application code exists, no recent evaluation:** "Run `/blueprint:evaluate` for a full architecture health check."
|
|
108
|
+
5. **Recent fix committed:** "Recent changes detected. Run `/blueprint:retro` to check if they warrant an ADR."
|
|
109
|
+
6. **No ADRs exist:** "No ADRs found. Run `/blueprint:new \"[topic]\"` to create your first decision record."
|
|
110
|
+
7. **All ADRs Accepted, no action needed:** "All [N] ADRs are Accepted. No pending actions."
|
|
111
|
+
|
|
112
|
+
### Step 4: Show ADR Summary Stats
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
ADRs: [total] total | [N] Accepted | [N] Proposed | [N] other
|
|
116
|
+
Last audit: [date or "never"]
|
|
117
|
+
Last evaluation: [date or "never"]
|
|
118
|
+
Last retro: [date or "never"]
|
|
119
|
+
```
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blueprint:hooks
|
|
3
|
+
description: >
|
|
4
|
+
Configure automatic blueprint triggers via Claude Code hooks. Install, list, or remove
|
|
5
|
+
hooks that fire blueprint commands automatically at the right moments. Use when: "set up
|
|
6
|
+
blueprint hooks", "install hooks", "auto-retro after fixes", "auto-guard on commits",
|
|
7
|
+
"blueprint hooks", "configure automation", "what hooks are available?".
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Blueprint Hooks
|
|
11
|
+
|
|
12
|
+
Configure automatic triggers that embed blueprint into the development workflow.
|
|
13
|
+
Without hooks, blueprint is a tool you remember to use. With hooks, it speaks up on its own.
|
|
14
|
+
|
|
15
|
+
## Available Hooks
|
|
16
|
+
|
|
17
|
+
| Hook | Trigger | What it does | Default |
|
|
18
|
+
|------|---------|-------------|---------|
|
|
19
|
+
| **guard** | Pre-commit | Run `/blueprint:guard` on staged files | Off |
|
|
20
|
+
| **retro-suggest** | After fix workflows | Suggest `/blueprint:retro` | On |
|
|
21
|
+
| **architecture-sync** | After ADR transition | Suggest updating ARCHITECTURE.md + fitness functions | On |
|
|
22
|
+
| **dependency-watch** | package.json/requirements.txt change | Suggest `/blueprint:new` for tech choice | On |
|
|
23
|
+
| **periodic-health** | Every 20 sessions | Suggest `/blueprint:health` + `/blueprint:debt` | On |
|
|
24
|
+
|
|
25
|
+
## Process
|
|
26
|
+
|
|
27
|
+
### `/blueprint:hooks` (no args) — List Current Hooks
|
|
28
|
+
|
|
29
|
+
Read Claude Code settings.json and check for blueprint hook entries:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
cat ~/.claude/settings.json 2>/dev/null | grep -A5 "blueprint"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Display current hook status:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
39
|
+
BLUEPRINT ► HOOKS
|
|
40
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
41
|
+
|
|
42
|
+
| Hook | Status | Trigger |
|
|
43
|
+
|-------------------|-----------|---------|
|
|
44
|
+
| guard | ✗ Off | Pre-commit |
|
|
45
|
+
| retro-suggest | ✓ On | After fix workflows |
|
|
46
|
+
| architecture-sync | ✓ On | After ADR transition |
|
|
47
|
+
| dependency-watch | ✓ On | Dependency file change |
|
|
48
|
+
| periodic-health | ✓ On | Every 20 sessions |
|
|
49
|
+
|
|
50
|
+
/blueprint:hooks install guard — enable pre-commit guard
|
|
51
|
+
/blueprint:hooks remove guard — disable pre-commit guard
|
|
52
|
+
/blueprint:hooks install all — enable all hooks
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### `/blueprint:hooks install <hook>` — Install a Hook
|
|
56
|
+
|
|
57
|
+
Use the `update-config` skill to add the hook to Claude Code settings.json.
|
|
58
|
+
|
|
59
|
+
**guard hook** — adds a PreToolUse hook that runs before Bash git commit:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"hooks": {
|
|
64
|
+
"PreToolUse": [{
|
|
65
|
+
"matcher": "Bash",
|
|
66
|
+
"hooks": [{
|
|
67
|
+
"type": "command",
|
|
68
|
+
"command": "if echo \"$INPUT\" | grep -q 'git commit'; then echo 'Run /blueprint:guard first'; fi"
|
|
69
|
+
}]
|
|
70
|
+
}]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**retro-suggest hook** — adds a PostToolUse notification after fix-related tool calls:
|
|
76
|
+
|
|
77
|
+
The retro-suggest hook doesn't block — it adds a note after fix workflows suggesting
|
|
78
|
+
`/blueprint:retro`. This is implemented as a behavioral instruction in the project's
|
|
79
|
+
CLAUDE.md rather than a settings.json hook:
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
<!-- BEGIN blueprint-hooks -->
|
|
83
|
+
## Blueprint Automation
|
|
84
|
+
|
|
85
|
+
After completing any fix workflow (gsd:quick, rapid:quick, rapid:bug-fix, or manual
|
|
86
|
+
bug fix commits), suggest: "Fix is in. Run `/blueprint:retro` to check if it warrants
|
|
87
|
+
an ADR?"
|
|
88
|
+
|
|
89
|
+
After any ADR lifecycle transition (accept, reject, deprecate, supersede), suggest:
|
|
90
|
+
"ADR updated. Consider `/blueprint:architect` to refresh ARCHITECTURE.md and
|
|
91
|
+
`/blueprint:fitness` to update architecture tests."
|
|
92
|
+
|
|
93
|
+
When package.json, requirements.txt, pyproject.toml, go.mod, or Cargo.toml is modified,
|
|
94
|
+
check if the change introduces a new major dependency. If so, suggest:
|
|
95
|
+
"New dependency detected. Consider `/blueprint:new` to document this technology choice."
|
|
96
|
+
<!-- END blueprint-hooks -->
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**architecture-sync hook** — same CLAUDE.md section as above.
|
|
100
|
+
|
|
101
|
+
**dependency-watch hook** — same CLAUDE.md section as above.
|
|
102
|
+
|
|
103
|
+
**periodic-health hook** — adds a session counter note to state.toml:
|
|
104
|
+
|
|
105
|
+
```toml
|
|
106
|
+
[hooks]
|
|
107
|
+
sessions_since_health = 0
|
|
108
|
+
health_interval = 20
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The help and status commands check this counter and suggest `/blueprint:health` when
|
|
112
|
+
it exceeds the interval.
|
|
113
|
+
|
|
114
|
+
### `/blueprint:hooks remove <hook>` — Remove a Hook
|
|
115
|
+
|
|
116
|
+
Reverse the installation: remove the relevant section from settings.json or CLAUDE.md.
|
|
117
|
+
|
|
118
|
+
### `/blueprint:hooks install all` — Install All Hooks
|
|
119
|
+
|
|
120
|
+
Install all 5 hooks in one go. Present the configuration and ask for confirmation
|
|
121
|
+
before writing.
|
|
122
|
+
|
|
123
|
+
## Implementation Notes
|
|
124
|
+
|
|
125
|
+
Blueprint hooks are intentionally lightweight — they suggest, they don't block (except
|
|
126
|
+
guard, which is opt-in). The goal is to make architectural governance a natural part of
|
|
127
|
+
the workflow, not a gate that slows development.
|
|
128
|
+
|
|
129
|
+
Hooks that go into CLAUDE.md use the same fenced-section pattern as the main blueprint
|
|
130
|
+
installer (<!-- BEGIN --> / <!-- END -->). They're updated by re-running the hooks
|
|
131
|
+
command, never manually edited.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blueprint:impact
|
|
3
|
+
description: >
|
|
4
|
+
Analyze an ADR's impact on other decisions and the codebase. Detects conflicts, dependencies,
|
|
5
|
+
and affected components. Use when: "impact of adr N", "check adr N for conflicts", "does this
|
|
6
|
+
conflict with anything?", "adr impact N".
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# ADR Impact Analysis
|
|
10
|
+
|
|
11
|
+
Cross-references a target ADR against all accepted ADRs and the codebase to detect conflicts,
|
|
12
|
+
dependencies, and affected areas.
|
|
13
|
+
|
|
14
|
+
## Shared Context
|
|
15
|
+
|
|
16
|
+
Read from parent `adr/` directory:
|
|
17
|
+
- `config/state.toml` — ADR directory location
|
|
18
|
+
- `config/relationships.toml` — existing relationship graph
|
|
19
|
+
- `agents/persona.md` — personality
|
|
20
|
+
- `agents/adr-impact-analyzer.md` — agent instructions
|
|
21
|
+
|
|
22
|
+
## Process
|
|
23
|
+
|
|
24
|
+
1. Read the target ADR (user specifies by number)
|
|
25
|
+
2. Read `agents/adr-impact-analyzer.md` and `agents/persona.md`
|
|
26
|
+
3. Spawn `general-purpose` agent with:
|
|
27
|
+
- Full text of the target ADR
|
|
28
|
+
- ADR file path and directory path
|
|
29
|
+
- List of all ADR filenames
|
|
30
|
+
- Current relationship graph from `config/relationships.toml`
|
|
31
|
+
- Full agent instructions + persona
|
|
32
|
+
4. Present the impact report
|
|
33
|
+
5. **Update `config/relationships.toml`** with discovered edges (DEPENDS_ON, CONFLICTS, etc.)
|
|
34
|
+
6. If conflicts found, suggest:
|
|
35
|
+
- Resolve conflicts first
|
|
36
|
+
- Revise the target ADR
|
|
37
|
+
- Accept the tension with documentation
|
|
38
|
+
- Run `/blueprint:rearchitect` to supersede a conflicting decision
|