ai-devkit 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +364 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +24 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/init.d.ts +9 -0
  8. package/dist/commands/init.d.ts.map +1 -0
  9. package/dist/commands/init.js +162 -0
  10. package/dist/commands/init.js.map +1 -0
  11. package/dist/commands/phase.d.ts +2 -0
  12. package/dist/commands/phase.d.ts.map +1 -0
  13. package/dist/commands/phase.js +83 -0
  14. package/dist/commands/phase.js.map +1 -0
  15. package/dist/index.d.ts +4 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +23 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/lib/Config.d.ts +12 -0
  20. package/dist/lib/Config.d.ts.map +1 -0
  21. package/dist/lib/Config.js +94 -0
  22. package/dist/lib/Config.js.map +1 -0
  23. package/dist/lib/TemplateManager.d.ts +13 -0
  24. package/dist/lib/TemplateManager.d.ts.map +1 -0
  25. package/dist/lib/TemplateManager.js +129 -0
  26. package/dist/lib/TemplateManager.js.map +1 -0
  27. package/dist/types.d.ts +17 -0
  28. package/dist/types.d.ts.map +1 -0
  29. package/dist/types.js +22 -0
  30. package/dist/types.js.map +1 -0
  31. package/package.json +46 -0
  32. package/templates/env/claude/CLAUDE.md +52 -0
  33. package/templates/env/claude/commands/check-implementation.md +21 -0
  34. package/templates/env/claude/commands/code-review.md +81 -0
  35. package/templates/env/claude/commands/execute-plan.md +71 -0
  36. package/templates/env/claude/commands/new-requirement.md +127 -0
  37. package/templates/env/claude/commands/review-design.md +11 -0
  38. package/templates/env/claude/commands/review-requirements.md +9 -0
  39. package/templates/env/claude/commands/update-planning.md +61 -0
  40. package/templates/env/claude/commands/writing-test.md +44 -0
  41. package/templates/env/cursor/commands/check-implementation.md +21 -0
  42. package/templates/env/cursor/commands/code-review.md +81 -0
  43. package/templates/env/cursor/commands/execute-plan.md +71 -0
  44. package/templates/env/cursor/commands/new-requirement.md +127 -0
  45. package/templates/env/cursor/commands/review-design.md +11 -0
  46. package/templates/env/cursor/commands/review-requirements.md +9 -0
  47. package/templates/env/cursor/commands/update-planning.md +61 -0
  48. package/templates/env/cursor/commands/writing-test.md +44 -0
  49. package/templates/env/cursor/rules/ai-devkit.md +51 -0
  50. package/templates/phases/deployment.md +72 -0
  51. package/templates/phases/design.md +60 -0
  52. package/templates/phases/implementation.md +65 -0
  53. package/templates/phases/monitoring.md +80 -0
  54. package/templates/phases/planning.md +60 -0
  55. package/templates/phases/requirements.md +51 -0
  56. package/templates/phases/testing.md +81 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.2.0] - 2025-10-14
11
+
12
+ ### Added
13
+ - Eight slash commands for Cursor and Claude Code:
14
+ - `/new-requirement` - Complete guided workflow from requirements to PR/MR creation
15
+ - `/code-review` - Structured local code reviews
16
+ - `/execute-plan` - Walk feature plans task-by-task
17
+ - `/writing-test` - Generate tests with guidance for 100% coverage
18
+ - `/update-planning` - Reconcile progress with planning docs
19
+ - `/check-implementation` - Compare implementation with design
20
+ - `/review-design` - Review system design and architecture
21
+ - `/review-requirements` - Review and summarize requirements
22
+ - Claude workspace configuration file (`CLAUDE.md`)
23
+ - Cursor rules file (`ai-devkit.md`)
24
+ - Design documentation requirements for mermaid diagrams (architecture and data flow)
25
+
26
+ ## [0.1.0] - 2025-10-14
27
+
28
+ ### Added
29
+ - Initial release of AI DevKit CLI
30
+ - Interactive `init` command for project initialization
31
+ - Support for Cursor and Claude Code environments
32
+ - Seven phase templates: requirements, design, planning, implementation, testing, deployment, monitoring
33
+ - `phase` command for adding individual phases
34
+ - Configuration management with `.ai-devkit.json`
35
+ - Template overwrite prompts for existing files
36
+ - Comprehensive documentation and README
37
+ - TypeScript support with full type definitions
38
+ - Cursor rules in `.cursor/rules/` directory
39
+ - Cursor slash commands as individual Markdown files in `.cursor/commands/`
40
+ - Claude Code workspace configuration in `CLAUDE.md`
41
+
42
+ ### Features
43
+ - Interactive prompts with Inquirer
44
+ - Flag-based overrides for automation
45
+ - Markdown templates with YAML frontmatter
46
+ - Cursor rules and slash commands generation
47
+ - Claude Code workspace configuration
48
+ - State tracking for initialized phases
49
+
package/README.md ADDED
@@ -0,0 +1,364 @@
1
+ # AI DevKit
2
+
3
+ A CLI toolkit for AI-assisted software development with structured phase templates and environment setup for Cursor and Claude Code.
4
+
5
+ ## Features
6
+
7
+ - 🎯 **Phase-based Development**: Structured templates for each stage of the software development lifecycle
8
+ - 🤖 **AI Environment Setup**: Automatic configuration for Cursor and Claude Code
9
+ - 📝 **Customizable Templates**: Markdown-based templates with YAML frontmatter
10
+ - 🚀 **Interactive CLI**: User-friendly prompts with flag override support
11
+ - ⚙️ **State Management**: Tracks initialized phases and configuration
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ # Using npx (no installation needed)
17
+ npx ai-devkit init
18
+
19
+ # Or install globally
20
+ npm install -g ai-devkit
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ Initialize AI DevKit in your project:
26
+
27
+ ```bash
28
+ # Interactive mode (recommended)
29
+ ai-devkit init
30
+
31
+ # With flags
32
+ ai-devkit init --environment cursor --all
33
+
34
+ # Initialize specific phases
35
+ ai-devkit init --phases requirements,design,planning
36
+ ```
37
+
38
+ This will:
39
+ 1. Create a `.ai-devkit.json` configuration file
40
+ 2. Set up your AI development environment (Cursor/Claude Code)
41
+ 3. Generate phase templates in `docs/ai/`
42
+
43
+ ## Available Phases
44
+
45
+ - **Requirements**: Problem understanding, requirements gathering, and success criteria
46
+ - **Design**: System architecture, data models, and technical design (include mermaid diagrams for architecture/data flow)
47
+ - **Planning**: Task breakdown, milestones, and project timeline
48
+ - **Implementation**: Technical implementation notes and code guidelines
49
+ - **Testing**: Testing strategy, test cases, and quality assurance
50
+ - **Deployment**: Deployment process, infrastructure, and release procedures
51
+ - **Monitoring**: Monitoring strategy, metrics, alerts, and observability
52
+
53
+ ## Commands
54
+
55
+ ### `ai-devkit init`
56
+
57
+ Initialize AI DevKit in your project.
58
+
59
+ **Options:**
60
+ - `-e, --environment <env>`: Specify environment (cursor|claude|both)
61
+ - `-a, --all`: Initialize all phases at once
62
+ - `-p, --phases <phases>`: Comma-separated list of specific phases
63
+
64
+ **Examples:**
65
+ ```bash
66
+ # Interactive mode
67
+ ai-devkit init
68
+
69
+ # Initialize for Cursor with all phases
70
+ ai-devkit init --environment cursor --all
71
+
72
+ # Initialize specific phases
73
+ ai-devkit init --phases requirements,design,implementation
74
+ ```
75
+
76
+ ### `ai-devkit phase [name]`
77
+
78
+ Add or update a specific phase template.
79
+
80
+ **Examples:**
81
+ ```bash
82
+ # Interactive selection
83
+ ai-devkit phase
84
+
85
+ # Add specific phase
86
+ ai-devkit phase requirements
87
+ ai-devkit phase testing
88
+ ```
89
+
90
+ ## Generated Structure
91
+
92
+ After initialization, your project will have:
93
+
94
+ ```
95
+ your-project/
96
+ ├── .ai-devkit.json # Configuration and state
97
+ ├── docs/
98
+ │ └── ai/
99
+ │ ├── requirements/
100
+ │ │ └── README.md
101
+ │ ├── design/
102
+ │ │ └── README.md
103
+ │ ├── planning/
104
+ │ │ └── README.md
105
+ │ ├── implementation/
106
+ │ │ └── README.md
107
+ │ ├── testing/
108
+ │ │ └── README.md
109
+ │ ├── deployment/
110
+ │ │ └── README.md
111
+ │ └── monitoring/
112
+ │ └── README.md
113
+ └── [Environment-specific files]
114
+ ```
115
+
116
+ ### For Cursor:
117
+ ```
118
+ └── .cursor/
119
+ ├── rules/ # Project-specific rules (Markdown files)
120
+ │ └── ai-devkit.md
121
+ └── commands/ # Custom slash commands (Markdown files)
122
+ ├── new-requirement.md
123
+ ├── code-review.md
124
+ ├── execute-plan.md
125
+ ├── writing-test.md
126
+ ├── update-planning.md
127
+ ├── check-implementation.md
128
+ ├── review-design.md
129
+ └── review-requirements.md
130
+ ```
131
+
132
+ ### For Claude Code:
133
+ ```
134
+ └── .claude/
135
+ ├── CLAUDE.md # Workspace configuration
136
+ └── commands/ # Custom commands (Markdown files)
137
+ ├── new-requirement.md
138
+ ├── code-review.md
139
+ ├── execute-plan.md
140
+ ├── writing-test.md
141
+ ├── update-planning.md
142
+ ├── check-implementation.md
143
+ ├── review-design.md
144
+ └── review-requirements.md
145
+ ```
146
+
147
+ ## Customizing Templates
148
+
149
+ All templates are plain Markdown files with YAML frontmatter. You can customize them to fit your project's needs:
150
+
151
+ ```markdown
152
+ ---
153
+ phase: requirements
154
+ title: Requirements & Problem Understanding
155
+ description: Clarify the problem space, gather requirements, and define success criteria
156
+ ---
157
+
158
+ # Your custom content here
159
+ ```
160
+
161
+ Templates are designed to provide structure while remaining concise and AI-friendly.
162
+
163
+ ## Environment Setup
164
+
165
+ ### Cursor
166
+
167
+ Generated files:
168
+ - `.cursor/rules/`: Project-specific rules as Markdown files (per [Cursor documentation](https://cursor.com/docs/context/rules))
169
+ - `.cursor/commands/`: Custom slash commands as Markdown files (per [Cursor documentation](https://cursor.com/docs/agent/chat/commands))
170
+
171
+ Available slash commands:
172
+ - `/new-requirement`: Complete workflow for adding a new feature from requirements to PR
173
+ - `/code-review`: Structured local code review against design docs before pushing changes
174
+ - `/execute-plan`: Walk a feature plan task-by-task with interactive prompts
175
+ - `/writing-test`: Write unit/integration tests targeting 100% coverage
176
+ - `/update-planning`: Update planning and task breakdown
177
+ - `/check-implementation`: Compare implementation with design
178
+ - `/review-design`: Review system design and architecture
179
+ - `/review-requirements`: Review and summarize requirements
180
+
181
+ Each command is stored as a plain Markdown file in `.cursor/commands/` and will automatically appear when you type `/` in Cursor's chat input.
182
+
183
+ ### Claude Code
184
+
185
+ Generated files:
186
+ - `.claude/CLAUDE.md`: Workspace configuration and guidelines
187
+ - `.claude/commands/`: Custom commands as Markdown files
188
+
189
+ Available commands:
190
+ - `new-requirement` - Complete workflow for adding a new feature from requirements to PR
191
+ - `code-review` - Structured local code review against design docs before pushing changes
192
+ - `execute-plan` - Walk a feature plan task-by-task with interactive prompts
193
+ - `writing-test` - Write unit/integration tests targeting 100% coverage
194
+ - `update-planning` - Update planning and task breakdown
195
+ - `check-implementation` - Compare implementation with design
196
+ - `review-design` - Review system design and architecture
197
+ - `review-requirements` - Review and summarize requirements
198
+
199
+ Commands can be referenced in Claude Code chats to guide AI assistance through your development phases.
200
+
201
+ ## Workflow Examples
202
+
203
+ ### Initial Project Setup
204
+
205
+ 1. **Initialize your project:**
206
+ ```bash
207
+ ai-devkit init
208
+ ```
209
+
210
+ 2. **Start with requirements:**
211
+ - Fill out `docs/ai/requirements/README.md`
212
+ - Use your AI assistant to help clarify and document requirements
213
+
214
+ 3. **Design your system:**
215
+ - Complete `docs/ai/design/README.md` and feature-specific files
216
+ - Include mermaid diagrams for architecture, component interactions, and data flow
217
+ - Reference requirements when making design decisions
218
+
219
+ 4. **Plan your work:**
220
+ - Break down tasks in `docs/ai/planning/README.md`
221
+ - Estimate and prioritize
222
+
223
+ 5. **Implement with guidance:**
224
+ - Follow patterns in `docs/ai/implementation/README.md`
225
+ - Keep implementation notes updated
226
+
227
+ 6. **Test thoroughly:**
228
+ - Use `docs/ai/testing/README.md` as your testing guide
229
+ - Document test cases and results
230
+
231
+ 7. **Deploy confidently:**
232
+ - Follow deployment procedures in `docs/ai/deployment/README.md`
233
+
234
+ 8. **Monitor and iterate:**
235
+ - Set up monitoring per `docs/ai/monitoring/README.md`
236
+
237
+ ### Adding a New Feature
238
+
239
+ **Use the `/new-requirement` command for a guided workflow:**
240
+
241
+ 1. **In Cursor or Claude Code**, type `/new-requirement`
242
+ 2. The AI will guide you through:
243
+ - 📋 Capturing requirement details
244
+ - 🔍 Creating feature-specific documentation
245
+ - 📐 Designing the solution
246
+ - 📅 Planning tasks and breaking down work
247
+ - 💻 Implementation (task by task)
248
+ - ✅ Testing and verification
249
+ - 🔀 Git commits and PR/MR creation
250
+
251
+ **Review and refine your documentation:**
252
+ - After drafting requirements, run `/review-requirements` to validate completeness
253
+ - After drafting design, run `/review-design` to ensure architecture clarity and mermaid diagrams
254
+
255
+ **Execute your plan:**
256
+ - Run `/execute-plan` to step through tasks interactively:
257
+ - Reads `docs/ai/planning/feature-{name}.md`
258
+ - Presents tasks in order with context
259
+ - Captures status/notes for each task
260
+ - Prompts you to update documentation as you progress
261
+
262
+ **Before pushing your code:**
263
+ - Run `/code-review` to perform a structured local review:
264
+ - Checks alignment with design docs
265
+ - Spots logic/security/performance issues
266
+ - Highlights redundant code and missing tests
267
+ - Suggests documentation updates
268
+
269
+ **Generate comprehensive tests:**
270
+ - Run `/writing-test` to create unit and integration tests targeting 100% coverage
271
+
272
+ This workflow creates feature-specific files:
273
+ - `docs/ai/requirements/feature-{name}.md`
274
+ - `docs/ai/design/feature-{name}.md`
275
+ - `docs/ai/planning/feature-{name}.md`
276
+ - `docs/ai/implementation/feature-{name}.md`
277
+ - `docs/ai/testing/feature-{name}.md`
278
+
279
+ ## Use Cases
280
+
281
+ - **New Projects**: Scaffold complete development documentation
282
+ - **Existing Projects**: Add structured documentation gradually
283
+ - **Team Collaboration**: Share common development practices
284
+ - **AI Pair Programming**: Provide context for AI assistants
285
+ - **Knowledge Management**: Document decisions and patterns
286
+
287
+ ## Best Practices
288
+
289
+ 1. **Keep templates updated**: As your project evolves, update phase documentation
290
+ 2. **Reference across phases**: Link requirements to design, design to implementation
291
+ 3. **Use with AI assistants**: Templates are designed to work well with AI code assistants
292
+ 4. **Customize for your needs**: Templates are starting points, not rigid requirements
293
+ 5. **Track decisions**: Document architectural decisions and their rationale
294
+
295
+ ## Configuration File
296
+
297
+ The `.ai-devkit.json` file tracks your setup:
298
+
299
+ ```json
300
+ {
301
+ "version": "0.2.0",
302
+ "environment": "cursor",
303
+ "initializedPhases": ["requirements", "design", "planning"],
304
+ "createdAt": "2025-10-14T...",
305
+ "updatedAt": "2025-10-14T..."
306
+ }
307
+ ```
308
+
309
+ ## Development
310
+
311
+ To work on ai-devkit itself:
312
+
313
+ ```bash
314
+ # Clone the repository
315
+ git clone <repository-url>
316
+ cd ai-devkit
317
+
318
+ # Install dependencies
319
+ npm install
320
+
321
+ # Run in development mode
322
+ npm run dev init
323
+
324
+ # Build
325
+ npm run build
326
+
327
+ # Test locally
328
+ npm link
329
+ ai-devkit init
330
+ ```
331
+
332
+ > **Note:** `ai-devkit init` now ensures the current directory is a git repository. If git is available and the repo isn't initialized, it will run `git init` automatically.
333
+
334
+ ## Contributing
335
+
336
+ Contributions are welcome! Please feel free to submit issues and pull requests.
337
+
338
+ ## License
339
+
340
+ MIT
341
+
342
+ ---
343
+
344
+ **Happy building with AI! 🚀**
345
+
346
+ ## Quick Reference
347
+
348
+ | Task | Command |
349
+ |------|---------|
350
+ | Initialize everything | `npx ai-devkit init --all` |
351
+ | Initialize for Cursor | `npx ai-devkit init --environment cursor` |
352
+ | Add specific phases | `npx ai-devkit init --phases requirements,design` |
353
+ | Add one phase later | `npx ai-devkit phase testing` |
354
+ | Guided feature workflow | `/new-requirement` (Cursor & Claude) |
355
+ | Execute feature plan | `/execute-plan` (Cursor & Claude) |
356
+ | Generate tests | `/writing-test` (Cursor & Claude) |
357
+ | **Local code review** | `/code-review` (Cursor & Claude) |
358
+ | Help | `npx ai-devkit --help` |
359
+
360
+ | Quick links | Description |
361
+ |-------------|-------------|
362
+ | [CHANGELOG.md](CHANGELOG.md) | Recent changes and release notes |
363
+ | [templates/](templates/) | Phase and environment templates |
364
+
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const commander_1 = require("commander");
5
+ const init_1 = require("./commands/init");
6
+ const phase_1 = require("./commands/phase");
7
+ const program = new commander_1.Command();
8
+ program
9
+ .name('ai-devkit')
10
+ .description('AI-assisted software development toolkit')
11
+ .version('0.1.0');
12
+ program
13
+ .command('init')
14
+ .description('Initialize AI DevKit in the current directory')
15
+ .option('-e, --environment <env>', 'Development environment (cursor|claude|both)')
16
+ .option('-a, --all', 'Initialize all phases')
17
+ .option('-p, --phases <phases>', 'Comma-separated list of phases to initialize')
18
+ .action(init_1.initCommand);
19
+ program
20
+ .command('phase [name]')
21
+ .description('Add a specific phase template (requirements|design|planning|implementation|testing|deployment|monitoring)')
22
+ .action(phase_1.phaseCommand);
23
+ program.parse();
24
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,4CAAgD;AAEhD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,0CAA0C,CAAC;KACvD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,+CAA+C,CAAC;KAC5D,MAAM,CAAC,yBAAyB,EAAE,8CAA8C,CAAC;KACjF,MAAM,CAAC,WAAW,EAAE,uBAAuB,CAAC;KAC5C,MAAM,CAAC,uBAAuB,EAAE,8CAA8C,CAAC;KAC/E,MAAM,CAAC,kBAAW,CAAC,CAAC;AAEvB,OAAO;KACJ,OAAO,CAAC,cAAc,CAAC;KACvB,WAAW,CAAC,2GAA2G,CAAC;KACxH,MAAM,CAAC,oBAAY,CAAC,CAAC;AAExB,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Environment } from '../types';
2
+ interface InitOptions {
3
+ environment?: Environment;
4
+ all?: boolean;
5
+ phases?: string;
6
+ }
7
+ export declare function initCommand(options: InitOptions): Promise<void>;
8
+ export {};
9
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAgD,MAAM,UAAU,CAAC;AAoCrF,UAAU,WAAW;IACnB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,iBAqIrD"}
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.initCommand = initCommand;
7
+ const child_process_1 = require("child_process");
8
+ const inquirer_1 = __importDefault(require("inquirer"));
9
+ const chalk_1 = __importDefault(require("chalk"));
10
+ const Config_1 = require("../lib/Config");
11
+ const TemplateManager_1 = require("../lib/TemplateManager");
12
+ const types_1 = require("../types");
13
+ function isGitAvailable() {
14
+ try {
15
+ (0, child_process_1.execSync)('git --version', { stdio: 'ignore' });
16
+ return true;
17
+ }
18
+ catch {
19
+ return false;
20
+ }
21
+ }
22
+ function ensureGitRepository() {
23
+ if (!isGitAvailable()) {
24
+ console.log(chalk_1.default.yellow('⚠️ Git is not installed or not available on the PATH. Skipping repository initialization.'));
25
+ return;
26
+ }
27
+ try {
28
+ (0, child_process_1.execSync)('git rev-parse --is-inside-work-tree', { stdio: 'ignore' });
29
+ }
30
+ catch {
31
+ try {
32
+ (0, child_process_1.execSync)('git init', { stdio: 'ignore' });
33
+ console.log(chalk_1.default.green('✓ Initialized a new git repository'));
34
+ }
35
+ catch (error) {
36
+ console.log(chalk_1.default.red('✗ Failed to initialize git repository:'), error instanceof Error ? error.message : error);
37
+ }
38
+ }
39
+ }
40
+ async function initCommand(options) {
41
+ const configManager = new Config_1.ConfigManager();
42
+ const templateManager = new TemplateManager_1.TemplateManager();
43
+ ensureGitRepository();
44
+ // Check if already initialized
45
+ if (await configManager.exists()) {
46
+ const { shouldContinue } = await inquirer_1.default.prompt([
47
+ {
48
+ type: 'confirm',
49
+ name: 'shouldContinue',
50
+ message: 'AI DevKit is already initialized. Do you want to reconfigure?',
51
+ default: false
52
+ }
53
+ ]);
54
+ if (!shouldContinue) {
55
+ console.log(chalk_1.default.yellow('Initialization cancelled.'));
56
+ return;
57
+ }
58
+ }
59
+ // Determine environment
60
+ let environment = options.environment;
61
+ if (!environment) {
62
+ const envAnswer = await inquirer_1.default.prompt([
63
+ {
64
+ type: 'list',
65
+ name: 'environment',
66
+ message: 'Which AI development environment are you using?',
67
+ choices: [
68
+ { name: 'Cursor', value: 'cursor' },
69
+ { name: 'Claude Code', value: 'claude' },
70
+ { name: 'Both', value: 'both' }
71
+ ]
72
+ }
73
+ ]);
74
+ environment = envAnswer.environment;
75
+ }
76
+ // Determine which phases to initialize
77
+ let selectedPhases = [];
78
+ if (options.all) {
79
+ selectedPhases = [...types_1.AVAILABLE_PHASES];
80
+ }
81
+ else if (options.phases) {
82
+ selectedPhases = options.phases.split(',').map(p => p.trim());
83
+ }
84
+ else {
85
+ const phaseAnswer = await inquirer_1.default.prompt([
86
+ {
87
+ type: 'checkbox',
88
+ name: 'phases',
89
+ message: 'Which phases do you want to initialize? (or use --all flag)',
90
+ choices: types_1.AVAILABLE_PHASES.map(phase => ({
91
+ name: types_1.PHASE_DISPLAY_NAMES[phase],
92
+ value: phase,
93
+ checked: true
94
+ }))
95
+ }
96
+ ]);
97
+ selectedPhases = phaseAnswer.phases;
98
+ }
99
+ if (selectedPhases.length === 0) {
100
+ console.log(chalk_1.default.yellow('No phases selected. Nothing to initialize.'));
101
+ return;
102
+ }
103
+ console.log(chalk_1.default.blue('\nInitializing AI DevKit...\n'));
104
+ // Create or update config
105
+ await configManager.create(environment);
106
+ console.log(chalk_1.default.green('✓ Created configuration file'));
107
+ // Copy environment templates
108
+ if (environment) {
109
+ const envExists = await templateManager.environmentFilesExist(environment);
110
+ let shouldCopyEnv = true;
111
+ if (envExists) {
112
+ const { overwrite } = await inquirer_1.default.prompt([
113
+ {
114
+ type: 'confirm',
115
+ name: 'overwrite',
116
+ message: `Environment configuration files already exist. Overwrite?`,
117
+ default: false
118
+ }
119
+ ]);
120
+ shouldCopyEnv = overwrite;
121
+ }
122
+ if (shouldCopyEnv) {
123
+ const envFiles = await templateManager.copyEnvironmentTemplates(environment);
124
+ envFiles.forEach(file => {
125
+ console.log(chalk_1.default.green(`✓ Created ${file}`));
126
+ });
127
+ }
128
+ else {
129
+ console.log(chalk_1.default.yellow('⊘ Skipped environment configuration'));
130
+ }
131
+ }
132
+ // Copy phase templates
133
+ for (const phase of selectedPhases) {
134
+ const exists = await templateManager.fileExists(phase);
135
+ let shouldCopy = true;
136
+ if (exists) {
137
+ const { overwrite } = await inquirer_1.default.prompt([
138
+ {
139
+ type: 'confirm',
140
+ name: 'overwrite',
141
+ message: `${types_1.PHASE_DISPLAY_NAMES[phase]} already exists. Overwrite?`,
142
+ default: false
143
+ }
144
+ ]);
145
+ shouldCopy = overwrite;
146
+ }
147
+ if (shouldCopy) {
148
+ const file = await templateManager.copyPhaseTemplate(phase);
149
+ await configManager.addPhase(phase);
150
+ console.log(chalk_1.default.green(`✓ Created ${phase} phase`));
151
+ }
152
+ else {
153
+ console.log(chalk_1.default.yellow(`⊘ Skipped ${phase} phase`));
154
+ }
155
+ }
156
+ console.log(chalk_1.default.green('\n✨ AI DevKit initialized successfully!\n'));
157
+ console.log(chalk_1.default.blue('Next steps:'));
158
+ console.log(' • Review and customize templates in docs/ai/');
159
+ console.log(' • Use your AI development environment with the generated configuration');
160
+ console.log(' • Run `ai-devkit phase <name>` to add more phases later\n');
161
+ }
162
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;;;;AA+CA,kCAqIC;AApLD,iDAAyC;AACzC,wDAAgC;AAChC,kDAA0B;AAC1B,0CAA8C;AAC9C,4DAAyD;AACzD,oCAAqF;AAErF,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,IAAA,wBAAQ,EAAC,eAAe,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,MAAM,CACV,4FAA4F,CAC7F,CACF,CAAC;QACF,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,IAAA,wBAAQ,EAAC,qCAAqC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,IAAA,wBAAQ,EAAC,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;YAC1C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,GAAG,CAAC,wCAAwC,CAAC,EACnD,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,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AM,eAAe,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC5D,MAAM,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC;QACvD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,0EAA0E,CAAC,CAAC;IACxF,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function phaseCommand(phaseName?: string): Promise<void>;
2
+ //# sourceMappingURL=phase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase.d.ts","sourceRoot":"","sources":["../../src/commands/phase.ts"],"names":[],"mappings":"AAMA,wBAAsB,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,iBA+EpD"}