procedure-cli 0.1.11 → 0.1.12
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/CODE-FIXED.md +26 -0
- package/CODE-REVIEW.md +45 -0
- package/README.md +93 -69
- package/dist/cli.js +12 -0
- package/dist/cli.js.map +1 -1
- package/docs/PRD.md +54 -44
- package/docs/USER-STORIES.md +181 -98
- package/package.json +1 -1
- package/src/cli.tsx +13 -0
package/CODE-FIXED.md
CHANGED
|
@@ -169,3 +169,29 @@ None.
|
|
|
169
169
|
- `rg "dimColor|color=\"(cyan|green|red|yellow|blue|magenta|white|black)\"" -n src`: no matches
|
|
170
170
|
|
|
171
171
|
---
|
|
172
|
+
## Entry 2026-02-22
|
|
173
|
+
|
|
174
|
+
### Entry ID
|
|
175
|
+
- `CF-20260222-006`
|
|
176
|
+
|
|
177
|
+
### Source Review
|
|
178
|
+
- `CR-20260222-004` (CODE-REVIEW.md entry 2026-02-22)
|
|
179
|
+
|
|
180
|
+
### Fixes Applied
|
|
181
|
+
|
|
182
|
+
1. Finding #12 (Medium) — **Fixed**
|
|
183
|
+
- `src/cli.tsx:11` — Replaced hard-stop behavior with warning-only messaging when directory is non-empty.
|
|
184
|
+
- `src/cli.tsx:13` — Added explicit note that existing files may be overwritten during Step 6, preserving the intended Generation conflict-confirmation flow.
|
|
185
|
+
- `src/cli.tsx:16` — Removed process exit path so wizard continues and existing overwrite warnings in Generation remain reachable.
|
|
186
|
+
|
|
187
|
+
2. Finding #13 (Low) — **Fixed**
|
|
188
|
+
- `src/cli.tsx:16` — Updated setup hint to include both valid invocations: `npx procedure-cli` and `npx @b3awesome/procedure`, avoiding single-command drift.
|
|
189
|
+
|
|
190
|
+
### Deferred
|
|
191
|
+
None.
|
|
192
|
+
|
|
193
|
+
### Verification Notes
|
|
194
|
+
- `npm run typecheck`: pass
|
|
195
|
+
- `npm run build`: pass
|
|
196
|
+
|
|
197
|
+
---
|
package/CODE-REVIEW.md
CHANGED
|
@@ -384,3 +384,48 @@
|
|
|
384
384
|
|
|
385
385
|
### Residual Risks / Testing Gaps
|
|
386
386
|
- No snapshot/UI regression tests currently enforce theme consistency rules across wizard steps.
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Entry 2026-02-22
|
|
391
|
+
|
|
392
|
+
### Entry ID
|
|
393
|
+
- `CR-20260222-004`
|
|
394
|
+
|
|
395
|
+
### Supersedes
|
|
396
|
+
- `CR-20260222-003`
|
|
397
|
+
|
|
398
|
+
### Scope
|
|
399
|
+
- New review cycle after recent CLI pre-flight and documentation updates.
|
|
400
|
+
- Validate latest fixed findings and check for regressions in runtime behavior.
|
|
401
|
+
|
|
402
|
+
### Validation Matrix
|
|
403
|
+
| Finding # | Previous Severity | Current Status | Evidence | Notes |
|
|
404
|
+
|-----------|-------------------|----------------|----------|-------|
|
|
405
|
+
| 11 | Low | Fixed | `CODE-FIXED.md:188`, `src/steps/build-test.tsx:68` | Theme consistency fix remains present (`color={C.overlay1}` in Build & Test default hint). |
|
|
406
|
+
|
|
407
|
+
### Findings (ordered by severity)
|
|
408
|
+
1. Medium - New empty-directory hard stop regresses overwrite-confirmation flow (`Finding #12`, `Status: New`)
|
|
409
|
+
- `src/cli.tsx:7`
|
|
410
|
+
- `src/cli.tsx:8`
|
|
411
|
+
- `src/steps/generation.tsx:45`
|
|
412
|
+
- `src/steps/generation.tsx:139`
|
|
413
|
+
- `src/lib/template.ts:40`
|
|
414
|
+
- CLI now exits before wizard render when cwd has any entries. This bypasses the existing generation-stage conflict detection and explicit overwrite confirmation (`checkConflicts` + "⚠ Will overwrite"), removing a previously supported safe path for regeneration in non-empty directories.
|
|
415
|
+
- Recommendation: downgrade pre-flight to a warning (not hard exit), or gate strict-empty behavior behind an explicit flag while preserving Step 6 overwrite confirmation.
|
|
416
|
+
|
|
417
|
+
2. Low - Empty-directory guidance command is inconsistent with repo package metadata (`Finding #13`, `Status: New`)
|
|
418
|
+
- `src/cli.tsx:15`
|
|
419
|
+
- `package.json:2`
|
|
420
|
+
- Error guidance suggests `npx @b3awesome/procedure`, but repository package metadata is `procedure-cli` with bin `procedure`. This can mislead contributors running the package directly from this repo context.
|
|
421
|
+
- Recommendation: derive suggested invocation from package metadata/config (single source of truth) or print both supported invocations explicitly.
|
|
422
|
+
|
|
423
|
+
### Verification Notes
|
|
424
|
+
- Procedure compliance: read latest `CODE-REVIEW.md` and `CODE-FIXED.md` before this review.
|
|
425
|
+
- `npm run typecheck`: pass.
|
|
426
|
+
- `npm run build`: pass.
|
|
427
|
+
- Reviewed local working-tree diffs in `README.md`, `docs/PRD.md`, `docs/USER-STORIES.md`, and `src/cli.tsx`.
|
|
428
|
+
|
|
429
|
+
### Residual Risks / Testing Gaps
|
|
430
|
+
- No integration test for behavior in non-empty directories vs regeneration flow (`checkConflicts` path).
|
|
431
|
+
- No test that validates CLI guidance text stays aligned with actual package/bin invocation names.
|
package/README.md
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
# Procedure CLI
|
|
2
2
|
|
|
3
|
-
Interactive CLI wizard that scaffolds projects with
|
|
3
|
+
Interactive CLI wizard that scaffolds new projects with a battle-tested `CLAUDE.md`, PRD, user stories, and optional tooling setup. Inspired by [Skills.sh](https://skills.sh) visual style.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Requirements
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Must be run in an **empty directory**. If the directory has existing files, the CLI exits with a helpful message.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
mkdir my-project && cd my-project
|
|
11
|
+
npx @b3awesome/procedure
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## What It Generates
|
|
8
15
|
|
|
9
16
|
| File | Purpose |
|
|
10
17
|
|------|---------|
|
|
11
|
-
| `CLAUDE.md` | AI-ready development guide with architecture, code style, workflow |
|
|
18
|
+
| `CLAUDE.md` | AI-ready development guide with architecture, code style, and workflow |
|
|
12
19
|
| `README.md` | Project overview with quick start, tech stack, and docs links |
|
|
13
|
-
| `docs/PRD.md` | Product Requirements Document with vision, features, tech stack |
|
|
20
|
+
| `docs/PRD.md` | Product Requirements Document with vision, features, and tech stack |
|
|
14
21
|
| `docs/USER-STORIES.md` | Gherkin-formatted acceptance criteria and user stories |
|
|
15
22
|
| `.env.example` | Environment variables template |
|
|
16
|
-
| `.gitignore` |
|
|
17
|
-
|
|
18
|
-
## Quick Start
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
npx procedure-cli
|
|
22
|
-
```
|
|
23
|
+
| `.gitignore` | Language/framework-appropriate git ignore defaults |
|
|
23
24
|
|
|
24
25
|
## Visual Style
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
Catppuccin Mocha color theme with a Skills.sh-inspired vertical timeline:
|
|
27
28
|
|
|
28
29
|
```
|
|
29
30
|
█▀█ █▀█ █▀█ █▀▀ █▀▀ █▀▄ █ █ █▀█ █▀▀
|
|
@@ -32,96 +33,119 @@ Procedure CLI uses a Skills.sh / @clack/prompts-inspired vertical timeline UI:
|
|
|
32
33
|
Bootstrap any project with a battle-tested
|
|
33
34
|
CLAUDE.md, PRD, user stories, and powerline.
|
|
34
35
|
───────────────────────────────────────────
|
|
35
|
-
|
|
36
|
-
│
|
|
36
|
+
┌
|
|
37
|
+
│ ◇ Project Info
|
|
38
|
+
│ my-app — A task management tool
|
|
37
39
|
│
|
|
38
|
-
◆ Stack & Style
|
|
39
|
-
│ ❯
|
|
40
|
-
│
|
|
40
|
+
│ ◆ Stack & Style ← animated dot while active
|
|
41
|
+
│ ❯ TypeScript + Node.js — CLI tools, backend APIs, npm packages
|
|
42
|
+
│ Next.js Full-Stack — SaaS apps, marketing sites, SSR/SSG
|
|
43
|
+
│ React SPA — Dashboards, admin panels, SPAs
|
|
44
|
+
│ ↓ more
|
|
45
|
+
│ ↑↓ move, enter select
|
|
41
46
|
│
|
|
42
|
-
○ Build & Test
|
|
47
|
+
│ ○ Build & Test
|
|
43
48
|
│
|
|
44
|
-
○ Architecture
|
|
49
|
+
│ ○ Architecture
|
|
45
50
|
│
|
|
46
|
-
○ Product Context
|
|
51
|
+
│ ○ Product Context
|
|
47
52
|
│
|
|
48
|
-
○ Generation
|
|
53
|
+
│ ○ Generation
|
|
49
54
|
│
|
|
50
|
-
○
|
|
55
|
+
│ ○ Setup
|
|
56
|
+
└
|
|
51
57
|
```
|
|
52
58
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
| Indicator | Meaning |
|
|
60
|
+
|-----------|---------|
|
|
61
|
+
| `◇` (green) | Completed — summary shown on the `│` line below |
|
|
62
|
+
| `◆◈◇◈` (mauve, animated) | Active — waiting for input |
|
|
63
|
+
| `○` (dim) | Pending |
|
|
64
|
+
| `┌` / `└` | Open/close corners wrapping the full wizard flow |
|
|
57
65
|
|
|
58
66
|
## The 7 Wizard Steps
|
|
59
67
|
|
|
60
|
-
1.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
### 1. Project Info
|
|
69
|
+
Name, description, package manager (select), license (select).
|
|
70
|
+
|
|
71
|
+
### 2. Stack & Style
|
|
72
|
+
Choose a **QuickStart preset** or configure manually:
|
|
73
|
+
|
|
74
|
+
| Preset | Best for |
|
|
75
|
+
|--------|----------|
|
|
76
|
+
| TypeScript + Node.js | CLI tools, backend APIs, npm packages |
|
|
77
|
+
| Next.js Full-Stack | SaaS apps, marketing sites, SSR/SSG |
|
|
78
|
+
| React SPA | Dashboards, admin panels, SPAs |
|
|
79
|
+
| Python + FastAPI | AI/ML backends, REST APIs, data services |
|
|
80
|
+
| Go HTTP Service | High-perf APIs, microservices |
|
|
81
|
+
| React Native + Expo | Cross-platform mobile apps |
|
|
82
|
+
| Configure manually → | Custom language, framework, and code style |
|
|
83
|
+
|
|
84
|
+
Presets auto-fill build/test/typecheck/lint/PR commands.
|
|
85
|
+
|
|
86
|
+
### 3. Build & Test
|
|
87
|
+
Build, test, typecheck, lint, and pre-PR commands — with smart defaults pre-filled when a QuickStart preset was selected.
|
|
88
|
+
|
|
89
|
+
### 4. Architecture
|
|
90
|
+
Select from 7 patterns (Monolith, MVC, Feature folders, Hexagonal, Microservices, Event-driven, Monorepo). Architecture notes are auto-generated from the chosen pattern.
|
|
91
|
+
|
|
92
|
+
### 5. Product Context
|
|
93
|
+
Problem statement, target users, tech stack (multi-select, prefilled from Step 2), core features (multi-select with custom input), non-goals.
|
|
94
|
+
|
|
95
|
+
### 6. Generation
|
|
96
|
+
Full summary of all collected inputs. Warns about any files that will be overwritten. Confirm to write files or skip.
|
|
97
|
+
|
|
98
|
+
### 7. Setup *(optional)*
|
|
99
|
+
Three independent yes/no prompts — each explained before asking:
|
|
100
|
+
|
|
101
|
+
- **Claude Powerline** — live status bar (git branch, context %, cost, active tools); runs via `npx` per session
|
|
102
|
+
- **Git repository** — `git init` + initial commit with the generated files
|
|
103
|
+
- **npm release scripts** — creates `~/bin/<project>-release` and adds `release:patch/minor/major` to `package.json`
|
|
67
104
|
|
|
68
105
|
## UI Components
|
|
69
106
|
|
|
70
107
|
| Component | File | Purpose |
|
|
71
108
|
|-----------|------|---------|
|
|
72
|
-
| Banner | `src/components/banner.tsx` | ASCII art header + tagline +
|
|
73
|
-
| Timeline | `src/components/timeline.tsx` |
|
|
74
|
-
| StepIndicator | `src/components/step-indicator.tsx` |
|
|
75
|
-
| GutterLine | `src/components/gutter-line.tsx` | `│ ` prefix wrapper
|
|
76
|
-
| GutteredSelect | `src/components/guttered-select.tsx` |
|
|
77
|
-
| GutteredMultiSelect | `src/components/guttered-select.tsx` | Multi-select with `●`/`○` toggle +
|
|
109
|
+
| Banner | `src/components/banner.tsx` | ASCII art header + tagline + divider |
|
|
110
|
+
| Timeline | `src/components/timeline.tsx` | `┌`/`└` corners, `│` gutter, step flow |
|
|
111
|
+
| StepIndicator | `src/components/step-indicator.tsx` | Animated dot + label per step |
|
|
112
|
+
| GutterLine | `src/components/gutter-line.tsx` | `│ ` prefix wrapper (Box row) |
|
|
113
|
+
| GutteredSelect | `src/components/guttered-select.tsx` | Sliding-window single-select with `│ ❯` gutter |
|
|
114
|
+
| GutteredMultiSelect | `src/components/guttered-select.tsx` | Multi-select with `●`/`○` toggle + custom input |
|
|
78
115
|
|
|
79
116
|
## Tech Stack
|
|
80
117
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
118
|
+
| Layer | Technology |
|
|
119
|
+
|-------|-----------|
|
|
120
|
+
| Language | TypeScript (strict mode, ESM) |
|
|
121
|
+
| UI Framework | Ink 6 (React for CLI) |
|
|
122
|
+
| Templating | Handlebars (`.hbs`) |
|
|
123
|
+
| AI | Vercel AI SDK 6, Z.ai (GLM), OpenAI |
|
|
124
|
+
| Build | tsc |
|
|
87
125
|
|
|
88
126
|
## Development
|
|
89
127
|
|
|
90
128
|
```bash
|
|
91
|
-
npm run dev # Run CLI
|
|
92
|
-
npm run build # Compile
|
|
129
|
+
npm run dev # Run CLI directly via tsx
|
|
130
|
+
npm run build # Compile to dist/
|
|
93
131
|
npm run typecheck # Type check only
|
|
94
|
-
npm run lint # Alias of typecheck in this repo
|
|
95
132
|
```
|
|
96
133
|
|
|
97
|
-
> **Warning:** Never run `npm run dev` from the procedure project directory — scaffolding writes to cwd and will overwrite procedure's own files. Always `cd` to a temp directory first.
|
|
134
|
+
> **Warning:** Never run `npm run dev` from the procedure project directory — scaffolding writes to `cwd` and will overwrite procedure's own files. Always `cd` to a temp directory first.
|
|
98
135
|
|
|
99
136
|
## Review & Fix Workflow
|
|
100
137
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
- `CODE-REVIEW.md` — review entries (`CR-YYYYMMDD-###`)
|
|
104
|
-
- `CODE-FIXED.md` — fix entries (`CF-YYYYMMDD-###`)
|
|
105
|
-
|
|
106
|
-
Process:
|
|
107
|
-
1. Start review by reading latest `CODE-REVIEW.md` and `CODE-FIXED.md`.
|
|
108
|
-
2. Append new review findings to `CODE-REVIEW.md` only.
|
|
109
|
-
3. During implementation, write fix actions to `CODE-FIXED.md` only.
|
|
110
|
-
4. Re-review and update finding statuses in a new review entry.
|
|
111
|
-
|
|
112
|
-
Verification standard after fixes: run `npm run typecheck` and `npm run build`.
|
|
138
|
+
Two append-only logs track review/fix cycles:
|
|
113
139
|
|
|
114
|
-
|
|
140
|
+
- `CODE-REVIEW.md` — findings (`CR-YYYYMMDD-###`)
|
|
141
|
+
- `CODE-FIXED.md` — fix actions (`CF-YYYYMMDD-###`)
|
|
115
142
|
|
|
116
|
-
|
|
117
|
-
- If generation is skipped, final summary explicitly states no files were written.
|
|
118
|
-
- Git setup no longer hard-fails on empty directories; it reports a warning when nothing is committed.
|
|
119
|
-
- `docs/USER-STORIES.md` now includes fallback starter content when no stories are provided.
|
|
143
|
+
Verification standard after fixes: `npm run typecheck` + `npm run build`.
|
|
120
144
|
|
|
121
145
|
## Documentation
|
|
122
146
|
|
|
123
|
-
- [CLAUDE.md](./CLAUDE.md) —
|
|
124
|
-
- [docs/PRD.md](./docs/PRD.md) —
|
|
147
|
+
- [CLAUDE.md](./CLAUDE.md) — Development guide
|
|
148
|
+
- [docs/PRD.md](./docs/PRD.md) — Product requirements
|
|
125
149
|
- [docs/USER-STORIES.md](./docs/USER-STORIES.md) — User stories and acceptance criteria
|
|
126
150
|
- [docs/GIAI-THICH-CLAUDE-MD.md](./docs/GIAI-THICH-CLAUDE-MD.md) — 4-layer CLAUDE.md methodology (Vietnamese)
|
|
127
151
|
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { render } from "ink";
|
|
4
|
+
import { readdirSync } from "node:fs";
|
|
4
5
|
import App from "./app.js";
|
|
6
|
+
const entries = readdirSync(process.cwd()).filter((e) => e !== ".DS_Store");
|
|
7
|
+
if (entries.length > 0) {
|
|
8
|
+
const sample = entries.slice(0, 3).join(", ");
|
|
9
|
+
const extra = entries.length > 3 ? `, +${entries.length - 3} more` : "";
|
|
10
|
+
console.error(`\nWarning: current directory is not empty.`);
|
|
11
|
+
console.error(` Found: ${sample}${extra}`);
|
|
12
|
+
console.error(` Existing files can be overwritten during Step 6 (Generation).`);
|
|
13
|
+
console.error(` Recommended for a fresh project:`);
|
|
14
|
+
console.error(` mkdir my-project && cd my-project`);
|
|
15
|
+
console.error(` npx procedure-cli (or: npx @b3awesome/procedure)\n`);
|
|
16
|
+
}
|
|
5
17
|
render(_jsx(App, {}));
|
|
6
18
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":";;AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,MAAM,CAAC,KAAC,GAAG,KAAG,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":";;AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC;AAC5E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IACvB,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,OAAO,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAC5D,OAAO,CAAC,KAAK,CAAC,YAAY,MAAM,GAAG,KAAK,EAAE,CAAC,CAAC;IAC5C,OAAO,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACjF,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACpD,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACvD,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,CAAC,KAAC,GAAG,KAAG,CAAC,CAAC"}
|
package/docs/PRD.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Vision
|
|
4
4
|
|
|
5
|
-
Empower developers to start projects with production-ready documentation and architecture decisions from day one, reducing onboarding time and ensuring best practices are baked in.
|
|
5
|
+
Empower developers to start projects with production-ready documentation and architecture decisions from day one, reducing onboarding time and ensuring best practices are baked in from the first commit.
|
|
6
6
|
|
|
7
7
|
## Problem
|
|
8
8
|
|
|
@@ -24,46 +24,52 @@ Empower developers to start projects with production-ready documentation and arc
|
|
|
24
24
|
## Core Features
|
|
25
25
|
|
|
26
26
|
**F-001: Interactive Project Wizard**
|
|
27
|
-
- 7-step guided setup with timeline
|
|
28
|
-
-
|
|
29
|
-
-
|
|
27
|
+
- 7-step guided setup with Catppuccin Mocha timeline UI
|
|
28
|
+
- `┌`/`└` corners wrap the full flow; animated dot on active step
|
|
29
|
+
- Empty-directory guard: exits with helpful message if cwd contains files
|
|
30
|
+
- Validates required fields; ESC exits at any point; Enter exits on completion
|
|
30
31
|
|
|
31
32
|
**F-002: CLAUDE.md Generation**
|
|
32
|
-
- Code style and import conventions
|
|
33
|
-
- Build
|
|
34
|
-
- Architecture
|
|
35
|
-
- Workflow guidance (planning, verification, bug fixing)
|
|
33
|
+
- Code style and import conventions (from preset or manual config)
|
|
34
|
+
- Build, test, typecheck, lint, and pre-PR commands
|
|
35
|
+
- Architecture pattern with auto-generated best-practice notes
|
|
36
|
+
- Workflow guidance (planning, verification, bug fixing, elegance)
|
|
36
37
|
- Lessons learned section (AI-updatable)
|
|
37
38
|
|
|
38
39
|
**F-003: PRD.md Generation**
|
|
39
40
|
- Vision, problem statement, target users
|
|
40
|
-
- Core features (F-001
|
|
41
|
-
-
|
|
42
|
-
- Tech stack table
|
|
43
|
-
- Open questions placeholder
|
|
41
|
+
- Core features (F-001 format), non-goals, tech stack table
|
|
42
|
+
- Success metrics placeholder, open questions section
|
|
44
43
|
|
|
45
44
|
**F-004: USER-STORIES.md Generation**
|
|
46
45
|
- Gherkin-formatted acceptance criteria
|
|
47
46
|
- "As a / I want / So that" narrative format
|
|
48
47
|
- Feature scenarios with Given/When/Then
|
|
49
|
-
-
|
|
48
|
+
- Scaffolded from wizard-collected core features and user context
|
|
50
49
|
|
|
51
50
|
**F-005: Environment & Config Files**
|
|
52
51
|
- `.env.example` template with user-specified variables
|
|
53
|
-
- `.gitignore` with language/framework-specific
|
|
52
|
+
- `.gitignore` with language/framework-specific defaults
|
|
54
53
|
|
|
55
|
-
**F-006:
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
54
|
+
**F-006: QuickStart Presets**
|
|
55
|
+
- 6 one-click presets: TypeScript+Node, Next.js, React SPA, Python+FastAPI, Go, React Native+Expo
|
|
56
|
+
- Each preset pre-fills stack, build, test, typecheck, lint, and pre-PR commands
|
|
57
|
+
- "Configure manually →" option for custom language/framework/code-style
|
|
58
|
+
|
|
59
|
+
**F-007: Setup & Tooling Integration (Optional)**
|
|
60
|
+
Each option is explained before the yes/no prompt:
|
|
61
|
+
- **Claude Powerline** — live status bar (git branch, context %, session cost, active tools); deployed via `npx` per session, no global install
|
|
62
|
+
- **Git repository** — `git init` + initial commit containing all generated files
|
|
63
|
+
- **npm release scripts** — creates `~/bin/<project>-release`; adds `release:patch`, `release:minor`, `release:major` to `package.json`; adapts commands to selected package manager
|
|
59
64
|
|
|
60
65
|
### Visual Style
|
|
61
66
|
|
|
62
|
-
- **
|
|
63
|
-
- **
|
|
64
|
-
- **
|
|
65
|
-
- **
|
|
66
|
-
- **
|
|
67
|
+
- **Theme:** Catppuccin Mocha Dark (mauve active, green complete, sapphire headers, overlay1 gutter)
|
|
68
|
+
- **Layout:** `┌`/`│`/`└` vertical timeline with `┌` before step 1 and `└` after step 7
|
|
69
|
+
- **Active step:** Animated dot cycling `◆ → ◈ → ◇ → ◈` at 350 ms
|
|
70
|
+
- **Completed step:** `◇` (green); summary displayed on separate `│ ` line below
|
|
71
|
+
- **Select menus:** Sliding window (5 visible at a time), `↑`/`↓` scroll indicators, `↑↓ move, enter select` hint
|
|
72
|
+
- **Multi-select:** `●` selected, `○` unselected, space to toggle, enter to confirm; custom "Other" option via text input
|
|
67
73
|
|
|
68
74
|
## Non-Goals
|
|
69
75
|
|
|
@@ -72,46 +78,52 @@ Empower developers to start projects with production-ready documentation and arc
|
|
|
72
78
|
- Database schema generation
|
|
73
79
|
- Frontend component scaffolding
|
|
74
80
|
- Package template marketplace
|
|
81
|
+
- `--quick` or `--update` CLI flags (wizard is always interactive)
|
|
82
|
+
- Partial regeneration of individual files
|
|
75
83
|
|
|
76
84
|
## Tech Stack
|
|
77
85
|
|
|
78
86
|
| Component | Technology | Purpose |
|
|
79
87
|
|-----------|-----------|---------|
|
|
80
88
|
| **Runtime** | Node.js + TypeScript | Type-safe CLI |
|
|
81
|
-
| **UI** | Ink + React | Interactive
|
|
89
|
+
| **UI** | Ink 6 + React 19 | Interactive terminal rendering |
|
|
82
90
|
| **Templating** | Handlebars | Dynamic file generation |
|
|
83
|
-
| **AI** | ai
|
|
84
|
-
| **Build** | tsc |
|
|
91
|
+
| **AI** | Vercel AI SDK 6, Z.ai, OpenAI | Optional AI-assisted generation |
|
|
92
|
+
| **Build** | tsc | Fast compilation, strict mode |
|
|
85
93
|
|
|
86
94
|
## 7 Wizard Steps (Detailed)
|
|
87
95
|
|
|
88
96
|
### Step 1: Project Info
|
|
89
|
-
- Inputs: Project name, description, package manager
|
|
90
|
-
-
|
|
97
|
+
- Inputs: Project name (required), description (required), package manager (select), license (select)
|
|
98
|
+
- Outputs: Project metadata used across all generated files
|
|
91
99
|
|
|
92
100
|
### Step 2: Stack & Style
|
|
93
|
-
- Inputs:
|
|
94
|
-
-
|
|
101
|
+
- Inputs: QuickStart preset selection, or manual language + framework + code-style multi-selects
|
|
102
|
+
- Outputs: Stack and style data; presets also pre-fill Step 3 commands
|
|
95
103
|
|
|
96
104
|
### Step 3: Build & Test
|
|
97
|
-
- Inputs: Build, test, typecheck, lint, PR
|
|
98
|
-
-
|
|
105
|
+
- Inputs: Build, test, typecheck, lint, pre-PR commands (pre-filled if preset chosen)
|
|
106
|
+
- Outputs: Development commands section in CLAUDE.md
|
|
99
107
|
|
|
100
108
|
### Step 4: Architecture
|
|
101
|
-
- Inputs: Architecture pattern
|
|
102
|
-
-
|
|
109
|
+
- Inputs: Architecture pattern selection (7 options)
|
|
110
|
+
- Outputs: Architecture section in CLAUDE.md with auto-generated best-practice notes
|
|
103
111
|
|
|
104
112
|
### Step 5: Product Context
|
|
105
|
-
- Inputs: Problem statement
|
|
106
|
-
-
|
|
113
|
+
- Inputs: Problem statement, target users, tech stack (multi-select, prefilled from Step 2), core features (multi-select + custom), non-goals
|
|
114
|
+
- Outputs: Data for PRD.md and USER-STORIES.md
|
|
107
115
|
|
|
108
116
|
### Step 6: Generation
|
|
109
|
-
-
|
|
110
|
-
-
|
|
117
|
+
- Shows full summary of all collected inputs grouped by section
|
|
118
|
+
- Warns about any existing files that will be overwritten
|
|
119
|
+
- Confirm → writes all files; Skip → exits without writing
|
|
120
|
+
- Outputs: CLAUDE.md, README.md, docs/PRD.md, docs/USER-STORIES.md, .env.example, .gitignore
|
|
111
121
|
|
|
112
|
-
### Step 7:
|
|
113
|
-
-
|
|
114
|
-
-
|
|
122
|
+
### Step 7: Setup (Optional)
|
|
123
|
+
- Three sequential yes/no prompts (Powerline, Git, Release scripts)
|
|
124
|
+
- Each explained in detail before asking
|
|
125
|
+
- All three can be independently enabled or skipped
|
|
126
|
+
- Outputs: `.claude/` powerline config, git repo with initial commit, `~/bin/<project>-release`, updated `package.json`
|
|
115
127
|
|
|
116
128
|
## Success Metrics
|
|
117
129
|
|
|
@@ -123,8 +135,6 @@ Empower developers to start projects with production-ready documentation and arc
|
|
|
123
135
|
|
|
124
136
|
## Open Questions
|
|
125
137
|
|
|
126
|
-
- Should we support multiple AI models (Claude, GPT-4, local LLMs)?
|
|
127
|
-
- Auto-generate user stories from feature descriptions?
|
|
138
|
+
- Should we support multiple AI models (Claude, GPT-4, local LLMs) for assisted generation?
|
|
128
139
|
- Integration with GitHub Actions for CI/CD template generation?
|
|
129
140
|
- Support for monorepo scaffolding (workspaces)?
|
|
130
|
-
- Interactive feature validation via AI (e.g., "Validate that F-001 and F-002 don't overlap")?
|
package/docs/USER-STORIES.md
CHANGED
|
@@ -10,70 +10,133 @@
|
|
|
10
10
|
|
|
11
11
|
```gherkin
|
|
12
12
|
Scenario: User completes full 7-step wizard
|
|
13
|
-
Given a developer runs `npx procedure
|
|
13
|
+
Given a developer runs `npx @b3awesome/procedure` in an empty directory
|
|
14
14
|
When they answer all wizard questions (project info, stack, build, architecture, product context)
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
And confirm generation in Step 6
|
|
16
|
+
Then CLAUDE.md, README.md, PRD.md, USER-STORIES.md, .env.example, and .gitignore are created
|
|
17
|
+
And a success message displays with the project name and generated files listed
|
|
18
|
+
And pressing Enter exits the CLI
|
|
17
19
|
```
|
|
18
20
|
|
|
19
21
|
```gherkin
|
|
20
22
|
Scenario: Wizard validates required inputs
|
|
21
23
|
Given the user is on Step 1 (Project Info)
|
|
22
|
-
When they leave the project name empty and
|
|
23
|
-
Then validation error shows
|
|
24
|
-
And
|
|
24
|
+
When they leave the project name empty and press Enter
|
|
25
|
+
Then a validation error shows inline
|
|
26
|
+
And the wizard does not advance until a valid name is entered
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
```gherkin
|
|
30
|
+
Scenario: User skips generation
|
|
31
|
+
Given the user reaches Step 6 (Generation)
|
|
32
|
+
When they press N at the "Proceed?" prompt
|
|
33
|
+
Then no files are written to disk
|
|
34
|
+
And the final summary states "Generation was skipped — no files were written"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## US-002: Empty Directory Guard
|
|
28
38
|
|
|
29
|
-
**As a** developer
|
|
30
|
-
**I want** to
|
|
31
|
-
**So that** I
|
|
39
|
+
**As a** developer protecting an existing project
|
|
40
|
+
**I want** the CLI to refuse to run in a non-empty directory
|
|
41
|
+
**So that** I don't accidentally overwrite my existing files
|
|
32
42
|
|
|
33
|
-
### Feature:
|
|
43
|
+
### Feature: Pre-flight Directory Check
|
|
44
|
+
|
|
45
|
+
```gherkin
|
|
46
|
+
Scenario: CLI exits when directory has existing files
|
|
47
|
+
Given a developer runs `npx @b3awesome/procedure` in a directory with files
|
|
48
|
+
When the CLI starts
|
|
49
|
+
Then it exits immediately with an error message
|
|
50
|
+
And the message lists up to 3 found files/directories
|
|
51
|
+
And it shows the commands to create an empty directory and retry
|
|
52
|
+
And the process exits with code 1
|
|
53
|
+
```
|
|
34
54
|
|
|
35
55
|
```gherkin
|
|
36
|
-
Scenario:
|
|
37
|
-
Given
|
|
38
|
-
When
|
|
39
|
-
Then
|
|
40
|
-
And files are generated immediately
|
|
56
|
+
Scenario: CLI starts normally in an empty directory
|
|
57
|
+
Given a developer runs `npx @b3awesome/procedure` in an empty directory
|
|
58
|
+
When the CLI starts
|
|
59
|
+
Then the wizard renders with the banner and Step 1 active
|
|
41
60
|
```
|
|
42
61
|
|
|
43
|
-
## US-003:
|
|
62
|
+
## US-003: QuickStart Presets
|
|
63
|
+
|
|
64
|
+
**As a** developer who knows their stack
|
|
65
|
+
**I want** to pick a preset and have all commands pre-filled
|
|
66
|
+
**So that** I can scaffold a project in under 2 minutes without typing every command
|
|
67
|
+
|
|
68
|
+
### Feature: Stack & Style Presets
|
|
44
69
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
70
|
+
```gherkin
|
|
71
|
+
Scenario: User selects a QuickStart preset
|
|
72
|
+
Given the user is on Step 2 (Stack & Style)
|
|
73
|
+
When they navigate to "TypeScript + Node.js" and press Enter
|
|
74
|
+
Then Step 2 completes immediately with language, framework, and code style set
|
|
75
|
+
And Step 3 (Build & Test) opens with build, test, typecheck, lint, and PR commands pre-filled
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```gherkin
|
|
79
|
+
Scenario: User switches to manual configuration
|
|
80
|
+
Given the user is on Step 2 (Stack & Style) in QuickStart mode
|
|
81
|
+
When they navigate to "Configure manually →" and press Enter
|
|
82
|
+
Then they are shown the language multi-select
|
|
83
|
+
And then the framework multi-select
|
|
84
|
+
And then the code style multi-select
|
|
85
|
+
And can choose any combination with custom "Other" input
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```gherkin
|
|
89
|
+
Scenario: Preset list shows scrollable options
|
|
90
|
+
Given the user is on Step 2 (Stack & Style)
|
|
91
|
+
When the preset list renders
|
|
92
|
+
Then 5 presets are visible at a time
|
|
93
|
+
And "↓ more" appears when additional options are below the visible window
|
|
94
|
+
And pressing ↓ scrolls the window to reveal more presets
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## US-004: Advanced Manual Configuration
|
|
98
|
+
|
|
99
|
+
**As a** team lead defining custom standards
|
|
100
|
+
**I want** to configure language, framework, and code style manually
|
|
101
|
+
**So that** the output matches our team's exact conventions
|
|
48
102
|
|
|
49
103
|
### Feature: Detailed Customization
|
|
50
104
|
|
|
51
105
|
```gherkin
|
|
52
|
-
Scenario: Full control over
|
|
53
|
-
Given the user
|
|
54
|
-
When they
|
|
55
|
-
|
|
56
|
-
And
|
|
106
|
+
Scenario: Full control over stack and style
|
|
107
|
+
Given the user selects "Configure manually →" in Step 2
|
|
108
|
+
When they choose multiple languages (e.g. TypeScript + Python)
|
|
109
|
+
And choose multiple frameworks (e.g. Next.js + FastAPI)
|
|
110
|
+
And select code style conventions with a custom "Other" rule
|
|
111
|
+
Then CLAUDE.md includes the exact languages, frameworks, and conventions chosen
|
|
57
112
|
```
|
|
58
113
|
|
|
59
|
-
## US-
|
|
114
|
+
## US-005: Generation Review and Confirmation
|
|
60
115
|
|
|
61
|
-
**As a**
|
|
62
|
-
**I want** to
|
|
63
|
-
**So that**
|
|
116
|
+
**As a** developer reviewing before committing
|
|
117
|
+
**I want** to see a full summary of all my inputs before files are written
|
|
118
|
+
**So that** I can catch mistakes without having to edit generated files
|
|
64
119
|
|
|
65
|
-
### Feature:
|
|
120
|
+
### Feature: Generation Summary Screen
|
|
66
121
|
|
|
67
122
|
```gherkin
|
|
68
|
-
Scenario:
|
|
69
|
-
Given the
|
|
70
|
-
When
|
|
71
|
-
Then
|
|
72
|
-
And
|
|
73
|
-
And
|
|
123
|
+
Scenario: Generation step shows all collected inputs
|
|
124
|
+
Given the user reaches Step 6 (Generation)
|
|
125
|
+
When the summary renders
|
|
126
|
+
Then it shows Project Info, Stack & Style, Build & Test, Architecture, and Product Context
|
|
127
|
+
And it lists all 6 files that will be generated
|
|
128
|
+
And it warns "⚠ Will overwrite: <filename>" for any files that already exist
|
|
74
129
|
```
|
|
75
130
|
|
|
76
|
-
|
|
131
|
+
```gherkin
|
|
132
|
+
Scenario: Overwrite warning shown for existing files
|
|
133
|
+
Given the target directory already contains CLAUDE.md
|
|
134
|
+
When the user reaches Step 6 (Generation)
|
|
135
|
+
Then a peach-colored warning lists CLAUDE.md as a file that will be overwritten
|
|
136
|
+
And the user must confirm before any writing occurs
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## US-006: PRD Generation with Full Context
|
|
77
140
|
|
|
78
141
|
**As a** product manager
|
|
79
142
|
**I want** the PRD to capture vision, problem, users, and core features
|
|
@@ -84,19 +147,12 @@ Scenario: User enables powerline during Step 7
|
|
|
84
147
|
```gherkin
|
|
85
148
|
Scenario: PRD includes all required sections
|
|
86
149
|
Given the user completes Step 5 (Product Context)
|
|
87
|
-
When they provide
|
|
88
|
-
Then PRD.md contains
|
|
89
|
-
|
|
90
|
-
| Vision | User's description |
|
|
91
|
-
| Problem | 5 bullet points |
|
|
92
|
-
| Users | Table with roles and value |
|
|
93
|
-
| Core Features | F-001 through F-006 format |
|
|
94
|
-
| Non-Goals | Explicit out-of-scope items |
|
|
95
|
-
| Tech Stack | Table with technologies |
|
|
96
|
-
| Success Metrics | Measurable outcomes |
|
|
150
|
+
When they provide problem statement, user context, core features, and non-goals
|
|
151
|
+
Then PRD.md contains Vision, Problem, Users, Core Features, Non-Goals, Tech Stack, and Success Metrics
|
|
152
|
+
And core features are formatted as F-001 through F-NNN entries
|
|
97
153
|
```
|
|
98
154
|
|
|
99
|
-
## US-
|
|
155
|
+
## US-007: User Stories with Gherkin Format
|
|
100
156
|
|
|
101
157
|
**As a** QA engineer
|
|
102
158
|
**I want** user stories with Gherkin acceptance criteria
|
|
@@ -105,77 +161,104 @@ Scenario: PRD includes all required sections
|
|
|
105
161
|
### Feature: Structured User Stories
|
|
106
162
|
|
|
107
163
|
```gherkin
|
|
108
|
-
Scenario:
|
|
164
|
+
Scenario: USER-STORIES.md includes Gherkin scenarios
|
|
109
165
|
Given the user provides core features in Step 5
|
|
110
166
|
When files are generated in Step 6
|
|
111
|
-
Then USER-STORIES.md contains
|
|
112
|
-
|
|
113
|
-
- "As a / I want / So that" format
|
|
114
|
-
- Feature: [name] sections
|
|
115
|
-
- Multiple Scenario: blocks with Gherkin syntax
|
|
167
|
+
Then USER-STORIES.md contains US-NNN headers with "As a / I want / So that" format
|
|
168
|
+
And each story includes one or more Scenario blocks with Given/When/Then syntax
|
|
116
169
|
```
|
|
117
170
|
|
|
118
|
-
## US-
|
|
171
|
+
## US-008: Visual Timeline Progress
|
|
119
172
|
|
|
120
|
-
**As a**
|
|
121
|
-
**I want**
|
|
122
|
-
**So that** I
|
|
173
|
+
**As a** new user
|
|
174
|
+
**I want** to see a visual timeline of all steps with clear current-step indication
|
|
175
|
+
**So that** I always know where I am and what's left
|
|
123
176
|
|
|
124
|
-
### Feature:
|
|
177
|
+
### Feature: Timeline Progress Indicator
|
|
125
178
|
|
|
126
179
|
```gherkin
|
|
127
|
-
Scenario:
|
|
128
|
-
Given the user
|
|
129
|
-
When they
|
|
130
|
-
Then
|
|
131
|
-
|
|
132
|
-
|
|
180
|
+
Scenario: Timeline shows completed, active, and pending steps
|
|
181
|
+
Given the user is on Step 3 (Build & Test)
|
|
182
|
+
When they view the terminal
|
|
183
|
+
Then the timeline shows:
|
|
184
|
+
- ◇ Project Info (green, completed, with summary below)
|
|
185
|
+
- ◇ Stack & Style (green, completed, with summary below)
|
|
186
|
+
- ◆ Build & Test (mauve animated dot, active)
|
|
187
|
+
- ○ Architecture (dim, pending)
|
|
188
|
+
- ○ Product Context (dim, pending)
|
|
189
|
+
- ○ Generation (dim, pending)
|
|
190
|
+
- ○ Setup (dim, pending)
|
|
191
|
+
And ┌ appears before step 1 and └ appears after step 7
|
|
133
192
|
```
|
|
134
193
|
|
|
135
|
-
|
|
194
|
+
```gherkin
|
|
195
|
+
Scenario: Completed step summary appears below step name
|
|
196
|
+
Given the user completes Step 1 (Project Info)
|
|
197
|
+
When the timeline advances to Step 2
|
|
198
|
+
Then below "Project Info" on a separate │ line, the summary shows the entered name and description
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## US-009: Optional Tooling Setup
|
|
202
|
+
|
|
203
|
+
**As a** developer setting up a new project
|
|
204
|
+
**I want** to optionally initialize git, configure Claude Powerline, and add release scripts
|
|
205
|
+
**So that** my project has proper version control and publish tooling from day one
|
|
206
|
+
|
|
207
|
+
### Feature: Setup Step
|
|
136
208
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
209
|
+
```gherkin
|
|
210
|
+
Scenario: User enables all three setup options
|
|
211
|
+
Given the wizard is on Step 7 (Setup)
|
|
212
|
+
When the user answers Yes to Powerline, Yes to Git, and Yes to release scripts
|
|
213
|
+
Then .claude/ powerline configuration is created
|
|
214
|
+
And git init runs and an initial commit is made with the generated files
|
|
215
|
+
And ~/bin/<project>-release is created with the correct package manager commands
|
|
216
|
+
And package.json is created (or updated) with release:patch, release:minor, and release:major scripts
|
|
217
|
+
```
|
|
140
218
|
|
|
141
|
-
|
|
219
|
+
```gherkin
|
|
220
|
+
Scenario: Each setup option is explained before asking
|
|
221
|
+
Given the wizard is on Step 7 (Setup)
|
|
222
|
+
When the Powerline question renders
|
|
223
|
+
Then an explanation is shown describing what Powerline does before the yes/no prompt
|
|
224
|
+
And the same applies to the Git and release script questions
|
|
225
|
+
```
|
|
142
226
|
|
|
143
227
|
```gherkin
|
|
144
|
-
Scenario:
|
|
145
|
-
Given
|
|
146
|
-
When
|
|
147
|
-
Then
|
|
148
|
-
And
|
|
149
|
-
And CLAUDE.md remains unchanged
|
|
228
|
+
Scenario: Git init is skipped gracefully when nothing to commit
|
|
229
|
+
Given the user enables Git setup
|
|
230
|
+
When git init runs but there are no files to commit (generation was skipped)
|
|
231
|
+
Then a warning message is shown explaining why the commit was skipped
|
|
232
|
+
And the setup step completes without error
|
|
150
233
|
```
|
|
151
234
|
|
|
152
|
-
|
|
235
|
+
```gherkin
|
|
236
|
+
Scenario: Release script skipped when it already exists
|
|
237
|
+
Given ~/bin/<project>-release already exists
|
|
238
|
+
When the user enables release script setup
|
|
239
|
+
Then a message confirms the existing script was skipped
|
|
240
|
+
And package.json release scripts are still applied if not already present
|
|
241
|
+
```
|
|
153
242
|
|
|
154
|
-
|
|
155
|
-
**I want** to see a visual timeline of remaining steps with time estimate
|
|
156
|
-
**So that** I know how long the setup will take
|
|
243
|
+
## US-010: Escape and Graceful Exit
|
|
157
244
|
|
|
158
|
-
|
|
245
|
+
**As a** developer who changed their mind
|
|
246
|
+
**I want** to exit the wizard at any point
|
|
247
|
+
**So that** I don't have to complete all steps or kill the process manually
|
|
248
|
+
|
|
249
|
+
### Feature: ESC to Exit
|
|
159
250
|
|
|
160
251
|
```gherkin
|
|
161
|
-
Scenario:
|
|
162
|
-
Given the user is
|
|
163
|
-
When they
|
|
164
|
-
Then
|
|
165
|
-
- ✔ Step 1: Project Info (completed)
|
|
166
|
-
- ✔ Step 2: Stack & Style (completed)
|
|
167
|
-
- ► Step 3: Build & Test (active)
|
|
168
|
-
- ○ Step 4: Architecture (pending)
|
|
169
|
-
- ○ Step 5: Product Context (pending)
|
|
170
|
-
- ○ Step 6: Generation (pending)
|
|
171
|
-
- ○ Step 7: Powerline (pending)
|
|
172
|
-
And "Est. time remaining: 8 minutes" is displayed
|
|
252
|
+
Scenario: ESC exits the wizard at any step
|
|
253
|
+
Given the user is anywhere in the 7-step wizard
|
|
254
|
+
When they press Escape
|
|
255
|
+
Then the CLI exits cleanly with no files written
|
|
173
256
|
```
|
|
174
257
|
|
|
175
258
|
```gherkin
|
|
176
|
-
Scenario:
|
|
177
|
-
Given the
|
|
178
|
-
When
|
|
179
|
-
Then
|
|
180
|
-
And
|
|
259
|
+
Scenario: Enter exits after completion
|
|
260
|
+
Given the wizard has completed all 7 steps
|
|
261
|
+
When the final success screen is shown
|
|
262
|
+
Then pressing Enter exits the CLI
|
|
263
|
+
And the final timeline shows all steps as completed with their summaries
|
|
181
264
|
```
|
package/package.json
CHANGED
package/src/cli.tsx
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { render } from "ink";
|
|
4
|
+
import { readdirSync } from "node:fs";
|
|
4
5
|
import App from "./app.js";
|
|
5
6
|
|
|
7
|
+
const entries = readdirSync(process.cwd()).filter((e) => e !== ".DS_Store");
|
|
8
|
+
if (entries.length > 0) {
|
|
9
|
+
const sample = entries.slice(0, 3).join(", ");
|
|
10
|
+
const extra = entries.length > 3 ? `, +${entries.length - 3} more` : "";
|
|
11
|
+
console.error(`\nWarning: current directory is not empty.`);
|
|
12
|
+
console.error(` Found: ${sample}${extra}`);
|
|
13
|
+
console.error(` Existing files can be overwritten during Step 6 (Generation).`);
|
|
14
|
+
console.error(` Recommended for a fresh project:`);
|
|
15
|
+
console.error(` mkdir my-project && cd my-project`);
|
|
16
|
+
console.error(` npx procedure-cli (or: npx @b3awesome/procedure)\n`);
|
|
17
|
+
}
|
|
18
|
+
|
|
6
19
|
render(<App />);
|