prjct-cli 0.8.6 → 0.9.1

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 (47) hide show
  1. package/CHANGELOG.md +216 -0
  2. package/CLAUDE.md +34 -0
  3. package/core/agentic/agent-router.js +482 -0
  4. package/core/agentic/command-executor.js +70 -15
  5. package/core/agentic/context-builder.js +4 -3
  6. package/core/agentic/context-filter.js +545 -0
  7. package/core/agentic/prompt-builder.js +48 -38
  8. package/core/agentic/tool-registry.js +35 -0
  9. package/core/command-registry.js +104 -164
  10. package/core/commands.js +84 -0
  11. package/core/domain/agent-generator.js +55 -44
  12. package/core/domain/architecture-generator.js +561 -0
  13. package/core/domain/task-stack.js +496 -0
  14. package/core/infrastructure/legacy-installer-detector.js +546 -0
  15. package/core/infrastructure/session-manager.js +14 -2
  16. package/core/infrastructure/setup.js +29 -11
  17. package/core/utils/jsonl-helper.js +137 -0
  18. package/package.json +1 -1
  19. package/scripts/install.sh +45 -8
  20. package/scripts/postinstall.js +5 -5
  21. package/templates/agents/AGENTS.md +3 -3
  22. package/templates/commands/analyze.md +10 -53
  23. package/templates/commands/ask.md +25 -338
  24. package/templates/commands/bug.md +11 -70
  25. package/templates/commands/build.md +8 -35
  26. package/templates/commands/cleanup.md +9 -32
  27. package/templates/commands/dash.md +241 -0
  28. package/templates/commands/design.md +5 -28
  29. package/templates/commands/done.md +6 -20
  30. package/templates/commands/feature.md +12 -225
  31. package/templates/commands/help.md +26 -313
  32. package/templates/commands/idea.md +7 -25
  33. package/templates/commands/init.md +15 -191
  34. package/templates/commands/migrate-all.md +25 -84
  35. package/templates/commands/next.md +6 -26
  36. package/templates/commands/now.md +6 -25
  37. package/templates/commands/pause.md +18 -0
  38. package/templates/commands/progress.md +5 -50
  39. package/templates/commands/recap.md +5 -54
  40. package/templates/commands/resume.md +97 -0
  41. package/templates/commands/ship.md +14 -135
  42. package/templates/commands/status.md +7 -32
  43. package/templates/commands/suggest.md +36 -495
  44. package/templates/commands/sync.md +7 -24
  45. package/templates/commands/work.md +44 -0
  46. package/templates/commands/workflow.md +3 -25
  47. package/templates/planning-methodology.md +195 -0
@@ -7,380 +7,67 @@ description: 'Conversational intent to action translator - helps users understan
7
7
 
8
8
  ## Purpose
9
9
 
10
- Translate natural language intent into actionable prjct command flows. Helps users who know WHAT they want but don't know HOW to do it with prjct.
11
-
12
- ## Usage
13
-
14
- ```
15
- /p:ask "<what you want to do>"
16
- ```
10
+ Translate natural language intent into actionable prjct command flows. Helps users who know WHAT they want but don't know HOW.
17
11
 
18
12
  ## Flow
19
13
 
20
14
  1. **Understand intent**: Parse user's natural language description
21
- 2. **Analyze context**: Read project state (core/now.md, core/next.md, planning/roadmap.md)
15
+ 2. **Analyze context**: Read project state (`core/now.md`, `core/next.md`, `planning/roadmap.md`)
22
16
  3. **Recommend flow**: Suggest specific command sequence with explanations
23
- 4. **Offer templates**: If applicable, show examples from similar use cases
24
- 5. **Ask confirmation**: Interactive - don't execute automatically
17
+ 4. **Ask confirmation**: Interactive - don't execute automatically
25
18
 
26
19
  ## Intent Categories
27
20
 
28
- Claude analyzes and maps to one of these patterns:
29
-
30
- ### 1. Feature Development
31
- Keywords: "add", "implement", "create", "build", "agregar", "implementar", "crear"
21
+ **1. Feature Development**: "add", "implement", "create", "build"
22
+ → `/p:feature "{desc}"` → `/p:done` (iterate) → `/p:ship "{name}"`
32
23
 
33
- **Recommended flow:**
34
- ```
35
- 1. /p:feature "{description}"
36
- → Value analysis (impact/effort/timing)
37
- → Task breakdown
38
- → Auto-start first task
39
-
40
- 2. /p:done (after each task)
41
-
42
- 3. /p:ship "{feature name}" (when complete)
43
- ```
24
+ **2. Performance/Optimization**: "optimize", "improve", "faster", "memory leak"
25
+ → `/p:feature "optimize {area}"` → `/p:build 1` → `/p:done` → `/p:ship "optimization"`
44
26
 
45
- ### 2. Performance/Optimization
46
- Keywords: "optimize", "improve", "faster", "performance", "memory leak", "optimizar", "mejorar"
27
+ **3. Bug Fixing**: "bug", "error", "fix", "broken", "not working"
28
+ → `/p:bug "{desc}"` `/p:build "{bug task}"` `/p:done` → `/p:ship "bug fixes"`
47
29
 
48
- **Recommended flow:**
49
- ```
50
- 1. /p:feature "optimize {area}"
51
- → Break down into measurable tasks:
52
- • Profile and identify bottlenecks
53
- • Implement specific optimizations
54
- • Measure improvements
55
- • Document findings
56
-
57
- 2. /p:build 1 (start with profiling)
58
-
59
- 3. /p:done (iterate through tasks)
60
-
61
- 4. /p:ship "performance optimization"
62
- ```
63
-
64
- ### 3. Bug Fixing
65
- Keywords: "bug", "error", "fix", "broken", "not working", "arreglar", "error"
66
-
67
- **Recommended flow:**
68
- ```
69
- 1. /p:bug "{description}"
70
- → Auto-prioritized based on severity
71
- → Added to queue
30
+ **4. Design/Architecture**: "design", "architecture", "structure", "plan"
31
+ → `/p:design {target} --type {architecture|api|component|database|flow}` → `/p:feature "implement {design}"` → `/p:build 1`
72
32
 
73
- 2. /p:build "{bug task}" (if high priority)
74
-
75
- 3. /p:done (when fixed)
76
-
77
- 4. /p:ship "bug fixes" (if part of larger batch)
78
- ```
79
-
80
- ### 4. Design/Architecture
81
- Keywords: "design", "architecture", "structure", "plan", "diseñar", "arquitectura"
82
-
83
- **Recommended flow:**
84
- ```
85
- 1. /p:design {target} --type {architecture|api|component|database|flow}
86
- → Create design document
87
- → Plan implementation
88
-
89
- 2. /p:feature "implement {design}"
90
- → Convert design to tasks
91
-
92
- 3. /p:build 1 (start implementation)
93
- ```
94
-
95
- ### 5. Lost/Confused
96
- Keywords: "don't know", "help", "stuck", "what should", "no sé", "ayuda"
97
-
98
- **Recommended flow:**
99
- ```
100
- 1. /p:suggest
101
- → Context-aware recommendations
102
- → Shows current state
103
- → Suggests next best action
104
-
105
- OR
106
-
107
- 2. /p:help
108
- → Interactive guide
109
- → Shows available commands
110
- → Examples
111
- ```
33
+ **5. Lost/Confused**: "don't know", "help", "stuck", "what should"
34
+ → `/p:suggest` (context-aware recommendations) OR `/p:help` (interactive guide)
112
35
 
113
36
  ## Response Format
114
37
 
115
38
  ```
116
39
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
117
- 🎯 Entiendo: {interpreted_intent}
40
+ 🎯 I understand: {interpreted_intent}
118
41
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
119
42
 
120
- 📊 TU CONTEXTO:
121
- Estado actual: {current_state}
122
- Tareas activas: {active_tasks}
123
- Último ship: {time_ago}
43
+ 📊 YOUR CONTEXT:
44
+ Current state: {current_state}
45
+ Active tasks: {active_tasks}
46
+ Last ship: {time_ago}
124
47
 
125
48
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
126
49
 
127
- 💡 RECOMENDACIÓN DE FLUJO:
50
+ 💡 RECOMMENDED FLOW:
128
51
 
129
52
  {step_by_step_command_flow}
130
53
 
131
- Cada paso explicado:
54
+ Each step explained:
132
55
  → {command_1}: {why_this_command}
133
56
  → {command_2}: {what_it_does}
134
57
  → {command_3}: {expected_outcome}
135
58
 
136
59
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
137
60
 
138
- EJEMPLOS SIMILARES:
139
-
140
- "{similar_example_1}"
141
- "{similar_example_2}"
142
-
143
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
144
-
145
- ¿Quieres que ejecute el paso 1?
146
- [Sí] [No, solo dame las tareas] [Necesito más ayuda]
147
- ```
148
-
149
- ## Examples
150
-
151
- ### Example 1: Performance Optimization
152
-
153
- **Input:**
154
- ```
155
- /p:ask "quiero mejorar el performance y evitar memory leaks"
156
- ```
157
-
158
- **Output:**
159
- ```
160
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
161
- 🎯 Entiendo: optimización de performance + solución de memory leaks
162
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
163
-
164
- 📊 TU CONTEXTO:
165
- • Estado actual: sin tarea activa
166
- • Tareas en cola: 3
167
- • Último ship: hace 2 días
168
-
169
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
170
-
171
- 💡 RECOMENDACIÓN DE FLUJO:
172
-
173
- 1. /p:feature "optimizar performance y memory leaks"
174
-
175
- Claude analizará y creará tareas como:
176
- • Setup profiler (Chrome DevTools/React DevTools)
177
- • Identificar memory leaks con heap snapshots
178
- • Optimizar re-renders innecesarios
179
- • Implementar memoization (useMemo, useCallback)
180
- • Code splitting para reducir bundle size
181
- • Medir mejoras y documentar
182
-
183
- 2. /p:build 1
184
- → Empezar con el profiling (necesitas datos primero)
185
-
186
- 3. /p:done
187
- → Después de cada tarea completada
188
-
189
- 4. /p:ship "performance optimization"
190
- → Cuando hayas terminado todas las mejoras
191
-
192
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
193
-
194
- ✨ POR QUÉ ESTE FLUJO:
195
-
196
- → /p:feature: Analiza el valor (impacto alto, esfuerzo medio)
197
- Recomienda timing (hacer ahora antes de más features)
198
- Breakdown inteligente (primero medir, luego optimizar)
199
-
200
- → /p:build: Asigna agente apropiado (probablemente FE)
201
- Tracking de tiempo
202
- Focus en una tarea a la vez
203
-
204
- → /p:done: Registra progreso
205
- Mantiene momentum
206
- Mueve a siguiente tarea
207
-
208
- → /p:ship: Commit + push + celebración
209
- Actualiza docs
210
- Registra el logro
211
-
212
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
213
-
214
- ¿Empezamos con /p:feature para analizar el valor y crear las tareas?
215
- ```
216
-
217
- ### Example 2: New Feature
218
-
219
- **Input:**
220
- ```
221
- /p:ask "I want to add user authentication"
61
+ Would you like me to execute step 1?
222
62
  ```
223
63
 
224
- **Output:**
225
- ```
226
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
227
- 🎯 I understand: implement user authentication system
228
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
229
-
230
- 📊 YOUR CONTEXT:
231
- • Current state: working on "navbar redesign"
232
- • Queue: 2 tasks
233
- • Last ship: 1 day ago
234
-
235
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
236
-
237
- ⚠️ IMPORTANTE: Tienes tarea activa
238
-
239
- Opciones:
240
-
241
- A) TERMINAR PRIMERO (Recomendado)
242
- 1. /p:done → Terminar "navbar redesign"
243
- 2. /p:feature "user authentication"
244
- 3. /p:build 1 → Empezar auth
245
-
246
- B) GUARDAR PARA DESPUÉS
247
- 1. /p:feature "user authentication"
248
- → Se agrega a la cola
249
- 2. Continúa con navbar
250
- 3. /p:done cuando termines navbar
251
- 4. /p:build "authentication" cuando estés listo
252
-
253
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
254
-
255
- 💡 RECOMENDACIÓN:
256
-
257
- Termina navbar primero (mantiene focus)
258
- Luego /p:feature "authentication" hará:
259
-
260
- • Análisis de valor (impacto: HIGH)
261
- • Stack analysis (sugiere: Clerk, Auth0, o custom JWT)
262
- • Task breakdown:
263
- - Setup auth provider
264
- - Implement login/signup UI
265
- - Protected routes
266
- - Session management
267
- - Testing
268
-
269
- • Auto-start primera tarea
270
-
271
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
272
-
273
- ¿Qué prefieres: A) Terminar navbar primero, o B) Agregar a cola?
274
- ```
275
-
276
- ### Example 3: Lost/Confused
277
-
278
- **Input:**
279
- ```
280
- /p:ask "no sé qué hacer ahora"
281
- ```
282
-
283
- **Output:**
284
- ```
285
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
286
- 🎯 Entiendo: necesitas orientación sobre qué hacer
287
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
288
-
289
- 📊 TU CONTEXTO:
290
- • Estado actual: sin tarea activa ✅
291
- • Tareas en cola: 5 tareas esperando
292
- • Último ship: hace 4 días ⚠️
293
-
294
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
295
-
296
- 💡 TE RECOMIENDO:
297
-
298
- 1. VER TU COLA DE TAREAS
299
- /p:next
300
- → Muestra las 5 tareas top priority
301
- → Ya están priorizadas y listas para trabajar
302
-
303
- 2. EMPEZAR LA TAREA #1
304
- /p:build 1
305
- → Empieza automáticamente la tarea top priority
306
- → Asigna agente apropiado
307
- → Tracking de tiempo
308
-
309
- 3. VER SUGERENCIAS INTELIGENTES
310
- /p:suggest
311
- → Analiza tu contexto completo
312
- → Recomienda basado en:
313
- - Tiempo sin ship (4 días)
314
- - Velocidad reciente
315
- - Urgencias
316
-
317
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
318
-
319
- 🎯 MI SUGERENCIA ESPECÍFICA:
320
-
321
- Han pasado 4 días sin ship → Es momento de completar algo
322
-
323
- Opción A: Trabaja en tareas de cola
324
- /p:next → /p:build 1 → /p:done → /p:ship
325
-
326
- Opción B: Crea algo nuevo rápido
327
- /p:feature "quick win" → /p:build 1 → ship today
328
-
329
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
330
-
331
- ¿Qué prefieres?
332
- 1. Ver qué hay en cola (/p:next)
333
- 2. Sugerencias personalizadas (/p:suggest)
334
- 3. Contarme qué tienes en mente
335
- ```
336
-
337
- ## Key Principles
338
-
339
- 1. **Conversational**: Natural language, not technical
340
- 2. **Educational**: Explain WHY each command
341
- 3. **Contextual**: Always check project state first
342
- 4. **Interactive**: Ask confirmation, offer choices
343
- 5. **No auto-execution**: Show the path, let user decide
344
- 6. **Bilingual**: Support English and Spanish naturally
345
- 7. **Examples**: Show similar use cases when relevant
346
-
347
64
  ## Validation
348
65
 
349
- - **Optional**: Can run without project initialized
350
- - **If not initialized**: Suggest `/p:init` first
66
+ - **Optional**: Can run without project initialized (suggests `/p:init` if needed)
351
67
  - **Read-only**: Never modifies files, only recommends
352
68
 
353
69
  ## Edge Cases
354
70
 
355
- ### No prjct project
356
- ```
357
- ⚠️ No prjct project here
358
-
359
- First, initialize:
360
- /p:init # For existing project
361
- /p:init "your idea" # For new project
362
-
363
- Then I can help you!
364
- ```
365
-
366
- ### Very vague request
367
- ```
368
- 🤔 Puedes darme más detalles?
369
-
370
- Qué quieres hacer:
371
- • Agregar nueva funcionalidad?
372
- • Arreglar algo que no funciona?
373
- • Mejorar el código existente?
374
- • No estás seguro?
375
-
376
- Cuéntame más y te ayudo a encontrar el comando correcto!
377
- ```
378
-
379
- ## Success Criteria
380
-
381
- After using `/p:ask`, user should:
382
- - ✅ Understand WHAT commands to use
383
- - ✅ Understand WHY those commands
384
- - ✅ Understand the SEQUENCE of actions
385
- - ✅ Feel confident to proceed
386
- - ✅ Learn the system while using it
71
+ **No prjct project**: Suggest `/p:init` or `/p:init "idea"` first
72
+ **Vague request**: Ask for more details - feature? bug? optimization? not sure?
73
+ **Active task exists**: Offer options - finish first (recommended) or add to queue
@@ -1,79 +1,20 @@
1
1
  ---
2
2
  allowed-tools: [Read, Write]
3
- description: 'Report and track bugs with auto-prioritization'
3
+ description: 'Report bug with auto-priority'
4
4
  ---
5
5
 
6
6
  # /p:bug
7
7
 
8
- ## Usage
9
-
10
- ```
11
- /p:bug "<description>"
12
- ```
13
-
14
- ## What It Does
15
-
16
- 1. **Severity detection**: Analyzes bug description for severity indicators
17
- 2. **Priority placement**: Adds to `core/next.md` based on severity
18
- 3. **Memory tracking**: Logs bug report to `memory/context.jsonl`
19
- 4. **Quick resolution**: Suggests immediate actions
20
-
21
- ## Severity Detection
22
-
23
- Auto-detects severity from keywords:
24
-
25
- - **Critical**: crash, down, broken, not working, production, urgent
26
- - **High**: error, fail, issue, problem, major
27
- - **Medium**: bug, incorrect, wrong, should
28
- - **Low**: minor, small, cosmetic, typo
8
+ ## Severity Keywords
9
+ - **Critical**: crash, down, broken, production
10
+ - **High**: error, fail, issue
11
+ - **Medium**: bug, incorrect
12
+ - **Low**: minor, typo
29
13
 
30
14
  ## Flow
15
+ 1. Detect severity → Format: `🐛 [LEVEL] {desc}`
16
+ 2. Insert: top if critical/high, bottom if med/low
17
+ 3. Update `core/next.md` + log
31
18
 
32
- 1. Detect severity from description
33
- 2. Read `core/next.md`
34
- 3. Format bug entry: `🐛 [SEVERITY] description`
35
- 4. Insert at top if critical/high, bottom if medium/low
36
- 5. Write to `core/next.md`
37
- 6. Log to `memory/context.jsonl`
38
-
39
- ## Response Format
40
-
41
- ```
42
- 🐛 Bug reported: {severity}
43
-
44
- {description}
45
-
46
- Priority: {critical/high/medium/low}
47
- Added to: core/next.md (position {top/bottom})
48
-
49
- Quick actions:
50
- • "start fixing" → /p:now "{description}"
51
- • "show queue" → /p:next
52
-
53
- /p:now | /p:next
54
- ```
55
-
56
- ## Example
57
-
58
- ```
59
- User: p. bug "login button crashes on mobile"
60
-
61
- Claude detects:
62
- - Keywords: "crashes" → CRITICAL severity
63
- - Action: Add to top of next.md
64
- - Format: 🐛 [CRITICAL] login button crashes on mobile
65
-
66
- Response:
67
- 🐛 Bug reported: CRITICAL
68
-
69
- login button crashes on mobile
70
-
71
- Priority: critical
72
- Added to: core/next.md (top priority)
73
-
74
- Quick actions:
75
- • "start fixing" → /p:now "login button crashes on mobile"
76
- • "show queue" → /p:next
77
-
78
- /p:now | /p:next
79
- ```
19
+ ## Response
20
+ `🐛 {severity} | Queued #{position} | Start: /p:now`
@@ -1,44 +1,17 @@
1
1
  ---
2
- allowed-tools: [Read, Write]
3
- description: 'Start task with agent assignment'
2
+ allowed-tools: [Read, Write, GetTimestamp]
3
+ description: 'Start task'
4
+ timestamp-rule: 'GetTimestamp() for id and started'
4
5
  ---
5
6
 
6
7
  # /p:build
7
8
 
8
- ## Validation
9
-
10
- - Blocks if: `core/now.md` has active task
11
- - Error: "Complete current task first. Use /p:done"
9
+ ## Check
10
+ Block if `core/now.md` active
12
11
 
13
12
  ## Flow
14
-
15
- 1. Parse: task desc OR queue # (1-5)
16
- 2. Detect: `TaskSchema.detectAgent(task)` + complexity
17
- 3. Get: GitHub dev from `git config user.name` + remote
18
- 4. Create: task metadata with agent, complexity, estimate
19
- 5. Write: `core/now.md` with frontmatter
20
-
21
- ## Frontmatter
22
-
23
- ```yaml
24
- ---
25
- id: task-{timestamp}
26
- agent: {detected_agent}
27
- dev: @{github_username}
28
- complexity: {trivial|simple|moderate|complex|epic}
29
- estimated: {time_range}
30
- started: {iso_timestamp}
31
- ---
32
- {task_description}
33
- ```
13
+ 1. Parse task/# → Detect agent + complexity
14
+ 2. Write now.md: id={GetTimestamp()}, agent, started={GetTimestamp()}
34
15
 
35
16
  ## Response
36
-
37
- ```
38
- 🎯 {task}
39
- {agent_icon} {agent_name}
40
- Est: {time_estimate}
41
- Complexity: {level}
42
-
43
- /p:done when finished
44
- ```
17
+ `🎯 {task} | {agent} | Est: {time} | Done: /p:done`
@@ -1,42 +1,19 @@
1
1
  ---
2
2
  allowed-tools: [Read, Edit, Bash]
3
- description: 'Code cleanup and optimization'
3
+ description: 'Code cleanup'
4
4
  ---
5
5
 
6
6
  # /p:cleanup
7
7
 
8
- ## Usage
9
-
10
- ```
11
- /p:cleanup [--type code|imports|files|deps|all] [--dry-run]
12
- ```
13
-
14
- ## Flow
15
-
16
- 1. Parse: type + mode
17
- 2. Backup: create if needed
18
- 3. Execute: cleanup by type
19
- 4. Validate: syntax check
20
- 5. Log: `memory/cleanup-log.jsonl`
21
-
22
8
  ## Types
9
+ - **code**: Remove logs, dead code
10
+ - **imports**: Clean unused
11
+ - **files**: Remove temp/empty
12
+ - **deps**: Find unused
13
+ - **all**: Everything
23
14
 
24
- - **code**: Remove console.logs, commented code, dead code
25
- - **imports**: Remove unused, organize imports
26
- - **files**: Remove temp files, empty files
27
- - **deps**: Analyze unused dependencies
28
- - **all**: All cleanup types
15
+ ## Flow
16
+ Parse type Backup Clean → Validate → Log
29
17
 
30
18
  ## Response
31
-
32
- ```
33
- 🧹 Cleanup complete!
34
-
35
- 📊 Results:
36
- • Console.logs: {N} removed
37
- • Dead code: {N} blocks
38
- • Unused imports: {N}
39
- • Space freed: {X} MB
40
-
41
- /p:test | /p:ship
42
- ```
19
+ `🧹 Cleaned: {N} logs, {N} dead code, {N} imports | Freed: {X}MB`