@agentic15.com/agentic15-claude-zen 2.0.6 → 3.0.2

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 (65) hide show
  1. package/CHANGELOG.md +298 -5
  2. package/README.md +16 -3
  3. package/bin/create-agentic15-claude-zen.js +1 -1
  4. package/package.json +3 -6
  5. package/src/cli/CommitCommand.js +19 -3
  6. package/src/cli/PlanCommand.js +184 -24
  7. package/src/cli/TaskCommand.js +3 -1
  8. package/src/core/ProjectInitializer.js +19 -23
  9. package/src/core/TaskIssueMapper.js +15 -11
  10. package/src/core/TemplateManager.js +2 -1
  11. package/templates/.github/ISSUE_TEMPLATE/task.md +23 -0
  12. package/templates/.github/PULL_REQUEST_TEMPLATE.md +23 -0
  13. package/templates/README.md +52 -55
  14. package/dist/hooks/auto-format.js +0 -2
  15. package/dist/hooks/check-pending-reviews.js +0 -2
  16. package/dist/hooks/complete-task.js +0 -2
  17. package/dist/hooks/detect-pending-reviews.js +0 -2
  18. package/dist/hooks/enforce-hard-requirements.js +0 -2
  19. package/dist/hooks/enforce-migration-workflow.js +0 -2
  20. package/dist/hooks/enforce-plan-template.js +0 -2
  21. package/dist/hooks/enforce-structured-development.js +0 -2
  22. package/dist/hooks/enforce-test-pyramid.js +0 -2
  23. package/dist/hooks/init-task-tracker.js +0 -2
  24. package/dist/hooks/performance-cache.js +0 -2
  25. package/dist/hooks/prevent-read-bypass.js +0 -2
  26. package/dist/hooks/session-start-context.js +0 -2
  27. package/dist/hooks/start-task.js +0 -2
  28. package/dist/hooks/task-status.js +0 -2
  29. package/dist/hooks/validate-component-contract.js +0 -2
  30. package/dist/hooks/validate-database-changes.js +0 -2
  31. package/dist/hooks/validate-e2e-coverage.js +0 -2
  32. package/dist/hooks/validate-git-workflow.js +0 -2
  33. package/dist/hooks/validate-integration-site.js +0 -2
  34. package/dist/hooks/validate-migration-impact.js +0 -2
  35. package/dist/hooks/validate-task-completion.js +0 -2
  36. package/dist/hooks/validate-test-quality.js +0 -2
  37. package/dist/hooks/validate-test-results.js +0 -2
  38. package/dist/hooks/validate-ui-integration.js +0 -2
  39. package/dist/hooks/validate-ui-runtime.js +0 -2
  40. package/dist/hooks/validate-ui-syntax.js +0 -2
  41. package/dist/hooks/validate-ui-visual-native.js +0 -2
  42. package/dist/hooks/validate-ui-visual.js +0 -2
  43. package/dist/hooks/validate-visual-regression.js +0 -2
  44. package/dist/index.js +0 -24
  45. package/dist/index.js.map +0 -7
  46. package/dist/scripts/add-version-headers.js +0 -2
  47. package/dist/scripts/help.js +0 -2
  48. package/dist/scripts/plan-amend.js +0 -2
  49. package/dist/scripts/plan-create.js +0 -2
  50. package/dist/scripts/plan-generate.js +0 -2
  51. package/dist/scripts/plan-help.js +0 -2
  52. package/dist/scripts/plan-init.js +0 -2
  53. package/dist/scripts/plan-manager.js +0 -2
  54. package/dist/scripts/pre-publish-checklist.js +0 -2
  55. package/dist/scripts/production-test.js +0 -2
  56. package/dist/scripts/profile-hooks.js +0 -2
  57. package/dist/scripts/setup-git-hooks.js +0 -2
  58. package/dist/scripts/task-done.js +0 -2
  59. package/dist/scripts/task-merge.js +0 -2
  60. package/dist/scripts/task-next.js +0 -2
  61. package/dist/scripts/task-start.js +0 -2
  62. package/dist/scripts/task-status.js +0 -2
  63. package/dist/scripts/verify-hooks.js +0 -2
  64. package/templates/.claude/CLAUDE.md +0 -408
  65. package/templates/.claude/ONBOARDING.md +0 -723
package/CHANGELOG.md CHANGED
@@ -1,11 +1,304 @@
1
- # Changelog
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
+ Copyright 2024-2025 agentic15.com
9
+
10
+ ## [3.0.2] - 2025-12-25
11
+
12
+ ### Summary
13
+ Publishing update - no code changes from v3.0.1.
14
+
15
+ This release publishes the interactive requirements mode to npm registry.
16
+
17
+ ## [3.0.1] - 2025-12-25
18
+
19
+ ### Summary
20
+ Patch release to publish the interactive requirements mode feature to npm.
21
+
22
+ This release makes v3.0.0 officially available on npm with the interactive mode feature fully documented and tested.
23
+
24
+ ## [3.0.0] - 2025-12-25
2
25
 
3
- All notable changes to this project will be documented in this file.
26
+ ### šŸŽ‰ MAJOR RELEASE - Complete CLI Architecture Transformation
4
27
 
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).
28
+ This is a **major breaking release** that fundamentally transforms the framework from npm script-based workflows to a pure CLI-driven architecture. The package has been completely rewritten, tested, and optimized for production use.
7
29
 
8
- Copyright 2024-2025 agentic15.com
30
+ ### šŸ†• Interactive Requirements Mode
31
+
32
+ Running `npx agentic15 plan` without arguments now enters **interactive mode**:
33
+ - Type or paste requirements of any length
34
+ - Include URLs, detailed specs, multiple paragraphs
35
+ - Press Ctrl+D (Mac/Linux) or Ctrl+Z+Enter (Windows) to save
36
+ - No shell escaping or quote issues
37
+ - Perfect for complex corporate websites, detailed project specs
38
+
39
+ **Example**:
40
+ ```bash
41
+ npx agentic15 plan
42
+ # Paste your requirements...
43
+ # Press Ctrl+D when done
44
+ ```
45
+
46
+ ### šŸ’„ Breaking Changes
47
+
48
+ **CRITICAL**: This release is **NOT backward compatible** with v1.x or v2.x workflows.
49
+
50
+ 1. **All npm scripts removed** - Use `npx agentic15 <command>` instead
51
+ - āŒ `npm run plan:generate` → āœ… `npx agentic15 plan "description"`
52
+ - āŒ `npm run plan:init` → āœ… `npx agentic15 plan` (auto-locks)
53
+ - āŒ `npm run task:start` → āœ… `npx agentic15 task next`
54
+ - āŒ No task:done - Status auto-detected by CLI
55
+
56
+ 2. **No obfuscated/minified code** - Ships pure ESM source code
57
+ - Removed 248KB of minified v1.x code
58
+ - Transparent, auditable codebase
59
+ - Easier debugging and contributions
60
+
61
+ 3. **Built-in plan logic** - No external script dependencies
62
+ - Plan generation/locking logic moved into PlanCommand class
63
+ - No npm script wrapper required
64
+ - Single command for entire workflow
65
+
66
+ 4. **v2.0 schema support** - Updated PROJECT-PLAN.json structure
67
+ - Root level uses `project` (singular) instead of `projects` (plural)
68
+ - Compatible with PROJECT-PLAN-TEMPLATE.json format
69
+ - Recursive task extraction from nested structures
70
+
71
+ ### ✨ What's New
72
+
73
+ #### CLI Commands (All New)
74
+ ```bash
75
+ npx agentic15 auth # One-time GitHub setup
76
+ npx agentic15 plan "desc" # Generate plan requirements
77
+ npx agentic15 plan # Lock plan (if PROJECT-PLAN.json exists)
78
+ npx agentic15 task next # Auto-start next pending task
79
+ npx agentic15 task start ID # Start specific task
80
+ npx agentic15 commit # Test, commit, push, create PR
81
+ npx agentic15 status # Show current progress
82
+ ```
83
+
84
+ #### GitHub Integration
85
+ - āœ… Issue templates (.github/ISSUE_TEMPLATE/task.md)
86
+ - āœ… PR templates (.github/PULL_REQUEST_TEMPLATE.md)
87
+ - āœ… CLI uses templates for consistent formatting
88
+ - āœ… Auto-generated issues follow standard structure
89
+ - āœ… Auto-generated PRs follow standard structure
90
+
91
+ #### Quality Improvements
92
+ - šŸ“¦ Package size: 46.0 kB compressed (down from 294KB)
93
+ - šŸ“ Total files: 52 (down from 67)
94
+ - 🧪 Black box tested - 5 critical bugs found and fixed
95
+ - āœ… All core workflows verified end-to-end
96
+ - šŸ“š Complete documentation with workflow diagrams
97
+
98
+ ### šŸ› Critical Bug Fixes (Found During Testing)
99
+
100
+ All bugs discovered and fixed during comprehensive black box testing:
101
+
102
+ 1. **Import Path Error** (bin/create-agentic15-claude-zen.js:179)
103
+ - Fixed: dist/index.js → src/index.js
104
+
105
+ 2. **Template Path Error** (src/core/TemplateManager.js:32)
106
+ - Fixed: Added '../..' to reach package root from src/core/
107
+
108
+ 3. **Obsolete Method Call** (src/core/ProjectInitializer.js)
109
+ - Removed: extractBundledFiles() call (tried to copy non-existent scripts)
110
+
111
+ 4. **Schema Compatibility** (src/cli/PlanCommand.js:207-210)
112
+ - Added: Support for v2.0 schema with singular 'project' at root
113
+
114
+ 5. **Wrong Method Reference** (src/cli/TaskCommand.js:155-158)
115
+ - Fixed: Now calls correct TaskIssueMapper.taskToIssueTitle/Body/Labels methods
116
+
117
+ ### šŸ“Š Testing & Verification
118
+
119
+ - āœ… **Test Repository**: https://github.com/agentic15/agentic15-test-v2
120
+ - āœ… **Project Creation**: Templates, dependencies, git, hooks
121
+ - āœ… **Plan Generation**: Requirements file, plan ID, ACTIVE-PLAN
122
+ - āœ… **Plan Locking**: Task extraction (3/3 tasks verified)
123
+ - āœ… **Task Management**: Auto-start next task, feature branch creation
124
+ - āœ… **Git Workflow**: Feature branches, status tracking
125
+
126
+ ### šŸŽÆ Migration Guide (v1.x/v2.x → v3.0.0)
127
+
128
+ **Before (v1.x/v2.x)**:
129
+ ```bash
130
+ npm run plan:generate "Build calculator"
131
+ # Claude creates plan
132
+ echo "plan-001-generated" > .claude/ACTIVE-PLAN
133
+ npm run plan:init
134
+ npm run task:start TASK-001
135
+ # Write code
136
+ npm run task:done
137
+ ```
138
+
139
+ **After (v3.0.0)**:
140
+ ```bash
141
+ npx agentic15 plan "Build calculator"
142
+ # Claude creates plan
143
+ npx agentic15 plan
144
+ npx agentic15 task next
145
+ # Write code
146
+ npx agentic15 commit
147
+ ```
148
+
149
+ ### šŸ“¦ Package Details
150
+
151
+ - **Size**: 46.0 kB compressed, 177.7 kB unpacked
152
+ - **Files**: 52
153
+ - **Architecture**: Pure ESM modules
154
+ - **Node**: >=18.0.0
155
+ - **Dependencies**: @octokit/rest@20.0.2, commander@12.1.0
156
+
157
+ ### šŸš€ Upgrade Instructions
158
+
159
+ **New Projects** (Recommended):
160
+ ```bash
161
+ npx @agentic15.com/agentic15-claude-zen@3.0.0 my-project
162
+ cd my-project
163
+ npx agentic15 auth
164
+ npx agentic15 plan "Your project description"
165
+ ```
166
+
167
+ **Existing Projects** (Requires Manual Migration):
168
+ 1. Update package: `npm install @agentic15.com/agentic15-claude-zen@3.0.0`
169
+ 2. Run auth setup: `npx agentic15 auth`
170
+ 3. Replace all npm run task:* with npx agentic15 commands
171
+ 4. Update any automation scripts
172
+
173
+ ### šŸŽ“ Documentation
174
+
175
+ - README.md: Quick start guide
176
+ - WORKFLOWS.md: Complete workflow documentation with mermaid diagrams
177
+ - CHANGELOG.md: Detailed version history (this file)
178
+ - .claude/POST-INSTALL.md: Instructions for Claude
179
+
180
+ ### āš ļø Known Limitations
181
+
182
+ - GitHub integration requires valid Personal Access Token
183
+ - PR creation requires GitHub CLI (gh) installed
184
+ - Windows users: Use quotes around package name in PowerShell
185
+
186
+ ---
187
+
188
+ ## [2.0.9] - 2025-12-25
189
+
190
+ ### Changed
191
+ - **BREAKING**: Removed obfuscated scripts directory (contained old v1.x minified code)
192
+ - **BREAKING**: Removed npm scripts (plan:generate, plan:init) - no longer needed
193
+ - Refactored PlanCommand.js to have plan generation/locking logic built-in (no external scripts)
194
+ - Package now uses ONLY CLI commands as documented in WORKFLOWS.md
195
+ - Package size: 45.7 kB compressed, 176.5 kB unpacked (52 files)
196
+ - TaskIssueMapper now follows .github/ISSUE_TEMPLATE/task.md structure for consistency
197
+ - CommitCommand now follows .github/PULL_REQUEST_TEMPLATE.md structure for PRs
198
+ - Updated onboarding instructions to show v2.0 CLI commands (removed outdated npm scripts)
199
+
200
+ ### Added
201
+ - GitHub issue and PR templates (.github/ISSUE_TEMPLATE/task.md, PULL_REQUEST_TEMPLATE.md)
202
+ - CLI now uses templates for consistent issue/PR formatting
203
+ - Built-in plan generation logic in PlanCommand class
204
+ - Built-in plan locking logic with task extraction
205
+ - Support for v2.0 schema (singular 'project' at root) in extractTasks()
206
+ - Standardized issue body format with sections: Task Description, Completion Criteria, Dependencies, Phase
207
+ - Standardized PR body format with sections: Task, Description, Changes, Testing, Notes
208
+
209
+ ### Fixed
210
+ - **BUG #1**: Incorrect import path in bin/create-agentic15-claude-zen.js (dist/index.js → src/index.js)
211
+ - **BUG #2**: Wrong template path in TemplateManager.js (needed to go up 2 levels from src/core/)
212
+ - **BUG #3**: Removed obsolete extractBundledFiles() call (tried to copy non-existent scripts)
213
+ - **BUG #4**: extractTasks() now handles v2.0 schema with singular 'project' key
214
+ - **BUG #5**: TaskCommand.js calls correct TaskIssueMapper methods (not non-existent mapTaskToIssue)
215
+
216
+ ### Removed
217
+ - All obfuscated v1.x scripts (19 files, ~248KB of minified code)
218
+ - npm run plan:* commands from templates
219
+ - extractBundledFiles() method call from ProjectInitializer
220
+
221
+ ### Testing
222
+ - Black box testing completed with 5 bugs found and fixed
223
+ - Successfully tested: project creation, auth setup, plan generation, plan locking, task extraction, feature branch creation
224
+ - Test repository: https://github.com/agentic15/agentic15-test-v2
225
+
226
+ ## [2.0.8] - 2025-12-25
227
+
228
+ ### Changed
229
+ - Removed entire dist/ folder (48 minified files)
230
+ - Changed to ship source code only (no minification)
231
+ - Updated package.json main entry from dist/index.js to src/index.js
232
+ - Removed all build/minification scripts
233
+
234
+ ### Fixed
235
+ - Fixed obfuscated/minified code showing wrong v1.x commands
236
+
237
+ ## [2.0.7] - 2025-12-25
238
+
239
+ ### Removed
240
+ - Deleted CLAUDE.md (1,100+ lines of obsolete v1.x documentation)
241
+ - Deleted ONBOARDING.md (86 lines of obsolete v1.x onboarding)
242
+
243
+ ### Changed
244
+ - Updated templates/README.md with v2.0 commands
245
+
246
+ ## [2.0.6] - 2025-12-25
247
+
248
+ ### Changed
249
+ - Added PowerShell syntax to README.md and WORKFLOWS.md
250
+ - PowerShell requires quotes: `npx "@agentic15.com/agentic15-claude-zen" my-project`
251
+
252
+ ## [2.0.5] - 2025-12-25
253
+
254
+ ### Changed
255
+ - Simplified README.md from 307 lines to 68 lines
256
+ - README now just points to WORKFLOWS.md for detailed workflows
257
+
258
+ ## [2.0.4] - 2025-12-25
259
+
260
+ ### Fixed
261
+ - Fixed package README.md with broken documentation links
262
+ - Removed references to deleted docs/ folder
263
+
264
+ ## [2.0.3] - 2025-12-25
265
+
266
+ ### Changed
267
+ - Further simplified README.md to match WORKFLOWS.md style
268
+ - Consolidated all workflow documentation
269
+
270
+ ## [2.0.2] - 2025-12-25
271
+
272
+ ### Changed
273
+ - Simplified README.md to focus on quick start and command reference
274
+ - All detailed workflows now in WORKFLOWS.md
275
+
276
+ ## [2.0.1] - 2025-12-25
277
+
278
+ ### Changed
279
+ - Updated package README with correct v2.0 commands
280
+ - Fixed mermaid diagram syntax errors in WORKFLOWS.md
281
+
282
+ ## [2.0.0] - 2025-12-25
283
+
284
+ ### Added
285
+ - CLI-based architecture (`npx agentic15` commands)
286
+ - Dedicated agentic15 CLI binary for all automation
287
+ - Single WORKFLOWS.md with mermaid diagrams
288
+ - Visual testing feedback loop
289
+ - Auto-generated commit messages
290
+ - Feature branch workflow with PRs
291
+ - GitHub issue/PR integration
292
+
293
+ ### Removed
294
+ - All npm run task:* commands (replaced by CLI)
295
+ - 9 workflow documentation files (3,526 lines)
296
+ - docs/ folder
297
+
298
+ ### Changed
299
+ - Workflow now requires feature branches + PRs (no direct main commits)
300
+ - Simplified documentation to <20 line POST-INSTALL.md + WORKFLOWS.md
301
+ - Commit messages auto-generated as [TASK-XXX] title
9
302
 
10
303
  ## [1.0.1] - 2025-12-24
11
304
 
package/README.md CHANGED
@@ -9,19 +9,32 @@ AI-Assisted Development Framework with Automated Workflows
9
9
 
10
10
  ## Quick Start
11
11
 
12
+ **Step 1: Create Project**
12
13
  ```bash
13
14
  # Bash/Mac/Linux
14
15
  npx @agentic15.com/agentic15-claude-zen my-project
15
16
 
16
17
  # PowerShell (Windows)
17
18
  npx "@agentic15.com/agentic15-claude-zen" my-project
19
+ ```
18
20
 
19
- # Then
21
+ **Step 2: Use CLI Inside Project**
22
+ ```bash
20
23
  cd my-project
21
- npx agentic15 auth
22
- npx agentic15 plan "Build a todo app"
24
+ npx agentic15 auth # One-time GitHub setup
25
+ npx agentic15 plan # Enter interactive mode
26
+ # Type/paste your requirements, press Ctrl+D when done
27
+ npx agentic15 task next # Start first task
28
+ npx agentic15 commit # Test, commit, push, PR
23
29
  ```
24
30
 
31
+ > **Note**: Project creation uses the full package name `@agentic15.com/agentic15-claude-zen`.
32
+ > Once inside your project, use the short command `agentic15` for all workflows.
33
+ >
34
+ > **Tip**: `npx agentic15 plan` without arguments enters interactive mode where you can
35
+ > paste long requirements, URLs, and detailed specs. Press Ctrl+D (Mac/Linux) or
36
+ > Ctrl+Z+Enter (Windows) to save.
37
+
25
38
  **See [WORKFLOWS.md](WORKFLOWS.md) for complete workflows.**
26
39
 
27
40
  ---
@@ -176,7 +176,7 @@ async function main() {
176
176
 
177
177
  // Import and run initialization
178
178
  try {
179
- const { initializeProject } = await import('../dist/index.js');
179
+ const { initializeProject } = await import('../src/index.js');
180
180
  await initializeProject(projectName, targetDir, { initGit, installDeps });
181
181
 
182
182
  console.log('\nāœ… Project created successfully!\n');
package/package.json CHANGED
@@ -1,19 +1,17 @@
1
1
  {
2
2
  "name": "@agentic15.com/agentic15-claude-zen",
3
- "version": "2.0.6",
3
+ "version": "3.0.2",
4
4
  "description": "Structured AI-assisted development framework for Claude Code with enforced quality standards",
5
- "main": "dist/index.js",
5
+ "main": "src/index.js",
6
6
  "bin": {
7
7
  "agentic15-claude-zen": "./bin/create-agentic15-claude-zen.js",
8
8
  "agentic15": "./bin/agentic15.js"
9
9
  },
10
10
  "type": "module",
11
11
  "scripts": {
12
- "build": "node esbuild.config.js",
13
12
  "test": "node test/integration.test.js",
14
13
  "test:e2e": "node test/e2e-verification.test.js",
15
- "test:site": "node test/verify-test-site.js",
16
- "prepublishOnly": "npm run build"
14
+ "test:site": "node test/verify-test-site.js"
17
15
  },
18
16
  "keywords": [
19
17
  "agentic15",
@@ -44,7 +42,6 @@
44
42
  "files": [
45
43
  "bin/",
46
44
  "src/",
47
- "dist/",
48
45
  "templates/",
49
46
  "templates/.gitignore",
50
47
  "README.md",
@@ -178,13 +178,29 @@ export class CommitCommand {
178
178
  taskData = task;
179
179
  }
180
180
 
181
- // Build PR body
182
- let prBody = taskData.description || '';
181
+ // Build PR body following .github/PULL_REQUEST_TEMPLATE.md structure
182
+ let prBody = `## Task\n\n`;
183
183
 
184
184
  if (taskData.githubIssue) {
185
- prBody += `\n\nCloses #${taskData.githubIssue}`;
185
+ prBody += `Closes #${taskData.githubIssue}\n\n`;
186
+ } else {
187
+ prBody += `${task.id}\n\n`;
186
188
  }
187
189
 
190
+ prBody += `## Description\n\n`;
191
+ prBody += `${taskData.description || task.description || commitMessage}\n\n`;
192
+
193
+ prBody += `## Changes\n\n`;
194
+ prBody += `- Implemented ${task.title}\n\n`;
195
+
196
+ prBody += `## Testing\n\n`;
197
+ prBody += `- [x] Unit tests pass (\`npm test\`)\n`;
198
+ prBody += `- [ ] Visual tests pass (if applicable) (\`npx playwright test\`)\n`;
199
+ prBody += `- [ ] Code follows project conventions\n\n`;
200
+
201
+ prBody += `## Notes\n\n`;
202
+ prBody += `Auto-generated by Agentic15 Claude Zen`;
203
+
188
204
  // Create PR using gh CLI
189
205
  const prCommand = `gh pr create --title "${commitMessage}" --body "${prBody}" --base ${mainBranch}`;
190
206
  const prOutput = execSync(prCommand, { encoding: 'utf-8' });
@@ -1,6 +1,6 @@
1
- import { execSync } from 'child_process';
2
1
  import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync } from 'fs';
3
2
  import { join } from 'path';
3
+ import readline from 'readline';
4
4
 
5
5
  export class PlanCommand {
6
6
  static async handle(description) {
@@ -37,43 +37,117 @@ export class PlanCommand {
37
37
 
38
38
  // No plan exists - create new one
39
39
  if (!description) {
40
- console.log('\nāŒ Project description required');
41
- console.log(' Usage: agentic15 plan "Build a calculator app"\n');
42
- process.exit(1);
40
+ // No description provided - enter interactive mode
41
+ console.log('\nšŸ“ Interactive Requirements Mode');
42
+ console.log('━'.repeat(70));
43
+ console.log('Enter your project requirements below.');
44
+ console.log('You can paste multiple lines, URLs, or write detailed specs.');
45
+ console.log('Press Ctrl+D (Mac/Linux) or Ctrl+Z then Enter (Windows) when done.\n');
46
+
47
+ description = await this.promptMultilineInput();
48
+
49
+ if (!description || description.trim().length === 0) {
50
+ console.log('\nāŒ No requirements provided\n');
51
+ process.exit(1);
52
+ }
43
53
  }
44
54
 
45
55
  return this.generatePlan(description);
46
56
  }
47
57
 
58
+ static async promptMultilineInput() {
59
+ return new Promise((resolve) => {
60
+ const rl = readline.createInterface({
61
+ input: process.stdin,
62
+ output: process.stdout,
63
+ terminal: false
64
+ });
65
+
66
+ let lines = [];
67
+
68
+ rl.on('line', (line) => {
69
+ lines.push(line);
70
+ });
71
+
72
+ rl.on('close', () => {
73
+ resolve(lines.join('\n'));
74
+ });
75
+ });
76
+ }
77
+
48
78
  static generatePlan(description) {
49
79
  console.log('\nšŸ“‹ Generating new plan...\n');
50
80
 
51
81
  try {
52
- // Run plan:generate script
53
- execSync(`npm run plan:generate "${description}"`, { stdio: 'inherit' });
82
+ // Create plan ID
83
+ const planId = this.getNextPlanId();
84
+ const planPath = join(process.cwd(), '.claude', 'plans', planId);
54
85
 
55
- // Find the generated plan
56
- const plansDir = join(process.cwd(), '.claude', 'plans');
57
- const plans = readdirSync(plansDir)
58
- .filter(name => name.startsWith('plan-') && name.includes('-generated'));
86
+ // Create plan directory
87
+ mkdirSync(planPath, { recursive: true });
59
88
 
60
- if (plans.length === 0) {
61
- console.log('\nāŒ Failed to generate plan\n');
62
- process.exit(1);
63
- }
89
+ // Create PROJECT-REQUIREMENTS.txt
90
+ const requirementsPath = join(planPath, 'PROJECT-REQUIREMENTS.txt');
91
+ const requirementsContent = `PROJECT REQUIREMENTS
92
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
93
+
94
+ ${description}
64
95
 
65
- // Use the most recent generated plan
66
- const planId = plans[plans.length - 1];
96
+ Generated: ${new Date().toISOString()}
97
+ PLAN ID: ${planId}
98
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
99
+
100
+ INSTRUCTIONS FOR CLAUDE
101
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
102
+
103
+ Please analyze the requirements above and create a comprehensive project plan.
104
+
105
+ 1. Read the PLAN-SCHEMA.json to understand the plan structure
106
+ 2. Read the PROJECT-PLAN-TEMPLATE.json for the format
107
+ 3. Create a PROJECT-PLAN.json file in this directory with:
108
+ - Clear project/subproject/milestone hierarchy
109
+ - Detailed tasks with IDs (TASK-001, TASK-002, etc.)
110
+ - Proper dependencies between tasks
111
+ - Realistic time estimates
112
+ - Phases: design, implementation, testing, deployment
113
+ - Completion criteria for each task
114
+
115
+ 4. Structure the plan to follow these phases:
116
+ - DESIGN: Architecture, UI/UX, database schema
117
+ - IMPLEMENTATION: Core features, API, frontend
118
+ - TESTING: Unit tests, integration tests, E2E tests
119
+ - DEPLOYMENT: Build, CI/CD, documentation
120
+
121
+ 5. Ensure tasks are:
122
+ - Granular (2-8 hours each)
123
+ - Clearly defined with specific deliverables
124
+ - Properly sequenced with dependencies
125
+ - Grouped logically by feature/component
126
+
127
+ 6. After creating the plan, tell the user to run:
128
+ npx agentic15 plan
129
+
130
+ This will lock the plan and generate the task tracker.
131
+
132
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
133
+ GENERATED: ${new Date().toISOString()}
134
+ `;
135
+
136
+ writeFileSync(requirementsPath, requirementsContent);
67
137
 
68
138
  // Set as active plan
69
- const activePlanPath = join(process.cwd(), '.claude', 'ACTIVE-PLAN');
139
+ const claudeDir = join(process.cwd(), '.claude');
140
+ if (!existsSync(claudeDir)) {
141
+ mkdirSync(claudeDir, { recursive: true });
142
+ }
143
+ const activePlanPath = join(claudeDir, 'ACTIVE-PLAN');
70
144
  writeFileSync(activePlanPath, planId);
71
145
 
72
- console.log(`\nāœ… Plan requirements created: ${planId}`);
146
+ console.log(`āœ… Plan requirements created: ${planId}`);
73
147
  console.log(` Location: .claude/plans/${planId}/PROJECT-REQUIREMENTS.txt\n`);
74
148
  console.log('šŸ’” Next steps:');
75
149
  console.log(` 1. Tell Claude: "Create the project plan"`);
76
- console.log(` 2. When Claude is done, run: agentic15 plan\n`);
150
+ console.log(` 2. When Claude is done, run: npx agentic15 plan\n`);
77
151
  } catch (error) {
78
152
  console.log(`\nāŒ Failed to generate plan: ${error.message}\n`);
79
153
  process.exit(1);
@@ -84,20 +158,106 @@ export class PlanCommand {
84
158
  console.log(`šŸ“‹ Locking plan: ${planId}\n`);
85
159
 
86
160
  try {
87
- // Run plan:init script
88
- execSync('npm run plan:init', { stdio: 'inherit' });
161
+ const planPath = join(process.cwd(), '.claude', 'plans', planId);
162
+ const projectPlanPath = join(planPath, 'PROJECT-PLAN.json');
89
163
 
90
- console.log('\nāœ… Plan locked successfully\n');
164
+ // Verify PROJECT-PLAN.json exists
165
+ if (!existsSync(projectPlanPath)) {
166
+ console.log('\nāŒ PROJECT-PLAN.json not found');
167
+ console.log(' Tell Claude to create the plan first\n');
168
+ process.exit(1);
169
+ }
91
170
 
92
- this.showPlanStatus(planId);
171
+ // Read the plan
172
+ const plan = JSON.parse(readFileSync(projectPlanPath, 'utf-8'));
173
+
174
+ // Extract tasks from plan
175
+ const tasks = [];
176
+ this.extractTasks(plan, tasks);
177
+
178
+ // Create task files
179
+ const tasksDir = join(planPath, 'tasks');
180
+ if (!existsSync(tasksDir)) {
181
+ mkdirSync(tasksDir, { recursive: true });
182
+ }
183
+
184
+ // Write individual task files
185
+ tasks.forEach(task => {
186
+ const taskPath = join(tasksDir, `${task.id}.json`);
187
+ writeFileSync(taskPath, JSON.stringify(task, null, 2));
188
+ });
189
+
190
+ // Create task tracker
191
+ const tracker = {
192
+ planId,
193
+ lockedAt: new Date().toISOString(),
194
+ taskFiles: tasks.map(task => ({
195
+ id: task.id,
196
+ title: task.title,
197
+ phase: task.phase || 'implementation',
198
+ status: 'pending',
199
+ description: task.description
200
+ }))
201
+ };
202
+
203
+ const trackerPath = join(planPath, 'TASK-TRACKER.json');
204
+ writeFileSync(trackerPath, JSON.stringify(tracker, null, 2));
93
205
 
94
- console.log('šŸ’” Next step: agentic15 task next\n');
206
+ // Mark as locked
207
+ const lockedPath = join(planPath, '.plan-locked');
208
+ writeFileSync(lockedPath, new Date().toISOString());
209
+
210
+ console.log('āœ… Plan locked successfully\n');
211
+ this.showPlanStatus(planId);
212
+ console.log('šŸ’” Next step: npx agentic15 task next\n');
95
213
  } catch (error) {
96
214
  console.log(`\nāŒ Failed to lock plan: ${error.message}\n`);
97
215
  process.exit(1);
98
216
  }
99
217
  }
100
218
 
219
+ static extractTasks(obj, tasks) {
220
+ // Recursively extract all tasks from the plan structure
221
+ if (obj.tasks && Array.isArray(obj.tasks)) {
222
+ tasks.push(...obj.tasks);
223
+ }
224
+
225
+ // Check nested structures
226
+ if (obj.milestones && Array.isArray(obj.milestones)) {
227
+ obj.milestones.forEach(milestone => this.extractTasks(milestone, tasks));
228
+ }
229
+
230
+ if (obj.subprojects && Array.isArray(obj.subprojects)) {
231
+ obj.subprojects.forEach(subproject => this.extractTasks(subproject, tasks));
232
+ }
233
+
234
+ if (obj.projects && Array.isArray(obj.projects)) {
235
+ obj.projects.forEach(project => this.extractTasks(project, tasks));
236
+ }
237
+
238
+ // Handle singular 'project' at root level (v2.0 schema)
239
+ if (obj.project && typeof obj.project === 'object') {
240
+ this.extractTasks(obj.project, tasks);
241
+ }
242
+ }
243
+
244
+ static getNextPlanId() {
245
+ const plansDir = join(process.cwd(), '.claude', 'plans');
246
+
247
+ if (!existsSync(plansDir)) {
248
+ mkdirSync(plansDir, { recursive: true });
249
+ }
250
+
251
+ const existingPlans = readdirSync(plansDir)
252
+ .filter(name => name.match(/^plan-\d{3}-/i))
253
+ .map(name => parseInt(name.match(/^plan-(\d{3})-/i)[1]))
254
+ .filter(num => !isNaN(num));
255
+
256
+ const nextNum = existingPlans.length > 0 ? Math.max(...existingPlans) + 1 : 1;
257
+
258
+ return `plan-${String(nextNum).padStart(3, '0')}-generated`;
259
+ }
260
+
101
261
  static showPlanStatus(planId) {
102
262
  const trackerPath = join(process.cwd(), '.claude', 'plans', planId, 'TASK-TRACKER.json');
103
263
 
@@ -152,7 +152,9 @@ export class TaskCommand {
152
152
  const taskPath = this.getTaskPath(task.id);
153
153
  const taskData = JSON.parse(readFileSync(taskPath, 'utf-8'));
154
154
 
155
- const { title, body, labels } = TaskIssueMapper.mapTaskToIssue(taskData);
155
+ const title = TaskIssueMapper.taskToIssueTitle(taskData);
156
+ const body = TaskIssueMapper.taskToIssueBody(taskData);
157
+ const labels = TaskIssueMapper.taskStatusToLabels(taskData.status || 'pending', taskData.phase);
156
158
  const issueNumber = await client.createIssue(title, body, labels);
157
159
 
158
160
  if (issueNumber) {