@ncoderz/awa 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -16
- package/dist/chunk-3SSUJFKN.js +625 -0
- package/dist/chunk-3SSUJFKN.js.map +1 -0
- package/dist/config-2TOQATI3.js +10 -0
- package/dist/config-2TOQATI3.js.map +1 -0
- package/dist/index.js +2190 -414
- package/dist/index.js.map +1 -1
- package/package.json +10 -4
- package/templates/awa/.agent/skills/awa-align/SKILL.md +3 -0
- package/templates/awa/.agent/skills/awa-check/SKILL.md +4 -0
- package/templates/awa/.agent/skills/awa-usage/SKILL.md +3 -0
- package/templates/awa/.agent/workflows/awa-align.md +3 -0
- package/templates/awa/.agent/workflows/awa-check.md +4 -0
- package/templates/awa/.agents/skills/awa-align/SKILL.md +3 -0
- package/templates/awa/.agents/skills/awa-check/SKILL.md +4 -0
- package/templates/awa/.agents/skills/awa-usage/SKILL.md +3 -0
- package/templates/awa/.awa/.agent/schemas/ALIGN_REPORT.schema.yaml +83 -0
- package/templates/awa/.awa/.agent/schemas/API.schema.yaml +7 -0
- package/templates/awa/.awa/.agent/schemas/ARCHITECTURE.schema.yaml +260 -0
- package/templates/awa/.awa/.agent/schemas/DESIGN.schema.yaml +361 -0
- package/templates/awa/.awa/.agent/schemas/EXAMPLES.schema.yaml +98 -0
- package/templates/awa/.awa/.agent/schemas/FEAT.schema.yaml +143 -0
- package/templates/awa/.awa/.agent/schemas/PLAN.schema.yaml +151 -0
- package/templates/awa/.awa/.agent/schemas/README.schema.yaml +137 -0
- package/templates/awa/.awa/.agent/schemas/REQ.schema.yaml +169 -0
- package/templates/awa/.awa/.agent/schemas/TASK.schema.yaml +200 -0
- package/templates/awa/.claude/agents/awa.md +2 -2
- package/templates/awa/.claude/skills/awa-align/SKILL.md +3 -0
- package/templates/awa/.claude/skills/awa-check/SKILL.md +4 -0
- package/templates/awa/.claude/skills/awa-usage/SKILL.md +3 -0
- package/templates/awa/.codex/prompts/awa-align.md +3 -0
- package/templates/awa/.codex/prompts/awa-check.md +4 -0
- package/templates/awa/.cursor/rules/awa-agent.md +1 -1
- package/templates/awa/.cursor/rules/awa-align.md +8 -0
- package/templates/awa/.cursor/rules/awa-check.md +9 -0
- package/templates/awa/.gemini/commands/awa-align.md +3 -0
- package/templates/awa/.gemini/commands/awa-check.md +4 -0
- package/templates/awa/.gemini/skills/awa-align/SKILL.md +3 -0
- package/templates/awa/.gemini/skills/awa-check/SKILL.md +4 -0
- package/templates/awa/.gemini/skills/awa-usage/SKILL.md +3 -0
- package/templates/awa/.github/agents/awa.agent.md +2 -2
- package/templates/awa/.github/prompts/awa.align.prompt.md +8 -0
- package/templates/awa/.github/prompts/awa.check.prompt.md +9 -0
- package/templates/awa/.github/skills/awa-align/SKILL.md +8 -0
- package/templates/awa/.github/skills/awa-check/SKILL.md +9 -0
- package/templates/awa/.github/skills/awa-usage/SKILL.md +8 -0
- package/templates/awa/.kilocode/rules/awa-agent.md +1 -1
- package/templates/awa/.kilocode/skills/awa-align/SKILL.md +3 -0
- package/templates/awa/.kilocode/skills/awa-check/SKILL.md +4 -0
- package/templates/awa/.kilocode/skills/awa-usage/SKILL.md +3 -0
- package/templates/awa/.kilocode/workflows/awa-align.md +3 -0
- package/templates/awa/.kilocode/workflows/awa-check.md +4 -0
- package/templates/awa/.opencode/agents/awa.md +2 -2
- package/templates/awa/.opencode/commands/awa-align.md +3 -0
- package/templates/awa/.opencode/commands/awa-check.md +4 -0
- package/templates/awa/.opencode/skills/awa-align/SKILL.md +3 -0
- package/templates/awa/.opencode/skills/awa-check/SKILL.md +4 -0
- package/templates/awa/.opencode/skills/awa-usage/SKILL.md +3 -0
- package/templates/awa/.qwen/commands/awa-align.md +3 -0
- package/templates/awa/.qwen/commands/awa-check.md +4 -0
- package/templates/awa/.qwen/skills/awa-align/SKILL.md +3 -0
- package/templates/awa/.qwen/skills/awa-check/SKILL.md +4 -0
- package/templates/awa/.qwen/skills/awa-usage/SKILL.md +3 -0
- package/templates/awa/.roo/rules/awa-agent.md +1 -1
- package/templates/awa/.roo/skills/awa-align/SKILL.md +3 -0
- package/templates/awa/.roo/skills/awa-check/SKILL.md +4 -0
- package/templates/awa/.roo/skills/awa-usage/SKILL.md +3 -0
- package/templates/awa/.windsurf/rules/awa-agent.md +1 -1
- package/templates/awa/.windsurf/skills/awa-align/SKILL.md +3 -0
- package/templates/awa/.windsurf/skills/awa-check/SKILL.md +4 -0
- package/templates/awa/.windsurf/skills/awa-usage/SKILL.md +3 -0
- package/templates/awa/AGENTS.md +1 -1
- package/templates/awa/CLAUDE.md +1 -1
- package/templates/awa/GEMINI.md +1 -1
- package/templates/awa/QWEN.md +1 -1
- package/templates/awa/_README.md +3 -2
- package/templates/awa/_delete.txt +49 -0
- package/templates/awa/_partials/{_cmd.awa-validate-alignment.md → _cmd.awa-align.md} +1 -1
- package/templates/awa/_partials/_cmd.awa-check.md +6 -0
- package/templates/awa/_partials/_skill.awa-align.md +6 -0
- package/templates/awa/_partials/_skill.awa-check.md +6 -0
- package/templates/awa/_partials/_skill.awa-usage.md +6 -0
- package/templates/awa/_partials/{awa.validate-alignment.md → awa.align.md} +2 -2
- package/templates/awa/_partials/awa.architecture.md +1 -1
- package/templates/awa/_partials/awa.check.md +73 -0
- package/templates/awa/_partials/awa.code.md +1 -0
- package/templates/awa/_partials/awa.core.md +24 -10
- package/templates/awa/_partials/awa.design.md +3 -2
- package/templates/awa/_partials/awa.documentation.md +1 -1
- package/templates/awa/_partials/awa.examples.md +1 -1
- package/templates/awa/_partials/awa.feature.md +1 -1
- package/templates/awa/_partials/awa.plan.md +1 -1
- package/templates/awa/_partials/awa.refactor.md +1 -0
- package/templates/awa/_partials/awa.requirements.md +2 -1
- package/templates/awa/_partials/awa.tasks.md +3 -3
- package/templates/awa/_partials/awa.upgrade.md +13 -12
- package/templates/awa/_partials/awa.usage.md +265 -0
- package/templates/awa/_tests/claude.toml +7 -0
- package/templates/awa/_tests/copilot.toml +6 -0
- package/templates/awa/.agent/skills/awa-validate-alignment/SKILL.md +0 -3
- package/templates/awa/.agent/workflows/awa-validate-alignment.md +0 -3
- package/templates/awa/.agents/skills/awa-validate-alignment/SKILL.md +0 -3
- package/templates/awa/.awa/.agent/schemas/ALIGN_REPORT.schema.md +0 -156
- package/templates/awa/.awa/.agent/schemas/API.schema.md +0 -4
- package/templates/awa/.awa/.agent/schemas/ARCHITECTURE.schema.md +0 -176
- package/templates/awa/.awa/.agent/schemas/DESIGN.schema.md +0 -253
- package/templates/awa/.awa/.agent/schemas/EXAMPLES.schema.md +0 -51
- package/templates/awa/.awa/.agent/schemas/FEAT.schema.md +0 -61
- package/templates/awa/.awa/.agent/schemas/PLAN.schema.md +0 -8
- package/templates/awa/.awa/.agent/schemas/README.schema.md +0 -133
- package/templates/awa/.awa/.agent/schemas/REQ.schema.md +0 -125
- package/templates/awa/.awa/.agent/schemas/TASK.schema.md +0 -137
- package/templates/awa/.claude/skills/awa-validate-alignment/SKILL.md +0 -3
- package/templates/awa/.codex/prompts/awa-validate-alignment.md +0 -3
- package/templates/awa/.cursor/rules/awa-validate-alignment.md +0 -8
- package/templates/awa/.gemini/commands/awa-validate-alignment.md +0 -3
- package/templates/awa/.gemini/skills/awa-validate-alignment/SKILL.md +0 -3
- package/templates/awa/.github/prompts/awa.validate-alignment.prompt.md +0 -8
- package/templates/awa/.github/skills/awa-validate-alignment/SKILL.md +0 -8
- package/templates/awa/.kilocode/skills/awa-validate-alignment/SKILL.md +0 -3
- package/templates/awa/.kilocode/workflows/awa-validate-alignment.md +0 -3
- package/templates/awa/.opencode/commands/awa-validate-alignment.md +0 -3
- package/templates/awa/.opencode/skills/awa-validate-alignment/SKILL.md +0 -3
- package/templates/awa/.qwen/commands/awa-validate-alignment.md +0 -3
- package/templates/awa/.qwen/skills/awa-validate-alignment/SKILL.md +0 -3
- package/templates/awa/.roo/skills/awa-validate-alignment/SKILL.md +0 -3
- package/templates/awa/.windsurf/skills/awa-validate-alignment/SKILL.md +0 -3
- package/templates/awa/_partials/_skill.awa-validate-alignment.md +0 -6
|
@@ -0,0 +1,361 @@
|
|
|
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: 500
|
|
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
|
+
# Change Log section (optional)
|
|
205
|
+
- heading: "Change Log"
|
|
206
|
+
level: 2
|
|
207
|
+
description: "Version history. Format: - {version} ({date}): {changes}"
|
|
208
|
+
|
|
209
|
+
sections-prohibited:
|
|
210
|
+
- "**"
|
|
211
|
+
- "~~"
|
|
212
|
+
|
|
213
|
+
example: |
|
|
214
|
+
# Design Specification
|
|
215
|
+
|
|
216
|
+
## Overview
|
|
217
|
+
|
|
218
|
+
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.
|
|
219
|
+
|
|
220
|
+
## Architecture
|
|
221
|
+
|
|
222
|
+
AFFECTED LAYERS: CLI Layer, Core Engine, I/O Layer
|
|
223
|
+
|
|
224
|
+
### High-Level Architecture
|
|
225
|
+
|
|
226
|
+
Sequential pipeline for predictable flow and error handling.
|
|
227
|
+
|
|
228
|
+
```mermaid
|
|
229
|
+
flowchart LR
|
|
230
|
+
Args[CLI Args] --> Parser
|
|
231
|
+
Config[.awa.toml] --> ConfigLoader
|
|
232
|
+
Parser --> ConfigLoader
|
|
233
|
+
ConfigLoader --> Engine[TemplateEngine]
|
|
234
|
+
Engine --> Generator[FileGenerator]
|
|
235
|
+
Generator --> Files[Output]
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Module Organization
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
src/
|
|
242
|
+
├── cli/
|
|
243
|
+
│ └── index.ts
|
|
244
|
+
├── core/
|
|
245
|
+
│ ├── config.ts
|
|
246
|
+
│ ├── template.ts
|
|
247
|
+
│ └── generator.ts
|
|
248
|
+
└── utils/
|
|
249
|
+
└── fs.ts
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Architectural Decisions
|
|
253
|
+
|
|
254
|
+
- PIPELINE OVER EVENT: Sequential pipeline for predictable flow and error handling. Alternatives: event-driven, middleware chain
|
|
255
|
+
|
|
256
|
+
## Components and Interfaces
|
|
257
|
+
|
|
258
|
+
### CFG-ConfigLoader
|
|
259
|
+
|
|
260
|
+
Loads TOML configuration from file, merges with CLI arguments (CLI wins), and produces resolved options with defaults applied.
|
|
261
|
+
|
|
262
|
+
IMPLEMENTS: CFG-1_AC-1, CFG-1_AC-2, CFG-4_AC-1
|
|
263
|
+
|
|
264
|
+
```typescript
|
|
265
|
+
interface ConfigLoader {
|
|
266
|
+
load(configPath: string | null): Promise<FileConfig | null>;
|
|
267
|
+
merge(cli: RawCliOptions, file: FileConfig | null): ResolvedOptions;
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Data Models
|
|
272
|
+
|
|
273
|
+
### Core Types
|
|
274
|
+
|
|
275
|
+
- RESOLVED_OPTIONS: Fully resolved configuration with all defaults applied
|
|
276
|
+
|
|
277
|
+
```typescript
|
|
278
|
+
interface ResolvedOptions {
|
|
279
|
+
readonly output: string;
|
|
280
|
+
readonly template: string | null;
|
|
281
|
+
readonly features: readonly string[];
|
|
282
|
+
readonly force: boolean;
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Correctness Properties
|
|
287
|
+
|
|
288
|
+
- CFG_P-1 [CLI Override]: CLI arguments always override config file values for the same option
|
|
289
|
+
VALIDATES: CFG-4_AC-1, CFG-4_AC-2
|
|
290
|
+
|
|
291
|
+
- GEN_P-2 [Dry Run Immutable]: Dry-run mode never modifies the file system
|
|
292
|
+
VALIDATES: GEN-6_AC-1, GEN-6_AC-2
|
|
293
|
+
|
|
294
|
+
## Error Handling
|
|
295
|
+
|
|
296
|
+
### ConfigError
|
|
297
|
+
|
|
298
|
+
Configuration loading and parsing errors
|
|
299
|
+
|
|
300
|
+
- FILE_NOT_FOUND: Config file does not exist when --config provided
|
|
301
|
+
- PARSE_ERROR: TOML syntax error with line number
|
|
302
|
+
|
|
303
|
+
### Strategy
|
|
304
|
+
|
|
305
|
+
PRINCIPLES:
|
|
306
|
+
|
|
307
|
+
- Fail fast on first error
|
|
308
|
+
- Provide actionable error messages with file paths
|
|
309
|
+
- Exit with non-zero code on any error
|
|
310
|
+
|
|
311
|
+
## Testing Strategy
|
|
312
|
+
|
|
313
|
+
### Property-Based Testing
|
|
314
|
+
|
|
315
|
+
- FRAMEWORK: fast-check
|
|
316
|
+
- MINIMUM_ITERATIONS: 100
|
|
317
|
+
- TAG_FORMAT: @awa-test: {CODE}_P-{n}
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
// @awa-test: CFG_P-1
|
|
321
|
+
test.prop([fc.string(), fc.string()])('CLI overrides config', (cliValue, configValue) => {
|
|
322
|
+
const cli = { output: cliValue };
|
|
323
|
+
const config = { output: configValue };
|
|
324
|
+
const result = configLoader.merge(cli, config);
|
|
325
|
+
expect(result.output).toBe(cliValue);
|
|
326
|
+
});
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Unit Testing
|
|
330
|
+
|
|
331
|
+
Test individual components in isolation
|
|
332
|
+
|
|
333
|
+
- AREAS: CFG-ConfigLoader merge logic, TPL-TemplateResolver type detection
|
|
334
|
+
|
|
335
|
+
## Requirements Traceability
|
|
336
|
+
|
|
337
|
+
### REQ-CFG-config.md
|
|
338
|
+
|
|
339
|
+
- CFG-1_AC-1 → CFG-ConfigLoader (CFG_P-1)
|
|
340
|
+
- CFG-4_AC-1 → CFG-ConfigLoader (CFG_P-1)
|
|
341
|
+
|
|
342
|
+
### REQ-GEN-generator.md
|
|
343
|
+
|
|
344
|
+
- GEN-6_AC-1 → GEN-FileGenerator (GEN_P-2) [partial] pending review
|
|
345
|
+
|
|
346
|
+
## Library Usage
|
|
347
|
+
|
|
348
|
+
### Framework Features
|
|
349
|
+
|
|
350
|
+
- CITTY: Command definition, argument parsing, help generation
|
|
351
|
+
|
|
352
|
+
### External Libraries
|
|
353
|
+
|
|
354
|
+
- citty (latest): CLI framework
|
|
355
|
+
- smol-toml (1.x): TOML parser
|
|
356
|
+
|
|
357
|
+
## Change Log
|
|
358
|
+
|
|
359
|
+
- 1.0.0 (2025-01-10): Initial design
|
|
360
|
+
|
|
361
|
+
- 1.0.0 (2025-01-10): Initial design
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Structural rules for EXAMPLES-{CODE}-{feature-name}-{nnn}.md files
|
|
2
|
+
target-files: ".awa/specs/EXAMPLES-*.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 500-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: 500
|
|
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
|
+
# Change Log section (optional)
|
|
43
|
+
- heading: "Change Log"
|
|
44
|
+
level: 2
|
|
45
|
+
description: "Version history. Format: - {version} ({date}): {changes}"
|
|
46
|
+
|
|
47
|
+
sections-prohibited:
|
|
48
|
+
- "SHALL "
|
|
49
|
+
- "SHOULD "
|
|
50
|
+
- "MAY "
|
|
51
|
+
- "**"
|
|
52
|
+
- "_AC-"
|
|
53
|
+
- "_P-"
|
|
54
|
+
- "IMPLEMENTS:"
|
|
55
|
+
- "VALIDATES:"
|
|
56
|
+
|
|
57
|
+
example: |
|
|
58
|
+
# Usage Examples: Template Engine [INFORMATIVE]
|
|
59
|
+
|
|
60
|
+
## Prerequisites
|
|
61
|
+
|
|
62
|
+
- Node.js 20 or higher
|
|
63
|
+
- awa CLI installed globally
|
|
64
|
+
|
|
65
|
+
## Example 1: Basic Generation
|
|
66
|
+
|
|
67
|
+
Generate configuration files with default settings.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
awa generate
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
EXPECTED OUTPUT:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
Created .github/agents/copilot.md
|
|
77
|
+
Created .github/agents/claude.md
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Example 2: Feature Flags
|
|
81
|
+
|
|
82
|
+
Enable specific features when generating.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
awa generate --features copilot,claude,cursor
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Example 3: Custom Template Source
|
|
89
|
+
|
|
90
|
+
Use a Git repository as the template source.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
awa generate --template owner/repo --features copilot
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Change Log
|
|
97
|
+
|
|
98
|
+
- 1.0.0 (2025-01-10): Initial examples
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Structural rules for FEAT-{CODE}-{feature-name}.md files
|
|
2
|
+
target-files: ".awa/specs/FEAT-*.md"
|
|
3
|
+
description: >
|
|
4
|
+
Non-normative feature context. Explains WHAT the feature is and WHY it exists,
|
|
5
|
+
not HOW to implement it. Uses clear, accessible language. Marked [INFORMATIVE]
|
|
6
|
+
to distinguish from normative REQ/DESIGN documents.
|
|
7
|
+
Prohibited: normative language (SHALL/SHOULD/MAY), acceptance criteria,
|
|
8
|
+
traceability IDs, design decisions, bold formatting.
|
|
9
|
+
line-limit: 500
|
|
10
|
+
|
|
11
|
+
sections:
|
|
12
|
+
# Top-level heading with INFORMATIVE marker
|
|
13
|
+
- heading: ".*\\[INFORMATIVE\\]"
|
|
14
|
+
level: 1
|
|
15
|
+
required: true
|
|
16
|
+
description: >
|
|
17
|
+
Document title including [INFORMATIVE] marker.
|
|
18
|
+
Format: # Feature Context: {Feature Name} [INFORMATIVE]
|
|
19
|
+
|
|
20
|
+
# Problem section
|
|
21
|
+
- heading: "Problem"
|
|
22
|
+
level: 2
|
|
23
|
+
required: true
|
|
24
|
+
description: >
|
|
25
|
+
Why this feature exists. What pain point or gap it addresses.
|
|
26
|
+
Written from the user's perspective.
|
|
27
|
+
|
|
28
|
+
# Conceptual Model section
|
|
29
|
+
- heading: "Conceptual Model"
|
|
30
|
+
level: 2
|
|
31
|
+
required: true
|
|
32
|
+
description: >
|
|
33
|
+
How users should think about this feature. Mental model, key abstractions,
|
|
34
|
+
and relationships between concepts. May include diagrams.
|
|
35
|
+
|
|
36
|
+
# Scenarios section with repeatable scenario headings
|
|
37
|
+
- heading: "Scenarios"
|
|
38
|
+
level: 2
|
|
39
|
+
required: true
|
|
40
|
+
description: >
|
|
41
|
+
Concrete usage narratives illustrating the feature in action. Each
|
|
42
|
+
scenario describes a realistic user situation and expected outcome.
|
|
43
|
+
children:
|
|
44
|
+
- heading: "Scenario \\d+:.*"
|
|
45
|
+
level: 3
|
|
46
|
+
repeatable: true
|
|
47
|
+
required: true
|
|
48
|
+
description: >
|
|
49
|
+
Individual scenario. Format: ### Scenario N: {Title}
|
|
50
|
+
Contains a narrative paragraph describing the user situation.
|
|
51
|
+
|
|
52
|
+
# Optional sections
|
|
53
|
+
- heading: "Background"
|
|
54
|
+
level: 2
|
|
55
|
+
description: "Additional context: history, prior art, references."
|
|
56
|
+
|
|
57
|
+
- heading: "Glossary"
|
|
58
|
+
level: 2
|
|
59
|
+
description: "Domain terms. Format: - TERM: Definition"
|
|
60
|
+
|
|
61
|
+
- heading: "Stakeholders"
|
|
62
|
+
level: 2
|
|
63
|
+
description: "Roles related to this feature. Format: - ROLE: Relationship"
|
|
64
|
+
|
|
65
|
+
- heading: "Diagrams"
|
|
66
|
+
level: 2
|
|
67
|
+
description: "Supplementary mermaid diagrams for the conceptual model."
|
|
68
|
+
|
|
69
|
+
- heading: "Non-Normative Notes"
|
|
70
|
+
level: 2
|
|
71
|
+
description: "Recommendations, best practices, or explanatory content that is not testable."
|
|
72
|
+
|
|
73
|
+
- heading: "Change Log"
|
|
74
|
+
level: 2
|
|
75
|
+
description: "Version history. Format: - {version} ({date}): {changes}"
|
|
76
|
+
|
|
77
|
+
sections-prohibited:
|
|
78
|
+
- "SHALL "
|
|
79
|
+
- "SHOULD "
|
|
80
|
+
- "MAY "
|
|
81
|
+
- "**"
|
|
82
|
+
- "_AC-"
|
|
83
|
+
- "_P-"
|
|
84
|
+
- "IMPLEMENTS:"
|
|
85
|
+
- "VALIDATES:"
|
|
86
|
+
|
|
87
|
+
example: |
|
|
88
|
+
# Template Engine Feature Context [INFORMATIVE]
|
|
89
|
+
|
|
90
|
+
## Problem
|
|
91
|
+
|
|
92
|
+
Developers need to generate AI agent configuration files across multiple
|
|
93
|
+
projects consistently. Manual creation is error-prone, time-consuming, and
|
|
94
|
+
leads to drift between projects. There is no standard way to conditionally
|
|
95
|
+
include or exclude configuration sections based on project needs.
|
|
96
|
+
|
|
97
|
+
## Conceptual Model
|
|
98
|
+
|
|
99
|
+
The template engine treats configuration files as templates that can be
|
|
100
|
+
rendered with a set of feature flags. Users think of features as toggles —
|
|
101
|
+
enable "copilot" to get GitHub Copilot config, enable "claude" for Claude
|
|
102
|
+
config, etc. The engine resolves which template files to include, renders
|
|
103
|
+
them with the active feature set, and writes the output.
|
|
104
|
+
|
|
105
|
+
Key abstractions:
|
|
106
|
+
- TEMPLATE: A file with optional Eta expressions
|
|
107
|
+
- FEATURE FLAG: A named toggle that controls conditional rendering
|
|
108
|
+
- PARTIAL: A reusable template fragment included by other templates
|
|
109
|
+
- PRESET: A named bundle of feature flags
|
|
110
|
+
|
|
111
|
+
## Scenarios
|
|
112
|
+
|
|
113
|
+
### Scenario 1: First-time Setup
|
|
114
|
+
|
|
115
|
+
A developer starts a new project and wants to add AI agent configuration
|
|
116
|
+
for GitHub Copilot and Claude. They run `awa generate --features copilot,claude`
|
|
117
|
+
and get a complete set of configuration files tailored to those two agents.
|
|
118
|
+
|
|
119
|
+
### Scenario 2: Adding a New Agent
|
|
120
|
+
|
|
121
|
+
An existing project already has Copilot configuration. The developer adds
|
|
122
|
+
Cursor support by running `awa generate --features copilot,cursor`. The engine
|
|
123
|
+
merges the new feature without disrupting existing configuration.
|
|
124
|
+
|
|
125
|
+
### Scenario 3: Previewing Changes
|
|
126
|
+
|
|
127
|
+
Before applying changes, the developer runs `awa diff` to see what files
|
|
128
|
+
would be added, modified, or removed. This gives confidence before committing.
|
|
129
|
+
|
|
130
|
+
## Background
|
|
131
|
+
|
|
132
|
+
Prior art includes tools like cookiecutter (Python), degit (JS), and Yeoman.
|
|
133
|
+
These focus on one-time scaffolding. awa differs by supporting re-generation.
|
|
134
|
+
|
|
135
|
+
## Glossary
|
|
136
|
+
|
|
137
|
+
- ETA: The template rendering library used by awa
|
|
138
|
+
- FEATURE FLAG: A string identifier that enables conditional template content
|
|
139
|
+
- PARTIAL: A template file prefixed with `_` that can be included by other templates
|
|
140
|
+
|
|
141
|
+
## Change Log
|
|
142
|
+
|
|
143
|
+
- 1.0.0 (2025-01-10): Initial feature context
|