@ncoderz/awa 1.7.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/LICENSE +23 -16
  2. package/README.md +25 -27
  3. package/dist/{chunk-OQZTQ5ZI.js → chunk-LRQWZCYL.js} +1 -4
  4. package/dist/chunk-LRQWZCYL.js.map +1 -0
  5. package/dist/chunk-WGGMDWBE.js +760 -0
  6. package/dist/chunk-WGGMDWBE.js.map +1 -0
  7. package/dist/{config-WL3SLSP6.js → config-EJIXC7D7.js} +2 -2
  8. package/dist/index.js +1252 -452
  9. package/dist/index.js.map +1 -1
  10. package/dist/renumber-ZCI2H5HZ.js +9 -0
  11. package/dist/renumber-ZCI2H5HZ.js.map +1 -0
  12. package/package.json +13 -6
  13. package/templates/awa/.agent/skills/spec-merge/SKILL.md +3 -0
  14. package/templates/awa/.agent/skills/spec-tidy/SKILL.md +3 -0
  15. package/templates/awa/.agent/workflows/spec-merge.md +3 -0
  16. package/templates/awa/.agent/workflows/spec-tidy.md +3 -0
  17. package/templates/awa/.agents/skills/spec-merge/SKILL.md +3 -0
  18. package/templates/awa/.agents/skills/spec-tidy/SKILL.md +3 -0
  19. package/templates/awa/.awa/.agent/schemas/ALIGN_REPORT.schema.yaml +1 -1
  20. package/templates/awa/.awa/.agent/schemas/API.schema.yaml +1 -1
  21. package/templates/awa/.awa/.agent/schemas/ARCHITECTURE.schema.yaml +7 -0
  22. package/templates/awa/.awa/.agent/schemas/DESIGN.schema.yaml +1 -1
  23. package/templates/awa/.awa/.agent/schemas/{EXAMPLES.schema.yaml → EXAMPLE.schema.yaml} +4 -4
  24. package/templates/awa/.awa/.agent/schemas/FEAT.schema.yaml +8 -1
  25. package/templates/awa/.awa/.agent/schemas/PLAN.schema.yaml +1 -1
  26. package/templates/awa/.awa/.agent/schemas/README.schema.yaml +1 -1
  27. package/templates/awa/.awa/.agent/schemas/REQ.schema.yaml +1 -1
  28. package/templates/awa/.awa/.agent/schemas/TASK.schema.yaml +1 -1
  29. package/templates/awa/.claude/skills/spec-merge/SKILL.md +3 -0
  30. package/templates/awa/.claude/skills/spec-tidy/SKILL.md +3 -0
  31. package/templates/awa/.gemini/commands/spec-merge.md +3 -0
  32. package/templates/awa/.gemini/commands/spec-tidy.md +3 -0
  33. package/templates/awa/.gemini/skills/spec-merge/SKILL.md +3 -0
  34. package/templates/awa/.gemini/skills/spec-tidy/SKILL.md +3 -0
  35. package/templates/awa/.github/prompts/awa.spec-merge.prompt.md +8 -0
  36. package/templates/awa/.github/prompts/awa.spec-tidy.prompt.md +7 -0
  37. package/templates/awa/.github/skills/spec-merge/SKILL.md +3 -0
  38. package/templates/awa/.github/skills/spec-tidy/SKILL.md +3 -0
  39. package/templates/awa/.kilocode/skills/spec-merge/SKILL.md +3 -0
  40. package/templates/awa/.kilocode/skills/spec-tidy/SKILL.md +3 -0
  41. package/templates/awa/.kilocode/workflows/spec-merge.md +3 -0
  42. package/templates/awa/.kilocode/workflows/spec-tidy.md +3 -0
  43. package/templates/awa/.opencode/commands/spec-merge.md +3 -0
  44. package/templates/awa/.opencode/commands/spec-tidy.md +3 -0
  45. package/templates/awa/.opencode/skills/spec-merge/SKILL.md +3 -0
  46. package/templates/awa/.opencode/skills/spec-tidy/SKILL.md +3 -0
  47. package/templates/awa/.qwen/commands/spec-merge.md +3 -0
  48. package/templates/awa/.qwen/commands/spec-tidy.md +3 -0
  49. package/templates/awa/.qwen/skills/spec-merge/SKILL.md +3 -0
  50. package/templates/awa/.qwen/skills/spec-tidy/SKILL.md +3 -0
  51. package/templates/awa/.roo/skills/spec-merge/SKILL.md +3 -0
  52. package/templates/awa/.roo/skills/spec-tidy/SKILL.md +3 -0
  53. package/templates/awa/.windsurf/skills/spec-merge/SKILL.md +3 -0
  54. package/templates/awa/.windsurf/skills/spec-tidy/SKILL.md +3 -0
  55. package/templates/awa/_delete.txt +4 -0
  56. package/templates/awa/_partials/_cmd.spec-merge.md +6 -0
  57. package/templates/awa/_partials/_cmd.spec-tidy.md +5 -0
  58. package/templates/awa/_partials/_skill.spec-merge.md +6 -0
  59. package/templates/awa/_partials/_skill.spec-tidy.md +6 -0
  60. package/templates/awa/_partials/awa.align.md +1 -1
  61. package/templates/awa/_partials/awa.brainstorm.md +1 -1
  62. package/templates/awa/_partials/awa.code.md +1 -1
  63. package/templates/awa/_partials/awa.core.md +8 -4
  64. package/templates/awa/_partials/awa.design.md +3 -2
  65. package/templates/awa/_partials/awa.documentation.md +1 -1
  66. package/templates/awa/_partials/awa.examples.md +4 -4
  67. package/templates/awa/_partials/awa.feature.md +2 -1
  68. package/templates/awa/_partials/awa.plan.md +2 -2
  69. package/templates/awa/_partials/awa.requirements.md +4 -2
  70. package/templates/awa/_partials/awa.spec-merge.md +97 -0
  71. package/templates/awa/_partials/awa.spec.tidy.md +92 -0
  72. package/templates/awa/_partials/awa.tasks.md +1 -1
  73. package/templates/awa/_partials/awa.upgrade.md +3 -3
  74. package/templates/awa/_partials/awa.usage.md +74 -6
  75. package/templates/awa/_partials/awa.vibe.md +1 -1
  76. package/templates/awa/_tests/claude/.awa/.agent/awa.core.md +126 -0
  77. package/templates/awa/_tests/claude/.awa/.agent/schemas/ALIGN_REPORT.schema.yaml +83 -0
  78. package/templates/awa/_tests/claude/.awa/.agent/schemas/API.schema.yaml +7 -0
  79. package/templates/awa/_tests/claude/.awa/.agent/schemas/ARCHITECTURE.schema.yaml +257 -0
  80. package/templates/awa/_tests/claude/.awa/.agent/schemas/DESIGN.schema.yaml +351 -0
  81. package/templates/awa/_tests/claude/.awa/.agent/schemas/EXAMPLE.schema.yaml +89 -0
  82. package/templates/awa/_tests/claude/.awa/.agent/schemas/FEAT.schema.yaml +142 -0
  83. package/templates/awa/_tests/claude/.awa/.agent/schemas/PLAN.schema.yaml +146 -0
  84. package/templates/awa/_tests/claude/.awa/.agent/schemas/README.schema.yaml +137 -0
  85. package/templates/awa/_tests/claude/.awa/.agent/schemas/REQ.schema.yaml +160 -0
  86. package/templates/awa/_tests/claude/.awa/.agent/schemas/TASK.schema.yaml +204 -0
  87. package/templates/awa/_tests/claude/.claude/agents/awa.md +137 -0
  88. package/templates/awa/_tests/claude/.claude/skills/awa-align/SKILL.md +67 -0
  89. package/templates/awa/_tests/claude/.claude/skills/awa-architecture/SKILL.md +50 -0
  90. package/templates/awa/_tests/claude/.claude/skills/awa-brainstorm/SKILL.md +57 -0
  91. package/templates/awa/_tests/claude/.claude/skills/awa-check/SKILL.md +79 -0
  92. package/templates/awa/_tests/claude/.claude/skills/awa-code/SKILL.md +179 -0
  93. package/templates/awa/_tests/claude/.claude/skills/awa-design/SKILL.md +62 -0
  94. package/templates/awa/_tests/claude/.claude/skills/awa-documentation/SKILL.md +91 -0
  95. package/templates/awa/_tests/claude/.claude/skills/awa-examples/SKILL.md +58 -0
  96. package/templates/awa/_tests/claude/.claude/skills/awa-feature/SKILL.md +56 -0
  97. package/templates/awa/_tests/claude/.claude/skills/awa-plan/SKILL.md +53 -0
  98. package/templates/awa/_tests/claude/.claude/skills/awa-refactor/SKILL.md +53 -0
  99. package/templates/awa/_tests/claude/.claude/skills/awa-requirements/SKILL.md +58 -0
  100. package/templates/awa/_tests/claude/.claude/skills/awa-tasks/SKILL.md +158 -0
  101. package/templates/awa/_tests/claude/.claude/skills/awa-upgrade/SKILL.md +68 -0
  102. package/templates/awa/_tests/claude/.claude/skills/awa-usage/SKILL.md +368 -0
  103. package/templates/awa/_tests/claude/.claude/skills/awa-vibe/SKILL.md +72 -0
  104. package/templates/awa/_tests/claude/.claude/skills/spec-merge/SKILL.md +102 -0
  105. package/templates/awa/_tests/claude/.claude/skills/spec-tidy/SKILL.md +97 -0
  106. package/templates/awa/_tests/claude/CLAUDE.md +132 -0
  107. package/templates/awa/_tests/copilot/.awa/.agent/awa.core.md +126 -0
  108. package/templates/awa/_tests/copilot/.awa/.agent/schemas/ALIGN_REPORT.schema.yaml +83 -0
  109. package/templates/awa/_tests/copilot/.awa/.agent/schemas/API.schema.yaml +7 -0
  110. package/templates/awa/_tests/copilot/.awa/.agent/schemas/ARCHITECTURE.schema.yaml +257 -0
  111. package/templates/awa/_tests/copilot/.awa/.agent/schemas/DESIGN.schema.yaml +351 -0
  112. package/templates/awa/_tests/copilot/.awa/.agent/schemas/EXAMPLE.schema.yaml +89 -0
  113. package/templates/awa/_tests/copilot/.awa/.agent/schemas/FEAT.schema.yaml +142 -0
  114. package/templates/awa/_tests/copilot/.awa/.agent/schemas/PLAN.schema.yaml +146 -0
  115. package/templates/awa/_tests/copilot/.awa/.agent/schemas/README.schema.yaml +137 -0
  116. package/templates/awa/_tests/copilot/.awa/.agent/schemas/REQ.schema.yaml +160 -0
  117. package/templates/awa/_tests/copilot/.awa/.agent/schemas/TASK.schema.yaml +204 -0
  118. package/templates/awa/_tests/copilot/.github/agents/awa.agent.md +137 -0
  119. package/templates/awa/_tests/copilot/.github/prompts/awa.align.prompt.md +67 -0
  120. package/templates/awa/_tests/copilot/.github/prompts/awa.architecture.prompt.md +50 -0
  121. package/templates/awa/_tests/copilot/.github/prompts/awa.brainstorm.prompt.md +57 -0
  122. package/templates/awa/_tests/copilot/.github/prompts/awa.check.prompt.md +79 -0
  123. package/templates/awa/_tests/copilot/.github/prompts/awa.code.prompt.md +179 -0
  124. package/templates/awa/_tests/copilot/.github/prompts/awa.design.prompt.md +62 -0
  125. package/templates/awa/_tests/copilot/.github/prompts/awa.documentation.prompt.md +91 -0
  126. package/templates/awa/_tests/copilot/.github/prompts/awa.examples.prompt.md +58 -0
  127. package/templates/awa/_tests/copilot/.github/prompts/awa.feature.prompt.md +56 -0
  128. package/templates/awa/_tests/copilot/.github/prompts/awa.plan.prompt.md +53 -0
  129. package/templates/awa/_tests/copilot/.github/prompts/awa.refactor.prompt.md +53 -0
  130. package/templates/awa/_tests/copilot/.github/prompts/awa.requirements.prompt.md +58 -0
  131. package/templates/awa/_tests/copilot/.github/prompts/awa.spec-merge.prompt.md +102 -0
  132. package/templates/awa/_tests/copilot/.github/prompts/awa.spec-tidy.prompt.md +96 -0
  133. package/templates/awa/_tests/copilot/.github/prompts/awa.tasks.prompt.md +158 -0
  134. package/templates/awa/_tests/copilot/.github/prompts/awa.upgrade.prompt.md +68 -0
  135. package/templates/awa/_tests/copilot/.github/prompts/awa.vibe.prompt.md +72 -0
  136. package/templates/awa/_tests/copilot/.github/skills/awa-align/SKILL.md +67 -0
  137. package/templates/awa/_tests/copilot/.github/skills/awa-architecture/SKILL.md +50 -0
  138. package/templates/awa/_tests/copilot/.github/skills/awa-brainstorm/SKILL.md +57 -0
  139. package/templates/awa/_tests/copilot/.github/skills/awa-check/SKILL.md +79 -0
  140. package/templates/awa/_tests/copilot/.github/skills/awa-code/SKILL.md +179 -0
  141. package/templates/awa/_tests/copilot/.github/skills/awa-design/SKILL.md +62 -0
  142. package/templates/awa/_tests/copilot/.github/skills/awa-documentation/SKILL.md +91 -0
  143. package/templates/awa/_tests/copilot/.github/skills/awa-examples/SKILL.md +58 -0
  144. package/templates/awa/_tests/copilot/.github/skills/awa-feature/SKILL.md +56 -0
  145. package/templates/awa/_tests/copilot/.github/skills/awa-plan/SKILL.md +53 -0
  146. package/templates/awa/_tests/copilot/.github/skills/awa-refactor/SKILL.md +53 -0
  147. package/templates/awa/_tests/copilot/.github/skills/awa-requirements/SKILL.md +58 -0
  148. package/templates/awa/_tests/copilot/.github/skills/awa-tasks/SKILL.md +158 -0
  149. package/templates/awa/_tests/copilot/.github/skills/awa-upgrade/SKILL.md +68 -0
  150. package/templates/awa/_tests/copilot/.github/skills/awa-usage/SKILL.md +368 -0
  151. package/templates/awa/_tests/copilot/.github/skills/awa-vibe/SKILL.md +72 -0
  152. package/templates/awa/_tests/copilot/.github/skills/spec-merge/SKILL.md +102 -0
  153. package/templates/awa/_tests/copilot/.github/skills/spec-tidy/SKILL.md +97 -0
  154. package/dist/chunk-OQZTQ5ZI.js.map +0 -1
  155. /package/dist/{config-WL3SLSP6.js.map → config-EJIXC7D7.js.map} +0 -0
@@ -0,0 +1,257 @@
1
+ # Structural rules for ARCHITECTURE.md
2
+ target-files: ".awa/specs/ARCHITECTURE.md"
3
+ description: >
4
+ High-level architecture overview for the project. Succinct language.
5
+ Do not overspecify or include implementation details. Covers project purpose,
6
+ system layers, technology stack, top-level architecture diagram, directory structure,
7
+ component details with RESPONSIBILITIES, interactions, rules, and
8
+ developer commands. Delegate to feature and design files where appropriate.
9
+ One file per project.
10
+ line-limit: 800
11
+
12
+ sections:
13
+ # Top-level heading
14
+ - heading: "Architecture"
15
+ level: 1
16
+ required: true
17
+ description: "Document title. No metadata in this section."
18
+
19
+ # Project Purpose section
20
+ - heading: "Project Purpose"
21
+ level: 2
22
+ required: true
23
+ description: >
24
+ Single paragraph: core problem and primary functionality.
25
+ What the project does and why it exists.
26
+
27
+ # System Overview section
28
+ - heading: "System Overview"
29
+ level: 2
30
+ required: true
31
+ description: >
32
+ Bullet list of software layers or subsystems (e.g., CLI Layer,
33
+ Core Engine, Template System, I/O Layer).
34
+
35
+ # Feature Codes section (auto-generated by awa check)
36
+ - heading: "Feature Codes"
37
+ level: 2
38
+ description: >
39
+ Auto-generated table of feature codes, feature names, and scope boundaries.
40
+ Managed by `awa check` — do not edit manually.
41
+
42
+ # Technology Stack section
43
+ - heading: "Technology Stack"
44
+ level: 2
45
+ required: true
46
+ description: >
47
+ Bullet list of technologies with major version only.
48
+ Format: - `{Technology N}` — {purpose}
49
+
50
+ # High-Level Architecture section with mermaid diagram
51
+ - heading: "High-Level Architecture"
52
+ level: 2
53
+ required: true
54
+ description: >
55
+ Mermaid diagram showing components, data flow, and dependencies.
56
+ Must include a mermaid code block.
57
+ contains:
58
+ - code-block: true
59
+ label: "architecture diagram (mermaid)"
60
+ description: "Mermaid diagram (flowchart, sequence, etc.) showing the architecture."
61
+
62
+ # Directory Structure section
63
+ - heading: "Directory Structure"
64
+ level: 2
65
+ required: true
66
+ description: >
67
+ Code block with directory tree showing source layout.
68
+ Format: path/ # description
69
+ contains:
70
+ - code-block: true
71
+ label: "directory tree"
72
+ description: "Plain text directory tree with inline comments."
73
+
74
+ # Component Details section
75
+ - heading: "Component Details"
76
+ level: 2
77
+ required: true
78
+ description: >
79
+ One H3 per major component. Each component has a single-sentence
80
+ description, RESPONSIBILITIES list, and optional CONSTRAINTS list.
81
+ children:
82
+ - heading: ".*"
83
+ level: 3
84
+ repeatable: true
85
+ required: true
86
+ description: >
87
+ Component heading. Contains a single-sentence description,
88
+ RESPONSIBILITIES bullet list, and optional CONSTRAINTS bullet list.
89
+ contains:
90
+ - pattern: "RESPONSIBILITIES"
91
+ label: "RESPONSIBILITIES section"
92
+ description: "Keyword followed by a bullet list of component responsibilities."
93
+
94
+ # Component Interactions section
95
+ - heading: "Component Interactions"
96
+ level: 2
97
+ required: true
98
+ description: >
99
+ Describes how components communicate. May include mermaid sequence
100
+ diagrams as H3 subsections.
101
+
102
+ # Architectural Rules section
103
+ - heading: "Architectural Rules"
104
+ level: 2
105
+ required: true
106
+ description: >
107
+ Bullet list of rules covering performance, scaling, maintainability,
108
+ security, and testing constraints.
109
+
110
+ # Release Status section (optional)
111
+ - heading: "Release Status"
112
+ level: 2
113
+ description: >
114
+ Current release phase (Alpha, Beta, RC, GA) with brief description.
115
+ Format: STATUS: {phase} - {description}
116
+
117
+ # Developer Commands section
118
+ - heading: "Developer Commands"
119
+ level: 2
120
+ required: true
121
+ description: >
122
+ Bullet list of essential developer commands.
123
+ Format: - `{command}` - {description}
124
+
125
+ sections-prohibited:
126
+ - "**"
127
+
128
+ example: |
129
+ # Architecture
130
+
131
+ ## Project Purpose
132
+
133
+ awa CLI generates AI coding agent configuration files from templates, enabling developers to quickly scaffold consistent agent setups across projects.
134
+
135
+ ## System Overview
136
+
137
+ - CLI Layer
138
+ - Core Engine
139
+ - Template System
140
+ - I/O Layer
141
+
142
+ ## Technology Stack
143
+
144
+ - `Node.js 20` — Runtime environment
145
+ - `TypeScript 5` — Type-safe development
146
+ - `Eta 3` — Template rendering
147
+ - `Citty` — CLI framework
148
+
149
+ ## High-Level Architecture
150
+
151
+ ```mermaid
152
+ flowchart LR
153
+ subgraph Input
154
+ Args[CLI Args]
155
+ Config[.awa.toml]
156
+ Templates[Templates]
157
+ end
158
+ subgraph Core
159
+ Parser[ArgumentParser]
160
+ Engine[TemplateEngine]
161
+ Generator[FileGenerator]
162
+ end
163
+ subgraph Output
164
+ Files[Generated Files]
165
+ end
166
+ Args --> Parser
167
+ Config --> Parser
168
+ Parser --> Engine
169
+ Templates --> Engine
170
+ Engine --> Generator
171
+ Generator --> Files
172
+ ```
173
+
174
+ ## Directory Structure
175
+
176
+ ```
177
+ src/ # Source code
178
+ src/cli/ # CLI entry and commands
179
+ src/core/ # Core engine logic
180
+ src/utils/ # Shared utilities
181
+ templates/ # Bundled templates
182
+ ```
183
+
184
+ ## Component Details
185
+
186
+ ### CLI Layer
187
+
188
+ Handles argument parsing and command dispatch.
189
+
190
+ RESPONSIBILITIES
191
+
192
+ - Parse CLI arguments and options
193
+ - Load and merge configuration
194
+ - Dispatch to appropriate command handlers
195
+
196
+ CONSTRAINTS
197
+
198
+ - Must fail fast on invalid arguments
199
+ - Must support --help and --version
200
+
201
+ ### Template Engine
202
+
203
+ Renders templates with feature flag context.
204
+
205
+ RESPONSIBILITIES
206
+
207
+ - Load templates from local or remote sources
208
+ - Render with Eta templating
209
+ - Detect empty output for conditional file creation
210
+
211
+ ### File Generator
212
+
213
+ Writes rendered output to the file system.
214
+
215
+ RESPONSIBILITIES
216
+
217
+ - Write files with conflict detection
218
+ - Support dry-run mode
219
+ - Generate diff output
220
+
221
+ ## Component Interactions
222
+
223
+ The CLI parses arguments, loads configuration, then passes resolved options to the template engine which renders files through the generator.
224
+
225
+ ### Generate Command Flow
226
+
227
+ ```mermaid
228
+ sequenceDiagram
229
+ participant User
230
+ participant CLI
231
+ participant Engine
232
+ participant Generator
233
+ User->>CLI: awa generate
234
+ CLI->>Engine: render(templates, features)
235
+ Engine->>Generator: write(files)
236
+ Generator-->>User: Success summary
237
+ ```
238
+
239
+ ## Architectural Rules
240
+
241
+ - All file I/O must go through the I/O layer
242
+ - Core engine must not depend on CLI layer
243
+ - Templates must be stateless and deterministic
244
+ - Errors must provide actionable messages with file paths
245
+ - All public APIs must have TypeScript types
246
+
247
+ ## Release Status
248
+
249
+ STATUS: Alpha — Core functionality implemented. API may change without notice.
250
+
251
+ ## Developer Commands
252
+
253
+ - `npm install` — Install dependencies
254
+ - `npm run dev` — Run in development mode
255
+ - `npm test` — Run test suite
256
+ - `npm run lint` — Run linter
257
+ - `npm run build` — Build for production
@@ -0,0 +1,351 @@
1
+ # Structural rules for DESIGN-{CODE}-{feature-name}.md files
2
+ target-files: ".awa/specs/DESIGN-*.md"
3
+ description: >
4
+ Design specification describing HOW to implement requirements (not WHAT).
5
+ Succinct language. Do not overspecify. Omit irrelevant information.
6
+ Each component has a name ({CODE}-{ComponentName}), description, IMPLEMENTS
7
+ trace, and interface code block. Correctness properties use {CODE}_P-{n} IDs
8
+ and link back to requirements via VALIDATES.
9
+ line-limit: 800
10
+
11
+ sections:
12
+ # Top-level heading: "Design Specification"
13
+ - heading: "Design Specification"
14
+ level: 1
15
+ required: true
16
+ description: "Document title. No metadata in this section."
17
+
18
+ # Overview section
19
+ - heading: "Overview"
20
+ level: 2
21
+ required: true
22
+ description: >
23
+ Technical approach and rationale. Reference REQ document, do not restate
24
+ requirements. Explain the design strategy and why it was chosen.
25
+
26
+ # Architecture section
27
+ - heading: "Architecture"
28
+ level: 2
29
+ required: true
30
+ description: >
31
+ System architecture with diagram, module layout, and key decisions.
32
+ Optional AFFECTED LAYERS line listing impacted layers.
33
+ children:
34
+ - heading: "High-Level Architecture"
35
+ level: 3
36
+ required: true
37
+ description: >
38
+ Description of the architecture with a mermaid diagram showing
39
+ components, data flow, and dependencies.
40
+ contains:
41
+ - code-block: true
42
+ label: "architecture diagram (mermaid)"
43
+ description: "Mermaid diagram (flowchart, sequence, etc.) showing architecture."
44
+ - heading: "Module Organization"
45
+ level: 3
46
+ required: true
47
+ description: "Directory tree showing file/module layout."
48
+ contains:
49
+ - code-block: true
50
+ label: "directory structure"
51
+ description: "Code block with directory tree (no mermaid, plain text tree)."
52
+ - heading: "Architectural Decisions"
53
+ level: 3
54
+ description: >
55
+ Key design decisions with rationale. Format:
56
+ - DECISION: rationale. Alternatives: alt1, alt2
57
+
58
+ # Components and Interfaces section
59
+ - heading: "Components and Interfaces"
60
+ level: 2
61
+ required: true
62
+ description: >
63
+ One H3 per component. Each component describes HOW it works (not WHAT),
64
+ lists which ACs it implements, and provides a code interface.
65
+ children:
66
+ - heading: ".*"
67
+ level: 3
68
+ repeatable: true
69
+ required: true
70
+ description: >
71
+ Component heading: ### {CODE}-{ComponentName}
72
+ Name pattern: {CODE}-{ComponentName} (e.g., CFG-ConfigLoader, CLI-Parser).
73
+ Must describe HOW the component works, include IMPLEMENTS trace, and
74
+ provide an interface code block.
75
+ contains:
76
+ - pattern: "IMPLEMENTS:"
77
+ label: "IMPLEMENTS trace line"
78
+ description: >
79
+ IMPLEMENTS: {CODE}-{n}[.{p}]_AC-{m}, ... — comma-separated list of
80
+ acceptance criteria this component implements.
81
+ - code-block: true
82
+ label: "interface definition"
83
+ description: "TypeScript/language interface showing the component's public API."
84
+
85
+ # Data Models section
86
+ - heading: "Data Models"
87
+ level: 2
88
+ required: true
89
+ description: >
90
+ Core types, entities, and data structures grouped by H3 subsection.
91
+ Each subsection contains named types (CAPITALS) with descriptions
92
+ and optional code blocks.
93
+ children:
94
+ - heading: ".*"
95
+ level: 3
96
+ repeatable: true
97
+ required: true
98
+ description: >
99
+ Data model group (e.g., ### Core Types, ### API Types).
100
+ Contains bullet list of named types in CAPITALS with descriptions,
101
+ and optional code blocks with type definitions.
102
+
103
+ # Correctness Properties section
104
+ - heading: "Correctness Properties"
105
+ level: 2
106
+ required: true
107
+ description: >
108
+ Formal invariants for property-based testing. Each property has an ID
109
+ ({CODE}_P-{n}), a short name in brackets, a description, and VALIDATES
110
+ trace back to ACs or requirements. Format:
111
+ - {CODE}_P-{n} [{ShortName}]: {one-line description}
112
+ VALIDATES: {CODE}-{n}[.{p}]_AC-{m}, ...
113
+ The [{ShortName}] is required and names the invariant (e.g., [CLI Override]).
114
+ contains:
115
+ - pattern: "_P-\\d+"
116
+ label: "property ID"
117
+ description: "Property ID in {CODE}_P-{n} format (e.g., CFG_P-1, GEN_P-2)."
118
+ - pattern: "VALIDATES:"
119
+ label: "VALIDATES trace line"
120
+ description: "VALIDATES: comma-separated list of AC or REQ IDs this property validates."
121
+
122
+ # Error Handling section
123
+ - heading: "Error Handling"
124
+ level: 2
125
+ required: true
126
+ description: >
127
+ Error types with named variants, and a Strategy subsection with PRINCIPLES.
128
+ Each error type is an H3 with variant bullet list, followed by ### Strategy.
129
+ children:
130
+ - heading: ".*"
131
+ level: 3
132
+ repeatable: true
133
+ description: >
134
+ Error type heading. Format: ### {ErrorTypeName}
135
+ Followed by a sentence describing the error category, then a bullet list
136
+ of named variants: - VARIANT_NAME: description.
137
+ - heading: "Strategy"
138
+ level: 3
139
+ required: true
140
+ description: "Error handling strategy with PRINCIPLES bullet list."
141
+ contains:
142
+ - pattern: "PRINCIPLES"
143
+ label: "PRINCIPLES keyword"
144
+ description: "The Strategy subsection must contain a PRINCIPLES bullet list."
145
+
146
+ # Testing Strategy section
147
+ - heading: "Testing Strategy"
148
+ level: 2
149
+ required: true
150
+ description: >
151
+ Testing approach with subsections for property-based testing (required),
152
+ unit testing, and integration testing.
153
+ children:
154
+ - heading: "Property-Based Testing"
155
+ level: 3
156
+ required: true
157
+ description: >
158
+ Defines the property testing framework, minimum iterations, tag format,
159
+ and example test code blocks. Format:
160
+ - FRAMEWORK: {name}
161
+ - MINIMUM_ITERATIONS: {number}
162
+ - TAG_FORMAT: @awa-test: {CODE}_P-{n}
163
+ - heading: "Unit Testing"
164
+ level: 3
165
+ description: "Unit testing strategy with AREAS list."
166
+ - heading: "Integration Testing"
167
+ level: 3
168
+ description: "Integration testing strategy with SCENARIOS list."
169
+
170
+ # Requirements Traceability section
171
+ - heading: "Requirements Traceability"
172
+ level: 2
173
+ required: true
174
+ description: >
175
+ Trace matrix grouped by source REQ file. Each H3 is a REQ file path,
176
+ containing bullet list entries mapping ACs to components and properties.
177
+ Format per entry: - {CODE}-{n}[.{p}]_AC-{m} → {CODE}-{ComponentName} ({CODE}_P-{n}) [{status}] {notes}
178
+ children:
179
+ - heading: ".*"
180
+ level: 3
181
+ repeatable: true
182
+ required: true
183
+ description: >
184
+ Source REQ file heading. Format: ### REQ-{CODE}-{feature}.md
185
+ Followed by bullet list of trace entries from that file.
186
+ Each entry: - {AC-ID} → {Component} ({Property}) [{status}] {notes}
187
+ Omit [{status}] if implemented. Omit ({Property}) if none.
188
+
189
+ # Library Usage section (optional)
190
+ - heading: "Library Usage"
191
+ level: 2
192
+ description: >
193
+ Framework features and external libraries used. Subsections:
194
+ ### Framework Features — - FEATURE: usage
195
+ ### External Libraries — - name (version): purpose
196
+ children:
197
+ - heading: "Framework Features"
198
+ level: 3
199
+ description: "Framework features used. Format: - FEATURE: usage description."
200
+ - heading: "External Libraries"
201
+ level: 3
202
+ description: "External libraries used. Format: - name (version): purpose."
203
+
204
+ sections-prohibited:
205
+ - "**"
206
+ - "~~"
207
+
208
+ example: |
209
+ # Design Specification
210
+
211
+ ## Overview
212
+
213
+ This design implements a CLI pipeline architecture for template-based code generation. The pipeline flows through argument parsing, configuration loading, template resolution, rendering, and file output with conflict resolution.
214
+
215
+ ## Architecture
216
+
217
+ AFFECTED LAYERS: CLI Layer, Core Engine, I/O Layer
218
+
219
+ ### High-Level Architecture
220
+
221
+ Sequential pipeline for predictable flow and error handling.
222
+
223
+ ```mermaid
224
+ flowchart LR
225
+ Args[CLI Args] --> Parser
226
+ Config[.awa.toml] --> ConfigLoader
227
+ Parser --> ConfigLoader
228
+ ConfigLoader --> Engine[TemplateEngine]
229
+ Engine --> Generator[FileGenerator]
230
+ Generator --> Files[Output]
231
+ ```
232
+
233
+ ### Module Organization
234
+
235
+ ```
236
+ src/
237
+ ├── cli/
238
+ │ └── index.ts
239
+ ├── core/
240
+ │ ├── config.ts
241
+ │ ├── template.ts
242
+ │ └── generator.ts
243
+ └── utils/
244
+ └── fs.ts
245
+ ```
246
+
247
+ ### Architectural Decisions
248
+
249
+ - PIPELINE OVER EVENT: Sequential pipeline for predictable flow and error handling. Alternatives: event-driven, middleware chain
250
+
251
+ ## Components and Interfaces
252
+
253
+ ### CFG-ConfigLoader
254
+
255
+ Loads TOML configuration from file, merges with CLI arguments (CLI wins), and produces resolved options with defaults applied.
256
+
257
+ IMPLEMENTS: CFG-1_AC-1, CFG-1_AC-2, CFG-4_AC-1
258
+
259
+ ```typescript
260
+ interface ConfigLoader {
261
+ load(configPath: string | null): Promise<FileConfig | null>;
262
+ merge(cli: RawCliOptions, file: FileConfig | null): ResolvedOptions;
263
+ }
264
+ ```
265
+
266
+ ## Data Models
267
+
268
+ ### Core Types
269
+
270
+ - RESOLVED_OPTIONS: Fully resolved configuration with all defaults applied
271
+
272
+ ```typescript
273
+ interface ResolvedOptions {
274
+ readonly output: string;
275
+ readonly template: string | null;
276
+ readonly features: readonly string[];
277
+ readonly force: boolean;
278
+ }
279
+ ```
280
+
281
+ ## Correctness Properties
282
+
283
+ - CFG_P-1 [CLI Override]: CLI arguments always override config file values for the same option
284
+ VALIDATES: CFG-4_AC-1, CFG-4_AC-2
285
+
286
+ - GEN_P-2 [Dry Run Immutable]: Dry-run mode never modifies the file system
287
+ VALIDATES: GEN-6_AC-1, GEN-6_AC-2
288
+
289
+ ## Error Handling
290
+
291
+ ### ConfigError
292
+
293
+ Configuration loading and parsing errors
294
+
295
+ - FILE_NOT_FOUND: Config file does not exist when --config provided
296
+ - PARSE_ERROR: TOML syntax error with line number
297
+
298
+ ### Strategy
299
+
300
+ PRINCIPLES:
301
+
302
+ - Fail fast on first error
303
+ - Provide actionable error messages with file paths
304
+ - Exit with non-zero code on any error
305
+
306
+ ## Testing Strategy
307
+
308
+ ### Property-Based Testing
309
+
310
+ - FRAMEWORK: fast-check
311
+ - MINIMUM_ITERATIONS: 100
312
+ - TAG_FORMAT: @awa-test: {CODE}_P-{n}
313
+
314
+ ```typescript
315
+ // @awa-test: CFG_P-1
316
+ test.prop([fc.string(), fc.string()])('CLI overrides config', (cliValue, configValue) => {
317
+ const cli = { output: cliValue };
318
+ const config = { output: configValue };
319
+ const result = configLoader.merge(cli, config);
320
+ expect(result.output).toBe(cliValue);
321
+ });
322
+ ```
323
+
324
+ ### Unit Testing
325
+
326
+ Test individual components in isolation
327
+
328
+ - AREAS: CFG-ConfigLoader merge logic, TPL-TemplateResolver type detection
329
+
330
+ ## Requirements Traceability
331
+
332
+ ### REQ-CFG-config.md
333
+
334
+ - CFG-1_AC-1 → CFG-ConfigLoader (CFG_P-1)
335
+ - CFG-4_AC-1 → CFG-ConfigLoader (CFG_P-1)
336
+
337
+ ### REQ-GEN-generator.md
338
+
339
+ - GEN-6_AC-1 → GEN-FileGenerator (GEN_P-2) [partial] pending review
340
+
341
+ ## Library Usage
342
+
343
+ ### Framework Features
344
+
345
+ - CITTY: Command definition, argument parsing, help generation
346
+
347
+ ### External Libraries
348
+
349
+ - citty (latest): CLI framework
350
+ - smol-toml (1.x): TOML parser
351
+
@@ -0,0 +1,89 @@
1
+ # Structural rules for EXAMPLE-{CODE}-{feature-name}-{nnn}.md files
2
+ target-files: ".awa/specs/EXAMPLE-*.md"
3
+ description: >
4
+ Concrete usage examples for a feature. Detailed, hands-on, reproducible.
5
+ Use the same {CODE} as the corresponding FEAT/REQ for the feature.
6
+ Number files sequentially (-001, -002, ...) when splitting at the line-limit.
7
+ Each example must have a title, context, and code/demonstration block.
8
+ Marked [INFORMATIVE]. Prohibited: normative language (SHALL/SHOULD/MAY),
9
+ acceptance criteria, traceability IDs, design decisions.
10
+ line-limit: 800
11
+
12
+ sections:
13
+ # Top-level heading with INFORMATIVE marker
14
+ - heading: ".*\\[INFORMATIVE\\]"
15
+ level: 1
16
+ required: true
17
+ description: >
18
+ Document title including [INFORMATIVE] marker.
19
+ Format: # Usage Examples: {Feature Name} [INFORMATIVE]
20
+
21
+ # Prerequisites section (optional)
22
+ - heading: "Prerequisites"
23
+ level: 2
24
+ description: "Required tools, setup, or prior knowledge before running examples."
25
+
26
+ # At least one example heading
27
+ - heading: "Example \\d+:.*"
28
+ level: 2
29
+ required: true
30
+ repeatable: true
31
+ description: >
32
+ Individual example with title, context paragraph, and code block.
33
+ Format: ## Example N: {Title}
34
+ Context explaining when to use this and what it demonstrates.
35
+ Followed by a code or CLI demonstration block.
36
+ Optional: EXPECTED OUTPUT code block, NOTES bullet list.
37
+ contains:
38
+ - code-block: true
39
+ label: "code or CLI demonstration"
40
+ description: "Fenced code block with language tag (bash, typescript, etc.)."
41
+
42
+ sections-prohibited:
43
+ - "SHALL "
44
+ - "SHOULD "
45
+ - "MAY "
46
+ - "**"
47
+ - "_AC-"
48
+ - "_P-"
49
+ - "IMPLEMENTS:"
50
+ - "VALIDATES:"
51
+
52
+ example: |
53
+ # Usage Examples: Template Engine [INFORMATIVE]
54
+
55
+ ## Prerequisites
56
+
57
+ - Node.js 20 or higher
58
+ - awa CLI installed globally
59
+
60
+ ## Example 1: Basic Generation
61
+
62
+ Generate configuration files with default settings.
63
+
64
+ ```bash
65
+ awa generate
66
+ ```
67
+
68
+ EXPECTED OUTPUT:
69
+
70
+ ```
71
+ Created .github/agents/copilot.md
72
+ Created .github/agents/claude.md
73
+ ```
74
+
75
+ ## Example 2: Feature Flags
76
+
77
+ Enable specific features when generating.
78
+
79
+ ```bash
80
+ awa template generate --features copilot,claude,cursor
81
+ ```
82
+
83
+ ## Example 3: Custom Template Source
84
+
85
+ Use a Git repository as the template source.
86
+
87
+ ```bash
88
+ awa template generate --template owner/repo --features copilot
89
+ ```