procedure-cli 0.1.11 → 0.1.13
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/.claude/settings.local.json +2 -1
- package/AGENTS.md +82 -61
- package/CODE-FIXED.md +81 -0
- package/CODE-REVIEW.md +172 -0
- package/README.md +105 -69
- package/dist/cli.js +12 -0
- package/dist/cli.js.map +1 -1
- package/dist/steps/build-test.js +32 -3
- package/dist/steps/build-test.js.map +1 -1
- package/dist/steps/powerline.js +11 -3
- package/dist/steps/powerline.js.map +1 -1
- package/dist/steps/product-context.js +54 -19
- package/dist/steps/product-context.js.map +1 -1
- package/dist/steps/project-info.js +30 -3
- package/dist/steps/project-info.js.map +1 -1
- package/docs/PRD.md +55 -44
- package/docs/USER-STORIES.md +241 -98
- package/package.json +1 -1
- package/src/cli.tsx +13 -0
- package/src/steps/build-test.tsx +41 -6
- package/src/steps/powerline.tsx +17 -1
- package/src/steps/product-context.tsx +100 -39
- package/src/steps/project-info.tsx +57 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-info.js","sourceRoot":"","sources":["../../src/steps/project-info.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"project-info.js","sourceRoot":"","sources":["../../src/steps/project-info.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAQhC,MAAM,UAAU,GAAW;IACzB,aAAa;IACb,aAA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A,KAAK,IAAI,CACR,KAAC,UAAU,cACT,KAAC,IAAI,IAAC,KAAK,EAAE,CAAC,CAAC,GAAG,YAAG,KAAK,GAAQ,GACvB,CACd,IACA,CACJ,CAAC;AACJ,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,53 @@ 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: warns when cwd has files and continues — Step 6 overwrite confirmation handles conflicts
|
|
30
|
+
- Validates required fields; ESC exits at any point; Enter exits on completion
|
|
31
|
+
- In-step field navigation: `Tab` = next field, `Shift+Tab` = previous field, `Enter` = confirm; `↑`/`↓` retain their option-navigation role inside selects
|
|
30
32
|
|
|
31
33
|
**F-002: CLAUDE.md Generation**
|
|
32
|
-
- Code style and import conventions
|
|
33
|
-
- Build
|
|
34
|
-
- Architecture
|
|
35
|
-
- Workflow guidance (planning, verification, bug fixing)
|
|
34
|
+
- Code style and import conventions (from preset or manual config)
|
|
35
|
+
- Build, test, typecheck, lint, and pre-PR commands
|
|
36
|
+
- Architecture pattern with auto-generated best-practice notes
|
|
37
|
+
- Workflow guidance (planning, verification, bug fixing, elegance)
|
|
36
38
|
- Lessons learned section (AI-updatable)
|
|
37
39
|
|
|
38
40
|
**F-003: PRD.md Generation**
|
|
39
41
|
- Vision, problem statement, target users
|
|
40
|
-
- Core features (F-001
|
|
41
|
-
-
|
|
42
|
-
- Tech stack table
|
|
43
|
-
- Open questions placeholder
|
|
42
|
+
- Core features (F-001 format), non-goals, tech stack table
|
|
43
|
+
- Success metrics placeholder, open questions section
|
|
44
44
|
|
|
45
45
|
**F-004: USER-STORIES.md Generation**
|
|
46
46
|
- Gherkin-formatted acceptance criteria
|
|
47
47
|
- "As a / I want / So that" narrative format
|
|
48
48
|
- Feature scenarios with Given/When/Then
|
|
49
|
-
-
|
|
49
|
+
- Scaffolded from wizard-collected core features and user context
|
|
50
50
|
|
|
51
51
|
**F-005: Environment & Config Files**
|
|
52
52
|
- `.env.example` template with user-specified variables
|
|
53
|
-
- `.gitignore` with language/framework-specific
|
|
53
|
+
- `.gitignore` with language/framework-specific defaults
|
|
54
54
|
|
|
55
|
-
**F-006:
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
55
|
+
**F-006: QuickStart Presets**
|
|
56
|
+
- 6 one-click presets: TypeScript+Node, Next.js, React SPA, Python+FastAPI, Go, React Native+Expo
|
|
57
|
+
- Each preset pre-fills stack, build, test, typecheck, lint, and pre-PR commands
|
|
58
|
+
- "Configure manually →" option for custom language/framework/code-style
|
|
59
|
+
|
|
60
|
+
**F-007: Setup & Tooling Integration (Optional)**
|
|
61
|
+
Each option is explained before the yes/no prompt:
|
|
62
|
+
- **Claude Powerline** — live status bar (git branch, context %, session cost, active tools); deployed via `npx` per session, no global install
|
|
63
|
+
- **Git repository** — `git init` + initial commit containing all generated files
|
|
64
|
+
- **npm release scripts** — creates `~/bin/<project>-release`; adds `release:patch`, `release:minor`, `release:major` to `package.json`; adapts commands to selected package manager
|
|
59
65
|
|
|
60
66
|
### Visual Style
|
|
61
67
|
|
|
62
|
-
- **
|
|
63
|
-
- **
|
|
64
|
-
- **
|
|
65
|
-
- **
|
|
66
|
-
- **
|
|
68
|
+
- **Theme:** Catppuccin Mocha Dark (mauve active, green complete, sapphire headers, overlay1 gutter)
|
|
69
|
+
- **Layout:** `┌`/`│`/`└` vertical timeline with `┌` before step 1 and `└` after step 7
|
|
70
|
+
- **Active step:** Animated dot cycling `◆ → ◈ → ◇ → ◈` at 350 ms
|
|
71
|
+
- **Completed step:** `◇` (green); summary displayed on separate `│ ` line below
|
|
72
|
+
- **Select menus:** Sliding window (5 visible at a time), `↑`/`↓` scroll indicators, `↑↓ move, enter select` hint
|
|
73
|
+
- **Multi-select:** `●` selected, `○` unselected, space to toggle, enter to confirm; custom "Other" option via text input
|
|
67
74
|
|
|
68
75
|
## Non-Goals
|
|
69
76
|
|
|
@@ -72,46 +79,52 @@ Empower developers to start projects with production-ready documentation and arc
|
|
|
72
79
|
- Database schema generation
|
|
73
80
|
- Frontend component scaffolding
|
|
74
81
|
- Package template marketplace
|
|
82
|
+
- `--quick` or `--update` CLI flags (wizard is always interactive)
|
|
83
|
+
- Partial regeneration of individual files
|
|
75
84
|
|
|
76
85
|
## Tech Stack
|
|
77
86
|
|
|
78
87
|
| Component | Technology | Purpose |
|
|
79
88
|
|-----------|-----------|---------|
|
|
80
89
|
| **Runtime** | Node.js + TypeScript | Type-safe CLI |
|
|
81
|
-
| **UI** | Ink + React | Interactive
|
|
90
|
+
| **UI** | Ink 6 + React 19 | Interactive terminal rendering |
|
|
82
91
|
| **Templating** | Handlebars | Dynamic file generation |
|
|
83
|
-
| **AI** | ai
|
|
84
|
-
| **Build** | tsc |
|
|
92
|
+
| **AI** | Vercel AI SDK 6, Z.ai, OpenAI | Optional AI-assisted generation |
|
|
93
|
+
| **Build** | tsc | Fast compilation, strict mode |
|
|
85
94
|
|
|
86
95
|
## 7 Wizard Steps (Detailed)
|
|
87
96
|
|
|
88
97
|
### Step 1: Project Info
|
|
89
|
-
- Inputs: Project name, description, package manager
|
|
90
|
-
-
|
|
98
|
+
- Inputs: Project name (required), description (required), package manager (select), license (select)
|
|
99
|
+
- Outputs: Project metadata used across all generated files
|
|
91
100
|
|
|
92
101
|
### Step 2: Stack & Style
|
|
93
|
-
- Inputs:
|
|
94
|
-
-
|
|
102
|
+
- Inputs: QuickStart preset selection, or manual language + framework + code-style multi-selects
|
|
103
|
+
- Outputs: Stack and style data; presets also pre-fill Step 3 commands
|
|
95
104
|
|
|
96
105
|
### Step 3: Build & Test
|
|
97
|
-
- Inputs: Build, test, typecheck, lint, PR
|
|
98
|
-
-
|
|
106
|
+
- Inputs: Build, test, typecheck, lint, pre-PR commands (pre-filled if preset chosen)
|
|
107
|
+
- Outputs: Development commands section in CLAUDE.md
|
|
99
108
|
|
|
100
109
|
### Step 4: Architecture
|
|
101
|
-
- Inputs: Architecture pattern
|
|
102
|
-
-
|
|
110
|
+
- Inputs: Architecture pattern selection (7 options)
|
|
111
|
+
- Outputs: Architecture section in CLAUDE.md with auto-generated best-practice notes
|
|
103
112
|
|
|
104
113
|
### Step 5: Product Context
|
|
105
|
-
- Inputs: Problem statement
|
|
106
|
-
-
|
|
114
|
+
- Inputs: Problem statement, target users, tech stack (multi-select, prefilled from Step 2), core features (multi-select + custom), non-goals
|
|
115
|
+
- Outputs: Data for PRD.md and USER-STORIES.md
|
|
107
116
|
|
|
108
117
|
### Step 6: Generation
|
|
109
|
-
-
|
|
110
|
-
-
|
|
118
|
+
- Shows full summary of all collected inputs grouped by section
|
|
119
|
+
- Warns about any existing files that will be overwritten
|
|
120
|
+
- Confirm → writes all files; Skip → exits without writing
|
|
121
|
+
- Outputs: CLAUDE.md, README.md, docs/PRD.md, docs/USER-STORIES.md, .env.example, .gitignore
|
|
111
122
|
|
|
112
|
-
### Step 7:
|
|
113
|
-
-
|
|
114
|
-
-
|
|
123
|
+
### Step 7: Setup (Optional)
|
|
124
|
+
- Three sequential yes/no prompts (Powerline, Git, Release scripts)
|
|
125
|
+
- Each explained in detail before asking
|
|
126
|
+
- All three can be independently enabled or skipped
|
|
127
|
+
- Outputs: `.claude/` powerline config, git repo with initial commit, `~/bin/<project>-release`, updated `package.json`
|
|
115
128
|
|
|
116
129
|
## Success Metrics
|
|
117
130
|
|
|
@@ -123,8 +136,6 @@ Empower developers to start projects with production-ready documentation and arc
|
|
|
123
136
|
|
|
124
137
|
## Open Questions
|
|
125
138
|
|
|
126
|
-
- Should we support multiple AI models (Claude, GPT-4, local LLMs)?
|
|
127
|
-
- Auto-generate user stories from feature descriptions?
|
|
139
|
+
- Should we support multiple AI models (Claude, GPT-4, local LLMs) for assisted generation?
|
|
128
140
|
- Integration with GitHub Actions for CI/CD template generation?
|
|
129
141
|
- 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
|
|
38
|
+
|
|
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
|
|
28
42
|
|
|
29
|
-
|
|
30
|
-
**I want** to scaffold a project with minimal questions
|
|
31
|
-
**So that** I can start coding in under 2 minutes
|
|
43
|
+
### Feature: Pre-flight Directory Check
|
|
32
44
|
|
|
33
|
-
|
|
45
|
+
```gherkin
|
|
46
|
+
Scenario: CLI warns when directory has existing files and continues
|
|
47
|
+
Given a developer runs `npx @b3awesome/procedure` in a directory with files
|
|
48
|
+
When the CLI starts
|
|
49
|
+
Then a warning is printed listing up to 3 found files/directories
|
|
50
|
+
And a recommendation to use an empty directory is shown
|
|
51
|
+
And the wizard renders normally so the user can proceed
|
|
52
|
+
And Step 6 (Generation) will list any files that would be overwritten before confirmation
|
|
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
|
|
44
63
|
|
|
45
|
-
**As a**
|
|
46
|
-
**I want** to
|
|
47
|
-
**So that**
|
|
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
|
|
69
|
+
|
|
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,164 @@ 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
|
|
172
|
+
|
|
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
|
|
119
176
|
|
|
120
|
-
|
|
121
|
-
**I want** the wizard to optionally initialize git with a sensible .gitignore
|
|
122
|
-
**So that** I don't accidentally commit build artifacts or secrets
|
|
177
|
+
### Feature: Timeline Progress Indicator
|
|
123
178
|
|
|
124
|
-
|
|
179
|
+
```gherkin
|
|
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
|
|
192
|
+
```
|
|
125
193
|
|
|
126
194
|
```gherkin
|
|
127
|
-
Scenario:
|
|
128
|
-
Given the user completes
|
|
129
|
-
When
|
|
130
|
-
Then
|
|
131
|
-
And .gitignore is committed with language/framework rules
|
|
132
|
-
And initial commit message is "chore: initialize project with Procedure CLI"
|
|
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
|
|
133
199
|
```
|
|
134
200
|
|
|
135
|
-
## US-
|
|
201
|
+
## US-009: Optional Tooling Setup
|
|
136
202
|
|
|
137
|
-
**As a** developer
|
|
138
|
-
**I want** to
|
|
139
|
-
**So that**
|
|
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
|
|
140
206
|
|
|
141
|
-
### Feature:
|
|
207
|
+
### Feature: Setup Step
|
|
142
208
|
|
|
143
209
|
```gherkin
|
|
144
|
-
Scenario: User
|
|
145
|
-
Given
|
|
146
|
-
When
|
|
147
|
-
Then
|
|
148
|
-
And
|
|
149
|
-
And
|
|
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
|
|
150
217
|
```
|
|
151
218
|
|
|
152
|
-
|
|
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
|
+
```
|
|
153
226
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
227
|
+
```gherkin
|
|
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
|
|
233
|
+
```
|
|
157
234
|
|
|
158
|
-
|
|
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
|
+
```
|
|
242
|
+
|
|
243
|
+
## US-010: In-Step Field Navigation
|
|
244
|
+
|
|
245
|
+
**As a** developer who made a typo in a previous field
|
|
246
|
+
**I want** to navigate back and forward between inputs within the current step
|
|
247
|
+
**So that** I can fix mistakes without restarting the step from scratch
|
|
248
|
+
|
|
249
|
+
### Feature: ↑/↓ Field Navigation
|
|
250
|
+
|
|
251
|
+
```gherkin
|
|
252
|
+
Scenario: User navigates back to a previous field within a step
|
|
253
|
+
Given the user is on Step 3 (Build & Test) with "Test command" active
|
|
254
|
+
When they press Shift+Tab
|
|
255
|
+
Then "Build command" becomes active again with its previously saved value restored
|
|
256
|
+
And "Test command" becomes invisible (not yet re-confirmed)
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
```gherkin
|
|
260
|
+
Scenario: User navigates forward using Tab
|
|
261
|
+
Given the user has gone back to "Build command" in Step 3
|
|
262
|
+
When they press Tab
|
|
263
|
+
Then the current value (typed or previously saved) is kept
|
|
264
|
+
And "Test command" becomes active again
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
```gherkin
|
|
268
|
+
Scenario: Tab on a required empty field shows error
|
|
269
|
+
Given the user is on "Build command" in Step 3
|
|
270
|
+
And the field is empty with no saved value
|
|
271
|
+
When they press Tab
|
|
272
|
+
Then a validation error is shown
|
|
273
|
+
And the field index does not advance
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
```gherkin
|
|
277
|
+
Scenario: Navigation hint is shown below each input field
|
|
278
|
+
Given the user is on any input field within a step
|
|
279
|
+
When the field renders
|
|
280
|
+
Then a hint line shows the available navigation keys
|
|
281
|
+
And "Shift+Tab prev" is omitted when on the first field
|
|
282
|
+
And "Tab next" is replaced by "Tab / Enter confirm" on the last field
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
```gherkin
|
|
286
|
+
Scenario: Tab and Shift+Tab work on select fields too
|
|
287
|
+
Given the user is on "Package manager" select (Step 1)
|
|
288
|
+
When they press Shift+Tab
|
|
289
|
+
Then the "Description" text input becomes active again
|
|
290
|
+
When they press Tab
|
|
291
|
+
Then the "License" select becomes active
|
|
292
|
+
And ↑↓ continue to navigate options within the select as normal
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
```gherkin
|
|
296
|
+
Scenario: Shift+Tab in Setup step navigates between confirm questions
|
|
297
|
+
Given the user is on the "Initialize git repo?" question in Step 7
|
|
298
|
+
When they press Shift+Tab
|
|
299
|
+
Then the "Set up Powerline?" question is shown again
|
|
300
|
+
And the user can re-answer it
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## US-011: Escape and Graceful Exit
|
|
304
|
+
|
|
305
|
+
**As a** developer who changed their mind
|
|
306
|
+
**I want** to exit the wizard at any point
|
|
307
|
+
**So that** I don't have to complete all steps or kill the process manually
|
|
308
|
+
|
|
309
|
+
### Feature: ESC to Exit
|
|
159
310
|
|
|
160
311
|
```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
|
|
312
|
+
Scenario: ESC exits the wizard at any step
|
|
313
|
+
Given the user is anywhere in the 7-step wizard
|
|
314
|
+
When they press Escape
|
|
315
|
+
Then the CLI exits cleanly with no files written
|
|
173
316
|
```
|
|
174
317
|
|
|
175
318
|
```gherkin
|
|
176
|
-
Scenario:
|
|
177
|
-
Given the
|
|
178
|
-
When
|
|
179
|
-
Then
|
|
180
|
-
And
|
|
319
|
+
Scenario: Enter exits after completion
|
|
320
|
+
Given the wizard has completed all 7 steps
|
|
321
|
+
When the final success screen is shown
|
|
322
|
+
Then pressing Enter exits the CLI
|
|
323
|
+
And the final timeline shows all steps as completed with their summaries
|
|
181
324
|
```
|
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 />);
|