@atlashub/smartstack-cli 3.25.0 → 3.27.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/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-entry.mjs +11 -5
- package/dist/mcp-entry.mjs.map +1 -1
- package/package.json +1 -2
- package/templates/skills/apex/SKILL.md +26 -5
- package/templates/skills/apex/_shared.md +3 -3
- package/templates/skills/apex/references/agent-teams-protocol.md +8 -8
- package/templates/skills/apex/references/challenge-questions.md +165 -0
- package/templates/skills/apex/{steps/step-04-validate.md → references/post-checks.md} +82 -214
- package/templates/skills/apex/references/smartstack-api.md +91 -14
- package/templates/skills/apex/references/smartstack-layers.md +16 -4
- package/templates/skills/apex/steps/step-00-init.md +84 -56
- package/templates/skills/apex/steps/step-01-analyze.md +73 -87
- package/templates/skills/apex/steps/step-03-execute.md +2 -2
- package/templates/skills/apex/steps/step-04-examine.md +198 -0
- package/templates/skills/apex/steps/{step-05-examine.md → step-05-deep-review.md} +6 -6
- package/templates/skills/apex/steps/step-06-resolve.md +2 -2
- package/templates/skills/business-analyse/SKILL.md +28 -0
- package/templates/skills/business-analyse/references/agent-module-prompt.md +255 -0
- package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +26 -10
- package/templates/skills/business-analyse/references/team-orchestration.md +437 -0
- package/templates/skills/business-analyse/steps/step-02-decomposition.md +31 -4
- package/templates/skills/business-analyse/steps/step-03a1-setup.md +21 -0
- package/templates/skills/business-analyse/steps/step-03d-validate.md +84 -0
- package/templates/skills/ralph-loop/references/core-seed-data.md +45 -10
- package/templates/skills/ralph-loop/steps/step-02-execute.md +47 -0
|
@@ -38,26 +38,11 @@ This saves ~2 minutes of Glob searches on an empty project.
|
|
|
38
38
|
|
|
39
39
|
Read available context (in order of priority):
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- permissionMatrix
|
|
47
|
-
- acceptance criteria
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**B. Feature.json (if exists):**
|
|
51
|
-
```
|
|
52
|
-
Read {feature_path} → extract:
|
|
53
|
-
- Module structure (sections, resources)
|
|
54
|
-
- Business rules
|
|
55
|
-
- Entity definitions
|
|
56
|
-
- Permission structure
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**C. Task description only:**
|
|
60
|
-
If neither PRD nor feature.json exists, rely on task description and code exploration.
|
|
41
|
+
| Source | Action |
|
|
42
|
+
|--------|--------|
|
|
43
|
+
| PRD (`{prd_path}`) | Extract: filesToCreate, brToCodeMapping, permissionMatrix, acceptance criteria |
|
|
44
|
+
| Feature.json (`{feature_path}`) | Extract: module structure, business rules, entity definitions, permissions |
|
|
45
|
+
| Task description only | Rely on task description and code exploration |
|
|
61
46
|
|
|
62
47
|
---
|
|
63
48
|
|
|
@@ -65,8 +50,6 @@ If neither PRD nor feature.json exists, rely on task description and code explor
|
|
|
65
50
|
|
|
66
51
|
### If economy_mode: Direct Tools
|
|
67
52
|
|
|
68
|
-
Use Glob, Grep, Read, and MCP tools directly:
|
|
69
|
-
|
|
70
53
|
```
|
|
71
54
|
Backend:
|
|
72
55
|
- Glob("**/Domain/Entities/**/{module_code}/**/*.cs")
|
|
@@ -91,116 +74,119 @@ MCP:
|
|
|
91
74
|
```
|
|
92
75
|
TeamCreate("apex-analyze", description: "Scan SmartStack project for existing code")
|
|
93
76
|
|
|
94
|
-
Spawn 3 teammates (
|
|
77
|
+
Spawn 3 teammates (subagent_type: "Explore", model: "sonnet"):
|
|
95
78
|
|
|
96
79
|
1. scan-backend:
|
|
97
|
-
"Scan backend
|
|
98
|
-
|
|
99
|
-
Report: file paths, class names, key patterns found.
|
|
100
|
-
Folders: Domain/, Infrastructure/, Application/, Api/"
|
|
80
|
+
"Scan backend for module {module_code}: entities, EF configs, services,
|
|
81
|
+
DTOs, validators, controllers in Domain/ + Infrastructure/ + Application/ + Api/"
|
|
101
82
|
|
|
102
83
|
2. scan-frontend:
|
|
103
|
-
"Scan frontend
|
|
104
|
-
|
|
105
|
-
Report: file paths, component names, route patterns.
|
|
106
|
-
Folders: src/pages/, src/components/, src/locales/"
|
|
84
|
+
"Scan frontend for module {module_code}: pages, components, hooks,
|
|
85
|
+
i18n files, route definitions in src/pages/ + src/components/ + src/locales/"
|
|
107
86
|
|
|
108
87
|
3. scan-context:
|
|
109
|
-
"Read context artifacts for module {module_code}
|
|
110
|
-
|
|
111
|
-
Report: sections, entities, business rules, permissions, acceptance criteria."
|
|
88
|
+
"Read context artifacts for module {module_code}: .ralph/prd-{module_code}.json,
|
|
89
|
+
docs/business/**/feature.json → extract sections, entities, rules, permissions, ACs"
|
|
112
90
|
|
|
113
|
-
Wait for all 3
|
|
114
|
-
Aggregate results.
|
|
115
|
-
|
|
116
|
-
Shutdown teammates → TeamDelete("apex-analyze")
|
|
91
|
+
Wait for all 3 → aggregate results → shutdown → TeamDelete("apex-analyze")
|
|
117
92
|
```
|
|
118
93
|
|
|
119
94
|
---
|
|
120
95
|
|
|
121
96
|
## 3. Seed Data Inventory
|
|
122
97
|
|
|
123
|
-
Check existing seed data:
|
|
124
|
-
|
|
125
98
|
```
|
|
126
99
|
Glob("**/Seeding/Data/{module_code}/*SeedData.cs")
|
|
127
100
|
Glob("**/Seeding/*SeedDataProvider.cs")
|
|
128
101
|
```
|
|
129
102
|
|
|
130
|
-
Identify:
|
|
131
|
-
- NavigationModuleSeedData: exists? complete?
|
|
132
|
-
- PermissionsSeedData: exists? complete?
|
|
133
|
-
- RolesSeedData: exists? complete?
|
|
134
|
-
- SeedConstants: exists?
|
|
135
|
-
- IClientSeedDataProvider: exists? registered in DI?
|
|
103
|
+
Identify: NavigationModuleSeedData, PermissionsSeedData, RolesSeedData, SeedConstants, IClientSeedDataProvider (+ DI registration).
|
|
136
104
|
|
|
137
105
|
---
|
|
138
106
|
|
|
139
107
|
## 4. FK Field Detection
|
|
140
108
|
|
|
141
109
|
For each entity found (or to be created), identify FK relationships:
|
|
110
|
+
- Properties ending in "Id" with matching navigation property
|
|
111
|
+
- Record: `{ entity, fkProperty, targetEntity, isRequired }`
|
|
112
|
+
|
|
113
|
+
**Why:** FK fields drive two critical requirements:
|
|
114
|
+
1. **Frontend:** Each FK field MUST use `EntityLookup` (NEVER plain text for GUIDs)
|
|
115
|
+
2. **Backend:** Each target entity's GetAll MUST support `?search=`
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 5. Gap Analysis
|
|
120
|
+
|
|
121
|
+
Compare what EXISTS vs what the TASK REQUIRES:
|
|
142
122
|
|
|
143
123
|
```
|
|
144
|
-
For each
|
|
145
|
-
- List properties ending in "Id" with a matching navigation property (e.g., EmployeeId + Employee)
|
|
146
|
-
- Record: { fkProperty, targetEntity, isRequired }
|
|
147
|
-
|
|
148
|
-
Output:
|
|
149
|
-
fkFields: [
|
|
150
|
-
{ entity: "TimeEntry", fkProperty: "EmployeeId", targetEntity: "Employee", isRequired: true },
|
|
151
|
-
{ entity: "TimeEntry", fkProperty: "ProjectId", targetEntity: "Project", isRequired: true }
|
|
152
|
-
]
|
|
124
|
+
For each element: EXISTS+COMPLETE → "skip" | EXISTS+INCOMPLETE → "modify" | MISSING → "create"
|
|
153
125
|
```
|
|
154
126
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
These are propagated to step-02 (plan) and step-03 (execute).
|
|
127
|
+
Cross-reference with step-00 challenge responses:
|
|
128
|
+
- Each entity: entity, EF config, service, controller, frontend pages → exists/missing
|
|
129
|
+
- Each section: NavigationSectionSeedData, frontend route → exists/missing
|
|
130
|
+
- If dependencies: verify FK target entities and their `?search=` support
|
|
160
131
|
|
|
161
132
|
---
|
|
162
133
|
|
|
163
|
-
##
|
|
134
|
+
## 6. Analysis Validation (User Checkpoint)
|
|
164
135
|
|
|
165
|
-
|
|
136
|
+
> **Objective:** Present findings and validate scope with the user BEFORE planning.
|
|
137
|
+
|
|
138
|
+
### 6a. Present Findings
|
|
166
139
|
|
|
167
140
|
```
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
141
|
+
ANALYSIS FINDINGS
|
|
142
|
+
═══════════════════════════════════════════════════════════════
|
|
143
|
+
|
|
144
|
+
Entities expected / found / to create: {summary}
|
|
145
|
+
Sections expected / found / to create: {summary}
|
|
146
|
+
FK Relationships: {fkFields summary}
|
|
147
|
+
Dependencies: {cross-module refs or "none"}
|
|
148
|
+
Complexity: {module_complexity}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 6b. Validate with User (if NOT auto_mode)
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
154
|
+
questions:
|
|
155
|
+
- header: "Scope"
|
|
156
|
+
question: "Based on the analysis above, is the scope accurate?"
|
|
157
|
+
options:
|
|
158
|
+
- label: "Scope is correct (Recommended)"
|
|
159
|
+
description: "Proceed to planning with the identified elements"
|
|
160
|
+
- label: "Add elements"
|
|
161
|
+
description: "I need to add entities, properties, or sections"
|
|
162
|
+
- label: "Reduce scope"
|
|
163
|
+
description: "Remove some elements — smaller first iteration"
|
|
164
|
+
- label: "Change approach"
|
|
165
|
+
description: "The analysis reveals issues — let's adjust"
|
|
166
|
+
multiSelect: false
|
|
172
167
|
```
|
|
173
168
|
|
|
169
|
+
If "Add elements": update `{entities}`, `{sections}`, `{key_properties}`, re-run gap analysis.
|
|
170
|
+
If "Reduce scope": update variables accordingly.
|
|
171
|
+
If "Change approach": discuss with user, potentially restart from step-00.
|
|
172
|
+
|
|
174
173
|
---
|
|
175
174
|
|
|
176
|
-
##
|
|
175
|
+
## 7. Analysis Summary
|
|
177
176
|
|
|
178
177
|
```
|
|
179
178
|
**APEX SmartStack - Analysis Complete**
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
- Frontend pages: {list with paths}
|
|
187
|
-
- Seed data: {status per type}
|
|
188
|
-
- Tests: {list with paths}
|
|
189
|
-
|
|
190
|
-
**Required Changes:**
|
|
191
|
-
- Create: {list of new files/elements}
|
|
192
|
-
- Modify: {list of files to change}
|
|
193
|
-
- Skip: {list of existing complete elements}
|
|
194
|
-
|
|
195
|
-
**Acceptance Criteria:** (inferred from PRD/feature/task)
|
|
196
|
-
- AC1: {criterion}
|
|
197
|
-
- AC2: {criterion}
|
|
198
|
-
...
|
|
179
|
+
Navigation: {context_code} → {app_name} → {module_code} → {sections[].code}
|
|
180
|
+
Entities: {entity_name → create | modify | skip}
|
|
181
|
+
Existing: entities, configs, services, controllers, pages, seed data, tests (with paths)
|
|
182
|
+
Required: create / modify / skip lists
|
|
183
|
+
Profile: complexity, dependencies, FK fields, workflow, notifications
|
|
184
|
+
ACs: AC1..ACn (inferred from PRD/feature/task/challenge)
|
|
199
185
|
```
|
|
200
186
|
|
|
201
187
|
---
|
|
202
188
|
|
|
203
|
-
##
|
|
189
|
+
## 8. Save Output (if save_mode)
|
|
204
190
|
|
|
205
191
|
Write to `{output_dir}/01-analyze.md` with analysis results.
|
|
206
192
|
|
|
@@ -3,7 +3,7 @@ name: step-03-execute
|
|
|
3
3
|
description: Orchestrate code creation via existing skills and MCP tools
|
|
4
4
|
model: opus
|
|
5
5
|
prev_step: steps/step-02-plan.md
|
|
6
|
-
next_step: steps/step-04-
|
|
6
|
+
next_step: steps/step-04-examine.md
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Step 3: Execute
|
|
@@ -207,4 +207,4 @@ Write to `{output_dir}/03-execute.md` with execution log per layer.
|
|
|
207
207
|
|
|
208
208
|
## NEXT STEP
|
|
209
209
|
|
|
210
|
-
Load `steps/step-04-
|
|
210
|
+
Load `steps/step-04-examine.md`
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-04-examine
|
|
3
|
+
description: MCP validation, build verification, seed data check, acceptance criteria
|
|
4
|
+
model: opus
|
|
5
|
+
prev_step: steps/step-03-execute.md
|
|
6
|
+
next_step: steps/step-05-deep-review.md
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Step 4: eXamine
|
|
10
|
+
|
|
11
|
+
> **This is the X in APEX.** Mandatory automated examination of all generated code.
|
|
12
|
+
|
|
13
|
+
**Goal:** Verify everything works. MCP conventions, build, seed data, acceptance criteria.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. MCP Convention Validation
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Call: mcp__smartstack__validate_conventions
|
|
21
|
+
|
|
22
|
+
Expected: 0 errors
|
|
23
|
+
If errors found:
|
|
24
|
+
→ Fix each error (use appropriate skill/MCP)
|
|
25
|
+
→ Re-validate until 0 errors
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. EF Core Migration Check (if needs_migration)
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
Call: mcp__smartstack__check_migrations
|
|
34
|
+
|
|
35
|
+
Verify:
|
|
36
|
+
- Migration exists and is applied
|
|
37
|
+
- No pending model changes
|
|
38
|
+
- ModelSnapshot matches
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 3. Frontend Route Validation (if frontend modified)
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Call: mcp__smartstack__validate_frontend_routes
|
|
47
|
+
|
|
48
|
+
Verify:
|
|
49
|
+
- Routes nested inside correct Layout wrapper
|
|
50
|
+
- Route paths match controller patterns
|
|
51
|
+
- No orphan routes
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 4. Build Verification
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Cleanup corrupted EF Core design-time artifacts (Roslyn BuildHost bug on Windows)
|
|
60
|
+
for d in src/*/bin?Debug; do [ -d "$d" ] && echo "Removing corrupted artifact: $d" && rm -rf "$d"; done
|
|
61
|
+
|
|
62
|
+
# Backend
|
|
63
|
+
dotnet clean && dotnet restore && dotnet build
|
|
64
|
+
|
|
65
|
+
# Frontend (if applicable)
|
|
66
|
+
npm run typecheck
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**BLOCKING:** Both must pass. If failure, fix and retry.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 5. Database & Migration Validation (if needs_migration)
|
|
74
|
+
|
|
75
|
+
### 5a. Pending Model Changes Check
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
INFRA_PROJECT=$(ls src/*Infrastructure*/*.csproj 2>/dev/null | head -1)
|
|
79
|
+
API_PROJECT=$(ls src/*Api*/*.csproj 2>/dev/null | head -1)
|
|
80
|
+
|
|
81
|
+
dotnet ef migrations has-pending-model-changes \
|
|
82
|
+
--project "$INFRA_PROJECT" \
|
|
83
|
+
--startup-project "$API_PROJECT"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**BLOCKING** if pending changes detected → migration is missing.
|
|
87
|
+
|
|
88
|
+
### 5b. Migration Application Test (SQL Server LocalDB)
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
DB_NAME="SmartStack_Apex_Examine_$(date +%s)"
|
|
92
|
+
CONN_STRING="Server=(localdb)\\MSSQLLocalDB;Database=$DB_NAME;Integrated Security=true;TrustServerCertificate=true;Connect Timeout=120;"
|
|
93
|
+
|
|
94
|
+
dotnet ef database update \
|
|
95
|
+
--connection "$CONN_STRING" \
|
|
96
|
+
--project "$INFRA_PROJECT" \
|
|
97
|
+
--startup-project "$API_PROJECT"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**BLOCKING** if migration fails on SQL Server. Common issues:
|
|
101
|
+
- SQLite-only syntax in migrations (fix: regenerate migration)
|
|
102
|
+
- Column type mismatches (fix: update EF configuration)
|
|
103
|
+
- Missing foreign key targets (fix: reorder migrations)
|
|
104
|
+
|
|
105
|
+
### 5c. Integration Tests on Real SQL Server
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Integration tests use DatabaseFixture → real SQL Server LocalDB
|
|
109
|
+
# This validates: LINQ→SQL, multi-tenant isolation, soft delete, EF configs
|
|
110
|
+
INT_TEST_PROJECT=$(ls tests/*Tests.Integration*/*.csproj 2>/dev/null | head -1)
|
|
111
|
+
if [ -n "$INT_TEST_PROJECT" ]; then
|
|
112
|
+
dotnet test "$INT_TEST_PROJECT" --no-build --verbosity normal
|
|
113
|
+
fi
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Tests running against SQL Server catch issues that SQLite misses:
|
|
117
|
+
- Case sensitivity in string comparisons
|
|
118
|
+
- Date/time function differences
|
|
119
|
+
- IDENTITY vs AUTOINCREMENT behavior
|
|
120
|
+
- Global query filter translation to T-SQL
|
|
121
|
+
|
|
122
|
+
### 5d. Cleanup
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
sqlcmd -S "(localdb)\MSSQLLocalDB" -Q "IF DB_ID('$DB_NAME') IS NOT NULL BEGIN ALTER DATABASE [$DB_NAME] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DROP DATABASE [$DB_NAME]; END" 2>/dev/null
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 6. Seed Data Completeness Check (if needs_seed_data)
|
|
131
|
+
|
|
132
|
+
| File | Checks |
|
|
133
|
+
|------|--------|
|
|
134
|
+
| NavigationApplicationSeedData | MUST be first, deterministic GUID for application (NOT for context — context is looked up by code), 4 lang translations |
|
|
135
|
+
| NavigationModuleSeedData | Deterministic GUIDs (SHA256), 4 languages, GetModuleEntry + GetTranslationEntries |
|
|
136
|
+
| PermissionsSeedData | MCP generate_permissions used, paths match Permissions.cs, wildcard + CRUD |
|
|
137
|
+
| RolesSeedData | Admin=wildcard, Manager=CRU, Contributor=CR, Viewer=R |
|
|
138
|
+
| IClientSeedDataProvider | 3 Seed methods, idempotent, factory methods, SaveChanges per group |
|
|
139
|
+
| DI Registration | `services.AddScoped<IClientSeedDataProvider, {App}SeedDataProvider>()` |
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 6b. BLOCKING POST-CHECKs
|
|
144
|
+
|
|
145
|
+
Load and execute all checks from `references/post-checks.md`.
|
|
146
|
+
|
|
147
|
+
**If ANY POST-CHECK fails → fix in step-03, re-validate.**
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 7. Acceptance Criteria POST-CHECK
|
|
152
|
+
|
|
153
|
+
For each AC inferred in step-01:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
AC1: {criterion} → PASS / FAIL (evidence: {file:line or test})
|
|
157
|
+
AC2: {criterion} → PASS / FAIL (evidence: {file:line or test})
|
|
158
|
+
...
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**All ACs must PASS. If any FAIL, go back to step-03 to fix.**
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 8. eXamine Summary
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
**APEX SmartStack - eXamine Complete**
|
|
169
|
+
|
|
170
|
+
| Category | Checks | Status |
|
|
171
|
+
|----------|--------|--------|
|
|
172
|
+
| MCP conventions | validate_conventions | PASS (0 errors) |
|
|
173
|
+
| Build | dotnet build + npm typecheck | PASS |
|
|
174
|
+
| EF Core | migrations, pending changes, SQL Server apply | PASS / N/A |
|
|
175
|
+
| DB tests | Integration tests on SQL Server | PASS / N/A |
|
|
176
|
+
| Frontend | routes, lazy loading, forms as pages, i18n (4 langs + keys) | PASS / N/A |
|
|
177
|
+
| Security | TenantId filter, RequirePermission, no Guid.Empty, no !.Value | PASS / N/A |
|
|
178
|
+
| Seed data | completeness, deterministic GUIDs, no ContextId/RoleId constants | PASS / N/A |
|
|
179
|
+
| Code quality | PaginatedResult, EntityLookup, CSS vars, search param | PASS / N/A |
|
|
180
|
+
| POST-CHECKs | 21 checks from references/post-checks.md | PASS / N/A |
|
|
181
|
+
| Acceptance criteria | AC1..ACn | {X}/{Y} PASS |
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 9. Save Output (if save_mode)
|
|
187
|
+
|
|
188
|
+
Write to `{output_dir}/04-examine.md` with validation results.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 10. Route to Next Step
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
examine_mode → step-05-deep-review | test_mode → step-07-tests | pr_mode → create PR | else → final summary
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**FINAL SUMMARY (if no more steps):** task, context, files created/modified, validation status, commits count, next steps.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: step-05-
|
|
2
|
+
name: step-05-deep-review
|
|
3
3
|
description: Adversarial code review of changes — find issues before they reach production
|
|
4
4
|
model: opus
|
|
5
|
-
prev_step: steps/step-04-
|
|
5
|
+
prev_step: steps/step-04-examine.md
|
|
6
6
|
next_step: steps/step-06-resolve.md
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
# Step 5:
|
|
9
|
+
# Step 5: Deep Review (if -x)
|
|
10
10
|
|
|
11
|
-
**Goal:** Review the code as an adversarial external reviewer. Find bugs, security issues, and convention violations that automated checks missed.
|
|
11
|
+
**Goal:** Review the code as an adversarial external reviewer. Find bugs, security issues, and convention violations that the automated eXamine checks (step-04) missed.
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -98,7 +98,7 @@ For each issue found, classify:
|
|
|
98
98
|
## 5. Summary
|
|
99
99
|
|
|
100
100
|
```
|
|
101
|
-
**APEX SmartStack -
|
|
101
|
+
**APEX SmartStack - Deep Review Complete**
|
|
102
102
|
|
|
103
103
|
**Files reviewed:** {count}
|
|
104
104
|
**Findings:** {blocking} BLOCKING, {suggestions} SUGGESTION, {nits} NIT
|
|
@@ -110,7 +110,7 @@ For each issue found, classify:
|
|
|
110
110
|
|
|
111
111
|
## 6. Save Output (if save_mode)
|
|
112
112
|
|
|
113
|
-
Write to `{output_dir}/05-
|
|
113
|
+
Write to `{output_dir}/05-deep-review.md` with all findings.
|
|
114
114
|
|
|
115
115
|
---
|
|
116
116
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
name: step-06-resolve
|
|
3
3
|
description: Fix BLOCKING findings from adversarial review
|
|
4
4
|
model: opus
|
|
5
|
-
prev_step: steps/step-05-
|
|
5
|
+
prev_step: steps/step-05-deep-review.md
|
|
6
6
|
next_step: steps/step-07-tests.md
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Step 6: Resolve (if BLOCKING findings)
|
|
10
10
|
|
|
11
|
-
**Goal:** Fix all BLOCKING findings from step-05. Re-validate after fixes.
|
|
11
|
+
**Goal:** Fix all BLOCKING findings from Deep Review (step-05). Re-validate after fixes.
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -271,8 +271,36 @@ Load ONLY relevant categories based on feature type:
|
|
|
271
271
|
- **Follow next_step directive** at end of each step
|
|
272
272
|
- **Context: business only** - Reject platform/personal/system contexts
|
|
273
273
|
- **Use parallel agents** for codebase exploration
|
|
274
|
+
- **Team mode** (2+ modules): After step-02, load `references/team-orchestration.md` and follow team protocol
|
|
275
|
+
- **Inline mode** (1 module): Classic sequential execution, no team
|
|
274
276
|
</execution_rules>
|
|
275
277
|
|
|
278
|
+
<team_mode>
|
|
279
|
+
**Automatic team activation for multi-module applications:**
|
|
280
|
+
|
|
281
|
+
| Condition | Mode |
|
|
282
|
+
|-----------|------|
|
|
283
|
+
| 1 module | Inline (classic, no team) |
|
|
284
|
+
| 2+ modules | Team mode (Propose & Review) |
|
|
285
|
+
|
|
286
|
+
**Team mode workflow (Propose & Review):**
|
|
287
|
+
1. Steps 00-02 execute inline in the main conversation (interactive with user)
|
|
288
|
+
2. After step-02 decomposition: `TeamCreate({ team_name: "ba-{appName}" })`
|
|
289
|
+
3. For each module: spawn autonomous agent, agent proposes complete specification, team lead presents to user for validation
|
|
290
|
+
4. After all modules specified: spawn consolidation agent (steps 04a + 04b), present report for user approval (04c)
|
|
291
|
+
5. After consolidation approved: spawn handoff agent (steps 05a + 05b + 05c)
|
|
292
|
+
6. `TeamDelete()` cleanup
|
|
293
|
+
|
|
294
|
+
**Why team mode:**
|
|
295
|
+
- Each module agent gets a **fresh context window** (zero accumulation)
|
|
296
|
+
- The team lead stays lightweight (< 30% context even with 10+ modules)
|
|
297
|
+
- Module agents work **autonomously** (no AskUserQuestion — they PROPOSE, user REVIEWS)
|
|
298
|
+
- Error recovery: if an agent crashes, respawn with same module context from feature.json
|
|
299
|
+
|
|
300
|
+
**Reference:** `references/team-orchestration.md` (loaded by step-02 after decomposition)
|
|
301
|
+
**Agent prompt template:** `references/agent-module-prompt.md`
|
|
302
|
+
</team_mode>
|
|
303
|
+
|
|
276
304
|
<success_criteria>
|
|
277
305
|
|
|
278
306
|
- Master feature.json created and enriched progressively through all steps
|