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
|
@@ -24,6 +24,100 @@ IF missing: "No prjct project. Run /p:init first." → STOP
|
|
|
24
24
|
|
|
25
25
|
SET: `{globalPath}` = `~/.prjct-cli/projects/{projectId}`
|
|
26
26
|
|
|
27
|
+
### Step 1.5: Validate Workflow Phase
|
|
28
|
+
|
|
29
|
+
READ: `{globalPath}/storage/state.json`
|
|
30
|
+
|
|
31
|
+
IF currentTask exists AND currentTask.workflow exists:
|
|
32
|
+
IF currentTask.workflow.phase != "merge":
|
|
33
|
+
OUTPUT:
|
|
34
|
+
```
|
|
35
|
+
Cannot ship. Current phase: {currentTask.workflow.phase}
|
|
36
|
+
|
|
37
|
+
Required phase: merge
|
|
38
|
+
|
|
39
|
+
Workflow: analyze → branch → implement → test → review → merge → ship → verify
|
|
40
|
+
|
|
41
|
+
Complete previous phases first:
|
|
42
|
+
- p. test (if in implement)
|
|
43
|
+
- p. review (if in test)
|
|
44
|
+
- p. merge (if in review)
|
|
45
|
+
```
|
|
46
|
+
STOP
|
|
47
|
+
|
|
48
|
+
### Step 1.6: Validate Open Tasks (AGENTIC)
|
|
49
|
+
|
|
50
|
+
IF currentTask exists AND status == "active":
|
|
51
|
+
SET: {openTaskDescription} = currentTask.description
|
|
52
|
+
SET: {elapsedTime} = time since currentTask.startedAt (format: "Xh Ym" or "Xm")
|
|
53
|
+
|
|
54
|
+
### Check for related subtasks
|
|
55
|
+
IF currentTask.subtasks exists:
|
|
56
|
+
SET: {pendingSubtasks} = subtasks where status == "pending"
|
|
57
|
+
SET: {pendingCount} = {pendingSubtasks}.length + 1 # +1 for current
|
|
58
|
+
ELSE:
|
|
59
|
+
SET: {pendingCount} = 1
|
|
60
|
+
|
|
61
|
+
USE AskUserQuestion:
|
|
62
|
+
```
|
|
63
|
+
question: "Active task: '{openTaskDescription}' ({elapsedTime}). {pendingCount} task(s) open. Ship anyway?"
|
|
64
|
+
header: "Open Tasks"
|
|
65
|
+
options:
|
|
66
|
+
- label: "Complete all and ship"
|
|
67
|
+
description: "Mark {pendingCount} task(s) as done, then ship"
|
|
68
|
+
- label: "Complete current only"
|
|
69
|
+
description: "Finish '{openTaskDescription}', ship now"
|
|
70
|
+
- label: "Cancel"
|
|
71
|
+
description: "Return to work, ship later"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
IF choice == "Cancel":
|
|
75
|
+
OUTPUT: "Ship cancelled. Continue working on: {openTaskDescription}"
|
|
76
|
+
STOP
|
|
77
|
+
|
|
78
|
+
IF choice == "Complete all and ship":
|
|
79
|
+
### Mark all subtasks complete
|
|
80
|
+
IF currentTask.subtasks exists:
|
|
81
|
+
SET: {now} = GetTimestamp()
|
|
82
|
+
FOR each subtask in currentTask.subtasks:
|
|
83
|
+
IF subtask.status != "completed":
|
|
84
|
+
SET: subtask.status = "completed"
|
|
85
|
+
SET: subtask.completedAt = "{now}"
|
|
86
|
+
|
|
87
|
+
### Mark current task complete
|
|
88
|
+
SET: {now} = GetTimestamp()
|
|
89
|
+
SET: previousTask = {
|
|
90
|
+
...currentTask,
|
|
91
|
+
"status": "completed",
|
|
92
|
+
"completedAt": "{now}"
|
|
93
|
+
}
|
|
94
|
+
SET: currentTask = null
|
|
95
|
+
WRITE: `{globalPath}/storage/state.json`
|
|
96
|
+
|
|
97
|
+
APPEND to `{globalPath}/memory/events.jsonl`:
|
|
98
|
+
```json
|
|
99
|
+
{"timestamp":"{now}","action":"task_auto_completed","reason":"ship","taskId":"{previousTask.id}"}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
OUTPUT: "✅ Completed: {openTaskDescription}"
|
|
103
|
+
|
|
104
|
+
IF choice == "Complete current only":
|
|
105
|
+
SET: {now} = GetTimestamp()
|
|
106
|
+
SET: previousTask = {
|
|
107
|
+
...currentTask,
|
|
108
|
+
"status": "completed",
|
|
109
|
+
"completedAt": "{now}"
|
|
110
|
+
}
|
|
111
|
+
SET: currentTask = null
|
|
112
|
+
WRITE: `{globalPath}/storage/state.json`
|
|
113
|
+
|
|
114
|
+
APPEND to `{globalPath}/memory/events.jsonl`:
|
|
115
|
+
```json
|
|
116
|
+
{"timestamp":"{now}","action":"task_auto_completed","reason":"ship","taskId":"{previousTask.id}"}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
OUTPUT: "✅ Completed: {openTaskDescription}"
|
|
120
|
+
|
|
27
121
|
### Step 2: Pre-flight Checks
|
|
28
122
|
|
|
29
123
|
#### 2.1 Check for changes
|
|
@@ -178,14 +272,26 @@ IF {branchName} == "main" OR {branchName} == "master":
|
|
|
178
272
|
STOP
|
|
179
273
|
|
|
180
274
|
#### 7.4 Commit Changes
|
|
275
|
+
|
|
276
|
+
**CRITICAL: Include BOTH prjct footer AND Claude Code Co-Author**
|
|
277
|
+
|
|
181
278
|
BASH: `git add .`
|
|
182
|
-
|
|
279
|
+
|
|
280
|
+
BASH: `git commit -m "$(cat <<'EOF'
|
|
281
|
+
feat: {feature}
|
|
183
282
|
|
|
184
283
|
{code review summary if any issues were found}
|
|
185
284
|
|
|
186
285
|
🤖 Generated with [p/](https://www.prjct.app/)
|
|
187
286
|
Designed for [Claude](https://www.anthropic.com/claude)
|
|
188
|
-
|
|
287
|
+
|
|
288
|
+
EOF
|
|
289
|
+
)"`
|
|
290
|
+
|
|
291
|
+
**The commit MUST include:**
|
|
292
|
+
1. `🤖 Generated with [p/](https://www.prjct.app/)` - prjct signature (REQUIRED)
|
|
293
|
+
2. `Designed for [Claude](https://www.anthropic.com/claude)` - attribution
|
|
294
|
+
3. `Co-Authored-By: Claude <noreply@anthropic.com>` - Claude Code standard
|
|
189
295
|
|
|
190
296
|
#### 7.5 Push Branch
|
|
191
297
|
BASH: `git push -u origin {branchName}`
|
|
@@ -302,42 +408,101 @@ IF currentTask:
|
|
|
302
408
|
```
|
|
303
409
|
WRITE: `{globalPath}/storage/state.json`
|
|
304
410
|
|
|
305
|
-
### Step 8: Update Storage
|
|
411
|
+
### Step 8: Update Storage and Workflow Checkpoints
|
|
306
412
|
GET timestamp: `bun -e "console.log(new Date().toISOString())" 2>/dev/null || node -e "console.log(new Date().toISOString())"`
|
|
307
413
|
GET uuid: `bun -e "console.log(crypto.randomUUID())" 2>/dev/null || node -e "console.log(require('crypto').randomUUID())"`
|
|
308
414
|
|
|
415
|
+
SET: {now} = timestamp
|
|
416
|
+
SET: {shippedId} = uuid
|
|
417
|
+
|
|
418
|
+
### 8.1 Update Workflow Checkpoints (if workflow exists)
|
|
419
|
+
READ: `{globalPath}/storage/state.json`
|
|
420
|
+
|
|
421
|
+
IF currentTask AND currentTask.workflow exists:
|
|
422
|
+
SET: currentTask.workflow.phase = "register"
|
|
423
|
+
|
|
424
|
+
### Set tag checkpoint
|
|
425
|
+
SET: currentTask.workflow.checkpoints.tag = {
|
|
426
|
+
"completedAt": "{now}",
|
|
427
|
+
"data": { "version": "{newVersion}", "tagName": "v{newVersion}" }
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
### Set release checkpoint
|
|
431
|
+
SET: currentTask.workflow.checkpoints.release = {
|
|
432
|
+
"completedAt": "{now}",
|
|
433
|
+
"data": { "prUrl": "{prUrl}", "prNumber": {prNumber} }
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
### Set deploy checkpoint (manual reminder)
|
|
437
|
+
SET: currentTask.workflow.checkpoints.deploy = {
|
|
438
|
+
"completedAt": "{now}",
|
|
439
|
+
"data": { "reminded": true, "manual": true }
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
### Set register checkpoint
|
|
443
|
+
SET: currentTask.workflow.checkpoints.register = {
|
|
444
|
+
"completedAt": "{now}",
|
|
445
|
+
"data": { "shippedId": "{shippedId}", "version": "{newVersion}" }
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
SET: currentTask.workflow.lastCheckpoint = "register"
|
|
449
|
+
|
|
450
|
+
WRITE: `{globalPath}/storage/state.json`
|
|
451
|
+
|
|
452
|
+
### Log workflow events
|
|
453
|
+
APPEND to `{globalPath}/memory/events.jsonl`:
|
|
454
|
+
```json
|
|
455
|
+
{"timestamp":"{now}","action":"phase_advanced","taskId":"{currentTask.id}","from":"merge","to":"register"}
|
|
456
|
+
{"timestamp":"{now}","action":"checkpoint_completed","taskId":"{currentTask.id}","checkpoint":"tag","data":{"version":"{newVersion}"}}
|
|
457
|
+
{"timestamp":"{now}","action":"checkpoint_completed","taskId":"{currentTask.id}","checkpoint":"release"}
|
|
458
|
+
{"timestamp":"{now}","action":"checkpoint_completed","taskId":"{currentTask.id}","checkpoint":"deploy"}
|
|
459
|
+
{"timestamp":"{now}","action":"checkpoint_completed","taskId":"{currentTask.id}","checkpoint":"register"}
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### 8.2 Update shipped.json
|
|
309
463
|
READ: `{globalPath}/storage/shipped.json` (or create default)
|
|
310
464
|
PREPEND new ship object:
|
|
311
465
|
```json
|
|
312
466
|
{
|
|
313
|
-
"id": "{
|
|
467
|
+
"id": "{shippedId}",
|
|
314
468
|
"name": "{feature}",
|
|
315
469
|
"version": "{newVersion}",
|
|
316
|
-
"shippedAt": "{
|
|
470
|
+
"shippedAt": "{now}",
|
|
317
471
|
"lint": "{lintStatus}",
|
|
318
472
|
"tests": "{testStatus}",
|
|
319
473
|
"branch": "{branchName}",
|
|
320
474
|
"prUrl": "{prUrl}",
|
|
321
475
|
"prNumber": {prNumber},
|
|
322
|
-
"ciStatus": "{ciStatus}"
|
|
476
|
+
"ciStatus": "{ciStatus}",
|
|
477
|
+
"taskId": "{currentTask.id}"
|
|
323
478
|
}
|
|
324
479
|
```
|
|
325
480
|
WRITE: `{globalPath}/storage/shipped.json`
|
|
326
481
|
|
|
327
|
-
Generate context
|
|
482
|
+
### 8.3 Generate context
|
|
328
483
|
WRITE: `{globalPath}/context/shipped.md`
|
|
329
484
|
|
|
330
|
-
Queue sync event
|
|
331
|
-
APPEND to `{globalPath}/sync/pending.json
|
|
485
|
+
### 8.4 Queue sync event
|
|
486
|
+
APPEND to `{globalPath}/sync/pending.json`:
|
|
487
|
+
```json
|
|
488
|
+
{"type":"feature.shipped","data":{"taskId":"{currentTask.id}","version":"{newVersion}","prUrl":"{prUrl}"},"timestamp":"{now}"}
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
### 8.5 Deploy reminder
|
|
492
|
+
OUTPUT:
|
|
493
|
+
```
|
|
494
|
+
📦 Deploy Reminder
|
|
495
|
+
|
|
496
|
+
Version {newVersion} is ready to deploy.
|
|
332
497
|
|
|
333
|
-
|
|
334
|
-
|
|
498
|
+
Remember to deploy to your platform when ready.
|
|
499
|
+
```
|
|
335
500
|
|
|
336
501
|
### Step 9: Output
|
|
337
502
|
|
|
338
503
|
IF {ciStatus} == "passed":
|
|
339
504
|
```
|
|
340
|
-
🚀
|
|
505
|
+
🚀 Shipped: {feature}
|
|
341
506
|
|
|
342
507
|
Version: {oldVersion} → {newVersion}
|
|
343
508
|
Changes: {changeType} ({totalLines} lines in {filesChanged} files)
|
|
@@ -346,11 +511,22 @@ CI: ✅ Passed
|
|
|
346
511
|
|
|
347
512
|
📎 PR: {prUrl}
|
|
348
513
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
514
|
+
Phase: register (10/11 checkpoints)
|
|
515
|
+
|
|
516
|
+
Workflow:
|
|
517
|
+
1. analyze ✓
|
|
518
|
+
2. branch ✓
|
|
519
|
+
3. implement ✓
|
|
520
|
+
4. test ✓
|
|
521
|
+
5. review ✓
|
|
522
|
+
6. merge ✓
|
|
523
|
+
7. tag ✓ - v{newVersion}
|
|
524
|
+
8. release ✓
|
|
525
|
+
9. deploy ✓ - (manual)
|
|
526
|
+
10. register ✓
|
|
527
|
+
11. verify ← next
|
|
528
|
+
|
|
529
|
+
Next: p. verify to complete workflow
|
|
354
530
|
```
|
|
355
531
|
|
|
356
532
|
IF {ciStatus} == "failed":
|