@atlashub/smartstack-cli 3.37.0 → 3.39.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 +16 -24
- package/dist/index.js.map +1 -1
- package/dist/mcp-entry.mjs +235 -265
- package/dist/mcp-entry.mjs.map +1 -1
- package/package.json +1 -1
- package/scripts/extract-api-endpoints.ts +5 -5
- package/scripts/generate-doc-with-mock-ui.ts +10 -17
- package/templates/agents/ba-reader.md +9 -9
- package/templates/agents/ba-writer.md +12 -15
- package/templates/agents/code-reviewer.md +1 -1
- package/templates/agents/docs-context-reader.md +1 -1
- package/templates/agents/efcore/scan.md +3 -1
- package/templates/agents/gitflow/commit.md +74 -0
- package/templates/agents/gitflow/finish.md +5 -2
- package/templates/agents/gitflow/init-clone.md +3 -3
- package/templates/agents/gitflow/init-validate.md +3 -2
- package/templates/agents/gitflow/merge.md +5 -4
- package/templates/agents/gitflow/pr.md +5 -4
- package/templates/agents/gitflow/start.md +37 -5
- package/templates/hooks/hooks.json +11 -0
- package/templates/hooks/wsl-dotnet-cleanup.sh +24 -0
- package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +20 -20
- package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +16 -24
- package/templates/mcp-scaffolding/migrations/seed-roles.cs.hbs +2 -2
- package/templates/skills/_resources/mcp-validate-documentation-spec.md +3 -3
- package/templates/skills/_shared.md +15 -17
- package/templates/skills/ai-prompt/SKILL.md +1 -1
- package/templates/skills/ai-prompt/steps/step-00-init.md +47 -0
- package/templates/skills/apex/SKILL.md +3 -4
- package/templates/skills/apex/_shared.md +10 -20
- package/templates/skills/apex/references/analysis-methods.md +141 -0
- package/templates/skills/apex/references/challenge-questions.md +1 -21
- package/templates/skills/apex/references/core-seed-data.md +35 -58
- package/templates/skills/apex/references/examine-build-validation.md +82 -0
- package/templates/skills/apex/references/execution-frontend-gates.md +177 -0
- package/templates/skills/apex/references/execution-frontend-patterns.md +105 -0
- package/templates/skills/apex/references/execution-layer1-rules.md +96 -0
- package/templates/skills/apex/references/initialization-challenge-flow.md +110 -0
- package/templates/skills/apex/references/planning-layer-mapping.md +151 -0
- package/templates/skills/apex/references/post-checks.md +145 -40
- package/templates/skills/apex/references/smartstack-api.md +35 -51
- package/templates/skills/apex/references/smartstack-frontend.md +18 -18
- package/templates/skills/apex/references/smartstack-layers.md +38 -62
- package/templates/skills/apex/steps/step-00-init.md +14 -26
- package/templates/skills/apex/steps/step-01-analyze.md +10 -143
- package/templates/skills/apex/steps/step-02-plan.md +10 -92
- package/templates/skills/apex/steps/step-03-execute.md +45 -252
- package/templates/skills/apex/steps/step-04-examine.md +14 -78
- package/templates/skills/apex/steps/step-05-deep-review.md +2 -2
- package/templates/skills/apex/steps/step-08-run-tests.md +1 -0
- package/templates/skills/application/SKILL.md +241 -242
- package/templates/skills/application/references/backend-controller-hierarchy.md +16 -16
- package/templates/skills/application/references/backend-seeding-and-dto-output.md +83 -0
- package/templates/skills/application/references/backend-table-prefix-mapping.md +79 -0
- package/templates/skills/application/references/backend-verification.md +1 -1
- package/templates/skills/application/references/frontend-i18n-and-output.md +67 -0
- package/templates/skills/application/references/frontend-route-naming.md +117 -0
- package/templates/skills/application/references/frontend-route-wiring-app-tsx.md +107 -0
- package/templates/skills/application/references/frontend-verification.md +12 -12
- package/templates/skills/application/references/init-parameter-detection.md +121 -0
- package/templates/skills/application/references/migration-checklist-troubleshooting.md +100 -0
- package/templates/skills/application/references/nav-fallback-procedure.md +199 -200
- package/templates/skills/application/references/provider-template.md +2 -6
- package/templates/skills/application/references/roles-client-project-handling.md +55 -0
- package/templates/skills/application/references/roles-fallback-procedure.md +149 -0
- package/templates/skills/application/references/test-coverage-requirements.md +213 -0
- package/templates/skills/application/references/test-frontend.md +3 -3
- package/templates/skills/application/steps/step-00-init.md +130 -260
- package/templates/skills/application/steps/step-01-navigation.md +170 -170
- package/templates/skills/application/steps/step-02-permissions.md +196 -196
- package/templates/skills/application/steps/step-03-roles.md +182 -339
- package/templates/skills/application/steps/step-03b-provider.md +133 -134
- package/templates/skills/application/steps/step-04-backend.md +174 -265
- package/templates/skills/application/steps/step-05-frontend.md +18 -144
- package/templates/skills/application/steps/step-06-migration.md +12 -60
- package/templates/skills/application/steps/step-07-tests.md +9 -76
- package/templates/skills/application/templates-backend.md +29 -27
- package/templates/skills/application/templates-frontend.md +49 -49
- package/templates/skills/application/templates-seed.md +57 -131
- package/templates/skills/business-analyse/SKILL.md +27 -30
- package/templates/skills/business-analyse/_architecture.md +6 -6
- package/templates/skills/business-analyse/_shared.md +60 -88
- package/templates/skills/business-analyse/questionnaire/04-data.md +3 -3
- package/templates/skills/business-analyse/questionnaire/06-security.md +1 -1
- package/templates/skills/business-analyse/questionnaire/13-cross-module.md +1 -1
- package/templates/skills/business-analyse/react/application-viewer.md +12 -12
- package/templates/skills/business-analyse/react/components.md +8 -12
- package/templates/skills/business-analyse/react/schema.md +836 -836
- package/templates/skills/business-analyse/references/agent-module-prompt.md +2 -3
- package/templates/skills/business-analyse/references/analysis-semantic-checks.md +190 -0
- package/templates/skills/business-analyse/references/cache-warming-strategy.md +2 -2
- package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +41 -0
- package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +74 -0
- package/templates/skills/business-analyse/references/cadrage-shared-modules.md +69 -0
- package/templates/skills/business-analyse/references/cadrage-structure-cards.md +1 -1
- package/templates/skills/business-analyse/references/compilation-structure-cards.md +297 -0
- package/templates/skills/business-analyse/references/consolidation-structural-checks.md +2 -2
- package/templates/skills/business-analyse/references/deploy-modes.md +5 -5
- package/templates/skills/business-analyse/references/detection-strategies.md +7 -7
- package/templates/skills/business-analyse/references/handoff-file-templates.md +14 -22
- package/templates/skills/business-analyse/references/handoff-mappings.md +4 -4
- package/templates/skills/business-analyse/references/handoff-seeddata-generation.md +312 -0
- package/templates/skills/business-analyse/references/init-schema-deployment.md +3 -3
- package/templates/skills/business-analyse/references/naming-conventions.md +22 -24
- package/templates/skills/business-analyse/references/prd-generation.md +2 -2
- package/templates/skills/business-analyse/references/review-data-mapping.md +2 -2
- package/templates/skills/business-analyse/references/robustness-checks.md +1 -1
- package/templates/skills/business-analyse/references/spec-auto-inference.md +3 -3
- package/templates/skills/business-analyse/references/team-orchestration.md +49 -6
- package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
- package/templates/skills/business-analyse/references/ui-resource-cards.md +18 -18
- package/templates/skills/business-analyse/references/validate-incremental-html.md +2 -2
- package/templates/skills/business-analyse/references/validation-checklist.md +2 -2
- package/templates/skills/business-analyse/schemas/application-schema.json +4 -5
- package/templates/skills/business-analyse/schemas/project-schema.json +1 -6
- package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +2 -3
- package/templates/skills/business-analyse/schemas/sections/specification-schema.json +4 -4
- package/templates/skills/business-analyse/steps/step-00-init.md +8 -17
- package/templates/skills/business-analyse/steps/step-01-cadrage.md +35 -198
- package/templates/skills/business-analyse/steps/step-01b-applications.md +16 -20
- package/templates/skills/business-analyse/steps/step-02-decomposition.md +1 -1
- package/templates/skills/business-analyse/steps/step-03a1-setup.md +4 -4
- package/templates/skills/business-analyse/steps/step-03a2-analysis.md +1 -1
- package/templates/skills/business-analyse/steps/step-03b-ui.md +4 -4
- package/templates/skills/business-analyse/steps/step-03c-compile.md +66 -140
- package/templates/skills/business-analyse/steps/step-03d-validate.md +2 -2
- package/templates/skills/business-analyse/steps/step-04a-collect.md +2 -2
- package/templates/skills/business-analyse/steps/step-04b-analyze.md +42 -160
- package/templates/skills/business-analyse/steps/step-04c-decide.md +1 -1
- package/templates/skills/business-analyse/steps/step-05a-handoff.md +74 -104
- package/templates/skills/business-analyse/steps/step-05b-deploy.md +13 -11
- package/templates/skills/business-analyse/steps/step-06-review.md +3 -3
- package/templates/skills/business-analyse/templates/tpl-frd.md +13 -13
- package/templates/skills/business-analyse/templates/tpl-handoff.md +12 -12
- package/templates/skills/business-analyse/templates/tpl-progress.md +1 -1
- package/templates/skills/business-analyse/templates-frd.md +25 -25
- package/templates/skills/business-analyse/templates-react.md +15 -21
- package/templates/skills/controller/SKILL.md +1 -1
- package/templates/skills/controller/postman-templates.md +1 -1
- package/templates/skills/controller/references/controller-code-templates.md +2 -2
- package/templates/skills/controller/references/mcp-scaffold-workflow.md +209 -0
- package/templates/skills/controller/references/permission-sync-templates.md +13 -16
- package/templates/skills/controller/steps/step-00-init.md +11 -11
- package/templates/skills/controller/steps/step-03-generate.md +64 -103
- package/templates/skills/controller/templates.md +67 -71
- package/templates/skills/debug/SKILL.md +13 -218
- package/templates/skills/debug/steps/step-00-init.md +57 -0
- package/templates/skills/debug/steps/step-01-analyze.md +219 -0
- package/templates/skills/debug/steps/step-02-resolve.md +85 -0
- package/templates/skills/documentation/SKILL.md +49 -345
- package/templates/skills/documentation/data-schema.md +11 -8
- package/templates/skills/documentation/steps/step-00-init.md +70 -0
- package/templates/skills/documentation/steps/step-01-scan.md +113 -0
- package/templates/skills/documentation/steps/step-02-generate.md +231 -0
- package/templates/skills/documentation/steps/step-03-validate.md +238 -0
- package/templates/skills/documentation/templates.md +480 -322
- package/templates/skills/efcore/SKILL.md +1 -1
- package/templates/skills/efcore/references/both-contexts.md +32 -0
- package/templates/skills/efcore/references/database-operations.md +67 -0
- package/templates/skills/efcore/references/destructive-operations.md +38 -0
- package/templates/skills/efcore/references/reset-operations.md +81 -0
- package/templates/skills/efcore/references/seed-methods.md +86 -0
- package/templates/skills/efcore/references/shared-init-functions.md +250 -0
- package/templates/skills/efcore/references/sql-objects-injection.md +61 -0
- package/templates/skills/efcore/references/troubleshooting.md +81 -0
- package/templates/skills/efcore/steps/db/step-deploy.md +1 -32
- package/templates/skills/efcore/steps/db/step-reset.md +7 -103
- package/templates/skills/efcore/steps/db/step-seed.md +10 -132
- package/templates/skills/efcore/steps/db/step-status.md +5 -44
- package/templates/skills/efcore/steps/migration/step-02-create.md +1 -14
- package/templates/skills/efcore/steps/migration/step-03-validate.md +8 -62
- package/templates/skills/efcore/steps/rebase-snapshot/step-03-create.md +1 -57
- package/templates/skills/efcore/steps/shared/step-00-init.md +11 -254
- package/templates/skills/efcore/steps/squash/step-03-create.md +1 -58
- package/templates/skills/feature-full/SKILL.md +1 -1
- package/templates/skills/feature-full/steps/step-00-init.md +57 -0
- package/templates/skills/feature-full/steps/step-01-implementation.md +1 -1
- package/templates/skills/gitflow/SKILL.md +28 -5
- package/templates/skills/gitflow/_shared.md +109 -12
- package/templates/skills/gitflow/phases/abort.md +4 -0
- package/templates/skills/gitflow/phases/cleanup.md +4 -0
- package/templates/skills/gitflow/references/commit-message-generation.md +58 -0
- package/templates/skills/gitflow/references/commit-migration-validation.md +49 -0
- package/templates/skills/gitflow/references/finish-cleanup.md +55 -0
- package/templates/skills/gitflow/references/finish-version-bumping.md +45 -0
- package/templates/skills/gitflow/references/init-environment-detection.md +41 -0
- package/templates/skills/gitflow/references/init-questions.md +185 -0
- package/templates/skills/gitflow/references/init-structure-creation.md +75 -0
- package/templates/skills/gitflow/references/init-version-detection.md +21 -0
- package/templates/skills/gitflow/references/init-workspace-detection.md +43 -0
- package/templates/skills/gitflow/references/merge-ci-status.md +36 -0
- package/templates/skills/gitflow/references/merge-execution.md +62 -0
- package/templates/skills/gitflow/references/merge-pr-context.md +76 -0
- package/templates/skills/gitflow/references/pr-build-checks.md +60 -0
- package/templates/skills/gitflow/references/pr-generation.md +58 -0
- package/templates/skills/gitflow/references/start-branch-normalization.md +28 -0
- package/templates/skills/gitflow/references/start-worktree-creation.md +50 -0
- package/templates/skills/gitflow/references/sync-push-verify.md +44 -0
- package/templates/skills/gitflow/references/sync-rebase-conflicts.md +38 -0
- package/templates/skills/gitflow/steps/step-commit.md +12 -91
- package/templates/skills/gitflow/steps/step-finish.md +15 -159
- package/templates/skills/gitflow/steps/step-init.md +24 -326
- package/templates/skills/gitflow/steps/step-merge.md +17 -176
- package/templates/skills/gitflow/steps/step-pr.md +10 -116
- package/templates/skills/gitflow/steps/step-start.md +16 -109
- package/templates/skills/gitflow/steps/step-sync.md +6 -69
- package/templates/skills/ralph-loop/SKILL.md +6 -0
- package/templates/skills/ralph-loop/references/category-completeness.md +185 -0
- package/templates/skills/ralph-loop/references/compact-loop.md +1 -1
- package/templates/skills/ralph-loop/references/init-resume-recovery.md +127 -0
- package/templates/skills/ralph-loop/references/module-transition.md +151 -0
- package/templates/skills/ralph-loop/references/multi-module-queue.md +171 -0
- package/templates/skills/ralph-loop/references/parallel-execution.md +246 -0
- package/templates/skills/ralph-loop/references/task-transform-legacy.md +6 -9
- package/templates/skills/ralph-loop/references/team-orchestration.md +45 -3
- package/templates/skills/ralph-loop/steps/step-00-init.md +36 -109
- package/templates/skills/ralph-loop/steps/step-01-task.md +15 -163
- package/templates/skills/ralph-loop/steps/step-02-execute.md +8 -154
- package/templates/skills/ralph-loop/steps/step-04-check.md +20 -73
- package/templates/skills/review-code/references/owasp-api-top10.md +5 -5
- package/templates/skills/review-code/references/smartstack-conventions.md +568 -568
- package/templates/skills/validate-feature/references/api-smoke-tests.md +140 -0
- package/templates/skills/validate-feature/references/db-validation-checks.md +180 -0
- package/templates/skills/validate-feature/steps/step-01-compile.md +1 -3
- package/templates/skills/validate-feature/steps/step-04-api-smoke.md +34 -145
- package/templates/skills/validate-feature/steps/step-05-db-validation.md +74 -260
- package/templates/skills/workflow/SKILL.md +1 -1
- package/templates/skills/workflow/steps/step-00-init.md +57 -0
|
@@ -54,160 +54,14 @@ writeJSON('.ralph/prd.json', prd);
|
|
|
54
54
|
|
|
55
55
|
#### 3a. Parallel Mode (if `-p` flag)
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
##### Phase 0: Foundation (Ralph sequential)
|
|
60
|
-
|
|
61
|
-
```javascript
|
|
62
|
-
// Collect ALL entities from ALL modules
|
|
63
|
-
const allEntities = [];
|
|
64
|
-
const allModules = [];
|
|
65
|
-
for (const prdFile of glob('.ralph/prd-*.json')) {
|
|
66
|
-
const modulePrd = readJSON(prdFile);
|
|
67
|
-
const moduleEntities = modulePrd.tasks
|
|
68
|
-
.filter(t => t.category === 'domain')
|
|
69
|
-
.map(t => extractEntityName(t.description));
|
|
70
|
-
allEntities.push(...moduleEntities);
|
|
71
|
-
allModules.push({
|
|
72
|
-
code: modulePrd.project.module,
|
|
73
|
-
application: modulePrd.project.application,
|
|
74
|
-
prdFile: prdFile,
|
|
75
|
-
entityCount: moduleEntities.length
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
console.log(`PARALLEL MODE: Phase 0 — Foundation`);
|
|
80
|
-
console.log(` Generating ${allEntities.length} entities from ${allModules.length} modules`);
|
|
81
|
-
console.log(` Entities: ${allEntities.join(', ')}`);
|
|
82
|
-
|
|
83
|
-
// Ralph generates ALL entities via apex foundation mode
|
|
84
|
-
// INVOKE: /apex --foundation -d .ralph/prd.json
|
|
85
|
-
//
|
|
86
|
-
// Apex will:
|
|
87
|
-
// - Generate ALL entity classes
|
|
88
|
-
// - Generate ALL EF configurations
|
|
89
|
-
// - Register ALL DbSets in DbContext
|
|
90
|
-
// - Create ONE migration with all entities
|
|
91
|
-
// - Skip services/controllers/frontend/tests
|
|
92
|
-
|
|
93
|
-
console.log(`Phase 0 completed. ModelSnapshot contains ${allEntities.length} entities.`);
|
|
94
|
-
console.log(`Committing foundation...`);
|
|
95
|
-
|
|
96
|
-
// Git commit
|
|
97
|
-
// bash: git add . && git commit -m "chore(foundation): entities for all modules"
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
##### Phase 1-N: Spawn Teammates (parallel)
|
|
101
|
-
|
|
102
|
-
```javascript
|
|
103
|
-
// Determine granularity: 1 teammate per APPLICATION or per MODULE
|
|
104
|
-
const teammates = [];
|
|
105
|
-
const applicationsMap = {}; // group modules by application
|
|
106
|
-
|
|
107
|
-
for (const mod of allModules) {
|
|
108
|
-
if (!applicationsMap[mod.application]) {
|
|
109
|
-
applicationsMap[mod.application] = [];
|
|
110
|
-
}
|
|
111
|
-
applicationsMap[mod.application].push(mod);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
for (const [appName, modules] of Object.entries(applicationsMap)) {
|
|
115
|
-
if (modules.length <= 3) {
|
|
116
|
-
// 1 teammate per APPLICATION
|
|
117
|
-
teammates.push({
|
|
118
|
-
name: `apex-${kebabCase(appName)}`,
|
|
119
|
-
application: appName,
|
|
120
|
-
modules: modules.map(m => m.code),
|
|
121
|
-
prdFiles: modules.map(m => m.prdFile)
|
|
122
|
-
});
|
|
123
|
-
} else {
|
|
124
|
-
// Application has >3 modules → 1 teammate per MODULE
|
|
125
|
-
for (const mod of modules) {
|
|
126
|
-
teammates.push({
|
|
127
|
-
name: `apex-${kebabCase(appName)}-${kebabCase(mod.code)}`,
|
|
128
|
-
application: appName,
|
|
129
|
-
modules: [mod.code],
|
|
130
|
-
prdFiles: [mod.prdFile]
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
57
|
+
See `references/parallel-execution.md` for complete parallel protocol:
|
|
135
58
|
|
|
136
|
-
|
|
137
|
-
for (const t of teammates) {
|
|
138
|
-
console.log(` - ${t.name}: ${t.modules.join(', ')}`);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Create team
|
|
142
|
-
TeamCreate({
|
|
143
|
-
team_name: `smartstack-${kebabCase(prd.project.name || 'project')}`,
|
|
144
|
-
description: `Parallel development for ${teammates.length} modules`
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// Spawn teammates
|
|
148
|
-
for (const teammate of teammates) {
|
|
149
|
-
Task({
|
|
150
|
-
subagent_type: "apex",
|
|
151
|
-
name: teammate.name,
|
|
152
|
-
team_name: `smartstack-${kebabCase(prd.project.name || 'project')}`,
|
|
153
|
-
prompt: `
|
|
154
|
-
You are teammate ${teammate.name}.
|
|
155
|
-
|
|
156
|
-
CONTEXT:
|
|
157
|
-
- Application: ${teammate.application}
|
|
158
|
-
- Modules: ${teammate.modules.join(', ')}
|
|
159
|
-
- PRD files: ${teammate.prdFiles.join(', ')}
|
|
160
|
-
|
|
161
|
-
ENTITIES ALREADY EXIST (Phase 0 completed by Ralph):
|
|
162
|
-
All entity classes, EF configurations, and migrations are already created.
|
|
163
|
-
The ModelSnapshot is complete and the database is ready.
|
|
164
|
-
|
|
165
|
-
YOUR TASK:
|
|
166
|
-
For each module, generate:
|
|
167
|
-
- Services (Application layer)
|
|
168
|
-
- Controllers (API layer)
|
|
169
|
-
- Seed data (Navigation + Permissions + Business data)
|
|
170
|
-
- Frontend (Pages + Routes + i18n for all 4 languages)
|
|
171
|
-
- Tests (Unit + Integration)
|
|
172
|
-
|
|
173
|
-
DO NOT:
|
|
174
|
-
- Create new entities (already done)
|
|
175
|
-
- Create migrations (ModelSnapshot already complete)
|
|
176
|
-
|
|
177
|
-
EXECUTE:
|
|
178
|
-
For each PRD file: invoke /apex -d {prdFile}
|
|
179
|
-
Apex will see existing entities and skip domain/infrastructure layers.
|
|
180
|
-
|
|
181
|
-
When done, send a message to team lead with results.
|
|
182
|
-
`
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Ralph waits for teammates to complete
|
|
187
|
-
// Each teammate will send a message when done
|
|
188
|
-
// Ralph collects results and proceeds to validation
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
##### Collect Results
|
|
192
|
-
|
|
193
|
-
```javascript
|
|
194
|
-
// Wait for all teammates to send completion messages
|
|
195
|
-
// Ralph receives SendMessage from each teammate with status
|
|
196
|
-
|
|
197
|
-
const teammateResults = []; // populated from teammate messages
|
|
198
|
-
|
|
199
|
-
console.log(`All teammates completed:`);
|
|
200
|
-
for (const result of teammateResults) {
|
|
201
|
-
console.log(` - ${result.name}: ${result.status}`);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// Cleanup team
|
|
205
|
-
TeamDelete();
|
|
206
|
-
|
|
207
|
-
// Proceed to step-03 for global validation
|
|
208
|
-
```
|
|
59
|
+
**IF `{parallel_mode}` == true:**
|
|
209
60
|
|
|
210
|
-
|
|
61
|
+
1. Phase 0 (Ralph sequential): Generate ALL entities from ALL modules + ONE migration
|
|
62
|
+
2. Phase 1-N (Teams parallel): Spawn teammates per application/module for services/controllers/frontend/tests
|
|
63
|
+
3. Collect results from teammates
|
|
64
|
+
4. Cleanup team, proceed to step-03
|
|
211
65
|
|
|
212
66
|
**ELSE (not parallel mode):**
|
|
213
67
|
|
|
@@ -230,7 +84,7 @@ if (prd._sectionSplit?.enabled) {
|
|
|
230
84
|
);
|
|
231
85
|
|
|
232
86
|
if (!depsOk) {
|
|
233
|
-
console.warn(`Phase ${nextPhase.phase} blocked
|
|
87
|
+
console.warn(`Phase ${nextPhase.phase} blocked — dependencies incomplete`);
|
|
234
88
|
goto STEP_04;
|
|
235
89
|
}
|
|
236
90
|
|
|
@@ -261,7 +115,7 @@ if (prd._sectionSplit?.enabled) {
|
|
|
261
115
|
|
|
262
116
|
This delegates ALL remaining tasks for the current module to apex:
|
|
263
117
|
|
|
264
|
-
- Apex reads the PRD, extracts context (`
|
|
118
|
+
- Apex reads the PRD, extracts context (`app_name`, `module_code`, `entities`, `sections`)
|
|
265
119
|
- Apex executes ALL layers: domain → infrastructure → migration → application → api → seed data → frontend → tests
|
|
266
120
|
- Apex runs full POST-CHECKs (50 checks from `references/post-checks.md`)
|
|
267
121
|
- Apex commits per layer (atomic commits)
|
|
@@ -33,7 +33,9 @@ const allDone = (tasksCompleted + tasksSkipped) === tasksTotal;
|
|
|
33
33
|
```bash
|
|
34
34
|
# Quick build check (quiet mode)
|
|
35
35
|
dotnet build --no-restore --verbosity quiet
|
|
36
|
-
|
|
36
|
+
BUILD_RC=$?
|
|
37
|
+
# Note: WSL bin\Debug cleanup handled by PostToolUse hook (wsl-dotnet-cleanup.sh)
|
|
38
|
+
if [ $BUILD_RC -ne 0 ]; then
|
|
37
39
|
echo "BUILD REGRESSION detected between apex invocations"
|
|
38
40
|
# Inject fix task — apex will handle the actual fix
|
|
39
41
|
prd.tasks.push({ id: maxId+1, description: "Fix build regression",
|
|
@@ -45,51 +47,18 @@ fi
|
|
|
45
47
|
|
|
46
48
|
### 1.7. Category Completeness Check (RUNS EVERY ITERATION)
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
> In test-v4-005, allDone was never true (PRD status not updated), so the
|
|
50
|
-
> module completeness check in section 3b never triggered, and missing
|
|
51
|
-
> frontend/test categories were never detected.
|
|
50
|
+
See `references/category-completeness.md` for detailed implementation.
|
|
52
51
|
|
|
53
52
|
```javascript
|
|
54
|
-
const
|
|
55
|
-
const REQUIRED_CATEGORIES = ['domain', 'infrastructure', 'application', 'api', 'seedData', 'frontend', 'test'];
|
|
56
|
-
const missingFromPrd = REQUIRED_CATEGORIES.filter(c => !presentCategories.has(c));
|
|
57
|
-
|
|
58
|
-
if (missingFromPrd.length > 0) {
|
|
59
|
-
console.warn(`PRD MISSING CATEGORIES: ${missingFromPrd.join(', ')}`);
|
|
60
|
-
|
|
61
|
-
// Inject guardrail tasks for missing categories
|
|
62
|
-
let maxIdNum = Math.max(...prd.tasks.map(t => parseInt(t.id.replace(/[^0-9]/g, ''), 10) || 0));
|
|
63
|
-
const prefix = prd.tasks[0]?.id?.replace(/[0-9]+$/, '') || 'GUARD-';
|
|
64
|
-
const lastApiTask = prd.tasks.filter(t => t.category === 'api').pop()?.id;
|
|
65
|
-
const lastSeedDataTask = prd.tasks.filter(t => t.category === 'seedData').pop()?.id;
|
|
66
|
-
|
|
67
|
-
for (const cat of missingFromPrd) {
|
|
68
|
-
maxIdNum++;
|
|
69
|
-
const taskId = `${prefix}${String(maxIdNum).padStart(3, '0')}`;
|
|
70
|
-
prd.tasks.push({
|
|
71
|
-
id: taskId,
|
|
72
|
-
description: `[GUARDRAIL] Generate missing ${cat} layer for ${prd.project?.module || 'module'}`,
|
|
73
|
-
status: 'pending', category: cat,
|
|
74
|
-
dependencies: lastSeedDataTask ? [lastSeedDataTask] : (lastApiTask ? [lastApiTask] : []),
|
|
75
|
-
acceptance_criteria: [
|
|
76
|
-
cat === 'frontend' ? 'React pages + routes wired to App.tsx' :
|
|
77
|
-
cat === 'test' ? 'Unit + integration tests passing' :
|
|
78
|
-
`${cat} layer complete`
|
|
79
|
-
],
|
|
80
|
-
started_at: null, completed_at: null, iteration: null,
|
|
81
|
-
commit_hash: null, files_changed: [], validation: null, error: null
|
|
82
|
-
});
|
|
83
|
-
console.log(` Injected [${taskId}] ${cat} guardrail`);
|
|
84
|
-
}
|
|
85
|
-
writeJSON('.ralph/prd.json', prd);
|
|
53
|
+
const { missing, guardrailsNeeded } = checkCategoryCompleteness(prd);
|
|
86
54
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
55
|
+
if (guardrailsNeeded.length > 0) {
|
|
56
|
+
prd.tasks.push(...guardrailsNeeded);
|
|
57
|
+
writeJSON('.ralph/prd.json', prd);
|
|
58
|
+
console.log(`PRD updated: +${guardrailsNeeded.length} guardrails, ${prd.tasks.filter(t => t.status === 'pending').length} pending tasks`);
|
|
90
59
|
}
|
|
91
60
|
|
|
92
|
-
//
|
|
61
|
+
// Artifact verification (check if completed tasks have files)
|
|
93
62
|
const completedCats = new Set(prd.tasks.filter(t => t.status === 'completed').map(t => t.category));
|
|
94
63
|
const artifactChecks = {
|
|
95
64
|
'frontend': () => glob.sync('**/src/pages/**/*.tsx').length > 0,
|
|
@@ -98,9 +67,13 @@ const artifactChecks = {
|
|
|
98
67
|
};
|
|
99
68
|
for (const [cat, check] of Object.entries(artifactChecks)) {
|
|
100
69
|
if (completedCats.has(cat) && !check()) {
|
|
101
|
-
console.warn(`ARTIFACT MISSING: ${cat} tasks marked completed but no files found — resetting`);
|
|
70
|
+
console.warn(`ARTIFACT MISSING: ${cat} tasks marked completed but no files found — resetting to pending`);
|
|
102
71
|
prd.tasks.filter(t => t.category === cat && t.status === 'completed')
|
|
103
|
-
.forEach(t => {
|
|
72
|
+
.forEach(t => {
|
|
73
|
+
t.status = 'pending';
|
|
74
|
+
t.error = 'Artifacts missing — re-execute';
|
|
75
|
+
t.completed_at = null;
|
|
76
|
+
});
|
|
104
77
|
writeJSON('.ralph/prd.json', prd);
|
|
105
78
|
}
|
|
106
79
|
}
|
|
@@ -141,6 +114,8 @@ if ({team_active}) {
|
|
|
141
114
|
|
|
142
115
|
### 3b. Sequential Multi-Module (modules-queue.json)
|
|
143
116
|
|
|
117
|
+
See `references/module-transition.md` for complete module advancement protocol.
|
|
118
|
+
|
|
144
119
|
```javascript
|
|
145
120
|
const queuePath = '.ralph/modules-queue.json';
|
|
146
121
|
if (fileExists(queuePath)) {
|
|
@@ -156,36 +131,8 @@ if (fileExists(queuePath)) {
|
|
|
156
131
|
console.log(`Module ${currentModule.code}: missing categories ${missing.join(', ')} — continuing loop`);
|
|
157
132
|
// Fall through to section 5 (compact loop)
|
|
158
133
|
} else {
|
|
159
|
-
//
|
|
160
|
-
|
|
161
|
-
queue.completedModules++;
|
|
162
|
-
const nextIndex = queue.currentIndex + 1;
|
|
163
|
-
|
|
164
|
-
if (nextIndex < queue.totalModules) {
|
|
165
|
-
queue.currentIndex = nextIndex;
|
|
166
|
-
queue.modules[nextIndex].status = 'in-progress';
|
|
167
|
-
writeJSON(queuePath, queue);
|
|
168
|
-
|
|
169
|
-
writeJSON('.ralph/module-changed.json', {
|
|
170
|
-
fromModule: currentModule.code, toModule: queue.modules[nextIndex].code,
|
|
171
|
-
timestamp: new Date().toISOString()
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
prd.status = 'completed';
|
|
175
|
-
writeJSON('.ralph/prd.json', prd);
|
|
176
|
-
const nextPrd = readJSON(queue.modules[nextIndex].prdFile);
|
|
177
|
-
nextPrd.config.current_iteration = 1;
|
|
178
|
-
nextPrd.config.max_iterations = prd.config.max_iterations;
|
|
179
|
-
writeJSON('.ralph/prd.json', nextPrd);
|
|
180
|
-
|
|
181
|
-
console.log(`MODULE COMPLETE: ${currentModule.code} → NEXT: ${queue.modules[nextIndex].code}`);
|
|
182
|
-
// → step-01 (module transition)
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// ALL MODULES COMPLETE
|
|
187
|
-
writeJSON(queuePath, queue);
|
|
188
|
-
console.log(`ALL ${queue.totalModules} MODULES COMPLETE`);
|
|
134
|
+
// All categories complete — advance to next module
|
|
135
|
+
// (detailed logic in references/module-transition.md)
|
|
189
136
|
}
|
|
190
137
|
}
|
|
191
138
|
```
|
|
@@ -25,7 +25,7 @@ public async Task<ActionResult<OrderDto>> Get(Guid id)
|
|
|
25
25
|
|
|
26
26
|
// GOOD: Tenant filter via EF Core global filter + explicit check
|
|
27
27
|
[HttpGet("{id}")]
|
|
28
|
-
[RequirePermission(Permissions.
|
|
28
|
+
[RequirePermission(Permissions.Orders.Read)]
|
|
29
29
|
public async Task<ActionResult<OrderDto>> Get(Guid id)
|
|
30
30
|
{
|
|
31
31
|
var order = await _context.Orders
|
|
@@ -76,7 +76,7 @@ public async Task<ActionResult> Update(Guid id, [FromBody] User user) { ... }
|
|
|
76
76
|
|
|
77
77
|
// GOOD: DTO limits writable fields
|
|
78
78
|
[HttpPut("{id}")]
|
|
79
|
-
[RequirePermission(Permissions.
|
|
79
|
+
[RequirePermission(Permissions.Users.Update)]
|
|
80
80
|
public async Task<ActionResult> Update(Guid id, [FromBody] UpdateUserDto dto) { ... }
|
|
81
81
|
|
|
82
82
|
public record UpdateUserDto(string Name, string Email); // No Role, no TenantId
|
|
@@ -117,8 +117,8 @@ public async Task<ActionResult<PaginatedResult<OrderDto>>> GetAll(
|
|
|
117
117
|
**Risk:** Regular users access admin-level API functions.
|
|
118
118
|
|
|
119
119
|
**SmartStack check:**
|
|
120
|
-
- [ ] Admin endpoints use `
|
|
121
|
-
- [ ]
|
|
120
|
+
- [ ] Admin endpoints use `administration.*` permissions
|
|
121
|
+
- [ ] Application-based routing enforced (Administration, Support, etc.)
|
|
122
122
|
- [ ] System account protection (UserType.System, UserType.LocalAdmin)
|
|
123
123
|
- [ ] No permission bypass via direct URL manipulation
|
|
124
124
|
|
|
@@ -130,7 +130,7 @@ public async Task<ActionResult> Delete(Guid id) { ... }
|
|
|
130
130
|
|
|
131
131
|
// GOOD: Explicit permission check
|
|
132
132
|
[HttpDelete("{id}")]
|
|
133
|
-
[RequirePermission(Permissions.
|
|
133
|
+
[RequirePermission(Permissions.Administration.Users.Delete)]
|
|
134
134
|
public async Task<ActionResult> Delete(Guid id) { ... }
|
|
135
135
|
```
|
|
136
136
|
</api5_broken_function_auth>
|