aw-spec-cli 0.1.3 → 0.1.4
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 +291 -0
- package/assets/docs/UI.Visualization/PACKAGING.md +191 -0
- package/assets/docs/UI.Visualization/UI.Visualization.Reference.pack.txt +11768 -0
- package/assets/docs/UI.Visualization/UI.Visualization.pack.txt +11214 -0
- package/assets/docs/UI.Visualization/pack-foundation.ps1 +165 -0
- package/assets/docs/UI.Visualization/pack-foundation.sh +206 -0
- package/assets/docs/UI.Visualization/pack-reference-foundation.ps1 +159 -0
- package/assets/docs/UI.Visualization/pack-reference-foundation.sh +205 -0
- package/assets/docs/UI.Visualization/unpack-foundation.ps1 +126 -0
- package/assets/docs/UI.Visualization/unpack-foundation.sh +217 -0
- package/assets/docs/UI.Visualization/unpack-reference-foundation.ps1 +129 -0
- package/assets/docs/UI.Visualization/unpack-reference-foundation.sh +218 -0
- package/assets/docs/domainspecs/UIVisualization/chart-bubble.md +70 -0
- package/assets/docs/domainspecs/UIVisualization/chart-dimred.md +58 -0
- package/assets/docs/domainspecs/UIVisualization/chart-heatmap.md +62 -0
- package/assets/docs/domainspecs/UIVisualization/chart-network.md +69 -0
- package/assets/docs/domainspecs/UIVisualization/chart-parallel.md +75 -0
- package/assets/docs/domainspecs/UIVisualization/chart-scurve.md +66 -0
- package/assets/docs/domainspecs/UIVisualization/chart-survival.md +69 -0
- package/assets/docs/domainspecs/UIVisualization/chart-trellis.md +68 -0
- package/assets/docs/domainspecs/UIVisualization/chart-violin.md +61 -0
- package/assets/docs/domainspecs/UIVisualization/chart-volcano.md +63 -0
- package/assets/docs/domainspecs/UIVisualization/charting-standards.domain.md +80 -0
- package/assets/docs/domainspecs/UIVisualization/clean-architecture.domain.md +87 -0
- package/assets/docs/domainspecs/UIVisualization/coding-standards.domain.md +47 -0
- package/assets/docs/domainspecs/UIVisualization/comandrulemap.md +130 -0
- package/assets/docs/domainspecs/UIVisualization/component-contracts.domain.md +67 -0
- package/assets/docs/domainspecs/UIVisualization/data-source.domain.md +68 -0
- package/assets/docs/domainspecs/UIVisualization/domain-requirements.md +110 -0
- package/assets/docs/domainspecs/UIVisualization/folder-structure.domain.md +55 -0
- package/assets/docs/domainspecs/UIVisualization/state-management.domain.md +67 -0
- package/assets/docs/domainspecs/UIVisualization/testing.domain.md +52 -0
- package/assets/docs/domainspecs/UIVisualization/ui-viz-terms.md +39 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +54 -7
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +142 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/manifest.d.ts +31 -0
- package/dist/utils/manifest.d.ts.map +1 -0
- package/dist/utils/manifest.js +91 -0
- package/dist/utils/manifest.js.map +1 -0
- package/dist/utils/update-engine.d.ts +52 -0
- package/dist/utils/update-engine.d.ts.map +1 -0
- package/dist/utils/update-engine.js +203 -0
- package/dist/utils/update-engine.js.map +1 -0
- package/package.json +1 -1
- package/assets/docs/requirement-spec.txt +0 -15
package/README.md
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
# aw-spec-cli
|
|
2
|
+
|
|
3
|
+
**AppWeaver Spec-Driven Development CLI** — Scaffold projects with vertical slices, DDD, CQRS, and AI agent skills.
|
|
4
|
+
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
`aw-spec-cli` initializes new projects with the **AppWeaver Spec-Driven Development** structure:
|
|
12
|
+
|
|
13
|
+
- **Vertical Slice Architecture** — Feature-oriented, decoupled modules
|
|
14
|
+
- **Domain-Driven Design (DDD)** — Rich domain models, bounded contexts
|
|
15
|
+
- **CQRS** — Command/Query separation for scalable reads/writes
|
|
16
|
+
- **AI Agent Skills** — Ready-to-use skills for Claude Code, Antigravity, and KiloCode
|
|
17
|
+
|
|
18
|
+
The CLI copies a battle-tested project skeleton (from the [AppWeaver.Spec](https://dev.azure.com/bytestrone-labs/AppWeaver/_git/AppWeaver.Spec) reference implementation) into your target directory.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
### Global Install (via Azure Artifacts / npm)
|
|
25
|
+
```bash
|
|
26
|
+
# From Azure Artifacts (after publishing)
|
|
27
|
+
npm install -g aw-spec-cli
|
|
28
|
+
|
|
29
|
+
# Or use via npx
|
|
30
|
+
npx aw-spec-cli@latest init
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Local Development Install
|
|
34
|
+
```bash
|
|
35
|
+
# From the cloned repository
|
|
36
|
+
git clone https://dev.azure.com/bytestrone-labs/AppWeaver/_git/appweaver
|
|
37
|
+
cd platform/Appweaver.Spec.Cli
|
|
38
|
+
npm install
|
|
39
|
+
npm run build
|
|
40
|
+
# Then run via node
|
|
41
|
+
dist/index.js init
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Requires **Node.js ≥ 18**.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Quick Start
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Create a new project in the current directory
|
|
52
|
+
aw-spec init
|
|
53
|
+
|
|
54
|
+
# Or specify a target directory
|
|
55
|
+
aw-spec init my-project
|
|
56
|
+
|
|
57
|
+
# Non-interactive (uses Claude skills by default)
|
|
58
|
+
aw-spec init -y
|
|
59
|
+
|
|
60
|
+
# Choose agent explicitly
|
|
61
|
+
aw-spec init --agent antigravity
|
|
62
|
+
aw-spec init --agent kilocode
|
|
63
|
+
|
|
64
|
+
# Preview what would be copied (no changes)
|
|
65
|
+
aw-spec init --dry-run
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
After initialization:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Verify the installation
|
|
72
|
+
aw-spec doctor
|
|
73
|
+
|
|
74
|
+
# Start spec-driven development
|
|
75
|
+
aw-spec specify "Your feature description"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Commands
|
|
81
|
+
|
|
82
|
+
### `aw-spec init [directory]`
|
|
83
|
+
|
|
84
|
+
Initialize a new AppWeaver Spec project.
|
|
85
|
+
|
|
86
|
+
| Option | Description |
|
|
87
|
+
|--------|-------------|
|
|
88
|
+
| `directory` | Target directory (default: current directory) |
|
|
89
|
+
| `-a, --agent <agent>` | Agent skills to include: `claude`, `antigravity`, `kilocode` (default: prompt) |
|
|
90
|
+
| `-y, --yes` | Skip prompts, use defaults (Claude) |
|
|
91
|
+
| `--dry-run` | Show what would be copied without making changes |
|
|
92
|
+
|
|
93
|
+
**Copied structure:**
|
|
94
|
+
```
|
|
95
|
+
target-dir/
|
|
96
|
+
├── .aw-spec/ # Core spec configuration
|
|
97
|
+
│ ├── extensions.yml # Extension registry
|
|
98
|
+
│ ├── feature.json # Feature tracking
|
|
99
|
+
│ ├── workflows/ # Workflow definitions
|
|
100
|
+
│ ├── templates/ # Spec/plan/task templates
|
|
101
|
+
│ └── scripts/ # Bash/PowerShell helpers
|
|
102
|
+
├── docs/ # Documentation scaffold
|
|
103
|
+
│ ├── architecture/
|
|
104
|
+
│ ├── domain/
|
|
105
|
+
│ ├── governance/
|
|
106
|
+
│ ├── security/
|
|
107
|
+
│ ├── domainspecs/
|
|
108
|
+
│ ├── glossary/
|
|
109
|
+
│ ├── VerticalSlice/ # Vertical slice packaging
|
|
110
|
+
│ └── ...
|
|
111
|
+
└── .claude/skills/ # Or .agents/skills/, .kilocode/
|
|
112
|
+
├── aw-spec-specify/
|
|
113
|
+
├── aw-spec-plan/
|
|
114
|
+
├── aw-spec-implement/
|
|
115
|
+
└── ... (13 skills total)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### `aw-spec doctor`
|
|
119
|
+
|
|
120
|
+
Verify the project structure is complete and valid.
|
|
121
|
+
|
|
122
|
+
| Option | Description |
|
|
123
|
+
|--------|-------------|
|
|
124
|
+
| `-v, --verbose` | Show detailed output (lists all skills, missing items) |
|
|
125
|
+
|
|
126
|
+
**Checks performed:**
|
|
127
|
+
- Required folders: `.aw-spec/`, `docs/`
|
|
128
|
+
- Required config files: `extensions.yml`, `feature.json`, `init-options.json`, `integration.json`, `workflow-registry.json`
|
|
129
|
+
- Agent skills folder (`.claude/skills` or `.agents/skills`) with all 13 skills
|
|
130
|
+
- Documentation structure (`architecture/`, `domain/`, `governance/`, `security/`, `domainspecs/`, `glossary/`, `VerticalSlice/`)
|
|
131
|
+
- Vertical Slice packaging scripts (`pack-foundation.sh`, `unpack-foundation.sh`, `PACKAGING.md`)
|
|
132
|
+
- `.aw-spec` subdirectories (`extensions/`, `templates/`, `scripts/`, `workflows/`, `integrations/`, `memory/`)
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Agent Support
|
|
137
|
+
|
|
138
|
+
| Agent | Folder | Skills |
|
|
139
|
+
|-------|--------|--------|
|
|
140
|
+
| **Claude Code** | `.claude/skills/` | 13 skills (specify, plan, implement, tasks, clarify, analyze, checklist, foundation, constitution, select-domain, agent-context-update, addcomponent, taskstoissues) |
|
|
141
|
+
| **Antigravity** | `.agents/skills/` | Same 13 skills, Antigravity-compatible format |
|
|
142
|
+
| **KiloCode** | `.kilocode/` | Workflow definitions (`.md` files) |
|
|
143
|
+
|
|
144
|
+
Choose based on your AI assistant. Skills provide guided workflows for spec-driven development:
|
|
145
|
+
- `aw-spec-specify` — Write feature specifications
|
|
146
|
+
- `aw-spec-plan` — Create implementation plans
|
|
147
|
+
- `aw-spec-implement` — Generate code from plans
|
|
148
|
+
- `aw-spec-tasks` — Break down into executable tasks
|
|
149
|
+
- ... and more
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Project Structure (After Init)
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
my-project/
|
|
157
|
+
├── .aw-spec/
|
|
158
|
+
│ ├── extensions.yml
|
|
159
|
+
│ ├── feature.json
|
|
160
|
+
│ ├── init-options.json
|
|
161
|
+
│ ├── integration.json
|
|
162
|
+
│ ├── workflows/
|
|
163
|
+
│ │ └── workflow-registry.json
|
|
164
|
+
│ ├── extensions/
|
|
165
|
+
│ │ └── agent-context/
|
|
166
|
+
│ │ ├── scripts/
|
|
167
|
+
│ │ └── commands/
|
|
168
|
+
│ ├── templates/
|
|
169
|
+
│ │ ├── spec-template.md
|
|
170
|
+
│ │ ├── plan-template.md
|
|
171
|
+
│ │ └── tasks-template.md
|
|
172
|
+
│ ├── scripts/
|
|
173
|
+
│ │ └── bash/
|
|
174
|
+
│ │ └── common.sh
|
|
175
|
+
│ ├── integrations/
|
|
176
|
+
│ └── memory/
|
|
177
|
+
├── docs/
|
|
178
|
+
│ ├── architecture/
|
|
179
|
+
│ ├── domain/
|
|
180
|
+
│ ├── governance/
|
|
181
|
+
│ ├── security/
|
|
182
|
+
│ ├── domainspecs/
|
|
183
|
+
│ ├── glossary/
|
|
184
|
+
│ ├── interop/
|
|
185
|
+
│ ├── ModularMonolith/
|
|
186
|
+
│ ├── VerticalSlice/
|
|
187
|
+
│ │ ├── VerticalSlice.pack.txt
|
|
188
|
+
│ │ ├── PACKAGING.md
|
|
189
|
+
│ │ ├── pack-foundation.sh
|
|
190
|
+
│ │ └── unpack-foundation.sh
|
|
191
|
+
│ ├── command.txt
|
|
192
|
+
│ ├── components/
|
|
193
|
+
│ ├── pharma-constitution.my-ref.md
|
|
194
|
+
│ ├── requirement-spec.txt
|
|
195
|
+
│ ├── technology-constitution.md
|
|
196
|
+
│ └── README.md
|
|
197
|
+
└── .claude/skills/ # Or .agents/skills/, .kilocode/
|
|
198
|
+
├── aw-spec-addcomponent/
|
|
199
|
+
├── aw-spec-agent-context-update/
|
|
200
|
+
├── aw-spec-analyze/
|
|
201
|
+
├── aw-spec-checklist/
|
|
202
|
+
├── aw-spec-clarify/
|
|
203
|
+
├── aw-spec-constitution/
|
|
204
|
+
├── aw-spec-foundation/
|
|
205
|
+
├── aw-spec-implement/
|
|
206
|
+
├── aw-spec-plan/
|
|
207
|
+
├── aw-spec-select-domain/
|
|
208
|
+
├── aw-spec-specify/
|
|
209
|
+
├── aw-spec-tasks/
|
|
210
|
+
└── aw-spec-taskstoissues/
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Development
|
|
216
|
+
|
|
217
|
+
### Prerequisites
|
|
218
|
+
- Node.js ≥ 18
|
|
219
|
+
- The [AppWeaver.Spec](https://dev.azure.com/bytestrone-labs/AppWeaver/_git/AppWeaver.Spec) repository cloned as a sibling directory (for bundling assets)
|
|
220
|
+
|
|
221
|
+
### Scripts
|
|
222
|
+
| Command | Description |
|
|
223
|
+
|---------|-------------|
|
|
224
|
+
| `npm run build` | Compile TypeScript to `dist/` |
|
|
225
|
+
| `npm run bundle:content` | Copy assets from `../AppWeaver.Spec` → `assets/` |
|
|
226
|
+
| `npm run prepack` | Build + bundle (runs automatically on `npm publish`) |
|
|
227
|
+
| `npm test` | Run unit tests (Vitest) |
|
|
228
|
+
| `npm run test:watch` | Watch mode |
|
|
229
|
+
| `npm run lint` | ESLint on `src/` |
|
|
230
|
+
| `npm run doctor` | Run CLI doctor on current directory |
|
|
231
|
+
|
|
232
|
+
### Setup (Local Development)
|
|
233
|
+
```bash
|
|
234
|
+
# Clone the main repository
|
|
235
|
+
git clone https://dev.azure.com/bytestrone-labs/AppWeaver/_git/appweaver
|
|
236
|
+
cd platform/Appweaver.Spec.Cli
|
|
237
|
+
npm install
|
|
238
|
+
|
|
239
|
+
# Ensure AppWeaver.Spec is available for bundling
|
|
240
|
+
# Either clone it as a sibling directory:
|
|
241
|
+
# git clone https://dev.azure.com/bytestrone-labs/AppWeaver/_git/AppWeaver.Spec ../AppWeaver.Spec
|
|
242
|
+
# Or the bundling script will fall back to published assets in dist/assets/
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Setup (After Publishing to Azure Artifacts)
|
|
246
|
+
Once published to Azure Artifacts, consumers can install via:
|
|
247
|
+
```bash
|
|
248
|
+
# From Azure Artifacts / npm registry (after publishing)
|
|
249
|
+
npm install -g aw-spec-cli
|
|
250
|
+
|
|
251
|
+
# Or use directly via npx
|
|
252
|
+
npx aw-spec-cli@latest init
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## How It Works
|
|
258
|
+
|
|
259
|
+
1. **Asset Bundling** (`scripts/bundle-content.ts`) — On publish, copies the AppWeaver.Spec reference implementation into `assets/` (excludes build artifacts, secrets, VCS folders).
|
|
260
|
+
|
|
261
|
+
2. **Asset Resolution** (`src/utils/paths.ts`) — At runtime, finds assets in priority order:
|
|
262
|
+
- `dist/assets/` (published package)
|
|
263
|
+
- `../AppWeaver.Spec` (local development)
|
|
264
|
+
- `packageRoot/assets` (fallback)
|
|
265
|
+
|
|
266
|
+
3. **Project Initialization** (`src/commands/init.ts`) — Copies `.aw-spec/`, `docs/`, and the selected agent's skills to the target directory with overwrite protection.
|
|
267
|
+
|
|
268
|
+
4. **Validation** (`src/commands/doctor.ts`) — Comprehensive structure verification with colored output.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Contributing
|
|
273
|
+
|
|
274
|
+
1. Fork the repository
|
|
275
|
+
2. Create a feature branch: `git checkout -b feature/my-feature`
|
|
276
|
+
3. Make changes with tests
|
|
277
|
+
4. Run `npm run build && npm test && npm run lint`
|
|
278
|
+
5. Submit a PR
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## License
|
|
283
|
+
|
|
284
|
+
MIT © [AppWeaver Team](https://dev.azure.com/bytestrone-labs/AppWeaver)
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Related
|
|
289
|
+
|
|
290
|
+
- [AppWeaver.Spec](https://dev.azure.com/bytestrone-labs/AppWeaver/_git/AppWeaver.Spec) — Reference implementation & source of bundled assets
|
|
291
|
+
- [Spec-Driven Development](https://dev.azure.com/bytestrone-labs/AppWeaver/_git/AppWeaver.Spec?path=/docs/spec-driven-development.md) — Methodology overview
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# UI.Visualization — Foundation Packaging Rules
|
|
2
|
+
|
|
3
|
+
> **Why this exists.** This packaging model replaces reconstruction with a
|
|
4
|
+
> **byte-for-byte bundle of the real, verified Next.js template**.
|
|
5
|
+
>
|
|
6
|
+
> You author the UI foundation **once** (a Next.js app that actually builds and runs),
|
|
7
|
+
> pack it into a single text file, and the scaffolder **unpacks + renames** it.
|
|
8
|
+
> No regeneration, no drift — the same guarantee that `VerticalSlice` provides for the backend.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## The single artifact
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
docs/UI.Visualization/
|
|
16
|
+
├── UI.Visualization.pack.txt ← THE BUNDLE: every source file in one text file
|
|
17
|
+
├── PACKAGING.md ← this file
|
|
18
|
+
├── pack-foundation.ps1 ← produces the pack from the template folder (Windows)
|
|
19
|
+
├── pack-foundation.sh ← produces the pack from the template folder (macOS/Linux)
|
|
20
|
+
├── pack-reference-foundation.ps1 ← produces a reference/sample pack
|
|
21
|
+
├── pack-reference-foundation.sh
|
|
22
|
+
├── unpack-foundation.ps1 ← extracts + renames into a target app (used by skill)
|
|
23
|
+
├── unpack-foundation.sh
|
|
24
|
+
├── unpack-reference-foundation.ps1
|
|
25
|
+
└── unpack-reference-foundation.sh
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The source template lives at:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
templates/UI.Visualization/
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## The sentinel convention
|
|
37
|
+
|
|
38
|
+
The template is authored under the sentinel app name:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
UI.Visualization
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The scaffolder rewrites the sentinel in **four case forms** (ordinal, case-sensitive, longest-first),
|
|
45
|
+
applied to **file contents and to file/folder paths**:
|
|
46
|
+
|
|
47
|
+
| Form | Sentinel | Example target (`PharmaViz`) | Where it appears |
|
|
48
|
+
|--------------|--------------------------------|---------------------------------|-------------------------------------------|
|
|
49
|
+
| dotted | `UI.Visualization` | `PharmaViz` | `package.json` name (dotted form), README |
|
|
50
|
+
| underscored | `UI_Visualization` | `PharmaViz` | any underscored identifiers |
|
|
51
|
+
| lower-hyphen | `ui-visualization` | `pharmaviz` | npm package name, Docker image tag |
|
|
52
|
+
| lower-dot | `ui.visualization` | `pharmaviz` | any lowercased identifiers |
|
|
53
|
+
|
|
54
|
+
### What does NOT get renamed
|
|
55
|
+
|
|
56
|
+
- `AppWeaver.*` framework package references in `package.json` (there are none in this UI template — all deps are third-party).
|
|
57
|
+
- The generic sample pages (`/heatmap`, `/bubble`, etc.) — these are example content the caller replaces with their own pages.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## How to author the template (do this once per change)
|
|
62
|
+
|
|
63
|
+
1. Work in `templates/UI.Visualization/`.
|
|
64
|
+
|
|
65
|
+
2. Use `UI.Visualization` as the sentinel wherever the app name belongs:
|
|
66
|
+
- `package.json` → `"name": "ui-visualization"` (lower-hyphen form)
|
|
67
|
+
- `README.md` → title
|
|
68
|
+
- `src/app/layout.tsx` → `<title>UI.Visualization</title>` and metadata
|
|
69
|
+
- Any other branding strings
|
|
70
|
+
|
|
71
|
+
3. Verify the template builds and runs clean:
|
|
72
|
+
```bash
|
|
73
|
+
cd templates/UI.Visualization
|
|
74
|
+
npm install
|
|
75
|
+
npm run build # must exit 0, no TypeScript errors
|
|
76
|
+
npm run dev # browse to http://localhost:3000, all 10 chart pages render
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
4. Fix every error here, in the real template, where the compiler tells you exactly what's wrong.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## How to build the bundle
|
|
84
|
+
|
|
85
|
+
From `docs/UI.Visualization/`:
|
|
86
|
+
|
|
87
|
+
**macOS / Linux:**
|
|
88
|
+
```bash
|
|
89
|
+
./pack-foundation.sh \
|
|
90
|
+
--source-dir ../../../../templates/UI.Visualization \
|
|
91
|
+
--out-file ./UI.Visualization.pack.txt
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Windows (PowerShell):**
|
|
95
|
+
```powershell
|
|
96
|
+
./pack-foundation.ps1 `
|
|
97
|
+
-SourceDir ../../../../templates/UI.Visualization `
|
|
98
|
+
-OutFile ./UI.Visualization.pack.txt
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The packer:
|
|
102
|
+
- Walks the template, **excluding** build/IDE and JS output artifacts:
|
|
103
|
+
- dirs: `node_modules .next .turbo dist out coverage .cache bin obj .vs .git logs`
|
|
104
|
+
- files: `*.tsbuildinfo next-env.d.ts *.log .env.* *.pem *.key secrets.json`
|
|
105
|
+
- **Fails closed on detected secrets** — scans file contents for credential markers and refuses to pack unless `--allow-secrets` / `-AllowSecrets` is passed.
|
|
106
|
+
- Stores text files **verbatim** and binary files (e.g. `.xlsx`) **base64-encoded**.
|
|
107
|
+
- Writes a header containing `foundation`, `sentinel`, file count, format version, and the replacement contract.
|
|
108
|
+
- **Warns** if the sentinel token appears in zero files.
|
|
109
|
+
|
|
110
|
+
Re-run it whenever the template changes; commit the regenerated `UI.Visualization.pack.txt`.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## How to build the reference pack
|
|
115
|
+
|
|
116
|
+
The reference pack is used by `/aw-spec-addcomponent` and `/aw-spec-implement` unpack workflows
|
|
117
|
+
when a feature reference example exists under `templates/features/`.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
./pack-reference-foundation.sh \
|
|
121
|
+
--source-dir ../../../../templates/features/UIVisualization.SimpleSample \
|
|
122
|
+
--out-file ./UI.Visualization.Reference.pack.txt
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
*(Create the `SimpleSample` folder when you have a working feature example to bundle.)*
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Pack file format (`aw-spec-pack/v1`)
|
|
130
|
+
|
|
131
|
+
Same format as `VerticalSlice.pack.txt`:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
# AW-SPEC FOUNDATION PACK
|
|
135
|
+
# foundation: UI.Visualization
|
|
136
|
+
# sentinel: UI.Visualization
|
|
137
|
+
# generated: 2026-06-26T10:00:00.0000000Z
|
|
138
|
+
# files: 32
|
|
139
|
+
# format: aw-spec-pack/v1
|
|
140
|
+
# --- replacement contract ... ---
|
|
141
|
+
# ============================================================
|
|
142
|
+
|
|
143
|
+
<<<FILE path="package.json">>>
|
|
144
|
+
...verbatim file content...
|
|
145
|
+
<<<ENDFILE>>>
|
|
146
|
+
<<<FILE path="src/app/layout.tsx">>>
|
|
147
|
+
...
|
|
148
|
+
<<<ENDFILE>>>
|
|
149
|
+
<<<FILE path="public/sample-data.xlsx" encoding="base64">>>
|
|
150
|
+
AAABAAE...
|
|
151
|
+
<<<ENDFILE>>>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## How scaffolding consumes the bundle
|
|
157
|
+
|
|
158
|
+
`/aw-spec-foundation UI.Visualization <AppName> [OutputDir]`
|
|
159
|
+
runs `unpack-foundation.sh` (or `.ps1`), which reads the sentinel from the pack header,
|
|
160
|
+
derives the four target case forms, and writes the renamed files to the output directory.
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# macOS / Linux
|
|
164
|
+
./unpack-foundation.sh \
|
|
165
|
+
--pack-file ./UI.Visualization.pack.txt \
|
|
166
|
+
--target-app-name PharmaViz \
|
|
167
|
+
--out-dir ~/projects/
|
|
168
|
+
|
|
169
|
+
# Windows
|
|
170
|
+
./unpack-foundation.ps1 `
|
|
171
|
+
-PackFile ./UI.Visualization.pack.txt `
|
|
172
|
+
-TargetAppName PharmaViz `
|
|
173
|
+
-OutDir ~/projects/
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
After unpacking:
|
|
177
|
+
```bash
|
|
178
|
+
cd ~/projects/PharmaViz # or wherever OutDir puts it
|
|
179
|
+
npm install
|
|
180
|
+
npm run dev # → http://localhost:3000
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Maintenance checklist
|
|
186
|
+
|
|
187
|
+
- [ ] Template builds clean (`npm run build`, no TypeScript errors).
|
|
188
|
+
- [ ] Sentinel `UI.Visualization` appears in `package.json`, `README.md`, `layout.tsx`.
|
|
189
|
+
- [ ] No `node_modules/`, `.next/`, or generated files committed into the pack.
|
|
190
|
+
- [ ] `pack-foundation.sh` reported a non-zero sentinel hit count.
|
|
191
|
+
- [ ] `UI.Visualization.pack.txt` regenerated and committed after any change.
|