aw-spec-cli 0.1.0 → 0.1.2

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 (173) hide show
  1. package/assets/.agents/skills/aw-spec-addcomponent/SKILL.md +129 -0
  2. package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +31 -0
  3. package/assets/.agents/skills/aw-spec-analyze/SKILL.md +296 -0
  4. package/assets/.agents/skills/aw-spec-checklist/SKILL.md +374 -0
  5. package/assets/.agents/skills/aw-spec-clarify/SKILL.md +320 -0
  6. package/assets/.agents/skills/aw-spec-constitution/SKILL.md +194 -0
  7. package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +268 -0
  8. package/assets/.agents/skills/aw-spec-foundation/SKILL.md +358 -0
  9. package/assets/.agents/skills/aw-spec-implement/SKILL.md +279 -0
  10. package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +209 -0
  11. package/assets/.agents/skills/aw-spec-plan/SKILL.md +221 -0
  12. package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +73 -0
  13. package/assets/.agents/skills/aw-spec-specify/SKILL.md +382 -0
  14. package/assets/.agents/skills/aw-spec-tasks/SKILL.md +259 -0
  15. package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +107 -0
  16. package/assets/.aw-spec/domain.json +3 -0
  17. package/assets/.aw-spec/extensions/.registry +19 -0
  18. package/assets/.aw-spec/extensions/agent-context/README.md +57 -0
  19. package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +4 -0
  20. package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +26 -0
  21. package/assets/.aw-spec/extensions/agent-context/extension.yml +34 -0
  22. package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +201 -0
  23. package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +237 -0
  24. package/assets/.aw-spec/extensions.yml +23 -0
  25. package/assets/.aw-spec/feature.json +3 -0
  26. package/assets/.aw-spec/init-options.json +9 -0
  27. package/assets/.aw-spec/integration.json +15 -0
  28. package/assets/.aw-spec/integrations/aw-spec.manifest.json +17 -0
  29. package/assets/.aw-spec/integrations/claude.manifest.json +17 -0
  30. package/assets/.aw-spec/memory/constitution.md +50 -0
  31. package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +189 -0
  32. package/assets/.aw-spec/scripts/bash/common.sh +582 -0
  33. package/assets/.aw-spec/scripts/bash/create-new-feature.sh +299 -0
  34. package/assets/.aw-spec/scripts/bash/setup-plan.sh +84 -0
  35. package/assets/.aw-spec/scripts/bash/setup-tasks.sh +91 -0
  36. package/assets/.aw-spec/templates/checklist-template.md +40 -0
  37. package/assets/.aw-spec/templates/constitution-template.md +57 -0
  38. package/assets/.aw-spec/templates/plan-template.md +113 -0
  39. package/assets/.aw-spec/templates/spec-template.md +131 -0
  40. package/assets/.aw-spec/templates/tasks-template.md +252 -0
  41. package/assets/.aw-spec/workflows/aw-spec/workflow.yml +77 -0
  42. package/assets/.aw-spec/workflows/workflow-registry.json +13 -0
  43. package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +129 -0
  44. package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +31 -0
  45. package/assets/.claude/skills/aw-spec-analyze/SKILL.md +296 -0
  46. package/assets/.claude/skills/aw-spec-checklist/SKILL.md +374 -0
  47. package/assets/.claude/skills/aw-spec-clarify/SKILL.md +320 -0
  48. package/assets/.claude/skills/aw-spec-constitution/SKILL.md +194 -0
  49. package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +268 -0
  50. package/assets/.claude/skills/aw-spec-foundation/SKILL.md +358 -0
  51. package/assets/.claude/skills/aw-spec-implement/SKILL.md +279 -0
  52. package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +209 -0
  53. package/assets/.claude/skills/aw-spec-plan/SKILL.md +221 -0
  54. package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +73 -0
  55. package/assets/.claude/skills/aw-spec-specify/SKILL.md +382 -0
  56. package/assets/.claude/skills/aw-spec-tasks/SKILL.md +259 -0
  57. package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +107 -0
  58. package/assets/.kilocode/rules/specify-rules.md +4 -0
  59. package/assets/.kilocode/workflows/aw-spec-addcomponent.md +129 -0
  60. package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +31 -0
  61. package/assets/.kilocode/workflows/aw-spec-analyze.md +296 -0
  62. package/assets/.kilocode/workflows/aw-spec-checklist.md +374 -0
  63. package/assets/.kilocode/workflows/aw-spec-clarify.md +320 -0
  64. package/assets/.kilocode/workflows/aw-spec-constitution.md +194 -0
  65. package/assets/.kilocode/workflows/aw-spec-fast-implement.md +263 -0
  66. package/assets/.kilocode/workflows/aw-spec-foundation.md +358 -0
  67. package/assets/.kilocode/workflows/aw-spec-implement.md +279 -0
  68. package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +204 -0
  69. package/assets/.kilocode/workflows/aw-spec-plan.md +221 -0
  70. package/assets/.kilocode/workflows/aw-spec-select-domain.md +73 -0
  71. package/assets/.kilocode/workflows/aw-spec-specify.md +382 -0
  72. package/assets/.kilocode/workflows/aw-spec-tasks.md +259 -0
  73. package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +107 -0
  74. package/assets/docs/README.md +106 -0
  75. package/assets/docs/VerticalSlice/PACKAGING.md +185 -0
  76. package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +2833 -0
  77. package/assets/docs/VerticalSlice/pack-foundation.ps1 +145 -0
  78. package/assets/docs/VerticalSlice/pack-foundation.sh +196 -0
  79. package/assets/docs/VerticalSlice/unpack-foundation.ps1 +126 -0
  80. package/assets/docs/VerticalSlice/unpack-foundation.sh +217 -0
  81. package/assets/docs/architecture/clean-architecture.md +71 -0
  82. package/assets/docs/architecture/cqrs.md +141 -0
  83. package/assets/docs/architecture/eventing.md +83 -0
  84. package/assets/docs/architecture/folder-structure.md +61 -0
  85. package/assets/docs/architecture/modular-monolith.md +47 -0
  86. package/assets/docs/architecture/persistence.md +269 -0
  87. package/assets/docs/architecture/testing.md +55 -0
  88. package/assets/docs/architecture/vertical-slices.md +201 -0
  89. package/assets/docs/command.txt +295 -0
  90. package/assets/docs/components/Email/README.md +112 -0
  91. package/assets/docs/components/Email/integration.md +260 -0
  92. package/assets/docs/components/Jobs/README.md +113 -0
  93. package/assets/docs/components/Jobs/integration.md +245 -0
  94. package/assets/docs/components/QrGenerator/README.md +78 -0
  95. package/assets/docs/components/QrGenerator/integration.md +185 -0
  96. package/assets/docs/components/README.md +57 -0
  97. package/assets/docs/domain/domain-driven-design.md +212 -0
  98. package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +34 -0
  99. package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +17 -0
  100. package/assets/docs/domainspecs/healthcare/auditing.domain.md +29 -0
  101. package/assets/docs/domainspecs/healthcare/authorization.domain.md +26 -0
  102. package/assets/docs/domainspecs/healthcare/clinical-terms.md +20 -0
  103. package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +26 -0
  104. package/assets/docs/domainspecs/healthcare/comandrulemap.md +119 -0
  105. package/assets/docs/domainspecs/healthcare/consent.md +19 -0
  106. package/assets/docs/domainspecs/healthcare/cqrs.domain.md +12 -0
  107. package/assets/docs/domainspecs/healthcare/data-classification.domain.md +28 -0
  108. package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +11 -0
  109. package/assets/docs/domainspecs/healthcare/dicom.md +15 -0
  110. package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +28 -0
  111. package/assets/docs/domainspecs/healthcare/domain-requirements.md +55 -0
  112. package/assets/docs/domainspecs/healthcare/eventing.domain.md +18 -0
  113. package/assets/docs/domainspecs/healthcare/fhir.md +36 -0
  114. package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +23 -0
  115. package/assets/docs/domainspecs/healthcare/hipaa.md +34 -0
  116. package/assets/docs/domainspecs/healthcare/hl7.md +15 -0
  117. package/assets/docs/domainspecs/healthcare/integration-terms.md +21 -0
  118. package/assets/docs/domainspecs/healthcare/persistence.domain.md +20 -0
  119. package/assets/docs/domainspecs/healthcare/terminology.md +30 -0
  120. package/assets/docs/domainspecs/healthcare/testing.domain.md +15 -0
  121. package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +18 -0
  122. package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +12 -0
  123. package/assets/docs/domainspecs/pharma/ai-rules.domain.md +32 -0
  124. package/assets/docs/domainspecs/pharma/api-versioning.domain.md +20 -0
  125. package/assets/docs/domainspecs/pharma/atc.md +22 -0
  126. package/assets/docs/domainspecs/pharma/auditing.domain.md +26 -0
  127. package/assets/docs/domainspecs/pharma/authorization.domain.md +25 -0
  128. package/assets/docs/domainspecs/pharma/coding-standards.domain.md +28 -0
  129. package/assets/docs/domainspecs/pharma/comandrulemap.md +136 -0
  130. package/assets/docs/domainspecs/pharma/cqrs.domain.md +16 -0
  131. package/assets/docs/domainspecs/pharma/data-classification.domain.md +24 -0
  132. package/assets/docs/domainspecs/pharma/data-provenance.md +21 -0
  133. package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +11 -0
  134. package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +36 -0
  135. package/assets/docs/domainspecs/pharma/domain-requirements.md +99 -0
  136. package/assets/docs/domainspecs/pharma/eventing.domain.md +18 -0
  137. package/assets/docs/domainspecs/pharma/fhir.md +31 -0
  138. package/assets/docs/domainspecs/pharma/folder-structure.domain.md +24 -0
  139. package/assets/docs/domainspecs/pharma/hl7.md +17 -0
  140. package/assets/docs/domainspecs/pharma/idmp.md +26 -0
  141. package/assets/docs/domainspecs/pharma/integration-terms.md +21 -0
  142. package/assets/docs/domainspecs/pharma/ndc.md +28 -0
  143. package/assets/docs/domainspecs/pharma/persistence.domain.md +23 -0
  144. package/assets/docs/domainspecs/pharma/pharma-terms.md +27 -0
  145. package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +30 -0
  146. package/assets/docs/domainspecs/pharma/regulatory-compliance.md +19 -0
  147. package/assets/docs/domainspecs/pharma/terminology.md +32 -0
  148. package/assets/docs/domainspecs/pharma/testing.domain.md +19 -0
  149. package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +17 -0
  150. package/assets/docs/domainspecs/pharma/zero-trust.domain.md +12 -0
  151. package/assets/docs/glossary/ai-rules.md +59 -0
  152. package/assets/docs/governance/api-versioning.md +99 -0
  153. package/assets/docs/governance/coding-standards.md +87 -0
  154. package/assets/docs/governance/dependency-policy.md +40 -0
  155. package/assets/docs/interop/ihe-conformance.md +31 -0
  156. package/assets/docs/pharma-constitution.my-ref.md +86 -0
  157. package/assets/docs/requirement-spec.txt +15 -0
  158. package/assets/docs/security/auditing.md +117 -0
  159. package/assets/docs/security/authorization-matrix.md +14 -0
  160. package/assets/docs/security/authorization.md +87 -0
  161. package/assets/docs/security/data-classification.md +38 -0
  162. package/assets/docs/security/zero-trust.md +76 -0
  163. package/assets/docs/technology-constitution.md +172 -0
  164. package/dist/commands/init.d.ts.map +1 -1
  165. package/dist/commands/init.js +3 -2
  166. package/dist/commands/init.js.map +1 -1
  167. package/dist/utils/copy-assets.d.ts +8 -1
  168. package/dist/utils/copy-assets.d.ts.map +1 -1
  169. package/dist/utils/copy-assets.js +1 -0
  170. package/dist/utils/copy-assets.js.map +1 -1
  171. package/dist/utils/paths.js +1 -1
  172. package/dist/utils/paths.js.map +1 -1
  173. package/package.json +1 -1
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: "aw-spec-plan"
3
+ description: "Execute the implementation planning workflow using the plan template to generate design artifacts."
4
+ argument-hint: "Optional guidance for the planning phase"
5
+ compatibility: "Requires aw-spec project structure with .aw-spec/ directory"
6
+ metadata:
7
+ author: "github-aw-spec"
8
+ source: "templates/commands/plan.md"
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ ---
12
+
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ You **MUST** consider the user input before proceeding (if not empty).
21
+
22
+ ## Context Reuse (cross-command dedup)
23
+
24
+ **Skip Read-ing any file already in this conversation.** Before loading a standards/domain/template/spec file this command names, check whether it is already in context (loaded earlier here or by a prior `/aw-spec-*` command). If present and unchanged, reuse it and **skip the Read** — only Read files not yet loaded. A file already in context still counts as loaded; this just avoids the redundant re-read.
25
+
26
+ ## Auto-Loaded Engineering Standards (Required Context)
27
+
28
+ **Before doing anything else in this command, load the project engineering-standards files listed below into context using the Read tool.** These were previously supplied manually as `@docs/...` mentions; they are now loaded automatically so the user does not need to pass them. Rules:
29
+
30
+ - Read each file below **before** starting the Pre-Execution Checks / Outline. Treat their contents as authoritative engineering standards for this command, second only to `.aw-spec/memory/constitution.md`.
31
+ - If a listed file does not exist, skip it silently and continue — do **not** error and do **not** ask the user to provide it.
32
+ - This is the **domain-agnostic technical** set, so the framework is reusable across domains. Domain-specific rule files (e.g. healthcare FHIR/HL7/PHI) are **not** part of this set — they are offered separately in the **Domain Rule-File Selection** section below (sourced from `comandrulemap.md`). You can also add any extra file directly with an `@` mention.
33
+
34
+ Standards for `/aw-spec-plan`:
35
+ - docs/architecture/clean-architecture.md
36
+ - docs/architecture/modular-monolith.md
37
+ - docs/architecture/folder-structure.md
38
+ - docs/architecture/cqrs.md
39
+ - docs/architecture/vertical-slices.md
40
+ - docs/architecture/persistence.md
41
+ - docs/architecture/testing.md
42
+ - docs/architecture/eventing.md
43
+ - docs/domain/domain-driven-design.md
44
+ - docs/security/zero-trust.md
45
+ - docs/security/authorization.md
46
+ - docs/security/auditing.md
47
+ - docs/security/data-classification.md
48
+ - docs/governance/coding-standards.md
49
+ - docs/governance/dependency-policy.md
50
+ - docs/governance/api-versioning.md
51
+ - docs/glossary/ai-rules.md
52
+
53
+ ## Domain Rule-File Selection (interactive)
54
+
55
+ After the technical standards above are loaded, and **before** the Pre-Execution Checks, resolve the active domain and ask the user which **domain** rule files to load for this command:
56
+
57
+ 1. **Resolve the active domain.** Read `.aw-spec/domain.json` and take its `domain` value — the active domain-specs folder name. The candidate domain rule files are the bullet list under the `## /aw-spec-plan` heading in `docs/domainspecs/<domain>/comandrulemap.md`.
58
+ 2. **Domain gate (missing domain or rules).** If `.aw-spec/domain.json` is absent or its `domain` is empty, **or** `docs/domainspecs/<domain>/comandrulemap.md` does not exist:
59
+ - Ask one single-select question with the AskUserQuestion tool — *"Domain is not set or its rule files are missing (state which: no domain set / domain '<domain>' has no comandrulemap.md). Continue without domain rules?"* — with options **"Continue (technical only)"** and **"Exit"**.
60
+ - **Continue (technical only)** → skip steps 3-5 and proceed with only the auto-loaded technical standards (plus any `@`-mentioned files).
61
+ - **Exit** → stop the command **immediately** with no side effects: do **not** run the Pre-Execution Checks, hooks, Outline, or any later step, and create/modify nothing. Tell the user to run `/aw-spec-select-domain` (or fix the domain folder) and re-run.
62
+ - If interactive questions cannot be asked (non-interactive/automated run), default to **Continue (technical only)**.
63
+ - Exception: if `comandrulemap.md` exists but has **no entries under this command's heading**, this is **not** a gate trigger — load no domain files for this command and continue normally to the Pre-Execution Checks.
64
+ 3. **Show a selection box** using the AskUserQuestion tool:
65
+ - Ask one single-select question — *"Domain rule files for /aw-spec-plan:"* — with options **"Select all (recommended)"**, **"Pick a subset"**, and **"None (technical only)"**.
66
+ - If the user chooses **"Pick a subset"**, follow up with **multi-select** questions whose options are the individual candidate files so the user can tick the ones they want. AskUserQuestion allows ≤4 options per question and ≤4 questions per call, so split the candidates into groups of ≤4 (by category: architecture overlays, clinical domain, security overlays, governance overlays, glossary) across as many calls as needed.
67
+ - If interactive questions cannot be asked (non-interactive or automated run), skip the prompt and default to **Select all**.
68
+ 4. **Load the selection.** Read every file the user selected (the full list for "Select all"; nothing extra for "None"). If any selected file does not exist on disk, skip it silently and continue — do not error.
69
+ 5. **Final context set** = the always-loaded technical standards (section above) **+** the domain files selected here **+** any files the user passed via `@` mention in their command. The `@`-mentioned files are always loaded in addition, whether or not they appear in the candidate list, and are never removed by a "None"/subset choice.
70
+ 6. Proceed to the Pre-Execution Checks only after the selected files are loaded.
71
+
72
+ ## Pre-Execution Checks
73
+
74
+ **Check for extension hooks (before planning)**:
75
+ - Check if `.aw-spec/extensions.yml` exists in the project root.
76
+ - If it exists, read it and look for entries under the `hooks.before_plan` key
77
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
78
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
79
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
80
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
81
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
82
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `aw-spec.git.commit` → `/aw-spec-git-commit`.
83
+ - For each executable hook, output the following based on its `optional` flag:
84
+ - **Optional hook** (`optional: true`):
85
+ ```
86
+ ## Extension Hooks
87
+
88
+ **Optional Pre-Hook**: {extension}
89
+ Command: `/{command}`
90
+ Description: {description}
91
+
92
+ Prompt: {prompt}
93
+ To execute: `/{command}`
94
+ ```
95
+ - **Mandatory hook** (`optional: false`):
96
+ ```
97
+ ## Extension Hooks
98
+
99
+ **Automatic Pre-Hook**: {extension}
100
+ Executing: `/{command}`
101
+ EXECUTE_COMMAND: {command}
102
+
103
+ Wait for the result of the hook command before proceeding to the Outline.
104
+ ```
105
+ - If no hooks are registered or `.aw-spec/extensions.yml` does not exist, skip silently
106
+
107
+ ## Outline
108
+
109
+ 1. **Setup**: Run `.aw-spec/scripts/bash/setup-plan.sh --json` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
110
+
111
+ 2. **Load context**: Read FEATURE_SPEC and `.aw-spec/memory/constitution.md`. Load IMPL_PLAN template (already copied).
112
+
113
+ 3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:
114
+ - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
115
+ - Fill Constitution Check section from constitution
116
+ - Evaluate gates (ERROR if violations unjustified)
117
+ - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
118
+ - Phase 1: Generate data-model.md, contracts/, quickstart.md
119
+ - Phase 1: Update agent context by running the agent script
120
+ - Re-evaluate Constitution Check post-design
121
+
122
+ ## Mandatory Post-Execution Hooks
123
+
124
+ **You MUST complete this section before reporting completion to the user.**
125
+
126
+ Check if `.aw-spec/extensions.yml` exists in the project root.
127
+ - If it does not exist, or no hooks are registered under `hooks.after_plan`, skip to the Completion Report.
128
+ - If it exists, read it and look for entries under the `hooks.after_plan` key.
129
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue to the Completion Report.
130
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
131
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
132
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
133
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
134
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `aw-spec.git.commit` → `/aw-spec-git-commit`.
135
+ - For each executable hook, output the following based on its `optional` flag:
136
+ - **Mandatory hook** (`optional: false`) — **You MUST emit `EXECUTE_COMMAND:` for each mandatory hook**:
137
+ ```
138
+ ## Extension Hooks
139
+
140
+ **Automatic Hook**: {extension}
141
+ Executing: `/{command}`
142
+ EXECUTE_COMMAND: {command}
143
+ ```
144
+ - **Optional hook** (`optional: true`):
145
+ ```
146
+ ## Extension Hooks
147
+
148
+ **Optional Hook**: {extension}
149
+ Command: `/{command}`
150
+ Description: {description}
151
+
152
+ Prompt: {prompt}
153
+ To execute: `/{command}`
154
+ ```
155
+
156
+ ## Completion Report
157
+
158
+ Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
159
+
160
+ ## Phases
161
+
162
+ ### Phase 0: Outline & Research
163
+
164
+ 1. **Extract unknowns from Technical Context** above:
165
+ - For each NEEDS CLARIFICATION → research task
166
+ - For each dependency → best practices task
167
+ - For each integration → patterns task
168
+
169
+ 2. **Generate and dispatch research agents**:
170
+
171
+ ```text
172
+ For each unknown in Technical Context:
173
+ Task: "Research {unknown} for {feature context}"
174
+ For each technology choice:
175
+ Task: "Find best practices for {tech} in {domain}"
176
+ ```
177
+
178
+ 3. **Consolidate findings** in `research.md` using format:
179
+ - Decision: [what was chosen]
180
+ - Rationale: [why chosen]
181
+ - Alternatives considered: [what else evaluated]
182
+
183
+ **Output**: research.md with all NEEDS CLARIFICATION resolved
184
+
185
+ ### Phase 1: Design & Contracts
186
+
187
+ **Prerequisites:** `research.md` complete
188
+
189
+ 1. **Extract entities from feature spec** → `data-model.md`:
190
+ - Entity name, fields, relationships
191
+ - Validation rules from requirements
192
+ - State transitions if applicable
193
+
194
+ 2. **Define interface contracts** (if project has external interfaces) → `/contracts/`:
195
+ - Identify what interfaces the project exposes to users or other systems
196
+ - Document the contract format appropriate for the project type
197
+ - Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications
198
+ - Skip if project is purely internal (build scripts, one-off tools, etc.)
199
+
200
+ 3. **Create quickstart validation guide** → `quickstart.md`:
201
+ - Document runnable validation scenarios that prove the feature works end-to-end
202
+ - Include prerequisites, setup commands, test/run commands, and expected outcomes
203
+ - Use links or references to contracts and data model details instead of duplicating them
204
+ - Do not include full implementation code, model/service/controller bodies, migrations, or complete test suites
205
+ - Keep this artifact as a validation/run guide; implementation details belong in `tasks.md` and the implementation phase
206
+
207
+ 4. **Agent context update**:
208
+ - Update the plan reference between the `<!-- AW-SPEC START -->` and `<!-- AW-SPEC END -->` markers in `CLAUDE.md` to point to the plan file created in step 1 (the IMPL_PLAN path)
209
+
210
+ **Output**: data-model.md, /contracts/*, quickstart.md, updated agent context file
211
+
212
+ ## Key rules
213
+
214
+ - Use absolute paths for filesystem operations; use project-relative paths for references in documentation and agent context files
215
+ - ERROR on gate failures or unresolved clarifications
216
+
217
+ ## Done When
218
+
219
+ - [ ] Plan workflow executed and design artifacts generated
220
+ - [ ] Extension hooks dispatched or skipped according to the rules in Mandatory Post-Execution Hooks above
221
+ - [ ] Completion reported to user with branch, plan path, and generated artifacts
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: "aw-spec-select-domain"
3
+ description: "Select the active domain-specs folder and store it in .aw-spec/domain.json, so all AW-Spec commands load the right domain rule files."
4
+ argument-hint: "Optional domain folder name to set directly (e.g. healthcare)"
5
+ compatibility: "Requires aw-spec project structure with .aw-spec/ and docs/domainspecs/ directories"
6
+ metadata:
7
+ author: "github-aw-spec"
8
+ source: "local"
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ ---
12
+
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ The text the user typed after `/aw-spec-select-domain` (if any) is an optional domain folder name to set directly.
21
+
22
+ ## Purpose
23
+
24
+ Set the **active domain** for this project. The active domain is the name of a folder under
25
+ `docs/domainspecs/`. It is stored in `.aw-spec/domain.json` as `{ "domain": "<folder-name>" }`,
26
+ and every `/aw-spec-*` command resolves `docs/domainspecs/<domain>/comandrulemap.md` from it to
27
+ offer that domain's rule files.
28
+
29
+ ## Outline
30
+
31
+ 1. **Discover candidate domains.** List the immediate **subdirectories** of `docs/domainspecs/`
32
+ (directories only — ignore loose files). This is the set of selectable domains.
33
+ - If `docs/domainspecs/` does not exist or has **no** subdirectories, report that no domains
34
+ are available, instruct the user to create `docs/domainspecs/<name>/` containing a
35
+ `comandrulemap.md` (laid out like the healthcare one), and **stop** without writing anything.
36
+
37
+ 2. **Direct argument (optional).** If the user passed an argument:
38
+ - If it exactly matches one of the discovered folder names, treat that as the chosen domain and
39
+ skip to step 4.
40
+ - If it does not match any folder, note the mismatch, list the available names, and fall through
41
+ to the interactive selection in step 3.
42
+
43
+ 3. **Interactive selection.** Present the candidate domains with the AskUserQuestion tool:
44
+ - If **2–4** domains exist: a single single-select question listing them.
45
+ - If **more than 4** domains exist: split across multiple questions/calls (AskUserQuestion
46
+ allows ≤4 options per question and ≤4 questions per call).
47
+ - If **exactly one** domain exists: ask a confirmation — *"Set active domain to '<name>'?"* with
48
+ options **"Set '<name>'"** and **"Cancel"**.
49
+ - If the user cancels (or interactive questions cannot be asked and no valid argument was given),
50
+ **stop** without writing anything.
51
+
52
+ 4. **Validate the choice.** Check whether `docs/domainspecs/<chosen>/comandrulemap.md` exists.
53
+ - If it is missing, warn the user that domain rules will not load until that file is added, but
54
+ still allow setting the domain (it is the developer's choice).
55
+
56
+ 5. **Write `.aw-spec/domain.json`.** Write (creating or overwriting) `.aw-spec/domain.json` with:
57
+ ```json
58
+ {
59
+ "domain": "<chosen folder name>"
60
+ }
61
+ ```
62
+ Store the **folder name only**, not a path.
63
+
64
+ 6. **Confirm.** Report to the user:
65
+ - the active domain now set,
66
+ - the resolved map path `docs/domainspecs/<chosen>/comandrulemap.md` and whether it exists,
67
+ - that subsequent `/aw-spec-*` commands will offer this domain's rule files.
68
+
69
+ ## Done When
70
+
71
+ - [ ] `.aw-spec/domain.json` written with the chosen domain folder name (or nothing written if the
72
+ user cancelled / no domains available).
73
+ - [ ] The active domain and resolved `comandrulemap.md` path reported to the user.