@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
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
<schema target-files=".awa/alignment/ALIGN-{x}-WITH-{y}-{nnn}.md">
|
|
2
|
-
|
|
3
|
-
<definitions>
|
|
4
|
-
x = source artifact (what is being validated).
|
|
5
|
-
y = target artifact (what x is validated against).
|
|
6
|
-
<severity>
|
|
7
|
-
CRITICAL: MUST/SHALL violation, security, data integrity
|
|
8
|
-
MAJOR: SHOULD violation, UX, performance
|
|
9
|
-
MINOR: MAY not implemented, orphan traces, optional
|
|
10
|
-
INFO: superset additions, suggestions
|
|
11
|
-
</severity>
|
|
12
|
-
<confidence>
|
|
13
|
-
CERTAIN: explicit trace (IMPLEMENTS, VALIDATES, @awa-*)
|
|
14
|
-
LIKELY: naming convention or strong inference
|
|
15
|
-
UNCERTAIN: semantic inference only → flag for human review
|
|
16
|
-
</confidence>
|
|
17
|
-
<finding-type>
|
|
18
|
-
MISSING | DIFFERENCE | CONFLICT | INCOMPLETE | UNTESTED | ORPHAN | SUPERSET
|
|
19
|
-
</finding-type>
|
|
20
|
-
<trace_matrix>
|
|
21
|
-
<trace in="DESIGN component" marker="IMPLEMENTS: {CODE}-{n}[.{p}]_AC-{m}" to="REQ AC" />
|
|
22
|
-
<trace in="DESIGN property" marker="{CODE}_P-{n} VALIDATES: {CODE}-{n}[.{p}]_AC-{m} | {CODE}-{n}" to="REQ" />
|
|
23
|
-
<trace in="code" marker="@awa-component: {CODE}-{ComponentName}" to="DESIGN component" />
|
|
24
|
-
<trace in="code" marker="@awa-impl: {CODE}-{n}[.{p}]_AC-{m}" to="REQ AC" />
|
|
25
|
-
<trace in="tests" marker="@awa-test: {CODE}_P-{n}" to="DESIGN property" />
|
|
26
|
-
<trace in="tests" marker="@awa-test: {CODE}-{n}[.{p}]_AC-{m}" to="REQ AC" />
|
|
27
|
-
<infer target="semantic_traces" when="markers missing" confidence="LIKELY|UNCERTAIN" />
|
|
28
|
-
</trace_matrix>
|
|
29
|
-
</definitions>
|
|
30
|
-
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"description": "Render as Markdown per $rendering.",
|
|
34
|
-
"type": "object",
|
|
35
|
-
"required": ["source", "target", "findings"],
|
|
36
|
-
"properties": {
|
|
37
|
-
"source": { "type": "string", "description": "x artifact path or identifier" },
|
|
38
|
-
"target": { "type": "string", "description": "y artifact path or identifier" },
|
|
39
|
-
"findings": {
|
|
40
|
-
"type": "array",
|
|
41
|
-
"items": {
|
|
42
|
-
"type": "object",
|
|
43
|
-
"required": ["severity", "confidence", "type", "sourceRef", "problem"],
|
|
44
|
-
"properties": {
|
|
45
|
-
"severity": { "enum": ["critical", "major", "minor", "info"] },
|
|
46
|
-
"confidence": { "enum": ["certain", "likely", "uncertain"] },
|
|
47
|
-
"type": { "enum": ["missing", "difference", "conflict", "incomplete", "superset", "orphan", "untested"] },
|
|
48
|
-
"sourceRef": {
|
|
49
|
-
"type": "object",
|
|
50
|
-
"required": ["location"],
|
|
51
|
-
"properties": {
|
|
52
|
-
"location": { "type": "string" },
|
|
53
|
-
"text": { "type": "string" }
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"targetRef": {
|
|
57
|
-
"type": "object",
|
|
58
|
-
"properties": {
|
|
59
|
-
"location": { "type": "string" },
|
|
60
|
-
"text": { "type": "string" }
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
"problem": { "type": "string" },
|
|
64
|
-
"traceability": { "enum": ["explicit-implements", "explicit-validates", "explicit-awa-component", "explicit-awa-impl", "explicit-awa-test", "naming", "semantic"], "description": "How the trace was established" },
|
|
65
|
-
"resolution": { "type": "string" }
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
"$rendering": {
|
|
71
|
-
"templates": {
|
|
72
|
-
"withFindings": [
|
|
73
|
-
"# ALIGNMENT REPORT",
|
|
74
|
-
"{source} ↔ {target}",
|
|
75
|
-
"",
|
|
76
|
-
"{for each finding: templates.finding}",
|
|
77
|
-
"",
|
|
78
|
-
"## Summary",
|
|
79
|
-
"CRITICAL: {count}",
|
|
80
|
-
"MAJOR: {count}",
|
|
81
|
-
"MINOR: {count}",
|
|
82
|
-
"INFO: {count}",
|
|
83
|
-
"STATUS: {PASSED ✅ | FAILED ❌}"
|
|
84
|
-
],
|
|
85
|
-
"noFindings": [
|
|
86
|
-
"# ALIGNMENT REPORT",
|
|
87
|
-
"{source} ↔ {target}",
|
|
88
|
-
"All checks passed. No alignment issues found.",
|
|
89
|
-
"**STATUS: PASSED ✅**"
|
|
90
|
-
],
|
|
91
|
-
"finding": [
|
|
92
|
-
"- [ ] {n}. {SEVERITY} [{CONFIDENCE}] {TYPE}",
|
|
93
|
-
"",
|
|
94
|
-
" SOURCE: {sourceRef.location}",
|
|
95
|
-
" > {sourceRef.text}",
|
|
96
|
-
"",
|
|
97
|
-
" TARGET: {targetRef.location}",
|
|
98
|
-
" > {targetRef.text}",
|
|
99
|
-
"",
|
|
100
|
-
" ISSUE: {problem}",
|
|
101
|
-
"",
|
|
102
|
-
" RESOLUTION: {resolution}",
|
|
103
|
-
"",
|
|
104
|
-
" *Traced via: {traceability}*"
|
|
105
|
-
]
|
|
106
|
-
},
|
|
107
|
-
"statusRules": [
|
|
108
|
-
"FAILED if any CRITICAL or MAJOR findings",
|
|
109
|
-
"PASSED otherwise"
|
|
110
|
-
],
|
|
111
|
-
"templateSelection": [
|
|
112
|
-
"No findings → noFindings",
|
|
113
|
-
"Findings exist → withFindings"
|
|
114
|
-
],
|
|
115
|
-
"omissionRules": [
|
|
116
|
-
"Omit source blockquote if sourceRef.text absent",
|
|
117
|
-
"Omit TARGET: line entirely if targetRef absent → show 'TARGET: (not found)'",
|
|
118
|
-
"Omit target blockquote if targetRef.text absent",
|
|
119
|
-
"Omit *Traced via* if traceability starts with 'explicit-'",
|
|
120
|
-
"Omit RESOLUTION: if resolution absent"
|
|
121
|
-
]
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
<example>
|
|
127
|
-
# ALIGNMENT REPORT
|
|
128
|
-
|
|
129
|
-
DESIGN-WKS-workspace.md ↔ src/workspace/**
|
|
130
|
-
|
|
131
|
-
- [ ] 1. CRITICAL [CERTAIN] MISSING
|
|
132
|
-
SOURCE: WKS-WorkspaceConfig (IMPLEMENTS: WKS-1_AC-1)
|
|
133
|
-
> pub fn load(root: &Path) -> Result<Self, WorkspaceError>
|
|
134
|
-
TARGET: (not found)
|
|
135
|
-
ISSUE: Design component declares IMPLEMENTS: WKS-1_AC-1, but no code file contains @awa-component: WKS-WorkspaceConfig with @awa-impl: WKS-1_AC-1.
|
|
136
|
-
RESOLUTION: Add @awa-component: WKS-WorkspaceConfig and @awa-impl: WKS-1_AC-1 to src/workspace/config.rs
|
|
137
|
-
|
|
138
|
-
- [ ] 2. MAJOR [CERTAIN] DIFFERENCE
|
|
139
|
-
SOURCE: WKS-WorkspaceValidator (IMPLEMENTS: WKS-2_AC-3)
|
|
140
|
-
> fn validate(&self) -> Result<(), ValidationError>
|
|
141
|
-
TARGET: src/workspace/validator.rs:45
|
|
142
|
-
> fn validate(&self) -> bool
|
|
143
|
-
ISSUE: Return type mismatch. Design specifies Result<(), ValidationError> but implementation returns bool, losing error context.
|
|
144
|
-
RESOLUTION: Update validator.rs to return Result<(), ValidationError> as specified in design
|
|
145
|
-
|
|
146
|
-
## Summary
|
|
147
|
-
|
|
148
|
-
CRITICAL: 1
|
|
149
|
-
MAJOR: 1
|
|
150
|
-
MINOR: 0
|
|
151
|
-
INFO: 0
|
|
152
|
-
|
|
153
|
-
STATUS: FAILED ❌
|
|
154
|
-
</example>
|
|
155
|
-
|
|
156
|
-
</schema>
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
<schema target-file=".awa/specs/ARCHITECTURE.md">
|
|
2
|
-
- You MUST write API specs in TypeSpec format unless requested otherwise.
|
|
3
|
-
- If written in TypeSpec, API specifications follow TypeSpec format conventions.
|
|
4
|
-
|
|
5
|
-
```json
|
|
6
|
-
{
|
|
7
|
-
"description": "Architecture only. Succinct language. Do not overspecify. Omit irrelevant information.",
|
|
8
|
-
"required": ["projectPurpose", "systemOverview", "technologyStack", "architectureDiagram", "directoryStructure", "componentDetails", "componentInteractions", "architecturalRules", "developerCommands"],
|
|
9
|
-
"properties": {
|
|
10
|
-
"projectPurpose": { "type": "single paragraph: core problem and primary functionality" },
|
|
11
|
-
"systemOverview": { "type": "array of software layers/subsystems" },
|
|
12
|
-
"technologyStack": { "type": "array", "items": { "properties": { "technology": { "type": "name with major version only" }, "purpose": {} } } },
|
|
13
|
-
"architectureDiagram": { "type": "mermaid diagram showing components, data flow, dependencies" },
|
|
14
|
-
"directoryStructure": { "type": "array", "items": { "properties": { "path": {}, "description": {} } } },
|
|
15
|
-
"componentDetails": { "type": "array", "items": { "$ref": "#/$defs/component" } },
|
|
16
|
-
"componentInteractions": {
|
|
17
|
-
"required": ["description"],
|
|
18
|
-
"properties": {
|
|
19
|
-
"description": {},
|
|
20
|
-
"diagrams": { "type": "array", "items": { "properties": { "title": {}, "mermaid": {} } } }
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"architecturalRules": { "type": "array covering performance, scaling, maintainability, security, testing" },
|
|
24
|
-
"releaseStatus": { "type": "string: current release phase (e.g., Alpha, Beta, RC, GA) with brief description" },
|
|
25
|
-
"developerCommands": { "type": "array", "items": { "properties": { "command": {}, "description": {} } } },
|
|
26
|
-
"metadata": { "properties": { "changeLog": { "type": "array", "items": { "properties": { "version": {}, "date": {}, "changes": {} } } } } }
|
|
27
|
-
},
|
|
28
|
-
"$defs": {
|
|
29
|
-
"component": {
|
|
30
|
-
"required": ["name", "description", "responsibilities"],
|
|
31
|
-
"properties": {
|
|
32
|
-
"name": {},
|
|
33
|
-
"description": { "type": "single sentence" },
|
|
34
|
-
"responsibilities": { "type": "array of strings" },
|
|
35
|
-
"constraints": { "type": "array of strings" }
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"$render": {
|
|
40
|
-
"template": "# Architecture\n\n## Project Purpose\n{projectPurpose}\n\n## System Overview\n{systemOverview→'- {}'}\n\n## Technology Stack\n{technologyStack→'- `{technology}` — {purpose}'}\n\n## High-Level Architecture\n```mermaid\n{architectureDiagram}\n```\n\n## Directory Structure\n```\n{directoryStructure→'{path} # {description}'}\n```\n\n## Component Details\n{componentDetails→'### {name}\n\n{description}\n\nRESPONSIBILITIES\n{responsibilities→\"- {}\"}\n\nCONSTRAINTS\n{constraints?→\"- {}\"}'}\n\n## Component Interactions\n{componentInteractions.description}\n{componentInteractions.diagrams→'### {title}\n```mermaid\n{mermaid}\n```'}\n\n## Architectural Rules\n{architecturalRules→'- {}'}\n\n## Release Status\n{releaseStatus}\n\n## Developer Commands\n{developerCommands→'- `{command}` — {description}'}\n\n## Change Log\n{metadata.changeLog→'- {version} ({date}): {changes}'}",
|
|
41
|
-
"omit": ["CONSTRAINTS section if empty", "diagrams section if empty"],
|
|
42
|
-
"prohibited": ["**bold** — use CAPITALS", "minor versions in tech stack (major only)", "non-architecture directories", "detailed implementation in component descriptions"]
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
<example>
|
|
48
|
-
# Architecture
|
|
49
|
-
|
|
50
|
-
## Project Purpose
|
|
51
|
-
|
|
52
|
-
awa CLI generates AI coding agent configuration files from templates, enabling developers to quickly scaffold consistent agent setups across projects.
|
|
53
|
-
|
|
54
|
-
## System Overview
|
|
55
|
-
|
|
56
|
-
- CLI Layer
|
|
57
|
-
- Core Engine
|
|
58
|
-
- Template System
|
|
59
|
-
- I/O Layer
|
|
60
|
-
|
|
61
|
-
## Technology Stack
|
|
62
|
-
|
|
63
|
-
- `Node.js 20` — Runtime environment
|
|
64
|
-
- `TypeScript 5` — Type-safe development
|
|
65
|
-
- `Eta 3` — Template rendering
|
|
66
|
-
- `Citty` — CLI framework
|
|
67
|
-
|
|
68
|
-
## High-Level Architecture
|
|
69
|
-
|
|
70
|
-
```mermaid
|
|
71
|
-
flowchart LR
|
|
72
|
-
subgraph Input
|
|
73
|
-
Args[CLI Args]
|
|
74
|
-
Config[.awa.toml]
|
|
75
|
-
Templates[Templates]
|
|
76
|
-
end
|
|
77
|
-
subgraph Core
|
|
78
|
-
Parser[ArgumentParser]
|
|
79
|
-
Engine[TemplateEngine]
|
|
80
|
-
Generator[FileGenerator]
|
|
81
|
-
end
|
|
82
|
-
subgraph Output
|
|
83
|
-
Files[Generated Files]
|
|
84
|
-
end
|
|
85
|
-
Args --> Parser
|
|
86
|
-
Config --> Parser
|
|
87
|
-
Parser --> Engine
|
|
88
|
-
Templates --> Engine
|
|
89
|
-
Engine --> Generator
|
|
90
|
-
Generator --> Files
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Directory Structure
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
src/ # Source code
|
|
97
|
-
src/cli/ # CLI entry and commands
|
|
98
|
-
src/core/ # Core engine logic
|
|
99
|
-
src/utils/ # Shared utilities
|
|
100
|
-
templates/ # Bundled templates
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Component Details
|
|
104
|
-
|
|
105
|
-
### CLI Layer
|
|
106
|
-
|
|
107
|
-
Handles argument parsing and command dispatch.
|
|
108
|
-
|
|
109
|
-
RESPONSIBILITIES
|
|
110
|
-
|
|
111
|
-
- Parse CLI arguments and options
|
|
112
|
-
- Load and merge configuration
|
|
113
|
-
- Dispatch to appropriate command handlers
|
|
114
|
-
|
|
115
|
-
CONSTRAINTS
|
|
116
|
-
|
|
117
|
-
- Must fail fast on invalid arguments
|
|
118
|
-
- Must support --help and --version
|
|
119
|
-
|
|
120
|
-
### Template Engine
|
|
121
|
-
|
|
122
|
-
Renders templates with feature flag context.
|
|
123
|
-
|
|
124
|
-
RESPONSIBILITIES
|
|
125
|
-
|
|
126
|
-
- Load templates from local or remote sources
|
|
127
|
-
- Render with Eta templating
|
|
128
|
-
- Detect empty output for conditional file creation
|
|
129
|
-
|
|
130
|
-
## Component Interactions
|
|
131
|
-
|
|
132
|
-
The CLI parses arguments, loads configuration, then passes resolved options to the template engine which renders files through the generator.
|
|
133
|
-
|
|
134
|
-
### Generate Command Flow
|
|
135
|
-
|
|
136
|
-
```mermaid
|
|
137
|
-
sequenceDiagram
|
|
138
|
-
participant User
|
|
139
|
-
participant CLI
|
|
140
|
-
participant Engine
|
|
141
|
-
participant Generator
|
|
142
|
-
User->>CLI: awa generate
|
|
143
|
-
CLI->>Engine: render(templates, features)
|
|
144
|
-
Engine->>Generator: write(files)
|
|
145
|
-
Generator-->>User: Success summary
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Architectural Rules
|
|
149
|
-
|
|
150
|
-
- All file I/O must go through the I/O layer
|
|
151
|
-
- Core engine must not depend on CLI layer
|
|
152
|
-
- Templates must be stateless and deterministic
|
|
153
|
-
- Errors must provide actionable messages with file paths
|
|
154
|
-
- All public APIs must have TypeScript types
|
|
155
|
-
|
|
156
|
-
## Release Status
|
|
157
|
-
|
|
158
|
-
STATUS: Alpha
|
|
159
|
-
|
|
160
|
-
Core functionality implemented. API may change without notice.
|
|
161
|
-
|
|
162
|
-
## Developer Commands
|
|
163
|
-
|
|
164
|
-
- `npm install` — Install dependencies
|
|
165
|
-
- `npm run dev` — Run in development mode
|
|
166
|
-
- `npm test` — Run test suite
|
|
167
|
-
- `npm run lint` — Run linter
|
|
168
|
-
- `npm run build` — Build for production
|
|
169
|
-
|
|
170
|
-
## Change Log
|
|
171
|
-
|
|
172
|
-
- 1.0.0 (2025-01-10): Initial architecture
|
|
173
|
-
- 1.1.0 (2025-01-15): Added diff command
|
|
174
|
-
</example>
|
|
175
|
-
|
|
176
|
-
</schema>
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
<schema target-files=".awa/specs/DESIGN-{feature-name}.md">
|
|
2
|
-
|
|
3
|
-
```json
|
|
4
|
-
{
|
|
5
|
-
"description": "Design only. Succinct language. Do not overspecify. Omit irrelevant information.",
|
|
6
|
-
"required": ["overview", "architecture", "componentsAndInterfaces", "dataModels", "correctnessProperties", "errorHandling", "testingStrategy", "requirementsTraceability"],
|
|
7
|
-
"properties": {
|
|
8
|
-
"overview": { "type": "technical approach and rationale; reference REQ, do not restate" },
|
|
9
|
-
"architecture": {
|
|
10
|
-
"required": ["highLevelArchitecture", "moduleOrganization"],
|
|
11
|
-
"properties": {
|
|
12
|
-
"affectedLayers": { "type": "array of layer names" },
|
|
13
|
-
"highLevelArchitecture": { "properties": { "description": {}, "diagram": { "type": "mermaid" } } },
|
|
14
|
-
"moduleOrganization": { "properties": { "structure": { "type": "directory tree" }, "description": {} } },
|
|
15
|
-
"architecturalDecisions": { "type": "array", "items": { "$ref": "#/$defs/decision" } }
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"componentsAndInterfaces": { "type": "array", "items": { "$ref": "#/$defs/component" } },
|
|
19
|
-
"dataModels": {
|
|
20
|
-
"required": ["coreTypes"],
|
|
21
|
-
"properties": {
|
|
22
|
-
"coreTypes": { "type": "array", "items": { "$ref": "#/$defs/dataType" } },
|
|
23
|
-
"entities": { "type": "array", "items": { "$ref": "#/$defs/entity" } }
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"correctnessProperties": { "type": "array of formal invariants for property-based testing", "items": { "$ref": "#/$defs/property" } },
|
|
27
|
-
"errorHandling": {
|
|
28
|
-
"required": ["errorTypes", "strategy"],
|
|
29
|
-
"properties": {
|
|
30
|
-
"errorTypes": { "type": "array", "items": { "$ref": "#/$defs/errorType" } },
|
|
31
|
-
"strategy": { "properties": { "principles": { "type": "array of strings" } } }
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"testingStrategy": {
|
|
35
|
-
"required": ["propertyBasedTesting"],
|
|
36
|
-
"properties": {
|
|
37
|
-
"propertyBasedTesting": {
|
|
38
|
-
"required": ["framework", "minimumIterations"],
|
|
39
|
-
"properties": {
|
|
40
|
-
"framework": {},
|
|
41
|
-
"minimumIterations": { "type": "integer" },
|
|
42
|
-
"tagFormat": {},
|
|
43
|
-
"exampleTests": { "type": "array", "items": { "properties": { "propertyId": {}, "code": {} } } }
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
"unitTesting": { "properties": { "description": {}, "areas": { "type": "array" } } },
|
|
47
|
-
"integrationTesting": { "properties": { "description": {}, "scenarios": { "type": "array" } } }
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"requirementsTraceability": {
|
|
51
|
-
"required": ["source", "matrix"],
|
|
52
|
-
"properties": {
|
|
53
|
-
"source": { "type": "path to requirements file" },
|
|
54
|
-
"matrix": { "type": "array", "items": { "$ref": "#/$defs/traceEntry" } }
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"libraryUsage": {
|
|
58
|
-
"properties": {
|
|
59
|
-
"frameworkFeatures": { "type": "array", "items": { "properties": { "feature": {}, "usage": {} } } },
|
|
60
|
-
"externalLibraries": { "type": "array", "items": { "properties": { "name": {}, "version": {}, "purpose": {} } } }
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
"metadata": { "properties": { "changeLog": { "type": "array", "items": { "properties": { "version": {}, "date": {}, "changes": {} } } } } }
|
|
64
|
-
},
|
|
65
|
-
"$defs": {
|
|
66
|
-
"decision": { "required": ["decision", "rationale"], "properties": { "decision": {}, "rationale": {}, "alternatives": { "type": "array" } } },
|
|
67
|
-
"component": {
|
|
68
|
-
"required": ["name", "description", "interface"],
|
|
69
|
-
"properties": {
|
|
70
|
-
"name": { "type": "pattern: {CODE}-{ComponentName} (e.g., CLI-Parser, CFG-ConfigLoader)" },
|
|
71
|
-
"description": { "type": "HOW it works, not WHAT (WHAT is in ACs)" },
|
|
72
|
-
"implements": { "type": "array of AC IDs (e.g., CFG-1_AC-1, CFG-1_AC-2)" },
|
|
73
|
-
"interface": { "type": "code block" }
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
"dataType": { "required": ["name"], "properties": { "name": {}, "description": {}, "definition": { "type": "code block" } } },
|
|
77
|
-
"entity": { "required": ["name", "fields"], "properties": { "name": {}, "description": {}, "fields": { "type": "array", "items": { "properties": { "name": {}, "type": {}, "required": {}, "description": {} } } } } },
|
|
78
|
-
"property": {
|
|
79
|
-
"required": ["id", "name", "description", "validates"],
|
|
80
|
-
"properties": {
|
|
81
|
-
"id": { "type": "pattern: {CODE}_P-{n} (e.g., CFG_P-1, GEN_P-2)" },
|
|
82
|
-
"name": {},
|
|
83
|
-
"description": {},
|
|
84
|
-
"validates": { "type": "array of AC or REQ IDs (e.g., CFG-4_AC-1, GEN-6)" }
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"errorType": { "required": ["name", "variants"], "properties": { "name": {}, "description": {}, "variants": { "type": "array", "items": { "properties": { "name": {}, "description": {} } } } } },
|
|
88
|
-
"traceEntry": {
|
|
89
|
-
"required": ["criterionId", "componentName"],
|
|
90
|
-
"properties": {
|
|
91
|
-
"criterionId": { "type": "{CODE}-{n}[.{p}]_AC-{m}" },
|
|
92
|
-
"componentName": { "type": "{CODE}-{ComponentName}" },
|
|
93
|
-
"propertyId": { "type": "{CODE}_P-{n}" },
|
|
94
|
-
"status": { "enum": ["implemented", "partial", "deferred", "n/a"] },
|
|
95
|
-
"notes": {}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
"$render": {
|
|
100
|
-
"template": "# Design Specification\n\n## Overview\n{overview}\n\n## Architecture\n\nAFFECTED LAYERS: {affectedLayers?}\n\n### High-Level Architecture\n{architecture.highLevelArchitecture.description}\n\n```mermaid\n{architecture.highLevelArchitecture.diagram}\n```\n\n### Module Organization\n```\n{architecture.moduleOrganization.structure}\n```\n\n### Architectural Decisions\n{architecturalDecisions→'- {DECISION}: {rationale}. Alternatives: {alternatives?}'}\n\n## Components and Interfaces\n{componentsAndInterfaces→'### {name}\n\n{description}\n\nIMPLEMENTS: {implements?}\n\n```typescript\n{interface}\n```'}\n\n## Data Models\n\n### Core Types\n{dataModels.coreTypes→'- {NAME}: {description}\n```typescript\n{definition}\n```'}\n\n### Entities\n{dataModels.entities→'### {name}\n{description}\n{fields→\"- {NAME} ({type}, {required?}): {description}\"}'}\n\n## Correctness Properties\n{correctnessProperties→'- {id} [{name}]: {description}\n VALIDATES: {validates}'}\n\n## Error Handling\n{errorHandling.errorTypes→'### {name}\n{description}\n{variants→\"- {NAME}: {description}\"}'}\n\n### Strategy\nPRINCIPLES:\n{errorHandling.strategy.principles→'- {}'}\n\n## Testing Strategy\n\n### Property-Based Testing\n- FRAMEWORK: {testingStrategy.propertyBasedTesting.framework}\n- MINIMUM_ITERATIONS: {testingStrategy.propertyBasedTesting.minimumIterations}\n- TAG_FORMAT: {testingStrategy.propertyBasedTesting.tagFormat?}\n{testingStrategy.propertyBasedTesting.exampleTests→'```typescript\n// @awa-test: {propertyId}\n{CODE}\n```'}\n\n### Unit Testing\n{testingStrategy.unitTesting.description?}\n- AREAS: {testingStrategy.unitTesting.areas?}\n\n### Integration Testing\n{testingStrategy.integrationTesting.description?}\n- SCENARIOS: {testingStrategy.integrationTesting.scenarios?}\n\n## Requirements Traceability\nSOURCE: {requirementsTraceability.source}\n{requirementsTraceability.matrix→'- {criterionId} → {componentName} ({propertyId?}) [{status?|omit if implemented}] {notes?}'}\n\n## Library Usage\n\n### Framework Features\n{libraryUsage.frameworkFeatures→'- {FEATURE}: {usage}'}\n\n### External Libraries\n{libraryUsage.externalLibraries→'- {name} ({version}): {purpose}'}\n\n## Change Log\n{metadata.changeLog→'- {version} ({date}): {changes}'}",
|
|
101
|
-
"omit": ["section if empty", "AFFECTED LAYERS if absent", "IMPLEMENTS if empty", "(propertyId) if absent", "[status] if implemented", "notes/alternatives if empty"],
|
|
102
|
-
"prohibited": ["**bold** — use CAPITALS", "*italic*", "tables — use lists", "ASCII diagrams — use mermaid", "FieldName: value patterns", "restating WHAT (requirements) — describe HOW (design)"]
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
<example>
|
|
108
|
-
# Design Specification
|
|
109
|
-
|
|
110
|
-
## Overview
|
|
111
|
-
|
|
112
|
-
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.
|
|
113
|
-
|
|
114
|
-
## Architecture
|
|
115
|
-
|
|
116
|
-
AFFECTED LAYERS: CLI Layer, Core Engine, I/O Layer
|
|
117
|
-
|
|
118
|
-
### High-Level Architecture
|
|
119
|
-
|
|
120
|
-
Sequential pipeline for predictable flow and error handling.
|
|
121
|
-
|
|
122
|
-
```mermaid
|
|
123
|
-
flowchart LR
|
|
124
|
-
Args[CLI Args] --> Parser
|
|
125
|
-
Config[.awa.toml] --> ConfigLoader
|
|
126
|
-
Parser --> ConfigLoader
|
|
127
|
-
ConfigLoader --> Engine[TemplateEngine]
|
|
128
|
-
Engine --> Generator[FileGenerator]
|
|
129
|
-
Generator --> Files[Output]
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Module Organization
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
src/
|
|
136
|
-
├── cli/
|
|
137
|
-
│ └── index.ts
|
|
138
|
-
├── core/
|
|
139
|
-
│ ├── config.ts
|
|
140
|
-
│ ├── template.ts
|
|
141
|
-
│ └── generator.ts
|
|
142
|
-
└── utils/
|
|
143
|
-
└── fs.ts
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Architectural Decisions
|
|
147
|
-
|
|
148
|
-
- PIPELINE OVER EVENT: Sequential pipeline for predictable flow and error handling. Alternatives: event-driven, middleware chain
|
|
149
|
-
|
|
150
|
-
## Components and Interfaces
|
|
151
|
-
|
|
152
|
-
### CFG-ConfigLoader
|
|
153
|
-
|
|
154
|
-
Loads TOML configuration from file, merges with CLI arguments (CLI wins), and produces resolved options with defaults applied.
|
|
155
|
-
|
|
156
|
-
IMPLEMENTS: CFG-1_AC-1, CFG-1_AC-2, CFG-4_AC-1
|
|
157
|
-
|
|
158
|
-
```typescript
|
|
159
|
-
interface ConfigLoader {
|
|
160
|
-
load(configPath: string | null): Promise<FileConfig | null>;
|
|
161
|
-
merge(cli: RawCliOptions, file: FileConfig | null): ResolvedOptions;
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
## Data Models
|
|
166
|
-
|
|
167
|
-
### Core Types
|
|
168
|
-
|
|
169
|
-
- RESOLVED_OPTIONS: Fully resolved configuration with all defaults applied
|
|
170
|
-
|
|
171
|
-
```typescript
|
|
172
|
-
interface ResolvedOptions {
|
|
173
|
-
readonly output: string;
|
|
174
|
-
readonly template: string | null;
|
|
175
|
-
readonly features: readonly string[];
|
|
176
|
-
readonly force: boolean;
|
|
177
|
-
}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
## Correctness Properties
|
|
181
|
-
|
|
182
|
-
- CFG_P-1 [CLI Override]: CLI arguments always override config file values for the same option
|
|
183
|
-
VALIDATES: CFG-4_AC-1, CFG-4_AC-2
|
|
184
|
-
|
|
185
|
-
- GEN_P-2 [Dry Run Immutable]: Dry-run mode never modifies the file system
|
|
186
|
-
VALIDATES: GEN-6_AC-1, GEN-6_AC-2
|
|
187
|
-
|
|
188
|
-
## Error Handling
|
|
189
|
-
|
|
190
|
-
### ConfigError
|
|
191
|
-
|
|
192
|
-
Configuration loading and parsing errors
|
|
193
|
-
|
|
194
|
-
- FILE_NOT_FOUND: Config file does not exist when --config provided
|
|
195
|
-
- PARSE_ERROR: TOML syntax error with line number
|
|
196
|
-
|
|
197
|
-
### Strategy
|
|
198
|
-
|
|
199
|
-
PRINCIPLES:
|
|
200
|
-
|
|
201
|
-
- Fail fast on first error
|
|
202
|
-
- Provide actionable error messages with file paths
|
|
203
|
-
- Exit with non-zero code on any error
|
|
204
|
-
|
|
205
|
-
## Testing Strategy
|
|
206
|
-
|
|
207
|
-
### Property-Based Testing
|
|
208
|
-
|
|
209
|
-
- FRAMEWORK: fast-check
|
|
210
|
-
- MINIMUM_ITERATIONS: 100
|
|
211
|
-
- TAG_FORMAT: @awa-test: {CODE}_P-{n}
|
|
212
|
-
|
|
213
|
-
```typescript
|
|
214
|
-
// @awa-test: CFG_P-1
|
|
215
|
-
test.prop([fc.string(), fc.string()])('CLI overrides config', (cliValue, configValue) => {
|
|
216
|
-
const cli = { output: cliValue };
|
|
217
|
-
const config = { output: configValue };
|
|
218
|
-
const result = configLoader.merge(cli, config);
|
|
219
|
-
expect(result.output).toBe(cliValue);
|
|
220
|
-
});
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Unit Testing
|
|
224
|
-
|
|
225
|
-
Test individual components in isolation
|
|
226
|
-
|
|
227
|
-
- AREAS: CFG-ConfigLoader merge logic, TPL-TemplateResolver type detection
|
|
228
|
-
|
|
229
|
-
## Requirements Traceability
|
|
230
|
-
|
|
231
|
-
SOURCE: .awa/specs/REQ-CLI.md, .awa/specs/REQ-CFG.md
|
|
232
|
-
|
|
233
|
-
- CFG-1_AC-1 → CFG-ConfigLoader (CFG_P-1)
|
|
234
|
-
- CFG-4_AC-1 → CFG-ConfigLoader (CFG_P-1)
|
|
235
|
-
- GEN-6_AC-1 → GEN-FileGenerator (GEN_P-2) [partial] pending review
|
|
236
|
-
|
|
237
|
-
## Library Usage
|
|
238
|
-
|
|
239
|
-
### Framework Features
|
|
240
|
-
|
|
241
|
-
- CITTY: Command definition, argument parsing, help generation
|
|
242
|
-
|
|
243
|
-
### External Libraries
|
|
244
|
-
|
|
245
|
-
- citty (latest): CLI framework
|
|
246
|
-
- smol-toml (1.x): TOML parser
|
|
247
|
-
|
|
248
|
-
## Change Log
|
|
249
|
-
|
|
250
|
-
- 1.0.0 (2025-01-10): Initial design
|
|
251
|
-
</example>
|
|
252
|
-
|
|
253
|
-
</schema>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<schema target-files=".awa/specs/EXAMPLES-{CODE}-{feature-name}-{nnn}.md">
|
|
2
|
-
|
|
3
|
-
- Concrete usage examples for a feature. Detailed, hands-on, reproducible.
|
|
4
|
-
- Use the same {CODE} as the corresponding FEAT/REQ for the feature.
|
|
5
|
-
- Number files sequentially (-001, -002, ...) when splitting at the 500-line limit.
|
|
6
|
-
- Each example must have a title and context explaining what it demonstrates.
|
|
7
|
-
- Required: at least one example with title, context, and code/demonstration block.
|
|
8
|
-
- Optional: prerequisites, expected output, notes.
|
|
9
|
-
- Prohibited: normative language (SHALL/SHOULD/MAY), acceptance criteria, traceability IDs, design decisions.
|
|
10
|
-
- Mark the document as INFORMATIVE (not normative).
|
|
11
|
-
|
|
12
|
-
Example structure:
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
# Usage Examples: {Feature Name} [INFORMATIVE]
|
|
16
|
-
|
|
17
|
-
## Prerequisites
|
|
18
|
-
|
|
19
|
-
- Required tools, setup, or prior knowledge
|
|
20
|
-
|
|
21
|
-
## Example 1: {Title}
|
|
22
|
-
|
|
23
|
-
{Context — when to use this, what it demonstrates}
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
{CLI invocation or code}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
EXPECTED OUTPUT:
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
{expected result}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Example 2: {Title}
|
|
36
|
-
|
|
37
|
-
{Context}
|
|
38
|
-
|
|
39
|
-
```typescript
|
|
40
|
-
{code example}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
NOTES:
|
|
44
|
-
- Additional observations or caveats
|
|
45
|
-
|
|
46
|
-
## Change Log
|
|
47
|
-
|
|
48
|
-
- {version} ({date}): {changes}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
</schema>
|