prjct-cli 0.5.1 → 0.7.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 (81) hide show
  1. package/CHANGELOG.md +220 -7
  2. package/CLAUDE.md +476 -55
  3. package/README.md +48 -55
  4. package/bin/prjct +170 -225
  5. package/core/agentic/command-executor.js +113 -0
  6. package/core/agentic/context-builder.js +85 -0
  7. package/core/agentic/prompt-builder.js +86 -0
  8. package/core/agentic/template-loader.js +104 -0
  9. package/core/agentic/tool-registry.js +117 -0
  10. package/core/command-registry.js +597 -0
  11. package/core/commands.js +2046 -2028
  12. package/core/domain/agent-generator.js +118 -0
  13. package/core/domain/analyzer.js +211 -0
  14. package/core/domain/architect-session.js +300 -0
  15. package/core/{agents → infrastructure/agents}/claude-agent.js +16 -13
  16. package/core/{author-detector.js → infrastructure/author-detector.js} +3 -1
  17. package/core/{capability-installer.js → infrastructure/capability-installer.js} +3 -6
  18. package/core/{command-installer.js → infrastructure/command-installer.js} +4 -2
  19. package/core/{config-manager.js → infrastructure/config-manager.js} +4 -4
  20. package/core/{editors-config.js → infrastructure/editors-config.js} +2 -10
  21. package/core/{migrator.js → infrastructure/migrator.js} +34 -19
  22. package/core/{path-manager.js → infrastructure/path-manager.js} +20 -44
  23. package/core/{session-manager.js → infrastructure/session-manager.js} +45 -105
  24. package/core/{update-checker.js → infrastructure/update-checker.js} +67 -67
  25. package/core/{animations-simple.js → utils/animations.js} +3 -23
  26. package/core/utils/date-helper.js +238 -0
  27. package/core/utils/file-helper.js +327 -0
  28. package/core/utils/jsonl-helper.js +206 -0
  29. package/core/{project-capabilities.js → utils/project-capabilities.js} +21 -22
  30. package/core/utils/session-helper.js +277 -0
  31. package/core/{version.js → utils/version.js} +1 -1
  32. package/package.json +5 -12
  33. package/templates/agents/AGENTS.md +151 -99
  34. package/templates/analysis/analyze.md +84 -0
  35. package/templates/commands/analyze.md +37 -233
  36. package/templates/commands/bug.md +79 -0
  37. package/templates/commands/build.md +44 -0
  38. package/templates/commands/cleanup.md +24 -84
  39. package/templates/commands/design.md +20 -95
  40. package/templates/commands/done.md +17 -180
  41. package/templates/commands/feature.md +113 -0
  42. package/templates/commands/fix.md +58 -66
  43. package/templates/commands/git.md +35 -57
  44. package/templates/commands/help.md +18 -52
  45. package/templates/commands/idea.md +18 -34
  46. package/templates/commands/init.md +65 -257
  47. package/templates/commands/next.md +20 -60
  48. package/templates/commands/now.md +21 -23
  49. package/templates/commands/progress.md +40 -73
  50. package/templates/commands/recap.md +52 -75
  51. package/templates/commands/roadmap.md +30 -85
  52. package/templates/commands/ship.md +93 -126
  53. package/templates/commands/status.md +42 -0
  54. package/templates/commands/sync.md +19 -205
  55. package/templates/commands/task.md +19 -79
  56. package/templates/commands/test.md +25 -71
  57. package/templates/commands/workflow.md +20 -210
  58. package/core/agent-generator.js +0 -516
  59. package/core/analyzer.js +0 -600
  60. package/core/animations.js +0 -277
  61. package/core/git-integration.js +0 -401
  62. package/core/workflow-engine.js +0 -213
  63. package/core/workflow-prompts.js +0 -192
  64. package/core/workflow-rules.js +0 -147
  65. package/scripts/post-install.js +0 -121
  66. package/scripts/preuninstall.js +0 -94
  67. package/scripts/verify-installation.sh +0 -158
  68. package/templates/agents/be.template.md +0 -42
  69. package/templates/agents/data.template.md +0 -41
  70. package/templates/agents/devops.template.md +0 -41
  71. package/templates/agents/fe.template.md +0 -42
  72. package/templates/agents/mobile.template.md +0 -41
  73. package/templates/agents/pm.template.md +0 -84
  74. package/templates/agents/qa.template.md +0 -54
  75. package/templates/agents/scribe.template.md +0 -95
  76. package/templates/agents/security.template.md +0 -41
  77. package/templates/agents/ux.template.md +0 -49
  78. package/templates/commands/context.md +0 -105
  79. package/templates/commands/stuck.md +0 -48
  80. package/templates/examples/natural-language-examples.md +0 -532
  81. /package/core/{agent-detector.js → infrastructure/agent-detector.js} +0 -0
@@ -1,532 +0,0 @@
1
- # Natural Language Examples
2
-
3
- Real-world examples showing how **Claude Code** handles natural language with context validation.
4
-
5
- > **Important**: These are examples, not the only valid phrases! Claude understands intent semantically, so users can express themselves in countless ways.
6
-
7
- > **Note**: All examples show how **Claude Code automatically validates context** and provides conversational responses when context is missing.
8
-
9
- ## Example 1: Starting a Task
10
-
11
- **User says (any of these work):**
12
- - "I want to start building the user authentication system"
13
- - "Let me work on the auth flow"
14
- - "Starting the login feature now"
15
- - "Voy a hacer la autenticación de usuarios"
16
-
17
- **Claude Code understands:**
18
- - Intent: User wants to start working on something
19
- - Command: `/p:now`
20
- - Parameter: [extracted task description]
21
-
22
- **Claude Code response:**
23
- ```markdown
24
- 💬 I understood: "start working on building the user authentication system"
25
- ⚡ Executing: /p:now "building the user authentication system"
26
-
27
- 🎯 Working on: building the user authentication system
28
- Started: 2:30 PM
29
-
30
- When you're done:
31
- • Say "I'm done" or "finished"
32
- • Or: /p:done
33
-
34
- Need help? Say "I'm stuck" or use /p:stuck
35
- ```
36
-
37
- ---
38
-
39
- ## Example 2: Completing a Task (WITH Active Task)
40
-
41
- **Context:** User has an active task in `core/now.md`
42
-
43
- **User says (any of these work):**
44
- - "I'm done"
45
- - "finished"
46
- - "terminé"
47
- - "all done with this"
48
- - "completed it"
49
-
50
- **Claude Code checks:**
51
- - Project exists: ✅
52
- - Active task exists: ✅
53
- - Context valid: Execute command
54
-
55
- **Claude Code response:**
56
- ```markdown
57
- 💬 I understood: "task completion"
58
- ⚡ Executing: /p:done
59
-
60
- ✅ Task complete: building the user authentication system (2h 15m)
61
-
62
- What's next?
63
- • "start next task" → Begin working
64
- • "ship this feature" → Track & celebrate
65
- • "add new idea" → Brainstorm
66
-
67
- Or use: /p:now | /p:ship | /p:idea
68
- ```
69
-
70
- ---
71
-
72
- ## Example 2b: Completing a Task (NO Active Task)
73
-
74
- **Context:** User has NO active task (empty `core/now.md`)
75
-
76
- **User says:**
77
- - "I'm done"
78
- - "finished"
79
- - "terminé"
80
-
81
- **Claude Code checks:**
82
- - Project exists: ✅
83
- - Active task exists: ❌
84
- - Context invalid: Return conversational response
85
-
86
- **Claude Code response (NO command execution):**
87
- ```markdown
88
- ✨ You're not working on anything right now!
89
-
90
- Want to start something?
91
- • Tell me what you want to build
92
- • Say "show me what's next"
93
- • Or use: /p:now | /p:next
94
-
95
- Let's ship something!
96
- ```
97
-
98
- **Why this is better:** Instead of showing a technical error like "⏺ No hay tarea activa en este momento...", Claude provides a friendly, actionable response that guides the user forward.
99
-
100
- ---
101
-
102
- ## Example 3: Shipping a Feature
103
-
104
- **User says:**
105
- ```
106
- ship the authentication system
107
- ```
108
-
109
- **Claude Code response:**
110
- ```markdown
111
- 💬 I understood: "ship feature"
112
- ⚡ Executing: /p:ship "authentication system"
113
-
114
- 🚀 authentication system shipped!
115
-
116
- 📈 This week: 3 | Total: 12
117
- Velocity: 1.2 features/day
118
-
119
- Keep the momentum!
120
- • "start next task" → Keep building
121
- • "see my progress" → View stats
122
- • "plan ahead" → Strategic thinking
123
-
124
- Or use: /p:now | /p:recap | /p:roadmap
125
- ```
126
-
127
- ---
128
-
129
- ## Example 3b: Shipping a Feature (NO Work Done Yet)
130
-
131
- **Context:** User has NO active task and NO shipped features
132
-
133
- **User says:**
134
- - "ship this"
135
- - "deploy it"
136
- - "let's launch"
137
-
138
- **Claude Code checks:**
139
- - Project exists: ✅
140
- - Has work to ship (active task OR shipped features): ❌
141
- - Context invalid: Return conversational response
142
-
143
- **Claude Code response (NO command execution):**
144
- ```markdown
145
- 🚀 Nothing to ship yet!
146
-
147
- First, let's build something:
148
- • Tell me what feature you want to create
149
- • Say "start building [feature]"
150
- • Or use: /p:now "feature name"
151
-
152
- Then we'll celebrate when you ship it!
153
- ```
154
-
155
- **Why this is better:** Instead of confusing the user with an error, Claude guides them toward the correct workflow: build first, ship later.
156
-
157
- ---
158
-
159
- ## Example 4: Capturing an Idea
160
-
161
- **User says:**
162
- ```
163
- I have an idea about adding dark mode to the dashboard
164
- ```
165
-
166
- **Claude Code response:**
167
- ```markdown
168
- 💬 I understood: "capture idea"
169
- ⚡ Executing: /p:idea "adding dark mode to the dashboard"
170
-
171
- 💡 Idea captured: adding dark mode to the dashboard
172
-
173
- Ready to start?
174
- • "start this" → Begin now
175
- • "plan more" → Keep brainstorming
176
- • "see ideas" → View backlog
177
-
178
- Or use: /p:now | /p:idea | /p:recap
179
- ```
180
-
181
- ---
182
-
183
- ## Example 5: Viewing Progress
184
-
185
- **User says:**
186
- ```
187
- show me my progress
188
- ```
189
-
190
- **Claude Code response:**
191
- ```markdown
192
- 💬 I understood: "view progress"
193
- ⚡ Executing: /p:recap
194
-
195
- 📊 Recap
196
-
197
- 🎯 Current: building user dashboard
198
- 🚀 Shipped: 3
199
- 📝 Queue: 5
200
- 💡 Ideas: 8
201
-
202
- Recent: authentication system (2h ago)
203
- ```
204
-
205
- ---
206
-
207
- ## Example 6: Getting Help
208
-
209
- **User says:**
210
- ```
211
- I'm stuck on this CORS error with the API
212
- ```
213
-
214
- **Claude Code response:**
215
- ```markdown
216
- 💬 I understood: "need help"
217
- ⚡ Executing: /p:stuck "CORS error with the API"
218
-
219
- 🆘 Let's solve: CORS error with the API
220
-
221
- Common solutions:
222
- 1. Add CORS headers to API responses
223
- 2. Configure proxy in development
224
- 3. Check credentials mode
225
-
226
- Need to break this down?
227
- • "start fixing CORS" → Focus on solution
228
- • "add as task" → Queue for later
229
- ```
230
-
231
- ---
232
-
233
- ## Example 7: Viewing Queue
234
-
235
- **User says:**
236
- ```
237
- what should I work on next?
238
- ```
239
-
240
- **Claude Code response:**
241
- ```markdown
242
- 💬 I understood: "view queue"
243
- ⚡ Executing: /p:next
244
-
245
- 📋 Priority Queue
246
-
247
- 1. Fix login bug (Priority: High)
248
- 2. Add user profile page
249
- 3. Implement password reset
250
- 4. Add email verification
251
- 5. Create admin dashboard
252
-
253
- Ready to start?
254
- • Say "start [task]"
255
- • Or: /p:now "[task]"
256
- ```
257
-
258
- ---
259
-
260
- ## Example 8: Any Language Works
261
-
262
- **User says (Spanish):**
263
- ```
264
- quiero empezar a trabajar en la página de login
265
- ```
266
-
267
- **Claude Code understands:**
268
- - Intent: User wants to start working (expressed in Spanish)
269
- - Command: `/p:now`
270
- - Parameter: "trabajar en la página de login"
271
-
272
- **Claude Code response:**
273
- ```markdown
274
- 💬 I understood: "start working on the login page"
275
- ⚡ Executing: /p:now "trabajar en la página de login"
276
-
277
- 🎯 Working on: trabajar en la página de login
278
- Started: 2:30 PM
279
-
280
- When you're done:
281
- • Say "I'm done" or "terminé"
282
- • Or: /p:done
283
-
284
- Need help? Say "I'm stuck" or use /p:stuck
285
- ```
286
-
287
- > **Note**: The LLM can respond in the user's language or English - both work!
288
-
289
- ---
290
-
291
- ## Example 9: Mixed Commands
292
-
293
- **User says:**
294
- ```
295
- I'm done with the login, now I want to start the API work
296
- ```
297
-
298
- **Claude Code response:**
299
- ```markdown
300
- 💬 I understood: "complete task + start new task"
301
- ⚡ Executing: /p:done → /p:now "API work"
302
-
303
- ✅ Task complete: login page (1h 45m)
304
-
305
- 🎯 Working on: API work
306
- Started: 4:15 PM
307
-
308
- What's next?
309
- • Say "I'm done" when finished
310
- • Or: /p:done
311
- ```
312
-
313
- ---
314
-
315
- ## Example 10: Ambiguous Input
316
-
317
- **User says:**
318
- ```
319
- help
320
- ```
321
-
322
- **Claude Code response:**
323
- ```markdown
324
- 💬 I need clarification:
325
-
326
- Did you mean:
327
- 1. 📖 Interactive guide → Use /p:help
328
- 2. 🆘 I'm stuck on something → Say "I'm stuck on [problem]" or use /p:stuck
329
-
330
- Which one?
331
- ```
332
-
333
- ---
334
-
335
- ## Example 11: p. Trigger (NEW - Zero Memorization)
336
-
337
- **Context:** User doesn't want to memorize `/p:*` commands
338
-
339
- **User says:**
340
- ```
341
- p. analiza todo este documento y dame el roadmap
342
- ```
343
-
344
- **Claude Code detects:**
345
- - Trigger: `p.` detected
346
- - Validates: `.prjct/prjct.config.json` exists ✅
347
- - Intent: "analysis" + "roadmap"
348
- - Command: `/p:analyze`
349
-
350
- **Claude Code response:**
351
- ```markdown
352
- 💬 I understood: "analyze document and create roadmap" (prjct context)
353
- ⚡ Executing: /p:analyze
354
-
355
- [Performs repository analysis]
356
-
357
- 📊 Analysis complete. Creating roadmap...
358
-
359
- [Shows roadmap suggestions]
360
-
361
- Ready to plan?
362
- • Say "p. add to roadmap" or use /p:roadmap
363
- • Or continue working on current task
364
- ```
365
-
366
- ---
367
-
368
- ## Example 12: p. Trigger Multi-Language
369
-
370
- **User says (Spanish):**
371
- ```
372
- p. estoy listo para shipear esta feature
373
- ```
374
-
375
- **Claude Code detects:**
376
- - Trigger: `p.` detected
377
- - Validates: Project exists ✅
378
- - Intent: "ship" (detected from "shipear")
379
- - Command: `/p:ship`
380
-
381
- **Claude Code response:**
382
- ```markdown
383
- 💬 I understood: "ready to ship this feature" (prjct context)
384
- ⚡ Executing: /p:ship
385
-
386
- What feature did you ship?
387
- • Tell me the feature name
388
- • Or use: /p:ship "feature name"
389
- ```
390
-
391
- ---
392
-
393
- ## Example 13: p. Trigger Without Project
394
-
395
- **Context:** User tries p. trigger in non-prjct directory
396
-
397
- **User says:**
398
- ```
399
- p. muéstrame mi progreso
400
- ```
401
-
402
- **Claude Code checks:**
403
- - Trigger: `p.` detected
404
- - Validates: `.prjct/prjct.config.json` NOT found ❌
405
-
406
- **Claude Code response (NO command execution):**
407
- ```markdown
408
- 🎯 No prjct project here!
409
-
410
- This doesn't look like a prjct directory.
411
-
412
- Want to initialize?
413
- • Say "initialize prjct" or "set up project"
414
- • Or use: /p:init
415
-
416
- Then you can track progress with p. commands!
417
- ```
418
-
419
- **Why this is better:** The `p.` trigger is **context-aware** - it only works in prjct directories, preventing accidental execution.
420
-
421
- ---
422
-
423
- ## Example 14: All Three Ways Work
424
-
425
- **Scenario:** User can choose their preferred style
426
-
427
- **Option 1 - p. Trigger (easiest):**
428
- ```
429
- User: "p. terminé"
430
- Claude: Detects completion intent → /p:done
431
- ```
432
-
433
- **Option 2 - Direct slash command:**
434
- ```
435
- User: "/p:done"
436
- Claude: Executes directly
437
- ```
438
-
439
- **Option 3 - Natural language:**
440
- ```
441
- User: "I'm done"
442
- Claude: Detects intent → /p:done
443
- ```
444
-
445
- **All three execute the same command!** Users pick what feels natural to them.
446
-
447
- ---
448
-
449
- ## Implementation Notes
450
-
451
- ### How Claude Code Handles Natural Language
452
-
453
- **Key Principle**: Claude Code (and Claude Desktop) automatically handle intent detection, context validation, and conversational responses through **CLAUDE.md instructions**. No SDK needed!
454
-
455
- **How it works:**
456
-
457
- 1. **CLAUDE.md is automatically read** - Both Claude Code and Desktop read this file for context
458
- 2. **Claude understands intent naturally** - As an LLM, Claude semantically understands what users want
459
- 3. **Simple file checks validate context** - Read `core/now.md`, check if `.prjct/prjct.config.json` exists
460
- 4. **Conversational responses when context missing** - Friendly guidance instead of errors
461
- 5. **Multi-language support** - Works in any language Claude understands
462
-
463
- **Implementation:**
464
-
465
- ```javascript
466
- // NO SDK NEEDED - Just use Claude Code's native capabilities:
467
-
468
- // 1. Detect p. trigger or natural language intent
469
- if (message.startsWith('p. ')) {
470
- // Check if prjct project exists
471
- const configExists = await Read('.prjct/prjct.config.json')
472
- if (!configExists) {
473
- return "🎯 No prjct project here! Run /p:init first."
474
- }
475
- // Extract intent from rest of message
476
- const intent = message.slice(3).trim()
477
- // Continue with semantic understanding...
478
- }
479
-
480
- // 2. Validate context before execution
481
- if (command === 'done') {
482
- const nowContent = await Read('core/now.md')
483
- if (!nowContent || nowContent.trim() === '') {
484
- return conversationalResponse() // Friendly guidance
485
- }
486
- }
487
-
488
- // 3. Execute command with transparency
489
- console.log(`💬 I understood: "${intent}"`)
490
- console.log(`⚡ Executing: /p:${command} ${params}`)
491
- ```
492
-
493
- ### Detection Flow (Natural)
494
- 1. **Check for p. trigger** - Highest priority
495
- - If starts with `p.` → Check if `.prjct/prjct.config.json` exists
496
- - If exists → Extract intent from rest of message
497
- - If not exists → Return "No prjct project" message
498
- 2. **Parse user input** - Direct slash command or natural language?
499
- 3. **Understand intent semantically** - What does the user want to do?
500
- 4. **Validate context** - Simple file reads to check prerequisites
501
- 5. **Respond**:
502
- - Context missing → Provide conversational guidance
503
- - Context valid → Execute command with transparency
504
- - No command intent → Normal conversation
505
- 6. **Show transparency** - Always communicate what you understood
506
- 7. **Execute and guide** - Run command and suggest next steps
507
-
508
- ### Transparency Format
509
- Always show what you understood:
510
- ```
511
- 💬 I understood: "[your interpretation of their intent]"
512
- ⚡ Executing: /p:[command] [params]
513
- ```
514
-
515
- ### Multilingual Support
516
- If you understand the intent in **any language**, execute it:
517
- - **English**: "I want to start the API"
518
- - **Spanish**: "Quiero empezar con la autenticación"
519
- - **Casual**: "gonna work on that bug"
520
- - **Formal**: "I shall commence development"
521
- - **Mixed**: "voy a hacer the dashboard"
522
-
523
- **All work!** Trust your semantic understanding.
524
-
525
- ### Parameter Extraction
526
- Pull the meaningful information from the message:
527
- - **For `/p:now`**: What task are they describing?
528
- - **For `/p:ship`**: What feature are they shipping?
529
- - **For `/p:idea`**: What's their idea?
530
- - **For `/p:stuck`**: What problem are they facing?
531
-
532
- Use context and understanding, not string manipulation!