@crewpilot/agent 2.0.0 → 3.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/README.md +131 -131
- package/dist-npm/cli.js +5 -5
- package/dist-npm/index.js +100 -100
- package/package.json +69 -69
- package/prompts/agent.md +282 -282
- package/prompts/copilot-instructions.md +36 -36
- package/prompts/{catalyst.config.json → crewpilot.config.json} +72 -72
- package/prompts/skills/assure-code-quality/SKILL.md +112 -112
- package/prompts/skills/assure-pr-intelligence/SKILL.md +148 -148
- package/prompts/skills/assure-review-functional/SKILL.md +114 -114
- package/prompts/skills/assure-review-standards/SKILL.md +106 -106
- package/prompts/skills/assure-threat-model/SKILL.md +182 -182
- package/prompts/skills/assure-vulnerability-scan/SKILL.md +146 -146
- package/prompts/skills/autopilot-meeting/SKILL.md +434 -434
- package/prompts/skills/autopilot-worker/SKILL.md +737 -737
- package/prompts/skills/daily-digest/SKILL.md +188 -188
- package/prompts/skills/deliver-change-management/SKILL.md +132 -132
- package/prompts/skills/deliver-deploy-guard/SKILL.md +144 -144
- package/prompts/skills/deliver-doc-governance/SKILL.md +130 -130
- package/prompts/skills/engineer-feature-builder/SKILL.md +270 -270
- package/prompts/skills/engineer-root-cause-analysis/SKILL.md +150 -150
- package/prompts/skills/engineer-test-first/SKILL.md +148 -148
- package/prompts/skills/insights-knowledge-base/SKILL.md +202 -202
- package/prompts/skills/insights-pattern-detection/SKILL.md +142 -142
- package/prompts/skills/strategize-architecture-planner/SKILL.md +141 -141
- package/prompts/skills/strategize-solution-design/SKILL.md +118 -118
- package/scripts/postinstall.js +108 -108
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
# Pattern Detection
|
|
2
|
-
|
|
3
|
-
> **Pillar**: Insights | **ID**: `insights-pattern-detection`
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
Codebase-wide pattern mining and anti-pattern identification. Analyzes structural health, detects recurring issues, tracks technical debt, and identifies emerging trends across the project.
|
|
8
|
-
|
|
9
|
-
## Activation Triggers
|
|
10
|
-
|
|
11
|
-
- "codebase health", "find patterns", "anti-patterns", "tech debt"
|
|
12
|
-
- "what patterns are we using", "code trends", "structural analysis"
|
|
13
|
-
- Automatically triggered when `root-cause-analysis` finds a systemic issue
|
|
14
|
-
|
|
15
|
-
## Methodology
|
|
16
|
-
|
|
17
|
-
### Process Flow
|
|
18
|
-
|
|
19
|
-
```dot
|
|
20
|
-
digraph pattern_detection {
|
|
21
|
-
rankdir=TB;
|
|
22
|
-
node [shape=box];
|
|
23
|
-
|
|
24
|
-
structure [label="Phase 1\nStructure Scan"];
|
|
25
|
-
mining [label="Phase 2\nPattern Mining"];
|
|
26
|
-
antipattern [label="Phase 3\nAnti-Pattern Detection"];
|
|
27
|
-
debt [label="Phase 4\nTechnical Debt Inventory"];
|
|
28
|
-
trends [label="Phase 5\nTrend Analysis", shape=diamond];
|
|
29
|
-
report [label="Report", shape=doublecircle];
|
|
30
|
-
|
|
31
|
-
structure -> mining;
|
|
32
|
-
mining -> antipattern;
|
|
33
|
-
antipattern -> debt;
|
|
34
|
-
debt -> trends;
|
|
35
|
-
trends -> report [label="historical\ndata available"];
|
|
36
|
-
debt -> report [label="no historical data"];
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Phase 1 — Structure Scan
|
|
41
|
-
1. Map the project structure: directories, modules, layers
|
|
42
|
-
2. Identify architectural patterns in use:
|
|
43
|
-
- MVC, MVVM, Clean Architecture, Hexagonal
|
|
44
|
-
- Microservices vs. monolith vs. modular monolith
|
|
45
|
-
- API patterns: REST, GraphQL, RPC
|
|
46
|
-
3. Detect organizational patterns: feature-based vs. layer-based vs. hybrid
|
|
47
|
-
|
|
48
|
-
### Phase 2 — Pattern Mining
|
|
49
|
-
Scan for recurring code patterns:
|
|
50
|
-
|
|
51
|
-
| Category | Patterns to Detect |
|
|
52
|
-
|---|---|
|
|
53
|
-
| **Error handling** | Try-catch styles, error propagation, error types |
|
|
54
|
-
| **Data access** | ORM patterns, raw queries, repository pattern |
|
|
55
|
-
| **State management** | Global state, dependency injection, singletons |
|
|
56
|
-
| **API design** | Route organization, middleware chains, validation |
|
|
57
|
-
| **Testing** | Test structure, mock strategies, fixture patterns |
|
|
58
|
-
| **Configuration** | Env vars, config objects, feature flags |
|
|
59
|
-
|
|
60
|
-
For each pattern found:
|
|
61
|
-
- **Frequency**: How often it appears
|
|
62
|
-
- **Consistency**: Are there deviations from the pattern?
|
|
63
|
-
- **Quality**: Is this a good pattern for this context?
|
|
64
|
-
|
|
65
|
-
### Phase 3 — Anti-Pattern Detection
|
|
66
|
-
Flag known anti-patterns:
|
|
67
|
-
|
|
68
|
-
| Anti-Pattern | Symptoms |
|
|
69
|
-
|---|---|
|
|
70
|
-
| **God Object/File** | Single file > 500 lines with mixed responsibilities |
|
|
71
|
-
| **Circular Dependencies** | Module A imports B imports A |
|
|
72
|
-
| **Shotgun Surgery** | Small change requires touching 5+ files |
|
|
73
|
-
| **Feature Envy** | Function uses more of another module's data than its own |
|
|
74
|
-
| **Dead Code** | Unreachable functions, unused exports |
|
|
75
|
-
| **Copy-Paste** | Near-duplicate code blocks across files |
|
|
76
|
-
| **Primitive Obsession** | Strings/numbers used where domain types belong |
|
|
77
|
-
| **Configuration Drift** | Same setting configured differently in multiple places |
|
|
78
|
-
|
|
79
|
-
### Phase 4 — Technical Debt Inventory
|
|
80
|
-
For each anti-pattern or inconsistency:
|
|
81
|
-
1. Estimate effort to fix (T-shirt size)
|
|
82
|
-
2. Assess impact on team velocity
|
|
83
|
-
3. Rate urgency: address now vs. track vs. accept
|
|
84
|
-
|
|
85
|
-
### Phase 5 — Trend Analysis
|
|
86
|
-
If `
|
|
87
|
-
1. Compare current patterns vs. previous scans
|
|
88
|
-
2. Identify patterns that are spreading (good or bad)
|
|
89
|
-
3. Flag entropy increase — growing inconsistency over time
|
|
90
|
-
|
|
91
|
-
## Tools Required
|
|
92
|
-
|
|
93
|
-
- `codebase` — Full project scan
|
|
94
|
-
- `terminal` — Run static analysis tools
|
|
95
|
-
- `
|
|
96
|
-
- `
|
|
97
|
-
- `
|
|
98
|
-
|
|
99
|
-
## Output Format
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
## [
|
|
103
|
-
|
|
104
|
-
### Architecture
|
|
105
|
-
{detected patterns and organization style}
|
|
106
|
-
|
|
107
|
-
### Code Patterns
|
|
108
|
-
| Pattern | Category | Frequency | Consistency | Quality |
|
|
109
|
-
|---|---|---|---|---|
|
|
110
|
-
| {pattern} | {category} | {count} | {high/medium/low} | {good/acceptable/poor} |
|
|
111
|
-
|
|
112
|
-
### Anti-Patterns
|
|
113
|
-
| Anti-Pattern | Locations | Severity | Fix Effort |
|
|
114
|
-
|---|---|---|---|
|
|
115
|
-
| {anti-pattern} | {files/modules} | {high/med/low} | {T-shirt} |
|
|
116
|
-
|
|
117
|
-
### Technical Debt
|
|
118
|
-
| Item | Impact | Urgency | Effort |
|
|
119
|
-
|---|---|---|---|
|
|
120
|
-
| {debt item} | {velocity/quality/security} | {now/track/accept} | {T-shirt} |
|
|
121
|
-
|
|
122
|
-
### Trends (if historical data available)
|
|
123
|
-
{getting better / getting worse / stable}
|
|
124
|
-
|
|
125
|
-
### Summary
|
|
126
|
-
Codebase health: {score}/10
|
|
127
|
-
Top concern: {most impactful issue}
|
|
128
|
-
Quick wins: {list of low-effort improvements}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## Chains To
|
|
132
|
-
|
|
133
|
-
- `code-quality` — Deep review of flagged anti-pattern locations
|
|
134
|
-
- `architecture-planner` — Restructure if systemic issues found
|
|
135
|
-
- `knowledge-base` — Store scan results for trend tracking
|
|
136
|
-
|
|
137
|
-
## Anti-Patterns (meta)
|
|
138
|
-
|
|
139
|
-
- Do NOT flag patterns as anti-patterns based on ideology — evaluate in context
|
|
140
|
-
- Do NOT report dead code without verifying it's truly unreachable
|
|
141
|
-
- Do NOT recommend rewrites for working code with manageable debt
|
|
142
|
-
- Do NOT present a massive list without prioritization
|
|
1
|
+
# Pattern Detection
|
|
2
|
+
|
|
3
|
+
> **Pillar**: Insights | **ID**: `insights-pattern-detection`
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Codebase-wide pattern mining and anti-pattern identification. Analyzes structural health, detects recurring issues, tracks technical debt, and identifies emerging trends across the project.
|
|
8
|
+
|
|
9
|
+
## Activation Triggers
|
|
10
|
+
|
|
11
|
+
- "codebase health", "find patterns", "anti-patterns", "tech debt"
|
|
12
|
+
- "what patterns are we using", "code trends", "structural analysis"
|
|
13
|
+
- Automatically triggered when `root-cause-analysis` finds a systemic issue
|
|
14
|
+
|
|
15
|
+
## Methodology
|
|
16
|
+
|
|
17
|
+
### Process Flow
|
|
18
|
+
|
|
19
|
+
```dot
|
|
20
|
+
digraph pattern_detection {
|
|
21
|
+
rankdir=TB;
|
|
22
|
+
node [shape=box];
|
|
23
|
+
|
|
24
|
+
structure [label="Phase 1\nStructure Scan"];
|
|
25
|
+
mining [label="Phase 2\nPattern Mining"];
|
|
26
|
+
antipattern [label="Phase 3\nAnti-Pattern Detection"];
|
|
27
|
+
debt [label="Phase 4\nTechnical Debt Inventory"];
|
|
28
|
+
trends [label="Phase 5\nTrend Analysis", shape=diamond];
|
|
29
|
+
report [label="Report", shape=doublecircle];
|
|
30
|
+
|
|
31
|
+
structure -> mining;
|
|
32
|
+
mining -> antipattern;
|
|
33
|
+
antipattern -> debt;
|
|
34
|
+
debt -> trends;
|
|
35
|
+
trends -> report [label="historical\ndata available"];
|
|
36
|
+
debt -> report [label="no historical data"];
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Phase 1 — Structure Scan
|
|
41
|
+
1. Map the project structure: directories, modules, layers
|
|
42
|
+
2. Identify architectural patterns in use:
|
|
43
|
+
- MVC, MVVM, Clean Architecture, Hexagonal
|
|
44
|
+
- Microservices vs. monolith vs. modular monolith
|
|
45
|
+
- API patterns: REST, GraphQL, RPC
|
|
46
|
+
3. Detect organizational patterns: feature-based vs. layer-based vs. hybrid
|
|
47
|
+
|
|
48
|
+
### Phase 2 — Pattern Mining
|
|
49
|
+
Scan for recurring code patterns:
|
|
50
|
+
|
|
51
|
+
| Category | Patterns to Detect |
|
|
52
|
+
|---|---|
|
|
53
|
+
| **Error handling** | Try-catch styles, error propagation, error types |
|
|
54
|
+
| **Data access** | ORM patterns, raw queries, repository pattern |
|
|
55
|
+
| **State management** | Global state, dependency injection, singletons |
|
|
56
|
+
| **API design** | Route organization, middleware chains, validation |
|
|
57
|
+
| **Testing** | Test structure, mock strategies, fixture patterns |
|
|
58
|
+
| **Configuration** | Env vars, config objects, feature flags |
|
|
59
|
+
|
|
60
|
+
For each pattern found:
|
|
61
|
+
- **Frequency**: How often it appears
|
|
62
|
+
- **Consistency**: Are there deviations from the pattern?
|
|
63
|
+
- **Quality**: Is this a good pattern for this context?
|
|
64
|
+
|
|
65
|
+
### Phase 3 — Anti-Pattern Detection
|
|
66
|
+
Flag known anti-patterns:
|
|
67
|
+
|
|
68
|
+
| Anti-Pattern | Symptoms |
|
|
69
|
+
|---|---|
|
|
70
|
+
| **God Object/File** | Single file > 500 lines with mixed responsibilities |
|
|
71
|
+
| **Circular Dependencies** | Module A imports B imports A |
|
|
72
|
+
| **Shotgun Surgery** | Small change requires touching 5+ files |
|
|
73
|
+
| **Feature Envy** | Function uses more of another module's data than its own |
|
|
74
|
+
| **Dead Code** | Unreachable functions, unused exports |
|
|
75
|
+
| **Copy-Paste** | Near-duplicate code blocks across files |
|
|
76
|
+
| **Primitive Obsession** | Strings/numbers used where domain types belong |
|
|
77
|
+
| **Configuration Drift** | Same setting configured differently in multiple places |
|
|
78
|
+
|
|
79
|
+
### Phase 4 — Technical Debt Inventory
|
|
80
|
+
For each anti-pattern or inconsistency:
|
|
81
|
+
1. Estimate effort to fix (T-shirt size)
|
|
82
|
+
2. Assess impact on team velocity
|
|
83
|
+
3. Rate urgency: address now vs. track vs. accept
|
|
84
|
+
|
|
85
|
+
### Phase 5 — Trend Analysis
|
|
86
|
+
If `crewpilot_knowledge_search` has historical data:
|
|
87
|
+
1. Compare current patterns vs. previous scans
|
|
88
|
+
2. Identify patterns that are spreading (good or bad)
|
|
89
|
+
3. Flag entropy increase — growing inconsistency over time
|
|
90
|
+
|
|
91
|
+
## Tools Required
|
|
92
|
+
|
|
93
|
+
- `codebase` — Full project scan
|
|
94
|
+
- `terminal` — Run static analysis tools
|
|
95
|
+
- `crewpilot_metrics_complexity` — Complexity metrics per module
|
|
96
|
+
- `crewpilot_knowledge_search` — Historical pattern data
|
|
97
|
+
- `crewpilot_knowledge_store` — Record findings for future comparison
|
|
98
|
+
|
|
99
|
+
## Output Format
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
## [CrewPilot → Pattern Detection]
|
|
103
|
+
|
|
104
|
+
### Architecture
|
|
105
|
+
{detected patterns and organization style}
|
|
106
|
+
|
|
107
|
+
### Code Patterns
|
|
108
|
+
| Pattern | Category | Frequency | Consistency | Quality |
|
|
109
|
+
|---|---|---|---|---|
|
|
110
|
+
| {pattern} | {category} | {count} | {high/medium/low} | {good/acceptable/poor} |
|
|
111
|
+
|
|
112
|
+
### Anti-Patterns
|
|
113
|
+
| Anti-Pattern | Locations | Severity | Fix Effort |
|
|
114
|
+
|---|---|---|---|
|
|
115
|
+
| {anti-pattern} | {files/modules} | {high/med/low} | {T-shirt} |
|
|
116
|
+
|
|
117
|
+
### Technical Debt
|
|
118
|
+
| Item | Impact | Urgency | Effort |
|
|
119
|
+
|---|---|---|---|
|
|
120
|
+
| {debt item} | {velocity/quality/security} | {now/track/accept} | {T-shirt} |
|
|
121
|
+
|
|
122
|
+
### Trends (if historical data available)
|
|
123
|
+
{getting better / getting worse / stable}
|
|
124
|
+
|
|
125
|
+
### Summary
|
|
126
|
+
Codebase health: {score}/10
|
|
127
|
+
Top concern: {most impactful issue}
|
|
128
|
+
Quick wins: {list of low-effort improvements}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Chains To
|
|
132
|
+
|
|
133
|
+
- `code-quality` — Deep review of flagged anti-pattern locations
|
|
134
|
+
- `architecture-planner` — Restructure if systemic issues found
|
|
135
|
+
- `knowledge-base` — Store scan results for trend tracking
|
|
136
|
+
|
|
137
|
+
## Anti-Patterns (meta)
|
|
138
|
+
|
|
139
|
+
- Do NOT flag patterns as anti-patterns based on ideology — evaluate in context
|
|
140
|
+
- Do NOT report dead code without verifying it's truly unreachable
|
|
141
|
+
- Do NOT recommend rewrites for working code with manageable debt
|
|
142
|
+
- Do NOT present a massive list without prioritization
|
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
# Architecture Planner
|
|
2
|
-
|
|
3
|
-
> **Pillar**: Strategize | **ID**: `strategize-architecture-planner`
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
Transform decisions into concrete architecture plans with component diagrams, API contracts, data flow, and implementation roadmaps. Produces living design documents that evolve with the codebase.
|
|
8
|
-
|
|
9
|
-
## Activation Triggers
|
|
10
|
-
|
|
11
|
-
- "plan the architecture", "design the system", "create an RFC", "structure this"
|
|
12
|
-
- "how should I organize", "component diagram", "data flow", "API design"
|
|
13
|
-
- After `solution-design` selects an approach that needs detailing
|
|
14
|
-
|
|
15
|
-
## Methodology
|
|
16
|
-
|
|
17
|
-
### Process Flow
|
|
18
|
-
|
|
19
|
-
```dot
|
|
20
|
-
digraph architecture_planner {
|
|
21
|
-
rankdir=TB;
|
|
22
|
-
node [shape=box];
|
|
23
|
-
|
|
24
|
-
scope [label="Phase 1\nScope Definition"];
|
|
25
|
-
components [label="Phase 2\nComponent Design"];
|
|
26
|
-
dataflow [label="Phase 3\nData Flow"];
|
|
27
|
-
roadmap [label="Phase 4\nImplementation Roadmap"];
|
|
28
|
-
adr [label="Phase 5\nADR", shape=diamond, style=filled, fillcolor="#ffcccc"];
|
|
29
|
-
feature [label="feature-builder\n(Milestone M1)", shape=doublecircle];
|
|
30
|
-
|
|
31
|
-
scope -> components;
|
|
32
|
-
components -> dataflow;
|
|
33
|
-
dataflow -> roadmap;
|
|
34
|
-
roadmap -> adr;
|
|
35
|
-
adr -> feature [label="approved"];
|
|
36
|
-
adr -> components [label="user requests\nrevisions"];
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Phase 1 — Scope Definition
|
|
41
|
-
1. Identify system boundaries — what's in scope vs. out of scope
|
|
42
|
-
2. List actors (users, services, external systems)
|
|
43
|
-
3. Define key quality attributes: scalability, latency, availability, consistency
|
|
44
|
-
4. Read existing codebase structure to understand current architecture
|
|
45
|
-
|
|
46
|
-
### Phase 2 — Component Design
|
|
47
|
-
1. Decompose into components/modules with clear responsibilities
|
|
48
|
-
2. Define interfaces between components (API contracts, event schemas)
|
|
49
|
-
3. Identify shared dependencies and data stores
|
|
50
|
-
4. Map to existing code structure where applicable
|
|
51
|
-
|
|
52
|
-
Output as a component table:
|
|
53
|
-
|
|
54
|
-
| Component | Responsibility | Inputs | Outputs | Dependencies |
|
|
55
|
-
|---|---|---|---|---|
|
|
56
|
-
| | | | | |
|
|
57
|
-
|
|
58
|
-
### Phase 3 — Data Flow
|
|
59
|
-
1. Trace the primary user journey through the system
|
|
60
|
-
2. Identify data transformations at each step
|
|
61
|
-
3. Mark synchronous vs. asynchronous boundaries
|
|
62
|
-
4. Identify potential bottlenecks and failure points
|
|
63
|
-
|
|
64
|
-
Produce a numbered flow:
|
|
65
|
-
```
|
|
66
|
-
1. User → API Gateway (HTTPS)
|
|
67
|
-
2. API Gateway → Auth Service (validate token)
|
|
68
|
-
3. Auth Service → User DB (query)
|
|
69
|
-
...
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Phase 4 — Implementation Roadmap
|
|
73
|
-
1. Break into milestones (each independently deployable/testable)
|
|
74
|
-
2. Order by dependency graph — foundations first
|
|
75
|
-
3. Estimate effort per milestone (T-shirt sizes)
|
|
76
|
-
4. Identify the critical path
|
|
77
|
-
5. Mark "go/no-go" decision points
|
|
78
|
-
|
|
79
|
-
### Phase 5 — ADR (Architecture Decision Record)
|
|
80
|
-
|
|
81
|
-
<HARD-GATE>
|
|
82
|
-
Do NOT begin implementation until the architecture plan (components, data flow, roadmap) has been presented to and approved by the user.
|
|
83
|
-
If the user has not explicitly confirmed the architecture, do NOT proceed.
|
|
84
|
-
</HARD-GATE>
|
|
85
|
-
|
|
86
|
-
If `require_adr` is true in config, generate:
|
|
87
|
-
|
|
88
|
-
```markdown
|
|
89
|
-
# ADR-{NNN}: {Title}
|
|
90
|
-
|
|
91
|
-
## Status: Proposed
|
|
92
|
-
## Context: {why this decision is needed}
|
|
93
|
-
## Decision: {what was decided}
|
|
94
|
-
## Consequences: {positive and negative}
|
|
95
|
-
## Alternatives Considered: {options rejected and why}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Tools Required
|
|
99
|
-
|
|
100
|
-
- `codebase` — Analyze existing project structure and dependencies
|
|
101
|
-
- `terminal` — Run dependency analysis commands (package.json, imports, etc.)
|
|
102
|
-
- `
|
|
103
|
-
|
|
104
|
-
## Output Format
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
## [
|
|
108
|
-
|
|
109
|
-
### Scope
|
|
110
|
-
{boundaries, actors, quality attributes}
|
|
111
|
-
|
|
112
|
-
### Components
|
|
113
|
-
{component table}
|
|
114
|
-
|
|
115
|
-
### Data Flow
|
|
116
|
-
{numbered flow}
|
|
117
|
-
|
|
118
|
-
### Implementation Roadmap
|
|
119
|
-
| Milestone | Description | Effort | Dependencies |
|
|
120
|
-
|---|---|---|---|
|
|
121
|
-
| M1 | | | |
|
|
122
|
-
|
|
123
|
-
### Critical Path
|
|
124
|
-
{sequence}
|
|
125
|
-
|
|
126
|
-
### ADR (if enabled)
|
|
127
|
-
{ADR document}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## Chains To
|
|
131
|
-
|
|
132
|
-
- `feature-builder` — Start implementing milestone M1
|
|
133
|
-
- `test-first` — Write integration tests for component interfaces
|
|
134
|
-
- `doc-governance` — Ensure architecture docs stay synchronized
|
|
135
|
-
|
|
136
|
-
## Anti-Patterns
|
|
137
|
-
|
|
138
|
-
- Do NOT design in a vacuum — always scan the existing codebase first
|
|
139
|
-
- Do NOT create components with unclear responsibilities (god-service smell)
|
|
140
|
-
- Do NOT skip the roadmap — architecture without sequencing is just a diagram
|
|
141
|
-
- Do NOT ignore existing patterns — evolve, don't replace, unless explicitly asked
|
|
1
|
+
# Architecture Planner
|
|
2
|
+
|
|
3
|
+
> **Pillar**: Strategize | **ID**: `strategize-architecture-planner`
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Transform decisions into concrete architecture plans with component diagrams, API contracts, data flow, and implementation roadmaps. Produces living design documents that evolve with the codebase.
|
|
8
|
+
|
|
9
|
+
## Activation Triggers
|
|
10
|
+
|
|
11
|
+
- "plan the architecture", "design the system", "create an RFC", "structure this"
|
|
12
|
+
- "how should I organize", "component diagram", "data flow", "API design"
|
|
13
|
+
- After `solution-design` selects an approach that needs detailing
|
|
14
|
+
|
|
15
|
+
## Methodology
|
|
16
|
+
|
|
17
|
+
### Process Flow
|
|
18
|
+
|
|
19
|
+
```dot
|
|
20
|
+
digraph architecture_planner {
|
|
21
|
+
rankdir=TB;
|
|
22
|
+
node [shape=box];
|
|
23
|
+
|
|
24
|
+
scope [label="Phase 1\nScope Definition"];
|
|
25
|
+
components [label="Phase 2\nComponent Design"];
|
|
26
|
+
dataflow [label="Phase 3\nData Flow"];
|
|
27
|
+
roadmap [label="Phase 4\nImplementation Roadmap"];
|
|
28
|
+
adr [label="Phase 5\nADR", shape=diamond, style=filled, fillcolor="#ffcccc"];
|
|
29
|
+
feature [label="feature-builder\n(Milestone M1)", shape=doublecircle];
|
|
30
|
+
|
|
31
|
+
scope -> components;
|
|
32
|
+
components -> dataflow;
|
|
33
|
+
dataflow -> roadmap;
|
|
34
|
+
roadmap -> adr;
|
|
35
|
+
adr -> feature [label="approved"];
|
|
36
|
+
adr -> components [label="user requests\nrevisions"];
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Phase 1 — Scope Definition
|
|
41
|
+
1. Identify system boundaries — what's in scope vs. out of scope
|
|
42
|
+
2. List actors (users, services, external systems)
|
|
43
|
+
3. Define key quality attributes: scalability, latency, availability, consistency
|
|
44
|
+
4. Read existing codebase structure to understand current architecture
|
|
45
|
+
|
|
46
|
+
### Phase 2 — Component Design
|
|
47
|
+
1. Decompose into components/modules with clear responsibilities
|
|
48
|
+
2. Define interfaces between components (API contracts, event schemas)
|
|
49
|
+
3. Identify shared dependencies and data stores
|
|
50
|
+
4. Map to existing code structure where applicable
|
|
51
|
+
|
|
52
|
+
Output as a component table:
|
|
53
|
+
|
|
54
|
+
| Component | Responsibility | Inputs | Outputs | Dependencies |
|
|
55
|
+
|---|---|---|---|---|
|
|
56
|
+
| | | | | |
|
|
57
|
+
|
|
58
|
+
### Phase 3 — Data Flow
|
|
59
|
+
1. Trace the primary user journey through the system
|
|
60
|
+
2. Identify data transformations at each step
|
|
61
|
+
3. Mark synchronous vs. asynchronous boundaries
|
|
62
|
+
4. Identify potential bottlenecks and failure points
|
|
63
|
+
|
|
64
|
+
Produce a numbered flow:
|
|
65
|
+
```
|
|
66
|
+
1. User → API Gateway (HTTPS)
|
|
67
|
+
2. API Gateway → Auth Service (validate token)
|
|
68
|
+
3. Auth Service → User DB (query)
|
|
69
|
+
...
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Phase 4 — Implementation Roadmap
|
|
73
|
+
1. Break into milestones (each independently deployable/testable)
|
|
74
|
+
2. Order by dependency graph — foundations first
|
|
75
|
+
3. Estimate effort per milestone (T-shirt sizes)
|
|
76
|
+
4. Identify the critical path
|
|
77
|
+
5. Mark "go/no-go" decision points
|
|
78
|
+
|
|
79
|
+
### Phase 5 — ADR (Architecture Decision Record)
|
|
80
|
+
|
|
81
|
+
<HARD-GATE>
|
|
82
|
+
Do NOT begin implementation until the architecture plan (components, data flow, roadmap) has been presented to and approved by the user.
|
|
83
|
+
If the user has not explicitly confirmed the architecture, do NOT proceed.
|
|
84
|
+
</HARD-GATE>
|
|
85
|
+
|
|
86
|
+
If `require_adr` is true in config, generate:
|
|
87
|
+
|
|
88
|
+
```markdown
|
|
89
|
+
# ADR-{NNN}: {Title}
|
|
90
|
+
|
|
91
|
+
## Status: Proposed
|
|
92
|
+
## Context: {why this decision is needed}
|
|
93
|
+
## Decision: {what was decided}
|
|
94
|
+
## Consequences: {positive and negative}
|
|
95
|
+
## Alternatives Considered: {options rejected and why}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Tools Required
|
|
99
|
+
|
|
100
|
+
- `codebase` — Analyze existing project structure and dependencies
|
|
101
|
+
- `terminal` — Run dependency analysis commands (package.json, imports, etc.)
|
|
102
|
+
- `crewpilot_knowledge_search` — Retrieve prior architecture decisions
|
|
103
|
+
|
|
104
|
+
## Output Format
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
## [CrewPilot → Architecture Planner]
|
|
108
|
+
|
|
109
|
+
### Scope
|
|
110
|
+
{boundaries, actors, quality attributes}
|
|
111
|
+
|
|
112
|
+
### Components
|
|
113
|
+
{component table}
|
|
114
|
+
|
|
115
|
+
### Data Flow
|
|
116
|
+
{numbered flow}
|
|
117
|
+
|
|
118
|
+
### Implementation Roadmap
|
|
119
|
+
| Milestone | Description | Effort | Dependencies |
|
|
120
|
+
|---|---|---|---|
|
|
121
|
+
| M1 | | | |
|
|
122
|
+
|
|
123
|
+
### Critical Path
|
|
124
|
+
{sequence}
|
|
125
|
+
|
|
126
|
+
### ADR (if enabled)
|
|
127
|
+
{ADR document}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Chains To
|
|
131
|
+
|
|
132
|
+
- `feature-builder` — Start implementing milestone M1
|
|
133
|
+
- `test-first` — Write integration tests for component interfaces
|
|
134
|
+
- `doc-governance` — Ensure architecture docs stay synchronized
|
|
135
|
+
|
|
136
|
+
## Anti-Patterns
|
|
137
|
+
|
|
138
|
+
- Do NOT design in a vacuum — always scan the existing codebase first
|
|
139
|
+
- Do NOT create components with unclear responsibilities (god-service smell)
|
|
140
|
+
- Do NOT skip the roadmap — architecture without sequencing is just a diagram
|
|
141
|
+
- Do NOT ignore existing patterns — evolve, don't replace, unless explicitly asked
|