@atlashub/smartstack-cli 4.17.1 → 4.19.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/package.json +1 -1
- package/templates/agents/ba-reader.md +86 -80
- package/templates/agents/ba-writer.md +321 -413
- package/templates/agents/docs-context-reader.md +3 -3
- package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +133 -0
- package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +126 -0
- package/templates/skills/apex/SKILL.md +29 -16
- package/templates/skills/apex/_shared.md +62 -9
- package/templates/skills/apex/references/analysis-methods.md +8 -6
- package/templates/skills/apex/references/challenge-questions.md +5 -5
- package/templates/skills/apex/references/core-seed-data.md +68 -45
- package/templates/skills/apex/references/frontend-route-wiring-app-tsx.md +26 -21
- package/templates/skills/apex/references/parallel-execution.md +156 -0
- package/templates/skills/apex/references/person-extension-pattern.md +12 -12
- package/templates/skills/apex/references/post-checks.md +1748 -1726
- package/templates/skills/apex/references/smartstack-api.md +63 -57
- package/templates/skills/apex/references/smartstack-frontend-compliance.md +594 -0
- package/templates/skills/apex/references/smartstack-frontend.md +1246 -1842
- package/templates/skills/apex/references/smartstack-layers.md +98 -145
- package/templates/skills/apex/steps/step-00-init.md +30 -6
- package/templates/skills/apex/steps/step-01-analyze.md +27 -23
- package/templates/skills/apex/steps/step-02-plan.md +12 -12
- package/templates/skills/apex/steps/step-03-execute.md +198 -143
- package/templates/skills/apex/steps/step-04-examine.md +24 -93
- package/templates/skills/apex/steps/step-05-deep-review.md +16 -16
- package/templates/skills/apex/steps/step-06-resolve.md +9 -9
- package/templates/skills/apex/steps/step-07-tests.md +3 -1
- package/templates/skills/apex/steps/step-08-run-tests.md +1 -1
- package/templates/skills/business-analyse/SKILL.md +182 -301
- package/templates/skills/business-analyse/_shared.md +119 -336
- package/templates/skills/business-analyse/html/ba-interactive.html +703 -82
- package/templates/skills/business-analyse/html/build-html.js +41 -3
- package/templates/skills/business-analyse/html/src/partials/cadrage-context.html +34 -0
- package/templates/skills/business-analyse/html/src/partials/cadrage-risks.html +48 -0
- package/templates/skills/business-analyse/html/src/partials/cadrage-scope.html +49 -0
- package/templates/skills/business-analyse/html/src/partials/cadrage-stakeholders.html +55 -0
- package/templates/skills/business-analyse/html/src/partials/cadrage-success.html +34 -0
- package/templates/skills/business-analyse/html/src/partials/consol-datamodel.html +8 -0
- package/templates/skills/business-analyse/html/src/partials/consol-flows.html +29 -0
- package/templates/skills/business-analyse/html/src/partials/consol-interactions.html +8 -0
- package/templates/skills/business-analyse/html/src/partials/consol-permissions.html +8 -0
- package/templates/skills/business-analyse/html/src/partials/decomp-dependencies.html +38 -0
- package/templates/skills/business-analyse/html/src/partials/decomp-modules.html +51 -0
- package/templates/skills/business-analyse/html/src/partials/handoff-summary.html +24 -0
- package/templates/skills/business-analyse/html/src/partials/module-spec-container.html +4 -0
- package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +17 -1
- package/templates/skills/business-analyse/html/src/scripts/02-navigation.js +31 -5
- package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +100 -63
- package/templates/skills/business-analyse/html/src/scripts/06-render-mockups.js +372 -0
- package/templates/skills/business-analyse/html/src/scripts/10-comments.js +41 -13
- package/templates/skills/business-analyse/html/src/styles/09-mockups-html.css +136 -0
- package/templates/skills/business-analyse/patterns/suggestion-catalog.md +7 -5
- package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +142 -0
- package/templates/skills/business-analyse/questionnaire/03-data-ui.md +94 -0
- package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +150 -0
- package/templates/skills/business-analyse/questionnaire/05-cross-module.md +69 -0
- package/templates/skills/business-analyse/questionnaire.md +23 -280
- package/templates/skills/business-analyse/react/application-viewer.md +2 -2
- package/templates/skills/business-analyse/react/components.md +4 -4
- package/templates/skills/business-analyse/react/i18n-template.md +1 -1
- package/templates/skills/business-analyse/react/schema.md +14 -14
- package/templates/skills/business-analyse/references/acceptance-criteria.md +25 -25
- package/templates/skills/business-analyse/references/analysis-semantic-checks.md +3 -3
- package/templates/skills/business-analyse/references/compilation-structure-cards.md +1 -1
- package/templates/skills/business-analyse/references/consolidation-structural-checks.md +7 -7
- package/templates/skills/business-analyse/references/deploy-data-build.md +14 -12
- package/templates/skills/business-analyse/references/deploy-modes.md +10 -10
- package/templates/skills/business-analyse/references/detection-strategies.md +6 -6
- package/templates/skills/business-analyse/references/html-data-mapping.md +15 -15
- package/templates/skills/business-analyse/references/naming-conventions.md +4 -4
- package/templates/skills/business-analyse/references/review-data-mapping.md +29 -29
- package/templates/skills/business-analyse/references/robustness-checks.md +36 -33
- package/templates/skills/business-analyse/references/spec-auto-inference.md +2 -2
- package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
- package/templates/skills/business-analyse/references/ui-resource-cards.md +1 -1
- package/templates/skills/business-analyse/references/validation-checklist.md +9 -6
- package/templates/skills/business-analyse/references/wireframe-svg-style-guide.md +2 -2
- package/templates/skills/business-analyse/schemas/application-schema.json +8 -8
- package/templates/skills/business-analyse/schemas/feature-schema.json +3 -3
- package/templates/skills/business-analyse/schemas/index-schema.json +47 -0
- package/templates/skills/business-analyse/schemas/project-schema.json +6 -6
- package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +1 -1
- package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +5 -3
- package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +4 -4
- package/templates/skills/business-analyse/schemas/sections/specification-schema.json +1 -1
- package/templates/skills/business-analyse/schemas/shared/common-defs.json +4 -3
- package/templates/skills/business-analyse/steps/step-00-init.md +93 -134
- package/templates/skills/business-analyse/steps/step-01-cadrage.md +136 -172
- package/templates/skills/business-analyse/steps/step-02-structure.md +175 -0
- package/templates/skills/business-analyse/steps/step-03-specify.md +198 -0
- package/templates/skills/business-analyse/steps/step-04-consolidate.md +478 -0
- package/templates/skills/business-analyse/steps/step-05-deploy.md +220 -0
- package/templates/skills/business-analyse/steps/step-06-review.md +51 -69
- package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
- package/templates/skills/business-analyse/templates/tpl-handoff.md +20 -17
- package/templates/skills/business-analyse/templates/tpl-launch-displays.md +2 -2
- package/templates/skills/business-analyse/templates-react.md +2 -2
- package/templates/skills/derive-prd/SKILL.md +92 -0
- package/templates/skills/derive-prd/references/acceptance-criteria.md +169 -0
- package/templates/skills/derive-prd/references/entity-domain-mapping.md +115 -0
- package/templates/skills/{business-analyse → derive-prd}/references/handoff-file-templates.md +131 -120
- package/templates/skills/{business-analyse → derive-prd}/references/handoff-mappings.md +95 -95
- package/templates/skills/{business-analyse → derive-prd}/references/handoff-seeddata-generation.md +312 -312
- package/templates/skills/{business-analyse → derive-prd}/references/prd-generation.md +262 -258
- package/templates/skills/derive-prd/references/readiness-scoring.md +104 -0
- package/templates/skills/derive-prd/schemas/handoff-schema.json +95 -0
- package/templates/skills/derive-prd/steps/step-00-validate.md +130 -0
- package/templates/skills/derive-prd/steps/step-01-transform.md +206 -0
- package/templates/skills/derive-prd/steps/step-02-export.md +181 -0
- package/templates/skills/{business-analyse → derive-prd}/templates/tpl-progress.md +172 -172
- package/templates/skills/ralph-loop/SKILL.md +10 -4
- package/templates/skills/ralph-loop/references/category-completeness.md +20 -4
- package/templates/skills/ralph-loop/references/compact-loop.md +80 -48
- package/templates/skills/ralph-loop/references/init-resume-recovery.md +4 -2
- package/templates/skills/ralph-loop/references/parallel-execution.md +27 -27
- package/templates/skills/ralph-loop/steps/step-00-init.md +19 -9
- package/templates/skills/ralph-loop/steps/step-01-task.md +12 -4
- package/templates/skills/ralph-loop/steps/step-02-execute.md +9 -4
- package/templates/skills/ralph-loop/steps/step-03-commit.md +1 -1
- package/templates/skills/ralph-loop/steps/step-04-check.md +5 -21
- package/templates/skills/ralph-loop/steps/step-05-report.md +6 -1
- package/templates/skills/apex/references/agent-teams-protocol.md +0 -203
- package/templates/skills/business-analyse/_architecture.md +0 -124
- package/templates/skills/business-analyse/_elicitation.md +0 -206
- package/templates/skills/business-analyse/_module-loop.md +0 -115
- package/templates/skills/business-analyse/_suggestions.md +0 -34
- package/templates/skills/business-analyse/questionnaire/00-application.md +0 -160
- package/templates/skills/business-analyse/questionnaire/00b-project.md +0 -85
- package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +0 -189
- package/templates/skills/business-analyse/questionnaire/03-scope.md +0 -164
- package/templates/skills/business-analyse/questionnaire/04-data.md +0 -88
- package/templates/skills/business-analyse/questionnaire/05-integrations.md +0 -58
- package/templates/skills/business-analyse/questionnaire/06-security.md +0 -68
- package/templates/skills/business-analyse/questionnaire/07-ui.md +0 -76
- package/templates/skills/business-analyse/questionnaire/08-performance.md +0 -42
- package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -45
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -43
- package/templates/skills/business-analyse/questionnaire/11-data-lifecycle.md +0 -59
- package/templates/skills/business-analyse/questionnaire/12-migration.md +0 -58
- package/templates/skills/business-analyse/questionnaire/13-cross-module.md +0 -69
- package/templates/skills/business-analyse/questionnaire/14-risk-assumptions.md +0 -135
- package/templates/skills/business-analyse/questionnaire/15-success-metrics.md +0 -136
- package/templates/skills/business-analyse/references/agent-module-prompt.md +0 -362
- package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +0 -557
- package/templates/skills/business-analyse/references/cache-warming-strategy.md +0 -566
- package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +0 -41
- package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +0 -74
- package/templates/skills/business-analyse/references/cadrage-pre-analysis.md +0 -115
- package/templates/skills/business-analyse/references/cadrage-shared-modules.md +0 -68
- package/templates/skills/business-analyse/references/cadrage-structure-cards.md +0 -85
- package/templates/skills/business-analyse/references/team-orchestration.md +0 -1022
- package/templates/skills/business-analyse/references/validate-incremental-html.md +0 -121
- package/templates/skills/business-analyse/steps/step-01b-applications.md +0 -419
- package/templates/skills/business-analyse/steps/step-02-decomposition.md +0 -387
- package/templates/skills/business-analyse/steps/step-03a-data.md +0 -16
- package/templates/skills/business-analyse/steps/step-03a1-setup.md +0 -506
- package/templates/skills/business-analyse/steps/step-03a2-analysis.md +0 -301
- package/templates/skills/business-analyse/steps/step-03b-ui.md +0 -425
- package/templates/skills/business-analyse/steps/step-03c-compile.md +0 -611
- package/templates/skills/business-analyse/steps/step-03d-validate.md +0 -783
- package/templates/skills/business-analyse/steps/step-04-consolidation.md +0 -17
- package/templates/skills/business-analyse/steps/step-04a-collect.md +0 -415
- package/templates/skills/business-analyse/steps/step-04b-analyze.md +0 -163
- package/templates/skills/business-analyse/steps/step-04c-decide.md +0 -186
- package/templates/skills/business-analyse/steps/step-05a-handoff.md +0 -840
- package/templates/skills/business-analyse/steps/step-05b-deploy.md +0 -522
- package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +0 -703
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
# Progress Tracker Template (templates/tpl-progress.md)
|
|
2
|
-
|
|
3
|
-
> **Used by:** step-
|
|
4
|
-
> **Purpose:** Template structure for .ralph/progress.txt - populate with module-specific data
|
|
5
|
-
|
|
6
|
-
## Template
|
|
7
|
-
|
|
8
|
-
```
|
|
9
|
-
═════════════════════════════════════════════════════════════════
|
|
10
|
-
SMARTSTACK RALPH LOOP - PROGRESS TRACKER
|
|
11
|
-
Project: {project_name} | Application: {app_name}
|
|
12
|
-
Modules: {count} ({moduleOrder.join(', ')})
|
|
13
|
-
Strategy: {implementation_strategy}
|
|
14
|
-
Created: {timestamp}
|
|
15
|
-
Status: HANDED-OFF
|
|
16
|
-
═════════════════════════════════════════════════════════════════
|
|
17
|
-
|
|
18
|
-
{For each module in topological order:}
|
|
19
|
-
[MODULE: {module_name}] ({complexity})
|
|
20
|
-
Status: NOT STARTED
|
|
21
|
-
Dependencies: {list of module dependencies or "FOUNDATION"}
|
|
22
|
-
|
|
23
|
-
[DOMAIN] Entity & Value Object Definitions
|
|
24
|
-
□ Define {Entity1} entity with properties and validation
|
|
25
|
-
□ Define {Entity2} entity with relationships
|
|
26
|
-
□ Define {ValueObject1} value object
|
|
27
|
-
□ Define domain exceptions
|
|
28
|
-
□ Total: X tasks
|
|
29
|
-
|
|
30
|
-
[SEEDDATA-CORE] Core Configuration (MANDATORY)
|
|
31
|
-
□ NavigationApplicationSeedData - Application navigation entry (once per app)
|
|
32
|
-
□ ApplicationRolesSeedData - Application-scoped roles (once per app)
|
|
33
|
-
□ NavigationModuleSeedData - Module navigation structure (per module)
|
|
34
|
-
□ PermissionsSeedData - RBAC permissions (per module)
|
|
35
|
-
□ RolesSeedData - Role-permission mappings (per module)
|
|
36
|
-
□ {App}SeedDataProvider - IClientSeedDataProvider (4 methods)
|
|
37
|
-
Total: 2 app-level + 3 per-module + 1 provider
|
|
38
|
-
|
|
39
|
-
[SEEDDATA] Business Reference Data
|
|
40
|
-
□ Seed {Entity1} reference data
|
|
41
|
-
□ Seed {Entity2} lookup values
|
|
42
|
-
□ Total: Y business seed tasks
|
|
43
|
-
|
|
44
|
-
[APPLICATION] Services & Business Logic
|
|
45
|
-
□ Create {ServiceName}Service for {UC1}
|
|
46
|
-
□ Create {DtoName}Dto for API contracts
|
|
47
|
-
□ Create {ValidatorName}Validator for input validation
|
|
48
|
-
□ Implement query handlers
|
|
49
|
-
Total: Z tasks
|
|
50
|
-
|
|
51
|
-
[INFRASTRUCTURE] Repositories & Persistence
|
|
52
|
-
□ Create {Entity1}Repository with CRUD + custom queries
|
|
53
|
-
□ Create {Entity2}Repository
|
|
54
|
-
□ Configure DbContext for module
|
|
55
|
-
□ Setup specifications for complex queries
|
|
56
|
-
□ Create IClientSeedDataProvider (client projects ONLY - injects core seeds at runtime)
|
|
57
|
-
□ Create DevDataSeeder + SeedConstants (if first module)
|
|
58
|
-
□ Total: A tasks
|
|
59
|
-
|
|
60
|
-
[API] REST Endpoints & Controllers
|
|
61
|
-
□ Create {ModuleNameController} GET endpoints (List, GetById)
|
|
62
|
-
□ Create {ModuleNameController} POST endpoint (Create)
|
|
63
|
-
□ Create {ModuleNameController} PUT endpoint (Update)
|
|
64
|
-
□ Create {ModuleNameController} DELETE endpoint (Delete)
|
|
65
|
-
□ Implement error handling and validation responses
|
|
66
|
-
Total: B tasks
|
|
67
|
-
|
|
68
|
-
[FRONTEND] UI Components & Pages (wireframe-driven)
|
|
69
|
-
□ Create {ModuleName}Page for listing [wireframe: {module}-list]
|
|
70
|
-
□ Create {ModuleName}DetailPage for viewing [wireframe: {module}-detail]
|
|
71
|
-
□ Create {ModuleName}Form component for creation/edit [wireframe: {module}-create]
|
|
72
|
-
□ Create custom hook use{ModuleName}
|
|
73
|
-
□ Implement pagination, filtering, sorting
|
|
74
|
-
□ Validate all pages match their wireframe layout
|
|
75
|
-
□ ⚠️ Routes MUST be INSIDE the AppLayout wrapper
|
|
76
|
-
Total: C tasks
|
|
77
|
-
|
|
78
|
-
[I18N] Internationalization Keys
|
|
79
|
-
□ Define i18n keys for {Module} UI labels
|
|
80
|
-
□ Setup translations for locales: fr, en, it, de
|
|
81
|
-
Total: D keys
|
|
82
|
-
|
|
83
|
-
[TESTS] Unit & Integration Tests
|
|
84
|
-
□ Unit tests for {Entity} domain logic
|
|
85
|
-
□ Unit tests for {ServiceName}Service
|
|
86
|
-
□ Integration tests for {ModuleNameController}
|
|
87
|
-
□ Security tests for authorization & tenant isolation
|
|
88
|
-
□ E2E tests for critical user flows
|
|
89
|
-
Total: E unit + F integration + G security = H tests
|
|
90
|
-
|
|
91
|
-
[QA] Quality Assurance
|
|
92
|
-
□ Code review against SmartStack conventions
|
|
93
|
-
□ Test coverage minimum 80%
|
|
94
|
-
□ Security scan for OWASP vulnerabilities
|
|
95
|
-
□ Performance testing under load
|
|
96
|
-
Total: 4 QA tasks
|
|
97
|
-
|
|
98
|
-
Module Total: X + 5 + Y + Z + A + B + C + D + H + 4 = {module_total} tasks
|
|
99
|
-
Estimated Effort: {simple/medium/complex} - {1-3/3-8/8-15} days
|
|
100
|
-
|
|
101
|
-
{If multi-module:}
|
|
102
|
-
[CROSS-MODULE] Integration Tasks
|
|
103
|
-
Status: NOT STARTED
|
|
104
|
-
Dependencies: All modules COMPLETED
|
|
105
|
-
|
|
106
|
-
□ Verify cross-module entity relationships
|
|
107
|
-
□ Test cross-module API dependencies
|
|
108
|
-
□ Validate permission matrix across modules
|
|
109
|
-
□ E2E flow tests spanning multiple modules
|
|
110
|
-
□ Cross-module data consistency checks
|
|
111
|
-
□ Integration test suite for module interactions
|
|
112
|
-
Total: 6 CROSS-MODULE tasks
|
|
113
|
-
|
|
114
|
-
═════════════════════════════════════════════════════════════════
|
|
115
|
-
SUMMARY
|
|
116
|
-
═════════════════════════════════════════════════════════════════
|
|
117
|
-
Total Modules: {count}
|
|
118
|
-
Total Tasks: {total_count}
|
|
119
|
-
- CORE SeedData: {count} × 5 = {total_core}
|
|
120
|
-
- Business Tasks: {total_biz}
|
|
121
|
-
- Development: {total_dev}
|
|
122
|
-
- Tests: {total_tests}
|
|
123
|
-
- QA: {total_qa}
|
|
124
|
-
- Cross-Module: {cross_module_count or 0}
|
|
125
|
-
|
|
126
|
-
Strategy: {strategy}
|
|
127
|
-
Module Order: {topological order with dependencies noted}
|
|
128
|
-
|
|
129
|
-
Complexity Distribution:
|
|
130
|
-
Simple: {count} modules ({estimate} days each)
|
|
131
|
-
Medium: {count} modules ({estimate} days each)
|
|
132
|
-
Complex: {count} modules ({estimate} days each)
|
|
133
|
-
|
|
134
|
-
Total Effort Estimate: {total_days} days ({total_hours} hours)
|
|
135
|
-
Per Developer (2): {total_days / 2} days
|
|
136
|
-
Parallel Potential: {strategy_efficiency_percent}%
|
|
137
|
-
|
|
138
|
-
═════════════════════════════════════════════════════════════════
|
|
139
|
-
LEGEND
|
|
140
|
-
═════════════════════════════════════════════════════════════════
|
|
141
|
-
□ = Task not started
|
|
142
|
-
✓ = Task completed
|
|
143
|
-
⚠ = Task in progress
|
|
144
|
-
✗ = Task failed / blocked
|
|
145
|
-
|
|
146
|
-
COLORS:
|
|
147
|
-
[DOMAIN] = Domain Model & Business Logic
|
|
148
|
-
[SEEDDATA-CORE] = MANDATORY core configuration (5 entries)
|
|
149
|
-
[SEEDDATA] = Business reference & lookup data
|
|
150
|
-
[APPLICATION] = Services, DTOs, Validators
|
|
151
|
-
[INFRASTRUCTURE] = Repositories, DbContext, ORM
|
|
152
|
-
[API] = REST controllers & endpoints
|
|
153
|
-
[FRONTEND] = React pages, components, hooks
|
|
154
|
-
[I18N] = Internationalization
|
|
155
|
-
[TESTS] = Unit, Integration, Security, E2E
|
|
156
|
-
[QA] = Code quality, coverage, security
|
|
157
|
-
[CROSS-MODULE] = Multi-module integration (if applicable)
|
|
158
|
-
|
|
159
|
-
═════════════════════════════════════════════════════════════════
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
## Progress Tracker Rules
|
|
163
|
-
|
|
164
|
-
- One section per module, in topological order (dependencies first)
|
|
165
|
-
- CORE SeedData ALWAYS 5 entries (mandatory)
|
|
166
|
-
- Business SeedData varies by module
|
|
167
|
-
- Hierarchical task structure (module → layer → tasks)
|
|
168
|
-
- Each task is independent, assignable checkbox
|
|
169
|
-
- Effort estimate per module (simple/medium/complex)
|
|
170
|
-
- Summary with totals across all modules
|
|
171
|
-
- Identified dependencies for parallel execution
|
|
172
|
-
- Cross-module tasks only if multi-module
|
|
1
|
+
# Progress Tracker Template (templates/tpl-progress.md)
|
|
2
|
+
|
|
3
|
+
> **Used by:** step-05-deploy (section 4: Generate progress.txt)
|
|
4
|
+
> **Purpose:** Template structure for .ralph/progress.txt - populate with module-specific data
|
|
5
|
+
|
|
6
|
+
## Template
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
═════════════════════════════════════════════════════════════════
|
|
10
|
+
SMARTSTACK RALPH LOOP - PROGRESS TRACKER
|
|
11
|
+
Project: {project_name} | Application: {app_name}
|
|
12
|
+
Modules: {count} ({moduleOrder.join(', ')})
|
|
13
|
+
Strategy: {implementation_strategy}
|
|
14
|
+
Created: {timestamp}
|
|
15
|
+
Status: HANDED-OFF
|
|
16
|
+
═════════════════════════════════════════════════════════════════
|
|
17
|
+
|
|
18
|
+
{For each module in topological order:}
|
|
19
|
+
[MODULE: {module_name}] ({complexity})
|
|
20
|
+
Status: NOT STARTED
|
|
21
|
+
Dependencies: {list of module dependencies or "FOUNDATION"}
|
|
22
|
+
|
|
23
|
+
[DOMAIN] Entity & Value Object Definitions
|
|
24
|
+
□ Define {Entity1} entity with properties and validation
|
|
25
|
+
□ Define {Entity2} entity with relationships
|
|
26
|
+
□ Define {ValueObject1} value object
|
|
27
|
+
□ Define domain exceptions
|
|
28
|
+
□ Total: X tasks
|
|
29
|
+
|
|
30
|
+
[SEEDDATA-CORE] Core Configuration (MANDATORY)
|
|
31
|
+
□ NavigationApplicationSeedData - Application navigation entry (once per app)
|
|
32
|
+
□ ApplicationRolesSeedData - Application-scoped roles (once per app)
|
|
33
|
+
□ NavigationModuleSeedData - Module navigation structure (per module)
|
|
34
|
+
□ PermissionsSeedData - RBAC permissions (per module)
|
|
35
|
+
□ RolesSeedData - Role-permission mappings (per module)
|
|
36
|
+
□ {App}SeedDataProvider - IClientSeedDataProvider (4 methods)
|
|
37
|
+
Total: 2 app-level + 3 per-module + 1 provider
|
|
38
|
+
|
|
39
|
+
[SEEDDATA] Business Reference Data
|
|
40
|
+
□ Seed {Entity1} reference data
|
|
41
|
+
□ Seed {Entity2} lookup values
|
|
42
|
+
□ Total: Y business seed tasks
|
|
43
|
+
|
|
44
|
+
[APPLICATION] Services & Business Logic
|
|
45
|
+
□ Create {ServiceName}Service for {UC1}
|
|
46
|
+
□ Create {DtoName}Dto for API contracts
|
|
47
|
+
□ Create {ValidatorName}Validator for input validation
|
|
48
|
+
□ Implement query handlers
|
|
49
|
+
Total: Z tasks
|
|
50
|
+
|
|
51
|
+
[INFRASTRUCTURE] Repositories & Persistence
|
|
52
|
+
□ Create {Entity1}Repository with CRUD + custom queries
|
|
53
|
+
□ Create {Entity2}Repository
|
|
54
|
+
□ Configure DbContext for module
|
|
55
|
+
□ Setup specifications for complex queries
|
|
56
|
+
□ Create IClientSeedDataProvider (client projects ONLY - injects core seeds at runtime)
|
|
57
|
+
□ Create DevDataSeeder + SeedConstants (if first module)
|
|
58
|
+
□ Total: A tasks
|
|
59
|
+
|
|
60
|
+
[API] REST Endpoints & Controllers
|
|
61
|
+
□ Create {ModuleNameController} GET endpoints (List, GetById)
|
|
62
|
+
□ Create {ModuleNameController} POST endpoint (Create)
|
|
63
|
+
□ Create {ModuleNameController} PUT endpoint (Update)
|
|
64
|
+
□ Create {ModuleNameController} DELETE endpoint (Delete)
|
|
65
|
+
□ Implement error handling and validation responses
|
|
66
|
+
Total: B tasks
|
|
67
|
+
|
|
68
|
+
[FRONTEND] UI Components & Pages (wireframe-driven)
|
|
69
|
+
□ Create {ModuleName}Page for listing [wireframe: {module}-list]
|
|
70
|
+
□ Create {ModuleName}DetailPage for viewing [wireframe: {module}-detail]
|
|
71
|
+
□ Create {ModuleName}Form component for creation/edit [wireframe: {module}-create]
|
|
72
|
+
□ Create custom hook use{ModuleName}
|
|
73
|
+
□ Implement pagination, filtering, sorting
|
|
74
|
+
□ Validate all pages match their wireframe layout
|
|
75
|
+
□ ⚠️ Routes MUST be INSIDE the AppLayout wrapper
|
|
76
|
+
Total: C tasks
|
|
77
|
+
|
|
78
|
+
[I18N] Internationalization Keys
|
|
79
|
+
□ Define i18n keys for {Module} UI labels
|
|
80
|
+
□ Setup translations for locales: fr, en, it, de
|
|
81
|
+
Total: D keys
|
|
82
|
+
|
|
83
|
+
[TESTS] Unit & Integration Tests
|
|
84
|
+
□ Unit tests for {Entity} domain logic
|
|
85
|
+
□ Unit tests for {ServiceName}Service
|
|
86
|
+
□ Integration tests for {ModuleNameController}
|
|
87
|
+
□ Security tests for authorization & tenant isolation
|
|
88
|
+
□ E2E tests for critical user flows
|
|
89
|
+
Total: E unit + F integration + G security = H tests
|
|
90
|
+
|
|
91
|
+
[QA] Quality Assurance
|
|
92
|
+
□ Code review against SmartStack conventions
|
|
93
|
+
□ Test coverage minimum 80%
|
|
94
|
+
□ Security scan for OWASP vulnerabilities
|
|
95
|
+
□ Performance testing under load
|
|
96
|
+
Total: 4 QA tasks
|
|
97
|
+
|
|
98
|
+
Module Total: X + 5 + Y + Z + A + B + C + D + H + 4 = {module_total} tasks
|
|
99
|
+
Estimated Effort: {simple/medium/complex} - {1-3/3-8/8-15} days
|
|
100
|
+
|
|
101
|
+
{If multi-module:}
|
|
102
|
+
[CROSS-MODULE] Integration Tasks
|
|
103
|
+
Status: NOT STARTED
|
|
104
|
+
Dependencies: All modules COMPLETED
|
|
105
|
+
|
|
106
|
+
□ Verify cross-module entity relationships
|
|
107
|
+
□ Test cross-module API dependencies
|
|
108
|
+
□ Validate permission matrix across modules
|
|
109
|
+
□ E2E flow tests spanning multiple modules
|
|
110
|
+
□ Cross-module data consistency checks
|
|
111
|
+
□ Integration test suite for module interactions
|
|
112
|
+
Total: 6 CROSS-MODULE tasks
|
|
113
|
+
|
|
114
|
+
═════════════════════════════════════════════════════════════════
|
|
115
|
+
SUMMARY
|
|
116
|
+
═════════════════════════════════════════════════════════════════
|
|
117
|
+
Total Modules: {count}
|
|
118
|
+
Total Tasks: {total_count}
|
|
119
|
+
- CORE SeedData: {count} × 5 = {total_core}
|
|
120
|
+
- Business Tasks: {total_biz}
|
|
121
|
+
- Development: {total_dev}
|
|
122
|
+
- Tests: {total_tests}
|
|
123
|
+
- QA: {total_qa}
|
|
124
|
+
- Cross-Module: {cross_module_count or 0}
|
|
125
|
+
|
|
126
|
+
Strategy: {strategy}
|
|
127
|
+
Module Order: {topological order with dependencies noted}
|
|
128
|
+
|
|
129
|
+
Complexity Distribution:
|
|
130
|
+
Simple: {count} modules ({estimate} days each)
|
|
131
|
+
Medium: {count} modules ({estimate} days each)
|
|
132
|
+
Complex: {count} modules ({estimate} days each)
|
|
133
|
+
|
|
134
|
+
Total Effort Estimate: {total_days} days ({total_hours} hours)
|
|
135
|
+
Per Developer (2): {total_days / 2} days
|
|
136
|
+
Parallel Potential: {strategy_efficiency_percent}%
|
|
137
|
+
|
|
138
|
+
═════════════════════════════════════════════════════════════════
|
|
139
|
+
LEGEND
|
|
140
|
+
═════════════════════════════════════════════════════════════════
|
|
141
|
+
□ = Task not started
|
|
142
|
+
✓ = Task completed
|
|
143
|
+
⚠ = Task in progress
|
|
144
|
+
✗ = Task failed / blocked
|
|
145
|
+
|
|
146
|
+
COLORS:
|
|
147
|
+
[DOMAIN] = Domain Model & Business Logic
|
|
148
|
+
[SEEDDATA-CORE] = MANDATORY core configuration (5 entries)
|
|
149
|
+
[SEEDDATA] = Business reference & lookup data
|
|
150
|
+
[APPLICATION] = Services, DTOs, Validators
|
|
151
|
+
[INFRASTRUCTURE] = Repositories, DbContext, ORM
|
|
152
|
+
[API] = REST controllers & endpoints
|
|
153
|
+
[FRONTEND] = React pages, components, hooks
|
|
154
|
+
[I18N] = Internationalization
|
|
155
|
+
[TESTS] = Unit, Integration, Security, E2E
|
|
156
|
+
[QA] = Code quality, coverage, security
|
|
157
|
+
[CROSS-MODULE] = Multi-module integration (if applicable)
|
|
158
|
+
|
|
159
|
+
═════════════════════════════════════════════════════════════════
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Progress Tracker Rules
|
|
163
|
+
|
|
164
|
+
- One section per module, in topological order (dependencies first)
|
|
165
|
+
- CORE SeedData ALWAYS 5 entries (mandatory)
|
|
166
|
+
- Business SeedData varies by module
|
|
167
|
+
- Hierarchical task structure (module → layer → tasks)
|
|
168
|
+
- Each task is independent, assignable checkbox
|
|
169
|
+
- Effort estimate per module (simple/medium/complex)
|
|
170
|
+
- Summary with totals across all modules
|
|
171
|
+
- Identified dependencies for parallel execution
|
|
172
|
+
- Cross-module tasks only if multi-module
|
|
@@ -5,7 +5,7 @@ argument-hint: "[-m N] [-c TEXT] [-v] <task description>"
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<objective>
|
|
8
|
-
Execute the Ralph Weegund technique — iterative module orchestration. Ralph reads PRDs from `/
|
|
8
|
+
Execute the Ralph Weegund technique — iterative module orchestration. Ralph reads PRDs from `/derive-prd`, resolves task dependencies, and delegates all code generation to `/apex -d`. Uses progress persistence and Agent Teams for multi-module parallelization.
|
|
9
9
|
|
|
10
10
|
**Key principle:** Ralph ORCHESTRATES (task selection, module sequencing, PRD state, reporting). All code generation is delegated to `/apex`.
|
|
11
11
|
</objective>
|
|
@@ -15,6 +15,7 @@ Execute the Ralph Weegund technique — iterative module orchestration. Ralph re
|
|
|
15
15
|
**From Business Analysis (RECOMMENDED):**
|
|
16
16
|
```bash
|
|
17
17
|
/business-analyse MyFeature
|
|
18
|
+
# Then: /derive-prd
|
|
18
19
|
# Then: /ralph-loop -r
|
|
19
20
|
```
|
|
20
21
|
|
|
@@ -43,9 +44,9 @@ Execute the Ralph Weegund technique — iterative module orchestration. Ralph re
|
|
|
43
44
|
|
|
44
45
|
**Single module:**
|
|
45
46
|
1. Init: parse flags, verify MCP, setup .ralph/ (step-00)
|
|
46
|
-
2. Load tasks from prd.json — unified v3 has pre-computed tasks (step-01,
|
|
47
|
-
3. Execute first task (step-02,
|
|
48
|
-
4. Commit + update progress (step-03,
|
|
47
|
+
2. Load tasks from prd.json — unified v3 has pre-computed tasks (step-01, step FILE read once)
|
|
48
|
+
3. Execute first task (step-02, step FILE read once)
|
|
49
|
+
4. Commit + update progress (step-03, step FILE read once)
|
|
49
50
|
5. Check completion → enter COMPACT LOOP (step-04)
|
|
50
51
|
6. **COMPACT LOOP** (step-04 → references/compact-loop.md):
|
|
51
52
|
- Find eligible → batch by category (max 5) → execute → test → commit → loop
|
|
@@ -105,6 +106,7 @@ LOAD → DELEGATE TO /apex -d → VERIFY PRD STATE → COMMIT PRD → NEXT MODUL
|
|
|
105
106
|
| `{section_phases}` | SectionPhase[] | Phase execution plan (Phase 0: foundation, Phase 1..N: per-section) |
|
|
106
107
|
| `{parallel_mode}` | boolean | Teams mode enabled via `-p` flag. Ralph generates Phase 0 (entities) sequentially, then spawns parallel teammates. |
|
|
107
108
|
| `{team_name}` | string\|null | Team name for parallel mode (e.g., "smartstack-hr") |
|
|
109
|
+
| `{team_active}` | boolean | True after `TeamCreate`, false after `TeamDelete`. Used in step-04 section 3a to send `MODULE_COMPLETE` to team-lead instead of advancing the module queue locally. |
|
|
108
110
|
</state_variables>
|
|
109
111
|
|
|
110
112
|
<mcp_requirements>
|
|
@@ -162,6 +164,10 @@ When the user invokes `/ralph-loop`, they are giving you the instruction to:
|
|
|
162
164
|
| 04 | `steps/step-04-check.md` | Check completion, compact loop entry | ~185 |
|
|
163
165
|
| 05 | `steps/step-05-report.md` | Generate final report | ~150 |
|
|
164
166
|
|
|
167
|
+
> **"Read Once" rule:** Each **step file** (step-01 to step-04) is loaded only once at the start of the first iteration. From iteration 2 onward, `compact-loop.md` drives the loop inline — step files are NOT re-read. This reduces context consumption. **Exception:** prd.json is re-read every iteration (it changes); step files are not.
|
|
168
|
+
|
|
169
|
+
> **Distinction:** `/apex -d prd.json` is invoked every iteration (B2 of compact-loop) — that is normal and expected. "Read Once" applies only to the step instruction files, not to data files or apex delegations.
|
|
170
|
+
|
|
165
171
|
**Reference files (loaded conditionally):**
|
|
166
172
|
| File | Loaded when |
|
|
167
173
|
|------|-------------|
|
|
@@ -151,14 +151,30 @@ if (guardrailsNeeded.length > 0) {
|
|
|
151
151
|
|
|
152
152
|
## Artifact Verification
|
|
153
153
|
|
|
154
|
-
After category check, verify artifacts actually exist for completed tasks
|
|
154
|
+
After category check, verify artifacts actually exist for completed tasks.
|
|
155
|
+
|
|
156
|
+
> **Patterns read from PRD metadata first** (`prd.metadata.artifactPatterns`), falling back to SmartStack defaults.
|
|
157
|
+
> This allows non-standard project structures to work without hardcoded paths.
|
|
155
158
|
|
|
156
159
|
```javascript
|
|
157
160
|
const completedCats = new Set(prd.tasks.filter(t => t.status === 'completed').map(t => t.category));
|
|
161
|
+
|
|
162
|
+
// Read custom patterns from PRD metadata (set by ss derive-prd based on project structure)
|
|
163
|
+
const customPatterns = prd.metadata?.artifactPatterns || {};
|
|
164
|
+
|
|
158
165
|
const artifactChecks = {
|
|
159
|
-
'frontend': () =>
|
|
160
|
-
|
|
161
|
-
|
|
166
|
+
'frontend': () => {
|
|
167
|
+
const patterns = customPatterns.frontend || ['**/src/pages/**/*.tsx', '**/src/app/**/*.tsx'];
|
|
168
|
+
return patterns.some(p => glob.sync(p).length > 0);
|
|
169
|
+
},
|
|
170
|
+
'test': () => {
|
|
171
|
+
const patterns = customPatterns.test || ['tests/**/*Tests.cs', '**/*.spec.ts', '**/*.test.ts'];
|
|
172
|
+
return patterns.some(p => glob.sync(p).length > 0);
|
|
173
|
+
},
|
|
174
|
+
'api': () => {
|
|
175
|
+
const patterns = customPatterns.api || ['src/*/Controllers/**/*Controller.cs', 'src/**/controllers/**/*.ts'];
|
|
176
|
+
return patterns.some(p => glob.sync(p).length > 0);
|
|
177
|
+
}
|
|
162
178
|
};
|
|
163
179
|
|
|
164
180
|
for (const [cat, check] of Object.entries(artifactChecks)) {
|
|
@@ -36,7 +36,7 @@ if (prd._sectionSplit?.enabled) {
|
|
|
36
36
|
|
|
37
37
|
if (!nextPhase) {
|
|
38
38
|
// All phases done — check if master PRD tasks are all complete
|
|
39
|
-
|
|
39
|
+
// → STOP this section. Return to step-04 section 1 (CHECK_COMPLETION path).
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const depsOk = nextPhase.dependsOn.every(depIdx =>
|
|
@@ -46,7 +46,7 @@ if (prd._sectionSplit?.enabled) {
|
|
|
46
46
|
if (!depsOk) {
|
|
47
47
|
// Phase blocked — should not happen with topological sort
|
|
48
48
|
console.warn(`Phase ${nextPhase.phase} blocked — dependencies incomplete`);
|
|
49
|
-
|
|
49
|
+
// → STOP this section. Return to step-04 section 1 (CHECK_COMPLETION path).
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
const phaseLabel = nextPhase.type === 'foundation'
|
|
@@ -54,11 +54,14 @@ if (prd._sectionSplit?.enabled) {
|
|
|
54
54
|
: `Phase ${nextPhase.phase}: Section "${nextPhase.sectionCode}" (${nextPhase.entities.length} entities)`;
|
|
55
55
|
console.log(`[{iteration}/{max}] SECTION SPLIT: ${phaseLabel}`);
|
|
56
56
|
|
|
57
|
-
//
|
|
58
|
-
|
|
57
|
+
// ↓ MANDATORY: execute this skill call now (not pseudo-code)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**INVOKE `/apex -d {nextPhase.prdFile}`**
|
|
61
|
+
|
|
62
|
+
Apex sees a focused PRD for this phase only. After apex returns, continue:
|
|
59
63
|
|
|
60
|
-
|
|
61
|
-
// Read references/section-splitting.md sections 7-9
|
|
64
|
+
```javascript
|
|
62
65
|
const phasePrd = readJSON(nextPhase.prdFile);
|
|
63
66
|
for (const phaseTask of phasePrd.tasks) {
|
|
64
67
|
const masterTask = prd.tasks.find(t => t.id === phaseTask.id);
|
|
@@ -96,7 +99,7 @@ if (prd._sectionSplit?.enabled) {
|
|
|
96
99
|
writeJSON('.ralph/prd.json', prd);
|
|
97
100
|
|
|
98
101
|
// → Skip to section C (commit PRD state), then D (loop back)
|
|
99
|
-
|
|
102
|
+
// → SKIP sections A and B. Jump directly to section C (COMMIT_PRD) below.
|
|
100
103
|
}
|
|
101
104
|
```
|
|
102
105
|
|
|
@@ -112,43 +115,65 @@ if (prd._sectionSplit?.enabled) {
|
|
|
112
115
|
```javascript
|
|
113
116
|
const MAX_RETRIES = 3;
|
|
114
117
|
|
|
118
|
+
// DEAD-END PRE-CHECK: verify if we are truly stuck BEFORE resetting retries.
|
|
119
|
+
// Resetting retries FIRST would mask a dead-end — the check must run on the raw state.
|
|
120
|
+
const failedBeforeRetry = prd.tasks.filter(t => t.status === 'failed');
|
|
121
|
+
const retriableBeforeReset = failedBeforeRetry.filter(t => (t._retryCount || 0) < MAX_RETRIES);
|
|
122
|
+
const hasPendingBeforeRetry = prd.tasks.some(t => t.status === 'pending');
|
|
123
|
+
const allDoneBeforeRetry = prd.tasks.every(t => t.status === 'completed' || t.status === 'skipped');
|
|
124
|
+
|
|
125
|
+
const isDeadEnd = !hasPendingBeforeRetry && !allDoneBeforeRetry && retriableBeforeReset.length === 0;
|
|
126
|
+
|
|
127
|
+
if (isDeadEnd) {
|
|
128
|
+
// TRUE dead-end: no pending tasks, not all done, and no retries left.
|
|
129
|
+
// Mark prd.status = 'failed' NOW so step-04 section 4 routes to step-05.
|
|
130
|
+
// Then fall through to `eligible.length === 0` below which returns to step-04.
|
|
131
|
+
console.log(`DEAD-END: ${prd.tasks.filter(t=>t.status==='completed').length} done, ${failedBeforeRetry.length} failed (retries exhausted), ${prd.tasks.filter(t=>t.status==='blocked').length} blocked`);
|
|
132
|
+
prd.status = 'failed';
|
|
133
|
+
writeJSON('.ralph/prd.json', prd);
|
|
134
|
+
// DO NOT reset retries below — skip to eligible search (will find 0 tasks → CHECK_COMPLETION)
|
|
135
|
+
}
|
|
136
|
+
|
|
115
137
|
// RETRY: Reset failed tasks to pending if retries remain (max 3 attempts per task)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
task.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
138
|
+
// Skipped when isDeadEnd = true (no retriable tasks remain anyway).
|
|
139
|
+
if (!isDeadEnd) {
|
|
140
|
+
for (const task of prd.tasks) {
|
|
141
|
+
if (task.status !== 'failed') continue;
|
|
142
|
+
const retryCount = task._retryCount || 0;
|
|
143
|
+
if (retryCount < MAX_RETRIES) {
|
|
144
|
+
task.status = 'pending';
|
|
145
|
+
task._retryCount = retryCount + 1;
|
|
146
|
+
task.error = null;
|
|
147
|
+
console.log(`RETRY [${task.id}] attempt ${retryCount + 1}/${MAX_RETRIES}: ${task.description.substring(0, 60)}`);
|
|
148
|
+
}
|
|
124
149
|
}
|
|
125
|
-
}
|
|
126
150
|
|
|
127
|
-
// Unblock tasks whose dependencies are no longer failed (due to retries above)
|
|
128
|
-
for (const task of prd.tasks) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
151
|
+
// Unblock tasks whose dependencies are no longer failed (due to retries above)
|
|
152
|
+
for (const task of prd.tasks) {
|
|
153
|
+
if (task.status !== 'blocked') continue;
|
|
154
|
+
const stillBlocked = task.dependencies.some(depId => {
|
|
155
|
+
const dep = prd.tasks.find(t => t.id === depId);
|
|
156
|
+
return dep && (dep.status === 'failed' || dep.status === 'blocked');
|
|
157
|
+
});
|
|
158
|
+
if (!stillBlocked) {
|
|
159
|
+
task.status = 'pending';
|
|
160
|
+
task.error = null;
|
|
161
|
+
console.log(`UNBLOCKED [${task.id}]: dependencies resolved`);
|
|
162
|
+
}
|
|
138
163
|
}
|
|
139
|
-
}
|
|
140
164
|
|
|
141
|
-
// Block pending tasks whose dependencies are still failed/blocked
|
|
142
|
-
for (const task of prd.tasks) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
165
|
+
// Block pending tasks whose dependencies are still failed/blocked
|
|
166
|
+
for (const task of prd.tasks) {
|
|
167
|
+
if (task.status !== 'pending') continue;
|
|
168
|
+
const depsBlocked = task.dependencies.some(depId => {
|
|
169
|
+
const dep = prd.tasks.find(t => t.id === depId);
|
|
170
|
+
return dep && (dep.status === 'failed' || dep.status === 'blocked');
|
|
171
|
+
});
|
|
172
|
+
if (depsBlocked) { task.status = 'blocked'; task.error = 'Blocked by failed dependency'; }
|
|
173
|
+
}
|
|
150
174
|
|
|
151
|
-
writeJSON('.ralph/prd.json', prd);
|
|
175
|
+
writeJSON('.ralph/prd.json', prd);
|
|
176
|
+
} // end if (!isDeadEnd)
|
|
152
177
|
|
|
153
178
|
// Find ALL eligible tasks (dependencies met)
|
|
154
179
|
const eligible = prd.tasks.filter(task => {
|
|
@@ -160,8 +185,8 @@ const eligible = prd.tasks.filter(task => {
|
|
|
160
185
|
});
|
|
161
186
|
|
|
162
187
|
if (eligible.length === 0) {
|
|
163
|
-
//
|
|
164
|
-
goto CHECK_COMPLETION
|
|
188
|
+
// All done or dead-end — return to step-04 sections 2-4
|
|
189
|
+
// [goto CHECK_COMPLETION]
|
|
165
190
|
}
|
|
166
191
|
|
|
167
192
|
// BATCH: group by category, take first group (max 5)
|
|
@@ -265,21 +290,28 @@ chore(ralph): update PRD state — iteration {iteration}
|
|
|
265
290
|
Tasks: {completed}/{batch_size} completed via /apex
|
|
266
291
|
Overall: {totalCompleted}/{total}
|
|
267
292
|
|
|
268
|
-
Co-Authored-By: Claude
|
|
293
|
+
Co-Authored-By: Claude AI <noreply@anthropic.com>
|
|
269
294
|
EOF
|
|
270
295
|
)"
|
|
271
296
|
```
|
|
272
297
|
|
|
273
298
|
### C4. PRD Sync Verification (HARD CHECK)
|
|
274
299
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
300
|
+
> **Note:** `prdCheck` (read in C1) is the authoritative post-apex snapshot.
|
|
301
|
+
> `completed` (from B3) was computed on a DIFFERENT read — do NOT mix the two.
|
|
302
|
+
> Re-derive the count from `prdCheck` to avoid stale-reference mismatches.
|
|
278
303
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
304
|
+
```javascript
|
|
305
|
+
// Re-derive completed count from the SAME object used for the commit (prdCheck)
|
|
306
|
+
const actuallyCompleted = prdCheck.tasks.filter(t => batchIds.includes(t.id) && t.status === 'completed').length;
|
|
307
|
+
const actuallyFailed = prdCheck.tasks.filter(t => batchIds.includes(t.id) && t.status === 'failed').length;
|
|
308
|
+
|
|
309
|
+
if (actuallyCompleted !== completed) {
|
|
310
|
+
console.warn(`PRD SYNC WARNING: B3 reported ${completed} completed, prdCheck shows ${actuallyCompleted}`);
|
|
311
|
+
console.warn('Using prdCheck as source of truth (apex may have written between reads)');
|
|
312
|
+
// DO NOT overwrite prdCheck — apex is the source of truth for task statuses
|
|
313
|
+
// Update local `completed` variable for progress reporting consistency
|
|
314
|
+
completed = actuallyCompleted;
|
|
283
315
|
}
|
|
284
316
|
```
|
|
285
317
|
|
|
@@ -88,7 +88,9 @@ if (handoffStatus === 'handed-off') {
|
|
|
88
88
|
console.log('BA artifacts detected without PRD — auto-recovering...');
|
|
89
89
|
|
|
90
90
|
// Call ss derive-prd to generate PRD files
|
|
91
|
-
|
|
91
|
+
// Flag: --feature (path to feature.json) — matches ss derive-prd CLI convention
|
|
92
|
+
// See also: step-05c-ralph-readiness.md section 2 "Fix: ss derive-prd --feature {path} --output ..."
|
|
93
|
+
const result = exec(`ss derive-prd --feature ${masterFeature}`);
|
|
92
94
|
|
|
93
95
|
if (result.exitCode !== 0) {
|
|
94
96
|
console.error('ss derive-prd failed — cannot auto-recover');
|
|
@@ -107,7 +109,7 @@ if (handoffStatus === 'handed-off') {
|
|
|
107
109
|
// BA handoff NOT complete
|
|
108
110
|
console.warn(`⚠ BA handoff status: "${handoffStatus}" (expected "handed-off")`);
|
|
109
111
|
console.warn('Cannot auto-recover PRD files without complete handoff');
|
|
110
|
-
console.warn('Run /
|
|
112
|
+
console.warn('Run /derive-prd to generate the handoff, then retry /ralph-loop');
|
|
111
113
|
STOP;
|
|
112
114
|
}
|
|
113
115
|
```
|