@atlashub/smartstack-cli 4.18.0 → 4.20.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 +318 -415
- 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 +706 -85
- 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 +32 -6
- 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/07-render-handoff.js +1 -1
- 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/html/src/template.html +1 -1
- package/templates/skills/business-analyse/patterns/suggestion-catalog.md +7 -5
- package/templates/skills/business-analyse/questionnaire/01-context.md +11 -157
- package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +101 -0
- package/templates/skills/business-analyse/questionnaire/03-data-ui.md +92 -0
- package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +6 -0
- package/templates/skills/business-analyse/questionnaire/05-cross-module.md +69 -0
- package/templates/skills/business-analyse/questionnaire.md +22 -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 +21 -21
- 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 +5 -5
- package/templates/skills/business-analyse/references/deploy-data-build.md +12 -11
- 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 -36
- 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 +3 -3
- 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 -4
- package/templates/skills/business-analyse/steps/step-00-init.md +68 -77
- package/templates/skills/business-analyse/steps/step-01-cadrage.md +50 -216
- 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 -263
- 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/documentation/SKILL.md +7 -0
- package/templates/skills/ralph-loop/SKILL.md +2 -1
- package/templates/skills/ralph-loop/references/init-resume-recovery.md +1 -1
- package/templates/skills/ralph-loop/steps/step-01-task.md +2 -2
- 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/_rules.md +0 -142
- 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 -58
- 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 -366
- 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 -1093
- 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 -486
- package/templates/skills/business-analyse/steps/step-03a2-analysis.md +0 -300
- package/templates/skills/business-analyse/steps/step-03b-ui.md +0 -405
- package/templates/skills/business-analyse/steps/step-03c-compile.md +0 -516
- package/templates/skills/business-analyse/steps/step-03d-validate.md +0 -691
- 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 -937
- 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
|
|
|
@@ -439,176 +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
|
|
411
|
+
**analysis.entities** in entities.json — REQUIRED fields: `name`, `description`, `attributes[]`, `relationships[]`
|
|
458
412
|
- attributes[]: REQUIRED `name`, `description`, `required` | OPTIONAL `unique`, `validation`, `type`
|
|
459
413
|
- relationships[]: REQUIRED `target`, `type`, `description`
|
|
460
414
|
- FORBIDDEN: `values` (use `validation`), `rules` (use `validation`)
|
|
461
|
-
- **Two-phase `type` field:** `type` is FORBIDDEN in raw analysis input (step-03a2, before compilation). After step-03c compilation, `type` is MANDATORY (auto-inferred C# type: `string`, `int`, `decimal`, `bool`, `DateTime`, `Guid`, `enum:{Name}`, etc.). The writer ACCEPTS `type` when the value is a recognized C# type — it is only auto-removed from pre-compilation writes.
|
|
462
415
|
|
|
463
|
-
**analysis.businessRules
|
|
416
|
+
**analysis.businessRules** in rules.json — REQUIRED: `id`, `name`, `category`, `statement`, `priority`
|
|
464
417
|
- OPTIONAL: `conditions[]`, `examples[]`, `testability`
|
|
465
418
|
- category values: `validation`, `calculation`, `workflow`, `security`, `data` (lowercase only)
|
|
466
|
-
- FORBIDDEN: `rule` (use `name`+`statement`), `condition` singular (use `conditions[]`)
|
|
419
|
+
- FORBIDDEN: `rule` (use `name`+`statement`), `condition` singular (use `conditions[]`)
|
|
467
420
|
- AUTO-MAP: `rule` → split into `name` (short) + `statement` (IF/THEN)
|
|
468
421
|
|
|
469
|
-
**
|
|
470
|
-
|
|
471
|
-
**analysis.processFlow** — REQUIRED: `entryPoints[]`, `mainFlow[]`, `decisionPoints[]`
|
|
472
|
-
- FORBIDDEN: `lifecycle` (that goes in specification.lifeCycles), flat step arrays
|
|
473
|
-
|
|
474
|
-
**analysis.dataLifecycle** — REQUIRED: `retention`, `archival`, `deletion`, `gdprRelevant`
|
|
475
|
-
|
|
476
|
-
**specification.useCases[]** — REQUIRED: `id`, `name`, `primaryActor`, `permission`, `preconditions[]`, `postconditions[]`, `mainScenario[]`
|
|
422
|
+
**specification.useCases** in usecases.json — REQUIRED: `id`, `name`, `primaryActor`, `permission`, `preconditions[]`, `postconditions[]`, `mainScenario[]`
|
|
477
423
|
- OPTIONAL: `alternativeScenarios[]`, `errorScenarios[]`, `linkedRules[]`
|
|
478
424
|
- mainScenario[]: array of strings "1. Step description"
|
|
479
|
-
- FORBIDDEN: `actor` (use `primaryActor`), `linkedBRs` (use `linkedRules`), `
|
|
425
|
+
- FORBIDDEN: `actor` (use `primaryActor`), `linkedBRs` (use `linkedRules`), `scenario` (use `mainScenario`)
|
|
480
426
|
- AUTO-MAP: `actor` → `primaryActor`, `linkedBRs` → `linkedRules`
|
|
481
427
|
|
|
482
|
-
**specification.functionalRequirements
|
|
428
|
+
**specification.functionalRequirements** in usecases.json — REQUIRED: `id`, `statement`, `priority`, `linkedUseCases[]`
|
|
483
429
|
- OPTIONAL: `linkedRules[]`, `acceptanceCriteria[]`
|
|
484
430
|
- priority values: `must`, `should`, `could`
|
|
485
|
-
- FORBIDDEN: `name` (use `statement`), `
|
|
486
|
-
- AUTO-MAP: `name
|
|
431
|
+
- FORBIDDEN: `name` (use `statement`), `linkedUCs` (use `linkedUseCases`), `linkedBRs` (use `linkedRules`)
|
|
432
|
+
- AUTO-MAP: `name` → `statement`, `linkedUCs` → `linkedUseCases`, `linkedBRs` → `linkedRules`
|
|
487
433
|
|
|
488
|
-
**specification.permissionMatrix** — REQUIRED shape: `{permissions[], roleAssignments[]}`
|
|
434
|
+
**specification.permissionMatrix** in permissions.json — REQUIRED shape: `{permissions[], roleAssignments[]}`
|
|
489
435
|
- permissions[]: `{path, action, description}`
|
|
490
436
|
- roleAssignments[]: `{role, permissions[]}`
|
|
491
|
-
- FORBIDDEN: flat array
|
|
492
|
-
|
|
493
|
-
**specification.sections[]** — REQUIRED: `code`, `title`, `type`, `resources[]`, `wireframe`
|
|
494
|
-
- resources[]: REQUIRED `code`, `type`, `entity`, `permission` | OPTIONAL `columnDefs[]`, `rowActions[]`, `defaultSort`, `defaultPageSize`, `emptyState`, `fields[]`, `formLayout`
|
|
437
|
+
- FORBIDDEN: flat array format, top-level `roles` key
|
|
495
438
|
|
|
496
|
-
**specification.uiWireframes
|
|
439
|
+
**specification.uiWireframes** in screens.json — REQUIRED: `screen`, `section`, `mockup`, `componentMapping[]`, `layout`
|
|
497
440
|
- componentMapping[]: `{wireframeElement, reactComponent}`
|
|
498
441
|
- layout: `{type, regions[]}` where regions[]: `{id, position, span?, components[]}`
|
|
499
|
-
- FORBIDDEN: wireframes without `layout` object
|
|
500
|
-
|
|
501
|
-
**specification.lifeCycles[]** — REQUIRED: `entity`, `field`, `initialState`, `states[]`, `transitions[]`
|
|
502
|
-
- states[]: REQUIRED `{id, displayName, color, allowedTransitions[], isTerminal}`
|
|
503
|
-
- transitions[]: REQUIRED `{from, to, action, label, permission}` | OPTIONAL `guards[]`, `effects[]`, `confirm`
|
|
504
|
-
- FORBIDDEN: flat string arrays for states (e.g., `["Active", "Inactive"]`), `terminalStates` as separate array
|
|
505
|
-
|
|
506
|
-
**specification.seedDataCore** — REQUIRED 9 arrays: `navigationApplications[]`, `applicationRoles[]`, `navigationModules[]`, `navigationSections[]`, `navigationResources[]`, `navigationTranslations[]`, `permissions[]`, `rolePermissions[]`, `permissionConstants[]`
|
|
507
|
-
- navigationApplications[]: `{code, label, icon, route, sort}`
|
|
508
|
-
- applicationRoles[]: `{code, name, permissions}`
|
|
509
|
-
- navigationModules[]: `{code, label, icon, route, parentCode, sort}`
|
|
510
|
-
- navigationSections[]: `{code, label, icon, route, parentCode, permission, sort}`
|
|
511
|
-
- navigationResources[]: `{code, type, entity, parentCode, permission}`
|
|
512
|
-
- navigationTranslations[]: `{moduleCode, language, label}` (4 languages: fr, en, it, de)
|
|
513
|
-
- permissions[]: `{path, action, description}`
|
|
514
|
-
- rolePermissions[]: `{role, permissionPath}`
|
|
515
|
-
- permissionConstants[]: `{constantName, path}`
|
|
516
|
-
- FORBIDDEN: flat object, comma-separated strings, singular constants
|
|
517
|
-
|
|
518
|
-
**specification.gherkinScenarios** — REQUIRED shape: `[{feature, scenarios[]}]` (array)
|
|
519
|
-
- scenarios[]: `{name, tags[], given[], when[], then[]}`
|
|
520
|
-
- FORBIDDEN: flat array of scenario objects without wrapping `feature`
|
|
521
|
-
|
|
522
|
-
**specification.validations[]** — REQUIRED: `entity`, `field`, `rule`, `errorMessageKey`
|
|
523
|
-
- FORBIDDEN: missing `entity`, missing `errorMessageKey`
|
|
524
442
|
|
|
525
|
-
**
|
|
526
|
-
- type values: `success`, `error`, `warning`, `info`
|
|
527
|
-
- FORBIDDEN: missing `title`, missing `i18nKey`
|
|
528
|
-
|
|
529
|
-
**specification.apiEndpoints[]** — REQUIRED: `method`, `path`, `description`, `permission`, `request`, `response`
|
|
530
|
-
|
|
531
|
-
**specification.navigation** — REQUIRED: `entries[]` where each: `{code, label, icon, route, parentCode, sort}`
|
|
532
|
-
|
|
533
|
-
**specification.i18nKeys[]** — REQUIRED: `key`, `fr`, `en`, `it`, `de`
|
|
534
|
-
|
|
535
|
-
**validation** — REQUIRED: `completenessChecks[]`, `consistencyChecks[]`, `semanticChecks[]`, `decision`
|
|
536
|
-
- decision: `{approved, reason, checkedAt}`
|
|
537
|
-
- semanticChecks[]: `{check, module?, status, details, autoFixed}`
|
|
538
|
-
- status values: `PASS`, `WARNING`, `ERROR`
|
|
539
|
-
|
|
540
|
-
**handoff** — REQUIRED: `complexity`, `filesToCreate`, `brToCodeMapping[]`, `apiEndpointSummary[]`, `prdFile`, `totalFiles`, `totalTasks`, `handedOffAt`
|
|
443
|
+
**handoff** in handoff.json — REQUIRED: `complexity`, `filesToCreate`, `brToCodeMapping[]`, `apiEndpointSummary[]`, `prdFile`, `totalFiles`, `totalTasks`, `handedOffAt`
|
|
541
444
|
- filesToCreate: REQUIRED 7 categories: `domain[]`, `application[]`, `infrastructure[]`, `api[]`, `frontend[]`, `seedData[]`, `tests[]`
|
|
542
445
|
- brToCodeMapping[]: `{ruleId, files[], implementation}`
|
|
543
|
-
- apiEndpointSummary[]: `{method, path, permission, linkedUC}`
|
|
544
446
|
|
|
545
|
-
### Application-Level
|
|
447
|
+
### Application-Level Thematic Files
|
|
546
448
|
|
|
547
|
-
**cadrage
|
|
548
|
-
-
|
|
449
|
+
**cadrage** in cadrage.json — REQUIRED: `stakeholders[]`, `applicationRoles[]`, `risks[]`, `acceptanceCriteria[]`
|
|
450
|
+
- stakeholders[]: `{role, function, involvement, tasks[]}`
|
|
549
451
|
- involvement values: `approver`, `decision-maker`, `consulted`, `informed`, `end-user`
|
|
550
|
-
-
|
|
551
|
-
|
|
552
|
-
**cadrage.applicationRoles[]** — REQUIRED: `role`, `level`, `permissionPattern`
|
|
553
|
-
- OPTIONAL: `description`
|
|
452
|
+
- applicationRoles[]: `{role, level, permissionPattern}`
|
|
554
453
|
- level values: `admin`, `manager`, `contributor`, `viewer`
|
|
555
|
-
-
|
|
556
|
-
|
|
557
|
-
**cadrage.risks[]** — REQUIRED: `id`, `type`, `description`, `mitigation`
|
|
558
|
-
- OPTIONAL: `probability`, `impact`, `priority`
|
|
454
|
+
- risks[]: `{id, type, description, mitigation}`
|
|
559
455
|
- id pattern: `RISK-NNN`
|
|
560
456
|
- type values: `business`, `technical`, `organizational`
|
|
561
|
-
- FORBIDDEN: `risk` as field name (use `description`), `severity` (use `priority`)
|
|
562
|
-
|
|
563
|
-
**cadrage.acceptanceCriteria[]** — REQUIRED: `id`, `criterion`, `validated`
|
|
564
|
-
- id pattern: `AC-NNN`
|
|
565
|
-
|
|
566
|
-
**cadrage.coverageMatrix[]** — REQUIRED: `item`, `category`, `module`
|
|
567
|
-
- OPTIONAL: `ucRef`, `notes`
|
|
568
|
-
- category values: `mustHave`, `shouldHave`, `couldHave`, `outOfScope`, `implicit` (camelCase)
|
|
569
|
-
- FORBIDDEN: `id` (no ID field), `feature` (use `item`), `priority` (use `category`)
|
|
570
|
-
|
|
571
|
-
**cadrage.codebaseContext** — MUST be a string, NOT an object
|
|
572
457
|
|
|
573
|
-
**modules[]** — REQUIRED: `code`, `description`, `featureType`, `dependencies[]`, `dependents[]`, `status`, `priority`, `sortOrder`, `entities[]`, `estimatedComplexity`
|
|
574
|
-
- OPTIONAL: `
|
|
458
|
+
**modules[]** in index.json — REQUIRED: `code`, `description`, `featureType`, `dependencies[]`, `dependents[]`, `status`, `priority`, `sortOrder`, `entities[]`, `estimatedComplexity`
|
|
459
|
+
- OPTIONAL: `indexJsonPath`
|
|
575
460
|
- FORBIDDEN: missing `dependencies`/`dependents`/`sortOrder`
|
|
576
461
|
|
|
577
|
-
**consolidation** — REQUIRED: `crossModuleInteractions[]`, `sharedEntities[]`, `permissionCoherence`, `e2eFlows[]`, `globalRiskAssessment[]`, `semanticChecks[]`, `decision`
|
|
578
|
-
- crossModuleInteractions[]: `{fromModule, toModule, interactionType, description, entities[]}`
|
|
579
|
-
- sharedEntities[]: `{entity, ownerModule, referencedBy[], sharedFields[]}`
|
|
580
|
-
- decision: `{approved, reason, approvedBy, approvedAt}`
|
|
581
|
-
- FORBIDDEN: nested `{fkReferences, sharedEntities, events}` in crossModuleInteractions, `clientApproval` string
|
|
582
|
-
|
|
583
|
-
### Enforcement Process
|
|
584
|
-
|
|
585
|
-
On EVERY `enrichSection()` call:
|
|
586
|
-
1. **BEFORE WRITE:** Scan incoming data keys against the schema above
|
|
587
|
-
2. **DETECT FORBIDDEN:** If any FORBIDDEN field found → attempt AUTO-MAP first
|
|
588
|
-
3. **AUTO-MAP:** Rename known mismatches (e.g., `actor` → `primaryActor`, `rule` → `name`+`statement`)
|
|
589
|
-
4. **REJECT:** If FORBIDDEN field found with no AUTO-MAP rule → BLOCK write, return error listing violations
|
|
590
|
-
5. **VALIDATE REQUIRED:** If REQUIRED fields missing → BLOCK write, return error listing missing fields
|
|
591
|
-
6. **LOG:** Record all auto-mappings and rejections in changelog[]
|
|
592
|
-
|
|
593
462
|
## Directory Structure
|
|
594
463
|
|
|
595
464
|
```
|
|
596
465
|
docs/business-analyse/
|
|
597
466
|
v1.0/
|
|
598
|
-
|
|
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
|
|
599
476
|
|
|
600
477
|
docs/{app}/business-analyse/
|
|
601
478
|
v1.0/
|
|
602
|
-
|
|
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
|
+
...
|
|
603
493
|
|
|
604
494
|
docs/{app}/{module}/business-analyse/
|
|
605
495
|
v1.0/
|
|
606
|
-
|
|
496
|
+
index.json ← MODULE metadata
|
|
497
|
+
discovery.json
|
|
498
|
+
analysis.json
|
|
499
|
+
specification.json
|
|
500
|
+
validation.json
|
|
501
|
+
handoff.json
|
|
607
502
|
v1.1/
|
|
608
|
-
|
|
503
|
+
index.json
|
|
504
|
+
discovery.json
|
|
505
|
+
...
|
|
609
506
|
```
|
|
610
507
|
|
|
611
|
-
Versions are stored as separate
|
|
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
|
+
}
|
|
525
|
+
```
|
|
526
|
+
|
|
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)
|
|
612
532
|
|
|
613
533
|
## Config Management
|
|
614
534
|
|
|
@@ -633,22 +553,22 @@ Versions are stored as separate files in versioned directories. Always store fea
|
|
|
633
553
|
|
|
634
554
|
Before EVERY enrichSection() call for specification or handoff sections, validate referential integrity.
|
|
635
555
|
|
|
636
|
-
### After enrichSection("specification")
|
|
637
|
-
1. Build SET_BR from
|
|
556
|
+
### After enrichSection("specification" or "usecases")
|
|
557
|
+
1. Build SET_BR from rules.json businessRules[].id
|
|
638
558
|
2. For each useCases[].linkedRules[] → verify ∈ SET_BR
|
|
639
559
|
3. For each functionalRequirements[].linkedRules[] → verify ∈ SET_BR
|
|
640
|
-
4. Build SET_UC from useCases[].id
|
|
560
|
+
4. Build SET_UC from usecases[].useCases[].id
|
|
641
561
|
5. For each functionalRequirements[].linkedUseCases[] → verify ∈ SET_UC
|
|
642
|
-
6. Build SET_PERM from permissionMatrix.permissions[].path
|
|
562
|
+
6. Build SET_PERM from permissions.json permissionMatrix.permissions[].path
|
|
643
563
|
7. For each roleAssignments[].permissions[] → verify ∈ SET_PERM
|
|
644
|
-
8. Build SET_SCREEN from uiWireframes[].screen
|
|
564
|
+
8. Build SET_SCREEN from screens.json uiWireframes[].screen
|
|
645
565
|
9. For each sections[].wireframe → verify ∈ SET_SCREEN
|
|
646
566
|
|
|
647
567
|
### After enrichSection("handoff")
|
|
648
|
-
1. Build SET_FR from specification
|
|
649
|
-
2. Build SET_UC from specification
|
|
650
|
-
3. Build SET_SCREEN from specification
|
|
651
|
-
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
|
|
652
572
|
5. For each filesToCreate.*[].linkedFRs[] → verify ∈ SET_FR
|
|
653
573
|
6. For each filesToCreate.*[].linkedUCs[] → verify ∈ SET_UC
|
|
654
574
|
7. For each filesToCreate.*[].linkedWireframes[] → verify ∈ SET_SCREEN
|
|
@@ -658,23 +578,23 @@ Before EVERY enrichSection() call for specification or handoff sections, validat
|
|
|
658
578
|
- LIST all violations (do not stop at first)
|
|
659
579
|
- AUTO-FIX: remove dangling refs, add missing items if source data exists
|
|
660
580
|
- LOG in changelog[] with warning
|
|
661
|
-
- NEVER write
|
|
581
|
+
- NEVER write without fixing references
|
|
662
582
|
|
|
663
583
|
## Execution Rules
|
|
664
584
|
|
|
665
585
|
1. **Always read before write** - merge with existing content when enriching
|
|
666
586
|
2. **Always validate before write** - run schema checks, return validation errors clearly
|
|
667
|
-
3. **
|
|
668
|
-
4. **Never deep-merge
|
|
669
|
-
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
|
|
670
590
|
6. **Pretty-print JSON** - use 2-space indentation
|
|
671
591
|
7. **Timestamp management** - always set metadata.updatedAt to current ISO timestamp on write
|
|
672
592
|
8. **Idempotency** - calling the same operation twice with same data should produce same result
|
|
673
|
-
9. **
|
|
593
|
+
9. **Hash updates** - calculate and store MD5 hash for every thematic file write
|
|
674
594
|
|
|
675
595
|
## File Size Management (CRITICAL)
|
|
676
596
|
|
|
677
|
-
**Problem:** Large
|
|
597
|
+
**Problem:** Large thematic files (>100KB) can cause write failures and token exhaustion.
|
|
678
598
|
|
|
679
599
|
**Solution:** Progressive monitoring and incremental operations.
|
|
680
600
|
|
|
@@ -689,70 +609,24 @@ Before EVERY enrichSection() call for specification or handoff sections, validat
|
|
|
689
609
|
|
|
690
610
|
### Pre-Write File Size Check
|
|
691
611
|
|
|
692
|
-
Before EVERY write operation:
|
|
612
|
+
Before EVERY write operation to a thematic file:
|
|
693
613
|
|
|
694
|
-
```
|
|
695
|
-
const currentFileSize = getFileSize(
|
|
614
|
+
```
|
|
615
|
+
const currentFileSize = getFileSize(thematicPath);
|
|
696
616
|
const estimatedNewSize = currentFileSize + newDataSize;
|
|
697
617
|
|
|
698
618
|
if (estimatedNewSize > 100 * 1024) { // 100KB
|
|
699
|
-
WARNING(`
|
|
619
|
+
WARNING(`Thematic file will be ${formatBytes(estimatedNewSize)} after write`);
|
|
700
620
|
WARNING(`Recommend using enrichSectionIncremental for future operations`);
|
|
701
621
|
}
|
|
702
622
|
|
|
703
623
|
if (estimatedNewSize > 500 * 1024) { // 500KB
|
|
704
|
-
BLOCKING_ERROR(`
|
|
624
|
+
BLOCKING_ERROR(`Thematic file would exceed 500KB (${formatBytes(estimatedNewSize)})`);
|
|
705
625
|
BLOCKING_ERROR(`Use enrichSectionIncremental instead of enrichSection`);
|
|
706
626
|
STOP;
|
|
707
627
|
}
|
|
708
628
|
```
|
|
709
629
|
|
|
710
|
-
### Operation Selection Guide
|
|
711
|
-
|
|
712
|
-
| Scenario | Recommended Operation | Reason |
|
|
713
|
-
|----------|----------------------|--------|
|
|
714
|
-
| First-time section write | `enrichSection` | No existing data, full write needed |
|
|
715
|
-
| Module loop (3+ iterations) | `enrichSectionIncremental` | Avoids rewriting same data multiple times |
|
|
716
|
-
| Large sections (>20KB) | `enrichSectionIncremental` | Reduces token usage by 50-70% |
|
|
717
|
-
| File size > 100KB | `enrichSectionIncremental` (REQUIRED) | Prevents file size bloat |
|
|
718
|
-
| Single field update | `enrichSectionIncremental` with `update` | Most efficient for targeted changes |
|
|
719
|
-
|
|
720
|
-
### Monitoring & Reporting
|
|
721
|
-
|
|
722
|
-
After EVERY write, report file size status:
|
|
723
|
-
|
|
724
|
-
```
|
|
725
|
-
✓ feature.json written successfully
|
|
726
|
-
Path: docs/HumanResources/Projects/business-analyse/v1.0/feature.json
|
|
727
|
-
Size: 87.3 KB (↑ 12.1 KB from previous)
|
|
728
|
-
Status: ⚠ Approaching 100KB threshold
|
|
729
|
-
Recommendation: Use enrichSectionIncremental for remaining modules
|
|
730
|
-
```
|
|
731
|
-
|
|
732
|
-
### Splitting Large Files (Advanced)
|
|
733
|
-
|
|
734
|
-
If a module feature.json exceeds 500KB despite incremental operations:
|
|
735
|
-
|
|
736
|
-
1. **Split specification section** into separate files:
|
|
737
|
-
- `specification-entities.json` (entities, relationships)
|
|
738
|
-
- `specification-rules.json` (business rules, validations)
|
|
739
|
-
- `specification-ui.json` (wireframes, sections, navigation)
|
|
740
|
-
|
|
741
|
-
2. **Update feature.json** with file references:
|
|
742
|
-
```json
|
|
743
|
-
{
|
|
744
|
-
"specification": {
|
|
745
|
-
"$ref": "./specification-entities.json",
|
|
746
|
-
"$ref2": "./specification-rules.json",
|
|
747
|
-
"$ref3": "./specification-ui.json"
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
```
|
|
751
|
-
|
|
752
|
-
3. **ba-reader** auto-resolves references when reading
|
|
753
|
-
|
|
754
|
-
**Note:** File splitting is a LAST RESORT. Prefer enrichSectionIncremental first.
|
|
755
|
-
|
|
756
630
|
## Error Handling
|
|
757
631
|
|
|
758
632
|
- Return clear validation errors with line numbers
|
|
@@ -763,25 +637,25 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
763
637
|
|
|
764
638
|
## $schema Reference Rules (MANDATORY)
|
|
765
639
|
|
|
766
|
-
> **Every
|
|
640
|
+
> **Every index.json MUST include a `$schema` field** pointing to the deployed schema file via relative path.
|
|
767
641
|
> Schemas are deployed by step-00-init to: `docs/{app}/business-analyse/schemas/`
|
|
768
642
|
|
|
769
643
|
**$schema paths by scope:**
|
|
770
644
|
|
|
771
|
-
| Scope |
|
|
645
|
+
| Scope | index.json location | $schema value |
|
|
772
646
|
|-------|----------------------|---------------|
|
|
773
|
-
| project | `docs/business-analyse/v1.0/
|
|
774
|
-
| application | `docs/{app}/business-analyse/v1.0/
|
|
775
|
-
| 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"` |
|
|
776
650
|
|
|
777
651
|
**Rules:**
|
|
778
|
-
- `$schema` is ALWAYS the FIRST field in
|
|
779
|
-
- 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
|
|
780
654
|
- For application scope: go up 1 level (v1.0/) → into schemas/
|
|
781
655
|
- For module scope: go up 3 levels (v1.0/ → business-analyse/ → {module}/) → into business-analyse/schemas/
|
|
782
656
|
- If schemas directory not found → WARNING (schemas may not have been deployed by step-00)
|
|
783
657
|
|
|
784
|
-
## Example
|
|
658
|
+
## Example index.json Structure
|
|
785
659
|
|
|
786
660
|
**Module-level:**
|
|
787
661
|
```json
|
|
@@ -790,6 +664,7 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
790
664
|
"id": "FEAT-001",
|
|
791
665
|
"version": "1.0",
|
|
792
666
|
"status": "draft",
|
|
667
|
+
"scope": "module",
|
|
793
668
|
"metadata": {
|
|
794
669
|
"app": "crm",
|
|
795
670
|
"module": "contacts",
|
|
@@ -810,12 +685,13 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
810
685
|
"handed-off": null
|
|
811
686
|
}
|
|
812
687
|
},
|
|
813
|
-
"
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
688
|
+
"fileHashes": {
|
|
689
|
+
"discovery.json": "abc123...",
|
|
690
|
+
"analysis.json": "def456...",
|
|
691
|
+
"specification.json": "ghi789...",
|
|
692
|
+
"validation.json": "jkl012...",
|
|
693
|
+
"handoff.json": "mno345..."
|
|
694
|
+
}
|
|
819
695
|
}
|
|
820
696
|
```
|
|
821
697
|
|
|
@@ -827,13 +703,35 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
827
703
|
"version": "1.0",
|
|
828
704
|
"status": "draft",
|
|
829
705
|
"scope": "application",
|
|
830
|
-
"metadata": {
|
|
831
|
-
|
|
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
|
+
},
|
|
832
733
|
"modules": [],
|
|
833
|
-
"dependencyGraph": {}
|
|
834
|
-
"consolidation": {},
|
|
835
|
-
"suggestions": [],
|
|
836
|
-
"changelog": []
|
|
734
|
+
"dependencyGraph": {}
|
|
837
735
|
}
|
|
838
736
|
```
|
|
839
737
|
|
|
@@ -848,6 +746,10 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
848
746
|
"metadata": {
|
|
849
747
|
"projectName": "Enterprise HR Platform",
|
|
850
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",
|
|
851
753
|
"workflow": {
|
|
852
754
|
"mode": "project",
|
|
853
755
|
"applicationOrder": ["HumanResources", "EmployeeSelfService"],
|
|
@@ -856,11 +758,12 @@ If a module feature.json exceeds 500KB despite incremental operations:
|
|
|
856
758
|
"currentApplication": "HumanResources"
|
|
857
759
|
}
|
|
858
760
|
},
|
|
859
|
-
"
|
|
761
|
+
"fileHashes": {
|
|
762
|
+
"index.json": "qrs345...",
|
|
763
|
+
"cadrage.json": "tuv678...",
|
|
764
|
+
"consolidation.json": "wxy901..."
|
|
765
|
+
},
|
|
860
766
|
"applications": [],
|
|
861
|
-
"applicationDependencyGraph": {}
|
|
862
|
-
"consolidation": {},
|
|
863
|
-
"suggestions": [],
|
|
864
|
-
"changelog": []
|
|
767
|
+
"applicationDependencyGraph": {}
|
|
865
768
|
}
|
|
866
769
|
```
|