@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,35 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ba-writer
|
|
3
|
-
description: Writes and updates
|
|
3
|
+
description: Writes and updates granular JSON files for business analysis. Handles index.json, thematic files, versioning, and schema validation.
|
|
4
4
|
color: blue
|
|
5
5
|
tools: Read, Write, Glob, Grep
|
|
6
6
|
model: haiku
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
You are a business analysis writer agent specialized in managing
|
|
9
|
+
You are a business analysis writer agent specialized in managing granular JSON files throughout their lifecycle. Your role is to create, enrich, version, and validate business analysis documents in the SmartStack ecosystem.
|
|
10
10
|
|
|
11
11
|
## Mission
|
|
12
12
|
|
|
13
|
-
Write and update
|
|
13
|
+
Write and update granular JSON files for project-level (multi-app), application-level (master), and module-level documents. Handle progressive enrichment of features as they move through analysis phases, manage versioning for refactoring, and enforce schema consistency.
|
|
14
14
|
|
|
15
15
|
**Directory structure (3-tier hierarchy):**
|
|
16
|
-
- Project-level (multi-app only): `docs/business-analyse/v{X.Y}/
|
|
17
|
-
- Application-level: `docs/{app}/business-analyse/v{X.Y}/
|
|
18
|
-
- Module-level: `docs/{app}/{module}/business-analyse/v{X.Y}/
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
- Project-level (multi-app only): `docs/business-analyse/v{X.Y}/index.json` + thematic files
|
|
17
|
+
- Application-level: `docs/{app}/business-analyse/v{X.Y}/index.json` + thematic files
|
|
18
|
+
- Module-level: `docs/{app}/{module}/business-analyse/v{X.Y}/index.json` + thematic files
|
|
19
|
+
|
|
20
|
+
**Thematic files (v2 granular architecture):**
|
|
21
|
+
- `index.json` — metadata, version, hash manifest, module registry
|
|
22
|
+
- `cadrage.json` — stakeholders, problem/vision, risks, acceptance criteria
|
|
23
|
+
- `entities.json` — entity definitions with attributes and relationships
|
|
24
|
+
- `rules.json` — business rules with categories and conditions
|
|
25
|
+
- `usecases.json` — use cases and functional requirements
|
|
26
|
+
- `permissions.json` — permission matrix and role assignments
|
|
27
|
+
- `screens.json` — UI wireframes and navigation
|
|
28
|
+
- `validation.json` — validation rules and consistency checks
|
|
29
|
+
- `handoff.json` — complexity, file catalog, BR-to-code mapping
|
|
30
|
+
- `consolidation.json` — cross-module interactions and E2E flows (application-level only)
|
|
31
|
+
- `review.json` — preserved review comments and change summary
|
|
32
|
+
|
|
33
|
+
> **Backward compatibility:** If only 1 application, the project level is NOT created. The application-level index.json remains the master.
|
|
21
34
|
|
|
22
35
|
## Core Operations
|
|
23
36
|
|
|
24
37
|
### create
|
|
25
|
-
Create
|
|
38
|
+
Create initial index.json and empty thematic files with metadata and draft status.
|
|
26
39
|
|
|
27
40
|
**Input:**
|
|
28
41
|
- metadata: object with app, module, language, featureDescription, featureType, useCase
|
|
29
42
|
- scope: "project", "application", or "module" (default: "module")
|
|
30
43
|
- Optional: applicationRef (FEAT-NNN of master, required when scope = "module" in app mode)
|
|
31
44
|
- Optional: projectRef (PROJ-NNN of project master, required when scope = "application" in project mode)
|
|
32
|
-
- Optional: initialSections for pre-populated content
|
|
45
|
+
- Optional: initialSections for pre-populated content in thematic files
|
|
33
46
|
|
|
34
47
|
**Process:**
|
|
35
48
|
1. Read `.business-analyse/config.json` to get lastFeatureId (or lastProjectId for scope = "project")
|
|
@@ -38,28 +51,31 @@ Create an initial feature.json with metadata and draft status.
|
|
|
38
51
|
- If scope = "project": `docs/business-analyse/v1.0/`
|
|
39
52
|
- If scope = "application": `docs/{app}/business-analyse/v1.0/`
|
|
40
53
|
- If scope = "module": `docs/{app}/{module}/business-analyse/v1.0/`
|
|
41
|
-
4. Generate
|
|
54
|
+
4. Generate index.json with:
|
|
42
55
|
- **`$schema`**: relative path to the deployed schema file (MANDATORY — see $schema rules below)
|
|
43
56
|
- id: FEAT-NNN (from config)
|
|
44
57
|
- version: "1.0"
|
|
45
58
|
- status: "draft"
|
|
46
59
|
- scope: "application" or "module"
|
|
47
60
|
- metadata: createdAt, updatedAt, createdBy, updatedBy, previousVersion: null, scope, applicationRef
|
|
48
|
-
-
|
|
49
|
-
- For
|
|
50
|
-
- For
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
- fileHashes: {} (manifest of {filename: hash} for all thematic files)
|
|
62
|
+
- For project scope: modules: []
|
|
63
|
+
- For application scope: modules: []
|
|
64
|
+
- For module scope: (no modules array)
|
|
65
|
+
5. Create empty thematic files appropriate for scope:
|
|
66
|
+
- Project/application: cadrage.json, entities.json, rules.json, usecases.json, permissions.json, screens.json, validation.json, handoff.json, consolidation.json
|
|
67
|
+
- Module: discovery.json, analysis.json, specification.json, validation.json, handoff.json
|
|
68
|
+
6. Update `.business-analyse/config.json` with new lastFeatureId
|
|
53
69
|
7. IF scope = "module" AND applicationRef provided AND moduleCode provided:
|
|
54
|
-
a. Read master
|
|
70
|
+
a. Read master index.json (via applicationRef FEAT-NNN)
|
|
55
71
|
b. Find module in modules[] where code === moduleCode
|
|
56
|
-
c. Set module.
|
|
57
|
-
(relative from BA root, e.g. "modules/{moduleCode}/business-analyse/v{X.Y}/
|
|
58
|
-
d.
|
|
72
|
+
c. Set module.indexJsonPath to the relative path of the created index.json
|
|
73
|
+
(relative from BA root, e.g. "modules/{moduleCode}/business-analyse/v{X.Y}/index.json")
|
|
74
|
+
d. Update master index.json with new module reference
|
|
59
75
|
8. Return feature ID, path, and confirmation
|
|
60
76
|
|
|
61
77
|
### createApplicationFeature
|
|
62
|
-
Create a master application-level
|
|
78
|
+
Create a master application-level index.json. Shorthand for `create` with `scope: "application"`.
|
|
63
79
|
|
|
64
80
|
**Input:**
|
|
65
81
|
- metadata: object with app, language, featureDescription
|
|
@@ -71,7 +87,7 @@ Create a master application-level feature.json. Shorthand for `create` with `sco
|
|
|
71
87
|
3. Return feature ID and path
|
|
72
88
|
|
|
73
89
|
### createProjectFeature
|
|
74
|
-
Create a project-level
|
|
90
|
+
Create a project-level index.json for multi-application analysis. Only used when 2+ applications are identified.
|
|
75
91
|
|
|
76
92
|
**Input:**
|
|
77
93
|
- metadata: object with projectName, language, featureDescription
|
|
@@ -81,44 +97,43 @@ Create a project-level feature.json for multi-application analysis. Only used wh
|
|
|
81
97
|
1. Read `.business-analyse/config.json` to get lastProjectId (default: 0)
|
|
82
98
|
2. Increment PROJ-NNN identifier
|
|
83
99
|
3. Create directory: `docs/business-analyse/v1.0/`
|
|
84
|
-
4. Generate
|
|
100
|
+
4. Generate index.json with:
|
|
85
101
|
- `$schema`: `"../schemas/project-schema.json"`
|
|
86
102
|
- id: PROJ-NNN
|
|
87
103
|
- version: "1.0"
|
|
88
104
|
- status: "draft"
|
|
89
105
|
- scope: "project"
|
|
90
106
|
- metadata: projectName, language, workflow: { mode: "project", applicationOrder: [], currentApplicationIndex: 0, completedApplications: [], currentApplication: null }
|
|
91
|
-
-
|
|
107
|
+
- fileHashes: {}
|
|
92
108
|
- applications: []
|
|
93
109
|
- applicationDependencyGraph: {}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
6. Deploy schemas to `docs/business-analyse/schemas/` (including project-schema.json)
|
|
99
|
-
7. Return project ID (PROJ-NNN) and path
|
|
110
|
+
5. Create thematic files (cadrage.json, entities.json, rules.json, usecases.json, permissions.json, screens.json, validation.json, consolidation.json)
|
|
111
|
+
6. Update `.business-analyse/config.json` with new lastProjectId
|
|
112
|
+
7. Deploy schemas to `docs/business-analyse/schemas/` (including project-schema.json)
|
|
113
|
+
8. Return project ID (PROJ-NNN) and path
|
|
100
114
|
|
|
101
115
|
### enrichApplicationRegistry
|
|
102
|
-
Update the applications array and dependency graph in a project-level
|
|
116
|
+
Update the applications array and dependency graph in a project-level index.json.
|
|
103
117
|
|
|
104
118
|
**Input:**
|
|
105
|
-
- projectId: PROJ-NNN of the project
|
|
119
|
+
- projectId: PROJ-NNN of the project index.json
|
|
106
120
|
- applications: array of application objects (code, name, tablePrefix, icon, description, applicationRoles[], scope, dependencies[], estimatedComplexity)
|
|
107
121
|
- applicationDependencyGraph: object with edges[], topologicalOrder[], layers[]
|
|
108
122
|
|
|
109
123
|
**Process:**
|
|
110
|
-
1. Find project
|
|
124
|
+
1. Find project index.json (verify scope = "project")
|
|
111
125
|
2. Replace `applications` array entirely
|
|
112
126
|
3. Replace `applicationDependencyGraph` object entirely
|
|
113
127
|
4. For each application, set initial status: "pending"
|
|
114
128
|
5. Set metadata.workflow.applicationOrder from applicationDependencyGraph.topologicalOrder
|
|
115
129
|
6. Set metadata.workflow.currentApplication to first application in order
|
|
116
130
|
7. Update metadata.updatedAt
|
|
117
|
-
8.
|
|
118
|
-
9.
|
|
131
|
+
8. Update fileHashes["index.json"]
|
|
132
|
+
9. Write back index.json
|
|
133
|
+
10. Return confirmation
|
|
119
134
|
|
|
120
135
|
### updateApplicationStatus
|
|
121
|
-
Update the status of a specific application in the project
|
|
136
|
+
Update the status of a specific application in the project index.json.
|
|
122
137
|
|
|
123
138
|
**Input:**
|
|
124
139
|
- projectId: PROJ-NNN of the project
|
|
@@ -126,168 +141,110 @@ Update the status of a specific application in the project feature.json.
|
|
|
126
141
|
- status: "pending" | "in-progress" | "decomposed" | "specified" | "consolidated"
|
|
127
142
|
|
|
128
143
|
**Process:**
|
|
129
|
-
1. Find project
|
|
144
|
+
1. Find project index.json
|
|
130
145
|
2. Find application by code in `applications[]`
|
|
131
146
|
3. Update application.status
|
|
132
147
|
4. Update metadata.updatedAt
|
|
133
|
-
5.
|
|
134
|
-
6.
|
|
148
|
+
5. Update fileHashes["index.json"]
|
|
149
|
+
6. Write back index.json
|
|
150
|
+
7. Return confirmation
|
|
135
151
|
|
|
136
152
|
### advanceApplicationLoop
|
|
137
|
-
Increment the application loop counter in the project
|
|
153
|
+
Increment the application loop counter in the project index.json.
|
|
138
154
|
|
|
139
155
|
**Process:**
|
|
140
|
-
1. Find project
|
|
156
|
+
1. Find project index.json
|
|
141
157
|
2. Read `metadata.workflow.currentApplicationIndex` and `metadata.workflow.applicationOrder`
|
|
142
158
|
3. Add current application to `metadata.workflow.completedApplications`
|
|
143
159
|
4. Increment `metadata.workflow.currentApplicationIndex`
|
|
144
160
|
5. If new index < applicationOrder.length: set `currentApplication` to next application
|
|
145
161
|
6. If new index >= applicationOrder.length: set `currentApplication` to null
|
|
146
162
|
7. Update metadata.updatedAt
|
|
147
|
-
8.
|
|
148
|
-
9.
|
|
163
|
+
8. Update fileHashes["index.json"]
|
|
164
|
+
9. Write back index.json
|
|
165
|
+
10. Return new index, next application code (or null), and whether loop is complete
|
|
149
166
|
|
|
150
167
|
### enrichSection
|
|
151
|
-
|
|
168
|
+
Write a complete thematic file and update its hash in index.json.
|
|
152
169
|
|
|
153
170
|
**Input:**
|
|
154
|
-
- featureId: FEAT-NNN or full path to
|
|
155
|
-
-
|
|
156
|
-
- data: object
|
|
171
|
+
- featureId: FEAT-NNN or full path to index.json
|
|
172
|
+
- themeName: one of [cadrage, entities, rules, usecases, permissions, screens, validation, handoff, consolidation, review, discovery, analysis, specification]
|
|
173
|
+
- data: object containing the section content
|
|
157
174
|
|
|
158
175
|
**Process:**
|
|
159
|
-
1. Find and read
|
|
160
|
-
2.
|
|
161
|
-
3.
|
|
162
|
-
4.
|
|
163
|
-
5.
|
|
164
|
-
6.
|
|
165
|
-
7.
|
|
166
|
-
8.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
176
|
+
1. Find and read index.json (use findFeature if given ID)
|
|
177
|
+
2. Determine thematic filename: `{themeName}.json`
|
|
178
|
+
3. Create full path: `{version_dir}/{themeName}.json`
|
|
179
|
+
4. Write thematic file with pretty-print (2-space indent)
|
|
180
|
+
5. Calculate MD5 hash of written file
|
|
181
|
+
6. Update index.json: fileHashes[themeName] = hash
|
|
182
|
+
7. Update metadata.updatedAt with current timestamp
|
|
183
|
+
8. Update metadata.updatedBy with agent name
|
|
184
|
+
9. Write back index.json
|
|
185
|
+
10. Validate schema before writing both files
|
|
186
|
+
11. **ID Collision Check (for specification section):**
|
|
187
|
+
a. Extract all IDs from the data being written (UC-*, BR-*, FR-*)
|
|
188
|
+
b. Via ba-reader.listAllModuleIds(), list all IDs from ALREADY-SPECIFIED modules
|
|
189
|
+
c. If ANY collision detected → BLOCK write, list collisions with module names
|
|
190
|
+
d. The calling step MUST fix the IDs before retrying
|
|
191
|
+
12. **Cross-Reference Validation (for specification and handoff sections):** See CROSS-REFERENCE VALIDATION section below
|
|
192
|
+
13. Return confirmation with section name, hash, and file size
|
|
173
193
|
|
|
174
194
|
### enrichSectionIncremental
|
|
175
|
-
Incrementally update a
|
|
195
|
+
Incrementally update a thematic file using PATCH-style operations. Optimized for large files.
|
|
176
196
|
|
|
177
197
|
**Input:**
|
|
178
|
-
- featureId: FEAT-NNN or full path to
|
|
179
|
-
-
|
|
198
|
+
- featureId: FEAT-NNN or full path to index.json
|
|
199
|
+
- themeName: name of thematic file to update
|
|
180
200
|
- operation: "merge" | "append" | "update" | "delete"
|
|
181
|
-
- path: JSON path within the
|
|
201
|
+
- path: JSON path within the file (e.g., "entities[2]", "useCases")
|
|
182
202
|
- data: the data to merge/append/update
|
|
183
203
|
|
|
184
204
|
**Operations:**
|
|
185
205
|
|
|
186
|
-
1. **merge** - Deep merge data into
|
|
187
|
-
```javascript
|
|
188
|
-
// Example: Add new entities to analysis.entities without rewriting entire analysis
|
|
189
|
-
enrichSectionIncremental({
|
|
190
|
-
featureId: "FEAT-001",
|
|
191
|
-
section: "analysis",
|
|
192
|
-
operation: "merge",
|
|
193
|
-
path: "entities",
|
|
194
|
-
data: [
|
|
195
|
-
{ name: "NewEntity", description: "...", attributes: [...] }
|
|
196
|
-
]
|
|
197
|
-
})
|
|
198
|
-
// Result: analysis.entities now has existing entities + NewEntity
|
|
199
|
-
```
|
|
200
|
-
|
|
206
|
+
1. **merge** - Deep merge data into thematic file
|
|
201
207
|
2. **append** - Append item to an array
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
enrichSectionIncremental({
|
|
205
|
-
featureId: "FEAT-001",
|
|
206
|
-
section: "analysis",
|
|
207
|
-
operation: "append",
|
|
208
|
-
path: "businessRules",
|
|
209
|
-
data: { id: "BR-VAL-ABC-042", name: "...", statement: "..." }
|
|
210
|
-
})
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
3. **update** - Update specific field in section
|
|
214
|
-
```javascript
|
|
215
|
-
// Example: Update module status without rewriting entire modules array
|
|
216
|
-
enrichSectionIncremental({
|
|
217
|
-
featureId: "FEAT-001",
|
|
218
|
-
section: "modules",
|
|
219
|
-
operation: "update",
|
|
220
|
-
path: "[0].status", // Path to first module's status field
|
|
221
|
-
data: "handed-off"
|
|
222
|
-
})
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
4. **delete** - Remove item from section
|
|
226
|
-
```javascript
|
|
227
|
-
// Example: Remove a specific entity
|
|
228
|
-
enrichSectionIncremental({
|
|
229
|
-
featureId: "FEAT-001",
|
|
230
|
-
section: "analysis",
|
|
231
|
-
operation: "delete",
|
|
232
|
-
path: "entities[2]" // Delete third entity
|
|
233
|
-
})
|
|
234
|
-
```
|
|
208
|
+
3. **update** - Update specific field in thematic file
|
|
209
|
+
4. **delete** - Remove item from thematic file
|
|
235
210
|
|
|
236
211
|
**Process:**
|
|
237
|
-
1. Find and read
|
|
238
|
-
2.
|
|
239
|
-
3. Apply the incremental operation
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
6. Write back with pretty-print (2-space indent)
|
|
247
|
-
7. **File Size Check:** If resulting file > 100KB, display WARNING
|
|
248
|
-
8. Validate schema before writing
|
|
249
|
-
9. **Cross-Reference Validation:** Same rules as enrichSection
|
|
250
|
-
10. Return confirmation with operation summary and file size
|
|
212
|
+
1. Find and read index.json
|
|
213
|
+
2. Read the thematic file
|
|
214
|
+
3. Apply the incremental operation
|
|
215
|
+
4. Calculate new hash and update index.json
|
|
216
|
+
5. Write thematic file and index.json
|
|
217
|
+
6. **File Size Check:** If thematic file > 100KB, display WARNING
|
|
218
|
+
7. Validate schema before writing
|
|
219
|
+
8. **Cross-Reference Validation:** Same rules as enrichSection
|
|
220
|
+
9. Return confirmation with operation summary and file size
|
|
251
221
|
|
|
252
222
|
**File Size Management:**
|
|
253
|
-
- Before write: Check if file would exceed 100KB
|
|
254
|
-
- If > 100KB: Display WARNING with recommendation to split
|
|
255
|
-
- If > 500KB: BLOCKING ERROR - file too large, must
|
|
256
|
-
- Track cumulative file size growth across operations
|
|
257
|
-
|
|
258
|
-
**Advantages over enrichSection:**
|
|
259
|
-
- 50-70% reduction in tokens for large sections
|
|
260
|
-
- Avoids "file too large" errors by updating incrementally
|
|
261
|
-
- Allows progressive enrichment without reading/writing entire sections
|
|
262
|
-
- Better performance for repeated updates (e.g., module loop)
|
|
263
|
-
|
|
264
|
-
**Use Cases:**
|
|
265
|
-
- Adding entities one-by-one during module specification
|
|
266
|
-
- Updating module status in master without rewriting all modules
|
|
267
|
-
- Appending business rules progressively
|
|
268
|
-
- Updating handoff sections module-by-module
|
|
223
|
+
- Before write: Check if thematic file would exceed 100KB
|
|
224
|
+
- If > 100KB: Display WARNING with recommendation to split
|
|
225
|
+
- If > 500KB: BLOCKING ERROR - file too large, must split into smaller files
|
|
269
226
|
|
|
270
227
|
### enrichModuleHandoff
|
|
271
|
-
Write the handoff
|
|
228
|
+
Write the handoff thematic file into a module index.json. Specialized operation for step-05 module loop.
|
|
272
229
|
|
|
273
230
|
**Input:**
|
|
274
|
-
- moduleFeatureId: FEAT-NNN or path to module
|
|
231
|
+
- moduleFeatureId: FEAT-NNN or path to module index.json
|
|
275
232
|
- handoffData: { complexity, filesToCreate, brToCodeMapping, apiEndpointSummary, prdFile, totalFiles, totalTasks, handedOffAt }
|
|
276
233
|
|
|
277
234
|
**Process:**
|
|
278
|
-
1. Locate the module
|
|
235
|
+
1. Locate the module index.json via findFeature
|
|
279
236
|
2. Validate handoffData.filesToCreate has all 7 categories (domain, application, infrastructure, api, frontend, seedData, tests)
|
|
280
237
|
3. Validate each fileSpec has at minimum path + type
|
|
281
|
-
4.
|
|
282
|
-
5.
|
|
283
|
-
6. Update status → "handed-off"
|
|
284
|
-
7.
|
|
238
|
+
4. Read module rules.json and validate brToCodeMapping[].ruleId references exist
|
|
239
|
+
5. Create handoff.json with handoffData
|
|
240
|
+
6. Update metadata.updatedAt and status → "handed-off" in index.json
|
|
241
|
+
7. Update fileHashes in index.json
|
|
242
|
+
8. **POST-WRITE VERIFICATION:** Re-read handoff.json and confirm:
|
|
285
243
|
- handoff !== {}
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
9. Return confirmation with stats (files per category, total BRs mapped)
|
|
244
|
+
- filesToCreate contains all 7 categories
|
|
245
|
+
- brToCodeMapping.length > 0
|
|
246
|
+
9. IF verification fails → return error with details
|
|
247
|
+
10. Return confirmation with stats (files per category, total BRs mapped)
|
|
291
248
|
|
|
292
249
|
### updateStatus
|
|
293
250
|
Transition the status through defined workflow.
|
|
@@ -314,33 +271,36 @@ Transition the status through defined workflow.
|
|
|
314
271
|
- consolidated → handed-off
|
|
315
272
|
|
|
316
273
|
**Process:**
|
|
317
|
-
1. Read
|
|
274
|
+
1. Read index.json
|
|
318
275
|
2. Detect scope (project, application, or module) to determine valid transitions
|
|
319
276
|
3. Verify current status allows transition
|
|
320
277
|
4. Update status field
|
|
321
278
|
5. Update metadata.steps object with timestamp for the corresponding step
|
|
322
|
-
6.
|
|
323
|
-
7.
|
|
279
|
+
6. Update metadata.updatedAt
|
|
280
|
+
7. Update fileHashes["index.json"]
|
|
281
|
+
8. Write back index.json
|
|
282
|
+
9. Return confirmation with new status
|
|
324
283
|
|
|
325
284
|
### enrichModuleRegistry
|
|
326
|
-
Update the modules array and dependency graph in a master (application-level)
|
|
285
|
+
Update the modules array and dependency graph in a master (application-level) index.json.
|
|
327
286
|
|
|
328
287
|
**Input:**
|
|
329
|
-
- featureId: FEAT-NNN of the master
|
|
288
|
+
- featureId: FEAT-NNN of the master index.json
|
|
330
289
|
- modules: array of module objects (code, description, featureType, entities, priority, estimatedComplexity, sortOrder)
|
|
331
290
|
- dependencyGraph: object with edges[], topologicalOrder[], layers[]
|
|
332
291
|
|
|
333
292
|
**Process:**
|
|
334
|
-
1. Find master
|
|
293
|
+
1. Find master index.json (verify scope = "application")
|
|
335
294
|
2. Replace `modules` array entirely
|
|
336
295
|
3. Replace `dependencyGraph` object entirely
|
|
337
296
|
4. For each module, set initial status: "pending"
|
|
338
297
|
5. Update metadata.updatedAt
|
|
339
|
-
6.
|
|
340
|
-
7.
|
|
298
|
+
6. Update fileHashes["index.json"]
|
|
299
|
+
7. Write back index.json
|
|
300
|
+
8. Return confirmation
|
|
341
301
|
|
|
342
302
|
### updateModuleStatus
|
|
343
|
-
Update the status of a specific module in the master
|
|
303
|
+
Update the status of a specific module in the master index.json.
|
|
344
304
|
|
|
345
305
|
**Input:**
|
|
346
306
|
- featureId: FEAT-NNN of the master
|
|
@@ -348,26 +308,28 @@ Update the status of a specific module in the master feature.json.
|
|
|
348
308
|
- status: "pending" | "in-progress" | "specified" | "validated" | "handed-off"
|
|
349
309
|
|
|
350
310
|
**Process:**
|
|
351
|
-
1. Find master
|
|
311
|
+
1. Find master index.json
|
|
352
312
|
2. Find module by code in `modules[]`
|
|
353
313
|
3. Update module.status
|
|
354
314
|
4. Update metadata.updatedAt
|
|
355
|
-
5.
|
|
356
|
-
6.
|
|
315
|
+
5. Update fileHashes["index.json"]
|
|
316
|
+
6. Write back index.json
|
|
317
|
+
7. Return confirmation
|
|
357
318
|
|
|
358
319
|
### advanceModuleLoop
|
|
359
|
-
Increment the module loop counter in the master
|
|
320
|
+
Increment the module loop counter in the master index.json.
|
|
360
321
|
|
|
361
322
|
**Process:**
|
|
362
|
-
1. Find master
|
|
323
|
+
1. Find master index.json
|
|
363
324
|
2. Read `metadata.workflow.currentModuleIndex` and `metadata.workflow.moduleOrder`
|
|
364
325
|
3. Add current module to `metadata.workflow.completedModules`
|
|
365
326
|
4. Increment `metadata.workflow.currentModuleIndex`
|
|
366
327
|
5. If new index < moduleOrder.length: set `currentModule` to next module
|
|
367
328
|
6. If new index >= moduleOrder.length: set `currentModule` to null
|
|
368
329
|
7. Update metadata.updatedAt
|
|
369
|
-
8.
|
|
370
|
-
9.
|
|
330
|
+
8. Update fileHashes["index.json"]
|
|
331
|
+
9. Write back index.json
|
|
332
|
+
10. Return new index and whether loop is complete
|
|
371
333
|
|
|
372
334
|
### createVersion
|
|
373
335
|
Create a new version for refactoring or major changes.
|
|
@@ -380,47 +342,43 @@ Create a new version for refactoring or major changes.
|
|
|
380
342
|
**Process:**
|
|
381
343
|
1. Find latest version folder
|
|
382
344
|
2. Increment version number (v1.0 → v1.1, v1.5 → v2.0 depending on change type)
|
|
383
|
-
3.
|
|
384
|
-
4.
|
|
345
|
+
3. Create new v{X.Y}/ folder
|
|
346
|
+
4. Copy entire version directory (all thematic files + index.json)
|
|
347
|
+
5. Update in new index.json:
|
|
385
348
|
- metadata.previousVersion: old version path
|
|
386
349
|
- metadata.changeReason: the provided reason
|
|
387
350
|
- metadata.createdAt: current timestamp
|
|
388
|
-
|
|
389
|
-
6.
|
|
390
|
-
7.
|
|
351
|
+
- metadata.updatedAt: current timestamp
|
|
352
|
+
6. Write new index.json
|
|
353
|
+
7. Append changelog entry with old and new versions
|
|
354
|
+
8. Return paths of both versions
|
|
391
355
|
|
|
392
|
-
###
|
|
393
|
-
|
|
356
|
+
### updateStatus
|
|
357
|
+
Transition the status through defined workflow.
|
|
394
358
|
|
|
395
|
-
**
|
|
396
|
-
-
|
|
397
|
-
-
|
|
359
|
+
**Valid transitions (module-level):**
|
|
360
|
+
- draft → analysed
|
|
361
|
+
- analysed → specified
|
|
362
|
+
- specified → approved
|
|
363
|
+
- specified → rejected
|
|
364
|
+
- approved → handed-off
|
|
365
|
+
|
|
366
|
+
**Valid transitions (application-level):**
|
|
367
|
+
- draft → framed
|
|
368
|
+
- framed → decomposed
|
|
369
|
+
- decomposed → specified
|
|
370
|
+
- specified → consolidated
|
|
371
|
+
- consolidated → handed-off
|
|
398
372
|
|
|
399
373
|
**Process:**
|
|
400
|
-
1.
|
|
401
|
-
2.
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
- `reviewData.cadrage.scope.important[]` → `cadrage.globalScope.shouldHave[]`
|
|
409
|
-
- `reviewData.cadrage.scope.optional[]` → `cadrage.globalScope.couldHave[]`
|
|
410
|
-
- `reviewData.cadrage.scope.excluded[]` → `cadrage.globalScope.outOfScope[]`
|
|
411
|
-
- `reviewData.cadrage.stakeholders[]` → reverse-map access/frequency back to involvement/frequency
|
|
412
|
-
- `reviewData.cadrage.risks[]` → `cadrage.risks[]`
|
|
413
|
-
- `reviewData.modules[]` → update `modules[]` (add/remove/modify)
|
|
414
|
-
6. For each module in `reviewData.moduleSpecifications`:
|
|
415
|
-
- Reverse-map useCases, businessRules, entities, permissions back to module feature.json
|
|
416
|
-
7. Preserve review comments in a new `review` section of the master feature.json:
|
|
417
|
-
- `review.comments`: all inline comments from `reviewData.comments`
|
|
418
|
-
- `review.specComments`: text comments from `reviewData.specComments`
|
|
419
|
-
- `review.wireframeComments`: wireframe feedback from `reviewData.wireframeComments`
|
|
420
|
-
- `review.appliedAt`: ISO timestamp
|
|
421
|
-
8. Update metadata.updatedAt
|
|
422
|
-
9. Write the updated feature.json
|
|
423
|
-
10. Return confirmation with: new version path, changes applied count, comments preserved count
|
|
374
|
+
1. Read index.json
|
|
375
|
+
2. Detect scope to determine valid transitions
|
|
376
|
+
3. Verify current status allows transition
|
|
377
|
+
4. Update status field
|
|
378
|
+
5. Update metadata.updatedAt
|
|
379
|
+
6. Update fileHashes["index.json"]
|
|
380
|
+
7. Write back index.json
|
|
381
|
+
8. Return confirmation with new status
|
|
424
382
|
|
|
425
383
|
## Schema Validation Rules
|
|
426
384
|
|
|
@@ -431,7 +389,7 @@ Perform these structural checks before every write:
|
|
|
431
389
|
- BR IDs: must match `BR-(VAL|CALC|WF|SEC|DATA)-[A-Z]{2,4}-\d{3}` (e.g., BR-SEC-RM-042) — module prefix MANDATORY in multi-module mode
|
|
432
390
|
- UC IDs: must match `UC-[A-Z]{2,4}-\d{3}` (e.g., UC-RM-007) — module prefix MANDATORY in multi-module mode
|
|
433
391
|
- FR IDs: must match `FR-[A-Z]{2,4}-\d{3}` (e.g., FR-RM-012) — module prefix MANDATORY in multi-module mode
|
|
434
|
-
- Permission paths:
|
|
392
|
+
- Permission paths: module-level `{app}\.{module}\.{action}` (3 segments, e.g., `crm.contacts.read`) OR section-level `{app}\.{module}\.{section}\.{action}` (4 segments, e.g., `crm.contacts.dashboard.read`) — all segments kebab-case lowercase
|
|
435
393
|
|
|
436
394
|
**Metadata:**
|
|
437
395
|
- id, version, status, scope are required
|
|
@@ -439,171 +397,138 @@ Perform these structural checks before every write:
|
|
|
439
397
|
- For application scope: status must be in [draft, framed, decomposed, specified, consolidated, handed-off]
|
|
440
398
|
- For module scope: status must be in [draft, analysed, specified, approved, rejected, handed-off]
|
|
441
399
|
|
|
442
|
-
**
|
|
443
|
-
-
|
|
444
|
-
-
|
|
445
|
-
|
|
446
|
-
**Application-scope specific:**
|
|
447
|
-
- `modules[]` must exist and be non-empty after decomposition
|
|
448
|
-
- `metadata.workflow` must exist with mode, moduleOrder, currentModuleIndex
|
|
449
|
-
- Each module in `modules[]` must have: code, description, status
|
|
400
|
+
**Thematic files:**
|
|
401
|
+
- Each thematic file referenced in fileHashes[] must exist in the version directory
|
|
402
|
+
- Hash values must be MD5 format
|
|
403
|
+
- Missing thematic files → WARNING (empty file auto-created)
|
|
450
404
|
|
|
451
405
|
## Structural Schema Enforcement (MANDATORY)
|
|
452
406
|
|
|
453
|
-
> **Before EVERY write**, validate field names against the expected schema structure
|
|
407
|
+
> **Before EVERY write**, validate field names against the expected schema structure. REJECT writes containing FORBIDDEN fields. AUTO-MAP known mismatches when possible.
|
|
454
408
|
|
|
455
|
-
### Module-Level
|
|
409
|
+
### Module-Level Thematic Files
|
|
456
410
|
|
|
457
|
-
**analysis.entities
|
|
458
|
-
- attributes[]: REQUIRED `name`, `description`, `required` | OPTIONAL `unique`, `validation`
|
|
411
|
+
**analysis.entities** in entities.json — REQUIRED fields: `name`, `description`, `attributes[]`, `relationships[]`
|
|
412
|
+
- attributes[]: REQUIRED `name`, `description`, `required` | OPTIONAL `unique`, `validation`, `type`
|
|
459
413
|
- relationships[]: REQUIRED `target`, `type`, `description`
|
|
460
|
-
- FORBIDDEN: `
|
|
414
|
+
- FORBIDDEN: `values` (use `validation`), `rules` (use `validation`)
|
|
461
415
|
|
|
462
|
-
**analysis.businessRules
|
|
416
|
+
**analysis.businessRules** in rules.json — REQUIRED: `id`, `name`, `category`, `statement`, `priority`
|
|
463
417
|
- OPTIONAL: `conditions[]`, `examples[]`, `testability`
|
|
464
418
|
- category values: `validation`, `calculation`, `workflow`, `security`, `data` (lowercase only)
|
|
465
|
-
- FORBIDDEN: `rule` (use `name`+`statement`), `condition` singular (use `conditions[]`)
|
|
419
|
+
- FORBIDDEN: `rule` (use `name`+`statement`), `condition` singular (use `conditions[]`)
|
|
466
420
|
- AUTO-MAP: `rule` → split into `name` (short) + `statement` (IF/THEN)
|
|
467
421
|
|
|
468
|
-
**
|
|
469
|
-
|
|
470
|
-
**analysis.processFlow** — REQUIRED: `entryPoints[]`, `mainFlow[]`, `decisionPoints[]`
|
|
471
|
-
- FORBIDDEN: `lifecycle` (that goes in specification.lifeCycles), flat step arrays
|
|
472
|
-
|
|
473
|
-
**analysis.dataLifecycle** — REQUIRED: `retention`, `archival`, `deletion`, `gdprRelevant`
|
|
474
|
-
|
|
475
|
-
**specification.useCases[]** — REQUIRED: `id`, `name`, `primaryActor`, `permission`, `preconditions[]`, `postconditions[]`, `mainScenario[]`
|
|
422
|
+
**specification.useCases** in usecases.json — REQUIRED: `id`, `name`, `primaryActor`, `permission`, `preconditions[]`, `postconditions[]`, `mainScenario[]`
|
|
476
423
|
- OPTIONAL: `alternativeScenarios[]`, `errorScenarios[]`, `linkedRules[]`
|
|
477
424
|
- mainScenario[]: array of strings "1. Step description"
|
|
478
|
-
- FORBIDDEN: `actor` (use `primaryActor`), `linkedBRs` (use `linkedRules`), `
|
|
425
|
+
- FORBIDDEN: `actor` (use `primaryActor`), `linkedBRs` (use `linkedRules`), `scenario` (use `mainScenario`)
|
|
479
426
|
- AUTO-MAP: `actor` → `primaryActor`, `linkedBRs` → `linkedRules`
|
|
480
427
|
|
|
481
|
-
**specification.functionalRequirements
|
|
428
|
+
**specification.functionalRequirements** in usecases.json — REQUIRED: `id`, `statement`, `priority`, `linkedUseCases[]`
|
|
482
429
|
- OPTIONAL: `linkedRules[]`, `acceptanceCriteria[]`
|
|
483
430
|
- priority values: `must`, `should`, `could`
|
|
484
|
-
- FORBIDDEN: `name` (use `statement`), `
|
|
485
|
-
- AUTO-MAP: `name
|
|
431
|
+
- FORBIDDEN: `name` (use `statement`), `linkedUCs` (use `linkedUseCases`), `linkedBRs` (use `linkedRules`)
|
|
432
|
+
- AUTO-MAP: `name` → `statement`, `linkedUCs` → `linkedUseCases`, `linkedBRs` → `linkedRules`
|
|
486
433
|
|
|
487
|
-
**specification.permissionMatrix** — REQUIRED shape: `{permissions[], roleAssignments[]}`
|
|
434
|
+
**specification.permissionMatrix** in permissions.json — REQUIRED shape: `{permissions[], roleAssignments[]}`
|
|
488
435
|
- permissions[]: `{path, action, description}`
|
|
489
436
|
- roleAssignments[]: `{role, permissions[]}`
|
|
490
|
-
- FORBIDDEN: flat array
|
|
491
|
-
|
|
492
|
-
**specification.sections[]** — REQUIRED: `code`, `title`, `type`, `resources[]`, `wireframe`
|
|
493
|
-
- resources[]: REQUIRED `code`, `type`, `entity`, `permission` | OPTIONAL `columnDefs[]`, `rowActions[]`, `defaultSort`, `defaultPageSize`, `emptyState`, `fields[]`, `formLayout`
|
|
437
|
+
- FORBIDDEN: flat array format, top-level `roles` key
|
|
494
438
|
|
|
495
|
-
**specification.uiWireframes
|
|
439
|
+
**specification.uiWireframes** in screens.json — REQUIRED: `screen`, `section`, `mockup`, `componentMapping[]`, `layout`
|
|
496
440
|
- componentMapping[]: `{wireframeElement, reactComponent}`
|
|
497
441
|
- layout: `{type, regions[]}` where regions[]: `{id, position, span?, components[]}`
|
|
498
|
-
- FORBIDDEN: wireframes without `layout` object
|
|
499
|
-
|
|
500
|
-
**specification.lifeCycles[]** — REQUIRED: `entity`, `field`, `initialState`, `states[]`, `transitions[]`
|
|
501
|
-
- states[]: REQUIRED `{id, displayName, color, allowedTransitions[], isTerminal}`
|
|
502
|
-
- transitions[]: REQUIRED `{from, to, action, label, permission}` | OPTIONAL `guards[]`, `effects[]`, `confirm`
|
|
503
|
-
- FORBIDDEN: flat string arrays for states (e.g., `["Active", "Inactive"]`), `terminalStates` as separate array
|
|
504
|
-
|
|
505
|
-
**specification.seedDataCore** — REQUIRED 5 arrays: `navigationModules[]`, `navigationTranslations[]`, `permissions[]`, `rolePermissions[]`, `permissionConstants[]`
|
|
506
|
-
- navigationModules[]: `{code, label, icon, route, parentCode, sort}`
|
|
507
|
-
- navigationTranslations[]: `{moduleCode, language, label}` (4 languages: fr, en, nl, de)
|
|
508
|
-
- permissions[]: `{path, action, description}`
|
|
509
|
-
- rolePermissions[]: `{role, permissionPath}`
|
|
510
|
-
- permissionConstants[]: `{constantName, path}`
|
|
511
|
-
- FORBIDDEN: flat object, comma-separated strings, singular constants
|
|
512
442
|
|
|
513
|
-
**
|
|
514
|
-
- scenarios[]: `{name, tags[], given[], when[], then[]}`
|
|
515
|
-
- FORBIDDEN: flat array of scenario objects without wrapping `feature`
|
|
516
|
-
|
|
517
|
-
**specification.validations[]** — REQUIRED: `entity`, `field`, `rule`, `errorMessageKey`
|
|
518
|
-
- FORBIDDEN: missing `entity`, missing `errorMessageKey`
|
|
519
|
-
|
|
520
|
-
**specification.messages[]** — REQUIRED: `code`, `type`, `title`, `i18nKey`
|
|
521
|
-
- type values: `success`, `error`, `warning`, `info`
|
|
522
|
-
- FORBIDDEN: missing `title`, missing `i18nKey`
|
|
523
|
-
|
|
524
|
-
**specification.apiEndpoints[]** — REQUIRED: `method`, `path`, `description`, `permission`, `request`, `response`
|
|
525
|
-
|
|
526
|
-
**specification.navigation** — REQUIRED: `entries[]` where each: `{code, label, icon, route, parentCode, sort}`
|
|
527
|
-
|
|
528
|
-
**specification.i18nKeys[]** — REQUIRED: `key`, `fr`, `en`, `nl`, `de`
|
|
529
|
-
|
|
530
|
-
**validation** — REQUIRED: `completenessChecks[]`, `consistencyChecks[]`, `semanticChecks[]`, `decision`
|
|
531
|
-
- decision: `{approved, reason, checkedAt}`
|
|
532
|
-
- semanticChecks[]: `{check, module?, status, details, autoFixed}`
|
|
533
|
-
- status values: `PASS`, `WARNING`, `ERROR`
|
|
534
|
-
|
|
535
|
-
**handoff** — REQUIRED: `complexity`, `filesToCreate`, `brToCodeMapping[]`, `apiEndpointSummary[]`, `prdFile`, `totalFiles`, `totalTasks`, `handedOffAt`
|
|
443
|
+
**handoff** in handoff.json — REQUIRED: `complexity`, `filesToCreate`, `brToCodeMapping[]`, `apiEndpointSummary[]`, `prdFile`, `totalFiles`, `totalTasks`, `handedOffAt`
|
|
536
444
|
- filesToCreate: REQUIRED 7 categories: `domain[]`, `application[]`, `infrastructure[]`, `api[]`, `frontend[]`, `seedData[]`, `tests[]`
|
|
537
445
|
- brToCodeMapping[]: `{ruleId, files[], implementation}`
|
|
538
|
-
- apiEndpointSummary[]: `{method, path, permission, linkedUC}`
|
|
539
446
|
|
|
540
|
-
### Application-Level
|
|
447
|
+
### Application-Level Thematic Files
|
|
541
448
|
|
|
542
|
-
**cadrage
|
|
543
|
-
-
|
|
449
|
+
**cadrage** in cadrage.json — REQUIRED: `stakeholders[]`, `applicationRoles[]`, `risks[]`, `acceptanceCriteria[]`
|
|
450
|
+
- stakeholders[]: `{role, function, involvement, tasks[]}`
|
|
544
451
|
- involvement values: `approver`, `decision-maker`, `consulted`, `informed`, `end-user`
|
|
545
|
-
-
|
|
546
|
-
|
|
547
|
-
**cadrage.applicationRoles[]** — REQUIRED: `role`, `level`, `permissionPattern`
|
|
548
|
-
- OPTIONAL: `description`
|
|
452
|
+
- applicationRoles[]: `{role, level, permissionPattern}`
|
|
549
453
|
- level values: `admin`, `manager`, `contributor`, `viewer`
|
|
550
|
-
-
|
|
551
|
-
|
|
552
|
-
**cadrage.risks[]** — REQUIRED: `id`, `type`, `description`, `mitigation`
|
|
553
|
-
- OPTIONAL: `probability`, `impact`, `priority`
|
|
454
|
+
- risks[]: `{id, type, description, mitigation}`
|
|
554
455
|
- id pattern: `RISK-NNN`
|
|
555
456
|
- type values: `business`, `technical`, `organizational`
|
|
556
|
-
- FORBIDDEN: `risk` as field name (use `description`), `severity` (use `priority`)
|
|
557
|
-
|
|
558
|
-
**cadrage.acceptanceCriteria[]** — REQUIRED: `id`, `criterion`, `validated`
|
|
559
|
-
- id pattern: `AC-NNN`
|
|
560
|
-
|
|
561
|
-
**cadrage.coverageMatrix[]** — REQUIRED: `item`, `category`, `module`
|
|
562
|
-
- OPTIONAL: `ucRef`, `notes`
|
|
563
|
-
- category values: `mustHave`, `shouldHave`, `couldHave`, `outOfScope`, `implicit` (camelCase)
|
|
564
|
-
- FORBIDDEN: `id` (no ID field), `feature` (use `item`), `priority` (use `category`)
|
|
565
457
|
|
|
566
|
-
**
|
|
567
|
-
|
|
568
|
-
**modules[]** — REQUIRED: `code`, `description`, `featureType`, `dependencies[]`, `dependents[]`, `status`, `priority`, `sortOrder`, `entities[]`, `estimatedComplexity`
|
|
569
|
-
- OPTIONAL: `featureJsonPath`
|
|
458
|
+
**modules[]** in index.json — REQUIRED: `code`, `description`, `featureType`, `dependencies[]`, `dependents[]`, `status`, `priority`, `sortOrder`, `entities[]`, `estimatedComplexity`
|
|
459
|
+
- OPTIONAL: `indexJsonPath`
|
|
570
460
|
- FORBIDDEN: missing `dependencies`/`dependents`/`sortOrder`
|
|
571
461
|
|
|
572
|
-
**consolidation** — REQUIRED: `crossModuleInteractions[]`, `sharedEntities[]`, `permissionCoherence`, `e2eFlows[]`, `globalRiskAssessment[]`, `semanticChecks[]`, `decision`
|
|
573
|
-
- crossModuleInteractions[]: `{fromModule, toModule, interactionType, description, entities[]}`
|
|
574
|
-
- sharedEntities[]: `{entity, ownerModule, referencedBy[], sharedFields[]}`
|
|
575
|
-
- decision: `{approved, reason, approvedBy, approvedAt}`
|
|
576
|
-
- FORBIDDEN: nested `{fkReferences, sharedEntities, events}` in crossModuleInteractions, `clientApproval` string
|
|
577
|
-
|
|
578
|
-
### Enforcement Process
|
|
579
|
-
|
|
580
|
-
On EVERY `enrichSection()` call:
|
|
581
|
-
1. **BEFORE WRITE:** Scan incoming data keys against the schema above
|
|
582
|
-
2. **DETECT FORBIDDEN:** If any FORBIDDEN field found → attempt AUTO-MAP first
|
|
583
|
-
3. **AUTO-MAP:** Rename known mismatches (e.g., `actor` → `primaryActor`, `rule` → `name`+`statement`)
|
|
584
|
-
4. **REJECT:** If FORBIDDEN field found with no AUTO-MAP rule → BLOCK write, return error listing violations
|
|
585
|
-
5. **VALIDATE REQUIRED:** If REQUIRED fields missing → BLOCK write, return error listing missing fields
|
|
586
|
-
6. **LOG:** Record all auto-mappings and rejections in changelog[]
|
|
587
|
-
|
|
588
462
|
## Directory Structure
|
|
589
463
|
|
|
590
464
|
```
|
|
591
465
|
docs/business-analyse/
|
|
592
466
|
v1.0/
|
|
593
|
-
|
|
467
|
+
index.json ← PROJECT metadata
|
|
468
|
+
cadrage.json
|
|
469
|
+
entities.json
|
|
470
|
+
rules.json
|
|
471
|
+
usecases.json
|
|
472
|
+
permissions.json
|
|
473
|
+
screens.json
|
|
474
|
+
validation.json
|
|
475
|
+
consolidation.json
|
|
594
476
|
|
|
595
477
|
docs/{app}/business-analyse/
|
|
596
478
|
v1.0/
|
|
597
|
-
|
|
479
|
+
index.json ← APPLICATION metadata
|
|
480
|
+
cadrage.json
|
|
481
|
+
entities.json
|
|
482
|
+
rules.json
|
|
483
|
+
usecases.json
|
|
484
|
+
permissions.json
|
|
485
|
+
screens.json
|
|
486
|
+
validation.json
|
|
487
|
+
consolidation.json
|
|
488
|
+
v1.1/
|
|
489
|
+
index.json
|
|
490
|
+
cadrage.json
|
|
491
|
+
entities.json
|
|
492
|
+
...
|
|
598
493
|
|
|
599
494
|
docs/{app}/{module}/business-analyse/
|
|
600
495
|
v1.0/
|
|
601
|
-
|
|
496
|
+
index.json ← MODULE metadata
|
|
497
|
+
discovery.json
|
|
498
|
+
analysis.json
|
|
499
|
+
specification.json
|
|
500
|
+
validation.json
|
|
501
|
+
handoff.json
|
|
602
502
|
v1.1/
|
|
603
|
-
|
|
503
|
+
index.json
|
|
504
|
+
discovery.json
|
|
505
|
+
...
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
Versions are stored as separate directories. Each directory contains index.json + thematic files.
|
|
509
|
+
|
|
510
|
+
## Hash Manifest (index.json fileHashes)
|
|
511
|
+
|
|
512
|
+
**Purpose:** Track which thematic files have been modified, enabling incremental updates and consistency checks.
|
|
513
|
+
|
|
514
|
+
**Structure:**
|
|
515
|
+
```json
|
|
516
|
+
{
|
|
517
|
+
"fileHashes": {
|
|
518
|
+
"index.json": "abc123...",
|
|
519
|
+
"cadrage.json": "def456...",
|
|
520
|
+
"entities.json": "ghi789...",
|
|
521
|
+
"rules.json": "jkl012...",
|
|
522
|
+
...
|
|
523
|
+
}
|
|
524
|
+
}
|
|
604
525
|
```
|
|
605
526
|
|
|
606
|
-
|
|
527
|
+
**Rules:**
|
|
528
|
+
- Update hash after EVERY write to thematic file
|
|
529
|
+
- Hash is MD5 of file contents (not formatted JSON, just raw bytes)
|
|
530
|
+
- Missing hash = file was never written (OPTIONAL file, OK to skip)
|
|
531
|
+
- Mismatch detected = file was modified externally (log warning, optionally restore from hash)
|
|
607
532
|
|
|
608
533
|
## Config Management
|
|
609
534
|
|
|
@@ -628,22 +553,22 @@ Versions are stored as separate files in versioned directories. Always store fea
|
|
|
628
553
|
|
|
629
554
|
Before EVERY enrichSection() call for specification or handoff sections, validate referential integrity.
|
|
630
555
|
|
|
631
|
-
### After enrichSection("specification")
|
|
632
|
-
1. Build SET_BR from
|
|
556
|
+
### After enrichSection("specification" or "usecases")
|
|
557
|
+
1. Build SET_BR from rules.json businessRules[].id
|
|
633
558
|
2. For each useCases[].linkedRules[] → verify ∈ SET_BR
|
|
634
559
|
3. For each functionalRequirements[].linkedRules[] → verify ∈ SET_BR
|
|
635
|
-
4. Build SET_UC from useCases[].id
|
|
560
|
+
4. Build SET_UC from usecases[].useCases[].id
|
|
636
561
|
5. For each functionalRequirements[].linkedUseCases[] → verify ∈ SET_UC
|
|
637
|
-
6. Build SET_PERM from permissionMatrix.permissions[].path
|
|
562
|
+
6. Build SET_PERM from permissions.json permissionMatrix.permissions[].path
|
|
638
563
|
7. For each roleAssignments[].permissions[] → verify ∈ SET_PERM
|
|
639
|
-
8. Build SET_SCREEN from uiWireframes[].screen
|
|
564
|
+
8. Build SET_SCREEN from screens.json uiWireframes[].screen
|
|
640
565
|
9. For each sections[].wireframe → verify ∈ SET_SCREEN
|
|
641
566
|
|
|
642
567
|
### After enrichSection("handoff")
|
|
643
|
-
1. Build SET_FR from specification
|
|
644
|
-
2. Build SET_UC from specification
|
|
645
|
-
3. Build SET_SCREEN from specification
|
|
646
|
-
4. Build SET_BR from analysis
|
|
568
|
+
1. Build SET_FR from specification functionalRequirements[].id
|
|
569
|
+
2. Build SET_UC from specification useCases[].id
|
|
570
|
+
3. Build SET_SCREEN from specification uiWireframes[].screen
|
|
571
|
+
4. Build SET_BR from analysis businessRules[].id
|
|
647
572
|
5. For each filesToCreate.*[].linkedFRs[] → verify ∈ SET_FR
|
|
648
573
|
6. For each filesToCreate.*[].linkedUCs[] → verify ∈ SET_UC
|
|
649
574
|
7. For each filesToCreate.*[].linkedWireframes[] → verify ∈ SET_SCREEN
|
|
@@ -653,23 +578,23 @@ Before EVERY enrichSection() call for specification or handoff sections, validat
|
|
|
653
578
|
- LIST all violations (do not stop at first)
|
|
654
579
|
- AUTO-FIX: remove dangling refs, add missing items if source data exists
|
|
655
580
|
- LOG in changelog[] with warning
|
|
656
|
-
- NEVER write
|
|
581
|
+
- NEVER write without fixing references
|
|
657
582
|
|
|
658
583
|
## Execution Rules
|
|
659
584
|
|
|
660
585
|
1. **Always read before write** - merge with existing content when enriching
|
|
661
586
|
2. **Always validate before write** - run schema checks, return validation errors clearly
|
|
662
|
-
3. **
|
|
663
|
-
4. **Never deep-merge
|
|
664
|
-
5. **Preserve all other
|
|
587
|
+
3. **Thematic file replacement is atomic** - when enriching a thematic file, replace the entire content
|
|
588
|
+
4. **Never deep-merge at file level** - accept the file data as-is from the caller
|
|
589
|
+
5. **Preserve all other thematic files** - when writing one thematic file, all others remain unchanged
|
|
665
590
|
6. **Pretty-print JSON** - use 2-space indentation
|
|
666
591
|
7. **Timestamp management** - always set metadata.updatedAt to current ISO timestamp on write
|
|
667
592
|
8. **Idempotency** - calling the same operation twice with same data should produce same result
|
|
668
|
-
9. **
|
|
593
|
+
9. **Hash updates** - calculate and store MD5 hash for every thematic file write
|
|
669
594
|
|
|
670
595
|
## File Size Management (CRITICAL)
|
|
671
596
|
|
|
672
|
-
**Problem:** Large
|
|
597
|
+
**Problem:** Large thematic files (>100KB) can cause write failures and token exhaustion.
|
|
673
598
|
|
|
674
599
|
**Solution:** Progressive monitoring and incremental operations.
|
|
675
600
|
|
|
@@ -684,70 +609,24 @@ Before EVERY enrichSection() call for specification or handoff sections, validat
|
|
|
684
609
|
|
|
685
610
|
### Pre-Write File Size Check
|
|
686
611
|
|
|
687
|
-
Before EVERY write operation:
|
|
612
|
+
Before EVERY write operation to a thematic file:
|
|
688
613
|
|
|
689
|
-
```
|
|
690
|
-
const currentFileSize = getFileSize(
|
|
614
|
+
```
|
|
615
|
+
const currentFileSize = getFileSize(thematicPath);
|
|
691
616
|
const estimatedNewSize = currentFileSize + newDataSize;
|
|
692
617
|
|
|
693
618
|
if (estimatedNewSize > 100 * 1024) { // 100KB
|
|
694
|
-
WARNING(`
|
|
619
|
+
WARNING(`Thematic file will be ${formatBytes(estimatedNewSize)} after write`);
|
|
695
620
|
WARNING(`Recommend using enrichSectionIncremental for future operations`);
|
|
696
621
|
}
|
|
697
622
|
|
|
698
623
|
if (estimatedNewSize > 500 * 1024) { // 500KB
|
|
699
|
-
BLOCKING_ERROR(`
|
|
624
|
+
BLOCKING_ERROR(`Thematic file would exceed 500KB (${formatBytes(estimatedNewSize)})`);
|
|
700
625
|
BLOCKING_ERROR(`Use enrichSectionIncremental instead of enrichSection`);
|
|
701
626
|
STOP;
|
|
702
627
|
}
|
|
703
628
|
```
|
|
704
629
|
|
|
705
|
-
### Operation Selection Guide
|
|
706
|
-
|
|
707
|
-
| Scenario | Recommended Operation | Reason |
|
|
708
|
-
|----------|----------------------|--------|
|
|
709
|
-
| First-time section write | `enrichSection` | No existing data, full write needed |
|
|
710
|
-
| Module loop (3+ iterations) | `enrichSectionIncremental` | Avoids rewriting same data multiple times |
|
|
711
|
-
| Large sections (>20KB) | `enrichSectionIncremental` | Reduces token usage by 50-70% |
|
|
712
|
-
| File size > 100KB | `enrichSectionIncremental` (REQUIRED) | Prevents file size bloat |
|
|
713
|
-
| Single field update | `enrichSectionIncremental` with `update` | Most efficient for targeted changes |
|
|
714
|
-
|
|
715
|
-
### Monitoring & Reporting
|
|
716
|
-
|
|
717
|
-
After EVERY write, report file size status:
|
|
718
|
-
|
|
719
|
-
```
|
|
720
|
-
✓ feature.json written successfully
|
|
721
|
-
Path: docs/business/HumanResources/Projects/business-analyse/v1.0/feature.json
|
|
722
|
-
Size: 87.3 KB (↑ 12.1 KB from previous)
|
|
723
|
-
Status: ⚠ Approaching 100KB threshold
|
|
724
|
-
Recommendation: Use enrichSectionIncremental for remaining modules
|
|
725
|
-
```
|
|
726
|
-
|
|
727
|
-
### Splitting Large Files (Advanced)
|
|
728
|
-
|
|
729
|
-
If a module feature.json exceeds 500KB despite incremental operations:
|
|
730
|
-
|
|
731
|
-
1. **Split specification section** into separate files:
|
|
732
|
-
- `specification-entities.json` (entities, relationships)
|
|
733
|
-
- `specification-rules.json` (business rules, validations)
|
|
734
|
-
- `specification-ui.json` (wireframes, sections, navigation)
|
|
735
|
-
|
|
736
|
-
2. **Update feature.json** with file references:
|
|
737
|
-
```json
|
|
738
|
-
{
|
|
739
|
-
"specification": {
|
|
740
|
-
"$ref": "./specification-entities.json",
|
|
741
|
-
"$ref2": "./specification-rules.json",
|
|
742
|
-
"$ref3": "./specification-ui.json"
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
```
|
|
746
|
-
|
|
747
|
-
3. **ba-reader** auto-resolves references when reading
|
|
748
|
-
|
|
749
|
-
**Note:** File splitting is a LAST RESORT. Prefer enrichSectionIncremental first.
|
|
750
|
-
|
|
751
630
|
## Error Handling
|
|
752
631
|
|
|
753
632
|
- Return clear validation errors with line numbers
|
|
@@ -758,25 +637,25 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
758
637
|
|
|
759
638
|
## $schema Reference Rules (MANDATORY)
|
|
760
639
|
|
|
761
|
-
> **Every
|
|
640
|
+
> **Every index.json MUST include a `$schema` field** pointing to the deployed schema file via relative path.
|
|
762
641
|
> Schemas are deployed by step-00-init to: `docs/{app}/business-analyse/schemas/`
|
|
763
642
|
|
|
764
643
|
**$schema paths by scope:**
|
|
765
644
|
|
|
766
|
-
| Scope |
|
|
645
|
+
| Scope | index.json location | $schema value |
|
|
767
646
|
|-------|----------------------|---------------|
|
|
768
|
-
| project | `docs/business-analyse/v1.0/
|
|
769
|
-
| application | `docs/{app}/business-analyse/v1.0/
|
|
770
|
-
| module | `docs/{app}/{module}/business-analyse/v1.0/
|
|
647
|
+
| project | `docs/business-analyse/v1.0/index.json` | `"../schemas/project-schema.json"` |
|
|
648
|
+
| application | `docs/{app}/business-analyse/v1.0/index.json` | `"../schemas/application-schema.json"` |
|
|
649
|
+
| module | `docs/{app}/{module}/business-analyse/v1.0/index.json` | `"../../../business-analyse/schemas/feature-schema.json"` |
|
|
771
650
|
|
|
772
651
|
**Rules:**
|
|
773
|
-
- `$schema` is ALWAYS the FIRST field in
|
|
774
|
-
- Path is RELATIVE from the
|
|
652
|
+
- `$schema` is ALWAYS the FIRST field in index.json (before `id`)
|
|
653
|
+
- Path is RELATIVE from the index.json file to the schemas directory
|
|
775
654
|
- For application scope: go up 1 level (v1.0/) → into schemas/
|
|
776
655
|
- For module scope: go up 3 levels (v1.0/ → business-analyse/ → {module}/) → into business-analyse/schemas/
|
|
777
656
|
- If schemas directory not found → WARNING (schemas may not have been deployed by step-00)
|
|
778
657
|
|
|
779
|
-
## Example
|
|
658
|
+
## Example index.json Structure
|
|
780
659
|
|
|
781
660
|
**Module-level:**
|
|
782
661
|
```json
|
|
@@ -785,6 +664,7 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
785
664
|
"id": "FEAT-001",
|
|
786
665
|
"version": "1.0",
|
|
787
666
|
"status": "draft",
|
|
667
|
+
"scope": "module",
|
|
788
668
|
"metadata": {
|
|
789
669
|
"app": "crm",
|
|
790
670
|
"module": "contacts",
|
|
@@ -805,12 +685,13 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
805
685
|
"handed-off": null
|
|
806
686
|
}
|
|
807
687
|
},
|
|
808
|
-
"
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
688
|
+
"fileHashes": {
|
|
689
|
+
"discovery.json": "abc123...",
|
|
690
|
+
"analysis.json": "def456...",
|
|
691
|
+
"specification.json": "ghi789...",
|
|
692
|
+
"validation.json": "jkl012...",
|
|
693
|
+
"handoff.json": "mno345..."
|
|
694
|
+
}
|
|
814
695
|
}
|
|
815
696
|
```
|
|
816
697
|
|
|
@@ -822,13 +703,35 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
822
703
|
"version": "1.0",
|
|
823
704
|
"status": "draft",
|
|
824
705
|
"scope": "application",
|
|
825
|
-
"metadata": {
|
|
826
|
-
|
|
706
|
+
"metadata": {
|
|
707
|
+
"app": "CRM",
|
|
708
|
+
"language": "en",
|
|
709
|
+
"featureDescription": "CRM application master",
|
|
710
|
+
"createdAt": "2024-01-15T10:30:00Z",
|
|
711
|
+
"updatedAt": "2024-01-15T10:30:00Z",
|
|
712
|
+
"createdBy": "ba-writer",
|
|
713
|
+
"updatedBy": "ba-writer",
|
|
714
|
+
"workflow": {
|
|
715
|
+
"mode": "application",
|
|
716
|
+
"moduleOrder": ["Contacts", "Accounts"],
|
|
717
|
+
"currentModuleIndex": 0,
|
|
718
|
+
"completedModules": [],
|
|
719
|
+
"currentModule": "Contacts"
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
"fileHashes": {
|
|
723
|
+
"index.json": "pqr678...",
|
|
724
|
+
"cadrage.json": "stu901...",
|
|
725
|
+
"entities.json": "vwx234...",
|
|
726
|
+
"rules.json": "yza567...",
|
|
727
|
+
"usecases.json": "bcd890...",
|
|
728
|
+
"permissions.json": "efg123...",
|
|
729
|
+
"screens.json": "hij456...",
|
|
730
|
+
"validation.json": "klm789...",
|
|
731
|
+
"consolidation.json": "nop012..."
|
|
732
|
+
},
|
|
827
733
|
"modules": [],
|
|
828
|
-
"dependencyGraph": {}
|
|
829
|
-
"consolidation": {},
|
|
830
|
-
"suggestions": [],
|
|
831
|
-
"changelog": []
|
|
734
|
+
"dependencyGraph": {}
|
|
832
735
|
}
|
|
833
736
|
```
|
|
834
737
|
|
|
@@ -843,6 +746,10 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
843
746
|
"metadata": {
|
|
844
747
|
"projectName": "Enterprise HR Platform",
|
|
845
748
|
"language": "fr",
|
|
749
|
+
"createdAt": "2024-01-15T10:30:00Z",
|
|
750
|
+
"updatedAt": "2024-01-15T10:30:00Z",
|
|
751
|
+
"createdBy": "ba-writer",
|
|
752
|
+
"updatedBy": "ba-writer",
|
|
846
753
|
"workflow": {
|
|
847
754
|
"mode": "project",
|
|
848
755
|
"applicationOrder": ["HumanResources", "EmployeeSelfService"],
|
|
@@ -851,11 +758,12 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
851
758
|
"currentApplication": "HumanResources"
|
|
852
759
|
}
|
|
853
760
|
},
|
|
854
|
-
"
|
|
761
|
+
"fileHashes": {
|
|
762
|
+
"index.json": "qrs345...",
|
|
763
|
+
"cadrage.json": "tuv678...",
|
|
764
|
+
"consolidation.json": "wxy901..."
|
|
765
|
+
},
|
|
855
766
|
"applications": [],
|
|
856
|
-
"applicationDependencyGraph": {}
|
|
857
|
-
"consolidation": {},
|
|
858
|
-
"suggestions": [],
|
|
859
|
-
"changelog": []
|
|
767
|
+
"applicationDependencyGraph": {}
|
|
860
768
|
}
|
|
861
769
|
```
|