prjct-cli 0.25.1 → 0.27.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.
- package/CHANGELOG.md +214 -0
- package/CLAUDE.md +109 -110
- package/core/infrastructure/command-installer.ts +27 -0
- package/core/infrastructure/setup.ts +51 -0
- package/package.json +1 -1
- package/templates/agentic/agents/uxui.md +8 -0
- package/templates/agentic/skill-integration.md +311 -0
- package/templates/agentic/subagent-generation.md +28 -12
- package/templates/commands/bug.md +72 -17
- package/templates/commands/done.md +158 -8
- package/templates/commands/git.md +21 -5
- package/templates/commands/merge.md +202 -0
- package/templates/commands/p.md +32 -0
- package/templates/commands/pause.md +40 -7
- package/templates/commands/resume.md +113 -33
- package/templates/commands/review.md +276 -0
- package/templates/commands/ship.md +193 -17
- package/templates/commands/sync.md +456 -55
- package/templates/commands/task.md +168 -542
- package/templates/commands/test.md +75 -3
- package/templates/commands/verify.md +204 -0
- package/templates/config/skill-mappings.json +87 -0
- package/templates/global/CLAUDE.md +193 -36
- package/templates/global/docs/commands.md +29 -31
- package/templates/subagents/domain/backend.md +1 -0
- package/templates/subagents/domain/devops.md +1 -0
- package/templates/subagents/domain/frontend.md +1 -0
- package/templates/subagents/domain/testing.md +1 -0
- package/templates/subagents/workflow/prjct-planner.md +1 -0
- package/templates/subagents/workflow/prjct-shipper.md +1 -0
|
@@ -1,639 +1,287 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Read, Write, Bash, Task, Glob, Grep, AskUserQuestion]
|
|
3
|
-
description: 'Unified task workflow with
|
|
4
|
-
timestamp-rule: 'GetTimestamp() and GetDate() for ALL timestamps'
|
|
5
|
-
architecture: 'Write-Through (JSON -> MD -> Events)'
|
|
6
|
-
storage-layer: true
|
|
7
|
-
source-of-truth: 'storage/state.json, storage/queue.json'
|
|
8
|
-
claude-context: 'context/now.md, context/next.md'
|
|
9
|
-
backend-sync: 'sync/pending.json'
|
|
3
|
+
description: 'Unified task workflow with intelligent classification'
|
|
10
4
|
---
|
|
11
5
|
|
|
12
|
-
#
|
|
6
|
+
# p. task - Start Any Task
|
|
13
7
|
|
|
14
|
-
Start any work with automatic
|
|
15
|
-
|
|
16
|
-
## 7-Phase Development Workflow
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
Phase 1: Discovery -> Understand the task
|
|
20
|
-
Phase 2: Exploration -> Analyze existing codebase
|
|
21
|
-
Phase 3: Questions -> Clarify ambiguities
|
|
22
|
-
Phase 4: Design -> Architecture options
|
|
23
|
-
Phase 5: Implementation -> Task breakdown + start
|
|
24
|
-
Phase 6: Review -> (via /p:done, /p:ship)
|
|
25
|
-
Phase 7: Summary -> (via /p:done)
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Architecture: Write-Through Pattern
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
User Action -> Storage (JSON) -> Context (MD) -> Sync Events
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**Source of Truth**: `storage/state.json` (current), `storage/queue.json` (queue)
|
|
35
|
-
**Claude Context**: `context/now.md`, `context/next.md` (generated)
|
|
36
|
-
**Backend Sync**: `sync/pending.json` (events)
|
|
8
|
+
Start any work with automatic classification and intelligent breakdown.
|
|
37
9
|
|
|
38
10
|
## Context Variables
|
|
39
11
|
|
|
40
12
|
- `{projectId}`: From `.prjct/prjct.config.json`
|
|
41
13
|
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
42
|
-
- `{queuePath}`: `{globalPath}/storage/queue.json`
|
|
43
|
-
- `{statePath}`: `{globalPath}/storage/state.json`
|
|
44
|
-
- `{contextPath}`: `{globalPath}/context/now.md`
|
|
45
|
-
- `{syncPath}`: `{globalPath}/sync/pending.json`
|
|
46
|
-
- `{memoryPath}`: `{globalPath}/memory/events.jsonl`
|
|
47
14
|
- `{task}`: User-provided task description
|
|
48
15
|
|
|
49
16
|
---
|
|
50
17
|
|
|
18
|
+
## Quick Flow
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
1. Validate project exists
|
|
22
|
+
2. Handle active task conflict (if any)
|
|
23
|
+
3. Classify task type (agentic reasoning)
|
|
24
|
+
4. Create git branch (if on main)
|
|
25
|
+
5. Run 5-phase workflow
|
|
26
|
+
6. Update storage + context
|
|
27
|
+
7. Output summary
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
51
32
|
## Step 1: Validate Project
|
|
52
33
|
|
|
53
|
-
|
|
54
|
-
|
|
34
|
+
```
|
|
35
|
+
READ: .prjct/prjct.config.json
|
|
36
|
+
EXTRACT: projectId
|
|
37
|
+
SET: globalPath = ~/.prjct-cli/projects/{projectId}
|
|
55
38
|
|
|
56
39
|
IF file not found:
|
|
57
|
-
OUTPUT: "No prjct project. Run
|
|
40
|
+
OUTPUT: "No prjct project. Run `p. init` first."
|
|
58
41
|
STOP
|
|
59
|
-
|
|
60
|
-
SET: `{globalPath}` = `~/.prjct-cli/projects/{projectId}`
|
|
61
|
-
READ: `{globalPath}/storage/state.json`
|
|
42
|
+
```
|
|
62
43
|
|
|
63
44
|
---
|
|
64
45
|
|
|
65
|
-
## Step 2: Handle No
|
|
46
|
+
## Step 2: Handle No Task Description
|
|
66
47
|
|
|
67
|
-
|
|
68
|
-
|
|
48
|
+
```
|
|
49
|
+
IF no task provided:
|
|
50
|
+
READ: {globalPath}/storage/state.json
|
|
69
51
|
|
|
70
52
|
IF currentTask exists AND status == "active":
|
|
71
|
-
|
|
72
|
-
OUTPUT:
|
|
73
|
-
```
|
|
74
|
-
Now: {currentTask.description}
|
|
75
|
-
Type: {currentTask.type}
|
|
76
|
-
|
|
77
|
-
Session: {sessionId}
|
|
78
|
-
Started: {elapsed} ago
|
|
79
|
-
Branch: {branch.name}
|
|
80
|
-
|
|
81
|
-
/p:done to complete | /p:pause to pause
|
|
82
|
-
```
|
|
53
|
+
OUTPUT current task status with elapsed time
|
|
83
54
|
STOP
|
|
84
55
|
ELSE:
|
|
85
|
-
OUTPUT: "No current task. Use
|
|
56
|
+
OUTPUT: "No current task. Use `p. task <description>` to start one."
|
|
86
57
|
STOP
|
|
58
|
+
```
|
|
87
59
|
|
|
88
60
|
---
|
|
89
61
|
|
|
90
|
-
## Step 3:
|
|
62
|
+
## Step 3: Handle Active Task Conflict
|
|
91
63
|
|
|
92
|
-
|
|
64
|
+
```
|
|
65
|
+
READ: {globalPath}/storage/state.json
|
|
93
66
|
|
|
94
67
|
IF currentTask exists AND status == "active" AND description != {task}:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
STOP
|
|
104
|
-
|
|
105
|
-
IF currentTask.description == {task}:
|
|
106
|
-
OUTPUT: "Continuing: {task}"
|
|
107
|
-
STOP
|
|
68
|
+
USE AskUserQuestion:
|
|
69
|
+
question: "Active task: '{currentTask.description}'. How to proceed?"
|
|
70
|
+
options:
|
|
71
|
+
- "Complete current first" → complete it, then continue
|
|
72
|
+
- "Pause and switch" → pause it, then continue
|
|
73
|
+
- "Cancel" → stay with current task
|
|
74
|
+
```
|
|
108
75
|
|
|
109
76
|
---
|
|
110
77
|
|
|
111
|
-
## Step 4: Agentic Classification
|
|
112
|
-
|
|
113
|
-
**DO NOT use keyword matching or if/else rules.**
|
|
114
|
-
**ANALYZE the task holistically and REASON about its nature.**
|
|
115
|
-
|
|
116
|
-
ANALYZE {task} considering:
|
|
117
|
-
|
|
118
|
-
1. **Intent**: What is the user trying to achieve?
|
|
119
|
-
- Are they adding something new that doesn't exist?
|
|
120
|
-
- Are they fixing something that's broken?
|
|
121
|
-
- Are they improving something that works but could be better?
|
|
122
|
-
- Are they reorganizing without changing behavior?
|
|
123
|
-
- Are they doing maintenance work?
|
|
124
|
-
|
|
125
|
-
2. **Impact**: What kind of value does this provide?
|
|
126
|
-
- User-facing functionality = feature or improvement
|
|
127
|
-
- Internal reorganization = refactor
|
|
128
|
-
- Broken behavior = bug
|
|
129
|
-
- Non-functional maintenance = chore
|
|
130
|
-
|
|
131
|
-
3. **Scope**: What is the nature of the change?
|
|
132
|
-
- New capability = feature
|
|
133
|
-
- Enhanced existing capability = improvement
|
|
134
|
-
- Broken capability = bug
|
|
135
|
-
- Same capability, better code = refactor
|
|
136
|
-
- Dependencies, docs, config = chore
|
|
137
|
-
|
|
138
|
-
DETERMINE {taskType} from this analysis:
|
|
139
|
-
|
|
140
|
-
| Type | When to classify as this |
|
|
141
|
-
|------|--------------------------|
|
|
142
|
-
| feature | Adds new functionality that didn't exist before |
|
|
143
|
-
| bug | Something is broken, incorrect, or not working as expected |
|
|
144
|
-
| improvement | Enhances existing functionality (performance, UX, usability) |
|
|
145
|
-
| refactor | Reorganizes code without changing external behavior |
|
|
146
|
-
| chore | Maintenance work: deps, docs, config, cleanup - no user-facing change |
|
|
147
|
-
|
|
148
|
-
**Examples of agentic reasoning:**
|
|
149
|
-
|
|
150
|
-
- "add error handling to login"
|
|
151
|
-
-> Reasoning: This adds new functionality (error handling) that didn't exist
|
|
152
|
-
-> Type: feature
|
|
78
|
+
## Step 4: Agentic Classification
|
|
153
79
|
|
|
154
|
-
|
|
155
|
-
-> Reasoning: Something is broken (button not working)
|
|
156
|
-
-> Type: bug
|
|
80
|
+
**CRITICAL: Use reasoning, NOT keyword matching.**
|
|
157
81
|
|
|
158
|
-
|
|
159
|
-
-> Reasoning: Dashboard works, but enhancing performance
|
|
160
|
-
-> Type: improvement
|
|
82
|
+
Analyze the task holistically:
|
|
161
83
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
84
|
+
| Type | When to Use |
|
|
85
|
+
|------|-------------|
|
|
86
|
+
| `feature` | Adds new functionality that didn't exist |
|
|
87
|
+
| `bug` | Something is broken or incorrect |
|
|
88
|
+
| `improvement` | Enhances existing functionality |
|
|
89
|
+
| `refactor` | Reorganizes code, same behavior |
|
|
90
|
+
| `chore` | Maintenance, deps, docs, config |
|
|
165
91
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
92
|
+
**Reasoning Examples:**
|
|
93
|
+
- "add error handling to login" → Reasoning: Adding new functionality → `feature`
|
|
94
|
+
- "fix button that doesn't submit" → Reasoning: Broken behavior → `bug`
|
|
95
|
+
- "make dashboard load faster" → Reasoning: Enhancing performance → `improvement`
|
|
96
|
+
- "split UserService into modules" → Reasoning: Reorganizing code → `refactor`
|
|
169
97
|
|
|
170
|
-
OUTPUT classification:
|
|
171
98
|
```
|
|
99
|
+
OUTPUT:
|
|
172
100
|
Analyzing: {task}
|
|
173
|
-
Intent: {your reasoning
|
|
101
|
+
Intent: {your reasoning}
|
|
174
102
|
Classification: {taskType}
|
|
175
103
|
```
|
|
176
104
|
|
|
177
|
-
SET: {taskType} = classified type
|
|
178
|
-
SET: {branchPrefix} = {taskType} (feature/, bug/, improvement/, refactor/, chore/)
|
|
179
|
-
|
|
180
105
|
---
|
|
181
106
|
|
|
182
107
|
## Step 5: Git Branch Management
|
|
183
108
|
|
|
184
|
-
|
|
185
|
-
BASH:
|
|
186
|
-
SET:
|
|
187
|
-
|
|
188
|
-
### 5.2 Handle Protected Branches
|
|
189
|
-
IF {currentBranch} == "main" OR {currentBranch} == "master":
|
|
190
|
-
OUTPUT: "Creating {taskType} branch for your task..."
|
|
109
|
+
```
|
|
110
|
+
BASH: git branch --show-current
|
|
111
|
+
SET: currentBranch = result
|
|
191
112
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
113
|
+
IF currentBranch == "main" OR currentBranch == "master":
|
|
114
|
+
# Handle uncommitted changes first
|
|
115
|
+
IF git status shows changes:
|
|
116
|
+
USE AskUserQuestion: "Uncommitted changes. Stash, commit, or abort?"
|
|
195
117
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
question: "Uncommitted changes detected. How to proceed?"
|
|
200
|
-
header: "Git"
|
|
201
|
-
options:
|
|
202
|
-
- label: "Stash changes"
|
|
203
|
-
description: "Temporarily save changes, create branch, then continue"
|
|
204
|
-
- label: "Commit first"
|
|
205
|
-
description: "Commit current changes before switching"
|
|
206
|
-
- label: "Abort"
|
|
207
|
-
description: "Cancel and keep working on current branch"
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
IF choice == "Stash changes":
|
|
211
|
-
BASH: `git stash push -m "prjct: stashed for {task}"`
|
|
212
|
-
SET: {stashedChanges} = true
|
|
213
|
-
ELSE IF choice == "Commit first":
|
|
214
|
-
OUTPUT: "Commit your changes first, then run /p:task again"
|
|
215
|
-
STOP
|
|
216
|
-
ELSE:
|
|
217
|
-
OUTPUT: "Aborted. Staying on {currentBranch}"
|
|
218
|
-
STOP
|
|
219
|
-
|
|
220
|
-
### 5.2.2 Create Branch
|
|
221
|
-
SET: {taskSlug} = slugify({task})
|
|
222
|
-
LIMIT: {taskSlug} to 50 characters, lowercase, replace spaces with hyphens
|
|
223
|
-
SET: {branchName} = "{branchPrefix}/{taskSlug}"
|
|
224
|
-
|
|
225
|
-
BASH: `git checkout -b {branchName}`
|
|
226
|
-
IF command fails (branch exists):
|
|
227
|
-
BASH: `git checkout {branchName}`
|
|
228
|
-
IF still fails:
|
|
229
|
-
OUTPUT: "Failed to create/checkout branch: {branchName}"
|
|
230
|
-
STOP
|
|
231
|
-
|
|
232
|
-
SET: {branchCreated} = true
|
|
233
|
-
SET: {baseBranch} = {currentBranch}
|
|
118
|
+
# Create branch
|
|
119
|
+
SET: branchName = {taskType}/{slugify(task)}
|
|
120
|
+
BASH: git checkout -b {branchName}
|
|
234
121
|
OUTPUT: "Created branch: {branchName}"
|
|
235
|
-
|
|
236
|
-
ELSE:
|
|
237
|
-
SET: {branchName} = {currentBranch}
|
|
238
|
-
SET: {branchCreated} = false
|
|
239
|
-
SET: {baseBranch} = null
|
|
122
|
+
```
|
|
240
123
|
|
|
241
124
|
---
|
|
242
125
|
|
|
243
|
-
##
|
|
126
|
+
## 5-Phase Workflow
|
|
244
127
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
### 1.1 Summarize the Task
|
|
248
|
-
Analyze {task} and OUTPUT:
|
|
128
|
+
### Phase 1: Discovery
|
|
129
|
+
Summarize what you understand:
|
|
249
130
|
```
|
|
250
131
|
Building: {one-sentence summary}
|
|
251
132
|
Type: {taskType}
|
|
252
133
|
|
|
253
134
|
Requirements:
|
|
254
|
-
- {
|
|
255
|
-
- {
|
|
256
|
-
- {requirement 3}
|
|
135
|
+
- {req 1}
|
|
136
|
+
- {req 2}
|
|
257
137
|
|
|
258
138
|
Success looks like:
|
|
259
|
-
- {
|
|
260
|
-
- {
|
|
139
|
+
- {criteria 1}
|
|
140
|
+
- {criteria 2}
|
|
261
141
|
```
|
|
262
142
|
|
|
263
|
-
###
|
|
264
|
-
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
|
|
269
|
-
---
|
|
143
|
+
### Phase 2: Exploration
|
|
144
|
+
Use Task(Explore) agent to find:
|
|
145
|
+
- Similar existing code
|
|
146
|
+
- Patterns used in this codebase
|
|
147
|
+
- Key files that would be affected
|
|
270
148
|
|
|
271
|
-
|
|
149
|
+
**Load skills based on task type:**
|
|
150
|
+
```
|
|
151
|
+
READ: {globalPath}/config/skills.json (if exists)
|
|
272
152
|
|
|
273
|
-
|
|
153
|
+
IF task involves UI/frontend:
|
|
154
|
+
Invoke Skill("frontend-design") for design patterns
|
|
155
|
+
OUTPUT: "🎨 Using frontend-design skill"
|
|
274
156
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
Task(
|
|
279
|
-
subagent_type: 'Explore',
|
|
280
|
-
prompt: 'Find code similar to "{task}". Look for:
|
|
281
|
-
- Existing implementations of similar functionality
|
|
282
|
-
- Patterns used in this codebase
|
|
283
|
-
- Key files that would be affected
|
|
284
|
-
Return: file paths, patterns found, relevant code snippets'
|
|
285
|
-
)
|
|
157
|
+
IF task involves backend/API:
|
|
158
|
+
Invoke Skill("javascript-typescript") OR Skill("python-development")
|
|
159
|
+
OUTPUT: "⚙️ Using {skill} skill"
|
|
286
160
|
```
|
|
287
161
|
|
|
288
|
-
### 2.2 Trace Dependencies
|
|
289
|
-
BASH: Find imports/dependencies related to the task area
|
|
290
|
-
|
|
291
|
-
### 2.3 Report Findings
|
|
292
|
-
OUTPUT:
|
|
293
162
|
```
|
|
163
|
+
OUTPUT:
|
|
294
164
|
Found similar:
|
|
295
|
-
- {
|
|
296
|
-
- {similar code 2} in {file path}
|
|
165
|
+
- {code} in {file}
|
|
297
166
|
|
|
298
167
|
Patterns used:
|
|
299
|
-
- {pattern
|
|
300
|
-
- {pattern 2}: {where it's used}
|
|
301
|
-
|
|
302
|
-
Key files to modify:
|
|
303
|
-
- {file 1}: {what needs to change}
|
|
304
|
-
- {file 2}: {what needs to change}
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
---
|
|
308
|
-
|
|
309
|
-
## PHASE 3: Questions
|
|
310
|
-
|
|
311
|
-
OUTPUT: "## Phase 3: Clarifying Questions"
|
|
312
|
-
|
|
313
|
-
### 3.1 Identify Ambiguities
|
|
314
|
-
Based on discovery and exploration, identify unclear aspects:
|
|
315
|
-
|
|
316
|
-
IF ambiguities exist:
|
|
317
|
-
USE AskUserQuestion tool:
|
|
318
|
-
```
|
|
319
|
-
- Scope: "Should this include {edge case}?"
|
|
320
|
-
- Tech: "Prefer {option A} or {option B}?"
|
|
321
|
-
- Priority: "Is {sub-task} required now or later?"
|
|
322
|
-
```
|
|
323
|
-
WAIT for answers
|
|
324
|
-
UPDATE requirements based on answers
|
|
325
|
-
|
|
326
|
-
IF no ambiguities:
|
|
327
|
-
OUTPUT: "Requirements are clear. Proceeding to design."
|
|
328
|
-
|
|
329
|
-
---
|
|
330
|
-
|
|
331
|
-
## PHASE 4: Design
|
|
332
|
-
|
|
333
|
-
OUTPUT: "## Phase 4: Architecture Design"
|
|
334
|
-
|
|
335
|
-
### 4.0 Load Available Experts (CRITICAL)
|
|
336
|
-
|
|
337
|
-
**ALWAYS load all available domain experts to inform the design phase.**
|
|
338
|
-
|
|
339
|
-
GLOB: `{globalPath}/agents/*.md`
|
|
340
|
-
SET: {availableAgents} = list of agent files found
|
|
341
|
-
|
|
342
|
-
FOR each agent in {availableAgents}:
|
|
343
|
-
READ: agent file
|
|
344
|
-
EXTRACT: agent domain (frontend, backend, database, testing, devops, uxui)
|
|
345
|
-
ADD to {loadedExperts}
|
|
346
|
-
|
|
347
|
-
OUTPUT: "Loaded experts: {loadedExperts.join(', ')}"
|
|
348
|
-
|
|
349
|
-
### 4.1 UX/UI Analysis (Frontend Tasks)
|
|
350
|
-
|
|
351
|
-
**CRITICAL**: If task involves UI/frontend, apply UX/UI analysis FIRST.
|
|
168
|
+
- {pattern}: {where}
|
|
352
169
|
|
|
353
|
-
|
|
354
|
-
-
|
|
355
|
-
- File types affected: .tsx, .jsx, .vue, .svelte, .swift, .kt, .dart
|
|
170
|
+
Key files:
|
|
171
|
+
- {file}: {what changes}
|
|
356
172
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
### Apply UX Checklist (MANDATORY)
|
|
361
|
-
```
|
|
362
|
-
**User Analysis:**
|
|
363
|
-
- Who: {describe the user}
|
|
364
|
-
- Problem: {what pain point this solves}
|
|
365
|
-
- Happy Path: {ideal flow}
|
|
366
|
-
- Edge Cases: {what can go wrong}
|
|
367
|
-
|
|
368
|
-
**UX Requirements:**
|
|
369
|
-
- [ ] User understands action in < 3 seconds
|
|
370
|
-
- [ ] Each action has visual feedback
|
|
371
|
-
- [ ] Errors are clear and recoverable
|
|
372
|
-
- [ ] Keyboard navigation supported
|
|
373
|
-
- [ ] Contrast ratio >= 4.5:1
|
|
374
|
-
- [ ] Touch targets >= 44px (mobile)
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
### Ask Aesthetic Direction
|
|
378
|
-
USE AskUserQuestion:
|
|
379
|
-
```
|
|
380
|
-
question: "What aesthetic direction for this task?"
|
|
381
|
-
header: "Aesthetic"
|
|
382
|
-
options:
|
|
383
|
-
- label: "Minimal"
|
|
384
|
-
description: "Clean, professional. Best for B2B, productivity tools"
|
|
385
|
-
- label: "Bold/Maximalist"
|
|
386
|
-
description: "Striking, modern. Best for creative, entertainment"
|
|
387
|
-
- label: "Soft/Organic"
|
|
388
|
-
description: "Friendly, approachable. Best for wellness, lifestyle"
|
|
389
|
-
- label: "Brutalist"
|
|
390
|
-
description: "Raw, technical. Best for dev tools, startups"
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
SET: {aestheticDirection} = user's choice
|
|
394
|
-
|
|
395
|
-
ELSE IF frontend task:
|
|
396
|
-
OUTPUT: "UX/UI agent not found. Run /p:sync to generate."
|
|
397
|
-
CONTINUE without UX/UI analysis
|
|
398
|
-
|
|
399
|
-
### 4.2 Backend Analysis (API Tasks)
|
|
400
|
-
|
|
401
|
-
IF task involves API/backend AND "backend" in {loadedExperts}:
|
|
402
|
-
OUTPUT: "### 4.2 Backend Analysis"
|
|
403
|
-
|
|
404
|
-
APPLY backend agent expertise:
|
|
405
|
-
- API design patterns
|
|
406
|
-
- Error handling conventions
|
|
407
|
-
- Authentication/authorization requirements
|
|
408
|
-
- Database interaction patterns
|
|
409
|
-
|
|
410
|
-
### 4.3 Database Analysis (Data Tasks)
|
|
411
|
-
|
|
412
|
-
IF task involves database/data AND "database" in {loadedExperts}:
|
|
413
|
-
OUTPUT: "### 4.3 Database Analysis"
|
|
414
|
-
|
|
415
|
-
APPLY database agent expertise:
|
|
416
|
-
- Schema design considerations
|
|
417
|
-
- Query optimization
|
|
418
|
-
- Migration strategy
|
|
419
|
-
- Data integrity constraints
|
|
420
|
-
|
|
421
|
-
### 4.4 Testing Strategy
|
|
422
|
-
|
|
423
|
-
IF "testing" in {loadedExperts}:
|
|
424
|
-
OUTPUT: "### 4.4 Testing Strategy"
|
|
173
|
+
Skills activated: {skills used}
|
|
174
|
+
```
|
|
425
175
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
- Edge cases to cover
|
|
430
|
-
- Test data requirements
|
|
176
|
+
### Phase 3: Questions
|
|
177
|
+
If anything is unclear, use AskUserQuestion.
|
|
178
|
+
If everything is clear, say so and continue.
|
|
431
179
|
|
|
432
|
-
### 4
|
|
180
|
+
### Phase 4: Design
|
|
181
|
+
Load relevant agents from `{globalPath}/agents/` and their linked skills:
|
|
433
182
|
|
|
434
|
-
|
|
435
|
-
|
|
183
|
+
**Agent + Skill Loading:**
|
|
184
|
+
```
|
|
185
|
+
FOR EACH relevant agent in {globalPath}/agents/:
|
|
186
|
+
READ agent file
|
|
187
|
+
PARSE frontmatter → get `skills` array
|
|
188
|
+
|
|
189
|
+
IF skills exist:
|
|
190
|
+
FOR EACH skill in skills:
|
|
191
|
+
Invoke Skill(skill) for domain expertise
|
|
192
|
+
OUTPUT: "📚 {agent} using /{skill}"
|
|
193
|
+
```
|
|
436
194
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
195
|
+
**Example flow for UI feature:**
|
|
196
|
+
1. Load `uxui.md` agent (has `skills: [frontend-design]`)
|
|
197
|
+
2. Invoke `/frontend-design` skill
|
|
198
|
+
3. Skill provides anti-AI-slop patterns, typography guidelines
|
|
199
|
+
4. Agent applies them to design options
|
|
442
200
|
|
|
443
|
-
|
|
444
|
-
Based on exploration and expert analysis, design 2-3 approaches:
|
|
201
|
+
Propose 2-3 approaches:
|
|
445
202
|
|
|
446
|
-
OUTPUT:
|
|
447
203
|
```
|
|
448
|
-
### Option 1: Minimal
|
|
449
|
-
- Approach: {
|
|
450
|
-
- Files: {count}
|
|
451
|
-
- Pros:
|
|
452
|
-
- Cons: {tradeoff}
|
|
204
|
+
### Option 1: Minimal
|
|
205
|
+
- Approach: {desc}
|
|
206
|
+
- Files: {count}
|
|
207
|
+
- Pros/Cons: ...
|
|
453
208
|
|
|
454
209
|
### Option 2: Clean Architecture
|
|
455
|
-
- Approach: {
|
|
456
|
-
- Files: {count}
|
|
457
|
-
- Pros:
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
-
|
|
462
|
-
-
|
|
463
|
-
-
|
|
464
|
-
- Cons: {minor tradeoff}
|
|
210
|
+
- Approach: {desc}
|
|
211
|
+
- Files: {count}
|
|
212
|
+
- Pros/Cons: ...
|
|
213
|
+
|
|
214
|
+
### Option 3: Recommended (Skill-informed)
|
|
215
|
+
- Approach: {desc}
|
|
216
|
+
- Files: {count}
|
|
217
|
+
- Pros/Cons: ...
|
|
218
|
+
- Skills applied: {skills}
|
|
465
219
|
```
|
|
466
220
|
|
|
467
|
-
|
|
468
|
-
USE AskUserQuestion:
|
|
469
|
-
```
|
|
470
|
-
question: "Which architecture approach?"
|
|
471
|
-
options:
|
|
472
|
-
- "Option 1: Minimal Changes"
|
|
473
|
-
- "Option 2: Clean Architecture"
|
|
474
|
-
- "Option 3: Pragmatic Balance (Recommended)"
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
SET: {chosenApproach} = user's choice
|
|
478
|
-
|
|
479
|
-
---
|
|
480
|
-
|
|
481
|
-
## PHASE 5: Implementation
|
|
482
|
-
|
|
483
|
-
OUTPUT: "## Phase 5: Task Breakdown"
|
|
484
|
-
|
|
485
|
-
### 5.1 Generate Tasks
|
|
486
|
-
Based on {chosenApproach}, break into tasks:
|
|
487
|
-
|
|
488
|
-
Rules:
|
|
489
|
-
1. Each task: 30min - 2h
|
|
490
|
-
2. Atomic (one concern each)
|
|
491
|
-
3. Ordered by dependency
|
|
492
|
-
4. Include testing as final task
|
|
221
|
+
Use AskUserQuestion to get approval.
|
|
493
222
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
223
|
+
### Phase 5: Task Breakdown
|
|
224
|
+
Break into actionable subtasks:
|
|
225
|
+
- Each task: 30min - 2h
|
|
226
|
+
- Ordered by dependency
|
|
227
|
+
- Include testing as final task
|
|
497
228
|
|
|
498
|
-
### 5.2 Show Task List
|
|
499
|
-
OUTPUT:
|
|
500
229
|
```
|
|
501
230
|
Tasks for {task}:
|
|
502
|
-
1. {
|
|
503
|
-
2. {
|
|
504
|
-
3. {task 3}
|
|
231
|
+
1. {subtask 1}
|
|
232
|
+
2. {subtask 2}
|
|
505
233
|
...
|
|
506
234
|
n. Write tests and verify
|
|
507
235
|
```
|
|
508
236
|
|
|
509
|
-
### 5.3 Impact Assessment
|
|
510
|
-
IF affects core functionality OR user-facing:
|
|
511
|
-
{impact} = "high"
|
|
512
|
-
ELSE IF affects internal systems:
|
|
513
|
-
{impact} = "medium"
|
|
514
|
-
ELSE:
|
|
515
|
-
{impact} = "low"
|
|
516
|
-
|
|
517
|
-
{effort} = estimate based on task count
|
|
518
|
-
|
|
519
237
|
---
|
|
520
238
|
|
|
521
|
-
## Step 6: Update Storage
|
|
522
|
-
|
|
523
|
-
### Update queue.json
|
|
524
|
-
|
|
525
|
-
READ: `{queuePath}` (or create default if not exists)
|
|
526
|
-
|
|
527
|
-
Default structure:
|
|
528
|
-
```json
|
|
529
|
-
{
|
|
530
|
-
"tasks": [],
|
|
531
|
-
"lastUpdated": null
|
|
532
|
-
}
|
|
533
|
-
```
|
|
534
|
-
|
|
535
|
-
For each task in {tasks}, create task object:
|
|
536
|
-
```json
|
|
537
|
-
{
|
|
538
|
-
"id": "{taskId}",
|
|
539
|
-
"description": "{taskDescription}",
|
|
540
|
-
"type": "{taskType}",
|
|
541
|
-
"priority": "normal",
|
|
542
|
-
"section": "active",
|
|
543
|
-
"featureId": "{featureId}",
|
|
544
|
-
"featureName": "{task}",
|
|
545
|
-
"createdAt": "{now}"
|
|
546
|
-
}
|
|
547
|
-
```
|
|
548
|
-
|
|
549
|
-
APPEND all tasks to `tasks` array
|
|
550
|
-
SET: `lastUpdated` = {now}
|
|
551
|
-
WRITE: `{queuePath}`
|
|
552
|
-
|
|
553
|
-
### Update state.json
|
|
554
|
-
|
|
555
|
-
{firstTask} = first item from {tasks}
|
|
556
|
-
GENERATE: {sessionId} = UUID v4
|
|
239
|
+
## Step 6: Update Storage
|
|
557
240
|
|
|
241
|
+
### Write state.json
|
|
558
242
|
```json
|
|
559
243
|
{
|
|
560
244
|
"currentTask": {
|
|
561
|
-
"id": "{
|
|
562
|
-
"description": "{
|
|
245
|
+
"id": "{uuid}",
|
|
246
|
+
"description": "{firstSubtask}",
|
|
563
247
|
"type": "{taskType}",
|
|
564
248
|
"status": "active",
|
|
565
|
-
"sessionId": "{
|
|
566
|
-
"featureId": "{
|
|
567
|
-
"startedAt": "{
|
|
249
|
+
"sessionId": "{uuid}",
|
|
250
|
+
"featureId": "{uuid}",
|
|
251
|
+
"startedAt": "{timestamp}",
|
|
568
252
|
"branch": {
|
|
569
253
|
"name": "{branchName}",
|
|
570
|
-
"
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
254
|
+
"baseBranch": "{baseBranch}"
|
|
255
|
+
},
|
|
256
|
+
"subtasks": [...],
|
|
257
|
+
"currentSubtaskIndex": 0,
|
|
258
|
+
"parentDescription": "{task}"
|
|
574
259
|
},
|
|
575
|
-
"lastUpdated": "{
|
|
260
|
+
"lastUpdated": "{timestamp}"
|
|
576
261
|
}
|
|
577
262
|
```
|
|
578
|
-
WRITE: `{statePath}`
|
|
579
|
-
|
|
580
|
-
---
|
|
581
263
|
|
|
582
|
-
|
|
264
|
+
### Write queue.json
|
|
265
|
+
Add all subtasks to queue with featureId linking them.
|
|
583
266
|
|
|
584
267
|
### Generate context/now.md
|
|
585
268
|
```markdown
|
|
586
269
|
# NOW
|
|
587
270
|
|
|
588
|
-
**{
|
|
271
|
+
**{firstSubtask.description}**
|
|
589
272
|
|
|
590
273
|
Type: {taskType}
|
|
591
|
-
Started: {now}
|
|
592
|
-
Session: {sessionId}
|
|
593
|
-
Branch: {branchName}
|
|
594
274
|
Feature: {task}
|
|
275
|
+
Branch: {branchName}
|
|
595
276
|
```
|
|
596
|
-
WRITE: `{globalPath}/context/now.md`
|
|
597
|
-
|
|
598
|
-
### Generate context/next.md
|
|
599
|
-
READ: `{queuePath}`
|
|
600
|
-
TRANSFORM to markdown with remaining tasks
|
|
601
|
-
WRITE: `{globalPath}/context/next.md`
|
|
602
277
|
|
|
603
278
|
---
|
|
604
279
|
|
|
605
|
-
## Step
|
|
606
|
-
|
|
607
|
-
READ: `{syncPath}` or create empty array
|
|
280
|
+
## Step 7: Log to Memory
|
|
608
281
|
|
|
609
|
-
### Task created event
|
|
610
|
-
APPEND:
|
|
611
|
-
```json
|
|
612
|
-
{
|
|
613
|
-
"type": "task.created",
|
|
614
|
-
"path": ["state"],
|
|
615
|
-
"data": {
|
|
616
|
-
"taskId": "{firstTask.id}",
|
|
617
|
-
"description": "{task}",
|
|
618
|
-
"type": "{taskType}",
|
|
619
|
-
"featureId": "{featureId}",
|
|
620
|
-
"taskCount": {taskCount},
|
|
621
|
-
"branch": "{branchName}"
|
|
622
|
-
},
|
|
623
|
-
"timestamp": "{now}",
|
|
624
|
-
"projectId": "{projectId}"
|
|
625
|
-
}
|
|
626
282
|
```
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
---
|
|
631
|
-
|
|
632
|
-
## Step 9: Log to Memory
|
|
633
|
-
|
|
634
|
-
APPEND to: `{memoryPath}`
|
|
635
|
-
```json
|
|
636
|
-
{"timestamp":"{now}","action":"task_started","taskId":"{firstTask.id}","type":"{taskType}","description":"{task}","branch":"{branchName}"}
|
|
283
|
+
APPEND to {globalPath}/memory/events.jsonl:
|
|
284
|
+
{"timestamp":"{now}","action":"task_started","taskId":"{id}","type":"{type}","description":"{task}"}
|
|
637
285
|
```
|
|
638
286
|
|
|
639
287
|
---
|
|
@@ -645,42 +293,20 @@ APPEND to: `{memoryPath}`
|
|
|
645
293
|
Type: {taskType}
|
|
646
294
|
|
|
647
295
|
Branch: {branchName}
|
|
648
|
-
|
|
649
|
-
Impact: {impact} | Effort: {effort}
|
|
296
|
+
Subtasks: {count}
|
|
650
297
|
|
|
651
|
-
Started: {
|
|
298
|
+
Started: {firstSubtask}
|
|
652
299
|
|
|
653
|
-
Next:
|
|
654
|
-
- Work on the task
|
|
655
|
-
- /p:done - When finished
|
|
656
|
-
- /p:next - See full queue
|
|
300
|
+
Next: Work on the task, then `p. done`
|
|
657
301
|
```
|
|
658
302
|
|
|
659
303
|
---
|
|
660
304
|
|
|
661
305
|
## Error Handling
|
|
662
306
|
|
|
663
|
-
| Error |
|
|
664
|
-
|
|
665
|
-
| No config | "No prjct project"
|
|
666
|
-
| No task | Show current task or prompt
|
|
667
|
-
| Active task
|
|
668
|
-
| Branch
|
|
669
|
-
| Write fails | Log warning | CONTINUE |
|
|
670
|
-
|
|
671
|
-
---
|
|
672
|
-
|
|
673
|
-
## Natural Language Triggers
|
|
674
|
-
|
|
675
|
-
Messages starting with `p.` trigger this command:
|
|
676
|
-
- `p. task add auth` -> /p:task "add auth"
|
|
677
|
-
- `p. task fix login` -> /p:task "fix login"
|
|
678
|
-
- `p. start refactor api` -> /p:task "refactor api"
|
|
679
|
-
- `p. build dark mode` -> /p:task "dark mode"
|
|
680
|
-
|
|
681
|
-
---
|
|
682
|
-
|
|
683
|
-
## References
|
|
684
|
-
|
|
685
|
-
- Architecture: `~/.prjct-cli/docs/architecture.md`
|
|
686
|
-
- Commands: `~/.prjct-cli/docs/commands.md`
|
|
307
|
+
| Error | Action |
|
|
308
|
+
|-------|--------|
|
|
309
|
+
| No config | "No prjct project. Run `p. init` first." → STOP |
|
|
310
|
+
| No task | Show current task or prompt for one |
|
|
311
|
+
| Active task | Ask user what to do |
|
|
312
|
+
| Branch fails | Show error, suggest fix |
|