beaver-build 1.0.6 → 1.0.8

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.
Files changed (3) hide show
  1. package/README.md +383 -237
  2. package/dist/index.js +1378 -488
  3. package/package.json +57 -52
package/README.md CHANGED
@@ -1,237 +1,383 @@
1
- <div align="center"><img width="400" height="225" alt="Beaver CLI" src="https://raw.githubusercontent.com/hd1008-lang/beaver/main/media/beaver.gif" /></div>
2
-
3
- # Beaver
4
-
5
- An interactive CLI tool for scaffolding modern web projects. Select your project type, configure your stack through a guided menu, and get a production-ready project generated on disk with pinned library versions.
6
-
7
- ## Getting Started
8
-
9
- ### Prerequisites
10
-
11
- - Node.js 18+
12
- - npm
13
-
14
- ### Installation
15
-
16
- **Option 1: Install globally** (recommended for frequent use)
17
-
18
- ```bash
19
- npm install -g beaver-build
20
- beaver
21
- ```
22
-
23
- **Option 2: Use directly with npx** (no installation needed)
24
-
25
- ```bash
26
- npx beaver
27
- ```
28
-
29
- ### Usage
30
-
31
- Simply run the command and follow the interactive prompts:
32
-
33
- ```bash
34
- beaver
35
- ```
36
-
37
- The CLI will guide you through:
38
-
39
- 1. **Project Type** — Choose React + Vite or Chrome Extension
40
- 2. **Project Name** — Enter your project directory name
41
- 3. **Configuration** — Select your preferred stack (layout, router, state management, styling, linter)
42
-
43
- After answering all prompts, your production-ready project will be generated in the specified directory with:
44
-
45
- - All dependencies pinned to stable versions
46
- - GitHub Copilot custom instructions for your chosen stack
47
- - Ready to run with `npm install && npm run dev`
48
-
49
- ---
50
-
51
- ## Development (Contributing)
52
-
53
- To contribute or develop locally:
54
-
55
- ```bash
56
- npm install
57
- npm run dev # Run CLI in development mode
58
- npm run build # Compile for distribution
59
- ```
60
-
61
- ---
62
-
63
- ## Project Types
64
-
65
- | Type | Status |
66
- |---|---|
67
- | React + Vite | Available |
68
- | Chrome Extension | Available |
69
- | Next.js | Upcoming |
70
- | Nuxt | Upcoming |
71
-
72
- ---
73
-
74
- ## React + Vite
75
-
76
- The CLI walks you through the following choices:
77
-
78
- ### 1. Project Name
79
-
80
- Validated to allow only letters, numbers, hyphens, and underscores (`[a-zA-Z0-9_-]`).
81
-
82
- ### 2. Layout
83
-
84
- | Option | Description |
85
- |---|---|
86
- | FSD | Feature Slice Design |
87
- | BPR | Bulletproof React |
88
-
89
- ### 3. Router
90
-
91
- | Option | Version |
92
- |---|---|
93
- | Not Using | — |
94
- | TanStack Router | v1.144.0 |
95
-
96
- ### 4. State Management
97
-
98
- | Option | Version |
99
- |---|---|
100
- | Not Using | — |
101
- | Zustand | v5.0.5 |
102
-
103
- ### 5. Data Fetching
104
-
105
- | Option | Version |
106
- |---|---|
107
- | Not Using | — |
108
- | TanStack Query | v5.74.4 |
109
-
110
- ### 6. CSS / Styling
111
-
112
- | Option | Version |
113
- |---|---|
114
- | Not Using | |
115
- | Tailwind CSS | v4.1.3 |
116
-
117
- ### 7. Linter / Formatter
118
-
119
- | Option | Version | Notes |
120
- |---|---|---|
121
- | Not Using | | — |
122
- | Biome | v1.9.4 | All-in-one lint + format |
123
- | ESLint | v9.39.4 | Flat config + typescript-eslint |
124
-
125
- ---
126
-
127
- ## Generated ProjectCopilot Instructions
128
-
129
- Every scaffolded project includes a set of GitHub Copilot custom instructions so that AI-assisted coding inside the project follows the conventions of the chosen stack. The files are layout-aware — the `applyTo` glob patterns and placement rules change between FSD and BPR.
130
-
131
- Files emitted in the generated project:
132
-
133
- | File | Scope | Emitted when |
134
- |---|---|---|
135
- | `.github/copilot-instructions.md` | Repo-wide overview — stack, naming, architecture | Always |
136
- | `.github/instructions/components.instructions.md` | Component file paths per layout | Always |
137
- | `.github/instructions/hooks.instructions.md` | Hook file paths per layout | Always |
138
- | `.github/instructions/tanstack-router.instructions.md` | `src/routes/**/*.tsx` | Router = TanStack Router |
139
- | `.github/instructions/zustand.instructions.md` | Store file paths per layout | State = Zustand |
140
- | `.github/instructions/tanstack-query.instructions.md` | API/query file paths per layout | Query = TanStack Query |
141
- | `.github/instructions/biome.instructions.md` or `eslint.instructions.md` | `**` | Linter ≠ none |
142
-
143
- The format follows GitHub's [path-specific custom instructions](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions#creating-path-specific-custom-instructions) spec (`applyTo` frontmatter).
144
-
145
- **Rule for contributors:** every new option added to the CLI (new router, new state library, new UI framework, etc.) must ship with its own instruction template in `src/scaffold/react-vite/templates/copilot-instructions.ts`. See [Adding a New Option to React + Vite](#adding-a-new-option-to-react--vite) below.
146
-
147
- ---
148
-
149
- ## Generated Project Pinned Dependencies
150
-
151
- | Package | Version |
152
- |---|---|
153
- | react | 19.1.0 |
154
- | react-dom | 19.1.0 |
155
- | vite | 6.4.3 |
156
- | @vitejs/plugin-react | 4.4.1 |
157
- | typescript | 5.8.3 |
158
- | @types/react | 19.1.1 |
159
- | @types/react-dom | 19.1.1 |
160
- | @tanstack/react-router | 1.144.0 |
161
- | @tanstack/router-devtools | 1.144.0 |
162
- | @tanstack/router-vite-plugin | 1.144.0 |
163
- | zustand | 5.0.5 |
164
- | @tanstack/react-query | 5.74.4 |
165
- | @tanstack/react-query-devtools | 5.74.4 |
166
- | @biomejs/biome | 1.9.4 |
167
- | eslint | 9.39.4 |
168
- | @eslint/js | 9.39.4 |
169
- | typescript-eslint | 8.26.0 |
170
- | eslint-plugin-react-hooks | 5.2.0 |
171
- | eslint-plugin-react-refresh | 0.4.19 |
172
- | globals | 15.15.0 |
173
-
174
- ---
175
-
176
- ## Project Structure
177
-
178
- ```
179
- src/
180
- index.ts Entry point — greeting, menu, error handling
181
- types/index.ts Cart, ProjectType, ReactViteCore, NextJSCore
182
- constants/index.ts Top-level menu options
183
- options/
184
- index.ts Top-level project type selection
185
- react-vite/
186
- index.ts React + Vite menu flow
187
- constants/index.ts Menu option definitions
188
- types/index.ts MenuOptions type
189
- scaffold/
190
- errors.ts ScaffoldError, isNodeError
191
- utils.ts FileMap, dirExists(), writeProjectFile()
192
- react-vite/
193
- index.ts Scaffold orchestrator
194
- templates/
195
- package-json.ts packageJsonTemplate(cart)
196
- vite-config.ts viteConfigTemplate(cart)
197
- tsconfig.ts tsconfigTemplate(), tsconfigNodeTemplate()
198
- index-html.ts indexHtmlTemplate(projectName)
199
- main-tsx.ts mainTsxTemplate(layout)
200
- app-tsx.ts appTsxFsdTemplate(), appTsxBprTemplate()
201
- router.ts rootRouteTemplate(), indexRouteTemplate()
202
- zustand.ts zustandStoreTemplate()
203
- query.ts queryProviderBprTemplate()
204
- linter.ts biomeConfigTemplate(), eslintConfigTemplate()
205
- gitignore.ts gitignoreTemplate()
206
- copilot-instructions.ts getCopilotInstructionFiles(cart) Copilot instruction set
207
- fsd-layout.ts getFsdFileMap(cart)
208
- bpr-layout.ts getBprFileMap(cart)
209
- utils/
210
- animation.ts typeWriter effect
211
- user.ts getUserName() from git config
212
- index.ts sleep()
213
- ```
214
-
215
- ---
216
-
217
- ## Adding a New Project Type
218
-
219
- 1. Set `disabled: false` in `src/constants/index.ts`
220
- 2. Create `src/options/<project-name>/` with constants, types, and flow functions
221
- 3. Handle the new type in `src/options/index.ts`
222
- 4. Add the interface to `src/types/index.ts` and include it in the `Cart` union
223
- 5. Create `src/scaffold/<project-name>/` with templates and an orchestrator
224
-
225
- ## Adding a New Option to React + Vite
226
-
227
- 1. Add the constant to `src/options/react-vite/constants/index.ts`
228
- 2. Export the value type from `src/types/index.ts` and add the field to `ReactViteCore`
229
- 3. Add a `menu<OptionName>` function in `src/options/react-vite/index.ts`
230
- 4. Call it in `flowReactVite`
231
- 5. Update `getFsdFileMap` and `getBprFileMap` to handle the new option
232
- 6. **Add a Copilot instruction template** in `src/scaffold/react-vite/templates/copilot-instructions.ts`:
233
- - Write a new template function (e.g. `newOptionTemplate(cart)`) returning a markdown string that starts with an `applyTo` frontmatter block scoped to the right paths for both FSD and BPR (use `FSD_PATHS` / `BPR_PATHS`)
234
- - Register it inside `getCopilotInstructionFiles` under a conditional block keyed by the new cart field
235
- - If the new option introduces a new kind of file path, extend the `Paths` type and both `FSD_PATHS` / `BPR_PATHS` maps so every path-specific rule stays layout-aware
236
-
237
- This step is mandatory any user who scaffolds a project with the new option must get a matching Copilot instruction file automatically.
1
+ <div align="center"><img width="400" height="225" alt="Beaver CLI" src="https://raw.githubusercontent.com/hd1008-lang/beaver/main/media/beaver.gif" /></div>
2
+
3
+ # Beaver
4
+
5
+ An interactive CLI tool for scaffolding modern web projects. Select your project type, configure your stack through a guided menu, and get a production-ready project generated on disk with pinned library versions.
6
+
7
+ **Current Version:** 1.0.7
8
+
9
+ ## Getting Started
10
+
11
+ ### Prerequisites
12
+
13
+ - Node.js >= 20.0.0
14
+ - npm
15
+
16
+ ### Installation
17
+
18
+ **Option 1: Install globally** (recommended for frequent use)
19
+
20
+ ```bash
21
+ npm install -g beaver-build
22
+ beaver
23
+ ```
24
+
25
+ **Option 2: Use directly with npx** (no installation needed)
26
+
27
+ ```bash
28
+ npx beaver-build
29
+ ```
30
+
31
+ ### Commands & Options
32
+
33
+ **Main command:**
34
+
35
+ ```bash
36
+ beaver # Interactive project scaffolding
37
+ ```
38
+
39
+ **Options:**
40
+
41
+ ```bash
42
+ beaver -v, --version # Show current version
43
+ beaver -h, --help # Show help and available commands
44
+ beaver update # Update beaver to the latest version from npm
45
+ ```
46
+
47
+ ### Usage
48
+
49
+ Simply run the command and follow the interactive prompts:
50
+
51
+ ```bash
52
+ beaver
53
+ ```
54
+
55
+ The CLI will guide you through:
56
+
57
+ 1. **Project Type** Choose React + Vite, Chrome Extension, or Next.js (upcoming)
58
+ 2. **Project Name** Enter your project directory name
59
+ 3. **Configuration** — Select your preferred stack (layout, router, state management, styling, linter, AI setup, testing)
60
+
61
+ After answering all prompts, your production-ready project will be generated in the specified directory with:
62
+
63
+ - All dependencies pinned to stable versions
64
+ - GitHub Copilot custom instructions for your chosen stack
65
+ - Ready to run with `npm install && npm run dev`
66
+
67
+ ---
68
+
69
+ ## Development (Contributing)
70
+
71
+ To contribute or develop locally:
72
+
73
+ ```bash
74
+ npm install
75
+
76
+ # Development & Building
77
+ npm run dev # Run CLI directly in development mode (using tsx)
78
+ npm run dev:build # Compile TypeScript, resolve aliases, then run
79
+ npm run build # Compile TypeScript for distribution (outputs to dist/)
80
+
81
+ # Documentation
82
+ npm run docs:index # Regenerate docs/INDEX.md
83
+ npm run docs:lint # Validate frontmatter in docs/
84
+ ```
85
+
86
+ **Publishing:**
87
+
88
+ When ready to publish a new version:
89
+
90
+ ```bash
91
+ npm version patch|minor|major # Update version in package.json
92
+ npm publish # Publishes to npm (runs build automatically)
93
+ ```
94
+
95
+ ---
96
+
97
+ ## Project Types
98
+
99
+ | Type | Description | Status |
100
+ |---|---|---|
101
+ | React + Vite | React 19 + Vite with comprehensive tooling options | ✅ Available |
102
+ | Chrome Extension | React 19 + Vite for Chrome Manifest v3 extensions | ✅ Available |
103
+ | Next.js | Next 15 with app router and modern features | 🔄 Upcoming |
104
+ | Nuxt | Nuxt 4 with Vue 3 composition API | 🔄 Upcoming |
105
+
106
+ ---
107
+
108
+ ## React + Vite
109
+
110
+ The CLI walks you through the following choices:
111
+
112
+ ### 1. Project Name
113
+
114
+ Validated to allow only letters, numbers, hyphens, and underscores (`[a-zA-Z0-9_-]`).
115
+
116
+ ### 2. Layout
117
+
118
+ | Option | Description |
119
+ |---|---|
120
+ | FSD | Feature Slice Design — modular file structure |
121
+ | BPR | Bulletproof Reactscalable architecture |
122
+
123
+ ### 3. Router
124
+
125
+ | Option | Version |
126
+ |---|---|
127
+ | Not Using | |
128
+ | TanStack Router | v1.144.0 |
129
+
130
+ ### 4. State Management
131
+
132
+ | Option | Version |
133
+ |---|---|
134
+ | Not Using | — |
135
+ | Zustand | v5.0.5 |
136
+
137
+ ### 5. Data Fetching
138
+
139
+ | Option | Version |
140
+ |---|---|
141
+ | Not Using | |
142
+ | TanStack Query | v5.74.4 |
143
+
144
+ ### 6. CSS / Styling
145
+
146
+ | Option | Version |
147
+ |---|---|
148
+ | Not Using | — |
149
+ | Tailwind CSS | v4.1.3 |
150
+
151
+ ### 7. AI Setup
152
+
153
+ | Option | Description |
154
+ |---|---|
155
+ | Not Using | |
156
+ | Claude (Claude Code) | CLAUDE.md + .claude/ agents + feature docs |
157
+
158
+ ### 8. Testing
159
+
160
+ | Option | Description |
161
+ |---|---|
162
+ | Not Using | |
163
+ | Setup Testing Base | Vitest + React Testing Library configuration |
164
+
165
+ ### 9. Linter / Formatter
166
+
167
+ | Option | Version | Notes |
168
+ |---|---|---|
169
+ | Not Using | | — |
170
+ | Biome | v1.9.4 | All-in-one lint + format |
171
+ | ESLint | v9.39.4 | Flat config + typescript-eslint |
172
+
173
+ ---
174
+
175
+ ## Chrome Extension
176
+
177
+ Build Chrome Manifest v3 extensions with React 19 and Vite. The CLI guides you through:
178
+
179
+ ### 1. Project Name
180
+
181
+ Validated to allow only letters, numbers, hyphens, and underscores (`[a-zA-Z0-9_-]`).
182
+
183
+ ### 2. State Management
184
+
185
+ | Option | Version |
186
+ |---|---|
187
+ | Not Using | — |
188
+ | Zustand | v5.0.5 |
189
+
190
+ ### 3. Data Fetching
191
+
192
+ | Option | Version |
193
+ |---|---|
194
+ | Not Using | — |
195
+ | TanStack Query | v5.74.4 |
196
+
197
+ ### 4. CSS / Styling
198
+
199
+ | Option | Version |
200
+ |---|---|
201
+ | Not Using | — |
202
+ | Tailwind CSS | v4.1.3 |
203
+
204
+ ### 5. AI Setup
205
+
206
+ | Option | Description |
207
+ |---|---|
208
+ | Not Using | — |
209
+ | Claude (Claude Code) | CLAUDE.md + .claude/ agents + feature docs |
210
+
211
+ ### 6. Linter / Formatter
212
+
213
+ | Option | Version | Notes |
214
+ |---|---|---|
215
+ | Not Using | — | — |
216
+ | Biome | v1.9.4 | All-in-one lint + format |
217
+ | ESLint | v9.39.4 | Flat config + typescript-eslint |
218
+
219
+ ---
220
+
221
+ ## Generated Project Copilot Instructions
222
+
223
+ Every scaffolded project includes a set of GitHub Copilot custom instructions so that AI-assisted coding inside the project follows the conventions of the chosen stack. The files are layout-aware — the `applyTo` glob patterns and placement rules change between FSD and BPR.
224
+
225
+ Files emitted in the generated project:
226
+
227
+ | File | Scope | Emitted when |
228
+ |---|---|---|
229
+ | `.github/copilot-instructions.md` | Repo-wide overview stack, naming, architecture | Always |
230
+ | `.github/instructions/components.instructions.md` | Component file paths per layout | Always |
231
+ | `.github/instructions/hooks.instructions.md` | Hook file paths per layout | Always |
232
+ | `.github/instructions/tanstack-router.instructions.md` | `src/routes/**/*.tsx` | Router = TanStack Router |
233
+ | `.github/instructions/zustand.instructions.md` | Store file paths per layout | State = Zustand |
234
+ | `.github/instructions/tanstack-query.instructions.md` | API/query file paths per layout | Query = TanStack Query |
235
+ | `.github/instructions/biome.instructions.md` or `eslint.instructions.md` | `**` | Linter none |
236
+
237
+ The format follows GitHub's [path-specific custom instructions](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions#creating-path-specific-custom-instructions) spec (`applyTo` frontmatter).
238
+
239
+ **Rule for contributors:** every new option added to the CLI (new router, new state library, new UI framework, etc.) must ship with its own instruction template in `src/scaffold/react-vite/templates/copilot-instructions.ts`. See [Adding a New Option to React + Vite](#adding-a-new-option-to-react--vite) below.
240
+
241
+ ---
242
+
243
+ ## Generated Project — Pinned Dependencies
244
+
245
+ | Package | Version |
246
+ |---|---|
247
+ | react | 19.1.0 |
248
+ | react-dom | 19.1.0 |
249
+ | vite | 6.4.3 |
250
+ | @vitejs/plugin-react | 4.4.1 |
251
+ | typescript | 5.8.3 |
252
+ | @types/react | 19.1.1 |
253
+ | @types/react-dom | 19.1.1 |
254
+ | @tanstack/react-router | 1.144.0 |
255
+ | @tanstack/router-devtools | 1.144.0 |
256
+ | @tanstack/router-vite-plugin | 1.144.0 |
257
+ | zustand | 5.0.5 |
258
+ | @tanstack/react-query | 5.74.4 |
259
+ | @tanstack/react-query-devtools | 5.74.4 |
260
+ | @biomejs/biome | 1.9.4 |
261
+ | eslint | 9.39.4 |
262
+ | @eslint/js | 9.39.4 |
263
+ | typescript-eslint | 8.26.0 |
264
+ | eslint-plugin-react-hooks | 5.2.0 |
265
+ | eslint-plugin-react-refresh | 0.4.19 |
266
+ | globals | 15.15.0 |
267
+ | vitest | Latest (when testing enabled) |
268
+ | @testing-library/react | Latest (when testing enabled) |
269
+ | @testing-library/jest-dom | Latest (when testing enabled) |
270
+
271
+ ---
272
+
273
+ ## Project Structure
274
+
275
+ ```
276
+ src/
277
+ index.ts Entry point — greeting, menu, error handling
278
+ types/index.ts Cart, ProjectType, ReactViteCore, ChromeExtensionCore, NextJSCore
279
+ constants/index.ts Top-level menu options (React+Vite, Chrome Extension, Next.js, Nuxt)
280
+ commands/
281
+ update.ts runUpdate() — check and install latest version from npm
282
+ options/
283
+ index.ts Top-level project type selection
284
+ react-vite/
285
+ index.ts React + Vite menu flow
286
+ constants/index.ts Menu option definitions (layout, router, state, query, CSS, AI, testing, linter)
287
+ types/index.ts MenuOptions type
288
+ chrome-extension/
289
+ index.ts Chrome Extension menu flow
290
+ constants/index.ts Menu option definitions (state, query, CSS, AI, linter)
291
+ scaffold/
292
+ errors.ts ScaffoldError, isNodeError
293
+ utils.ts FileMap, dirExists(), writeProjectFile()
294
+ shared/
295
+ claude-setup.ts Shared Claude Code setup templates
296
+ react-vite/
297
+ index.ts Scaffold orchestrator
298
+ templates/
299
+ package-json.ts packageJsonTemplate(cart)
300
+ vite-config.ts viteConfigTemplate(cart)
301
+ tsconfig.ts tsconfigTemplate(), tsconfigNodeTemplate()
302
+ index-html.ts indexHtmlTemplate(projectName)
303
+ main-tsx.ts mainTsxTemplate(layout)
304
+ app-tsx.ts appTsxFsdTemplate(), appTsxBprTemplate()
305
+ router.ts rootRouteTemplate(), indexRouteTemplate()
306
+ zustand.ts zustandStoreTemplate()
307
+ query.ts queryProviderBprTemplate()
308
+ linter.ts biomeConfigTemplate(), eslintConfigTemplate()
309
+ testing-setup.ts vitestConfigTemplate(), testingSetupTemplate()
310
+ styles.ts stylesCssTemplate()
311
+ gitignore.ts gitignoreTemplate()
312
+ claude-setup.ts claudeSetupTemplate()
313
+ home-page.ts homePageTemplate()
314
+ vite-env-d-ts.ts viteEnvDtsTemplate()
315
+ copilot-instructions.ts getCopilotInstructionFiles(cart)
316
+ fsd-layout.ts getFsdFileMap(cart)
317
+ bpr-layout.ts getBprFileMap(cart)
318
+ chrome-extension/
319
+ index.ts Scaffold orchestrator for Chrome extensions
320
+ templates/
321
+ package-json.ts packageJsonTemplate(cart)
322
+ vite-config.ts viteConfigTemplate(cart)
323
+ manifest-json.ts manifestJsonTemplate(cart)
324
+ tsconfig.ts tsconfigTemplate()
325
+ main-tsx.ts mainTsxTemplate()
326
+ app-tsx.ts appTsxTemplate()
327
+ layout.ts layoutTemplate()
328
+ linter.ts biomeConfigTemplate(), eslintConfigTemplate()
329
+ query.ts queryProviderTemplate()
330
+ gitignore.ts gitignoreTemplate()
331
+ claude-setup.ts claudeSetupTemplate()
332
+ build-extension-script.ts buildExtensionScriptTemplate()
333
+ utils/
334
+ animation.ts typeWriter effect
335
+ user.ts getUserName() from git config
336
+ check-node-version.ts checkNodeVersion() — verify Node.js >= 20.0.0
337
+ index.ts sleep()
338
+ ```
339
+
340
+ ---
341
+
342
+ ## Adding a New Project Type
343
+
344
+ To enable a new project type (e.g., enable Next.js):
345
+
346
+ 1. Set `disabled: false` in `src/constants/index.ts`
347
+ 2. Create `src/options/<project-name>/` directory with:
348
+ - `index.ts` — menu flow function (e.g. `flowNextJS()`)
349
+ - `constants/index.ts` — menu option definitions
350
+ 3. Handle the new type in `src/options/index.ts` — import and call the flow function
351
+ 4. Add the interface to `src/types/index.ts` and include it in the `Cart` union (e.g. `NextJSCore`)
352
+ 5. Create `src/scaffold/<project-name>/` with:
353
+ - `index.ts` — scaffold orchestrator (spinner, file writing, cleanup on error)
354
+ - `templates/` — all template functions (package.json, config files, source templates)
355
+ 6. Register Copilot instruction templates if AI setup is available
356
+
357
+ ## Adding a New Option to React + Vite
358
+
359
+ To add a new menu option (e.g., a new UI library):
360
+
361
+ 1. Add the constant to `src/options/react-vite/constants/index.ts`
362
+ - Define `REACT_MENU_<OPTION_NAME>` with display, value, description, disabled fields
363
+ 2. Export the value type from `src/types/index.ts` and add the field to `ReactViteCore`
364
+ 3. Add a `menu<OptionName>` function in `src/options/react-vite/index.ts` using `selectFromMenu`
365
+ 4. Call it in `flowReactVite` in the right order (before scaffold step)
366
+ 5. Update `getFsdFileMap` and `getBprFileMap` in `src/scaffold/react-vite/templates/` to handle the new option
367
+ 6. **Add a Copilot instruction template** in `src/scaffold/react-vite/templates/copilot-instructions.ts`:
368
+ - Write a new template function (e.g. `uiLibraryTemplate(cart)`) returning markdown with `applyTo` frontmatter scoped to both FSD and BPR paths
369
+ - Register it inside `getCopilotInstructionFiles` under a conditional block keyed by the new cart field
370
+ - If the new option introduces new file paths, extend `Paths` type and both `FSD_PATHS` / `BPR_PATHS` maps
371
+
372
+ **This step is mandatory** — every scaffolded project with the new option must receive its matching Copilot instruction file.
373
+
374
+ ## Adding a New Option to Chrome Extension
375
+
376
+ Same process as React + Vite:
377
+
378
+ 1. Add the constant to `src/options/chrome-extension/constants/index.ts`
379
+ 2. Export the value type from `src/types/index.ts` and add the field to `ChromeExtensionCore`
380
+ 3. Add a `menu<OptionName>` function in `src/options/chrome-extension/index.ts`
381
+ 4. Call it in `flowChromeExtension`
382
+ 5. Update templates in `src/scaffold/chrome-extension/templates/` to handle the new option
383
+ 6. Add a Copilot instruction template if applicable (Chrome extensions also use AI setup)