@ncoderz/awa 1.0.0 → 1.1.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/index.js +2307 -128
- 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/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/.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/.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/.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/.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/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/.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/.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/.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/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/{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/_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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncoderz/awa",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "awa is an Agent Workflow for AIs. It is also a CLI tool to powerfully manage agent workflow files using templates.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,14 +16,15 @@
|
|
|
16
16
|
"init": "tsx scripts/init.ts",
|
|
17
17
|
"dev": "tsx src/cli/index.ts",
|
|
18
18
|
"start": "node dist/index.js",
|
|
19
|
-
"build": "npm run init && npm run lint && npm run typecheck:all && tsup",
|
|
19
|
+
"build": "npm run init && npm run check && npm run lint && npm run typecheck:all && tsup",
|
|
20
20
|
"gen:example": "tsx src/cli/index.ts generate ./outputs/example --template ./templates/example",
|
|
21
21
|
"gen:awa": "tsx src/cli/index.ts generate ./outputs/awa --template ./templates/awa",
|
|
22
|
-
"gen:awa:this": "tsx src/cli/index.ts generate . --template ./templates/awa copilot",
|
|
22
|
+
"gen:awa:this": "tsx src/cli/index.ts generate . --template ./templates/awa --features copilot",
|
|
23
23
|
"diff:awa:this": "tsx src/cli/index.ts diff . --template ./templates/awa --features copilot",
|
|
24
24
|
"test": "vitest run",
|
|
25
25
|
"test:watch": "vitest",
|
|
26
26
|
"test:coverage": "vitest run --coverage",
|
|
27
|
+
"check": "npm run dev -- check",
|
|
27
28
|
"lint": "biome check --error-on-warnings .",
|
|
28
29
|
"lint:fix": "biome check --error-on-warnings --fix .",
|
|
29
30
|
"format": "biome format --write .",
|
|
@@ -63,11 +64,16 @@
|
|
|
63
64
|
"diff": "^8.0.3",
|
|
64
65
|
"eta": "^4.5.1",
|
|
65
66
|
"isbinaryfile": "^6.0.0",
|
|
66
|
-
"
|
|
67
|
+
"remark-gfm": "^4.0.1",
|
|
68
|
+
"remark-parse": "^11.0.0",
|
|
69
|
+
"smol-toml": "^1.6.0",
|
|
70
|
+
"unified": "^11.0.5",
|
|
71
|
+
"yaml": "^2.8.2"
|
|
67
72
|
},
|
|
68
73
|
"devDependencies": {
|
|
69
74
|
"@biomejs/biome": "^2",
|
|
70
75
|
"@types/degit": "^2.8.6",
|
|
76
|
+
"@types/mdast": "^4.0.4",
|
|
71
77
|
"@types/node": "^25.3.0",
|
|
72
78
|
"@vitest/coverage-v8": "^4.0.18",
|
|
73
79
|
"fast-check": "^4.5.3",
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Structural rules for ALIGN-{x}-WITH-{y}-{nnn}.md files
|
|
2
|
+
target-files: ".awa/align/ALIGN-*.md"
|
|
3
|
+
description: >
|
|
4
|
+
Alignment report comparing a source artifact (x) with a target artifact (y).
|
|
5
|
+
Each finding has a severity (CRITICAL/MAJOR/MINOR/INFO), confidence
|
|
6
|
+
(CERTAIN/LIKELY/UNCERTAIN), and type (MISSING/DIFFERENCE/CONFLICT/INCOMPLETE/
|
|
7
|
+
UNTESTED/ORPHAN/SUPERSET). Findings are checkbox items with SOURCE, TARGET,
|
|
8
|
+
ISSUE, and RESOLUTION fields. Summary section has severity counts and STATUS.
|
|
9
|
+
line-limit: 500
|
|
10
|
+
|
|
11
|
+
sections:
|
|
12
|
+
# Top-level heading
|
|
13
|
+
- heading: "ALIGNMENT REPORT"
|
|
14
|
+
level: 1
|
|
15
|
+
required: true
|
|
16
|
+
description: >
|
|
17
|
+
Document title followed by the comparison line:
|
|
18
|
+
{source-artifact} ↔ {target-artifact}
|
|
19
|
+
Then a list of findings as checkbox items.
|
|
20
|
+
contains:
|
|
21
|
+
# Findings are checkbox list items
|
|
22
|
+
- list:
|
|
23
|
+
pattern: "\\[[ x]\\].*\\b(CRITICAL|MAJOR|MINOR|INFO)\\b"
|
|
24
|
+
min: 1
|
|
25
|
+
label: "finding items"
|
|
26
|
+
description: >
|
|
27
|
+
Checkbox items for each finding. Format:
|
|
28
|
+
- [ ] N. {SEVERITY} [{CONFIDENCE}] {TYPE}
|
|
29
|
+
SOURCE: {location}
|
|
30
|
+
> {source text}
|
|
31
|
+
TARGET: {location}
|
|
32
|
+
> {target text}
|
|
33
|
+
ISSUE: {description}
|
|
34
|
+
RESOLUTION: {action}
|
|
35
|
+
required: false
|
|
36
|
+
|
|
37
|
+
# Summary section
|
|
38
|
+
- heading: "Summary"
|
|
39
|
+
level: 2
|
|
40
|
+
required: true
|
|
41
|
+
description: >
|
|
42
|
+
Severity counts and pass/fail status. Format:
|
|
43
|
+
CRITICAL: {n}
|
|
44
|
+
MAJOR: {n}
|
|
45
|
+
MINOR: {n}
|
|
46
|
+
INFO: {n}
|
|
47
|
+
STATUS: PASSED or FAILED
|
|
48
|
+
contains:
|
|
49
|
+
- pattern: "^(CRITICAL|MAJOR|MINOR|INFO):"
|
|
50
|
+
label: "severity count"
|
|
51
|
+
description: "One line per severity level with count."
|
|
52
|
+
- pattern: "^STATUS:"
|
|
53
|
+
label: "STATUS line"
|
|
54
|
+
description: "STATUS: PASSED or STATUS: FAILED (with optional emoji)."
|
|
55
|
+
|
|
56
|
+
example: |
|
|
57
|
+
# ALIGNMENT REPORT
|
|
58
|
+
|
|
59
|
+
DESIGN-WKS-workspace.md ↔ src/workspace/**
|
|
60
|
+
|
|
61
|
+
- [ ] 1. CRITICAL [CERTAIN] MISSING
|
|
62
|
+
SOURCE: WKS-WorkspaceConfig (IMPLEMENTS: WKS-1_AC-1)
|
|
63
|
+
> pub fn load(root: &Path) -> Result<Self, WorkspaceError>
|
|
64
|
+
TARGET: (not found)
|
|
65
|
+
ISSUE: Design component declares IMPLEMENTS: WKS-1_AC-1, but no code file contains @awa-component: WKS-WorkspaceConfig.
|
|
66
|
+
RESOLUTION: Add @awa-component: WKS-WorkspaceConfig to src/workspace/config.rs
|
|
67
|
+
|
|
68
|
+
- [ ] 2. MAJOR [CERTAIN] DIFFERENCE
|
|
69
|
+
SOURCE: WKS-WorkspaceValidator (IMPLEMENTS: WKS-2_AC-3)
|
|
70
|
+
> fn validate(&self) -> Result<(), ValidationError>
|
|
71
|
+
TARGET: src/workspace/validator.rs:45
|
|
72
|
+
> fn validate(&self) -> bool
|
|
73
|
+
ISSUE: Return type mismatch. Design specifies Result but implementation returns bool.
|
|
74
|
+
RESOLUTION: Update validator.rs to return Result<(), ValidationError>
|
|
75
|
+
|
|
76
|
+
## Summary
|
|
77
|
+
|
|
78
|
+
CRITICAL: 1
|
|
79
|
+
MAJOR: 1
|
|
80
|
+
MINOR: 0
|
|
81
|
+
INFO: 0
|
|
82
|
+
|
|
83
|
+
STATUS: FAILED
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Structural rules for API-{CODE}-{api-name}.tsp files
|
|
2
|
+
target-files: ".awa/specs/API-*.tsp"
|
|
3
|
+
description: >
|
|
4
|
+
TypeSpec API specification. Defines major APIs using TypeSpec format
|
|
5
|
+
conventions. Write in TypeSpec unless explicitly requested otherwise.
|
|
6
|
+
One file per API surface area, named with the feature CODE prefix.
|
|
7
|
+
line-limit: 500
|
|
@@ -0,0 +1,260 @@
|
|
|
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
|
+
# Technology Stack section
|
|
36
|
+
- heading: "Technology Stack"
|
|
37
|
+
level: 2
|
|
38
|
+
required: true
|
|
39
|
+
description: >
|
|
40
|
+
Bullet list of technologies with major version only.
|
|
41
|
+
Format: - `{Technology N}` — {purpose}
|
|
42
|
+
|
|
43
|
+
# High-Level Architecture section with mermaid diagram
|
|
44
|
+
- heading: "High-Level Architecture"
|
|
45
|
+
level: 2
|
|
46
|
+
required: true
|
|
47
|
+
description: >
|
|
48
|
+
Mermaid diagram showing components, data flow, and dependencies.
|
|
49
|
+
Must include a mermaid code block.
|
|
50
|
+
contains:
|
|
51
|
+
- code-block: true
|
|
52
|
+
label: "architecture diagram (mermaid)"
|
|
53
|
+
description: "Mermaid diagram (flowchart, sequence, etc.) showing the architecture."
|
|
54
|
+
|
|
55
|
+
# Directory Structure section
|
|
56
|
+
- heading: "Directory Structure"
|
|
57
|
+
level: 2
|
|
58
|
+
required: true
|
|
59
|
+
description: >
|
|
60
|
+
Code block with directory tree showing source layout.
|
|
61
|
+
Format: path/ # description
|
|
62
|
+
contains:
|
|
63
|
+
- code-block: true
|
|
64
|
+
label: "directory tree"
|
|
65
|
+
description: "Plain text directory tree with inline comments."
|
|
66
|
+
|
|
67
|
+
# Component Details section
|
|
68
|
+
- heading: "Component Details"
|
|
69
|
+
level: 2
|
|
70
|
+
required: true
|
|
71
|
+
description: >
|
|
72
|
+
One H3 per major component. Each component has a single-sentence
|
|
73
|
+
description, RESPONSIBILITIES list, and optional CONSTRAINTS list.
|
|
74
|
+
children:
|
|
75
|
+
- heading: ".*"
|
|
76
|
+
level: 3
|
|
77
|
+
repeatable: true
|
|
78
|
+
required: true
|
|
79
|
+
description: >
|
|
80
|
+
Component heading. Contains a single-sentence description,
|
|
81
|
+
RESPONSIBILITIES bullet list, and optional CONSTRAINTS bullet list.
|
|
82
|
+
contains:
|
|
83
|
+
- pattern: "RESPONSIBILITIES"
|
|
84
|
+
label: "RESPONSIBILITIES section"
|
|
85
|
+
description: "Keyword followed by a bullet list of component responsibilities."
|
|
86
|
+
|
|
87
|
+
# Component Interactions section
|
|
88
|
+
- heading: "Component Interactions"
|
|
89
|
+
level: 2
|
|
90
|
+
required: true
|
|
91
|
+
description: >
|
|
92
|
+
Describes how components communicate. May include mermaid sequence
|
|
93
|
+
diagrams as H3 subsections.
|
|
94
|
+
|
|
95
|
+
# Architectural Rules section
|
|
96
|
+
- heading: "Architectural Rules"
|
|
97
|
+
level: 2
|
|
98
|
+
required: true
|
|
99
|
+
description: >
|
|
100
|
+
Bullet list of rules covering performance, scaling, maintainability,
|
|
101
|
+
security, and testing constraints.
|
|
102
|
+
|
|
103
|
+
# Release Status section (optional)
|
|
104
|
+
- heading: "Release Status"
|
|
105
|
+
level: 2
|
|
106
|
+
description: >
|
|
107
|
+
Current release phase (Alpha, Beta, RC, GA) with brief description.
|
|
108
|
+
Format: STATUS: {phase} - {description}
|
|
109
|
+
|
|
110
|
+
# Developer Commands section
|
|
111
|
+
- heading: "Developer Commands"
|
|
112
|
+
level: 2
|
|
113
|
+
required: true
|
|
114
|
+
description: >
|
|
115
|
+
Bullet list of essential developer commands.
|
|
116
|
+
Format: - `{command}` - {description}
|
|
117
|
+
|
|
118
|
+
# Change Log section (optional)
|
|
119
|
+
- heading: "Change Log"
|
|
120
|
+
level: 2
|
|
121
|
+
description: "Version history. Format: - {version} ({date}): {changes}"
|
|
122
|
+
|
|
123
|
+
sections-prohibited:
|
|
124
|
+
- "**"
|
|
125
|
+
|
|
126
|
+
example: |
|
|
127
|
+
# Architecture
|
|
128
|
+
|
|
129
|
+
## Project Purpose
|
|
130
|
+
|
|
131
|
+
awa CLI generates AI coding agent configuration files from templates, enabling developers to quickly scaffold consistent agent setups across projects.
|
|
132
|
+
|
|
133
|
+
## System Overview
|
|
134
|
+
|
|
135
|
+
- CLI Layer
|
|
136
|
+
- Core Engine
|
|
137
|
+
- Template System
|
|
138
|
+
- I/O Layer
|
|
139
|
+
|
|
140
|
+
## Technology Stack
|
|
141
|
+
|
|
142
|
+
- `Node.js 20` — Runtime environment
|
|
143
|
+
- `TypeScript 5` — Type-safe development
|
|
144
|
+
- `Eta 3` — Template rendering
|
|
145
|
+
- `Citty` — CLI framework
|
|
146
|
+
|
|
147
|
+
## High-Level Architecture
|
|
148
|
+
|
|
149
|
+
```mermaid
|
|
150
|
+
flowchart LR
|
|
151
|
+
subgraph Input
|
|
152
|
+
Args[CLI Args]
|
|
153
|
+
Config[.awa.toml]
|
|
154
|
+
Templates[Templates]
|
|
155
|
+
end
|
|
156
|
+
subgraph Core
|
|
157
|
+
Parser[ArgumentParser]
|
|
158
|
+
Engine[TemplateEngine]
|
|
159
|
+
Generator[FileGenerator]
|
|
160
|
+
end
|
|
161
|
+
subgraph Output
|
|
162
|
+
Files[Generated Files]
|
|
163
|
+
end
|
|
164
|
+
Args --> Parser
|
|
165
|
+
Config --> Parser
|
|
166
|
+
Parser --> Engine
|
|
167
|
+
Templates --> Engine
|
|
168
|
+
Engine --> Generator
|
|
169
|
+
Generator --> Files
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Directory Structure
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
src/ # Source code
|
|
176
|
+
src/cli/ # CLI entry and commands
|
|
177
|
+
src/core/ # Core engine logic
|
|
178
|
+
src/utils/ # Shared utilities
|
|
179
|
+
templates/ # Bundled templates
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Component Details
|
|
183
|
+
|
|
184
|
+
### CLI Layer
|
|
185
|
+
|
|
186
|
+
Handles argument parsing and command dispatch.
|
|
187
|
+
|
|
188
|
+
RESPONSIBILITIES
|
|
189
|
+
|
|
190
|
+
- Parse CLI arguments and options
|
|
191
|
+
- Load and merge configuration
|
|
192
|
+
- Dispatch to appropriate command handlers
|
|
193
|
+
|
|
194
|
+
CONSTRAINTS
|
|
195
|
+
|
|
196
|
+
- Must fail fast on invalid arguments
|
|
197
|
+
- Must support --help and --version
|
|
198
|
+
|
|
199
|
+
### Template Engine
|
|
200
|
+
|
|
201
|
+
Renders templates with feature flag context.
|
|
202
|
+
|
|
203
|
+
RESPONSIBILITIES
|
|
204
|
+
|
|
205
|
+
- Load templates from local or remote sources
|
|
206
|
+
- Render with Eta templating
|
|
207
|
+
- Detect empty output for conditional file creation
|
|
208
|
+
|
|
209
|
+
### File Generator
|
|
210
|
+
|
|
211
|
+
Writes rendered output to the file system.
|
|
212
|
+
|
|
213
|
+
RESPONSIBILITIES
|
|
214
|
+
|
|
215
|
+
- Write files with conflict detection
|
|
216
|
+
- Support dry-run mode
|
|
217
|
+
- Generate diff output
|
|
218
|
+
|
|
219
|
+
## Component Interactions
|
|
220
|
+
|
|
221
|
+
The CLI parses arguments, loads configuration, then passes resolved options to the template engine which renders files through the generator.
|
|
222
|
+
|
|
223
|
+
### Generate Command Flow
|
|
224
|
+
|
|
225
|
+
```mermaid
|
|
226
|
+
sequenceDiagram
|
|
227
|
+
participant User
|
|
228
|
+
participant CLI
|
|
229
|
+
participant Engine
|
|
230
|
+
participant Generator
|
|
231
|
+
User->>CLI: awa generate
|
|
232
|
+
CLI->>Engine: render(templates, features)
|
|
233
|
+
Engine->>Generator: write(files)
|
|
234
|
+
Generator-->>User: Success summary
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Architectural Rules
|
|
238
|
+
|
|
239
|
+
- All file I/O must go through the I/O layer
|
|
240
|
+
- Core engine must not depend on CLI layer
|
|
241
|
+
- Templates must be stateless and deterministic
|
|
242
|
+
- Errors must provide actionable messages with file paths
|
|
243
|
+
- All public APIs must have TypeScript types
|
|
244
|
+
|
|
245
|
+
## Release Status
|
|
246
|
+
|
|
247
|
+
STATUS: Alpha — Core functionality implemented. API may change without notice.
|
|
248
|
+
|
|
249
|
+
## Developer Commands
|
|
250
|
+
|
|
251
|
+
- `npm install` — Install dependencies
|
|
252
|
+
- `npm run dev` — Run in development mode
|
|
253
|
+
- `npm test` — Run test suite
|
|
254
|
+
- `npm run lint` — Run linter
|
|
255
|
+
- `npm run build` — Build for production
|
|
256
|
+
|
|
257
|
+
## Change Log
|
|
258
|
+
|
|
259
|
+
- 1.0.0 (2025-01-10): Initial architecture
|
|
260
|
+
- 1.1.0 (2025-01-15): Added diff command
|