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
@@ -1,131 +1,252 @@
1
- # Feature Specification: [FEATURE NAME]
1
+ # Specification: [AGGREGATE]
2
2
 
3
- **Feature Branch**: `[###-feature-name]`
3
+ **Aggregate (feature)**: `[Aggregate]` <!-- the feature = the aggregate, e.g. Order -->
4
4
 
5
- **Created**: [DATE]
5
+ **Spec home**: `specs/[Aggregate]/`
6
+
7
+ **Version**: v1.0 <!-- living truth; every applied change request bumps this — see Change History -->
6
8
 
7
9
  **Status**: Draft
8
10
 
9
11
  **Input**: User description: "$ARGUMENTS"
10
12
 
11
- ## User Scenarios & Testing *(mandatory)*
13
+ <!--
14
+ AGGREGATE = FEATURE. This spec covers ONE aggregate (e.g. Order) and is the
15
+ single LIVING source of truth for its whole lifecycle. Every operation on it
16
+ (CreateOrder, UpdateOrder, …) is a USER STORY below — NOT a separate feature.
17
+ A later requirement is a new US-n added here as a delta (see .aw-spec/changes/
18
+ and delta-spec-template.md), never a new spec folder. One spec + one design.md
19
+ (specs/[Aggregate]/design.md) — the DESIGN derives from THIS document.
20
+
21
+ Section order is intentional: establish the business need and scope, then the
22
+ stable core the aggregate IS (requirements → rules → constraints → entities →
23
+ data classification → integration contracts → edge cases), then the prioritized
24
+ user journeys that exercise it, then measurable success.
25
+
26
+ DOMAIN LIFT (specify's job): three sections — Constraints & NFRs (CN-), Data
27
+ Classification (DC-), Integration Contracts (IC-) — are where specify LIFTS
28
+ domain-derived constraints out of the domain rule files into the spec. Design
29
+ authors architecture from the spec ONLY, so anything not captured here never
30
+ reaches design. Fill them when the domain applies; keep them (empty → "None")
31
+ otherwise.
32
+ -->
33
+
34
+ ## Business Need
12
35
 
13
36
  <!--
14
- IMPORTANT: User stories should be PRIORITIZED as user journeys ordered by importance.
15
- Each user story/journey must be INDEPENDENTLY TESTABLE - meaning if you implement just ONE of them,
16
- you should still have a viable MVP (Minimum Viable Product) that delivers value.
17
-
18
- Assign priorities (P1, P2, P3, etc.) to each story, where P1 is the most critical.
19
- Think of each story as a standalone slice of functionality that can be:
20
- - Developed independently
21
- - Tested independently
22
- - Deployed independently
23
- - Demonstrated to users independently
37
+ ACTION REQUIRED: Why this aggregate exists — the problem, the affected users,
38
+ and the value delivered. Business-facing; no implementation detail.
24
39
  -->
25
40
 
26
- ### User Story 1 - [Brief Title] (Priority: P1)
41
+ [The problem this aggregate solves, who it serves, and the value it delivers.]
27
42
 
28
- [Describe this user journey in plain language]
43
+ ## Scope & Assumptions
29
44
 
30
- **Why this priority**: [Explain the value and why it has this priority level]
45
+ ### Aggregate Boundary
31
46
 
32
- **Independent Test**: [Describe how this can be tested independently - e.g., "Can be fully tested by [specific action] and delivers [specific value]"]
47
+ <!--
48
+ The aggregate = the largest slice whose code no other feature owns. State what
49
+ it OWNS, what it only REFERENCES (by identifier, not owned), and what is out of
50
+ scope. This anchors the design's "dependencies point inward" and keeps commands
51
+ as deltas on THIS aggregate rather than new features.
52
+ -->
33
53
 
34
- **Acceptance Scenarios**:
54
+ - **Owns**: [entities/behaviour inside this aggregate — e.g. Order, OrderLine]
55
+ - **References (by id, not owned)**: [Customer, Product — read-only / by identifier]
56
+ - **Out of scope / non-goals**: [explicitly excluded — e.g. payment settlement, shipping]
35
57
 
36
- 1. **Given** [initial state], **When** [action], **Then** [expected outcome]
37
- 2. **Given** [initial state], **When** [action], **Then** [expected outcome]
58
+ ### Assumptions
38
59
 
39
- ---
60
+ <!--
61
+ Reasonable defaults chosen where the description was silent, plus dependencies
62
+ on existing systems/services.
63
+ -->
40
64
 
41
- ### User Story 2 - [Brief Title] (Priority: P2)
65
+ - [Assumption about target users, e.g., "Users have stable internet connectivity"]
66
+ - [Assumption about scope, e.g., "Mobile support is out of scope for v1"]
67
+ - [Dependency on an existing system/service, e.g., "Requires the existing user-profile API"]
42
68
 
43
- [Describe this user journey in plain language]
69
+ ## System Requirements *(mandatory)*
44
70
 
45
- **Why this priority**: [Explain the value and why it has this priority level]
71
+ <!--
72
+ Functional requirements in EARS notation (Easy Approach to Requirements Syntax):
73
+ atomic, testable, unambiguous. Choose the pattern that fits each requirement —
74
+
75
+ • Ubiquitous THE SYSTEM SHALL <requirement>
76
+ • Event-driven WHEN <trigger> THE SYSTEM SHALL <response>
77
+ • State-driven WHILE <in a state> THE SYSTEM SHALL <response>
78
+ • Unwanted IF <condition/error> THEN THE SYSTEM SHALL <response>
79
+ • Optional WHERE <feature is present> THE SYSTEM SHALL <response>
80
+
81
+ Give each a STABLE id (FR-001, …) — design sections and code trace to these ids.
82
+ Mark genuine unknowns "[NEEDS CLARIFICATION: <question>]" (≤3; scope/UX/security
83
+ only, and only where no reasonable default exists).
84
+ -->
46
85
 
47
- **Independent Test**: [Describe how this can be tested independently]
86
+ - **FR-001**: WHEN [a customer submits an order] THE SYSTEM SHALL [create it in Draft state].
87
+ - **FR-002**: THE SYSTEM SHALL [persist every order under a unique identifier].
88
+ - **FR-003**: IF [the order has no line items] THEN THE SYSTEM SHALL [reject the submission].
89
+ - **FR-004**: WHILE [an order is in Draft] THE SYSTEM SHALL [allow line items to be added or removed].
90
+ - **FR-005**: WHERE [tax calculation is enabled] THE SYSTEM SHALL [apply the regional tax rule].
48
91
 
49
- **Acceptance Scenarios**:
92
+ ## Business Rules *(invariants — always true, technology-agnostic)*
50
93
 
51
- 1. **Given** [initial state], **When** [action], **Then** [expected outcome]
94
+ <!--
95
+ ACTION REQUIRED: Constraints that must ALWAYS hold for the aggregate, independent
96
+ of any single operation. These become the design's §Domain invariants and must be
97
+ enforceable and testable. Give each a STABLE id (BR-001, …).
98
+ -->
52
99
 
53
- ---
100
+ - **BR-001**: [An order's total MUST never be negative.]
101
+ - **BR-002**: [A submitted order MUST always have at least one line item.]
102
+ - **BR-003**: [An order's identifier is immutable once created.]
54
103
 
55
- ### User Story 3 - [Brief Title] (Priority: P3)
104
+ ## Constraints & Non-Functional Requirements *(domain lift — CN)*
56
105
 
57
- [Describe this user journey in plain language]
106
+ <!--
107
+ ACTION REQUIRED (when the domain applies; else "None (as of vX.Y)"). Constraints the
108
+ aggregate MUST satisfy that are NEITHER functional behaviour (those are FR) NOR
109
+ always-true business invariants (those are BR): the regulatory, retention,
110
+ immutability, audit-mandate, and performance-as-a-limit rules. Many are LIFTED here
111
+ by specify from the domain rule files (e.g. persistence.domain, auditing.domain,
112
+ data-classification.domain) so they survive into design — which reads the spec ONLY.
113
+ Give each a STABLE id (CN-001, …); design's §5 Cross-Cutting and the analyze gate
114
+ trace to these ids. State each as testable; where lifted, cite the source rule.
115
+ -->
58
116
 
59
- **Why this priority**: [Explain the value and why it has this priority level]
117
+ - **CN-001**: [Retention — e.g. submitted orders + their audit trail are retained for [period] per [policy]; hard delete is forbidden once submitted (logical/retire only). — lifted from persistence.domain]
118
+ - **CN-002**: [Audit immutability — e.g. every create/modify/cancel emits an append-only audit entry (User, Timestamp, Action, Previous, New). — lifted from auditing.domain]
119
+ - **CN-003**: [Data integrity — e.g. records subject to [regime] satisfy [integrity standard].]
120
+ - **CN-004**: [Performance-as-a-limit — e.g. P95 read latency < 200 ms at 200 RPS; not a behaviour, a bound.]
60
121
 
61
- **Independent Test**: [Describe how this can be tested independently]
122
+ ## Key Entities *(the aggregate's conceptual model — no implementation detail)*
62
123
 
63
- **Acceptance Scenarios**:
124
+ <!--
125
+ The aggregate root and the entities/value objects inside its boundary: what each
126
+ represents, its key attributes, lifecycle/states, and relationships. Reference to
127
+ OTHER aggregates is by identifier only (see Aggregate Boundary).
128
+ -->
64
129
 
65
- 1. **Given** [initial state], **When** [action], **Then** [expected outcome]
130
+ - **[Aggregate root — e.g. Order]**: [what it represents; key attributes; lifecycle/states, e.g. Draft → Submitted → Fulfilled]
131
+ - **[Entity / value object — e.g. OrderLine]**: [what it represents; relationship to the root]
66
132
 
67
- ---
133
+ ## Data Classification *(domain lift — DC)*
68
134
 
69
- [Add more user stories as needed, each with an assigned priority]
135
+ <!--
136
+ ACTION REQUIRED (when the aggregate handles sensitive data; else "None (as of vX.Y)").
137
+ The sensitivity taxonomy for this aggregate's data and the exposure rules that follow:
138
+ which categories exist, which Key-Entity fields fall in each, and where each category
139
+ MAY / MUST NOT appear (public API surface, logs, metrics, traces, external projections).
140
+ Lifted by specify from the domain data-classification rules. Design enforces these; the
141
+ analyze-design / analyze-slice gates check them. Give each a STABLE id (DC-001, …); reference fields by
142
+ the names used in Key Entities.
143
+ -->
144
+
145
+ | id | Category | Applies to (fields / entities) | Exposure rule |
146
+ |---|---|---|---|
147
+ | DC-001 | [Public] | [id, status, non-sensitive attributes] | [may appear on the public API + external projections] |
148
+ | DC-002 | [Sensitive / restricted] | [PII, pre-release, commercially-sensitive fields] | [MUST NOT appear on the public surface, nor in logs / metrics / traces] |
149
+ | DC-003 | [Externally-sourced] | [imported fields] | [carries provenance; [handling rule]] |
150
+
151
+ ## Integration Contracts *(domain lift — IC)*
152
+
153
+ <!--
154
+ ACTION REQUIRED (when the aggregate interoperates; else "None (as of vX.Y)"). The
155
+ external contracts this aggregate MUST satisfy — interoperability obligations lifted by
156
+ specify from the domain interop rules (e.g. FHIR/HL7/DICOM projections, terminology
157
+ services, inbound feeds). State each at CONTRACT level: which standard, which resources,
158
+ direction (inbound/outbound), projection vs system-of-record — NOT the adapter design
159
+ (design realises these in its API / Infrastructure layers). Give each a STABLE id
160
+ (IC-001, …); design's §4.2 External Integrations traces to these ids.
161
+ -->
70
162
 
71
- ### Edge Cases
163
+ - **IC-001**: [Outbound projection — e.g. the aggregate SHALL project to [external standard / resources] as read-only projections (not the system of record); identifiers map to [external identifier]; coded fields to [coded type].]
164
+ - **IC-002**: [Reference-data validation — e.g. coded values SHALL validate against [terminology / reference service]; no invented codes.]
165
+ - **IC-003**: [Inbound feed — e.g. inbound [feed/standard] SHALL flow through an Interop adapter, never a direct write path to the aggregate.]
166
+
167
+ ## Edge Cases & Exceptional Scenarios
72
168
 
73
169
  <!--
74
- ACTION REQUIRED: The content in this section represents placeholders.
75
- Fill them out with the right edge cases.
170
+ ACTION REQUIRED: Boundary conditions, error paths, and concurrency/consistency
171
+ cases. Each should map to a System Requirement (often an IF…THEN unwanted-behaviour
172
+ requirement) or a Business Rule.
76
173
  -->
77
174
 
78
- - What happens when [boundary condition]?
79
- - How does system handle [error scenario]?
175
+ - What happens when [boundary condition, e.g., the same order is submitted twice]?
176
+ - How does the system handle [error scenario, e.g., a referenced product no longer exists]?
80
177
 
81
- ## Requirements *(mandatory)*
178
+ ## User Stories *(prioritized)*
82
179
 
83
180
  <!--
84
- ACTION REQUIRED: The content in this section represents placeholders.
85
- Fill them out with the right functional requirements.
181
+ Prioritized user journeys (P1 = most critical). Each MUST be INDEPENDENTLY
182
+ TESTABLE — implementing just one still yields a viable slice of value that can be
183
+ developed, tested, deployed, and demonstrated on its own.
184
+
185
+ Give each a STABLE id (US-1, US-2, …); design sections trace to these ids. Each
186
+ story exercises specific System Requirements / Business Rules — cite them so the
187
+ spine (US ↔ FR/BR ↔ design ↔ code) stays exact. On this living spec, note when a
188
+ story entered or changed: "Added: vX.Y (CR-…)" / "Modified: vX.Y (CR-…)".
86
189
  -->
87
190
 
88
- ### Functional Requirements
191
+ ### US-1 - [Brief Title] (Priority: P1) · _Added: v1.0_
192
+
193
+ [Describe this user journey in plain language.]
194
+
195
+ **Why this priority**: [The value and why it ranks here.]
196
+
197
+ **Exercises**: [FR-001, FR-003, BR-001]
198
+
199
+ **Acceptance Criteria**:
200
+
201
+ 1. **Given** [initial state], **When** [action], **Then** [expected outcome]
202
+ 2. **Given** [initial state], **When** [action], **Then** [expected outcome]
203
+
204
+ **Independent Test**: [How this story is verified on its own and the value it delivers.]
205
+
206
+ ---
207
+
208
+ ### US-2 - [Brief Title] (Priority: P2) · _Added: v1.0_
89
209
 
90
- - **FR-001**: System MUST [specific capability, e.g., "allow users to create accounts"]
91
- - **FR-002**: System MUST [specific capability, e.g., "validate email addresses"]
92
- - **FR-003**: Users MUST be able to [key interaction, e.g., "reset their password"]
93
- - **FR-004**: System MUST [data requirement, e.g., "persist user preferences"]
94
- - **FR-005**: System MUST [behavior, e.g., "log all security events"]
210
+ [Describe this user journey in plain language.]
95
211
 
96
- *Example of marking unclear requirements:*
212
+ **Why this priority**: [The value and why it ranks here.]
97
213
 
98
- - **FR-006**: System MUST authenticate users via [NEEDS CLARIFICATION: auth method not specified - email/password, SSO, OAuth?]
99
- - **FR-007**: System MUST retain user data for [NEEDS CLARIFICATION: retention period not specified]
214
+ **Exercises**: [FR-…, BR-…]
100
215
 
101
- ### Key Entities *(include if feature involves data)*
216
+ **Acceptance Criteria**:
102
217
 
103
- - **[Entity 1]**: [What it represents, key attributes without implementation]
104
- - **[Entity 2]**: [What it represents, relationships to other entities]
218
+ 1. **Given** [initial state], **When** [action], **Then** [expected outcome]
219
+
220
+ **Independent Test**: [How this story is verified on its own.]
221
+
222
+ ---
223
+
224
+ [Add more user stories as needed (US-3, US-4, …), each with a priority and a stable id.]
105
225
 
106
226
  ## Success Criteria *(mandatory)*
107
227
 
108
228
  <!--
109
- ACTION REQUIRED: Define measurable success criteria.
110
- These must be technology-agnostic and measurable.
229
+ ACTION REQUIRED: Measurable, technology-agnostic outcomes — verified at the
230
+ `analyze-slice` phase. Give each a STABLE id (SC-001, …).
111
231
  -->
112
232
 
113
233
  ### Measurable Outcomes
114
234
 
115
- - **SC-001**: [Measurable metric, e.g., "Users can complete account creation in under 2 minutes"]
116
- - **SC-002**: [Measurable metric, e.g., "System handles 1000 concurrent users without degradation"]
117
- - **SC-003**: [User satisfaction metric, e.g., "90% of users successfully complete primary task on first attempt"]
118
- - **SC-004**: [Business metric, e.g., "Reduce support tickets related to [X] by 50%"]
235
+ - **SC-001**: [Measurable metric, e.g., "A customer can place an order in under 2 minutes."]
236
+ - **SC-002**: [Measurable metric, e.g., "The system sustains 1000 concurrent orders without degradation."]
237
+ - **SC-003**: [User-satisfaction metric, e.g., "90% of first-time users complete an order without assistance."]
238
+ - **SC-004**: [Business metric, e.g., "Reduce order-related support tickets by 50%."]
119
239
 
120
- ## Assumptions
240
+ ## Change History
121
241
 
122
242
  <!--
123
- ACTION REQUIRED: The content in this section represents placeholders.
124
- Fill them out with the right assumptions based on reasonable defaults
125
- chosen when the feature description did not specify certain details.
243
+ The living-truth ledger. Every applied change request appends a row here, carrying
244
+ the version it ships as. finalize-delta writes the row when it merges the delta;
245
+ close-delta then archives the CR, bumps the minor version in active_version.json and
246
+ stamps that same number into this document's **Version** header — one mechanism, one
247
+ stage, so header, row and active_version.json never disagree. Newest last.
126
248
  -->
127
249
 
128
- - [Assumption about target users, e.g., "Users have stable internet connectivity"]
129
- - [Assumption about scope boundaries, e.g., "Mobile support is out of scope for v1"]
130
- - [Assumption about data/environment, e.g., "Existing authentication system will be reused"]
131
- - [Dependency on existing system/service, e.g., "Requires access to the existing user profile API"]
250
+ | Version | Date | Change | User stories | CR |
251
+ |---------|------|--------|--------------|-----|
252
+ | v1.0 | [DATE] | Initial specification | US-1 | — |
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "claude-code",
3
+ "sdk": {
4
+ "type": "claude-agent-sdk",
5
+ "package": "claude-agent-sdk",
6
+ "module": "claude_agent_sdk",
7
+ "adapter": "../.aw-spec/orchestrator/adapters/claude_agent_sdk.py"
8
+ },
9
+ "runtime": "Claude Code CLI (claude -p)",
10
+ "bin": "claude",
11
+ "args": ["-p", "--output-format", "json", "--no-session-persistence"],
12
+ "model_flag": "--model",
13
+ "system": { "flag": "--system-prompt" },
14
+ "user": { "mode": "stdin" },
15
+ "tools_flag": "--tools",
16
+ "approval": {
17
+ "acceptEdits": ["--permission-mode", "acceptEdits"],
18
+ "bypassPermissions": ["--permission-mode", "bypassPermissions"],
19
+ "default": ["--permission-mode", "default"]
20
+ },
21
+ "isolation": {
22
+ "bare": ["--bare"],
23
+ "fresh": ["--setting-sources", ""]
24
+ },
25
+ "budget_flag": "--max-budget-usd",
26
+ "result_keys": ["result"]
27
+ }
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: "aw-spec-orch"
3
+ description: "Parametric launcher (Claude Code): 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 claude 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:** `.claude/agent.json`
16
+
17
+ > Claude Code spawns via the `claude -p` CLI (native `--system-prompt`,
18
+ > `--tools`, and `--bare` isolation). Its `sdk` block declares the SDK the
19
+ > `sdk`/`sdk-apply` strategies import (`claude-agent-sdk`) and the adapter
20
+ > (`.aw-spec/orchestrator/adapters/claude_agent_sdk.py`, shared per-SDK)
21
+ > that owns its calling convention.
22
+
23
+ ## Execution Steps
24
+
25
+ 1. **Parse Arguments** (`<skill> [strategy] [input…]`):
26
+ - `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.
27
+ - `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>`.
28
+ - Everything after the strategy is the user input: pass it as `--input "<text>"` (omit when empty).
29
+ - `--agent-profile .claude/agent.json` is required for `spawn`, `sdk`, and `sdk-apply` (`agent` needs no profile). If the SDK package isn't installed, add `--sdk-install`.
30
+ - **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.
31
+ - `spawn` may also add `--isolation bare|fresh` and `--model <name>`; `sdk`/`sdk-apply` accept `--model <name>`.
32
+
33
+ 2. **Run the Interpreter**:
34
+ ```bash
35
+ python3 .aw-spec/orchestrator/orchestrator.py \
36
+ .aw-spec/orchestrator/workflows/aw-spec-<skill>.orch.yaml \
37
+ --strategy <strategy> \
38
+ --checkpoint .aw-spec/orchestrator/.state/<skill>.state.json \
39
+ [--agent-profile .claude/agent.json] # spawn, sdk, sdk-apply \
40
+ [--input "<user input>"] \
41
+ --json
42
+ ```
43
+
44
+ 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).
45
+ - **`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).
46
+ - **`select`** — ask the USER to pick ONE of `options`; write the chosen value as plain text to `response_path`.
47
+ - **`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`.
48
+ - **`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.
49
+ - **`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`.
50
+ - **`agent_query` / `agent_review`** — same as above but READ-ONLY (do not modify files); the reply must end with the required ```json fence.
51
+ - **`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`.
52
+ - If `pending.note` is present, your previous response was rejected — follow the note and rewrite `response_path`.
53
+
54
+ 4. **Report**:
55
+ 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 (Claude Code): 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 claude 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:** `.claude/agent.json`
16
+
17
+ > Claude Code spawns via the `claude -p` CLI (native `--system-prompt`,
18
+ > `--tools`, and `--bare` isolation). Its `sdk` block declares the SDK the
19
+ > `sdk`/`sdk-apply` strategies import (`claude-agent-sdk`) and the adapter
20
+ > (`.aw-spec/orchestrator/adapters/claude_agent_sdk.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 .claude/agent.json` is required for `spawn`, `sdk`, and `sdk-apply`:
29
+ `spawn` reads the CLI to launch 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` may also add `--isolation bare|fresh` and `--model <name>` (bare is
36
+ strongest; use it when `ANTHROPIC_API_KEY` is set). `sdk`/`sdk-apply` accept
37
+ `--model <name>`; isolation is intrinsic (fresh SDK session, no settings).
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 .claude/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,28 @@
1
+ {
2
+ "name": "kilocode",
3
+ "sdk": {
4
+ "type": "claude-agent-sdk",
5
+ "package": "claude-agent-sdk",
6
+ "module": "claude_agent_sdk",
7
+ "adapter": "../.aw-spec/orchestrator/adapters/claude_agent_sdk.py"
8
+ },
9
+ "runtime": "Kilo Code launches the interpreter; generation delegates to the Claude Code CLI",
10
+ "note": "Kilo Code is a VS Code extension with no standalone headless generation CLI, so this profile reuses `claude -p` for the fresh generation. To generate via Gemini instead, replace bin/args/system/user/tools_flag/approval with the .agents (antigravity) profile's values.",
11
+ "bin": "claude",
12
+ "args": ["-p", "--output-format", "json", "--no-session-persistence"],
13
+ "model_flag": "--model",
14
+ "system": { "flag": "--system-prompt" },
15
+ "user": { "mode": "stdin" },
16
+ "tools_flag": "--tools",
17
+ "approval": {
18
+ "acceptEdits": ["--permission-mode", "acceptEdits"],
19
+ "bypassPermissions": ["--permission-mode", "bypassPermissions"],
20
+ "default": ["--permission-mode", "default"]
21
+ },
22
+ "isolation": {
23
+ "bare": ["--bare"],
24
+ "fresh": ["--setting-sources", ""]
25
+ },
26
+ "budget_flag": "--max-budget-usd",
27
+ "result_keys": ["result"]
28
+ }
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: "aw-spec-orch-demo"
3
+ description: "Prototype launcher (Kilo Code): 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 claude 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:** `.kilocode/agent.json`
16
+
17
+ > Kilo Code has no native headless CLI, so it reuses `claude -p` for `spawn`
18
+ > (native `--system-prompt`, `--tools`, `--bare` isolation). Its `sdk` block
19
+ > declares the SDK the `sdk`/`sdk-apply` strategies import (`claude-agent-sdk`)
20
+ > and the adapter (`.aw-spec/orchestrator/adapters/claude_agent_sdk.py`,
21
+ > shared per-SDK) 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 .kilocode/agent.json` is required for `spawn`, `sdk`, and `sdk-apply`:
29
+ `spawn` reads the CLI to launch 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` may also add `--isolation bare|fresh` and `--model <name>` (bare is
36
+ strongest; use it when `ANTHROPIC_API_KEY` is set). `sdk`/`sdk-apply` accept
37
+ `--model <name>`; isolation is intrinsic (fresh SDK session, no settings).
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 .kilocode/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,55 @@
1
+ ---
2
+ name: "aw-spec-orch"
3
+ description: "Parametric launcher (Kilo Code): 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 claude 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:** `.kilocode/agent.json`
16
+
17
+ > Kilo Code has no native headless CLI, so it reuses `claude -p` for `spawn`
18
+ > (native `--system-prompt`, `--tools`, `--bare` isolation). Its `sdk` block
19
+ > declares the SDK the `sdk`/`sdk-apply` strategies import (`claude-agent-sdk`)
20
+ > and the adapter (`.aw-spec/orchestrator/adapters/claude_agent_sdk.py`,
21
+ > shared per-SDK) that owns its calling convention.
22
+
23
+ ## Execution Steps
24
+
25
+ 1. **Parse Arguments** (`<skill> [strategy] [input…]`):
26
+ - `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.
27
+ - `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>`.
28
+ - Everything after the strategy is the user input: pass it as `--input "<text>"` (omit when empty).
29
+ - `--agent-profile .kilocode/agent.json` is required for `spawn`, `sdk`, and `sdk-apply` (`agent` needs no profile). If the SDK package isn't installed, add `--sdk-install`.
30
+ - **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.
31
+ - `spawn` may also add `--isolation bare|fresh` and `--model <name>`; `sdk`/`sdk-apply` accept `--model <name>`.
32
+
33
+ 2. **Run the Interpreter**:
34
+ ```bash
35
+ python3 .aw-spec/orchestrator/orchestrator.py \
36
+ .aw-spec/orchestrator/workflows/aw-spec-<skill>.orch.yaml \
37
+ --strategy <strategy> \
38
+ --checkpoint .aw-spec/orchestrator/.state/<skill>.state.json \
39
+ [--agent-profile .kilocode/agent.json] # spawn, sdk, sdk-apply \
40
+ [--input "<user input>"] \
41
+ --json
42
+ ```
43
+
44
+ 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).
45
+ - **`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).
46
+ - **`select`** — ask the USER to pick ONE of `options`; write the chosen value as plain text to `response_path`.
47
+ - **`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`.
48
+ - **`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.
49
+ - **`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`.
50
+ - **`agent_query` / `agent_review`** — same as above but READ-ONLY (do not modify files); the reply must end with the required ```json fence.
51
+ - **`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`.
52
+ - If `pending.note` is present, your previous response was rejected — follow the note and rewrite `response_path`.
53
+
54
+ 4. **Report**:
55
+ 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.
@@ -1,6 +1,6 @@
1
1
  # Clean Architecture Standards
2
2
 
3
- > Pure technology (domain-agnostic). NON-NEGOTIABLE. Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
3
+ > Pure technology (domain-agnostic). NON-NEGOTIABLE. Commands: `/aw-spec-design`, `/aw-spec-build`.
4
4
 
5
5
  ## Dependency direction
6
6