aw-spec-cli 0.1.3 → 0.1.5

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.
Files changed (230) hide show
  1. package/README.md +291 -0
  2. package/assets/.agents/agent.json +28 -0
  3. package/assets/.agents/skills/aw-spec-orch/SKILL.md +56 -0
  4. package/assets/.agents/skills/aw-spec-orch-demo/SKILL.md +59 -0
  5. package/assets/.aw-spec/DESIGN-FORMAT.md +151 -0
  6. package/assets/.aw-spec/ORCH-DIALECT.md +156 -0
  7. package/assets/.aw-spec/RULE-PARTITION.md +126 -0
  8. package/assets/.aw-spec/extensions/agent-context/extension.yml +12 -9
  9. package/assets/.aw-spec/extensions.yml +12 -19
  10. package/assets/.aw-spec/integrations/aw-spec.manifest.json +1 -9
  11. package/assets/.aw-spec/interpreter/run-skill.py +1158 -0
  12. package/assets/.aw-spec/orchestrator/AGENT-PROFILE.md +94 -0
  13. package/assets/.aw-spec/orchestrator/README.md +300 -0
  14. package/assets/.aw-spec/orchestrator/adapters/claude_agent_sdk.py +74 -0
  15. package/assets/.aw-spec/orchestrator/adapters/google_antigravity.py +74 -0
  16. package/assets/.aw-spec/orchestrator/modules/delta-design.orch.yaml +105 -0
  17. package/assets/.aw-spec/orchestrator/modules/delta-spec.orch.yaml +79 -0
  18. package/assets/.aw-spec/orchestrator/modules/domain-select.orch.yaml +81 -0
  19. package/assets/.aw-spec/orchestrator/modules/tech-select.orch.yaml +75 -0
  20. package/assets/.aw-spec/orchestrator/orchestrator.py +1721 -0
  21. package/assets/.aw-spec/orchestrator/rev-templates/ai-rules.reference.md +40 -0
  22. package/assets/.aw-spec/orchestrator/rev-templates/comandrulemap.skeleton.md +59 -0
  23. package/assets/.aw-spec/orchestrator/rev-templates/commandtechrulemap.skeleton.md +97 -0
  24. package/assets/.aw-spec/orchestrator/rev-templates/domain-constitution.skeleton.md +61 -0
  25. package/assets/.aw-spec/orchestrator/rev-templates/domain-requirements.skeleton.md +48 -0
  26. package/assets/.aw-spec/orchestrator/rev-templates/domain-rule-file.skeleton.md +39 -0
  27. package/assets/.aw-spec/orchestrator/rev-templates/technical-constitution.skeleton.md +106 -0
  28. package/assets/.aw-spec/orchestrator/rev-templates/technical-rule-file.skeleton.md +54 -0
  29. package/assets/.aw-spec/orchestrator/workflows/_smoke.orch.yaml +160 -0
  30. package/assets/.aw-spec/orchestrator/workflows/aw-spec-add-component.orch.yaml +244 -0
  31. package/assets/.aw-spec/orchestrator/workflows/aw-spec-adopt.orch.yaml +775 -0
  32. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +248 -0
  33. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +261 -0
  34. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +425 -0
  35. package/assets/.aw-spec/orchestrator/workflows/aw-spec-build.orch.yaml +188 -0
  36. package/assets/.aw-spec/orchestrator/workflows/aw-spec-characterize.orch.yaml +474 -0
  37. package/assets/.aw-spec/orchestrator/workflows/aw-spec-close-delta.orch.yaml +181 -0
  38. package/assets/.aw-spec/orchestrator/workflows/aw-spec-constitution.orch.yaml +284 -0
  39. package/assets/.aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml +103 -0
  40. package/assets/.aw-spec/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +69 -0
  41. package/assets/.aw-spec/orchestrator/workflows/aw-spec-deploy.orch.yaml +85 -0
  42. package/assets/.aw-spec/orchestrator/workflows/aw-spec-design.orch.yaml +382 -0
  43. package/assets/.aw-spec/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +382 -0
  44. package/assets/.aw-spec/orchestrator/workflows/aw-spec-foundation.orch.yaml +246 -0
  45. package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +231 -0
  46. package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement.orch.yaml +258 -0
  47. package/assets/.aw-spec/orchestrator/workflows/aw-spec-inventory.orch.yaml +236 -0
  48. package/assets/.aw-spec/orchestrator/workflows/aw-spec-onboard.orch.yaml +949 -0
  49. package/assets/.aw-spec/orchestrator/workflows/aw-spec-parity.orch.yaml +293 -0
  50. package/assets/.aw-spec/orchestrator/workflows/aw-spec-run.orch.yaml +177 -0
  51. package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-domain.orch.yaml +79 -0
  52. package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-feature.orch.yaml +128 -0
  53. package/assets/.aw-spec/orchestrator/workflows/aw-spec-specify.orch.yaml +412 -0
  54. package/assets/.aw-spec/scripts/bash/aw-inventory.sh +14 -0
  55. package/assets/.aw-spec/scripts/bash/aw-parity.sh +13 -0
  56. package/assets/.aw-spec/scripts/bash/aw-rev-constitution.sh +13 -0
  57. package/assets/.aw-spec/scripts/bash/aw-spec-actions.sh +1899 -0
  58. package/assets/.aw-spec/scripts/bash/aw-xref.sh +15 -0
  59. package/assets/.aw-spec/scripts/bash/common.sh +11 -60
  60. package/assets/.aw-spec/scripts/powershell/aw-inventory.ps1 +14 -0
  61. package/assets/.aw-spec/scripts/powershell/aw-parity.ps1 +13 -0
  62. package/assets/.aw-spec/scripts/powershell/aw-rev-constitution.ps1 +13 -0
  63. package/assets/.aw-spec/scripts/powershell/aw-spec-actions.ps1 +1563 -0
  64. package/assets/.aw-spec/scripts/powershell/aw-xref.ps1 +15 -0
  65. package/assets/.aw-spec/scripts/python/aw-inventory.py +683 -0
  66. package/assets/.aw-spec/scripts/python/aw-parity.py +380 -0
  67. package/assets/.aw-spec/scripts/python/aw-rev-constitution.py +312 -0
  68. package/assets/.aw-spec/scripts/python/aw-xref.py +1330 -0
  69. package/assets/.aw-spec/scripts/python/validate_okf.py +349 -0
  70. package/assets/.aw-spec/templates/constitution-domain-template.md +75 -0
  71. package/assets/.aw-spec/templates/constitution-technical-template.md +70 -0
  72. package/assets/.aw-spec/templates/delta-design-template.md +69 -0
  73. package/assets/.aw-spec/templates/delta-spec-template.md +60 -0
  74. package/assets/.aw-spec/templates/design-template.md +383 -0
  75. package/assets/.aw-spec/templates/okf-concept-template.md +103 -0
  76. package/assets/.aw-spec/templates/parity-manifest-template.json +49 -0
  77. package/assets/.aw-spec/templates/source-map-template.md +85 -0
  78. package/assets/.aw-spec/templates/spec-template.md +192 -71
  79. package/assets/.claude/agent.json +27 -0
  80. package/assets/.claude/skills/aw-spec-orch/SKILL.md +55 -0
  81. package/assets/.claude/skills/aw-spec-orch-demo/SKILL.md +59 -0
  82. package/assets/.kilocode/agent.json +28 -0
  83. package/assets/.kilocode/workflows/aw-spec-orch-demo.md +59 -0
  84. package/assets/.kilocode/workflows/aw-spec-orch.md +55 -0
  85. package/assets/docs/architecture/clean-architecture.md +1 -1
  86. package/assets/docs/architecture/cqrs.md +1 -1
  87. package/assets/docs/architecture/eventing.md +1 -1
  88. package/assets/docs/architecture/folder-structure.md +1 -1
  89. package/assets/docs/architecture/modular-monolith.md +1 -1
  90. package/assets/docs/architecture/persistence.md +1 -1
  91. package/assets/docs/architecture/testing.md +1 -1
  92. package/assets/docs/architecture/vertical-slices.md +1 -1
  93. package/assets/docs/components/Email/README.md +1 -1
  94. package/assets/docs/components/Jobs/README.md +1 -1
  95. package/assets/docs/components/QrGenerator/README.md +1 -1
  96. package/assets/docs/components/README.md +1 -1
  97. package/assets/docs/domain/domain-driven-design.md +1 -1
  98. package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +1 -1
  99. package/assets/docs/domainspecs/healthcare/auditing.domain.md +86 -18
  100. package/assets/docs/domainspecs/healthcare/authorization.domain.md +1 -1
  101. package/assets/docs/domainspecs/healthcare/clinical-terms.md +1 -1
  102. package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +1 -1
  103. package/assets/docs/domainspecs/healthcare/comandrulemap.md +58 -124
  104. package/assets/docs/domainspecs/healthcare/commandtechrulemap.md +119 -0
  105. package/assets/docs/domainspecs/healthcare/consent.md +1 -1
  106. package/assets/docs/domainspecs/healthcare/cqrs.domain.md +1 -1
  107. package/assets/docs/domainspecs/healthcare/data-classification.domain.md +1 -1
  108. package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +1 -1
  109. package/assets/docs/domainspecs/healthcare/dicom.md +1 -1
  110. package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +1 -1
  111. package/assets/docs/domainspecs/healthcare/eventing.domain.md +1 -1
  112. package/assets/docs/domainspecs/healthcare/fhir.md +1 -1
  113. package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +1 -1
  114. package/assets/docs/domainspecs/healthcare/hipaa.md +1 -1
  115. package/assets/docs/domainspecs/healthcare/hl7.md +1 -1
  116. package/assets/docs/domainspecs/healthcare/integration-terms.md +1 -1
  117. package/assets/docs/domainspecs/healthcare/persistence.domain.md +1 -1
  118. package/assets/docs/domainspecs/healthcare/terminology.md +1 -1
  119. package/assets/docs/domainspecs/healthcare/testing.domain.md +1 -1
  120. package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +1 -1
  121. package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +1 -1
  122. package/assets/docs/domainspecs/pharma/api-versioning.domain.md +1 -1
  123. package/assets/docs/domainspecs/pharma/atc.md +1 -1
  124. package/assets/docs/domainspecs/pharma/auditing.domain.md +80 -16
  125. package/assets/docs/domainspecs/pharma/authorization.domain.md +1 -1
  126. package/assets/docs/domainspecs/pharma/coding-standards.domain.md +1 -1
  127. package/assets/docs/domainspecs/pharma/comandrulemap.md +64 -142
  128. package/assets/docs/domainspecs/pharma/commandtechrulemap.md +119 -0
  129. package/assets/docs/domainspecs/pharma/cqrs.domain.md +1 -1
  130. package/assets/docs/domainspecs/pharma/data-classification.domain.md +1 -1
  131. package/assets/docs/domainspecs/pharma/data-provenance.md +1 -1
  132. package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +1 -1
  133. package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +1 -1
  134. package/assets/docs/domainspecs/pharma/eventing.domain.md +1 -1
  135. package/assets/docs/domainspecs/pharma/fhir.md +1 -1
  136. package/assets/docs/domainspecs/pharma/folder-structure.domain.md +1 -1
  137. package/assets/docs/domainspecs/pharma/hl7.md +1 -1
  138. package/assets/docs/domainspecs/pharma/idmp.md +1 -1
  139. package/assets/docs/domainspecs/pharma/integration-terms.md +1 -1
  140. package/assets/docs/domainspecs/pharma/ndc.md +1 -1
  141. package/assets/docs/domainspecs/pharma/persistence.domain.md +1 -1
  142. package/assets/docs/domainspecs/pharma/pharma-terms.md +1 -1
  143. package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +1 -1
  144. package/assets/docs/domainspecs/pharma/regulatory-compliance.md +1 -1
  145. package/assets/docs/domainspecs/pharma/terminology.md +1 -1
  146. package/assets/docs/domainspecs/pharma/testing.domain.md +1 -1
  147. package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +1 -1
  148. package/assets/docs/domainspecs/pharma/zero-trust.domain.md +1 -1
  149. package/assets/docs/governance/api-versioning.md +1 -1
  150. package/assets/docs/governance/coding-standards.md +1 -1
  151. package/assets/docs/governance/dependency-policy.md +1 -1
  152. package/assets/docs/requirement-spec.txt +13 -1
  153. package/assets/docs/security/auditing.md +54 -11
  154. package/assets/docs/security/authorization.md +1 -1
  155. package/assets/docs/security/data-classification.md +1 -1
  156. package/assets/docs/security/zero-trust.md +1 -1
  157. package/dist/commands/update.d.ts +3 -0
  158. package/dist/commands/update.d.ts.map +1 -0
  159. package/dist/commands/update.js +142 -0
  160. package/dist/commands/update.js.map +1 -0
  161. package/dist/utils/manifest.d.ts +31 -0
  162. package/dist/utils/manifest.d.ts.map +1 -0
  163. package/dist/utils/manifest.js +91 -0
  164. package/dist/utils/manifest.js.map +1 -0
  165. package/dist/utils/paths.js +2 -2
  166. package/dist/utils/paths.js.map +1 -1
  167. package/dist/utils/update-engine.d.ts +52 -0
  168. package/dist/utils/update-engine.d.ts.map +1 -0
  169. package/dist/utils/update-engine.js +203 -0
  170. package/dist/utils/update-engine.js.map +1 -0
  171. package/package.json +1 -1
  172. package/assets/.agents/skills/aw-spec-addcomponent/SKILL.md +0 -129
  173. package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +0 -31
  174. package/assets/.agents/skills/aw-spec-analyze/SKILL.md +0 -296
  175. package/assets/.agents/skills/aw-spec-checklist/SKILL.md +0 -374
  176. package/assets/.agents/skills/aw-spec-clarify/SKILL.md +0 -320
  177. package/assets/.agents/skills/aw-spec-constitution/SKILL.md +0 -194
  178. package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +0 -268
  179. package/assets/.agents/skills/aw-spec-foundation/SKILL.md +0 -358
  180. package/assets/.agents/skills/aw-spec-implement/SKILL.md +0 -279
  181. package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
  182. package/assets/.agents/skills/aw-spec-plan/SKILL.md +0 -221
  183. package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +0 -73
  184. package/assets/.agents/skills/aw-spec-specify/SKILL.md +0 -382
  185. package/assets/.agents/skills/aw-spec-tasks/SKILL.md +0 -259
  186. package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +0 -107
  187. package/assets/.aw-spec/integrations/claude.manifest.json +0 -17
  188. package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +0 -189
  189. package/assets/.aw-spec/scripts/bash/create-new-feature.sh +0 -299
  190. package/assets/.aw-spec/scripts/bash/setup-plan.sh +0 -84
  191. package/assets/.aw-spec/scripts/bash/setup-tasks.sh +0 -91
  192. package/assets/.aw-spec/templates/checklist-template.md +0 -40
  193. package/assets/.aw-spec/templates/constitution-template.md +0 -57
  194. package/assets/.aw-spec/templates/plan-template.md +0 -113
  195. package/assets/.aw-spec/templates/tasks-template.md +0 -252
  196. package/assets/.aw-spec/workflows/aw-spec/workflow.yml +0 -77
  197. package/assets/.aw-spec/workflows/workflow-registry.json +0 -13
  198. package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +0 -129
  199. package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +0 -31
  200. package/assets/.claude/skills/aw-spec-analyze/SKILL.md +0 -296
  201. package/assets/.claude/skills/aw-spec-checklist/SKILL.md +0 -374
  202. package/assets/.claude/skills/aw-spec-clarify/SKILL.md +0 -320
  203. package/assets/.claude/skills/aw-spec-constitution/SKILL.md +0 -194
  204. package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +0 -268
  205. package/assets/.claude/skills/aw-spec-foundation/SKILL.md +0 -358
  206. package/assets/.claude/skills/aw-spec-implement/SKILL.md +0 -279
  207. package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
  208. package/assets/.claude/skills/aw-spec-plan/SKILL.md +0 -221
  209. package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +0 -73
  210. package/assets/.claude/skills/aw-spec-specify/SKILL.md +0 -382
  211. package/assets/.claude/skills/aw-spec-tasks/SKILL.md +0 -259
  212. package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +0 -107
  213. package/assets/.kilocode/rules/specify-rules.md +0 -4
  214. package/assets/.kilocode/workflows/aw-spec-addcomponent.md +0 -129
  215. package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +0 -31
  216. package/assets/.kilocode/workflows/aw-spec-analyze.md +0 -296
  217. package/assets/.kilocode/workflows/aw-spec-checklist.md +0 -374
  218. package/assets/.kilocode/workflows/aw-spec-clarify.md +0 -320
  219. package/assets/.kilocode/workflows/aw-spec-constitution.md +0 -194
  220. package/assets/.kilocode/workflows/aw-spec-fast-implement.md +0 -263
  221. package/assets/.kilocode/workflows/aw-spec-foundation.md +0 -358
  222. package/assets/.kilocode/workflows/aw-spec-implement.md +0 -279
  223. package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +0 -204
  224. package/assets/.kilocode/workflows/aw-spec-plan.md +0 -221
  225. package/assets/.kilocode/workflows/aw-spec-select-domain.md +0 -73
  226. package/assets/.kilocode/workflows/aw-spec-specify.md +0 -382
  227. package/assets/.kilocode/workflows/aw-spec-tasks.md +0 -259
  228. package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +0 -107
  229. package/assets/docs/command.txt +0 -295
  230. package/assets/docs/pharma-constitution.my-ref.md +0 -86
package/README.md ADDED
@@ -0,0 +1,291 @@
1
+ # aw-spec-cli
2
+
3
+ **AppWeaver Spec-Driven Development CLI** — Scaffold projects with vertical slices, DDD, CQRS, and AI agent skills.
4
+
5
+ [![Node.js >=18](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org/)
6
+
7
+ ---
8
+
9
+ ## Overview
10
+
11
+ `aw-spec-cli` initializes new projects with the **AppWeaver Spec-Driven Development** structure:
12
+
13
+ - **Vertical Slice Architecture** — Feature-oriented, decoupled modules
14
+ - **Domain-Driven Design (DDD)** — Rich domain models, bounded contexts
15
+ - **CQRS** — Command/Query separation for scalable reads/writes
16
+ - **AI Agent Skills** — Ready-to-use skills for Claude Code, Antigravity, and KiloCode
17
+
18
+ The CLI copies a battle-tested project skeleton (from the [AppWeaver.Spec](https://dev.azure.com/bytestrone-labs/AppWeaver/_git/AppWeaver.Spec) reference implementation) into your target directory.
19
+
20
+ ---
21
+
22
+ ## Installation
23
+
24
+ ### Global Install (via Azure Artifacts / npm)
25
+ ```bash
26
+ # From Azure Artifacts (after publishing)
27
+ npm install -g aw-spec-cli
28
+
29
+ # Or use via npx
30
+ npx aw-spec-cli@latest init
31
+ ```
32
+
33
+ ### Local Development Install
34
+ ```bash
35
+ # From the cloned repository
36
+ git clone https://dev.azure.com/bytestrone-labs/AppWeaver/_git/appweaver
37
+ cd platform/Appweaver.Spec.Cli
38
+ npm install
39
+ npm run build
40
+ # Then run via node
41
+ dist/index.js init
42
+ ```
43
+
44
+ Requires **Node.js ≥ 18**.
45
+
46
+ ---
47
+
48
+ ## Quick Start
49
+
50
+ ```bash
51
+ # Create a new project in the current directory
52
+ aw-spec init
53
+
54
+ # Or specify a target directory
55
+ aw-spec init my-project
56
+
57
+ # Non-interactive (uses Claude skills by default)
58
+ aw-spec init -y
59
+
60
+ # Choose agent explicitly
61
+ aw-spec init --agent antigravity
62
+ aw-spec init --agent kilocode
63
+
64
+ # Preview what would be copied (no changes)
65
+ aw-spec init --dry-run
66
+ ```
67
+
68
+ After initialization:
69
+
70
+ ```bash
71
+ # Verify the installation
72
+ aw-spec doctor
73
+
74
+ # Start spec-driven development
75
+ aw-spec specify "Your feature description"
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Commands
81
+
82
+ ### `aw-spec init [directory]`
83
+
84
+ Initialize a new AppWeaver Spec project.
85
+
86
+ | Option | Description |
87
+ |--------|-------------|
88
+ | `directory` | Target directory (default: current directory) |
89
+ | `-a, --agent <agent>` | Agent skills to include: `claude`, `antigravity`, `kilocode` (default: prompt) |
90
+ | `-y, --yes` | Skip prompts, use defaults (Claude) |
91
+ | `--dry-run` | Show what would be copied without making changes |
92
+
93
+ **Copied structure:**
94
+ ```
95
+ target-dir/
96
+ ├── .aw-spec/ # Core spec configuration
97
+ │ ├── extensions.yml # Extension registry
98
+ │ ├── feature.json # Feature tracking
99
+ │ ├── workflows/ # Workflow definitions
100
+ │ ├── templates/ # Spec/plan/task templates
101
+ │ └── scripts/ # Bash/PowerShell helpers
102
+ ├── docs/ # Documentation scaffold
103
+ │ ├── architecture/
104
+ │ ├── domain/
105
+ │ ├── governance/
106
+ │ ├── security/
107
+ │ ├── domainspecs/
108
+ │ ├── glossary/
109
+ │ ├── VerticalSlice/ # Vertical slice packaging
110
+ │ └── ...
111
+ └── .claude/skills/ # Or .agents/skills/, .kilocode/
112
+ ├── aw-spec-specify/
113
+ ├── aw-spec-plan/
114
+ ├── aw-spec-implement/
115
+ └── ... (13 skills total)
116
+ ```
117
+
118
+ ### `aw-spec doctor`
119
+
120
+ Verify the project structure is complete and valid.
121
+
122
+ | Option | Description |
123
+ |--------|-------------|
124
+ | `-v, --verbose` | Show detailed output (lists all skills, missing items) |
125
+
126
+ **Checks performed:**
127
+ - Required folders: `.aw-spec/`, `docs/`
128
+ - Required config files: `extensions.yml`, `feature.json`, `init-options.json`, `integration.json`, `workflow-registry.json`
129
+ - Agent skills folder (`.claude/skills` or `.agents/skills`) with all 13 skills
130
+ - Documentation structure (`architecture/`, `domain/`, `governance/`, `security/`, `domainspecs/`, `glossary/`, `VerticalSlice/`)
131
+ - Vertical Slice packaging scripts (`pack-foundation.sh`, `unpack-foundation.sh`, `PACKAGING.md`)
132
+ - `.aw-spec` subdirectories (`extensions/`, `templates/`, `scripts/`, `workflows/`, `integrations/`, `memory/`)
133
+
134
+ ---
135
+
136
+ ## Agent Support
137
+
138
+ | Agent | Folder | Skills |
139
+ |-------|--------|--------|
140
+ | **Claude Code** | `.claude/skills/` | 13 skills (specify, plan, implement, tasks, clarify, analyze, checklist, foundation, constitution, select-domain, agent-context-update, addcomponent, taskstoissues) |
141
+ | **Antigravity** | `.agents/skills/` | Same 13 skills, Antigravity-compatible format |
142
+ | **KiloCode** | `.kilocode/` | Workflow definitions (`.md` files) |
143
+
144
+ Choose based on your AI assistant. Skills provide guided workflows for spec-driven development:
145
+ - `aw-spec-specify` — Write feature specifications
146
+ - `aw-spec-plan` — Create implementation plans
147
+ - `aw-spec-implement` — Generate code from plans
148
+ - `aw-spec-tasks` — Break down into executable tasks
149
+ - ... and more
150
+
151
+ ---
152
+
153
+ ## Project Structure (After Init)
154
+
155
+ ```
156
+ my-project/
157
+ ├── .aw-spec/
158
+ │ ├── extensions.yml
159
+ │ ├── feature.json
160
+ │ ├── init-options.json
161
+ │ ├── integration.json
162
+ │ ├── workflows/
163
+ │ │ └── workflow-registry.json
164
+ │ ├── extensions/
165
+ │ │ └── agent-context/
166
+ │ │ ├── scripts/
167
+ │ │ └── commands/
168
+ │ ├── templates/
169
+ │ │ ├── spec-template.md
170
+ │ │ ├── plan-template.md
171
+ │ │ └── tasks-template.md
172
+ │ ├── scripts/
173
+ │ │ └── bash/
174
+ │ │ └── common.sh
175
+ │ ├── integrations/
176
+ │ └── memory/
177
+ ├── docs/
178
+ │ ├── architecture/
179
+ │ ├── domain/
180
+ │ ├── governance/
181
+ │ ├── security/
182
+ │ ├── domainspecs/
183
+ │ ├── glossary/
184
+ │ ├── interop/
185
+ │ ├── ModularMonolith/
186
+ │ ├── VerticalSlice/
187
+ │ │ ├── VerticalSlice.pack.txt
188
+ │ │ ├── PACKAGING.md
189
+ │ │ ├── pack-foundation.sh
190
+ │ │ └── unpack-foundation.sh
191
+ │ ├── command.txt
192
+ │ ├── components/
193
+ │ ├── pharma-constitution.my-ref.md
194
+ │ ├── requirement-spec.txt
195
+ │ ├── technology-constitution.md
196
+ │ └── README.md
197
+ └── .claude/skills/ # Or .agents/skills/, .kilocode/
198
+ ├── aw-spec-addcomponent/
199
+ ├── aw-spec-agent-context-update/
200
+ ├── aw-spec-analyze/
201
+ ├── aw-spec-checklist/
202
+ ├── aw-spec-clarify/
203
+ ├── aw-spec-constitution/
204
+ ├── aw-spec-foundation/
205
+ ├── aw-spec-implement/
206
+ ├── aw-spec-plan/
207
+ ├── aw-spec-select-domain/
208
+ ├── aw-spec-specify/
209
+ ├── aw-spec-tasks/
210
+ └── aw-spec-taskstoissues/
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Development
216
+
217
+ ### Prerequisites
218
+ - Node.js ≥ 18
219
+ - The [AppWeaver.Spec](https://dev.azure.com/bytestrone-labs/AppWeaver/_git/AppWeaver.Spec) repository cloned as a sibling directory (for bundling assets)
220
+
221
+ ### Scripts
222
+ | Command | Description |
223
+ |---------|-------------|
224
+ | `npm run build` | Compile TypeScript to `dist/` |
225
+ | `npm run bundle:content` | Copy assets from `../AppWeaver.Spec` → `assets/` |
226
+ | `npm run prepack` | Build + bundle (runs automatically on `npm publish`) |
227
+ | `npm test` | Run unit tests (Vitest) |
228
+ | `npm run test:watch` | Watch mode |
229
+ | `npm run lint` | ESLint on `src/` |
230
+ | `npm run doctor` | Run CLI doctor on current directory |
231
+
232
+ ### Setup (Local Development)
233
+ ```bash
234
+ # Clone the main repository
235
+ git clone https://dev.azure.com/bytestrone-labs/AppWeaver/_git/appweaver
236
+ cd platform/Appweaver.Spec.Cli
237
+ npm install
238
+
239
+ # Ensure AppWeaver.Spec is available for bundling
240
+ # Either clone it as a sibling directory:
241
+ # git clone https://dev.azure.com/bytestrone-labs/AppWeaver/_git/AppWeaver.Spec ../AppWeaver.Spec
242
+ # Or the bundling script will fall back to published assets in dist/assets/
243
+ ```
244
+
245
+ ### Setup (After Publishing to Azure Artifacts)
246
+ Once published to Azure Artifacts, consumers can install via:
247
+ ```bash
248
+ # From Azure Artifacts / npm registry (after publishing)
249
+ npm install -g aw-spec-cli
250
+
251
+ # Or use directly via npx
252
+ npx aw-spec-cli@latest init
253
+ ```
254
+
255
+ ---
256
+
257
+ ## How It Works
258
+
259
+ 1. **Asset Bundling** (`scripts/bundle-content.ts`) — On publish, copies the AppWeaver.Spec reference implementation into `assets/` (excludes build artifacts, secrets, VCS folders).
260
+
261
+ 2. **Asset Resolution** (`src/utils/paths.ts`) — At runtime, finds assets in priority order:
262
+ - `dist/assets/` (published package)
263
+ - `../AppWeaver.Spec` (local development)
264
+ - `packageRoot/assets` (fallback)
265
+
266
+ 3. **Project Initialization** (`src/commands/init.ts`) — Copies `.aw-spec/`, `docs/`, and the selected agent's skills to the target directory with overwrite protection.
267
+
268
+ 4. **Validation** (`src/commands/doctor.ts`) — Comprehensive structure verification with colored output.
269
+
270
+ ---
271
+
272
+ ## Contributing
273
+
274
+ 1. Fork the repository
275
+ 2. Create a feature branch: `git checkout -b feature/my-feature`
276
+ 3. Make changes with tests
277
+ 4. Run `npm run build && npm test && npm run lint`
278
+ 5. Submit a PR
279
+
280
+ ---
281
+
282
+ ## License
283
+
284
+ MIT © [AppWeaver Team](https://dev.azure.com/bytestrone-labs/AppWeaver)
285
+
286
+ ---
287
+
288
+ ## Related
289
+
290
+ - [AppWeaver.Spec](https://dev.azure.com/bytestrone-labs/AppWeaver/_git/AppWeaver.Spec) — Reference implementation & source of bundled assets
291
+ - [Spec-Driven Development](https://dev.azure.com/bytestrone-labs/AppWeaver/_git/AppWeaver.Spec?path=/docs/spec-driven-development.md) — Methodology overview
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "antigravity",
3
+ "sdk": {
4
+ "type": "google-antigravity",
5
+ "package": "google-antigravity",
6
+ "module": "google.antigravity",
7
+ "adapter": "../.aw-spec/orchestrator/adapters/google_antigravity.py"
8
+ },
9
+ "runtime": "Antigravity CLI (agy -p) — Antigravity is Gemini-based",
10
+ "note": "Antigravity (agy) has no --system-prompt flag, so 'system' is folded into the prompt (system: prepend).",
11
+ "bin": "agy",
12
+ "args": ["--dangerously-skip-permissions", "--add-dir", "."],
13
+ "model_flag": "--model",
14
+ "system": "prepend",
15
+ "user": { "mode": "arg", "flag": "-p" },
16
+ "tools_flag": null,
17
+ "approval": {
18
+ "acceptEdits": ["--mode", "accept-edits"],
19
+ "bypassPermissions": ["--dangerously-skip-permissions"],
20
+ "default": [],
21
+ "readonly": ["--mode", "plan"]
22
+ },
23
+ "isolation": {
24
+ "bare": [],
25
+ "fresh": []
26
+ },
27
+ "result_keys": ["response", "result"]
28
+ }
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: "aw-spec-orch"
3
+ description: "Parametric launcher (Antigravity): run ANY converted aw-spec skill on the aw-orchestrator under one of the 4 strategies (agent [default], spawn, sdk, sdk-apply)."
4
+ argument-hint: "<skill> [strategy] [input…] — e.g. 'select-domain', 'specify spawn Build an order API', 'analyze-slice'"
5
+ compatibility: "Requires .aw-spec/orchestrator/ and the agy CLI on PATH"
6
+ user-invocable: true
7
+ disable-model-invocation: false
8
+ ---
9
+
10
+ # Orchestrator Skill Launcher
11
+
12
+ Runs one converted `aw-spec-*` workflow on the shared, agent-agnostic engine. All orchestration and **all context management live in the workflow YAML + engine** (`.aw-spec/orchestrator/orchestrator.py`): the interpreter assembles the COMPLETE payload (system + user) for every request; you never author generation context yourself. Execution follows the chosen strategy; the checkpoint channel carries every human-facing interaction regardless of strategy.
13
+
14
+ - **Engine + workflows (common, shared by all agents):** `.aw-spec/orchestrator/orchestrator.py`, `.aw-spec/orchestrator/workflows/aw-spec-<skill>.orch.yaml`, shared modules in `.aw-spec/orchestrator/modules/`, shared scripts in `.aw-spec/scripts/`
15
+ - **This agent's transport profile:** `.agents/agent.json`
16
+
17
+ > Antigravity spawns via the `agy` CLI (Gemini-based; no `--system-prompt`,
18
+ > so `system` is folded into the prompt — isolation is best-effort). Its
19
+ > `sdk` block declares the SDK the `sdk`/`sdk-apply` strategies import
20
+ > (`google-antigravity`) and the adapter
21
+ > (`.aw-spec/orchestrator/adapters/google_antigravity.py`, shared per-SDK)
22
+ > that owns its calling convention.
23
+
24
+ ## Execution Steps
25
+
26
+ 1. **Parse Arguments** (`<skill> [strategy] [input…]`):
27
+ - `skill` (required): the aw-spec skill name, e.g. `demo`, `select-domain`, `foundation`, `specify`, `design`, `implement`, `build`. Resolve the workflow file `.aw-spec/orchestrator/workflows/aw-spec-<skill>.orch.yaml`. If it does not exist, list the available `aw-spec-*.orch.yaml` files in that folder and stop.
28
+ - `strategy` (optional, one of `agent`, `spawn`, `sdk`, `sdk-apply`; default `agent` — YOU fulfill each generation through the checkpoint channel, no profile needed): who executes each generation. Always pass `--strategy <strategy>`.
29
+ - Everything after the strategy is the user input: pass it as `--input "<text>"` (omit when empty).
30
+ - `--agent-profile .agents/agent.json` is required for `spawn`, `sdk`, and `sdk-apply` (`agent` needs no profile). If the SDK package isn't installed, add `--sdk-install`.
31
+ - **Always** pass `--checkpoint .aw-spec/orchestrator/.state/<skill>.state.json` — for EVERY strategy. Converted skills contain interactive steps (questions, selections, hooks); the checkpoint is how they reach you and the user. Strategies only govern who generates.
32
+ - `spawn` may also add `--isolation bare|fresh` and `--model <name>`; `sdk`/`sdk-apply` accept `--model <name>`.
33
+
34
+ 2. **Run the Interpreter**:
35
+ ```bash
36
+ python3 .aw-spec/orchestrator/orchestrator.py \
37
+ .aw-spec/orchestrator/workflows/aw-spec-<skill>.orch.yaml \
38
+ --strategy <strategy> \
39
+ --checkpoint .aw-spec/orchestrator/.state/<skill>.state.json \
40
+ [--agent-profile .agents/agent.json] # spawn, sdk, sdk-apply \
41
+ [--input "<user input>"] \
42
+ --json
43
+ ```
44
+
45
+ 3. **Handle the Suspend/Resume Loop** — whenever the command exits with code `2`, read the printed `pending` JSON and dispatch on `pending.kind`; fulfill it, write the response to `pending.response_path`, then re-run the SAME command. Repeat until exit `0` (done) or `1` (stopped by a gate).
46
+ - **`ask`** — ask the USER the `prompt` with the listed `options` (use your question tool). Write the chosen answer as PLAIN TEXT to `response_path` (comma-separated values when `multi` is true).
47
+ - **`select`** — ask the USER to pick ONE of `options`; write the chosen value as plain text to `response_path`.
48
+ - **`hook`** — run each MANDATORY hook in `hooks` (each is a slash command of THIS agent) in this conversation; optional hooks at your discretion. Then write `done` to `response_path`.
49
+ - **`author`** — read `system_path` + `user_path` and treat them as your ONLY standards and context. Author the COMPLETE content of the file named in `target` and write it — content ONLY, no commentary, no code fence — to `response_path`. Do NOT write the target file yourself; the interpreter does that.
50
+ - **`agent_generate`** — read `system_path` + `user_path`; perform the task YOURSELF with the listed `tools` within `permission_mode`; write your full final reply — ending with the required ```json fence — to `response_path`.
51
+ - **`agent_query` / `agent_review`** — same as above but READ-ONLY (do not modify files); the reply must end with the required ```json fence.
52
+ - **`apply`** — an isolated generation already decided the changes: read `artifact_path` and write its file contents EXACTLY to the paths it names, then write the confirmation ```json fence to `response_path`.
53
+ - If `pending.note` is present, your previous response was rejected — follow the note and rewrite `response_path`.
54
+
55
+ 4. **Report**:
56
+ Report the final JSON (`status`, `outputs`, and any `reason`) to the user. On `stopped`, relay the gate message verbatim — it tells the user what to fix or run first.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: "aw-spec-orch-demo"
3
+ description: "Prototype launcher (Antigravity): run the aw-orchestrator using the specified strategy (spawn, agent, sdk, sdk-apply)."
4
+ argument-hint: "Optional strategy ('agent', 'spawn', 'sdk', 'sdk-apply') and/or k=value vars (e.g. 'agent out_dir=...')"
5
+ compatibility: "Requires .aw-spec/orchestrator/ and the gemini CLI on PATH"
6
+ user-invocable: true
7
+ disable-model-invocation: false
8
+ ---
9
+
10
+ # Orchestrator Launcher
11
+
12
+ All orchestration lives in the workflow YAML and is executed by `.aw-spec/orchestrator/orchestrator.py` (the general, agent-agnostic engine). The interpreter assembles the COMPLETE payload (system + user) for every request; you never author generation context yourself.
13
+
14
+ - **Engine + workflow (general):** `.aw-spec/orchestrator/orchestrator.py`, `*.orch.yaml`
15
+ - **This agent's transport profile:** `.agents/agent.json`
16
+
17
+ > Antigravity spawns via the `agy` CLI (Gemini-based; no `--system-prompt`, so
18
+ > `system` is folded into the prompt). Its `sdk` block declares the SDK the
19
+ > `sdk`/`sdk-apply` strategies import (`google-antigravity`) and the adapter
20
+ > (`.aw-spec/orchestrator/adapters/google_antigravity.py`, shared per-SDK)
21
+ > that owns its calling convention.
22
+
23
+ ## Execution Steps
24
+
25
+ 1. **Parse Arguments**:
26
+ - Identify the requested strategy (one of: `agent`, `spawn`, `sdk`, `sdk-apply`). If the user specifies a strategy as the first argument, use it. Otherwise, default to `spawn`.
27
+ - Always pass the strategy explicitly: `--strategy <strategy>`.
28
+ - `--agent-profile .agents/agent.json` is required for `spawn`, `sdk`, and `sdk-apply`:
29
+ `spawn` reads the CLI to launch (`agy`) from it; `sdk`/`sdk-apply` read the SDK
30
+ package/module (and its `adapter` file) to import from its `sdk` block.
31
+ If the SDK package isn't installed, add `--sdk-install` so the engine
32
+ pip-installs the declared package first. (`agent` needs no profile.)
33
+ - `--checkpoint .aw-spec/orchestrator/.demo-out/demo.state.json` is required for
34
+ `sdk-apply` and `agent` (suspend/resume — follow the loop in step 3).
35
+ - `spawn` accepts `--model <name>` (e.g. `gemini-2.5-pro`); isolation is
36
+ best-effort for Antigravity (no `--bare` equivalent). `sdk`/`sdk-apply`
37
+ accept `--model <name>`; isolation is intrinsic (fresh SDK session).
38
+
39
+ 2. **Run the Interpreter**:
40
+ Run the command (include only the bracketed flags that apply to the chosen strategy):
41
+ ```bash
42
+ python3 .aw-spec/orchestrator/orchestrator.py \
43
+ .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml \
44
+ --strategy <strategy> \
45
+ [--agent-profile .agents/agent.json] # spawn, sdk, sdk-apply \
46
+ [--checkpoint .aw-spec/orchestrator/.demo-out/demo.state.json] # sdk-apply, agent \
47
+ --json
48
+ ```
49
+
50
+ 3. **Handle Suspend/Resume Loop (for `agent` or `sdk-apply` strategies)**:
51
+ - If the command exits with code `2` (suspend):
52
+ - Read the prompt from the sidecar file `<checkpoint-path>.user.md` (and system instructions from `<checkpoint-path>.system.md`).
53
+ - Fulfill the request directly using your own tools (e.g., implementing the handler or reviewing files in the workspace).
54
+ - Write the final generation or review output to `<checkpoint-path>.response.md`.
55
+ - Re-run the exact same command.
56
+ - Repeat until the orchestrator exits with code `0`.
57
+
58
+ 4. **Report**:
59
+ Report the final JSON outputs (`status`, `outputs`, `review_pass`, generated file paths, etc.) to the user.
@@ -0,0 +1,151 @@
1
+ # aw-spec design-doc format — the single high-level design (HLD)
2
+
3
+ The format the spec-anchored pipeline uses for the **Design** phase. Sibling of
4
+ `ORCH-DIALECT.md` (the orchestrator dialect) and `RULE-PARTITION.md` (which rules each
5
+ command loads): this one governs the *artifact* those workflows read and write — the
6
+ design document — not the engine. The authoring template is
7
+ `.aw-spec/templates/design-template.md`.
8
+
9
+ ## The contract
10
+
11
+ A feature's design is **one document**, living beside its spec:
12
+
13
+ ```
14
+ specs/<Aggregate>/
15
+ spec.md # behaviour (tech-agnostic) — WHAT / WHY — the source of truth
16
+ design.md # structure & decisions (tech-agnostic HLD) — the MEDIATOR
17
+ changes/ # open + archived change records (delta-spec + delta-design)
18
+ ```
19
+
20
+ `design.md` is the **mediator** between the spec and the generated code:
21
+
22
+ ```
23
+ spec.md ──▶ design.md ──▶ code (+ tests)
24
+ behaviour structure & generated by `implement`
25
+ FR/BR/US/SC decisions (HLD) (stack bound at generation time)
26
+ ```
27
+
28
+ - **One design per aggregate.** The four clean-architecture layers (Domain,
29
+ Application, API, Infrastructure) are **sections** of this one document, each at
30
+ design level. Feature = aggregate; commands are user stories inside it. *(This is
31
+ the **greenfield** layout, authored from `design-template.md`. See the Brownfield
32
+ variant below for reverse-engineered / existing-codebase designs.)*
33
+ - **High-level, not code.** It carries entities/value-objects/events, behaviour as
34
+ **signatures + pre/post/invariant/raises**, use-cases, endpoint contracts, ports,
35
+ and the significant technical decisions with rationale — but **no complete method
36
+ bodies**. See `design-template.md` for the section structure (§0–§9). The domain
37
+ layer (§1) follows spec.md exactly — its entities/value-objects are the spec's Key
38
+ Entities and its invariants are the spec's Business Rules.
39
+ - **Technology-agnostic.** Behaviour and contracts use conceptual types, never a
40
+ language. The SAME design.md must be generatable on a different stack. The target
41
+ language/framework/persistence is bound only at `implement` time from the
42
+ constitution's technology base + the active stack profile.
43
+ - **Physical schema is out of scope.** PKs/FKs, columns, indexes, JSON shapes, and
44
+ migration SQL belong to a separate technical-data-model — design.md states WHAT is
45
+ stored and WHICH port persists it, not the schema.
46
+ - **Two deferral ledgers are first-class:** §7 Assumptions (`DA-n`, clarify later)
47
+ and §8 Workarounds (`WA-n`, clear later). They keep the HLD honest about what it
48
+ defers; `implement` tags generated code that leans on them.
49
+ - **Solution-wide rules live elsewhere, not per feature:** the layering/dependency
50
+ rule is the constitution's; the code-generation mechanics (folder mapping,
51
+ file-per-element, test pairing, stack binding) are a technology-specific rule
52
+ applied in the `implement` phase. `design.md` stays feature-specific and
53
+ technology-agnostic.
54
+
55
+ ## Brownfield variant (existing codebases)
56
+
57
+ A design reverse-engineered from — or added forward to — an **existing** codebase is
58
+ authored from the repo's **code-derived `design-template` override**, which
59
+ `/aw-spec-orch onboard` reverse-engineers from the repo's own structure and installs at
60
+ `.aw-spec/templates/overrides/design-template.md`. Both `adopt` (reverse design) and the
61
+ forward `design` phase scaffold from it via the default template name. It is the **same
62
+ contract** as above — one living HLD per aggregate, tech-agnostic, spec-anchored, with the
63
+ same traceability spine and the two deferral ledgers — with **one difference that matters**:
64
+
65
+ - **Structure follows the code, not a fixed layering.** The **code is the source of
66
+ truth**, so the design describes the system **as-built**. Its structural sections
67
+ are **derived from the code's own organisation** (its folders / projects / modules)
68
+ rather than the fixed Domain/Application/API/Infrastructure four. A component the
69
+ code has that fits no textbook layer (a UI tier, a worker, a host project) gets its
70
+ own section; a layer the code lacks does not appear. Two neutral anchors are kept
71
+ because every system has them and the tooling keys on them: **§1 is the domain/data
72
+ model** (the cross-reference tool reads it for `<Other>Id` reference edges) and one
73
+ **§2 subsection is the External Integrations table** (matched by heading keyword, so
74
+ `aw-xref` extracts contract edges from either layout). The `debt` ledger records
75
+ only debt the **code itself** evidences (stubs, dead code, torn seams) — being
76
+ organised unlike a reference architecture is **not** debt, it is the as-built shape;
77
+ migrating toward a target is a separate modernization decision.
78
+
79
+ This keeps a brownfield design free of greenfield architectural bias while remaining a
80
+ normal feature the CR delta loop and forward pipeline consume unchanged.
81
+
82
+ ## Generate forward, reconcile only the high-level back
83
+
84
+ The design document and the code are **not** a byte-for-byte copy of each other.
85
+
86
+ | Direction | Phase | What happens |
87
+ |---|---|---|
88
+ | **Generate** (forward) | Implement | The model reads spec + design.md and **generates** the code and tests — a reasoning step the design guides and constrains, not a transcription. |
89
+ | **Reconcile** (high-level back) | Build / Run fixes | Compile/typecheck/runtime fixes happen on the **code**. Only when a fix is a **high-level technical variation** — a changed pattern, a new component, an altered contract/dependency — is that decision written back into design.md. Low-level churn stays in the code. |
90
+
91
+ > **Invariant:** design.md remains a faithful **high-level** account of the built
92
+ > system — every significant technical decision is recorded — but it is a durable
93
+ > design reference, **not** a line-by-line mirror of the code. (This retires the old
94
+ > `docs == files` extract/reconcile invariant.)
95
+
96
+ ## The traceability spine
97
+
98
+ ```
99
+ FR/BR/US/SC ↔ design section (element / decision) ↔ code (+ tests) ↔ commit
100
+ ```
101
+
102
+ Every design element traces **up** to a spec id, and the whole spec traces **down**
103
+ into a design section (§6 Traceability). This is what makes the analyze gate and the
104
+ review able to check coverage, and what keeps CR impact analysis exact.
105
+
106
+ ## Feature granularity (why a command is a delta, not a new feature)
107
+
108
+ A **feature is the largest slice whose code no other feature owns.** Because
109
+ `implement` regenerates the whole feature's code coherently, a shared file
110
+ (`src/Domain/Order.cs`) must have exactly **one** owning design. So for an aggregate
111
+ with a shared entity, **feature = the aggregate** (`Order`), and individual commands
112
+ (`CreateOrder`, `UpdateOrder`, …) are **user stories / deltas** on the same design.md:
113
+
114
+ - `CreateOrder` = US-1; `UpdateOrder` = US-2.
115
+ - Adding `UpdateOrder` is an additive CR: a Delta Spec (`+US-2`) and a Delta Design
116
+ (`ADDED` new use-case/endpoint sections, `MODIFIED` the shared Order/root and
117
+ repository sections — see `delta-design-template.md`). The design phase amends
118
+ design.md doc-first, bumps the feature version (`v1.0 → v1.1`), and archives the CR;
119
+ `implement` regenerates the touched slice; regression re-tests the shared-file
120
+ dependents.
121
+
122
+ Two command-level features would both claim `src/Domain/Order.cs` and collide —
123
+ which is exactly why the aggregate is the boundary.
124
+
125
+ ## Migration status
126
+
127
+ **Complete.** Every phase now runs this HLD model, including the executable chain.
128
+
129
+ The legacy path-tagged helpers (`design-extract` / `design-reconcile` / `design-paths`)
130
+ are **retired and deleted** from both shells. They belonged to the four-document,
131
+ full-code model in which `design.{domain,application,api,infra}.md` carried the source
132
+ inside ` ```lang path=… ` fences. That convention is gone — no template emits `path=`,
133
+ and `design-scaffold` writes a single `design.md` — so all three had been finding
134
+ nothing and no-op'ing at exit 0. (Their glob, `design.*.md`, could not have matched a
135
+ single `design.md` even if the fences had survived: the second dot required a middle
136
+ segment. The one legitimate remaining user of that glob, `list-features`'s informational
137
+ `design_docs` count, is fixed to `design*.md`.)
138
+
139
+ The question those helpers answered — *which files is this slice made of* — is now an
140
+ **OKF query**, because the knowledge bundle is where that answer is actually maintained:
141
+
142
+ | Need | Now |
143
+ | --- | --- |
144
+ | read the slice's files | `aw-xref concept-paths --feature-dir <dir>` → the concept's `source_files` |
145
+ | record files a fix loop touched | `aw-xref concept-upsert --source-files … --merge` |
146
+
147
+ `build`, `run`, and `analyze-slice` all read through `concept-paths` (feeding their fix
148
+ loops and, in `analyze-slice`, the conformance pass) and write back through
149
+ `concept-upsert --merge`. Both directions are advisory: `concept-paths` is strictly
150
+ read-only and returns an empty list rather than an error when no concept exists yet, so
151
+ a greenfield slice before its first `implement` behaves exactly as it did before.