prjct-cli 0.57.0 → 0.58.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.58.0] - 2026-02-05
4
+
5
+ ### Features
6
+
7
+ - complete Linear/JIRA workflow integration (#95)
8
+
9
+
3
10
  ## [0.57.0] - 2026-02-05
4
11
 
5
12
  ### Features
@@ -25841,7 +25841,7 @@ var require_package = __commonJS({
25841
25841
  "package.json"(exports, module) {
25842
25842
  module.exports = {
25843
25843
  name: "prjct-cli",
25844
- version: "0.57.0",
25844
+ version: "0.58.0",
25845
25845
  description: "Context layer for AI agents. Project context for Claude Code, Gemini CLI, and more.",
25846
25846
  main: "core/index.ts",
25847
25847
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prjct-cli",
3
- "version": "0.57.0",
3
+ "version": "0.58.0",
4
4
  "description": "Context layer for AI agents. Project context for Claude Code, Gemini CLI, and more.",
5
5
  "main": "core/index.ts",
6
6
  "bin": {
@@ -114,18 +114,31 @@ WRITE `{globalPath}/storage/state.json`:
114
114
  }
115
115
  ```
116
116
 
117
- ## Step 5: Sync Issue Tracker Status
117
+ ## Step 5: Sync Issue Tracker Status (REQUIRED - DO NOT SKIP)
118
+
119
+ **⛔ This step is MANDATORY if there's a linked issue.**
120
+
121
+ ```bash
122
+ # Get projectId
123
+ PROJ_ID=$(cat .prjct/prjct.config.json | grep -o '"projectId"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4)
124
+ ```
118
125
 
119
126
  ```
120
127
  IF previousTask.linearId exists:
121
- # Update Linear issue to Done
122
- RUN: bun $PRJCT_CLI/core/cli/linear.ts --project {projectId} status "{linearId}" "done"
123
- OUTPUT: "Linear: {linearId} → Done"
128
+ # Mark issue as Done in Linear (REQUIRED)
129
+ RUN: bun $PRJCT_CLI/core/cli/linear.ts --project $PROJ_ID done "{linearId}"
130
+
131
+ # Add completion comment with summary
132
+ RUN: bun $PRJCT_CLI/core/cli/linear.ts --project $PROJ_ID comment "{linearId}" "✅ Task completed. Ready for ship."
133
+
134
+ OUTPUT: "Linear: {linearId} → Done ✓"
124
135
 
125
136
  ELSE IF previousTask.externalId AND previousTask.externalProvider == "jira":
126
- # Update JIRA issue to Done
127
- RUN: bun $PRJCT_CLI/core/cli/jira.ts --project {projectId} status "{externalId}" "done"
128
- OUTPUT: "JIRA: {externalId} Done"
137
+ # Transition to Done in JIRA (REQUIRED)
138
+ RUN: bun $PRJCT_CLI/core/cli/jira.ts --project $PROJ_ID transition "{externalId}" "Done"
139
+ RUN: bun $PRJCT_CLI/core/cli/jira.ts --project $PROJ_ID comment "{externalId}" "✅ Task completed. Ready for ship."
140
+
141
+ OUTPUT: "JIRA: {externalId} → Done ✓"
129
142
  ```
130
143
 
131
144
  ## Step 6: Log Event
@@ -132,12 +132,59 @@ git pull origin main
132
132
 
133
133
  ---
134
134
 
135
- ### STEP 7: Update Linear (if applicable)
135
+ ### STEP 7: Update Issue Tracker (REQUIRED - DO NOT SKIP)
136
136
 
137
- IF `currentTask.linearId`:
137
+ **⛔ This step is MANDATORY if there's a linked issue.**
138
+
139
+ ```
140
+ READ: {globalPath}/storage/state.json
141
+ GET: currentTask.linearId, currentTask.jiraId
142
+ ```
143
+
144
+ **IF linearId exists:**
145
+ ```bash
146
+ # Get projectId
147
+ PROJ_ID=$(cat .prjct/prjct.config.json | grep -o '"projectId"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4)
148
+
149
+ # Mark issue as Done in Linear (REQUIRED)
150
+ bun $PRJCT_CLI/core/cli/linear.ts --project $PROJ_ID done "{linearId}"
151
+
152
+ # Add completion comment
153
+ bun $PRJCT_CLI/core/cli/linear.ts --project $PROJ_ID comment "{linearId}" "✅ PR #{prNumber} merged and released"
154
+
155
+ OUTPUT: "Linear: {linearId} → Done ✓"
156
+ ```
157
+
158
+ **IF jiraId exists:**
159
+ ```bash
160
+ # Transition to Done in JIRA (REQUIRED)
161
+ bun $PRJCT_CLI/core/cli/jira.ts --project $PROJ_ID transition "{jiraId}" "Done"
162
+ bun $PRJCT_CLI/core/cli/jira.ts --project $PROJ_ID comment "{jiraId}" "✅ PR #{prNumber} merged and released"
163
+
164
+ OUTPUT: "JIRA: {jiraId} → Done ✓"
138
165
  ```
139
- Update Linear issue status to "Done" or "Merged"
140
- Add comment: "PR #{prNumber} merged"
166
+
167
+ **IF no issue tracker linked:**
168
+ ```
169
+ OUTPUT: "No issue tracker linked."
170
+ ```
171
+
172
+ ---
173
+
174
+ ### STEP 8: Complete Task State
175
+
176
+ ```
177
+ UPDATE: {globalPath}/storage/state.json
178
+
179
+ SET: previousTask = currentTask
180
+ SET: previousTask.status = "completed"
181
+ SET: previousTask.completedAt = {timestamp}
182
+ SET: currentTask = null
183
+ ```
184
+
185
+ APPEND to `{globalPath}/memory/events.jsonl`:
186
+ ```json
187
+ {"type":"task_completed","taskId":"{id}","linearId":"{linearId}","prNumber":"{prNumber}","timestamp":"{timestamp}"}
141
188
  ```
142
189
 
143
190
  ---
@@ -10,17 +10,58 @@ allowed-tools: [Read, Write, Bash, AskUserQuestion]
10
10
 
11
11
  ---
12
12
 
13
- ### STEP 1: Pre-flight Checks (BLOCKING)
13
+ ### STEP 0: Resolve Project Context
14
+
15
+ ```bash
16
+ # Get projectId from local config
17
+ cat .prjct/prjct.config.json 2>/dev/null | grep -o '"projectId"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4
18
+ ```
19
+
20
+ Set `globalPath = ~/.prjct-cli/projects/{projectId}`
21
+
22
+ READ: `{globalPath}/storage/state.json` to get current task info (linearId, description, etc.)
23
+
24
+ ---
25
+
26
+ ### STEP 1: Pre-flight Checks
14
27
 
15
28
  ```bash
16
29
  # 1a. Check current branch
17
30
  BRANCH=$(git branch --show-current)
18
31
  ```
19
32
 
20
- **⛔ IF branch is `main` or `master`:**
33
+ **IF branch is `main` or `master`:**
34
+
35
+ ```bash
36
+ # Check if there's a recent merge (within last commit)
37
+ git log -1 --pretty=format:"%s" | head -1
21
38
  ```
22
- STOP. DO NOT PROCEED.
23
- Tell user: "Cannot ship from main branch. Create a feature branch first."
39
+
40
+ **IF last commit is a merge/squash from a PR:**
41
+ ```
42
+ # This is POST-MERGE state - user wants to finalize/release
43
+ OUTPUT: "Detected: Already on main after merge."
44
+ OUTPUT: "Checking for pending release..."
45
+
46
+ # Check if version was already bumped by CI
47
+ npm view prjct-cli version 2>/dev/null
48
+ node -p "require('./package.json').version"
49
+
50
+ IF npm version >= package.json version:
51
+ OUTPUT: "✅ Already released: v{version}"
52
+ OUTPUT: "npm: prjct-cli@{version}"
53
+ GOTO: STEP 8 (Update Issue Tracker)
54
+ ELSE:
55
+ OUTPUT: "Triggering release workflow..."
56
+ # CI handles the release on push to main
57
+ OUTPUT: "Release will be handled by CI workflow."
58
+ GOTO: STEP 8 (Update Issue Tracker)
59
+ ```
60
+
61
+ **IF no recent merge (user is trying to ship from main):**
62
+ ```
63
+ ⛔ STOP. DO NOT PROCEED.
64
+ Tell user: "Cannot ship from main branch. Create a feature branch first: git checkout -b feature/your-feature"
24
65
  ABORT the ship command entirely.
25
66
  ```
26
67
 
@@ -37,11 +78,12 @@ ABORT the ship command entirely.
37
78
  ```
38
79
 
39
80
  ```bash
40
- # 1c. Check for changes
81
+ # 1c. Check for changes (only if on feature branch)
41
82
  git status --porcelain
83
+ git diff --stat HEAD~1..HEAD 2>/dev/null || git diff --stat
42
84
  ```
43
85
 
44
- **⛔ IF no changes:**
86
+ **⛔ IF no changes AND on feature branch:**
45
87
  ```
46
88
  STOP. DO NOT PROCEED.
47
89
  Tell user: "No changes to ship."
@@ -50,7 +92,72 @@ ABORT the ship command entirely.
50
92
 
51
93
  ---
52
94
 
53
- ### STEP 2: Show Plan and Get Approval (BLOCKING)
95
+ ### STEP 2: Gather Ship Documentation (MANDATORY)
96
+
97
+ **⛔ This step is NON-NEGOTIABLE. Every ship MUST have documentation.**
98
+
99
+ ```
100
+ AskUserQuestion:
101
+ question: "Describe what was implemented in this feature"
102
+ header: "Implementation"
103
+ options:
104
+ - label: "Provide description"
105
+ description: "Describe the implementation details"
106
+ ```
107
+
108
+ SAVE the implementation description.
109
+
110
+ ```
111
+ AskUserQuestion:
112
+ question: "What did you learn while implementing this?"
113
+ header: "Learnings"
114
+ options:
115
+ - label: "Add learnings"
116
+ description: "Patterns discovered, gotchas, insights"
117
+ - label: "No specific learnings"
118
+ description: "Skip this section"
119
+ ```
120
+
121
+ SAVE the learnings (if any).
122
+
123
+ ---
124
+
125
+ ### STEP 3: Generate QA Test Plan (MANDATORY)
126
+
127
+ **⛔ Every ship MUST include test steps. NO EXCEPTIONS.**
128
+
129
+ Based on the changes, generate:
130
+
131
+ ```markdown
132
+ ## Test Plan
133
+
134
+ ### For QA Team
135
+ 1. [Specific step to test feature]
136
+ 2. [Expected behavior]
137
+ 3. [Edge cases to verify]
138
+
139
+ ### For End Users
140
+ **What changed:** [User-facing description]
141
+ **How to use:** [Steps to use the new feature]
142
+ **Breaking changes:** [Any breaking changes, or "None"]
143
+ ```
144
+
145
+ Show user the generated test plan and ask for approval:
146
+
147
+ ```
148
+ AskUserQuestion:
149
+ question: "Is this test plan accurate?"
150
+ header: "Test Plan"
151
+ options:
152
+ - label: "Yes, looks good"
153
+ description: "Proceed with this test plan"
154
+ - label: "Modify test plan"
155
+ description: "Edit the test steps"
156
+ ```
157
+
158
+ ---
159
+
160
+ ### STEP 4: Show Ship Plan and Get Approval (BLOCKING)
54
161
 
55
162
  **⛔ DO NOT execute any commits/pushes until user explicitly approves.**
56
163
 
@@ -59,16 +166,21 @@ Show the user:
59
166
  ## Ship Plan
60
167
 
61
168
  Branch: {branch}
62
- Changes:
63
- {git diff --stat}
169
+ Changes: {git diff --stat}
170
+
171
+ Documentation:
172
+ - Implementation: {summary}
173
+ - Learnings: {summary or "None"}
174
+ - Test Plan: {summary}
64
175
 
65
176
  Will do:
66
177
  1. Run tests (if configured)
67
178
  2. Bump version (patch/minor/major)
68
- 3. Update CHANGELOG.md
179
+ 3. Update CHANGELOG.md with full documentation
69
180
  4. Commit with prjct footer
70
181
  5. Push branch
71
- 6. Create PR to main
182
+ 6. Create PR to main with test plan
183
+ 7. Update Linear/JIRA status to "In Review"
72
184
  ```
73
185
 
74
186
  Then ask for confirmation:
@@ -99,11 +211,11 @@ STOP - Do not continue
99
211
  ```
100
212
 
101
213
  **If "Yes, ship it":**
102
- CONTINUE to Step 3
214
+ CONTINUE to Step 5
103
215
 
104
216
  ---
105
217
 
106
- ### STEP 3: Quality Checks
218
+ ### STEP 5: Quality Checks
107
219
 
108
220
  ```bash
109
221
  # Run tests if package.json has test script
@@ -112,12 +224,12 @@ npm test 2>/dev/null || bun test 2>/dev/null || echo "No tests configured"
112
224
 
113
225
  ```bash
114
226
  # Run lint if configured
115
- npm run lint 2>/dev/null || echo "No lint configured"
227
+ npm run lint 2>/dev/null || npm run check 2>/dev/null || echo "No lint configured"
116
228
  ```
117
229
 
118
230
  ---
119
231
 
120
- ### STEP 4: Version Bump (REQUIRED)
232
+ ### STEP 6: Version Bump (REQUIRED)
121
233
 
122
234
  Determine version bump type:
123
235
  - `fix:` commits → **patch** (0.0.X)
@@ -134,19 +246,34 @@ OLD_VERSION=$(node -p "require('./package.json').version")
134
246
 
135
247
  ---
136
248
 
137
- ### STEP 5: Update CHANGELOG.md (REQUIRED)
249
+ ### STEP 7: Update CHANGELOG.md (REQUIRED - FULL DOCUMENTATION)
250
+
251
+ Add entry at top of CHANGELOG.md with COMPLETE documentation:
138
252
 
139
- Add entry at top of CHANGELOG.md:
140
253
  ```markdown
141
254
  ## [X.X.X] - YYYY-MM-DD
142
255
 
143
- ### {Fixed/Added/Changed}
144
- - {description of changes}
256
+ ### {Features/Bug Fixes/Changed}
257
+ - **{Feature name}**: {description}
258
+
259
+ ### Implementation Details
260
+ {implementation description from Step 2}
261
+
262
+ ### Learnings
263
+ {learnings from Step 2, or omit if none}
264
+
265
+ ### Test Plan
266
+
267
+ #### For QA
268
+ {QA test steps from Step 3}
269
+
270
+ #### For Users
271
+ {User-facing changes from Step 3}
145
272
  ```
146
273
 
147
274
  ---
148
275
 
149
- ### STEP 6: Commit (REQUIRED FORMAT)
276
+ ### STEP 8: Commit (REQUIRED FORMAT)
150
277
 
151
278
  ```bash
152
279
  git add .
@@ -155,6 +282,9 @@ git commit -m "$(cat <<'EOF'
155
282
 
156
283
  {body if needed}
157
284
 
285
+ Implementation: {brief summary}
286
+ Test: {how to test}
287
+
158
288
  Generated with [p/](https://www.prjct.app/)
159
289
  EOF
160
290
  )"
@@ -164,20 +294,32 @@ EOF
164
294
 
165
295
  ---
166
296
 
167
- ### STEP 7: Push and Create PR (REQUIRED)
297
+ ### STEP 9: Push and Create PR (REQUIRED)
168
298
 
169
299
  ```bash
170
300
  git push -u origin {branch}
171
301
  gh pr create --title "{type}: {description}" --base main --body "$(cat <<'EOF'
172
302
  ## Summary
173
- {bullet points}
303
+ {bullet points of what changed}
304
+
305
+ ## Implementation
306
+ {implementation details from Step 2}
174
307
 
175
308
  ## Changes
176
- {what changed}
309
+ {list of files/modules affected}
177
310
 
178
311
  ## Test Plan
179
- {how to verify}
180
312
 
313
+ ### For QA
314
+ {QA test steps}
315
+
316
+ ### For Users
317
+ {User-facing documentation}
318
+
319
+ ## Learnings
320
+ {learnings, if any}
321
+
322
+ ---
181
323
  Generated with [p/](https://www.prjct.app/)
182
324
  EOF
183
325
  )"
@@ -185,11 +327,78 @@ EOF
185
327
 
186
328
  ---
187
329
 
188
- ### STEP 8: Update Linear/Issue Tracker (if applicable)
330
+ ### STEP 10: Update Issue Tracker (REQUIRED - DO NOT SKIP)
331
+
332
+ **⛔ This step is MANDATORY if there's a linked issue.**
333
+
334
+ ```
335
+ READ: {globalPath}/storage/state.json
336
+ GET: linearId or jiraId from currentTask
337
+ ```
338
+
339
+ **IF linearId exists:**
340
+ ```bash
341
+ # Get projectId
342
+ PROJ_ID=$(cat .prjct/prjct.config.json | grep -o '"projectId"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4)
343
+
344
+ # Add implementation comment to Linear issue
345
+ bun $PRJCT_CLI/core/cli/linear.ts --project $PROJ_ID comment "{linearId}" "$(cat <<'EOF'
346
+ ## Implementation Complete
347
+
348
+ **PR:** {pr_url}
349
+ **Branch:** {branch}
350
+
351
+ ### What was implemented
352
+ {implementation details}
353
+
354
+ ### How to test
355
+ {test steps for QA}
356
+
357
+ ### For users
358
+ {user-facing changes}
359
+
360
+ ### Learnings
361
+ {learnings}
362
+ EOF
363
+ )"
364
+
365
+ # Mark issue as Done (if PR was merged) or In Review (if PR is open)
366
+ IF on main branch (post-merge):
367
+ bun $PRJCT_CLI/core/cli/linear.ts --project $PROJ_ID done "{linearId}"
368
+ OUTPUT: "Linear: {linearId} → Done ✓"
369
+ ELSE:
370
+ # Issue stays In Progress, PR link added as comment
371
+ OUTPUT: "Linear: {linearId} - Comment added with PR link"
372
+ ```
373
+
374
+ **IF jiraId exists:**
375
+ ```bash
376
+ # Similar flow for JIRA
377
+ bun $PRJCT_CLI/core/cli/jira.ts --project $PROJ_ID comment "{jiraId}" "PR: {pr_url}"
378
+ bun $PRJCT_CLI/core/cli/jira.ts --project $PROJ_ID transition "{jiraId}" "In Review"
379
+ OUTPUT: "JIRA: {jiraId} → In Review ✓"
380
+ ```
381
+
382
+ **IF no issue tracker configured:**
383
+ ```
384
+ OUTPUT: "No issue tracker linked. Consider using `p. linear setup` for better tracking."
385
+ ```
386
+
387
+ ---
388
+
389
+ ### STEP 11: Update Local State
189
390
 
190
- If task has `linearId`:
191
- - Update issue status to "In Review" or appropriate state
192
- - Add comment with PR link
391
+ ```
392
+ UPDATE: {globalPath}/storage/state.json
393
+ SET: currentTask.status = "shipped" (if PR merged) or "in_review" (if PR open)
394
+ SET: currentTask.shippedAt = {timestamp}
395
+ SET: currentTask.prUrl = {pr_url}
396
+ ```
397
+
398
+ APPEND to `{globalPath}/memory/events.jsonl`:
399
+ ```json
400
+ {"type":"task_shipped","taskId":"{id}","linearId":"{linearId}","prUrl":"{pr_url}","version":"{version}","timestamp":"{timestamp}"}
401
+ ```
193
402
 
194
403
  ---
195
404
 
@@ -201,10 +410,16 @@ If task has `linearId`:
201
410
  Version: {old} → {new}
202
411
  PR: {url}
203
412
  Branch: {branch}
413
+ {linearId ? "Linear: {linearId} → In Review ✓" : ""}
414
+
415
+ Documentation:
416
+ - Implementation: ✓
417
+ - Test Plan: ✓
418
+ - Learnings: ✓
204
419
 
205
420
  Next:
206
421
  - Review PR → {url}
207
- - Merge when ready `p. merge`
422
+ - After mergeIssues auto-updated to Done
208
423
  ```
209
424
 
210
425
  ---
@@ -220,5 +435,8 @@ Common violations:
220
435
  - ❌ Skipping CHANGELOG update
221
436
  - ❌ Not waiting for user approval
222
437
  - ❌ Missing prjct footer in commit
438
+ - ❌ **Skipping test plan documentation**
439
+ - ❌ **Not updating Linear/JIRA status**
440
+ - ❌ **Not adding implementation comments to issues**
223
441
 
224
442
  **These violations make prjct useless. Follow the workflow.**
@@ -96,11 +96,11 @@ IF integrations.linear.enabled:
96
96
  SET: task.description = issue.title
97
97
  SET: $ARGUMENTS = issue.title # Use title for task
98
98
 
99
- # Mark issue as In Progress in Linear
100
- RUN: bun $PRJCT_CLI/core/cli/linear.ts --project {projectId} status "$ARGUMENTS" "in_progress"
99
+ # Mark issue as In Progress in Linear (REQUIRED - DO NOT SKIP)
100
+ RUN: bun $PRJCT_CLI/core/cli/linear.ts --project {projectId} start "{task.linearId}"
101
101
 
102
102
  OUTPUT: "Linked to Linear: {issue.identifier} - {issue.title}"
103
- OUTPUT: "Linear: In Progress"
103
+ OUTPUT: "Linear: In Progress"
104
104
 
105
105
  ELSE IF integrations.jira.enabled:
106
106
  # JIRA issue detected