@softdesignbrasil/productdock-cli 0.14.0 → 0.15.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.
Files changed (3) hide show
  1. package/README.md +236 -188
  2. package/dist/productdock.js +95 -88
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -234,16 +234,16 @@ Nothing is written until every decision is made: a `link` that fails leaves the
234
234
  directory exactly as it was, instead of a `productdock.json` carrying only the
235
235
  project.
236
236
 
237
- | Flag | Description |
238
- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
239
- | `--project-id <uuid>` | Skip interactive project selection |
240
- | `--repository-id <uuid>` | Skip interactive repository selection; refused when the id is not in the project |
237
+ | Flag | Description |
238
+ | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
239
+ | `--project-id <uuid>` | Skip interactive project selection |
240
+ | `--repository-id <uuid>` | Skip interactive repository selection; refused when the id is not in the project |
241
241
  | `--ide <ide>` | IDE to configure — `claude-code`, `cursor`, `vscode`, `claude-desktop` (repeatable). Added to the IDEs already in `productdock.json` (never replaces what `productdock init` wrote); without a prior `init`, it stands in for it |
242
- | `--install-mcp` | Install the MCP configuration without asking |
243
- | `--no-install-mcp` | Do not install the MCP configuration |
244
- | `--install-skills` | Install skills and agents without asking |
245
- | `--no-install-skills` | Do not install skills or agents |
246
- | `-y, --yes` | Answer yes to every confirmation |
242
+ | `--install-mcp` | Install the MCP configuration without asking |
243
+ | `--no-install-mcp` | Do not install the MCP configuration |
244
+ | `--install-skills` | Install skills and agents without asking |
245
+ | `--no-install-skills` | Do not install skills or agents |
246
+ | `-y, --yes` | Answer yes to every confirmation |
247
247
 
248
248
  Under `--json` the response document reports the resulting state of the link —
249
249
  project, repository (`null` when none was bound), IDEs, and whether the MCP and
@@ -330,12 +330,39 @@ productdock skill status
330
330
  productdock agent status
331
331
  ```
332
332
 
333
- | Subcommand | Description |
334
- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
335
- | `list` | List what the registry offers. `--source internal\|third-party\|productdock` |
333
+ | Subcommand | Description |
334
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
335
+ | `list` | List what the registry offers. `--source internal\|third-party\|productdock` |
336
336
  | `install [name]` | Install into every target derived from `productdock.json` — one item by `name`, or every item of a source with `--source internal\|third-party\|productdock`. `--version <version>` (by name only). `--force` overwrites what is already on disk: without it, `install <name>` refuses and `install --source` skips an item installed in every target, installs it only in the targets where it is missing (an empty or partial folder counts as missing) and reports it |
337
- | `update [name]` | Update one, or every installed item. Up-to-date and locally modified items are skipped unless `--force` |
338
- | `status` | Report `up to date` / `outdated` / `modified` per installed item |
337
+ | `update [name]` | Update one, or every installed item. Up-to-date and locally modified items are skipped unless `--force` |
338
+ | `status` | Report `up to date` / `outdated` / `modified` per installed item — one registry request per kind. Under `--json`, `items` lists each one (see below) |
339
+
340
+ Under `--json`, `status` returns one item per installed artifact — the contract the `pd-*` skills read in
341
+ their version probe:
342
+
343
+ ```jsonc
344
+ {
345
+ "ok": true,
346
+ "operation": "skill_status",
347
+ "kind": "skill",
348
+ "items": [
349
+ { "name": "pd-workflow", "version": "3.3.0", "latest": "3.4.0", "state": "outdated" },
350
+ { "name": "pd-security-eval", "version": "1.2.0", "latest": "1.2.0", "state": "up-to-date" },
351
+ { "name": "pd-x", "version": "1.0.0", "latest": null, "state": "other-branch", "branch": "feature/x" }
352
+ ]
353
+ }
354
+ ```
355
+
356
+ | `state` | Meaning |
357
+ | -------------- | ---------------------------------------------------------------------------------------------------- |
358
+ | `up-to-date` | On disk matches the registry's latest |
359
+ | `outdated` | Untouched since install, on an older version than the registry's — `update` installs the latest |
360
+ | `modified` | A skill edited on disk since install (never an agent — see above); `update` skips it without `--force` |
361
+ | `missing` | Recorded in `productdock.json` but not on disk |
362
+ | `other-branch` | Installed from another `ai-tools` branch than the active one; `branch` says which (`null` = default) |
363
+ | `unknown` | Not in the registry, or the registry could not be reached (`latest: null`) |
364
+
365
+ Nothing installed returns `"items": []`. No session exits `2`, as every command.
339
366
 
340
367
  `install` takes **either** a name **or** `--source`: both together, or neither,
341
368
  is a usage error (exit `1`). A source outside `internal`, `third-party` and
@@ -400,6 +427,10 @@ productdock wi list
400
427
  productdock wi list --status backlog --search "authentication"
401
428
  productdock wi list --search improvement # matches the type
402
429
 
430
+ # Only the work items assigned to you — combines with the filters above
431
+ productdock wi list --mine
432
+ productdock wi list --mine --status development
433
+
403
434
  # The PRD of one work item — ref is PREFIX-N, a number, a UUID or a title
404
435
  productdock wi prd PROD-168
405
436
  productdock wi prd 168
@@ -412,11 +443,11 @@ productdock wi spec-context PROD-168 --json --out spec-context.json
412
443
 
413
444
  ##### Parameters
414
445
 
415
- | Subcommand | Argument | Options |
416
- | -------------------- | -------- | ------------------------------------------------------------------------------------- |
417
- | `list` | — | `--status <status>` · `--search <term>` · `--repository-name <name>` · `--out <file>` |
418
- | `prd <ref>` | `<ref>` | `--out <file>` |
419
- | `spec-context <ref>` | `<ref>` | `--out <file>` |
446
+ | Subcommand | Argument | Options |
447
+ | -------------------- | -------- | ------------------------------------------------------------------------------------------------ |
448
+ | `list` | — | `--status <status>` · `--search <term>` · `--repository-name <name>` · `--mine` · `--out <file>` |
449
+ | `prd <ref>` | `<ref>` | `--out <file>` |
450
+ | `spec-context <ref>` | `<ref>` | `--out <file>` |
420
451
 
421
452
  | Parameter | Description |
422
453
  | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -424,6 +455,7 @@ productdock wi spec-context PROD-168 --json --out spec-context.json
424
455
  | `--status <status>` | Kanban column: `backlog`, `prd`, `specification`, `development`, `review`, `testing`, `homologation`, `production` |
425
456
  | `--search <term>` | Matches the work item **title OR description OR type** — one term, three columns |
426
457
  | `--repository-name <name>` | Repository by name, resolved server-side. It **replaces** the repository of the linked directory for this call — `repository_id` is not sent alongside it, or the server would ignore the name. Passing it together with `--repository-id` is refused (exit `1`), not silently resolved one way |
458
+ | `--mine` | Only work items assigned to you. Filtered by the server, by the user of the token — the same "mine" as the `--mine` of `watch` — and applied before the 100-item cap, so `has_more` counts only your items. Combines with `--status`, `--search` and the repository scope |
427
459
  | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
428
460
 
429
461
  ##### Response format
@@ -445,11 +477,11 @@ under `data`:
445
477
  `get_spec_context`. Without `--json`, `stdout` stays empty and a human-readable
446
478
  summary goes to `stderr`.
447
479
 
448
- | Subcommand | `data` |
449
- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
450
- | `prd` | `{ content, status, version, updated_at }` — the latest PRD version. A work item with no PRD returns `{ content: null, message }`, which is a **success**, not an error |
451
- | `list` | `{ project_id, work_item_prefix, repository_id, has_more, items[] }`; each item is `{ id, item_number, title, description, type, status, flow_mode, current_phase }`. Capped at 100 items — `has_more: true` says the cap was hit |
452
- | `spec-context` | `{ product_brief, product_brief_status, product_vision, domain_model, discovery_insights, non_functional_requirements, sibling_specs, skill_mode, current_state, repository_id }`. `skill_mode` is the project's Lite Mode toggle (`full` / `lite`) |
480
+ | Subcommand | `data` |
481
+ | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
482
+ | `prd` | `{ content, status, version, updated_at }` — the latest PRD version. A work item with no PRD returns `{ content: null, message }`, which is a **success**, not an error |
483
+ | `list` | `{ project_id, work_item_prefix, repository_id, has_more, items[] }`; each item is `{ id, item_number, title, description, type, status, flow_mode, current_phase, assigned_to, assigned_to_name }` — `assigned_to` is the assignee's user id and `assigned_to_name` the readable name, both `null` when nobody is assigned. Capped at 100 items — `has_more: true` says the cap was hit. Without `--json`, the summary shows the assignee next to each item, `(sem responsável)` when there is none |
484
+ | `spec-context` | `{ product_brief, product_brief_status, product_vision, domain_model, discovery_insights, non_functional_requirements, sibling_specs, skill_mode, current_state, repository_id }`. `skill_mode` is the project's Lite Mode toggle (`full` / `lite`) |
453
485
 
454
486
  ##### Exit codes
455
487
 
@@ -643,15 +675,15 @@ productdock wi attachments PROD-261 --download ./attachments --json
643
675
 
644
676
  ##### Parameters
645
677
 
646
- | Subcommand | Argument | Options |
647
- | ------------------- | -------- | -------------------------------- |
678
+ | Subcommand | Argument | Options |
679
+ | ------------------- | -------- | ----------------------------------- |
648
680
  | `attachments <ref>` | `<ref>` | `--download <dir>` · `--out <file>` |
649
681
 
650
- | Parameter | Description |
651
- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
652
- | `<ref>` | **Required.** Work item reference in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
682
+ | Parameter | Description |
683
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
684
+ | `<ref>` | **Required.** Work item reference in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
653
685
  | `--download <dir>` | Writes the bytes of every attachment of the list into `<dir>`, one `GET /cli/work-items/attachments/content` per attachment — never through the `signed_url`. The bytes go to disk exactly as served: not decoded as UTF-8 and not masked. `<dir>` is created when it does not exist. The file name is the base name of `file_name` (`../` and folders are dropped, so nothing lands outside `<dir>`). **A file that already exists is overwritten.** When two attachments share a name, the second gets `-<n>` before the extension (`print.png`, `print-2.png`; compared ignoring case). An empty list writes nothing and creates nothing. A failure in the middle stops the command with its exit code and **keeps what was already written** — those paths are on `stderr` |
654
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
686
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
655
687
 
656
688
  ##### Response format
657
689
 
@@ -673,10 +705,10 @@ per attachment — name, MIME type, size, date and author.
673
705
 
674
706
  `data` is `{ work_item_id, count, attachments[] }`:
675
707
 
676
- | Field | Meaning |
677
- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
678
- | `work_item_id` | The work item the reference resolved to |
679
- | `count` | How many attachments came back — always `attachments.length` |
708
+ | Field | Meaning |
709
+ | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
710
+ | `work_item_id` | The work item the reference resolved to |
711
+ | `count` | How many attachments came back — always `attachments.length` |
680
712
  | `attachments[]` | Most recent first: `{ id, file_name, mime_type, file_size, created_at, uploaded_by, author_name, signed_url, expires_in }`. `file_size` is in bytes; `author_name` is the author's full name, or their e-mail, or `Sem nome`, and `null` when there is no author. `signed_url` is a read URL of the private bucket, valid for `expires_in` seconds (300) |
681
713
 
682
714
  `signed_url` is meant for an agent over MCP. Under `--json` its token comes out
@@ -698,11 +730,11 @@ each file appears.
698
730
 
699
731
  The general table above holds; this is how each condition maps to it:
700
732
 
701
- | Code | When |
702
- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
703
- | `0` | The attachments were read — including a work item with no attachments |
733
+ | Code | When |
734
+ | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
735
+ | `0` | The attachments were read — including a work item with no attachments |
704
736
  | `1` | Missing `<ref>`; directory not linked and no `--project-id`; missing reference (`400`); not a member of the project (`403` — `not_member`, or `project_membership_required` with only "Ver todos os projetos"); work item not found **or not visible to you** (`404` — the two are deliberately indistinguishable); any other API failure; **with `--download`**, the download of one attachment refused (`403`), not found (`404`) or not writable to disk — what was written before the failure stays in `<dir>`, and `stderr` names it |
705
- | `2` | The API rejected the token (`401`) — run `productdock login` again; with `--download`, also when it happens in the middle of the downloads, keeping what was already written |
737
+ | `2` | The API rejected the token (`401`) — run `productdock login` again; with `--download`, also when it happens in the middle of the downloads, keeping what was already written |
706
738
 
707
739
  #### `productdock wi comment`
708
740
 
@@ -1139,9 +1171,9 @@ in `prd-review-claims.json` under the configuration directory (next to
1139
1171
 
1140
1172
  | Parameter | Description |
1141
1173
  | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1142
- | `<ref>` / `--ref` | **Required.** Work item under review, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title. It is the positional argument of `get`, `claim` and `release`, and the `--ref` flag of `submit`, so the two can never be swapped by accident |
1174
+ | `<ref>` / `--ref` | **Required.** Work item under review, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title. It is the positional argument of `get`, `claim` and `release`, and the `--ref` flag of `submit`, so the two can never be swapped by accident |
1143
1175
  | `--job-id <uuid>` | The Tech Review request the round enters through — the `job.id` that `claim` returned, or the request of the `watch` round. Sent only when given; the server refuses a request that is not running for you (cancelled included) and writes nothing |
1144
- | `--status <status>` | Thread status filter: `open`, `resolved`, `ignored`, `superseded`, `archived`, or `all` (the default). The CLI keeps no list of its own — an unknown value is refused **by the server**, which names the accepted ones |
1176
+ | `--status <status>` | Thread status filter: `open`, `resolved`, `ignored`, `superseded`, `archived`, or `all` (the default). The CLI keeps no list of its own — an unknown value is refused **by the server**, which names the accepted ones |
1145
1177
  | `--limit <n>` | Cap on how many threads come back, most recent first — a positive integer. The server defaults to 50 and caps at 200. A non-numeric value is refused locally (exit `1`), never silently ignored |
1146
1178
  | `[file]` | Path to the review body on disk, read as UTF-8 and sent verbatim — not trimmed, not re-encoded, not truncated. The fenced JSON block with the `prd-review/v1` envelope, at the top of it, is **mandatory** — a body without it is refused by the server. Optional only in the sense that `--content` replaces it; passing both is refused (exit `1`), not silently resolved one way |
1147
1179
  | `--content <text>` | The review body inline, as an alternative to the file |
@@ -1168,47 +1200,47 @@ summary goes to `stderr`.
1168
1200
 
1169
1201
  `get` returns `{ work_item_id, brief_version, summary, count, threads[] }`:
1170
1202
 
1171
- | Field | Meaning |
1172
- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1173
- | `summary` | Thread counts by status: `{ open, resolved, ignored, superseded, archived }`. **`summary.open` is the number to check before composing the next round** |
1174
- | `count` | How many threads came back — after `--status` and `--limit` |
1175
- | `threads[].finding_key` | The stable correlation key of the finding **across rounds**. Reusing it in the next round updates the existing thread instead of creating a new one; `null` on human threads and on threads created before the key existed |
1176
- | `threads[].status` | `open`, `resolved`, `ignored`, `superseded` or `archived`. An `ignored` finding must not be re-emitted. A resolved Blocker or Gap that the PRD still has is reopened by the next round (`threads_reopened`); a resolved Suggestion is not |
1177
- | `threads[].archived_from_status` | The status an `archived` finding had when it left the panel — on publishing, skipping the Tech Review or restoring a version. `null` while not archived |
1178
- | `threads[].messages[]` | The messages of the review rounds, authors already hydrated (`author`, `source`, `text`). The human conversation does not come: the state of the finding is the PM's decision, and it is what the next round needs |
1179
- | `threads[].outdated` | `true` when the thread is anchored to a PRD version older than the current one |
1180
- | `brief_version` | The current PRD version the review is being read against |
1203
+ | Field | Meaning |
1204
+ | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1205
+ | `summary` | Thread counts by status: `{ open, resolved, ignored, superseded, archived }`. **`summary.open` is the number to check before composing the next round** |
1206
+ | `count` | How many threads came back — after `--status` and `--limit` |
1207
+ | `threads[].finding_key` | The stable correlation key of the finding **across rounds**. Reusing it in the next round updates the existing thread instead of creating a new one; `null` on human threads and on threads created before the key existed |
1208
+ | `threads[].status` | `open`, `resolved`, `ignored`, `superseded` or `archived`. An `ignored` finding must not be re-emitted. A resolved Blocker or Gap that the PRD still has is reopened by the next round (`threads_reopened`); a resolved Suggestion is not |
1209
+ | `threads[].archived_from_status` | The status an `archived` finding had when it left the panel — on publishing, skipping the Tech Review or restoring a version. `null` while not archived |
1210
+ | `threads[].messages[]` | The messages of the review rounds, authors already hydrated (`author`, `source`, `text`). The human conversation does not come: the state of the finding is the PM's decision, and it is what the next round needs |
1211
+ | `threads[].outdated` | `true` when the thread is anchored to a PRD version older than the current one |
1212
+ | `brief_version` | The current PRD version the review is being read against |
1181
1213
 
1182
1214
  `submit` returns the round's outcome — this is what decides the next round:
1183
1215
 
1184
- | Field | Meaning |
1185
- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
1186
- | `success` | Always `true` on a `0` exit. It says the round was accepted — **not** that anything was posted; see the counters below |
1187
- | `review_round` | Number of this round. It equals the artifact version of the envelope snapshot |
1188
- | `threads_created` | Findings that had no live thread — a new thread each |
1189
- | `threads_updated` | Findings matched to an **open** thread by `finding_key`: the round was appended and the PM's reply survived |
1190
- | `threads_reopened` | Blockers and Gaps the PM had **resolved** that this round emitted again — the PRD still has them, so the thread is open again |
1191
- | `threads_skipped_closed` | Findings the PM had already **ignored**, or resolved Suggestions. Nothing was posted for them, and they were not reopened — a normal outcome |
1192
- | `threads_superseded` | Threads that were open and did **not** come back in this round: the review considered them settled |
1193
- | `tech_review` | The badge written on the PRD: `none` (a clean review), `changes_requested_gaps` or `changes_requested_blocking` |
1194
- | `artifact_id` · `artifact_version` | The snapshot of the raw envelope kept as a phase artifact |
1216
+ | Field | Meaning |
1217
+ | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
1218
+ | `success` | Always `true` on a `0` exit. It says the round was accepted — **not** that anything was posted; see the counters below |
1219
+ | `review_round` | Number of this round. It equals the artifact version of the envelope snapshot |
1220
+ | `threads_created` | Findings that had no live thread — a new thread each |
1221
+ | `threads_updated` | Findings matched to an **open** thread by `finding_key`: the round was appended and the PM's reply survived |
1222
+ | `threads_reopened` | Blockers and Gaps the PM had **resolved** that this round emitted again — the PRD still has them, so the thread is open again |
1223
+ | `threads_skipped_closed` | Findings the PM had already **ignored**, or resolved Suggestions. Nothing was posted for them, and they were not reopened — a normal outcome |
1224
+ | `threads_superseded` | Threads that were open and did **not** come back in this round: the review considered them settled |
1225
+ | `tech_review` | The badge written on the PRD: `none` (a clean review), `changes_requested_gaps` or `changes_requested_blocking` |
1226
+ | `artifact_id` · `artifact_version` | The snapshot of the raw envelope kept as a phase artifact |
1195
1227
 
1196
1228
  `claim` and `release` return `{ job, runner_session }`:
1197
1229
 
1198
- | Field | Meaning |
1199
- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1230
+ | Field | Meaning |
1231
+ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1200
1232
  | `job` | The request as the queue returned it on `claim` — `id` (the value of `--job-id`), `status`, `brief_version`, `work_item_ref`, … `null` on `claim` when the work item has no queued request: nothing to review. On `release`, the request of the claim with the fields the release resets: `status: "queued"`, `interactive: false`, and `claimed_by`, `runner_label`, `lease_until` and `started_at` `null`. `attempts` and `attempt_history` stay as the claim returned them — the server recalculates them and answers only `{ released: true }` |
1201
- | `runner_session` | The session of the claim. `release` sends it back with the request, so the queue knows who gave it back. `null` when `claim` took nothing |
1233
+ | `runner_session` | The session of the claim. `release` sends it back with the request, so the queue knows who gave it back. `null` when `claim` took nothing |
1202
1234
 
1203
1235
  #### Exit codes
1204
1236
 
1205
1237
  The general table above holds; this is how each condition maps to it:
1206
1238
 
1207
- | Code | When |
1208
- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1209
- | `0` | The read-back ran — including a work item with no review at all — or the round was recorded, **including a round that posted nothing because every finding was already closed**; `claim` ran, **including when there was no request to take** (`job: null`); `release` gave the request back |
1239
+ | Code | When |
1240
+ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1241
+ | `0` | The read-back ran — including a work item with no review at all — or the round was recorded, **including a round that posted nothing because every finding was already closed**; `claim` ran, **including when there was no request to take** (`job: null`); `release` gave the request back |
1210
1242
  | `1` | Missing `<ref>`/`--ref`; non-numeric `--limit`; unknown `--status` (`400`, refused by the server); no body (no file and no `--content`); file and `--content` together; unreadable file; directory not linked and no `--project-id`; **invalid envelope (`400`) — the response names the offending field, and nothing was written**; **round refused for its request — the `--job-id` request is not running for you, cancelled included (`400`, `prd_review_job_not_running`), no open request for the reviewed version (`400`, `prd_review_job_required`), or unknown request (`404`, `prd_review_job_not_found`) — and nothing was written**; `release` with no `claim` of that work item on this machine; no permission to edit work items (`403`, `submit`, `claim` and `release`); work item not found **or not visible to you** (`404` — the two are deliberately indistinguishable); any other API failure |
1211
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
1243
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
1212
1244
 
1213
1245
  ### `productdock eval` — project evaluations
1214
1246
 
@@ -1285,7 +1317,7 @@ top of this section.
1285
1317
  | Parameter | Description |
1286
1318
  | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1287
1319
  | `<file>` | **Required.** Path to the eval envelope on disk — the `latest.json` the eval skill writes. Read as UTF-8 and parsed locally: it must be a JSON **object** (`schema_version` 1.0). Malformed JSON, an array or a scalar fails locally (exit `1`) without a network call; everything inside the object is validated by the server |
1288
- | `--repository-name <name>` | Label of the evaluated repository, used only when the envelope carries no `target.repositories`. There is no repository _id_ in this operation: the evaluation is project-level, so the `project.repository` of `productdock.json` is not sent, and `--repository-id` is refused (exit `1`, before any network call) |
1320
+ | `--repository-name <name>` | Label of the evaluated repository, used only when the envelope carries no `target.repositories`. There is no repository _id_ in this operation: the evaluation is project-level, so the `project.repository` of `productdock.json` is not sent, and `--repository-id` is refused (exit `1`, before any network call) |
1289
1321
  | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1290
1322
 
1291
1323
  #### Response format
@@ -1305,22 +1337,22 @@ under `data`:
1305
1337
 
1306
1338
  Without `--json`, `stdout` stays empty and a one-line summary goes to `stderr`.
1307
1339
 
1308
- | Field | Meaning |
1309
- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1310
- | `success` | Always `true` on a `0` exit |
1340
+ | Field | Meaning |
1341
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1342
+ | `success` | Always `true` on a `0` exit |
1311
1343
  | `evaluation_id` | Id of the project's "latest" evaluation for the `eval_type`. It is **stable across submissions** of the same `(project, eval_type)`; the submission itself is recorded as an execution of the history, whose id (`execution_id`) is what `eval latest` returns — the two are different ids |
1312
- | `project_id` | The project the evaluation was recorded under — the one the server authorized, not the one you asked for |
1313
- | `eval_type` | `security`, `observability` or `frontend_quality`, read from the envelope |
1344
+ | `project_id` | The project the evaluation was recorded under — the one the server authorized, not the one you asked for |
1345
+ | `eval_type` | `security`, `observability` or `frontend_quality`, read from the envelope |
1314
1346
 
1315
1347
  #### Exit codes
1316
1348
 
1317
1349
  The general table above holds; this is how each condition maps to it:
1318
1350
 
1319
- | Code | When |
1320
- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1321
- | `0` | The evaluation was recorded |
1351
+ | Code | When |
1352
+ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1353
+ | `0` | The evaluation was recorded |
1322
1354
  | `1` | Missing `<file>`; unreadable file; the file is not a JSON object; `--repository-id` given (refused before any network call — the repository comes from the envelope or `--repository-name`); directory not linked and no `--project-id`; **invalid envelope (`400`) — the response names the offending field, and nothing was written**; no access to the project (`403`); any other API failure |
1323
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
1355
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
1324
1356
 
1325
1357
  #### `productdock eval latest`
1326
1358
 
@@ -1360,16 +1392,16 @@ productdock eval latest --type security --execution-id <execution_id> --json
1360
1392
 
1361
1393
  ##### Parameters
1362
1394
 
1363
- | Subcommand | Argument | Options |
1364
- | ---------- | -------- | ---------------------------------------------------------- |
1365
- | `latest` | — | `--type` · `--repository` · `--execution-id` · `--out` |
1395
+ | Subcommand | Argument | Options |
1396
+ | ---------- | -------- | ------------------------------------------------------ |
1397
+ | `latest` | — | `--type` · `--repository` · `--execution-id` · `--out` |
1366
1398
 
1367
- | Parameter | Description |
1368
- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1399
+ | Parameter | Description |
1400
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1369
1401
  | `--type <eval_type>` | **Required.** `security`, `observability`, `frontend_quality` or `backend_quality`. Sent as typed — the list of types is the server's, and an unknown type comes back as a `400` naming the options |
1370
- | `--repository <key>` | The `repository_key` of a previous answer: the latest execution of that repository. Not a UUID and not the `--repository-name` label |
1371
- | `--execution-id <id>` | The `execution_id` of a previous answer: that execution. It is **not** the `evaluation_id` that `eval submit` returns |
1372
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1402
+ | `--repository <key>` | The `repository_key` of a previous answer: the latest execution of that repository. Not a UUID and not the `--repository-name` label |
1403
+ | `--execution-id <id>` | The `execution_id` of a previous answer: that execution. It is **not** the `evaluation_id` that `eval submit` returns |
1404
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1373
1405
 
1374
1406
  ##### Response format
1375
1407
 
@@ -1395,11 +1427,11 @@ a trailing space in the label is visible and is not mistaken for the key.
1395
1427
  `data` is the evaluation envelope as the eval skill submitted it (`eval_type`,
1396
1428
  `score`, `rating`, `executed_at`, `dimensions`, `findings`, `counts`, …), plus:
1397
1429
 
1398
- | Field | Meaning |
1399
- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1400
- | `execution_id` | Id of the execution that was read — the value `--execution-id` takes |
1401
- | `repository_key` | Key of the evaluated repository — the value `--repository` takes |
1402
- | `repository_label` | Label of the evaluated repository, as the skill sent it |
1430
+ | Field | Meaning |
1431
+ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1432
+ | `execution_id` | Id of the execution that was read — the value `--execution-id` takes |
1433
+ | `repository_key` | Key of the evaluated repository — the value `--repository` takes |
1434
+ | `repository_label` | Label of the evaluated repository, as the skill sent it |
1403
1435
  | `view` | The findings as the Eval screen shows them: `categories` (dimension, label, score), `findings` (id, title, severity, category, `location` `{ file, line }`, linked `work_item`), `positives` and `totals` |
1404
1436
 
1405
1437
  **No evaluation is a success, not an error.** When the project has no
@@ -1415,11 +1447,11 @@ may well have executions of other repositories — and points to
1415
1447
 
1416
1448
  The general table above holds; this is how each condition maps to it:
1417
1449
 
1418
- | Code | When |
1419
- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1420
- | `0` | The report was read — including no evaluation (`data: null`) |
1450
+ | Code | When |
1451
+ | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1452
+ | `0` | The report was read — including no evaluation (`data: null`) |
1421
1453
  | `1` | Missing `--type`; `--repository-id` given (refused before any network call — use `--repository <key>`); directory not linked and no `--project-id`; invalid parameter (`400` — unknown `eval_type`, malformed `execution_id`); not a member of the project (`403` — `not_member`, or `project_membership_required` with only "Ver todos os projetos"); any other API failure |
1422
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
1454
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
1423
1455
 
1424
1456
  #### `productdock eval list`
1425
1457
 
@@ -1450,14 +1482,14 @@ productdock eval list --type observability --json --out eval-repositories.json
1450
1482
 
1451
1483
  ##### Parameters
1452
1484
 
1453
- | Subcommand | Argument | Options |
1454
- | ---------- | -------- | -------------------- |
1455
- | `list` | — | `--type` · `--out` |
1485
+ | Subcommand | Argument | Options |
1486
+ | ---------- | -------- | ------------------ |
1487
+ | `list` | — | `--type` · `--out` |
1456
1488
 
1457
- | Parameter | Description |
1458
- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1489
+ | Parameter | Description |
1490
+ | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1459
1491
  | `--type <eval_type>` | **Required.** `security`, `observability`, `frontend_quality` or `backend_quality`. Sent as typed — the list of types is the server's, and an unknown type comes back as a `400` naming the options |
1460
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1492
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1461
1493
 
1462
1494
  ##### Response format
1463
1495
 
@@ -1479,12 +1511,12 @@ per repository — key, label, number of executions and the date of the latest.
1479
1511
 
1480
1512
  `data` is an array, the repository of the most recent execution first:
1481
1513
 
1482
- | Field | Meaning |
1483
- | ---------------- | ------------------------------------------------------------------------------------------------- |
1484
- | `key` | The `repository_key` — the value `eval latest --repository` takes |
1514
+ | Field | Meaning |
1515
+ | ---------------- | ------------------------------------------------------------------------------------------------ |
1516
+ | `key` | The `repository_key` — the value `eval latest --repository` takes |
1485
1517
  | `label` | Label of the repository in its most recent execution; `sem repositório` when the skill sent none |
1486
- | `executionCount` | How many executions of the type the repository has |
1487
- | `lastExecutedAt` | `executed_at` of its most recent execution |
1518
+ | `executionCount` | How many executions of the type the repository has |
1519
+ | `lastExecutedAt` | `executed_at` of its most recent execution |
1488
1520
 
1489
1521
  **Nothing evaluated is a success, not an error.** When the project has no
1490
1522
  evaluation of that type, the API answers `200` with `[]`: `data` is `[]`, the
@@ -1494,11 +1526,11 @@ exit code is `0`, and the summary on `stderr` says no repository was evaluated.
1494
1526
 
1495
1527
  The general table above holds; this is how each condition maps to it:
1496
1528
 
1497
- | Code | When |
1498
- | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1499
- | `0` | The list was read — including an empty one (`data: []`) |
1529
+ | Code | When |
1530
+ | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1531
+ | `0` | The list was read — including an empty one (`data: []`) |
1500
1532
  | `1` | Missing `--type`; `--repository-id` given (refused before any network call); directory not linked and no `--project-id`; unknown `eval_type` (`400`); not a member of the project (`403` — `not_member`, or `project_membership_required` with only "Ver todos os projetos"); any other API failure |
1501
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
1533
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
1502
1534
 
1503
1535
  ### `productdock test-report` — test suite reports
1504
1536
 
@@ -1553,11 +1585,11 @@ The subcommand also accepts `--json`, documented once at the top of
1553
1585
  | --------------- | -------- | ------------------------ |
1554
1586
  | `submit <file>` | `<file>` | `--project-id` · `--out` |
1555
1587
 
1556
- | Parameter | Description |
1557
- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1588
+ | Parameter | Description |
1589
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1558
1590
  | `<file>` | **Required.** Path to the test suite report on disk. Read as UTF-8 and parsed locally: it must be a JSON **object**. Malformed JSON, an array or a scalar fails locally (exit `1`) without a network call; everything inside the object is validated by the server |
1559
- | `--project-id <uuid>` | Project the execution is recorded under — overrides `project.id` of `productdock.json`, for this call only. There is no repository in this operation: `--repository-id` is refused (exit `1`, before any network call) |
1560
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1591
+ | `--project-id <uuid>` | Project the execution is recorded under — overrides `project.id` of `productdock.json`, for this call only. There is no repository in this operation: `--repository-id` is refused (exit `1`, before any network call) |
1592
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1561
1593
 
1562
1594
  #### Response format
1563
1595
 
@@ -1576,21 +1608,21 @@ under `data`:
1576
1608
 
1577
1609
  Without `--json`, `stdout` stays empty and a one-line summary goes to `stderr`.
1578
1610
 
1579
- | Field | Meaning |
1580
- | ------------ | ---------------------------------------------------------------------------------------------------- |
1581
- | `id` | Id of the execution |
1582
- | `run_number` | Number of the execution in the project's history |
1611
+ | Field | Meaning |
1612
+ | ------------ | ---------------------------------------------------------------------------------------------------------------- |
1613
+ | `id` | Id of the execution |
1614
+ | `run_number` | Number of the execution in the project's history |
1583
1615
  | `created` | `true` when the submission added an execution; `false` when it updated one already recorded with the same report |
1584
1616
 
1585
1617
  #### Exit codes
1586
1618
 
1587
1619
  The general table above holds; this is how each condition maps to it:
1588
1620
 
1589
- | Code | When |
1590
- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1591
- | `0` | The execution was recorded |
1621
+ | Code | When |
1622
+ | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1623
+ | `0` | The execution was recorded |
1592
1624
  | `1` | Missing `<file>`; unreadable file; the file is not a JSON object; `--repository-id` given (refused before any network call); directory not linked and no `--project-id`; **invalid report (`400`) — the response names the offending field, and nothing was written**; not a member of the project (`403`); report above the server's size limit (`413`) — one message, with the size that was sent; any other API failure |
1593
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
1625
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
1594
1626
 
1595
1627
  ### `productdock state` — the SDLC state of a work item
1596
1628
 
@@ -1683,7 +1715,7 @@ the same work item, with no error anywhere — cannot happen by accident.
1683
1715
  | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1684
1716
  | `<ref>` | **Required** on `phase`. The work item — `PREFIX-N` (`PROD-168`), a number, a UUID or a title |
1685
1717
  | `--ref <ref>` | **Required** on `update`. Same four formats. It is a flag, not a positional, so its order with the body file can never be swapped |
1686
- | `--type <type>` | **Required** on `update`. The kind of update: `decision`, `blocker`, `lesson`, `review`, `phase_change`, `phase_progress`, `flow_change`. Sent as-is: the enum belongs to the server, which rejects what it does not know and lists the options |
1718
+ | `--type <type>` | **Required** on `update`. The kind of update: `decision`, `blocker`, `lesson`, `review`, `phase_change`, `phase_progress`, `flow_change`. Sent as-is: the enum belongs to the server, which rejects what it does not know and lists the options |
1687
1719
  | `[file]` | Path to the update body on disk. Read as UTF-8 and parsed locally: it must be a JSON **object**. Malformed JSON, an array or a scalar fails locally (exit `1`) without a network call; the keys inside are the server's business |
1688
1720
  | `--content <json>` | The same body inline. Passing the file **and** `--content` is refused, not resolved by precedence: they are the same choice with different answers. Neither one is required — an update may have no body at all, and an empty `{}` is not invented here |
1689
1721
  | `--dry-run` | Validates the body server-side — the same schema check, the same refusals, the same numbering — and writes **nothing**. It exists because probing the schema against a real work item created one entry per attempt, and the CLI offers no way to read or delete a decision or a lesson. The response carries `dry_run: true` and `would_apply` in place of `applied` |
@@ -1853,14 +1885,14 @@ gives the request back to the queue (`release`) and exits — both with `0`.
1853
1885
 
1854
1886
  #### Parameters
1855
1887
 
1856
- | Flag | Description |
1857
- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------- |
1858
- | `--project-id <uuid>` | Project to serve — overrides `project.id` of `productdock.json` |
1859
- | `--mine` | Only work items assigned to you. Filtered by the server, in the claim |
1860
- | `--confirm` | Ask before each run — needs a terminal. Declining gives the request back to the queue, and this session does not receive it again |
1888
+ | Flag | Description |
1889
+ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1890
+ | `--project-id <uuid>` | Project to serve — overrides `project.id` of `productdock.json` |
1891
+ | `--mine` | Only work items assigned to you. Filtered by the server, in the claim |
1892
+ | `--confirm` | Ask before each run — needs a terminal. Declining gives the request back to the queue, and this session does not receive it again |
1861
1893
  | `--interval <seconds>` | Seconds between queue polls while idle — a positive integer, `10` by default. A non-numeric value is refused (exit `1`). When polls fail in a row (API down, gateway `504`, no answer within 20 s), the wait doubles after each failure up to 2 minutes, and returns to the interval on the first poll that answers |
1862
- | `--follow` | Print what Claude does in each stage, live — one line per tool call (file read, search, command, subagent, file written) |
1863
- | `--json` | One JSON event per line on `stdout` (NDJSON); prose and the questions of the first run and `--confirm` on `stderr` |
1894
+ | `--follow` | Print what Claude does in each stage, live — one line per tool call (file read, search, command, subagent, file written) |
1895
+ | `--json` | One JSON event per line on `stdout` (NDJSON); prose and the questions of the first run and `--confirm` on `stderr` |
1864
1896
 
1865
1897
  #### Response format
1866
1898
 
@@ -1868,16 +1900,16 @@ Without `--json`, `stdout` stays empty and each round is reported on `stderr`:
1868
1900
  the request in progress, the outcome and its duration (and turns). Under
1869
1901
  `--json`, one event per line:
1870
1902
 
1871
- | `event` | When |
1872
- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
1873
- | `watch_started` | The runner is up — `project_id`, `runner_label`, `model`, `only_assigned`, `confirm`, `follow`, `skill_version` |
1874
- | `job_started` | A request was taken — `job_id`, `work_item_ref`, `brief_version`, `title`, `skill_version` (the `SKILL.md` version copied into the round) |
1875
- | `job_released` | A request declined under `--confirm` went back to the queue |
1903
+ | `event` | When |
1904
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1905
+ | `watch_started` | The runner is up — `project_id`, `runner_label`, `model`, `only_assigned`, `confirm`, `follow`, `skill_version` |
1906
+ | `job_started` | A request was taken — `job_id`, `work_item_ref`, `brief_version`, `title`, `skill_version` (the `SKILL.md` version copied into the round) |
1907
+ | `job_released` | A request declined under `--confirm` went back to the queue |
1876
1908
  | `job_finished` | The round ended — `outcome` (`completed`, `failed`, `discarded`, `released`), `duration_ms`, `turns`, and the verdict counts (`tech_pending`, or the `tech_decisions` of a 2.3.0 skill) or the `error` |
1877
- | `activity` | Only with `--follow` — one action of Claude: `job_id`, `stage` (`A`/`B`), `kind` (`tool`/`text`), `tool`, `detail` |
1878
- | `warning` | Something that did not end the round — a failed heartbeat, an unreachable queue |
1879
- | `queue_recovered` | The queue answered again after failed polls — `failures` (how many in a row) |
1880
- | `stopping` | The first Ctrl+C |
1909
+ | `activity` | Only with `--follow` — one action of Claude: `job_id`, `stage` (`A`/`B`), `kind` (`tool`/`text`), `tool`, `detail` |
1910
+ | `warning` | Something that did not end the round — a failed heartbeat, an unreachable queue |
1911
+ | `queue_recovered` | The queue answered again after failed polls — `failures` (how many in a row) |
1912
+ | `stopping` | The first Ctrl+C |
1881
1913
 
1882
1914
  The last line is the closing document — `{ "ok": true, "event": "watch_stopped", "rounds": n }`,
1883
1915
  or the error document.
@@ -1886,11 +1918,11 @@ or the error document.
1886
1918
 
1887
1919
  The general table above holds; this is how each condition maps to it:
1888
1920
 
1889
- | Code | When |
1890
- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1891
- | `0` | The runner was stopped with Ctrl+C — once or twice |
1921
+ | Code | When |
1922
+ | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1923
+ | `0` | The runner was stopped with Ctrl+C — once or twice |
1892
1924
  | `1` | Directory not linked and no `--project-id` (no network call is made); no terminal (`--json` included) with no model stored yet, or with `--confirm`; not inside a Git repository; `claude` not on the `PATH`; `pd-workflow` not installed; non-numeric `--interval`; the queue refused the call for good — no permission on the project (`403`), bad request (`400`) |
1893
- | `2` | No CLI session, or the API rejected the token (`401`) — run `productdock login` again |
1925
+ | `2` | No CLI session, or the API rejected the token (`401`) — run `productdock login` again |
1894
1926
 
1895
1927
  ### `productdock doctor`
1896
1928
 
@@ -1905,17 +1937,29 @@ productdock doctor --fix
1905
1937
 
1906
1938
  Checks performed:
1907
1939
 
1908
- 1. `~/.productdock/credentials.json` exists and is valid
1909
- 2. Access token is renewable (refresh token not expired)
1910
- 3. `productdock.json` exists with an IDE list
1911
- 4. The directory is linked to a ProductDock project
1912
- 5. MCP server is reachable
1913
- 6. MCP config files exist for each configured IDE, point at the correct URL and carry the project and repository of the
1940
+ 1. The running CLI is on the `latest` version published to npm (`@softdesignbrasil/productdock-cli`) — an older one,
1941
+ or a failed lookup (3s timeout), is a warning. `--fix` does not update the CLI, since only you know whether it was
1942
+ installed with `npm install -g`, `npx` or a binary; it prints `npm install -g @softdesignbrasil/productdock-cli@latest`
1943
+ 2. `~/.productdock/credentials.json` exists and is valid
1944
+ 3. Access token is renewable (refresh token not expired)
1945
+ 4. `productdock.json` exists with an IDE list
1946
+ 5. The directory is linked to a ProductDock project
1947
+ 6. MCP server is reachable — only checked when the MCP is in use
1948
+ 7. MCP config files exist for each configured IDE, point at the correct URL and carry the project and repository of the
1914
1949
  current link — after re-linking to another repository, `--fix` rewrites them. The MCP is legacy and optional: in a
1915
1950
  directory that never configured it (no `mcp` in `productdock.json`, no `productdock` entry in any IDE file, as after
1916
- `link --no-install-mcp`) this check passes and `--fix` does not install it
1917
- 7. `AI_TOOLS_BRANCH` is not silently overriding the skill/agent source
1918
- 8. Every skill and agent recorded in `productdock.json` is installed on disk — a skill folder without its `SKILL.md`, or an empty agent file, counts as missing
1951
+ `link --no-install-mcp`) this check passes and `--fix` does not install it. MCP problems (6 and 7) are reported as
1952
+ warnings, never errors
1953
+ 8. `AI_TOOLS_BRANCH` is not silently overriding the skill/agent source
1954
+ 9. Every skill and agent recorded in `productdock.json` is installed on disk — a skill folder without its `SKILL.md`, or an empty agent file, counts as missing
1955
+ 10. Installed skills and agents are on the registry's latest version — a newer one is a warning, and `--fix` updates it
1956
+ (skipping any skill modified locally, as `skill update` does)
1957
+
1958
+ Outside `doctor`, any command run by a human in a terminal ends with a one-line notice when installed skills or agents
1959
+ have a newer version (`productdock skill update` / `productdock agent update`). The registry is queried at most once a
1960
+ day per project (cached in `~/.productdock/update-check.json`) with a 3s timeout; the notice goes to `stderr` and is
1961
+ never shown under `--json`, without a TTY (the IDE agent calling the CLI), for `skill`/`agent`/`doctor`/`login`/`init`/
1962
+ `link`/`watch`, or when `PRODUCTDOCK_NO_UPDATE_CHECK` is set. A failed check is silent.
1919
1963
 
1920
1964
  ---
1921
1965
 
@@ -2024,12 +2068,14 @@ productdock login IDE (Claude Code / Cursor / VS Code)
2024
2068
 
2025
2069
  All optional — defaults point at production.
2026
2070
 
2027
- | Variable | Default | Description |
2028
- | -------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2029
- | `PRODUCTDOCK_API_URL` | `https://productdock-api.softdesign.com.br` | ProductDock API base URL — root of the OAuth (`/oauth/*`) and project (`/cli/*`) endpoints |
2030
- | `PRODUCTDOCK_MCP_URL` | `<PRODUCTDOCK_API_URL>/mcp` | MCP server URL, written into each IDE config by `mcp setup`. Legacy: when it is set and `PRODUCTDOCK_API_URL` is not, this value minus the `/mcp` suffix becomes the API base |
2031
- | `PRODUCTDOCK_REGISTRY_URL` | `https://productdock-core-api.softdesign.com.br` | Skill and agent registry URL |
2032
- | `AI_TOOLS_BRANCH` | _(registry default branch, `main`)_ | Resolve skills and agents from this `ai-tools` branch. Setting it to `main` is the same as not setting it |
2071
+ | Variable | Default | Description |
2072
+ | -------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2073
+ | `PRODUCTDOCK_API_URL` | `https://productdock-api.softdesign.com.br` | ProductDock API base URL — root of the OAuth (`/oauth/*`) and project (`/cli/*`) endpoints |
2074
+ | `PRODUCTDOCK_MCP_URL` | `<PRODUCTDOCK_API_URL>/mcp` | MCP server URL, written into each IDE config by `mcp setup`. Legacy: when it is set and `PRODUCTDOCK_API_URL` is not, this value minus the `/mcp` suffix becomes the API base |
2075
+ | `PRODUCTDOCK_REGISTRY_URL` | `https://productdock-core-api.softdesign.com.br` | Skill and agent registry URL |
2076
+ | `AI_TOOLS_BRANCH` | _(registry default branch, `main`)_ | Resolve skills and agents from this `ai-tools` branch. Setting it to `main` is the same as not setting it |
2077
+ | `PRODUCTDOCK_NPM_REGISTRY_URL` | `https://registry.npmjs.org` | npm registry `doctor` asks for the CLI's `latest` version |
2078
+ | `PRODUCTDOCK_NO_UPDATE_CHECK` | _(unset)_ | Any value turns off the end-of-command notice about outdated skills and agents. `doctor` still reports them |
2033
2079
  | `PRODUCTDOCK_CONFIG_DIR` | `~/.productdock` | Directory of `credentials.json` and of the user's `config.json`. `login`, the token refresh and `logout` honour it; `productdock watch` sets it for the `productdock` calls Claude makes, so they share your session without changing `HOME` |
2034
2080
 
2035
2081
  When running from source, these are also read from a `.env` file in the repository root — see `.env.example`.
@@ -2064,37 +2110,39 @@ bun test test/output.test.ts
2064
2110
 
2065
2111
  ### Source layout
2066
2112
 
2067
- | File | Responsibility |
2068
- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2069
- | `bin/productdock.ts` | Commander program — command definitions and dispatch |
2070
- | `lib/constants.ts` | Version, base URLs and environment overrides — the `/oauth/*` and `/cli/*` root, the MCP server URL, the registry, `AI_TOOLS_BRANCH`; loads `.env` when running from source |
2071
- | `lib/auth.ts` | OAuth 2.1 + PKCE flow, credential store (`PRODUCTDOCK_CONFIG_DIR`), token refresh |
2072
- | `lib/config.ts` | `productdock.json` read/write/migrate, `init` and `link` |
2073
- | `lib/api.ts` | Project and repository lookup behind `link` — `/cli/projects` and `/cli/projects/{id}/repositories` |
2074
- | `lib/git.ts` | `origin` remote detection, Azure DevOps URL parsing (SSH, HTTPS, legacy), and the worktree helpers of `watch` |
2075
- | `lib/ide.ts` | IDE detection and MCP config writing |
2076
- | `lib/registry.ts` | Registry HTTP client — one code path for skills and agents, `?branch=` |
2077
- | `lib/http.ts` | HTTP client for the `/cli/*` endpoints — file bodies, `multipart`, binary download, HTTP status kept in the error |
2078
- | `lib/scope.ts` | Project scope — `project_id`/`repository_id` from `productdock.json`, flags override |
2079
- | `lib/artifacts.ts` | Install core: destinations, zip extraction, SHA256 fingerprint, drift |
2080
- | `lib/frontmatter.ts` | Frontmatter adaptation per platform (agents) — port of the ai-tools installer |
2081
- | `lib/artifact-commands.ts` | The `skill` and `agent` command groups, generic over artifact kind |
2082
- | `lib/work-items.ts` | The `wi` command group — `list`, `prd`, `spec-context`, `bugs`, `prototypes` and `attachments` (with `--download`) over `/cli/work-items/*` |
2083
- | `lib/work-item-attachments.ts` | The `wi` writes — `comment` over `/cli/work-items/comments` and `evidence` (multipart) over `/cli/work-items/qa-evidence` |
2084
- | `lib/code.ts` | The `code` command group — `map` and `search` over `/cli/code/*` |
2085
- | `lib/phase-artifacts.ts` | The `artifact` command group — `submit` over `/cli/artifacts`, body from a file |
2086
- | `lib/prd-review.ts` | The `prd-review` command group — `get` (mandatory read-back) and `submit` over `/cli/prd-review`, and `claim`/`release` of the interactive Tech Review request |
2113
+ | File | Responsibility |
2114
+ | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
2115
+ | `bin/productdock.ts` | Commander program — command definitions and dispatch |
2116
+ | `lib/constants.ts` | Version, base URLs and environment overrides — the `/oauth/*` and `/cli/*` root, the MCP server URL, the registry, `AI_TOOLS_BRANCH`; loads `.env` when running from source |
2117
+ | `lib/artifact-updates.ts` | Outdated skill/agent detection against the registry — used by `doctor` and by the cached end-of-command notice |
2118
+ | `lib/auth.ts` | OAuth 2.1 + PKCE flow, credential store (`PRODUCTDOCK_CONFIG_DIR`), token refresh |
2119
+ | `lib/config.ts` | `productdock.json` read/write/migrate, `init` and `link` |
2120
+ | `lib/api.ts` | Project and repository lookup behind `link` — `/cli/projects` and `/cli/projects/{id}/repositories` |
2121
+ | `lib/git.ts` | `origin` remote detection, Azure DevOps URL parsing (SSH, HTTPS, legacy), and the worktree helpers of `watch` |
2122
+ | `lib/ide.ts` | IDE detection and MCP config writing |
2123
+ | `lib/registry.ts` | Registry HTTP client — one code path for skills and agents, `?branch=` |
2124
+ | `lib/http.ts` | HTTP client for the `/cli/*` endpoints — file bodies, `multipart`, binary download, HTTP status kept in the error |
2125
+ | `lib/scope.ts` | Project scope — `project_id`/`repository_id` from `productdock.json`, flags override |
2126
+ | `lib/artifacts.ts` | Install core: destinations, zip extraction, SHA256 fingerprint, drift |
2127
+ | `lib/frontmatter.ts` | Frontmatter adaptation per platform (agents) — port of the ai-tools installer |
2128
+ | `lib/artifact-commands.ts` | The `skill` and `agent` command groups, generic over artifact kind |
2129
+ | `lib/work-items.ts` | The `wi` command group — `list`, `prd`, `spec-context`, `bugs`, `prototypes` and `attachments` (with `--download`) over `/cli/work-items/*` |
2130
+ | `lib/work-item-attachments.ts` | The `wi` writes — `comment` over `/cli/work-items/comments` and `evidence` (multipart) over `/cli/work-items/qa-evidence` |
2131
+ | `lib/code.ts` | The `code` command group — `map` and `search` over `/cli/code/*` |
2132
+ | `lib/phase-artifacts.ts` | The `artifact` command group — `submit` over `/cli/artifacts`, body from a file |
2133
+ | `lib/prd-review.ts` | The `prd-review` command group — `get` (mandatory read-back) and `submit` over `/cli/prd-review`, and `claim`/`release` of the interactive Tech Review request |
2087
2134
  | `lib/evaluations.ts` | The `eval` command group — `submit` over `/cli/evaluations` (envelope from a file), `latest` over `/cli/evaluations/report` and `list` over `/cli/evaluations/repositories`, project-level |
2088
- | `lib/test-reports.ts` | The `test-report` command group — `submit` over `/cli/test-reports` (report from a file), project-level |
2089
- | `lib/sdlc-state.ts` | The `state` command group — `phase` over `/cli/state/phase` and `update` over `/cli/state`, the read/write pair over the same state |
2090
- | `lib/prd-review-jobs.ts` | Tech Review queue client — `claim` (by work item, interactive), `heartbeat`, `release` and `finish` over `/cli/prd-review-jobs/*` |
2091
- | `lib/watch.ts` | The `watch` command — the PRD Tech Review runner: disposable worktree, the two Claude Code stages, heartbeat — no question during the round |
2092
- | `lib/user-config.ts` | The user's `config.json` in the configuration directory, and the private atomic writer shared with the credentials |
2093
- | `lib/doctor.ts` | Diagnostics |
2094
- | `lib/exit.ts` | Exit code taxonomy — `CliError` and the error → code mapping |
2095
- | `lib/output.ts` | Output layer — JSON on `stdout`, prose on `stderr`, credential redaction |
2096
- | `lib/tty.ts` | TTY guard — fails fast instead of blocking on a prompt |
2097
- | `lib/types.d.ts` | Shared types — IDE keys, install targets, `productdock.json` shape |
2135
+ | `lib/test-reports.ts` | The `test-report` command group — `submit` over `/cli/test-reports` (report from a file), project-level |
2136
+ | `lib/sdlc-state.ts` | The `state` command group — `phase` over `/cli/state/phase` and `update` over `/cli/state`, the read/write pair over the same state |
2137
+ | `lib/prd-review-jobs.ts` | Tech Review queue client — `claim` (by work item, interactive), `heartbeat`, `release` and `finish` over `/cli/prd-review-jobs/*` |
2138
+ | `lib/watch.ts` | The `watch` command — the PRD Tech Review runner: disposable worktree, the two Claude Code stages, heartbeat — no question during the round |
2139
+ | `lib/user-config.ts` | The user's `config.json` in the configuration directory, and the private atomic writer shared with the credentials |
2140
+ | `lib/cli-version.ts` | The CLI's own version against the `latest` dist-tag on npm — used by `doctor` |
2141
+ | `lib/doctor.ts` | Diagnostics |
2142
+ | `lib/exit.ts` | Exit code taxonomy — `CliError` and the error → code mapping |
2143
+ | `lib/output.ts` | Output layer — JSON on `stdout`, prose on `stderr`, credential redaction |
2144
+ | `lib/tty.ts` | TTY guard — fails fast instead of blocking on a prompt |
2145
+ | `lib/types.d.ts` | Shared types — IDE keys, install targets, `productdock.json` shape |
2098
2146
 
2099
2147
  ### Building
2100
2148