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
@@ -1,348 +1,61 @@
1
1
  ---
2
2
  allowed-tools: [Read]
3
- description: 'Interactive contextual guide - helps users based on their current state'
3
+ description: 'Contextual help'
4
4
  ---
5
5
 
6
6
  # /p:help
7
7
 
8
- ## Purpose
9
-
10
- Contextual help system that analyzes project state and provides relevant guidance. Different responses based on user's current situation.
11
-
12
8
  ## Flow
9
+ Check state → Determine context → Show relevant help
13
10
 
14
- 1. **Check project state**: Read core files if initialized
15
- 2. **Determine context**: What state is the user in?
16
- 3. **Provide relevant help**: Suggestions based on context
17
- 4. **Show examples**: Concrete examples for their situation
18
-
19
- ## Response Based on Context
20
-
21
- ### Context 1: Project Not Initialized
22
-
23
- ```
24
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
25
- 👋 WELCOME TO PRJCT!
26
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
27
-
28
- Ship Fast. No BS.
29
-
30
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
31
-
32
- 🚀 FIRST STEP: Initialize
33
-
34
- For existing project:
35
- /p:init
36
-
37
- For new blank project:
38
- /p:init "your idea here"
39
- → Activates ARCHITECT MODE
40
- → Conversational setup
41
- → Tech stack recommendations
42
-
43
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
44
-
45
- After init, I'll help you:
46
- • Break down features into tasks
47
- • Track your progress
48
- • Ship faster
49
-
50
- Let's start! 🎉
51
- ```
11
+ ## Contexts
12
+ 1. **Not init**: Show `/p:init` guide
13
+ 2. **Empty**: Suggest `/p:feature` or `/p:analyze`
14
+ 3. **Active task**: Show task, suggest `/p:done`
15
+ 4. **Has queue**: Suggest `/p:work 1`
16
+ 5. **Lost**: Show all options with examples
52
17
 
53
- ### Context 2: Initialized, No Active Task, Empty Queue
18
+ ## Response Format
54
19
 
55
20
  ```
56
21
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
57
- 🎯 WHAT DO YOU WANT TO DO?
22
+ 🎯 HELP - {CONTEXT_TITLE}
58
23
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
59
24
 
60
25
  📊 Your status:
61
- Project: initialized ✅
62
- • Active task: none
63
- • Queue: empty
64
- • Ready to work!
65
-
66
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
-
68
- 💡 RECOMMENDED NEXT STEPS:
69
-
70
- 1. 🚀 Add a feature
71
- Tell me what you want to build:
72
- → /p:feature "add dark mode"
73
- → /p:feature "implement auth"
74
- → /p:feature "optimize performance"
75
-
76
- I'll analyze value, break it into tasks, and start working!
77
-
78
- 2. 🔍 Analyze your project
79
- → /p:analyze
80
- Find TODOs, improvements, and opportunities
81
-
82
- 3. 📋 See your roadmap
83
- → /p:roadmap
84
- View planned features and progress
85
-
86
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
87
-
88
- 💬 TALK NATURALLY:
89
-
90
- You can just tell me:
91
- "I want to add authentication"
92
- "Help me optimize the app"
93
- "What should I do?"
94
-
95
- I understand! No need to memorize commands.
96
-
97
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
98
-
99
- 🆘 NEED MORE HELP?
100
-
101
- → /p:ask "what you want to do"
102
- (I'll guide you step by step)
103
-
104
- → /p:suggest
105
- (I'll analyze and recommend actions)
106
- ```
107
-
108
- ### Context 3: Initialized, Has Active Task
109
-
110
- ```
111
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
112
- 🎯 HELP - CURRENT STATUS
113
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
114
-
115
- 📊 Your status:
116
- • Working on: "{current_task}"
117
- • Started: {time_ago}
118
- • Queue: {N} tasks waiting
119
-
120
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
121
-
122
- 💡 WHAT YOU CAN DO:
123
-
124
- 1. ✅ Finished current task?
125
- → /p:done
126
- Marks complete, moves to next automatically
127
-
128
- 2. ❓ Stuck or need help?
129
- → /p:stuck "{what's blocking you}"
130
- I'll help troubleshoot
131
-
132
- 3. 📊 See what's next?
133
- → /p:next
134
- View your priority queue
135
-
136
- 4. 🎯 Check progress?
137
- → /p:status (visual dashboard)
138
- → /p:recap (detailed overview)
139
-
140
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
141
-
142
- 💬 OR JUST TELL ME:
143
-
144
- "I'm done"
145
- "I'm stuck with X"
146
- "What's next?"
147
- "Show me my progress"
148
-
149
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
150
-
151
- ⏱️ ACTIVE TASK INFO:
152
-
153
- Task: {current_task}
154
- Duration: {duration}
155
- Started: {timestamp}
156
-
157
- Focus on one task at a time → Ship faster!
158
- ```
159
-
160
- ### Context 4: Initialized, No Active Task, Has Queue
161
-
162
- ```
163
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
164
- 🎯 HELP - READY TO WORK!
165
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
166
-
167
- 📊 Your status:
168
- • Active task: none
169
- • Queue: {N} tasks ready
170
- • Last ship: {time_ago}
26
+ {relevant_state_info}
171
27
 
172
28
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
173
29
 
174
30
  💡 RECOMMENDED ACTIONS:
175
31
 
176
- 1. ⚡ Start working (RECOMMENDED)
177
- /p:next
178
- See your top 5 priority tasks
179
-
180
- → /p:build 1
181
- Start task #1 immediately
182
-
183
- → /p:build "task name"
184
- Start specific task
185
-
186
- 2. 📊 Check your progress
187
- → /p:status (visual dashboard)
188
- → /p:recap (detailed overview)
32
+ 1. {action_1}
33
+ {command_or_natural_language}
189
34
 
190
- 3. 💡 Add new feature
191
- /p:feature "{description}"
192
- Analyze, break down, and start
35
+ 2. {action_2}
36
+ → {command_or_natural_language}
193
37
 
194
- 4. 🐛 Report a bug
195
- /p:bug "{description}"
196
- Auto-prioritized and queued
38
+ 3. {action_3}
39
+ → {command_or_natural_language}
197
40
 
198
41
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
199
42
 
200
43
  💬 OR JUST SAY:
201
-
202
- "Show me what's next"
203
- "Start task 1"
204
- "I want to work on X"
205
-
206
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
207
-
208
- 💡 TIP:
209
-
210
- You have {N} tasks waiting!
211
- → /p:suggest for personalized recommendations
212
- ```
213
-
214
- ### Context 5: Lost/Confused
215
-
216
- ```
217
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
218
- 🆘 HOW CAN I HELP?
219
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
220
-
221
- No worries! Let me guide you.
222
-
223
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
224
-
225
- 🎯 CHOOSE YOUR SCENARIO:
226
-
227
- 1. 💡 "I want to build something new"
228
- → /p:feature "{what you want to build}"
229
-
230
- Examples:
231
- • /p:feature "add user authentication"
232
- • /p:feature "improve performance"
233
- • /p:feature "redesign homepage"
234
-
235
- 2. 🐛 "Something is broken"
236
- → /p:bug "{description}"
237
-
238
- Example:
239
- • /p:bug "login button not working"
240
-
241
- 3. ❓ "I don't know what to do"
242
- → /p:suggest
243
- I'll analyze your project and recommend
244
-
245
- 4. 📊 "I want to see my progress"
246
- → /p:status (visual)
247
- → /p:recap (detailed)
248
-
249
- 5. 🤔 "I need to understand something"
250
- → /p:ask "{what you want to do}"
251
-
252
- I'll translate your intent into actions!
44
+ "{natural_example_1}"
45
+ "{natural_example_2}"
253
46
 
254
47
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
255
48
 
256
- 💬 REMEMBER:
257
-
258
- You can talk naturally! Just tell me what you want:
259
-
260
- "I want to add dark mode"
261
- "Help me fix this bug"
262
- "What should I work on?"
263
- "I'm stuck with X"
264
-
265
- I understand both:
266
- • Natural language ✅
267
- • Commands ✅
268
- • English & Spanish ✅
269
-
270
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
271
-
272
- 🚀 PRJCT PHILOSOPHY:
273
-
274
- Ship Fast. No BS.
275
-
276
- • One task at a time
277
- • Track progress automatically
278
- • Celebrate every ship
279
- • No ceremonies, no overhead
280
-
281
- Just build and ship! 🎉
282
- ```
283
-
284
- ## Core Commands Reference
285
-
286
- Always include at the end of contextual help:
287
-
49
+ 📚 CORE COMMANDS:
50
+ Planning: /p:feature, /p:roadmap, /p:bug
51
+ Working: /p:next, /p:build, /p:done
52
+ Shipping: /p:ship
53
+ Progress: /p:status, /p:recap
54
+ Help: /p:ask, /p:suggest, /p:stuck
288
55
  ```
289
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
290
- 📚 CORE COMMANDS (if you prefer)
291
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
292
-
293
- Planning:
294
- /p:feature "{desc}" → Add feature with roadmap
295
- /p:roadmap → View strategic plan
296
- /p:bug "{desc}" → Report and track bug
297
-
298
- Working:
299
- /p:next → See priority queue
300
- /p:build {1-5} → Start task
301
- /p:now → Show current task
302
- /p:done → Complete task
303
-
304
- Shipping:
305
- /p:ship "{name}" → Commit, push, celebrate
306
-
307
- Progress:
308
- /p:status → Visual dashboard
309
- /p:recap → Detailed overview
310
-
311
- Help:
312
- /p:ask "{intent}" → Intent → Action guide
313
- /p:suggest → Smart recommendations
314
- /p:stuck "{issue}" → Get help
315
-
316
- Setup:
317
- /p:init → Initialize project
318
- /p:analyze → Deep analysis
319
-
320
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
321
-
322
- But remember: You can just talk naturally! 💬
323
- ```
324
-
325
- ## Key Principles
326
-
327
- 1. **Context-aware**: Different help based on state
328
- 2. **Actionable**: Always show what to do next
329
- 3. **Examples**: Concrete examples, not abstract
330
- 4. **Encouraging**: Positive, helpful tone
331
- 5. **Bilingual**: Support English and Spanish
332
- 6. **No jargon**: Simple, clear language
333
- 7. **Progressive**: Start simple, show depth if needed
334
56
 
335
57
  ## Validation
336
58
 
337
59
  - **Optional**: Works before project initialized
338
- - **Adaptive**: Response changes based on state
339
60
  - **Read-only**: Never modifies files
340
-
341
- ## Success Criteria
342
-
343
- After using `/p:help`, user should:
344
- - ✅ Know exactly what to do next
345
- - ✅ Understand they can talk naturally
346
- - ✅ Feel confident to proceed
347
- - ✅ Have concrete commands to try
348
- - ✅ Not feel overwhelmed
61
+ - **Adaptive**: Response changes based on state
@@ -1,34 +1,16 @@
1
1
  ---
2
- allowed-tools: [Write]
2
+ allowed-tools: [Read, Write, GetTimestamp, GetDate]
3
3
  description: 'Quick idea capture'
4
+ timestamp-rule: 'GetTimestamp() and GetDate() for timestamps'
4
5
  ---
5
6
 
6
7
  # /p:idea
7
8
 
8
- ## Usage
9
-
10
- ```
11
- /p:idea <text>
12
- ```
13
-
14
9
  ## Flow
15
-
16
- 1. **Append to session**: `planning/sessions/{YYYY-MM}/{YYYY-MM-DD}.jsonl`
17
- 2. **Update index**: Append to `planning/ideas.md` (keep only last 30 days)
18
- 3. If actionable → add to `core/next.md`
19
- 4. **Archive old**: If ideas.md > 30 days, move to `planning/archive/ideas-{YYYY-MM}.md`
20
-
21
- ## Session Log Format
22
-
23
- ```jsonl
24
- {"ts":"2025-10-04T16:00:00Z","type":"idea_add","idea":"{text}","actionable":{true/false},"priority":"{high/med/low}"}
25
- ```
10
+ 1. Log: `planning/sessions/{YY-MM}/{DD}.jsonl`
11
+ `{"ts":"{GetTimestamp()}","type":"idea_add","idea":"{text}"}`
12
+ 2. Update: `planning/ideas.md` with {GetDate()}
13
+ 3. If actionable → `core/next.md`
26
14
 
27
15
  ## Response
28
-
29
- ```
30
- 💡 {idea}
31
- {✅ Added to queue | 📝 Saved to backlog}
32
-
33
- /p:now "{idea}" | /p:next
34
- ```
16
+ `💡 {idea} | Saved | Start: /p:feature "{idea}"`
@@ -1,210 +1,34 @@
1
1
  ---
2
2
  allowed-tools: [Read, Write, Bash]
3
- description: 'Initialize prjct project (with architect mode for blank projects)'
3
+ description: 'Initialize prjct'
4
4
  ---
5
5
 
6
6
  # /p:init
7
7
 
8
- ## Usage
8
+ ## Flow
9
9
 
10
- ```
11
- /p:init # Existing project
12
- /p:init "[idea]" # New blank project (architect mode)
13
- ```
14
-
15
- ## Flow: Existing Project
16
-
17
- 1. Generate: project ID from path hash
18
- 2. Create: `~/.prjct-cli/projects/{id}/` structure (including `agents/`)
19
- 3. Write: `.prjct/prjct.config.json`
20
- 4. Run: `/p:analyze` to understand stack
21
- 5. Generate: agents based on stack
22
- 6. Log: `memory/context.jsonl`
23
-
24
- ## Flow: Blank Project (Architect Mode)
25
-
26
- 1. Generate: project ID
27
- 2. Activate: ARCHITECT role
28
- 3. Analyze: idea/requirements
29
- 4. Recommend: tech stack options (Next.js, React, Vue, etc.)
30
- 5. User confirms: choice
31
- 6. Create: directory structure + base files
32
- 7. Generate: initial roadmap
33
- 8. Generate: agents
34
- 9. Ask: "¿Empezamos con la primera feature?"
35
-
36
- ## Directory Structure
37
-
38
- ```
39
- ~/.prjct-cli/projects/{id}/
40
- ├── core/ # now.md, next.md, context.md
41
- ├── progress/ # shipped.md, metrics.md
42
- ├── planning/ # ideas.md, roadmap.md
43
- ├── analysis/ # repo-summary.md
44
- ├── agents/ # AI agent definitions
45
- └── memory/ # context.jsonl
46
- ```
47
-
48
- ## Config Format
49
-
50
- ```json
51
- {
52
- "version": "0.6.0",
53
- "projectId": "{id}",
54
- "dataPath": "~/.prjct-cli/projects/{id}",
55
- "author": {
56
- "name": "{from git}",
57
- "email": "{from git}",
58
- "github": "{from remote}"
59
- }
60
- }
61
- ```
62
-
63
- ## Response: Existing Project
64
-
65
- ```
66
- ✅ prjct initialized!
67
-
68
- 📁 Data: ~/.prjct-cli/projects/{id}
69
- 📝 Config: .prjct/prjct.config.json
70
- 📊 Analysis: {stack_summary}
71
- 🤖 Agents: {N} agents generated
72
-
73
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
74
- 🎯 WHAT DO YOU WANT TO DO FIRST?
75
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
76
-
77
- Choose your path:
78
-
79
- 1. 🚀 Add a new feature
80
- Tell me what you want to build!
81
-
82
- Examples:
83
- • "add user authentication"
84
- • "implement dark mode"
85
- • "optimize performance"
86
-
87
- → /p:feature "{description}"
88
-
89
- 2. 🐛 Fix a bug
90
- Describe what's broken
91
-
92
- Example:
93
- • "login button not working"
94
-
95
- → /p:bug "{description}"
96
-
97
- 3. 🔍 Analyze deeper
98
- Discover TODOs and improvements
99
-
100
- → /p:analyze
101
-
102
- 4. 📊 See current status
103
- View what's in your project
104
-
105
- → /p:status (visual dashboard)
106
- → /p:recap (detailed overview)
107
-
108
- 5. 💡 Not sure yet?
109
- Get personalized suggestions
110
-
111
- → /p:suggest
112
- → /p:help
113
-
114
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
10
+ **Existing**: ID → dirs → config → analyze → agents
11
+ **Blank + idea**: ARCHITECT → analyze → recommend stack → create → roadmap
115
12
 
116
- 💬 OR JUST TELL ME:
13
+ ## Structure
14
+ `~/.prjct-cli/projects/{id}/`: core, progress, planning, analysis, agents, memory
117
15
 
118
- You can talk naturally:
119
- "I want to add authentication"
120
- "Help me fix this performance issue"
121
- "What should I do?"
16
+ ## Config
17
+ `.prjct/prjct.config.json`: version, projectId, dataPath, author
122
18
 
123
- I understand! No need to memorize commands.
124
-
125
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
126
-
127
- Let's ship something! 🚀
128
- ```
129
-
130
- ## Response: Blank Project
131
-
132
- ```
133
- ✅ prjct initialized!
134
-
135
- 📐 ARCHITECT MODE ACTIVATED
136
-
137
- Your idea: "{idea}"
138
-
139
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
140
-
141
- 🎨 TECH STACK RECOMMENDATIONS:
142
-
143
- Based on your idea, I recommend:
144
-
145
- ⭐ Option 1: Next.js + TypeScript + Tailwind
146
- → Best for: Full-stack apps, SEO, modern UI
147
- → Why: Fast, scalable, great DX
148
-
149
- Option 2: React + Vite + shadcn/ui
150
- → Best for: SPAs, rapid prototyping
151
- → Why: Lightweight, flexible
152
-
153
- Option 3: Vue 3 + Nuxt
154
- → Best for: Progressive apps, content sites
155
- → Why: Easy learning curve, performant
156
-
157
- Custom: Tell me your preference
158
- → Any stack works with prjct!
159
-
160
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
161
-
162
- Which option works for you? (1, 2, 3, or describe your choice)
163
-
164
- [After user confirms:]
165
-
166
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
167
-
168
- ✅ Structure created!
169
-
170
- 📁 Project: {path}
171
- 📦 Stack: {chosen_stack}
172
- 📋 Initial roadmap: {N} features
173
- 🤖 Agents: {N} specialists generated
19
+ ## Response
20
+ `✅ Init | {stack} | {N} agents | Next: /p:feature or /p:help`
174
21
 
175
22
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
176
23
  🎯 WHAT'S NEXT?
177
24
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━
178
25
 
179
- Your roadmap is ready! You can:
180
-
181
- 1. 🚀 Start with first feature (RECOMMENDED)
182
- /p:feature "{first_feature}"
183
- I'll break it down and we'll start building
26
+ 1. 🚀 Start first feature (RECOMMENDED) → /p:feature "{first_feature}"
27
+ 2. 📊 See roadmap → /p:roadmap
28
+ 3. 🔍 Review structure /p:recap
29
+ 4. 💡 Modify plan Just tell me
184
30
 
185
- 2. 📊 See your roadmap
186
- → /p:roadmap
187
- View all planned features
188
-
189
- 3. 🔍 Review project structure
190
- → /p:recap
191
- See what was created
192
-
193
- 4. 💡 Modify the plan
194
- Just tell me:
195
- "I also want to add {feature}"
196
- "Let's do {different_feature} first"
197
-
198
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
199
-
200
- 💬 REMEMBER:
201
-
202
- You can talk naturally! Just tell me what you want:
203
- "Start with authentication"
204
- "Show me the roadmap"
205
- "I want to add another feature"
206
-
207
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
31
+ 💬 REMEMBER: Talk naturally! "Start with auth" / "Show roadmap" / "Add another feature"
208
32
 
209
33
  Ready to start building? 🚀
210
34
  ```