prjct-cli 0.5.1 → 0.6.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 (45) hide show
  1. package/CHANGELOG.md +153 -1
  2. package/CLAUDE.md +43 -28
  3. package/README.md +1 -1
  4. package/bin/prjct +78 -63
  5. package/core/agent-generator.js +19 -10
  6. package/core/ascii-graphics.js +433 -0
  7. package/core/command-registry.js +553 -0
  8. package/core/commands.js +203 -4
  9. package/core/task-schema.js +342 -0
  10. package/package.json +2 -1
  11. package/templates/agents/AGENTS.md +79 -101
  12. package/templates/agents/be.template.md +14 -29
  13. package/templates/agents/coordinator.template.md +34 -0
  14. package/templates/agents/data.template.md +14 -28
  15. package/templates/agents/devops.template.md +14 -28
  16. package/templates/agents/fe.template.md +14 -29
  17. package/templates/agents/mobile.template.md +14 -28
  18. package/templates/agents/qa.template.md +14 -41
  19. package/templates/agents/scribe.template.md +15 -81
  20. package/templates/agents/security.template.md +14 -28
  21. package/templates/agents/ux.template.md +14 -36
  22. package/templates/commands/analyze.md +36 -239
  23. package/templates/commands/build.md +41 -0
  24. package/templates/commands/cleanup.md +24 -87
  25. package/templates/commands/context.md +24 -93
  26. package/templates/commands/design.md +20 -98
  27. package/templates/commands/done.md +16 -181
  28. package/templates/commands/fix.md +27 -66
  29. package/templates/commands/git.md +33 -60
  30. package/templates/commands/help.md +18 -52
  31. package/templates/commands/idea.md +11 -36
  32. package/templates/commands/init.md +30 -277
  33. package/templates/commands/next.md +20 -62
  34. package/templates/commands/now.md +18 -22
  35. package/templates/commands/progress.md +23 -78
  36. package/templates/commands/recap.md +22 -74
  37. package/templates/commands/roadmap.md +21 -90
  38. package/templates/commands/ship.md +26 -161
  39. package/templates/commands/status.md +40 -0
  40. package/templates/commands/stuck.md +21 -33
  41. package/templates/commands/sync.md +19 -209
  42. package/templates/commands/task.md +18 -80
  43. package/templates/commands/test.md +23 -72
  44. package/templates/commands/workflow.md +20 -212
  45. package/templates/agents/pm.template.md +0 -84
@@ -0,0 +1,553 @@
1
+ /**
2
+ * Command Registry - Single Source of Truth
3
+ *
4
+ * All prjct commands are defined here with metadata.
5
+ * This registry is used by:
6
+ * - bin/prjct (terminal CLI)
7
+ * - website/Commands.tsx (documentation site)
8
+ * - CLAUDE.md (AI assistant instructions)
9
+ * - scripts/validate-commands.js (validation)
10
+ *
11
+ * @version 0.6.0 - Simplified workflow with 9 core commands
12
+ */
13
+
14
+ const COMMANDS = [
15
+ // ===== CORE WORKFLOW COMMANDS (9 essential) =====
16
+
17
+ // 1. Initialize
18
+ {
19
+ name: 'init',
20
+ category: 'core',
21
+ description: 'Deep project analysis and initialization',
22
+ usage: {
23
+ claude: '/p:init',
24
+ terminal: 'prjct init',
25
+ },
26
+ params: null,
27
+ implemented: true,
28
+ hasTemplate: true,
29
+ icon: 'Zap',
30
+ requiresInit: false,
31
+ blockingRules: null,
32
+ features: [
33
+ 'Analyzes codebase structure',
34
+ 'Reviews docs and GitHub',
35
+ 'Generates project summary',
36
+ 'Creates initial roadmap',
37
+ ],
38
+ },
39
+
40
+ // 2. Agentic Idea Evaluation
41
+ {
42
+ name: 'idea',
43
+ category: 'core',
44
+ description: 'AI-powered idea evaluation with risk assessment',
45
+ usage: {
46
+ claude: '/p:idea "add dark mode"',
47
+ terminal: 'prjct idea "add dark mode"',
48
+ },
49
+ params: '<text>',
50
+ implemented: false, // Needs agentic enhancement
51
+ hasTemplate: true,
52
+ icon: 'Lightbulb',
53
+ requiresInit: true,
54
+ blockingRules: null,
55
+ features: [
56
+ 'Risk assessment (low/medium/high)',
57
+ 'Time estimation',
58
+ 'Task breakdown',
59
+ 'Optimal timing recommendation',
60
+ 'ASCII decision tree',
61
+ 'Interactive keep/discard',
62
+ ],
63
+ },
64
+
65
+ // 3. Strategic Roadmap
66
+ {
67
+ name: 'roadmap',
68
+ category: 'core',
69
+ description: 'Strategic planning with ASCII logic maps',
70
+ usage: {
71
+ claude: '/p:roadmap',
72
+ terminal: 'prjct roadmap',
73
+ },
74
+ params: null,
75
+ implemented: false,
76
+ hasTemplate: true,
77
+ icon: 'Map',
78
+ requiresInit: true,
79
+ blockingRules: null,
80
+ features: [
81
+ 'ASCII logic maps (not mermaid)',
82
+ 'Shows approved ideas',
83
+ 'Implementation status',
84
+ 'Dependencies visualization',
85
+ ],
86
+ },
87
+
88
+ // 4. Status Dashboard
89
+ {
90
+ name: 'status',
91
+ category: 'core',
92
+ description: 'KPI dashboard with ASCII graphics',
93
+ usage: {
94
+ claude: '/p:status',
95
+ terminal: 'prjct status',
96
+ },
97
+ params: null,
98
+ implemented: false,
99
+ hasTemplate: true,
100
+ icon: 'BarChart3',
101
+ requiresInit: true,
102
+ blockingRules: null,
103
+ features: [
104
+ 'ASCII progress bars',
105
+ 'Task completion metrics',
106
+ 'Current focus display',
107
+ 'Time tracking',
108
+ 'Visual KPI dashboard',
109
+ ],
110
+ },
111
+
112
+ // 5. Current Task
113
+ {
114
+ name: 'now',
115
+ category: 'core',
116
+ description: 'Show current working task',
117
+ usage: {
118
+ claude: '/p:now',
119
+ terminal: 'prjct now',
120
+ },
121
+ params: null,
122
+ implemented: true,
123
+ hasTemplate: true,
124
+ icon: 'Target',
125
+ requiresInit: true,
126
+ blockingRules: null,
127
+ },
128
+
129
+ // 6. Build (Start Task)
130
+ {
131
+ name: 'build',
132
+ category: 'core',
133
+ description: 'Start task with agent assignment and tracking',
134
+ usage: {
135
+ claude: '/p:build "implement auth"',
136
+ terminal: 'prjct build "implement auth"',
137
+ },
138
+ params: '<task> | [1-5]',
139
+ implemented: false,
140
+ hasTemplate: true,
141
+ icon: 'Play',
142
+ requiresInit: true,
143
+ blockingRules: {
144
+ check: 'now.md must be empty',
145
+ message: 'Complete current task with /p:done first',
146
+ },
147
+ features: [
148
+ 'Agent assignment (auto or manual)',
149
+ 'GitHub dev tracking',
150
+ 'Time estimation by complexity',
151
+ 'Start time tracking',
152
+ 'Moves to now.md with metadata',
153
+ ],
154
+ },
155
+
156
+ // 7. Next Tasks
157
+ {
158
+ name: 'next',
159
+ category: 'core',
160
+ description: 'Show top 5 non-blocking priority tasks',
161
+ usage: {
162
+ claude: '/p:next',
163
+ terminal: 'prjct next',
164
+ },
165
+ params: null,
166
+ implemented: true, // Needs blocking logic
167
+ hasTemplate: true,
168
+ icon: 'List',
169
+ requiresInit: true,
170
+ blockingRules: {
171
+ check: 'filters blocked tasks',
172
+ message: 'Shows warning if now.md is active',
173
+ },
174
+ features: [
175
+ 'Filters out blocked tasks',
176
+ 'Shows top 5 by priority',
177
+ 'Numbered 1-5 for quick selection',
178
+ 'Warns if active task exists',
179
+ ],
180
+ },
181
+
182
+ // 8. Complete Task
183
+ {
184
+ name: 'done',
185
+ category: 'core',
186
+ description: 'Mark current task as complete',
187
+ usage: {
188
+ claude: '/p:done',
189
+ terminal: 'prjct done',
190
+ },
191
+ params: null,
192
+ implemented: true,
193
+ hasTemplate: true,
194
+ icon: 'CheckCircle',
195
+ requiresInit: true,
196
+ blockingRules: {
197
+ check: 'now.md must have content',
198
+ message: 'No active task to complete',
199
+ },
200
+ },
201
+
202
+ // 9. Ship Feature
203
+ {
204
+ name: 'ship',
205
+ category: 'core',
206
+ description: 'Commit, push, and celebrate shipped feature',
207
+ usage: {
208
+ claude: '/p:ship "user authentication"',
209
+ terminal: 'prjct ship "user authentication"',
210
+ },
211
+ params: '<feature>',
212
+ implemented: false, // Needs Git integration
213
+ hasTemplate: true,
214
+ icon: 'Rocket',
215
+ requiresInit: true,
216
+ blockingRules: null,
217
+ features: [
218
+ 'Auto-generates commit message',
219
+ 'Adds "Generated-by: prjct/cli" footer',
220
+ 'Interactive push confirmation',
221
+ 'Moves to shipped.md',
222
+ 'Completion metadata tracking',
223
+ ],
224
+ },
225
+
226
+ // ===== OPTIONAL COMMANDS (Advanced features) =====
227
+ {
228
+ name: 'workflow',
229
+ category: 'optional',
230
+ description: 'Cascading agentic workflow for complex tasks',
231
+ usage: {
232
+ claude: '/p:workflow',
233
+ terminal: 'prjct workflow',
234
+ },
235
+ params: null,
236
+ implemented: true,
237
+ hasTemplate: true,
238
+ icon: 'GitBranch',
239
+ requiresInit: true,
240
+ blockingRules: null,
241
+ isOptional: true,
242
+ },
243
+ {
244
+ name: 'design',
245
+ category: 'optional',
246
+ description: 'Design system architecture, APIs, and components',
247
+ usage: {
248
+ claude: '/p:design authentication --type architecture',
249
+ terminal: 'prjct design authentication --type architecture',
250
+ },
251
+ params: '[target] --type architecture|api|component|database|flow',
252
+ implemented: true,
253
+ hasTemplate: true,
254
+ icon: 'Palette',
255
+ requiresInit: true,
256
+ blockingRules: null,
257
+ isOptional: true,
258
+ },
259
+ {
260
+ name: 'cleanup',
261
+ category: 'optional',
262
+ description: 'Clean up temp files and old entries',
263
+ usage: {
264
+ claude: '/p:cleanup',
265
+ terminal: 'prjct cleanup',
266
+ },
267
+ params: null,
268
+ implemented: true,
269
+ hasTemplate: true,
270
+ icon: 'Zap',
271
+ requiresInit: true,
272
+ blockingRules: null,
273
+ isOptional: true,
274
+ },
275
+ {
276
+ name: 'stuck',
277
+ category: 'optional',
278
+ description: 'Get contextual help with problems',
279
+ usage: {
280
+ claude: '/p:stuck "CORS error in API calls"',
281
+ terminal: 'prjct stuck "CORS error in API calls"',
282
+ },
283
+ params: '<issue description>',
284
+ implemented: true,
285
+ hasTemplate: true,
286
+ icon: 'HelpCircle',
287
+ requiresInit: true,
288
+ blockingRules: null,
289
+ isOptional: true,
290
+ },
291
+ {
292
+ name: 'analyze',
293
+ category: 'optional',
294
+ description: 'Analyze repository and sync tasks',
295
+ usage: {
296
+ claude: '/p:analyze',
297
+ terminal: 'prjct analyze',
298
+ },
299
+ params: null,
300
+ implemented: true,
301
+ hasTemplate: true,
302
+ icon: 'Search',
303
+ requiresInit: true,
304
+ blockingRules: null,
305
+ isOptional: true,
306
+ },
307
+ {
308
+ name: 'sync',
309
+ category: 'optional',
310
+ description: 'Sync project state and update workflow agents',
311
+ usage: {
312
+ claude: '/p:sync',
313
+ terminal: 'prjct sync',
314
+ },
315
+ params: null,
316
+ implemented: true,
317
+ hasTemplate: true,
318
+ icon: 'RefreshCw',
319
+ requiresInit: true,
320
+ blockingRules: null,
321
+ isOptional: true,
322
+ },
323
+
324
+ // ===== SETUP COMMANDS (Not part of daily workflow) =====
325
+ {
326
+ name: 'start',
327
+ category: 'setup',
328
+ description: 'First-time setup (install commands to editors)',
329
+ usage: {
330
+ claude: null,
331
+ terminal: 'prjct start',
332
+ },
333
+ params: null,
334
+ implemented: true,
335
+ hasTemplate: false,
336
+ icon: 'Terminal',
337
+ requiresInit: false,
338
+ blockingRules: null,
339
+ },
340
+ {
341
+ name: 'setup',
342
+ category: 'setup',
343
+ description: 'Reconfigure editor installations',
344
+ usage: {
345
+ claude: null,
346
+ terminal: 'prjct setup [--force] [--editor <name>]',
347
+ },
348
+ params: '[--force] [--editor <name>]',
349
+ implemented: true,
350
+ hasTemplate: false,
351
+ icon: 'Settings',
352
+ requiresInit: false,
353
+ blockingRules: null,
354
+ },
355
+ {
356
+ name: 'migrate-all',
357
+ category: 'setup',
358
+ description: 'Migrate all legacy projects',
359
+ usage: {
360
+ claude: null,
361
+ terminal: 'prjct migrate-all [--deep-scan] [--remove-legacy] [--dry-run]',
362
+ },
363
+ params: '[--deep-scan] [--remove-legacy] [--dry-run]',
364
+ implemented: true,
365
+ hasTemplate: false,
366
+ icon: 'Database',
367
+ requiresInit: false,
368
+ blockingRules: null,
369
+ },
370
+ ]
371
+
372
+ /**
373
+ * Category metadata
374
+ */
375
+ const CATEGORIES = {
376
+ core: {
377
+ title: 'Core Workflow',
378
+ icon: 'Zap',
379
+ description: '9 essential commands for daily development workflow',
380
+ order: 1,
381
+ },
382
+ optional: {
383
+ title: 'Optional Commands',
384
+ icon: 'Package',
385
+ description: 'Advanced features for specialized workflows',
386
+ order: 2,
387
+ },
388
+ setup: {
389
+ title: 'Setup',
390
+ icon: 'Terminal',
391
+ description: 'Installation and configuration (not for daily use)',
392
+ order: 3,
393
+ },
394
+ }
395
+
396
+ /**
397
+ * Helper functions
398
+ */
399
+ const registry = {
400
+ /**
401
+ * Get all commands
402
+ */
403
+ getAll: () => COMMANDS,
404
+
405
+ /**
406
+ * Get command by name
407
+ */
408
+ getByName: (name) => COMMANDS.find((c) => c.name === name),
409
+
410
+ /**
411
+ * Get commands by category
412
+ */
413
+ getByCategory: (category) => COMMANDS.filter((c) => c.category === category),
414
+
415
+ /**
416
+ * Get all implemented commands
417
+ */
418
+ getAllImplemented: () => COMMANDS.filter((c) => c.implemented),
419
+
420
+ /**
421
+ * Get all commands with templates
422
+ */
423
+ getAllWithTemplates: () => COMMANDS.filter((c) => c.hasTemplate),
424
+
425
+ /**
426
+ * Get commands available in Claude Code
427
+ */
428
+ getClaudeCommands: () => COMMANDS.filter((c) => c.usage.claude !== null),
429
+
430
+ /**
431
+ * Get commands available in terminal
432
+ */
433
+ getTerminalCommands: () => COMMANDS.filter((c) => c.usage.terminal !== null),
434
+
435
+ /**
436
+ * Get all categories
437
+ */
438
+ getCategories: () => CATEGORIES,
439
+
440
+ /**
441
+ * Get category metadata
442
+ */
443
+ getCategory: (category) => CATEGORIES[category],
444
+
445
+ /**
446
+ * Validate command registry
447
+ */
448
+ validate: () => {
449
+ const issues = []
450
+
451
+ // Check for duplicate names
452
+ const names = COMMANDS.map((c) => c.name)
453
+ const duplicates = names.filter((name, index) => names.indexOf(name) !== index)
454
+ if (duplicates.length > 0) {
455
+ issues.push(`Duplicate command names: ${duplicates.join(', ')}`)
456
+ }
457
+
458
+ // Check for commands with templates but not implemented
459
+ const notImplemented = COMMANDS.filter((c) => c.hasTemplate && !c.implemented)
460
+ if (notImplemented.length > 0) {
461
+ issues.push(
462
+ `Commands with templates but not implemented: ${notImplemented.map((c) => c.name).join(', ')}`,
463
+ )
464
+ }
465
+
466
+ // Check for invalid categories
467
+ const validCategories = Object.keys(CATEGORIES)
468
+ const invalidCategories = COMMANDS.filter((c) => !validCategories.includes(c.category))
469
+ if (invalidCategories.length > 0) {
470
+ issues.push(
471
+ `Invalid categories: ${invalidCategories.map((c) => `${c.name}:${c.category}`).join(', ')}`,
472
+ )
473
+ }
474
+
475
+ return {
476
+ valid: issues.length === 0,
477
+ issues,
478
+ }
479
+ },
480
+
481
+ /**
482
+ * Get core commands only (9 essential)
483
+ */
484
+ getCoreCommands: () => COMMANDS.filter((c) => c.category === 'core'),
485
+
486
+ /**
487
+ * Get optional commands
488
+ */
489
+ getOptionalCommands: () => COMMANDS.filter((c) => c.category === 'optional'),
490
+
491
+ /**
492
+ * Get commands that require initialization
493
+ */
494
+ getRequiresInit: () => COMMANDS.filter((c) => c.requiresInit),
495
+
496
+ /**
497
+ * Get commands with blocking rules
498
+ */
499
+ getWithBlockingRules: () => COMMANDS.filter((c) => c.blockingRules !== null),
500
+
501
+ /**
502
+ * Check if command can execute based on blocking rules
503
+ */
504
+ canExecute: (commandName, context = {}) => {
505
+ const command = COMMANDS.find((c) => c.name === commandName)
506
+ if (!command) return { allowed: false, message: 'Command not found' }
507
+ if (!command.blockingRules) return { allowed: true }
508
+
509
+ // Example context checks - should be implemented per command
510
+ const { hasActiveTask, hasContent } = context
511
+
512
+ if (commandName === 'build' && hasActiveTask) {
513
+ return { allowed: false, message: command.blockingRules.message }
514
+ }
515
+ if (commandName === 'done' && !hasContent) {
516
+ return { allowed: false, message: command.blockingRules.message }
517
+ }
518
+ if (commandName === 'next' && hasActiveTask) {
519
+ return {
520
+ allowed: true,
521
+ warning: 'You have an active task. Complete it with /p:done first.',
522
+ }
523
+ }
524
+
525
+ return { allowed: true }
526
+ },
527
+
528
+ /**
529
+ * Get statistics
530
+ */
531
+ getStats: () => ({
532
+ total: COMMANDS.length,
533
+ core: COMMANDS.filter((c) => c.category === 'core').length,
534
+ optional: COMMANDS.filter((c) => c.category === 'optional').length,
535
+ setup: COMMANDS.filter((c) => c.category === 'setup').length,
536
+ implemented: COMMANDS.filter((c) => c.implemented).length,
537
+ withTemplates: COMMANDS.filter((c) => c.hasTemplate).length,
538
+ claudeOnly: COMMANDS.filter((c) => c.usage.claude && !c.usage.terminal).length,
539
+ terminalOnly: COMMANDS.filter((c) => !c.usage.claude && c.usage.terminal).length,
540
+ both: COMMANDS.filter((c) => c.usage.claude && c.usage.terminal).length,
541
+ requiresInit: COMMANDS.filter((c) => c.requiresInit).length,
542
+ withBlockingRules: COMMANDS.filter((c) => c.blockingRules !== null).length,
543
+ byCategory: Object.keys(CATEGORIES).reduce(
544
+ (acc, cat) => ({
545
+ ...acc,
546
+ [cat]: COMMANDS.filter((c) => c.category === cat).length,
547
+ }),
548
+ {},
549
+ ),
550
+ }),
551
+ }
552
+
553
+ module.exports = registry