prjct-cli 0.35.3 → 0.35.4
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/core/commands/analysis.ts +58 -32
- package/core/commands/command-data.ts +11 -50
- package/core/commands/commands.ts +18 -21
- package/core/commands/context.ts +238 -0
- package/core/commands/register.ts +7 -5
- package/core/commands/setup.ts +1 -17
- package/core/index.ts +2 -4
- package/core/services/index.ts +2 -0
- package/core/services/sync-service.ts +1080 -0
- package/core/types/commands.ts +0 -12
- package/core/types/index.ts +0 -1
- package/dist/bin/prjct.mjs +1215 -307
- package/package.json +2 -8
- package/templates/agentic/agent-routing.md +22 -88
- package/templates/agentic/agents/uxui.md +42 -197
- package/templates/agentic/context-filtering.md +14 -56
- package/templates/agentic/orchestrator.md +26 -302
- package/templates/agentic/skill-integration.md +37 -289
- package/templates/agentic/subagent-generation.md +31 -104
- package/templates/agentic/task-fragmentation.md +39 -273
- package/templates/agents/AGENTS.md +32 -188
- package/templates/commands/bug.md +22 -520
- package/templates/commands/dash.md +26 -161
- package/templates/commands/done.md +19 -250
- package/templates/commands/enrich.md +21 -732
- package/templates/commands/idea.md +18 -160
- package/templates/commands/init.md +20 -209
- package/templates/commands/merge.md +21 -185
- package/templates/commands/next.md +21 -103
- package/templates/commands/pause.md +21 -272
- package/templates/commands/resume.md +18 -411
- package/templates/commands/setup.md +0 -1
- package/templates/commands/ship.md +30 -627
- package/templates/commands/sync.md +11 -1448
- package/templates/commands/task.md +17 -439
- package/templates/commands/test.md +30 -259
- package/CLAUDE.md +0 -211
- package/packages/shared/package.json +0 -29
- package/packages/shared/src/index.ts +0 -10
- package/packages/shared/src/schemas.ts +0 -124
- package/packages/shared/src/types.ts +0 -187
- package/packages/shared/src/unified.ts +0 -174
- package/packages/shared/src/utils.ts +0 -148
- package/packages/shared/tsconfig.json +0 -18
|
@@ -1,124 +1,42 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Read]
|
|
3
|
-
description: 'Show priority queue'
|
|
4
|
-
architecture: 'Write-Through (JSON → MD → Events)'
|
|
5
|
-
storage-layer: true
|
|
6
|
-
source-of-truth: 'storage/queue.json'
|
|
7
|
-
claude-context: 'context/next.md'
|
|
8
3
|
---
|
|
9
4
|
|
|
10
|
-
#
|
|
5
|
+
# p. next
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
**Source of Truth**: `storage/queue.json`
|
|
17
|
-
**Also reads**: `storage/state.json` for current task status
|
|
18
|
-
|
|
19
|
-
## Context Variables
|
|
20
|
-
- `{projectId}`: From `.prjct/prjct.config.json`
|
|
21
|
-
- `{globalPath}`: `~/.prjct-cli/projects/{projectId}`
|
|
22
|
-
- `{queuePath}`: `{globalPath}/storage/queue.json`
|
|
23
|
-
- `{statePath}`: `{globalPath}/storage/state.json`
|
|
24
|
-
|
|
25
|
-
## Flow
|
|
7
|
+
```bash
|
|
8
|
+
prjct context next
|
|
9
|
+
```
|
|
26
10
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
3. Display top 5 non-blocked tasks
|
|
11
|
+
READ `{globalPath}/storage/queue.json`
|
|
12
|
+
READ `{globalPath}/storage/state.json`
|
|
30
13
|
|
|
31
|
-
|
|
14
|
+
IF `currentTask` active → Show warning first
|
|
32
15
|
|
|
33
|
-
**
|
|
16
|
+
**Output (queue view)**:
|
|
34
17
|
```
|
|
35
|
-
⚠️ Active: {currentTask.description}
|
|
36
|
-
|
|
37
|
-
Complete with /p:done first, or:
|
|
38
|
-
|
|
39
18
|
📋 Queue ({count})
|
|
40
|
-
|
|
19
|
+
|
|
20
|
+
1. {task_1} [{priority}]
|
|
41
21
|
2. {task_2}
|
|
42
22
|
3. {task_3}
|
|
43
23
|
...
|
|
44
24
|
|
|
45
|
-
|
|
25
|
+
Next:
|
|
26
|
+
- Start task → `p. task "{task_1}"`
|
|
27
|
+
- Add task → `p. task "description"`
|
|
28
|
+
- Report bug → `p. bug "description"`
|
|
46
29
|
```
|
|
47
30
|
|
|
48
|
-
**
|
|
49
|
-
```
|
|
50
|
-
📋 Queue ({count})
|
|
51
|
-
|
|
52
|
-
1. {task_1} {priority}
|
|
53
|
-
2. {task_2} {priority}
|
|
54
|
-
3. {task_3} {priority}
|
|
55
|
-
4. {task_4}
|
|
56
|
-
5. {task_5}
|
|
57
|
-
|
|
58
|
-
{IF count > 5: ... and {count - 5} more}
|
|
59
|
-
|
|
60
|
-
Start: /p:work 1 or /p:now "{task}"
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**If empty queue**:
|
|
31
|
+
**Output (empty)**:
|
|
64
32
|
```
|
|
65
33
|
📋 Queue is empty
|
|
66
34
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
35
|
+
Next:
|
|
36
|
+
- Add task → `p. task "description"`
|
|
37
|
+
- Report bug → `p. bug "description"`
|
|
38
|
+
- Capture idea → `p. idea "note"`
|
|
71
39
|
```
|
|
72
40
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
| Data | Storage File | Field |
|
|
76
|
-
|------|--------------|-------|
|
|
77
|
-
| Current Task | `storage/state.json` | `currentTask` |
|
|
78
|
-
| Queue Tasks | `storage/queue.json` | `tasks[]` |
|
|
79
|
-
| Shipped | `storage/shipped.json` | `shipped[]` |
|
|
80
|
-
|
|
81
|
-
## Usage Variants
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
/p:next # Priority queue (default)
|
|
85
|
-
/p:next roadmap # Feature-grouped view
|
|
86
|
-
/p:next --roadmap # Same as above
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Roadmap View
|
|
90
|
-
|
|
91
|
-
When called with `roadmap` parameter, show feature-grouped view:
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
📍 PRODUCT ROADMAP
|
|
95
|
-
|
|
96
|
-
🚀 Current Sprint
|
|
97
|
-
├── ✅ {completed_feature} - shipped {date}
|
|
98
|
-
├── 🔄 {active_feature} ({X}% complete)
|
|
99
|
-
│ └── 🎯 {current_task}
|
|
100
|
-
└── ⏳ {pending_feature} ({N} tasks)
|
|
101
|
-
|
|
102
|
-
📅 Next Up ({N} features)
|
|
103
|
-
├── {feature_1} - {effort}
|
|
104
|
-
└── {feature_2} - {effort}
|
|
105
|
-
|
|
106
|
-
📊 Velocity: {X.X} features/week
|
|
107
|
-
|
|
108
|
-
/p:now "{next}" | /p:done
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Roadmap Data Aggregation
|
|
112
|
-
|
|
113
|
-
1. Group queue tasks by `featureId`
|
|
114
|
-
2. Calculate completion % per feature
|
|
115
|
-
3. Sort by priority/dependency
|
|
116
|
-
4. Show current task within active feature
|
|
117
|
-
|
|
118
|
-
## Natural Language Support
|
|
119
|
-
|
|
120
|
-
- "p. next" → Priority queue
|
|
121
|
-
- "p. queue" → Priority queue
|
|
122
|
-
- "p. what's next" → Priority queue
|
|
123
|
-
- "p. roadmap" → Roadmap view
|
|
124
|
-
- "p. features" → Roadmap view
|
|
41
|
+
**Roadmap view** (`p. next roadmap`):
|
|
42
|
+
Group by feature, show completion %
|
|
@@ -1,290 +1,39 @@
|
|
|
1
1
|
---
|
|
2
2
|
allowed-tools: [Read, Write, Bash, AskUserQuestion]
|
|
3
|
-
description: 'Pause current session with reason'
|
|
4
|
-
timestamp-rule: 'GetTimestamp() for all timestamps'
|
|
5
|
-
architecture: 'Write-Through (JSON → MD → Events)'
|
|
6
|
-
storage-layer: true
|
|
7
|
-
source-of-truth: 'storage/state.json'
|
|
8
|
-
claude-context: 'context/now.md'
|
|
9
|
-
backend-sync: 'sync/pending.json'
|
|
10
3
|
---
|
|
11
4
|
|
|
12
|
-
#
|
|
5
|
+
# p. pause "$ARGUMENTS"
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
User Action → Storage (JSON) → Context (MD) → Sync Events
|
|
7
|
+
```bash
|
|
8
|
+
prjct context pause
|
|
18
9
|
```
|
|
19
10
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
**Backend Sync**: `sync/pending.json` (events)
|
|
11
|
+
IF no `currentTask` → "No active task to pause"
|
|
12
|
+
IF already paused → Show paused state, STOP
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- `{syncPath}`: `{globalPath}/sync/pending.json`
|
|
30
|
-
- `{memoryPath}`: `{globalPath}/memory/events.jsonl`
|
|
31
|
-
- `{reason}`: User-provided reason (optional)
|
|
14
|
+
IF no reason provided, Ask: "Why pausing?"
|
|
15
|
+
- Blocked (waiting on external)
|
|
16
|
+
- Switching task
|
|
17
|
+
- Taking a break
|
|
18
|
+
- Researching
|
|
32
19
|
|
|
33
|
-
|
|
20
|
+
IF blocked → Ask what's blocking
|
|
34
21
|
|
|
35
|
-
|
|
22
|
+
Calculate duration since `startedAt`
|
|
36
23
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
| `switch` | Switching to higher priority task | Context switch metric |
|
|
41
|
-
| `break` | Taking a break | Normal pause |
|
|
42
|
-
| `research` | Need to investigate more | Research time tracked |
|
|
24
|
+
UPDATE `{globalPath}/storage/state.json`:
|
|
25
|
+
- `pausedTask` = currentTask with `status: "paused"`, `pausedAt`, `pauseReason`
|
|
26
|
+
- `currentTask` = null
|
|
43
27
|
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
Why are you pausing?
|
|
47
|
-
1. blocked - Waiting on something external
|
|
48
|
-
2. switch - Starting a different task
|
|
49
|
-
3. break - Taking a break
|
|
50
|
-
4. research - Need to investigate
|
|
28
|
+
**Output**:
|
|
51
29
|
```
|
|
30
|
+
⏸️ Paused: {task}
|
|
52
31
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
READ: `.prjct/prjct.config.json`
|
|
56
|
-
EXTRACT: `projectId`
|
|
57
|
-
|
|
58
|
-
IF file not found:
|
|
59
|
-
OUTPUT: "No prjct project. Run /p:init first."
|
|
60
|
-
STOP
|
|
61
|
-
|
|
62
|
-
## Step 2: Check Current State
|
|
63
|
-
|
|
64
|
-
### Read state.json (source of truth)
|
|
65
|
-
READ: `{statePath}`
|
|
66
|
-
|
|
67
|
-
IF file not found OR no currentTask:
|
|
68
|
-
OUTPUT: "⚠️ No active session to pause. Use /p:now to start one."
|
|
69
|
-
STOP
|
|
70
|
-
|
|
71
|
-
PARSE JSON
|
|
72
|
-
EXTRACT: {currentTask}, {pausedTask}
|
|
73
|
-
|
|
74
|
-
IF {currentTask} is null OR {currentTask.status} != "active":
|
|
75
|
-
IF {pausedTask} exists:
|
|
76
|
-
CALCULATE: {elapsed} = time since {pausedTask.pausedAt}
|
|
77
|
-
OUTPUT:
|
|
78
|
-
```
|
|
79
|
-
⏸️ Already paused: {pausedTask.description}
|
|
80
|
-
|
|
81
|
-
Paused: {elapsed} ago
|
|
82
|
-
Duration so far: {pausedTask.duration}
|
|
83
|
-
Reason: {pausedTask.pauseReason}
|
|
84
|
-
|
|
85
|
-
/p:resume to continue | /p:done to complete
|
|
86
|
-
```
|
|
87
|
-
STOP
|
|
88
|
-
ELSE:
|
|
89
|
-
OUTPUT: "⚠️ No active session to pause."
|
|
90
|
-
STOP
|
|
91
|
-
|
|
92
|
-
## Step 3: Get Pause Reason (AGENTIC)
|
|
93
|
-
|
|
94
|
-
IF {reason} not provided:
|
|
95
|
-
USE AskUserQuestion:
|
|
96
|
-
```
|
|
97
|
-
question: "Why are you pausing '{currentTask.description}'?"
|
|
98
|
-
header: "Pause Reason"
|
|
99
|
-
options:
|
|
100
|
-
- label: "Blocked"
|
|
101
|
-
description: "Waiting on external dependency"
|
|
102
|
-
- label: "Switching task"
|
|
103
|
-
description: "Starting a different, higher priority task"
|
|
104
|
-
- label: "Taking a break"
|
|
105
|
-
description: "Stepping away temporarily"
|
|
106
|
-
- label: "Researching"
|
|
107
|
-
description: "Need to investigate more before continuing"
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
SET: {reason} = choice mapped to (blocked, switch, break, research)
|
|
111
|
-
|
|
112
|
-
IF {reason} == "blocked":
|
|
113
|
-
USE AskUserQuestion:
|
|
114
|
-
```
|
|
115
|
-
question: "What's blocking you?"
|
|
116
|
-
header: "Blocker"
|
|
117
|
-
options:
|
|
118
|
-
- label: "Waiting for review"
|
|
119
|
-
description: "Code review or approval needed"
|
|
120
|
-
- label: "Waiting for API/credentials"
|
|
121
|
-
description: "External access or keys needed"
|
|
122
|
-
- label: "Waiting for clarification"
|
|
123
|
-
description: "Need more info on requirements"
|
|
124
|
-
- label: "Technical blocker"
|
|
125
|
-
description: "Dependency or infrastructure issue"
|
|
126
|
-
```
|
|
127
|
-
SET: {blockerNote} = choice (user can also provide custom text)
|
|
128
|
-
|
|
129
|
-
## Step 4: Calculate Duration So Far
|
|
130
|
-
|
|
131
|
-
SET: {now} = GetTimestamp()
|
|
132
|
-
SET: {durationSeconds} = seconds between {currentTask.startedAt} and {now}
|
|
133
|
-
SET: {durationFormatted} = format as "Xh Ym" or "Xm"
|
|
134
|
-
|
|
135
|
-
## Step 5: Update Storage (SOURCE OF TRUTH)
|
|
136
|
-
|
|
137
|
-
### Prepare paused task
|
|
138
|
-
```json
|
|
139
|
-
{
|
|
140
|
-
"id": "{currentTask.id}",
|
|
141
|
-
"description": "{currentTask.description}",
|
|
142
|
-
"status": "paused",
|
|
143
|
-
"startedAt": "{currentTask.startedAt}",
|
|
144
|
-
"pausedAt": "{now}",
|
|
145
|
-
"sessionId": "{currentTask.sessionId}",
|
|
146
|
-
"duration": {durationSeconds},
|
|
147
|
-
"pauseReason": "{reason}",
|
|
148
|
-
"pauseNote": "{blockerNote}",
|
|
149
|
-
"estimate": "{currentTask.estimate}",
|
|
150
|
-
"estimateSeconds": {currentTask.estimateSeconds},
|
|
151
|
-
"workflow": "{currentTask.workflow}",
|
|
152
|
-
"subtasks": "{currentTask.subtasks}",
|
|
153
|
-
"currentSubtaskIndex": {currentTask.currentSubtaskIndex},
|
|
154
|
-
"branch": "{currentTask.branch}"
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
**Note**: The workflow field is preserved so the task can resume at the correct phase.
|
|
159
|
-
|
|
160
|
-
### Update state.json
|
|
161
|
-
READ: `{statePath}`
|
|
162
|
-
SET: state.pausedTask = paused task object
|
|
163
|
-
SET: state.currentTask = null
|
|
164
|
-
SET: state.lastUpdated = {now}
|
|
165
|
-
WRITE: `{statePath}`
|
|
166
|
-
|
|
167
|
-
## Step 6: Generate Context (FOR CLAUDE)
|
|
168
|
-
|
|
169
|
-
WRITE: `{nowContextPath}`
|
|
170
|
-
|
|
171
|
-
```markdown
|
|
172
|
-
# NOW
|
|
173
|
-
|
|
174
|
-
⏸️ **{currentTask.description}** (paused)
|
|
175
|
-
|
|
176
|
-
Started: {currentTask.startedAt}
|
|
177
|
-
Paused: {now}
|
|
178
|
-
Duration: {durationFormatted}
|
|
32
|
+
Duration: {time}
|
|
179
33
|
Reason: {reason}
|
|
180
|
-
Session: {currentTask.sessionId}
|
|
181
|
-
{IF blockerNote: Note: {blockerNote}}
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
## Step 7: Queue Sync Event (FOR BACKEND)
|
|
185
|
-
|
|
186
|
-
READ: `{syncPath}` or create empty array
|
|
187
|
-
APPEND event:
|
|
188
|
-
```json
|
|
189
|
-
{
|
|
190
|
-
"type": "task.paused",
|
|
191
|
-
"path": ["state"],
|
|
192
|
-
"data": {
|
|
193
|
-
"taskId": "{currentTask.id}",
|
|
194
|
-
"description": "{currentTask.description}",
|
|
195
|
-
"pausedAt": "{now}",
|
|
196
|
-
"duration": {durationSeconds},
|
|
197
|
-
"reason": "{reason}",
|
|
198
|
-
"note": "{blockerNote}"
|
|
199
|
-
},
|
|
200
|
-
"timestamp": "{now}",
|
|
201
|
-
"projectId": "{projectId}"
|
|
202
|
-
}
|
|
203
|
-
```
|
|
204
|
-
WRITE: `{syncPath}`
|
|
205
|
-
|
|
206
|
-
## Step 8: Log to Memory (AUDIT TRAIL)
|
|
207
|
-
|
|
208
|
-
APPEND to: `{memoryPath}`
|
|
209
|
-
|
|
210
|
-
Single line (JSONL):
|
|
211
|
-
```json
|
|
212
|
-
{"timestamp":"{now}","action":"task_paused","taskId":"{currentTask.id}","sessionId":"{currentTask.sessionId}","task":"{currentTask.description}","duration":{durationSeconds},"reason":"{reason}","note":"{blockerNote}"}
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
## Output
|
|
216
|
-
|
|
217
|
-
SUCCESS:
|
|
218
|
-
```
|
|
219
|
-
⏸️ Paused: {currentTask.description}
|
|
220
|
-
|
|
221
|
-
Session: {currentTask.sessionId}
|
|
222
|
-
Active time: {durationFormatted}
|
|
223
|
-
Reason: {reason}
|
|
224
|
-
{IF blockerNote: Note: {blockerNote}}
|
|
225
|
-
|
|
226
|
-
Next:
|
|
227
|
-
• /p:resume - Continue this task
|
|
228
|
-
• /p:now <task> - Start different task
|
|
229
|
-
• /p:done - Complete without resuming
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## Error Handling
|
|
233
|
-
|
|
234
|
-
| Error | Response | Action |
|
|
235
|
-
|-------|----------|--------|
|
|
236
|
-
| No project | "No prjct project" | STOP |
|
|
237
|
-
| No session | "No active session" | STOP |
|
|
238
|
-
| Already paused | Show paused state | STOP |
|
|
239
|
-
| Write fails | Log warning | CONTINUE |
|
|
240
|
-
|
|
241
|
-
## Examples
|
|
242
|
-
|
|
243
|
-
### Example 1: Pause with Blocked Reason
|
|
244
|
-
**Input:** `/p:pause blocked`
|
|
245
|
-
**Prompt:** "What's blocking you?"
|
|
246
|
-
**User:** "Waiting for API credentials from vendor"
|
|
247
|
-
|
|
248
|
-
**Output:**
|
|
249
|
-
```
|
|
250
|
-
⏸️ Paused: implement auth
|
|
251
|
-
|
|
252
|
-
Session: 550e8400-e29b-41d4-a716-446655440000
|
|
253
|
-
Active time: 2h 30m
|
|
254
|
-
Reason: blocked
|
|
255
|
-
Note: Waiting for API credentials from vendor
|
|
256
|
-
|
|
257
|
-
Next:
|
|
258
|
-
• /p:resume - Continue this task
|
|
259
|
-
• /p:now <task> - Start different task
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
### Example 2: Quick Break
|
|
263
|
-
**Input:** `/p:pause break`
|
|
264
|
-
|
|
265
|
-
**Output:**
|
|
266
|
-
```
|
|
267
|
-
⏸️ Paused: implement auth
|
|
268
|
-
|
|
269
|
-
Session: 550e8400-e29b-41d4-a716-446655440000
|
|
270
|
-
Active time: 2h 30m
|
|
271
|
-
Reason: break
|
|
272
|
-
|
|
273
|
-
Next:
|
|
274
|
-
• /p:resume - Continue this task
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### Example 3: Context Switch
|
|
278
|
-
**Input:** `/p:pause switch`
|
|
279
|
-
|
|
280
|
-
**Output:**
|
|
281
|
-
```
|
|
282
|
-
⏸️ Paused: implement auth
|
|
283
|
-
|
|
284
|
-
Session: 550e8400-e29b-41d4-a716-446655440000
|
|
285
|
-
Active time: 2h 30m
|
|
286
|
-
Reason: switch
|
|
287
34
|
|
|
288
35
|
Next:
|
|
289
|
-
|
|
36
|
+
- Resume → `p. resume`
|
|
37
|
+
- New task → `p. task "description"`
|
|
38
|
+
- Complete without resuming → `p. done`
|
|
290
39
|
```
|