@softdesignbrasil/productdock-cli 0.6.0 → 0.8.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 +502 -304
  2. package/dist/productdock.js +76 -76
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -79,7 +79,7 @@ productdock --json doctor
79
79
 
80
80
  Under `--json` the CLI:
81
81
 
82
- - writes **exactly one JSON document to `stdout`** — in success *and* in failure;
82
+ - writes **exactly one JSON document to `stdout`** — in success _and_ in failure;
83
83
  - suppresses prose and spinners, and sends every error message to `stderr`;
84
84
  - never prompts: a command that would have to ask something fails immediately
85
85
  instead of waiting for input that will never come.
@@ -98,11 +98,11 @@ there — `--help` and `--version`. Prose, spinners and error messages always go
98
98
 
99
99
  ### Exit codes
100
100
 
101
- | Code | Meaning |
102
- | ---- | ------------------------------------------------------------------------ |
103
- | `0` | Success — also when the user cancels a prompt (Ctrl-C) |
104
- | `1` | Business error — bad usage, missing configuration, failed remote call |
105
- | `2` | Authentication error — no session, or the refresh token was rejected |
101
+ | Code | Meaning |
102
+ | ---- | --------------------------------------------------------------------- |
103
+ | `0` | Success — also when the user cancels a prompt (Ctrl-C) |
104
+ | `1` | Business error — bad usage, missing configuration, failed remote call |
105
+ | `2` | Authentication error — no session, or the refresh token was rejected |
106
106
 
107
107
  An operation that would need a terminal and does not have one (`--json`, no TTY,
108
108
  CI) exits `1` with an explanation on `stderr` — it never blocks.
@@ -118,7 +118,7 @@ The file is looked up in the current directory **and in every directory above
118
118
  it**, the way Git finds `.git`. So a command run from inside
119
119
  `.productdock/work-items/<WI>/` — where the artifacts of a work item live, and
120
120
  therefore where you are working — resolves the same scope as one run from the
121
- repository root. `productdock init` and `productdock link` still *write* in the
121
+ repository root. `productdock init` and `productdock link` still _write_ in the
122
122
  current directory: linking from a subdirectory must not rewrite the parent's
123
123
  link.
124
124
 
@@ -134,9 +134,9 @@ productdock <operation> --project-id <uuid>
134
134
  productdock <operation> --repository-id <uuid>
135
135
  ```
136
136
 
137
- | Flag | Description |
138
- | ------------------------ | ---------------------------------------------------------------- |
139
- | `--project-id <uuid>` | Project the operation runs against — overrides `project.id` |
137
+ | Flag | Description |
138
+ | ------------------------ | ---------------------------------------------------------------------- |
139
+ | `--project-id <uuid>` | Project the operation runs against — overrides `project.id` |
140
140
  | `--repository-id <uuid>` | Repository the operation runs against — overrides `project.repository` |
141
141
 
142
142
  In a tree that was never linked, an operation that needs a project exits `1`,
@@ -200,16 +200,16 @@ Nothing is written until every decision is made: a `link` that fails leaves the
200
200
  directory exactly as it was, instead of a `productdock.json` carrying only the
201
201
  project.
202
202
 
203
- | Flag | Description |
204
- | ------------------------ | ------------------------------------------------------------------------------ |
205
- | `--project-id <uuid>` | Skip interactive project selection |
206
- | `--repository-id <uuid>` | Skip interactive repository selection; refused when the id is not in the project |
203
+ | Flag | Description |
204
+ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
205
+ | `--project-id <uuid>` | Skip interactive project selection |
206
+ | `--repository-id <uuid>` | Skip interactive repository selection; refused when the id is not in the project |
207
207
  | `--ide <ide>` | IDE to configure — `claude-code`, `cursor`, `vscode`, `claude-desktop` (repeatable). Replaces running `productdock init`, which needs a terminal |
208
- | `--install-mcp` | Install the MCP configuration without asking |
209
- | `--no-install-mcp` | Do not install the MCP configuration |
210
- | `--install-skills` | Install skills and agents without asking |
211
- | `--no-install-skills` | Do not install skills or agents |
212
- | `-y, --yes` | Answer yes to every confirmation |
208
+ | `--install-mcp` | Install the MCP configuration without asking |
209
+ | `--no-install-mcp` | Do not install the MCP configuration |
210
+ | `--install-skills` | Install skills and agents without asking |
211
+ | `--no-install-skills` | Do not install skills or agents |
212
+ | `-y, --yes` | Answer yes to every confirmation |
213
213
 
214
214
  Under `--json` the response document reports the resulting state of the link —
215
215
  project, repository (`null` when none was bound), IDEs, and whether the MCP and
@@ -249,11 +249,11 @@ Both groups share the same four subcommands and the same behaviour — `skill` m
249
249
 
250
250
  An agent is a **single file** upstream (`agents/{name}.agent.md`), not a folder like a skill, and it is installed under the name each platform expects:
251
251
 
252
- | Target | Written to | Frontmatter |
253
- | --- | --- | --- |
254
- | Claude Code (`claude-code`, `claude-desktop`) | `.claude/agents/{name}.md` | kept, minus the platform override blocks |
255
- | GitHub Copilot (`vscode`) | `.github/agents/{name}.agent.md` | `name`, `description`, `argument-hint`, plus the source's `copilot:` block |
256
- | Cursor | — | Cursor has no destination for agents; the target is skipped |
252
+ | Target | Written to | Frontmatter |
253
+ | --------------------------------------------- | -------------------------------- | -------------------------------------------------------------------------- |
254
+ | Claude Code (`claude-code`, `claude-desktop`) | `.claude/agents/{name}.md` | kept, minus the platform override blocks |
255
+ | GitHub Copilot (`vscode`) | `.github/agents/{name}.agent.md` | `name`, `description`, `argument-hint`, plus the source's `copilot:` block |
256
+ | Cursor | — | Cursor has no destination for agents; the target is skipped |
257
257
 
258
258
  This is the same layout the `ai-tools` installer writes, so an agent installed by either route is one file in one place.
259
259
 
@@ -289,12 +289,12 @@ productdock skill status
289
289
  productdock agent status
290
290
  ```
291
291
 
292
- | Subcommand | Description |
293
- | ----------------------- | ------------------------------------------------------------------------------- |
294
- | `list` | List what the registry offers. `--source internal\|third-party\|productdock` |
295
- | `install <name>` | Install into every target derived from `productdock.json`. `--version <version>`. Refuses if it already exists on disk unless `--force` |
296
- | `update [name]` | Update one, or every installed item. Up-to-date and locally modified items are skipped unless `--force` |
297
- | `status` | Report `up to date` / `outdated` / `modified` per installed item |
292
+ | Subcommand | Description |
293
+ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
294
+ | `list` | List what the registry offers. `--source internal\|third-party\|productdock` |
295
+ | `install <name>` | Install into every target derived from `productdock.json`. `--version <version>`. Refuses if it already exists on disk unless `--force` |
296
+ | `update [name]` | Update one, or every installed item. Up-to-date and locally modified items are skipped unless `--force` |
297
+ | `status` | Report `up to date` / `outdated` / `modified` per installed item |
298
298
 
299
299
  `status` compares a SHA256 fingerprint of the installed directory against the versions the registry knows about:
300
300
 
@@ -309,9 +309,9 @@ productdock agent status
309
309
 
310
310
  ### `productdock wi` — work items
311
311
 
312
- Five operations over the work items of a project, served by the
313
- `/cli/work-items/*` endpoints of the ProductDock API. Three of them read
314
- (`list`, `prd`, `spec-context`); two of them write to the work item —
312
+ Seven operations over the work items of a project, served by the
313
+ `/cli/work-items/*` endpoints of the ProductDock API. Five of them read
314
+ (`list`, `prd`, `spec-context`, `bugs`, `prototypes`); two of them write to the work item —
315
315
  `comment` posts a comment, `evidence` uploads a QA screenshot. Each has its own
316
316
  subsection below.
317
317
 
@@ -344,19 +344,19 @@ productdock wi spec-context PROD-168 --json --out spec-context.json
344
344
 
345
345
  ##### Parameters
346
346
 
347
- | Subcommand | Argument | Options |
348
- | -------------------- | -------- | -------------------------------------------------------------------------------------------------- |
349
- | `list` | — | `--status <status>` · `--search <term>` · `--repository-name <name>` · `--out <file>` |
350
- | `prd <ref>` | `<ref>` | `--out <file>` |
351
- | `spec-context <ref>` | `<ref>` | `--out <file>` |
347
+ | Subcommand | Argument | Options |
348
+ | -------------------- | -------- | ------------------------------------------------------------------------------------- |
349
+ | `list` | — | `--status <status>` · `--search <term>` · `--repository-name <name>` · `--out <file>` |
350
+ | `prd <ref>` | `<ref>` | `--out <file>` |
351
+ | `spec-context <ref>` | `<ref>` | `--out <file>` |
352
352
 
353
- | Parameter | Description |
354
- | ------------------------- | ------------------------------------------------------------------------------------------------------------- |
355
- | `<ref>` | Work item reference in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title. A number and a `PREFIX-N` are only resolvable with a project in scope — which the linked directory always provides |
356
- | `--status <status>` | Kanban column: `backlog`, `prd`, `specification`, `development`, `review`, `testing`, `homologation`, `production` |
357
- | `--search <term>` | Matches the work item **title OR description OR type** — one term, three columns |
358
- | `--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 |
359
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
353
+ | Parameter | Description |
354
+ | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
355
+ | `<ref>` | Work item reference in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title. A number and a `PREFIX-N` are only resolvable with a project in scope — which the linked directory always provides |
356
+ | `--status <status>` | Kanban column: `backlog`, `prd`, `specification`, `development`, `review`, `testing`, `homologation`, `production` |
357
+ | `--search <term>` | Matches the work item **title OR description OR type** — one term, three columns |
358
+ | `--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 |
359
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
360
360
 
361
361
  ##### Response format
362
362
 
@@ -364,28 +364,181 @@ Under `--json`, `stdout` carries one document with the API response untouched
364
364
  under `data`:
365
365
 
366
366
  ```jsonc
367
- { "ok": true, "operation": "get_prd", "data": { /* the body below */ } }
367
+ {
368
+ "ok": true,
369
+ "operation": "get_prd",
370
+ "data": {
371
+ /* the body below */
372
+ },
373
+ }
368
374
  ```
369
375
 
370
376
  `operation` is the canonical operation name — `get_prd`, `list_work_items` or
371
377
  `get_spec_context`. Without `--json`, `stdout` stays empty and a human-readable
372
378
  summary goes to `stderr`.
373
379
 
374
- | Subcommand | `data` |
375
- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
376
- | `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 |
377
- | `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 |
378
- | `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`) |
380
+ | Subcommand | `data` |
381
+ | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
382
+ | `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 |
383
+ | `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 |
384
+ | `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`) |
379
385
 
380
386
  ##### Exit codes
381
387
 
382
388
  The general table above holds; this is how each condition maps to it:
383
389
 
384
- | Code | When |
385
- | ---- | ---------------------------------------------------------------------------------------------------------------------------- |
386
- | `0` | The operation ran — including a work item with no PRD |
390
+ | Code | When |
391
+ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
392
+ | `0` | The operation ran — including a work item with no PRD |
387
393
  | `1` | Directory not linked and no `--project-id`; missing `<ref>`; `--repository-id` and `--repository-name` together; missing required scope (`400`); no access to the project (`403`); work item not found **or not visible to you** (`404` — the two are deliberately indistinguishable); any other API failure |
388
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
394
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
395
+
396
+ #### `productdock wi bugs`
397
+
398
+ Lists the bugs of a work item's **Quality** tab, served by the
399
+ `/cli/work-items/qa-issues` endpoint of the ProductDock API. It is the same
400
+ operation the MCP server exposes as the `get_qa_issues` tool, and it returns the
401
+ same body — the CLI and the MCP call the same code on the server, so reading
402
+ every lineage, keeping one entry per bug id at its latest version, the status
403
+ filter and the `summary` are one implementation, not two.
404
+
405
+ **A bug belongs to the work item, not to a repository.** The bugs recorded on
406
+ the platform carry no repository and the ones recorded by the skill do, and the
407
+ command returns both: the `project.repository` of `productdock.json` is **not**
408
+ sent, exactly as in `wi prd`.
409
+
410
+ ```bash
411
+ # Every bug of the work item, whatever its status
412
+ productdock wi bugs PROD-222
413
+
414
+ # Only the open ones, machine-readable — what the workflow skill reads
415
+ productdock wi bugs PROD-222 --status open --json
416
+
417
+ # Saved to a file
418
+ productdock wi bugs PROD-222 --json --out bugs.json
419
+ ```
420
+
421
+ ##### Parameters
422
+
423
+ | Subcommand | Argument | Options |
424
+ | ------------ | -------- | ------------------------------------ |
425
+ | `bugs <ref>` | `<ref>` | `--status <status>` · `--out <file>` |
426
+
427
+ | Parameter | Description |
428
+ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
429
+ | `<ref>` | **Required.** Work item reference in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
430
+ | `--status <status>` | Bug status at its latest version: `open`, `resolved`, `invalid`, or `all`. Sent as-is — the CLI keeps no list of its own, and an unknown value is refused **by the server**, which names the accepted ones. Without the flag no filter is sent and the server's default (`all`) applies |
431
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
432
+
433
+ ##### Response format
434
+
435
+ Under `--json`, `stdout` carries one document with the API response untouched
436
+ under `data`:
437
+
438
+ ```jsonc
439
+ {
440
+ "ok": true,
441
+ "operation": "get_qa_issues",
442
+ "data": {
443
+ /* the body below */
444
+ },
445
+ }
446
+ ```
447
+
448
+ Without `--json`, `stdout` stays empty and a summary goes to `stderr`: one line
449
+ per bug — id, status, severity, title — and the count of open ones.
450
+
451
+ `data` is `{ summary, count, issues[] }`:
452
+
453
+ | Field | Meaning |
454
+ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
455
+ | `summary` | Bug counts by status — `{ open, resolved, invalid }` — over the bugs that came back, after `--status` |
456
+ | `count` | How many bugs came back |
457
+ | `issues[]` | One entry per bug id, at its latest version: `{ id, title, severity, priority, type, status, tc_ref, evidence[], body, source, repository_id, version, edited_by, created_at }`. `body` is the bug's markdown, untouched; `evidence[]` is `{ label, url? }` |
458
+
459
+ A work item with no bugs returns `count: 0` and `issues: []`, which is a
460
+ **success**, not an error.
461
+
462
+ ##### Exit codes
463
+
464
+ The general table above holds; this is how each condition maps to it:
465
+
466
+ | Code | When |
467
+ | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
468
+ | `0` | The bugs were read — including a work item with no bugs |
469
+ | `1` | Missing `<ref>`; directory not linked and no `--project-id`; unknown `--status` (`400`, refused by the server); no access to the project (`403`); work item not found **or not visible to you** (`404` — the two are deliberately indistinguishable); any other API failure |
470
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
471
+
472
+ #### `productdock wi prototypes`
473
+
474
+ Lists the prototypes registered on a work item — the links on its
475
+ **Refinement** tab (Figma, Claude Design or any other link), served by the
476
+ `/cli/work-items/prototypes` endpoint of the ProductDock API. It is the same
477
+ operation the MCP server exposes as the `get_work_item_prototypes` tool, and it
478
+ returns the same body — the CLI and the MCP call the same code on the server, so
479
+ the ordering and the author lookup are one implementation, not two.
480
+
481
+ **A prototype belongs to the work item, not to a repository.** The
482
+ `project.repository` of `productdock.json` is **not** sent, exactly as in
483
+ `wi bugs`.
484
+
485
+ ```bash
486
+ # Every prototype of the work item, oldest first
487
+ productdock wi prototypes PROD-227
488
+
489
+ # Machine-readable, saved to a file — what the workflow skill reads
490
+ productdock wi prototypes PROD-227 --json --out prototypes.json
491
+ ```
492
+
493
+ ##### Parameters
494
+
495
+ | Subcommand | Argument | Options |
496
+ | ------------------ | -------- | -------------- |
497
+ | `prototypes <ref>` | `<ref>` | `--out <file>` |
498
+
499
+ | Parameter | Description |
500
+ | -------------- | ----------------------------------------------------------------------------------------------------------------- |
501
+ | `<ref>` | **Required.** Work item reference in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
502
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
503
+
504
+ ##### Response format
505
+
506
+ Under `--json`, `stdout` carries one document with the API response untouched
507
+ under `data`:
508
+
509
+ ```jsonc
510
+ {
511
+ "ok": true,
512
+ "operation": "get_work_item_prototypes",
513
+ "data": {
514
+ /* the body below */
515
+ },
516
+ }
517
+ ```
518
+
519
+ Without `--json`, `stdout` stays empty and a summary goes to `stderr`: one line
520
+ per prototype — tool, name, URL.
521
+
522
+ `data` is `{ work_item_id, count, prototypes[] }`:
523
+
524
+ | Field | Meaning |
525
+ | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
526
+ | `work_item_id` | The work item the reference resolved to |
527
+ | `count` | How many prototypes came back — always `prototypes.length` |
528
+ | `prototypes[]` | In order of creation, oldest first: `{ id, url, name, tool, created_by, author_name, created_at, updated_at }`. `tool` is `figma`, `claude_design` or `link`; `author_name` is the author's full name, or their e-mail when there is none. `created_by` and `author_name` may be `null` |
529
+
530
+ A work item with no prototypes returns `count: 0` and `prototypes: []`, which
531
+ is a **success**, not an error.
532
+
533
+ ##### Exit codes
534
+
535
+ The general table above holds; this is how each condition maps to it:
536
+
537
+ | Code | When |
538
+ | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
539
+ | `0` | The prototypes were read — including a work item with no prototypes |
540
+ | `1` | Missing `<ref>`; directory not linked and no `--project-id`; missing reference (`400`); no access to the project (`403`); work item not found **or not visible to you** (`404` — the two are deliberately indistinguishable); any other API failure |
541
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
389
542
 
390
543
  #### `productdock wi comment`
391
544
 
@@ -417,17 +570,17 @@ productdock wi comment qa-summary.md --ref PROD-168 \
417
570
 
418
571
  ##### Parameters
419
572
 
420
- | Subcommand | Argument | Options |
421
- | ------------------ | -------- | -------------------------------------------------- |
422
- | `comment [file]` | `[file]` | `--ref` · `--content` · `--label` · `--out` |
573
+ | Subcommand | Argument | Options |
574
+ | ---------------- | -------- | ------------------------------------------- |
575
+ | `comment [file]` | `[file]` | `--ref` · `--content` · `--label` · `--out` |
423
576
 
424
- | Parameter | Description |
425
- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
426
- | `[file]` | Path to the comment body on disk, read as UTF-8 and sent verbatim — not trimmed, not re-encoded, not truncated. Optional only in the sense that `--content` replaces it; passing both is refused (exit `1`), not silently resolved one way |
427
- | `--ref <ref>` | **Required.** Work item the comment belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
428
- | `--content <text>` | The comment body inline, as an alternative to the file |
429
- | `--label <label>` | Label of the agent signing the comment. Defaults to whatever the server applies — the CLI keeps no copy of that default |
430
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
577
+ | Parameter | Description |
578
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
579
+ | `[file]` | Path to the comment body on disk, read as UTF-8 and sent verbatim — not trimmed, not re-encoded, not truncated. Optional only in the sense that `--content` replaces it; passing both is refused (exit `1`), not silently resolved one way |
580
+ | `--ref <ref>` | **Required.** Work item the comment belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
581
+ | `--content <text>` | The comment body inline, as an alternative to the file |
582
+ | `--label <label>` | Label of the agent signing the comment. Defaults to whatever the server applies — the CLI keeps no copy of that default |
583
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
431
584
 
432
585
  ##### Response format
433
586
 
@@ -435,26 +588,32 @@ Under `--json`, `stdout` carries one document with the API response untouched
435
588
  under `data`:
436
589
 
437
590
  ```jsonc
438
- { "ok": true, "operation": "post_work_item_comment", "data": { /* the body below */ } }
591
+ {
592
+ "ok": true,
593
+ "operation": "post_work_item_comment",
594
+ "data": {
595
+ /* the body below */
596
+ },
597
+ }
439
598
  ```
440
599
 
441
600
  Without `--json`, `stdout` stays empty and a one-line summary goes to `stderr`.
442
601
 
443
- | Field | Meaning |
444
- | -------------- | ---------------------------------------------------------------------------- |
445
- | `success` | Always `true` on a `0` exit — the comment was written |
446
- | `comment_id` | Id of the comment just created |
447
- | `work_item_id` | The work item it landed on, resolved server-side from `--ref` |
602
+ | Field | Meaning |
603
+ | -------------- | ------------------------------------------------------------- |
604
+ | `success` | Always `true` on a `0` exit — the comment was written |
605
+ | `comment_id` | Id of the comment just created |
606
+ | `work_item_id` | The work item it landed on, resolved server-side from `--ref` |
448
607
 
449
608
  ##### Exit codes
450
609
 
451
610
  The general table above holds; this is how each condition maps to it:
452
611
 
453
- | Code | When |
454
- | ---- | ---------------------------------------------------------------------------------------------------------------------------- |
455
- | `0` | The comment was written |
612
+ | Code | When |
613
+ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
614
+ | `0` | The comment was written |
456
615
  | `1` | Missing `--ref`; no body (no file and no `--content`); file and `--content` together; unreadable file; directory not linked and no `--project-id`; empty body (`400`); no permission to edit work items (`403`); work item not found **or not visible to you** (`404` — the two are deliberately indistinguishable); any other API failure |
457
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
616
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
458
617
 
459
618
  #### `productdock wi evidence`
460
619
 
@@ -468,7 +627,7 @@ difference is the point of the command.
468
627
  Over MCP the tool cannot see your filesystem, so it returns a `signed_url` per
469
628
  filename and instructs the caller to `PUT` the bytes to Storage itself: the
470
629
  second half happens outside the contract, and the server never sees the file —
471
- the MIME and the size it checks are the ones you *declared*. Here the file goes
630
+ the MIME and the size it checks are the ones you _declared_. Here the file goes
472
631
  up in a single call, and MIME and size are revalidated **on the bytes that
473
632
  arrived**. Anything that is not a PNG, JPEG, GIF or WEBP is refused, as is
474
633
  anything over 10 MB.
@@ -502,15 +661,15 @@ done
502
661
 
503
662
  ##### Parameters
504
663
 
505
- | Subcommand | Argument | Options |
506
- | -------------------- | -------- | -------------------- |
507
- | `evidence <file>` | `<file>` | `--ref` · `--out` |
664
+ | Subcommand | Argument | Options |
665
+ | ----------------- | -------- | ----------------- |
666
+ | `evidence <file>` | `<file>` | `--ref` · `--out` |
508
667
 
509
- | Parameter | Description |
510
- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- |
511
- | `<file>` | **Required.** Path to the screenshot on disk. The bytes are sent as `multipart/form-data`, unchanged. The name on your disk becomes the readable tail of the path in the bucket, sanitised server-side; it has no bearing on *where* the object lands |
512
- | `--ref <ref>` | **Required.** Work item the evidence belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
513
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
668
+ | Parameter | Description |
669
+ | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
670
+ | `<file>` | **Required.** Path to the screenshot on disk. The bytes are sent as `multipart/form-data`, unchanged. The name on your disk becomes the readable tail of the path in the bucket, sanitised server-side; it has no bearing on _where_ the object lands |
671
+ | `--ref <ref>` | **Required.** Work item the evidence belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
672
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
514
673
 
515
674
  The work item and the project travel as **query parameters**, not as form
516
675
  fields. That is not a preference: on the server, guards run before the multipart
@@ -523,13 +682,19 @@ Under `--json`, `stdout` carries one document with the API response untouched
523
682
  under `data`:
524
683
 
525
684
  ```jsonc
526
- { "ok": true, "operation": "upload_qa_evidence", "data": { /* the body below */ } }
685
+ {
686
+ "ok": true,
687
+ "operation": "upload_qa_evidence",
688
+ "data": {
689
+ /* the body below */
690
+ },
691
+ }
527
692
  ```
528
693
 
529
694
  Without `--json`, `stdout` stays empty and a two-line summary goes to `stderr`.
530
695
 
531
- | Field | Meaning |
532
- | -------------- | ----------------------------------------------------------------------------------------------------------------- |
696
+ | Field | Meaning |
697
+ | -------------- | -------------------------------------------------------------------------------------------------------------- |
533
698
  | `success` | Always `true` on a `0` exit — the object was written |
534
699
  | `bucket` | `qa-evidence` — the private bucket, the same one the portal and the IDE write to |
535
700
  | `path` | Path of the object, **derived server-side**. This is the value that goes in `evidence[].url` of `qa-result/v1` |
@@ -542,11 +707,11 @@ Without `--json`, `stdout` stays empty and a two-line summary goes to `stderr`.
542
707
 
543
708
  The general table above holds; this is how each condition maps to it:
544
709
 
545
- | Code | When |
546
- | ---- | ---------------------------------------------------------------------------------------------------------------------------- |
547
- | `0` | The evidence was stored |
710
+ | Code | When |
711
+ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
712
+ | `0` | The evidence was stored |
548
713
  | `1` | Missing `<file>` or `--ref`; unreadable file; directory not linked and no `--project-id`; **file type not accepted (`400` `unsupported_file_type`)**; **file over 10 MB (`400` `file_too_large`, or `413` when the request itself is cut short)**; empty file (`400` `empty_file`); no file received (`400` `file_required`); no permission to edit work items (`403`); work item not found **or not visible to you** (`404` — the two are deliberately indistinguishable); any other API failure |
549
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
714
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
550
715
 
551
716
  ### `productdock code` — reading the repository and its code
552
717
 
@@ -579,17 +744,17 @@ documented once at the top of this section.
579
744
 
580
745
  #### Parameters
581
746
 
582
- | Subcommand | Argument | Options |
583
- | ------------------ | ------------- | --------------------------------------------- |
584
- | `map` | — | `--out <file>` |
585
- | `search <query>` | `<query>` | `--top-k <n>` · `--out <file>` |
747
+ | Subcommand | Argument | Options |
748
+ | ---------------- | --------- | ------------------------------ |
749
+ | `map` | — | `--out <file>` |
750
+ | `search <query>` | `<query>` | `--top-k <n>` · `--out <file>` |
586
751
 
587
- | Parameter | Description |
588
- | ------------------------ | ----------------------------------------------------------------------------------------------------------------- |
589
- | `<query>` | What to look for, in natural language. It is embedded and matched server-side against the indexed code |
752
+ | Parameter | Description |
753
+ | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
754
+ | `<query>` | What to look for, in natural language. It is embedded and matched server-side against the indexed code |
590
755
  | `--repository-id <uuid>` | Narrows the operation to one repository **of the project in scope**. Unlike `wi list`, the `project.repository` of `productdock.json` is **not** applied by default: narrowing a map or a search without being asked hides results, and a hidden result is the one nobody notices. An id from another project returns an empty set, exactly as it does over MCP |
591
- | `--top-k <n>` | How many snippets to return — a positive integer. The server caps it (50) and defaults to 10. A non-numeric value is refused (exit `1`), never silently ignored |
592
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
756
+ | `--top-k <n>` | How many snippets to return — a positive integer. The server caps it (50) and defaults to 10. A non-numeric value is refused (exit `1`), never silently ignored |
757
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
593
758
 
594
759
  #### Response format
595
760
 
@@ -597,27 +762,33 @@ Under `--json`, `stdout` carries one document with the API response untouched
597
762
  under `data`:
598
763
 
599
764
  ```jsonc
600
- { "ok": true, "operation": "search_code", "data": { /* the body below */ } }
765
+ {
766
+ "ok": true,
767
+ "operation": "search_code",
768
+ "data": {
769
+ /* the body below */
770
+ },
771
+ }
601
772
  ```
602
773
 
603
774
  `operation` is the canonical operation name — `get_repo_map` or `search_code`.
604
775
  Without `--json`, `stdout` stays empty and a human-readable summary goes to
605
776
  `stderr`.
606
777
 
607
- | Subcommand | `data` |
608
- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
778
+ | Subcommand | `data` |
779
+ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
609
780
  | `map` | `{ repositories[] }`; each entry is `{ repository_id, repository_name, default_branch, indexed, summaries_pending, entry_points[], file_map[], total_files, total_chunks, last_indexed_at }`. `file_map` is capped at 200 files. A repository that was never indexed comes back with `indexed: false` — a **success**, not an error |
610
- | `search` | `{ results[] }`; each hit is `{ file_path, repository_id, repository_name, content, language, similarity }` — the snippet plus where it came from. `content` is truncated at 1500 characters. Nothing indexed for the scope means `results: []`, which is also a success |
781
+ | `search` | `{ results[] }`; each hit is `{ file_path, repository_id, repository_name, content, language, similarity }` — the snippet plus where it came from. `content` is truncated at 1500 characters. Nothing indexed for the scope means `results: []`, which is also a success |
611
782
 
612
783
  #### Exit codes
613
784
 
614
785
  The general table above holds; this is how each condition maps to it:
615
786
 
616
- | Code | When |
617
- | ---- | ---------------------------------------------------------------------------------------------------------------------------- |
618
- | `0` | The operation ran — including an empty map and an empty result set |
787
+ | Code | When |
788
+ | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
789
+ | `0` | The operation ran — including an empty map and an empty result set |
619
790
  | `1` | Directory not linked and no `--project-id`; missing `<query>`; non-numeric `--top-k`; missing required scope (`400`); no access to the project — or to **any** of the projects owning the repositories asked for (`403`); any other API failure |
620
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
791
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
621
792
 
622
793
  ### `productdock artifact` — writing SDLC phase artifacts
623
794
 
@@ -674,23 +845,23 @@ documented once at the top of this section.
674
845
 
675
846
  ##### Parameters
676
847
 
677
- | Subcommand | Argument | Options |
678
- | ------------------ | ------------ | -------------------------------------------------------------------------------------------------------------------------------- |
679
- | `submit [file]` | `[file]` | `--ref` · `--phase` · `--type` · `--content` · `--mode` · `--patch` · `--status` · `--dry-run` · `--repository-name` · `--out` |
680
-
681
- | Parameter | Description |
682
- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
683
- | `[file]` | Path to the artifact body on disk, read as UTF-8 and sent verbatim — not trimmed, not re-encoded, not truncated. Optional: replaced by `--content`, and not needed at all under `--mode patch`. Passing both the file and `--content` is refused (exit `1`), not silently resolved one way |
684
- | `--ref <ref>` | **Required.** Work item the artifact belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
685
- | `--phase <phase>` | **Required.** SDLC phase of the artifact — e.g. `specify`, `design`, `tasks`, `test-design`, `qa-run`. The CLI keeps no list of its own: whatever the server accepts, the command sends |
686
- | `--type <type>` | **Required.** Artifact type — e.g. `spec`, `design`, `tasks`, `qa-plan`, `qa-result`, `qa-issue`. Same rule as `--phase` |
687
- | `--content <text>` | The artifact body inline, as an alternative to the file |
688
- | `--mode <full\|patch>` | `full` (default) sends the whole artifact; `patch` sends only the entries that changed. Any other value is refused (exit `1`) before any network call |
689
- | `--patch <json>` | Required under `--mode patch`, and only there: a JSON object with the entries to reconcile by key — tasks by `id`, `qa-result` test cases by `tc_ref`, gates by `name`, coverage by `criterion`, scalars under `set`. Malformed JSON fails locally, naming the flag. Passing it without `--mode patch` is refused (exit `1`) rather than ignored: an ignored patch would silently become a full submission |
690
- | `--status <done\|skip>` | `done` (default) records a real artifact; `skip` records a phase that was deliberately skipped |
848
+ | Subcommand | Argument | Options |
849
+ | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
850
+ | `submit [file]` | `[file]` | `--ref` · `--phase` · `--type` · `--content` · `--mode` · `--patch` · `--status` · `--dry-run` · `--repository-name` · `--out` |
851
+
852
+ | Parameter | Description |
853
+ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
854
+ | `[file]` | Path to the artifact body on disk, read as UTF-8 and sent verbatim — not trimmed, not re-encoded, not truncated. Optional: replaced by `--content`, and not needed at all under `--mode patch`. Passing both the file and `--content` is refused (exit `1`), not silently resolved one way |
855
+ | `--ref <ref>` | **Required.** Work item the artifact belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
856
+ | `--phase <phase>` | **Required.** SDLC phase of the artifact — e.g. `specify`, `design`, `tasks`, `test-design`, `qa-run`. The CLI keeps no list of its own: whatever the server accepts, the command sends |
857
+ | `--type <type>` | **Required.** Artifact type — e.g. `spec`, `design`, `tasks`, `qa-plan`, `qa-result`, `qa-issue`. Same rule as `--phase` |
858
+ | `--content <text>` | The artifact body inline, as an alternative to the file |
859
+ | `--mode <full\|patch>` | `full` (default) sends the whole artifact; `patch` sends only the entries that changed. Any other value is refused (exit `1`) before any network call |
860
+ | `--patch <json>` | Required under `--mode patch`, and only there: a JSON object with the entries to reconcile by key — tasks by `id`, `qa-result` test cases by `tc_ref`, gates by `name`, coverage by `criterion`, scalars under `set`. Malformed JSON fails locally, naming the flag. Passing it without `--mode patch` is refused (exit `1`) rather than ignored: an ignored patch would silently become a full submission |
861
+ | `--status <done\|skip>` | `done` (default) records a real artifact; `skip` records a phase that was deliberately skipped |
691
862
  | `--dry-run` | Runs the whole server-side validation — envelope, patch merge, `BUG-N` collision — and writes **no version**. It exists because every submission creates a new version: resending "to see if it works now" was recorded in the work item's history as if it were work, and there is no way to clean it up. The response carries `dry_run: true` and `would_write_version` instead of `artifact_id`/`version` |
692
- | `--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`). The repository is part of the artifact's lineage, so picking the wrong one writes a version nobody is reading |
693
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
863
+ | `--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`). The repository is part of the artifact's lineage, so picking the wrong one writes a version nobody is reading |
864
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
694
865
 
695
866
  ##### Response format
696
867
 
@@ -698,32 +869,38 @@ Under `--json`, `stdout` carries one document with the API response untouched
698
869
  under `data`:
699
870
 
700
871
  ```jsonc
701
- { "ok": true, "operation": "submit_artifact", "data": { /* the body below */ } }
872
+ {
873
+ "ok": true,
874
+ "operation": "submit_artifact",
875
+ "data": {
876
+ /* the body below */
877
+ },
878
+ }
702
879
  ```
703
880
 
704
881
  Without `--json`, `stdout` stays empty and a one-line summary goes to `stderr`.
705
882
 
706
- | Field | Meaning |
707
- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
708
- | `success` | Always `true` on a `0` exit. It says the call was accepted — **not** that the JSON envelope inside the body was read; for that, see `patched` |
709
- | `artifact_id` | Id of the version just written. It is a **new id on every submission**: the artifact's identity is (work item + phase + type), and each submission is one more version of that lineage |
710
- | `version` | Version number within the lineage, starting at 1. It never collides: concurrent submissions retry server-side |
711
- | `phase_advanced_to` | The phase the work item moved to, or `null`. Submitting an artifact does not advance a phase by itself |
712
- | `repository_id` | Repository the version was recorded under, or `null` for artifacts whose scope is the whole work item (`prd`, and anything in the `define` phase) |
713
- | `repository_name` | Reserved; currently `null` |
714
- | `patched` | **Only under `--mode patch`:** which keys the merge actually matched or appended. It is the proof that the envelope was read and the patch landed where it was meant to |
715
- | `parsed` | **Only for `--type tasks`, in both modes:** the task ids the server read inside the `tasks/v1` envelope. Same job as `patched` — it answers "did the server *interpret* my body?", which `success: true` cannot |
716
- | `dry_run` | **Only under `--dry-run`:** `true`, alongside `would_write_version`. Nothing was written |
883
+ | Field | Meaning |
884
+ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
885
+ | `success` | Always `true` on a `0` exit. It says the call was accepted — **not** that the JSON envelope inside the body was read; for that, see `patched` |
886
+ | `artifact_id` | Id of the version just written. It is a **new id on every submission**: the artifact's identity is (work item + phase + type), and each submission is one more version of that lineage |
887
+ | `version` | Version number within the lineage, starting at 1. It never collides: concurrent submissions retry server-side |
888
+ | `phase_advanced_to` | The phase the work item moved to, or `null`. Submitting an artifact does not advance a phase by itself |
889
+ | `repository_id` | Repository the version was recorded under, or `null` for artifacts whose scope is the whole work item (`prd`, and anything in the `define` phase) |
890
+ | `repository_name` | Reserved; currently `null` |
891
+ | `patched` | **Only under `--mode patch`:** which keys the merge actually matched or appended. It is the proof that the envelope was read and the patch landed where it was meant to |
892
+ | `parsed` | **Only for `--type tasks`, in both modes:** the task ids the server read inside the `tasks/v1` envelope. Same job as `patched` — it answers "did the server _interpret_ my body?", which `success: true` cannot |
893
+ | `dry_run` | **Only under `--dry-run`:** `true`, alongside `would_write_version`. Nothing was written |
717
894
 
718
895
  ##### Exit codes
719
896
 
720
897
  The general table above holds; this is how each condition maps to it:
721
898
 
722
- | Code | When |
723
- | ---- | ---------------------------------------------------------------------------------------------------------------------------- |
724
- | `0` | The version was written |
899
+ | Code | When |
900
+ | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
901
+ | `0` | The version was written |
725
902
  | `1` | Missing `--ref`, `--phase` or `--type`; no body in `--mode full`; file and `--content` together; unreadable file; `--mode` outside `full\|patch`; `--mode patch` without `--patch`, or with malformed `--patch`; `--patch` without `--mode patch`; `--repository-id` and `--repository-name` together; directory not linked and no `--project-id`; **invalid envelope (`400`) — the response names the offending field, and nothing was written**; no permission to edit work items (`403`); work item not found **or not visible to you** (`404` — the two are deliberately indistinguishable); any other API failure |
726
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
903
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
727
904
 
728
905
  #### `productdock artifact commit`
729
906
 
@@ -772,20 +949,20 @@ documented once at the top of this section.
772
949
 
773
950
  ##### Parameters
774
951
 
775
- | Subcommand | Argument | Options |
776
- | ------------------ | ------------ | --------------------------------------------------------------------------------------------- |
777
- | `commit [file]` | `[file]` | `--ref` · `--phase` · `--type` · `--content` · `--branch` · `--repository-name` · `--out` |
952
+ | Subcommand | Argument | Options |
953
+ | --------------- | -------- | ----------------------------------------------------------------------------------------- |
954
+ | `commit [file]` | `[file]` | `--ref` · `--phase` · `--type` · `--content` · `--branch` · `--repository-name` · `--out` |
778
955
 
779
- | Parameter | Description |
780
- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
956
+ | Parameter | Description |
957
+ | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
781
958
  | `[file]` | Path to the artifact body on disk, read as UTF-8 and sent verbatim — not trimmed, not re-encoded, not truncated. Optional: replaced by `--content`. Passing both the file and `--content` is refused (exit `1`), not silently resolved one way. **It has no bearing on where the file lands in the repository** |
782
- | `--ref <ref>` | **Required.** Work item the artifact belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
783
- | `--phase <phase>` | **Required.** SDLC phase of the artifact — e.g. `specify`, `design`, `tasks`, `qa-run`. The CLI keeps no list of its own: whatever the server accepts, the command sends |
784
- | `--type <type>` | **Required.** Artifact type — e.g. `spec`, `design`, `tasks`, `plan`, `qa-report`. It decides the filename: `plan` → `plan.md`, `qa-report` → `qa-run.md`, anything else → `{type}.md` |
785
- | `--content <text>` | The artifact body inline, as an alternative to the file |
786
- | `--branch <branch>` | Branch of the commit. Defaults to the repository's default branch; a branch that does not exist yet is created from the default one, server-side |
787
- | `--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`) |
788
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
959
+ | `--ref <ref>` | **Required.** Work item the artifact belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
960
+ | `--phase <phase>` | **Required.** SDLC phase of the artifact — e.g. `specify`, `design`, `tasks`, `qa-run`. The CLI keeps no list of its own: whatever the server accepts, the command sends |
961
+ | `--type <type>` | **Required.** Artifact type — e.g. `spec`, `design`, `tasks`, `plan`, `qa-report`. It decides the filename: `plan` → `plan.md`, `qa-report` → `qa-run.md`, anything else → `{type}.md` |
962
+ | `--content <text>` | The artifact body inline, as an alternative to the file |
963
+ | `--branch <branch>` | Branch of the commit. Defaults to the repository's default branch; a branch that does not exist yet is created from the default one, server-side |
964
+ | `--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`) |
965
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
789
966
 
790
967
  ##### Response format
791
968
 
@@ -793,27 +970,33 @@ Under `--json`, `stdout` carries one document with the API response untouched
793
970
  under `data`:
794
971
 
795
972
  ```jsonc
796
- { "ok": true, "operation": "commit_artifact", "data": { /* the body below */ } }
973
+ {
974
+ "ok": true,
975
+ "operation": "commit_artifact",
976
+ "data": {
977
+ /* the body below */
978
+ },
979
+ }
797
980
  ```
798
981
 
799
982
  Without `--json`, `stdout` stays empty and a two-line summary goes to `stderr`.
800
983
 
801
- | Field | Meaning |
802
- | ----------- | ------------------------------------------------------------------------------------------------------------ |
803
- | `success` | Always `true` on a `0` exit — the push was applied |
804
- | `path` | Path the artifact was written to, **derived server-side** from the work item |
805
- | `branch` | Branch the commit landed on — the one you asked for, or the repository default |
806
- | `commit_id` | SHA of the commit, or `null` when Azure DevOps returned no commit for the push |
984
+ | Field | Meaning |
985
+ | ----------- | ------------------------------------------------------------------------------ |
986
+ | `success` | Always `true` on a `0` exit — the push was applied |
987
+ | `path` | Path the artifact was written to, **derived server-side** from the work item |
988
+ | `branch` | Branch the commit landed on — the one you asked for, or the repository default |
989
+ | `commit_id` | SHA of the commit, or `null` when Azure DevOps returned no commit for the push |
807
990
 
808
991
  ##### Exit codes
809
992
 
810
993
  The general table above holds; this is how each condition maps to it:
811
994
 
812
- | Code | When |
813
- | ---- | ---------------------------------------------------------------------------------------------------------------------------- |
814
- | `0` | The commit was pushed |
995
+ | Code | When |
996
+ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
997
+ | `0` | The commit was pushed |
815
998
  | `1` | Missing `--ref`, `--phase` or `--type`; no body (no file and no `--content`); file and `--content` together; unreadable file; `--repository-id` and `--repository-name` together; directory not linked and no `--project-id`; **linked directory with no repository, and no `--repository-name`** — the target is mandatory; missing required scope (`400`); work item outside the project in scope (`400`); repository not found in the project (`400`); **your Microsoft connection needs to be re-established (`409` `azure_reconnect_required`) — reconnect the account in ProductDock and run the command again**; no permission to edit work items (`403`); no access to the project (`403`); any other API failure |
816
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
999
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
817
1000
 
818
1001
  ### `productdock prd-review` — the PRD critical review
819
1002
 
@@ -854,19 +1037,19 @@ documented once at the top of this section.
854
1037
 
855
1038
  #### Parameters
856
1039
 
857
- | Subcommand | Argument | Options |
858
- | ----------------- | -------- | -------------------------------------------------------------- |
859
- | `get <ref>` | `<ref>` | `--status <status>` · `--limit <n>` · `--out <file>` |
860
- | `submit [file]` | `[file]` | `--ref` · `--content` · `--out` |
1040
+ | Subcommand | Argument | Options |
1041
+ | --------------- | -------- | ---------------------------------------------------- |
1042
+ | `get <ref>` | `<ref>` | `--status <status>` · `--limit <n>` · `--out <file>` |
1043
+ | `submit [file]` | `[file]` | `--ref` · `--content` · `--out` |
861
1044
 
862
- | Parameter | Description |
863
- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
864
- | `<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` and the `--ref` flag of `submit`, so the two can never be swapped by accident |
865
- | `--status <status>` | Thread status filter: `open`, `resolved`, `ignored`, `superseded`, 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 |
866
- | `--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 |
867
- | `[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 |
868
- | `--content <text>` | The review body inline, as an alternative to the file |
869
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1045
+ | Parameter | Description |
1046
+ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1047
+ | `<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` and the `--ref` flag of `submit`, so the two can never be swapped by accident |
1048
+ | `--status <status>` | Thread status filter: `open`, `resolved`, `ignored`, `superseded`, 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 |
1049
+ | `--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 |
1050
+ | `[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 |
1051
+ | `--content <text>` | The review body inline, as an alternative to the file |
1052
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
870
1053
 
871
1054
  #### Response format
872
1055
 
@@ -874,7 +1057,13 @@ Under `--json`, `stdout` carries one document with the API response untouched
874
1057
  under `data`:
875
1058
 
876
1059
  ```jsonc
877
- { "ok": true, "operation": "get_prd_review", "data": { /* the body below */ } }
1060
+ {
1061
+ "ok": true,
1062
+ "operation": "get_prd_review",
1063
+ "data": {
1064
+ /* the body below */
1065
+ },
1066
+ }
878
1067
  ```
879
1068
 
880
1069
  `operation` is the canonical operation name — `get_prd_review` or
@@ -883,39 +1072,39 @@ summary goes to `stderr`.
883
1072
 
884
1073
  `get` returns `{ work_item_id, brief_version, summary, count, threads[] }`:
885
1074
 
886
- | Field | Meaning |
887
- | --------------------- | ---------------------------------------------------------------------------------------------------------------------- |
888
- | `summary` | Thread counts by status: `{ open, resolved, ignored, superseded }`. **`summary.open` is the number to check before composing the next round** |
889
- | `count` | How many threads came back — after `--status` and `--limit` |
890
- | `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 |
891
- | `threads[].status` | `open`, `resolved`, `ignored` or `superseded`. A finding whose thread is `resolved` or `ignored` must not be re-emitted — the PM already closed it |
892
- | `threads[].reply_count` · `has_human_reply` | How many replies came after the agent's root message, and whether **any of them is human**. `has_human_reply: true` is the signal that a person answered this finding |
893
- | `threads[].messages[]` | The whole conversation, authors already hydrated (`author`, `source`, `text`). Human messages arrive as plain text — the stored HTML is converted server-side |
894
- | `threads[].outdated` | `true` when the thread is anchored to a PRD version older than the current one |
895
- | `brief_version` | The current PRD version the review is being read against |
1075
+ | Field | Meaning |
1076
+ | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1077
+ | `summary` | Thread counts by status: `{ open, resolved, ignored, superseded }`. **`summary.open` is the number to check before composing the next round** |
1078
+ | `count` | How many threads came back — after `--status` and `--limit` |
1079
+ | `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 |
1080
+ | `threads[].status` | `open`, `resolved`, `ignored` or `superseded`. A finding whose thread is `resolved` or `ignored` must not be re-emitted — the PM already closed it |
1081
+ | `threads[].reply_count` · `has_human_reply` | How many replies came after the agent's root message, and whether **any of them is human**. `has_human_reply: true` is the signal that a person answered this finding |
1082
+ | `threads[].messages[]` | The whole conversation, authors already hydrated (`author`, `source`, `text`). Human messages arrive as plain text — the stored HTML is converted server-side |
1083
+ | `threads[].outdated` | `true` when the thread is anchored to a PRD version older than the current one |
1084
+ | `brief_version` | The current PRD version the review is being read against |
896
1085
 
897
1086
  `submit` returns the round's outcome — this is what decides the next round:
898
1087
 
899
- | Field | Meaning |
900
- | ------------------------ | ------------------------------------------------------------------------------------------------------------------ |
901
- | `success` | Always `true` on a `0` exit. It says the round was accepted — **not** that anything was posted; see the counters below |
902
- | `review_round` | Number of this round. It equals the artifact version of the envelope snapshot |
903
- | `threads_created` | Findings that had no live thread — a new thread each |
904
- | `threads_updated` | Findings matched to an **open** thread by `finding_key`: the round was appended and the PM's reply survived |
905
- | `threads_skipped_closed` | Findings the PM had already **resolved or ignored**. Nothing was posted for them, and they were not reopened — this is a normal, successful outcome |
906
- | `threads_superseded` | Threads that were open and did **not** come back in this round: the review considered them settled |
907
- | `tech_review` | The badge written on the PRD: `none` (a clean review), `changes_requested_gaps` or `changes_requested_blocking` |
908
- | `artifact_id` · `artifact_version` | The snapshot of the raw envelope kept as a phase artifact |
1088
+ | Field | Meaning |
1089
+ | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
1090
+ | `success` | Always `true` on a `0` exit. It says the round was accepted — **not** that anything was posted; see the counters below |
1091
+ | `review_round` | Number of this round. It equals the artifact version of the envelope snapshot |
1092
+ | `threads_created` | Findings that had no live thread — a new thread each |
1093
+ | `threads_updated` | Findings matched to an **open** thread by `finding_key`: the round was appended and the PM's reply survived |
1094
+ | `threads_skipped_closed` | Findings the PM had already **resolved or ignored**. Nothing was posted for them, and they were not reopened — this is a normal, successful outcome |
1095
+ | `threads_superseded` | Threads that were open and did **not** come back in this round: the review considered them settled |
1096
+ | `tech_review` | The badge written on the PRD: `none` (a clean review), `changes_requested_gaps` or `changes_requested_blocking` |
1097
+ | `artifact_id` · `artifact_version` | The snapshot of the raw envelope kept as a phase artifact |
909
1098
 
910
1099
  #### Exit codes
911
1100
 
912
1101
  The general table above holds; this is how each condition maps to it:
913
1102
 
914
- | Code | When |
915
- | ---- | ---------------------------------------------------------------------------------------------------------------------------- |
916
- | `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** |
1103
+ | Code | When |
1104
+ | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1105
+ | `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** |
917
1106
  | `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**; no permission to edit work items (`403`, `submit` only); work item not found **or not visible to you** (`404` — the two are deliberately indistinguishable); any other API failure |
918
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
1107
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
919
1108
 
920
1109
  ### `productdock eval` — project evaluations
921
1110
 
@@ -960,15 +1149,15 @@ top of this section.
960
1149
 
961
1150
  #### Parameters
962
1151
 
963
- | Subcommand | Argument | Options |
964
- | ----------------- | ------------ | ----------------------------------------------- |
965
- | `submit <file>` | `<file>` | `--repository-name` · `--out` |
1152
+ | Subcommand | Argument | Options |
1153
+ | --------------- | -------- | ----------------------------- |
1154
+ | `submit <file>` | `<file>` | `--repository-name` · `--out` |
966
1155
 
967
- | Parameter | Description |
968
- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
1156
+ | Parameter | Description |
1157
+ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
969
1158
  | `<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 |
970
- | `--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 `--repository-id` and the `project.repository` of `productdock.json` are not sent |
971
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1159
+ | `--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 `--repository-id` and the `project.repository` of `productdock.json` are not sent |
1160
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
972
1161
 
973
1162
  #### Response format
974
1163
 
@@ -976,27 +1165,33 @@ Under `--json`, `stdout` carries one document with the API response untouched
976
1165
  under `data`:
977
1166
 
978
1167
  ```jsonc
979
- { "ok": true, "operation": "submit_eval", "data": { /* the body below */ } }
1168
+ {
1169
+ "ok": true,
1170
+ "operation": "submit_eval",
1171
+ "data": {
1172
+ /* the body below */
1173
+ },
1174
+ }
980
1175
  ```
981
1176
 
982
1177
  Without `--json`, `stdout` stays empty and a one-line summary goes to `stderr`.
983
1178
 
984
- | Field | Meaning |
985
- | --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
986
- | `success` | Always `true` on a `0` exit |
1179
+ | Field | Meaning |
1180
+ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1181
+ | `success` | Always `true` on a `0` exit |
987
1182
  | `evaluation_id` | Id of the evaluation row. Unlike a phase artifact, it is **stable across submissions** of the same `(project, eval_type)`: the row is replaced, not versioned |
988
- | `project_id` | The project the evaluation was recorded under — the one the server authorized, not the one you asked for |
989
- | `eval_type` | `security`, `observability` or `frontend_quality`, read from the envelope |
1183
+ | `project_id` | The project the evaluation was recorded under — the one the server authorized, not the one you asked for |
1184
+ | `eval_type` | `security`, `observability` or `frontend_quality`, read from the envelope |
990
1185
 
991
1186
  #### Exit codes
992
1187
 
993
1188
  The general table above holds; this is how each condition maps to it:
994
1189
 
995
- | Code | When |
996
- | ---- | ---------------------------------------------------------------------------------------------------------------------------- |
997
- | `0` | The evaluation was recorded |
1190
+ | Code | When |
1191
+ | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1192
+ | `0` | The evaluation was recorded |
998
1193
  | `1` | Missing `<file>`; unreadable file; the file is not a JSON object; directory not linked and no `--project-id`; **invalid envelope (`400`) — the response names the offending field, and nothing was written**; **no `project.evaluations.manage` permission (`403`)**; no access to the project (`403`); any other API failure |
999
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
1194
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
1000
1195
 
1001
1196
  ### `productdock state` — the SDLC state of a work item
1002
1197
 
@@ -1046,14 +1241,12 @@ productdock state update --ref PROD-168 --type lesson \
1046
1241
  `productdock state update --help` prints the accepted `content` fields **per
1047
1242
  `--type`**, so finding them out does not cost a probe against a real work item.
1048
1243
 
1049
-
1050
-
1051
1244
  Both subcommands also accept `--json`, `--project-id` and `--repository-id`,
1052
1245
  documented once at the top of this section.
1053
1246
 
1054
1247
  **The repository travels with both.** The state is repo-aware: `feature_state`
1055
1248
  has one row per `(work item, repository)`, and the artifact list is filtered the
1056
- same way. The repository of `productdock.json` is sent by `phase` *and* by
1249
+ same way. The repository of `productdock.json` is sent by `phase` _and_ by
1057
1250
  `update`, so reading with one scope and writing with another — two truths for
1058
1251
  the same work item, with no error anywhere — cannot happen by accident.
1059
1252
 
@@ -1074,27 +1267,27 @@ the same work item, with no error anywhere — cannot happen by accident.
1074
1267
  and one where a decision/blocker/lesson would end up with an empty body
1075
1268
  because the text arrived under keys this operation does not read. An entry
1076
1269
  with only a title is still accepted — a short record is not a loss;
1077
- - in a `lesson`, the four fields of the skill's *Lessons Learned* template
1270
+ - in a `lesson`, the four fields of the skill's _Lessons Learned_ template
1078
1271
  (`context`, `problem`, `solution`, `prevents`) are accepted and composed into
1079
1272
  `description`. They used to be dropped in silence, leaving the lesson with
1080
1273
  nothing but its title.
1081
1274
 
1082
1275
  #### Parameters
1083
1276
 
1084
- | Subcommand | Argument | Options |
1085
- | ------------------ | ---------- | -------------------------------------------- |
1086
- | `phase <ref>` | `<ref>` | `--out` |
1087
- | `update [file]` | `[file]` | `--ref` · `--type` · `--content` · `--dry-run` · `--out` |
1088
-
1089
- | Parameter | Description |
1090
- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
1091
- | `<ref>` | **Required** on `phase`. The work item — `PREFIX-N` (`PROD-168`), a number, a UUID or a title |
1092
- | `--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 |
1093
- | `--type <type>` | **Required** on `update`. The kind of update: `decision`, `blocker`, `lesson`, `review`, `phase_change`, `phase_progress`, `prd_review`, `flow_change`. Sent as-is: the enum belongs to the server, which rejects what it does not know and lists the options |
1094
- | `[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 |
1095
- | `--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 |
1277
+ | Subcommand | Argument | Options |
1278
+ | --------------- | -------- | -------------------------------------------------------- |
1279
+ | `phase <ref>` | `<ref>` | `--out` |
1280
+ | `update [file]` | `[file]` | `--ref` · `--type` · `--content` · `--dry-run` · `--out` |
1281
+
1282
+ | Parameter | Description |
1283
+ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1284
+ | `<ref>` | **Required** on `phase`. The work item — `PREFIX-N` (`PROD-168`), a number, a UUID or a title |
1285
+ | `--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 |
1286
+ | `--type <type>` | **Required** on `update`. The kind of update: `decision`, `blocker`, `lesson`, `review`, `phase_change`, `phase_progress`, `prd_review`, `flow_change`. Sent as-is: the enum belongs to the server, which rejects what it does not know and lists the options |
1287
+ | `[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 |
1288
+ | `--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 |
1096
1289
  | `--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` |
1097
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1290
+ | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1098
1291
 
1099
1292
  #### Response format
1100
1293
 
@@ -1111,43 +1304,44 @@ the `ignored_fields` warning, spelled out as "not stored".
1111
1304
 
1112
1305
  `detect_phase`:
1113
1306
 
1114
- | Field | Meaning |
1115
- | ------------------------- | ------------------------------------------------------------------------------------------------------------ |
1116
- | `feature_id` | The work item the reference resolved to |
1117
- | `status` | Kanban column (`backlog` … `production`) |
1307
+ | Field | Meaning |
1308
+ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1309
+ | `feature_id` | The work item the reference resolved to |
1310
+ | `status` | Kanban column (`backlog` … `production`) |
1118
1311
  | `current_phase`/`next_phase` | The current skill phase, and the one after it. Reconciled **monotonically** from two sources: the phase derived from the Kanban status and the one `phase_change` wrote to `feature_state` — whichever is further along wins. They used to disagree: entering `validation` (which stays in the `development` column on purpose) made this field answer `implement` while `update_state` answered `validation` |
1119
- | `artifacts_found` | Artifact types already submitted for this work item (and repository) |
1120
- | `work_item_type`/`flow_mode` | Type and **Fluxo Rápido** of the item (`full`/`fast`, only meaningful on `improvement`) |
1121
- | `uses_plan` | **Route by this**, not by recombining type and flow in prose: `true` means the Plan track (`plan.md`) |
1122
- | `mode` | **Modo Lite** of the project (`full`/`lite`) — whether Test Design runs. Not the Fluxo Rápido, and not the UI's "Modo Light"; the two vocabularies share the word `full` by accident |
1123
- | `tasks_progress` | `{ done, total, percent, parallel }` read from the latest `tasks` artifact — from the `tasks/v1` envelope, with the legacy Markdown as a fallback. `null` when there is no `tasks` artifact |
1124
- | `implementation_complete` | `true` when every task is done — or when an `implement` artifact was submitted with `--status done`, which is the only path for work items that skip the `tasks` phase |
1125
- | `state_content` | The recorded state as an **object**: `decisions[]`, `blockers[]`, `lessons[]`, `reviews[]`. Reading a decision back used to require `wi spec-context` — a command whose name does not suggest it — and two levels of parsing |
1312
+ | `artifacts_found` | Artifact types already submitted for this work item (and repository) |
1313
+ | `work_item_type`/`flow_mode` | Type and **Fluxo Rápido** of the item (`full`/`fast`, only meaningful on `improvement`) |
1314
+ | `uses_plan` | **Route by this**, not by recombining type and flow in prose: `true` means the Plan track (`plan.md`) |
1315
+ | `mode` | **Modo Lite** of the project (`full`/`lite`) — whether Test Design runs. Not the Fluxo Rápido, and not the UI's "Modo Light"; the two vocabularies share the word `full` by accident |
1316
+ | `tasks_progress` | `{ done, total, percent, parallel }` read from the latest `tasks` artifact — from the `tasks/v1` envelope, with the legacy Markdown as a fallback. `null` when there is no `tasks` artifact |
1317
+ | `implementation_complete` | `true` when every task is done — or when an `implement` artifact was submitted with `--status done`, which is the only path for work items that skip the `tasks` phase |
1318
+ | `open_qa_bugs` | Number of bugs still `open` in the work item's Quality tab — the platform's own and the ones the skills submitted, on any repository. `0` when there are none. Read them with [`wi bugs`](#productdock-wi-bugs) |
1319
+ | `state_content` | The recorded state as an **object**: `decisions[]`, `blockers[]`, `lessons[]`, `reviews[]`. Reading a decision back used to require `wi spec-context` — a command whose name does not suggest it — and two levels of parsing |
1126
1320
 
1127
1321
  `update_state`:
1128
1322
 
1129
- | Field | Meaning |
1130
- | ----------------- | ------------------------------------------------------------------------------------------------------------------------ |
1131
- | `success` | Always `true` on a `0` exit |
1132
- | `work_item_id` | The work item the state was written to |
1133
- | `applied` | `{ update_type, id?, phase? }` — `id` is the one **the server assigned**, the only piece of the mutation you cannot derive |
1134
- | `current_phase` | The internal phase after the update |
1135
- | `accepted_fields` | Keys of `content` the server **did** use. The positive side of `ignored_fields`: `success: true` says the call was accepted, this says the body was read |
1136
- | `ignored_fields` | Keys of `content` the server did not use. **Present means not stored** — absent means everything landed |
1137
- | `dry_run` | Only under `--dry-run`: `true`, with `would_apply` in place of `applied`. Nothing was written |
1138
- | `idempotent` | `true` when the entry already existed and was matched instead of duplicated |
1139
- | `flow_mode`/`previous_flow_mode` | Only on `flow_change` |
1140
- | `progress` | Only on `phase_progress` — the marker written to the work item (`Fase 2/6 · Sidebar`) |
1323
+ | Field | Meaning |
1324
+ | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
1325
+ | `success` | Always `true` on a `0` exit |
1326
+ | `work_item_id` | The work item the state was written to |
1327
+ | `applied` | `{ update_type, id?, phase? }` — `id` is the one **the server assigned**, the only piece of the mutation you cannot derive |
1328
+ | `current_phase` | The internal phase after the update |
1329
+ | `accepted_fields` | Keys of `content` the server **did** use. The positive side of `ignored_fields`: `success: true` says the call was accepted, this says the body was read |
1330
+ | `ignored_fields` | Keys of `content` the server did not use. **Present means not stored** — absent means everything landed |
1331
+ | `dry_run` | Only under `--dry-run`: `true`, with `would_apply` in place of `applied`. Nothing was written |
1332
+ | `idempotent` | `true` when the entry already existed and was matched instead of duplicated |
1333
+ | `flow_mode`/`previous_flow_mode` | Only on `flow_change` |
1334
+ | `progress` | Only on `phase_progress` — the marker written to the work item (`Fase 2/6 · Sidebar`) |
1141
1335
 
1142
1336
  #### Exit codes
1143
1337
 
1144
1338
  The general table above holds; this is how each condition maps to it:
1145
1339
 
1146
- | Code | When |
1147
- | ---- | ---------------------------------------------------------------------------------------------------------------------------- |
1148
- | `0` | The phase was read, or the state was written |
1340
+ | Code | When |
1341
+ | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1342
+ | `0` | The phase was read, or the state was written |
1149
1343
  | `1` | Missing `<ref>`/`--ref`/`--type`; body file unreadable; body that is not a JSON object; file **and** `--content` together; directory not linked and no `--project-id`; **`flow_change` refused (`400`) — wrong type, or outside the `backlog`/`prd`/`specification` window**; **body the server could not interpret (`400`) — the message carries the schema of the `--type`, and nothing was written**; unknown `update_type` (`400`); no permission for the write (`403`); no access to the work item (`404` — the same answer as "does not exist", on purpose); any other API failure |
1150
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
1344
+ | `2` | The API rejected the token (`401`) — run `productdock login` again |
1151
1345
 
1152
1346
  ### `productdock doctor`
1153
1347
 
@@ -1194,11 +1388,11 @@ Checks performed:
1194
1388
 
1195
1389
  Install locations are derived from the IDE list in `productdock.json` — a skill or agent is written once per distinct target, with identical content:
1196
1390
 
1197
- | IDE key | Target | Skills | Agents |
1198
- | ------------------------------- | --------- | ------------------------- | ------------------------- |
1199
- | `claude-code`, `claude-desktop` | `claude` | `.claude/skills/<name>/` | `.claude/agents/<name>/` |
1200
- | `vscode` | `copilot` | `.github/skills/<name>/` | `.github/agents/<name>/` |
1201
- | `cursor` | `cursor` | `.cursor/skills/<name>/` | `.cursor/agents/<name>/` |
1391
+ | IDE key | Target | Skills | Agents |
1392
+ | ------------------------------- | --------- | ------------------------ | ------------------------ |
1393
+ | `claude-code`, `claude-desktop` | `claude` | `.claude/skills/<name>/` | `.claude/agents/<name>/` |
1394
+ | `vscode` | `copilot` | `.github/skills/<name>/` | `.github/agents/<name>/` |
1395
+ | `cursor` | `cursor` | `.cursor/skills/<name>/` | `.cursor/agents/<name>/` |
1202
1396
 
1203
1397
  Agents get a directory of their own rather than a bare `.md` file: Claude Code scans `.claude/agents/` recursively and takes a subagent's identity from its `name` frontmatter, not from its path, so nesting is safe and keeps multi-file agents intact.
1204
1398
 
@@ -1207,20 +1401,24 @@ Everything installed is recorded in `productdock.json`, which is what `update` a
1207
1401
  ```jsonc
1208
1402
  {
1209
1403
  "ides": ["claude-code", "cursor"],
1210
- "project": { "id": "…", "name": "ProductDock", "repositoryName": "productdock-cli" },
1404
+ "project": {
1405
+ "id": "…",
1406
+ "name": "ProductDock",
1407
+ "repositoryName": "productdock-cli",
1408
+ },
1211
1409
  "mcp": { "url": "https://productdock-api.softdesign.com.br/mcp" },
1212
1410
  "skills": {
1213
1411
  "pd-workflow": {
1214
1412
  "version": "1.4.0",
1215
- "sha256": "…", // fingerprint of the installed tree
1413
+ "sha256": "…", // fingerprint of the installed tree
1216
1414
  "targets": ["claude", "cursor"],
1217
1415
  "installedAt": "2026-08-31T12:00:00.000Z",
1218
- "branch": "feature/new-phases" // only when it differs from `main`; absent means `main`
1219
- }
1416
+ "branch": "feature/new-phases", // only when it differs from `main`; absent means `main`
1417
+ },
1220
1418
  },
1221
1419
  "agents": {
1222
1420
  /* same shape as skills */
1223
- }
1421
+ },
1224
1422
  }
1225
1423
  ```
1226
1424
 
@@ -1274,12 +1472,12 @@ productdock login IDE (Claude Code / Cursor / VS Code)
1274
1472
 
1275
1473
  All optional — defaults point at production.
1276
1474
 
1277
- | Variable | Default | Description |
1278
- | -------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------- |
1279
- | `PRODUCTDOCK_API_URL` | `https://productdock-api.softdesign.com.br` | ProductDock API base URL — root of the OAuth (`/oauth/*`) and project (`/cli/*`) endpoints |
1280
- | `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 |
1281
- | `PRODUCTDOCK_REGISTRY_URL` | `https://productdock-core-api.softdesign.com.br` | Skill and agent registry URL |
1282
- | `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 |
1475
+ | Variable | Default | Description |
1476
+ | -------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1477
+ | `PRODUCTDOCK_API_URL` | `https://productdock-api.softdesign.com.br` | ProductDock API base URL — root of the OAuth (`/oauth/*`) and project (`/cli/*`) endpoints |
1478
+ | `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 |
1479
+ | `PRODUCTDOCK_REGISTRY_URL` | `https://productdock-core-api.softdesign.com.br` | Skill and agent registry URL |
1480
+ | `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 |
1283
1481
 
1284
1482
  When running from source, these are also read from a `.env` file in the repository root — see `.env.example`.
1285
1483
 
@@ -1313,33 +1511,33 @@ bun test test/output.test.ts
1313
1511
 
1314
1512
  ### Source layout
1315
1513
 
1316
- | File | Responsibility |
1317
- | ------------------------- | -------------------------------------------------------------------------- |
1318
- | `bin/productdock.ts` | Commander program — command definitions and dispatch |
1319
- | `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 |
1320
- | `lib/auth.ts` | OAuth 2.1 + PKCE flow, credential store, token refresh |
1321
- | `lib/config.ts` | `productdock.json` read/write/migrate, `init` and `link` |
1322
- | `lib/api.ts` | Project and repository lookup behind `link` — `/cli/projects` and `/cli/projects/{id}/repositories` |
1323
- | `lib/git.ts` | `origin` remote detection and Azure DevOps URL parsing (SSH, HTTPS, legacy) |
1324
- | `lib/ide.ts` | IDE detection and MCP config writing |
1325
- | `lib/registry.ts` | Registry HTTP client — one code path for skills and agents, `?branch=` |
1326
- | `lib/http.ts` | HTTP client for the `/cli/*` endpoints — file bodies, `multipart`, HTTP status kept in the error |
1327
- | `lib/scope.ts` | Project scope — `project_id`/`repository_id` from `productdock.json`, flags override |
1328
- | `lib/artifacts.ts` | Install core: destinations, zip extraction, SHA256 fingerprint, drift |
1329
- | `lib/frontmatter.ts` | Frontmatter adaptation per platform (agents) — port of the ai-tools installer |
1330
- | `lib/artifact-commands.ts`| The `skill` and `agent` command groups, generic over artifact kind |
1331
- | `lib/work-items.ts` | The `wi` command group — `list`, `prd` and `spec-context` over `/cli/work-items/*` |
1332
- | `lib/work-item-attachments.ts` | The `wi` writes — `comment` over `/cli/work-items/comments` and `evidence` (multipart) over `/cli/work-items/qa-evidence` |
1333
- | `lib/code.ts` | The `code` command group — `map` and `search` over `/cli/code/*` |
1334
- | `lib/phase-artifacts.ts` | The `artifact` command group — `submit` over `/cli/artifacts` and `commit` over `/cli/artifacts/commit`, body from a file |
1335
- | `lib/prd-review.ts` | The `prd-review` command group — `get` (mandatory read-back) and `submit` over `/cli/prd-review` |
1336
- | `lib/evaluations.ts` | The `eval` command group — `submit` over `/cli/evaluations`, envelope from a file, project-level |
1337
- | `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 |
1338
- | `lib/doctor.ts` | Diagnostics |
1339
- | `lib/exit.ts` | Exit code taxonomy — `CliError` and the error → code mapping |
1340
- | `lib/output.ts` | Output layer — JSON on `stdout`, prose on `stderr`, credential redaction |
1341
- | `lib/tty.ts` | TTY guard — fails fast instead of blocking on a prompt |
1342
- | `lib/types.d.ts` | Shared types — IDE keys, install targets, `productdock.json` shape |
1514
+ | File | Responsibility |
1515
+ | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1516
+ | `bin/productdock.ts` | Commander program — command definitions and dispatch |
1517
+ | `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 |
1518
+ | `lib/auth.ts` | OAuth 2.1 + PKCE flow, credential store, token refresh |
1519
+ | `lib/config.ts` | `productdock.json` read/write/migrate, `init` and `link` |
1520
+ | `lib/api.ts` | Project and repository lookup behind `link` — `/cli/projects` and `/cli/projects/{id}/repositories` |
1521
+ | `lib/git.ts` | `origin` remote detection and Azure DevOps URL parsing (SSH, HTTPS, legacy) |
1522
+ | `lib/ide.ts` | IDE detection and MCP config writing |
1523
+ | `lib/registry.ts` | Registry HTTP client — one code path for skills and agents, `?branch=` |
1524
+ | `lib/http.ts` | HTTP client for the `/cli/*` endpoints — file bodies, `multipart`, HTTP status kept in the error |
1525
+ | `lib/scope.ts` | Project scope — `project_id`/`repository_id` from `productdock.json`, flags override |
1526
+ | `lib/artifacts.ts` | Install core: destinations, zip extraction, SHA256 fingerprint, drift |
1527
+ | `lib/frontmatter.ts` | Frontmatter adaptation per platform (agents) — port of the ai-tools installer |
1528
+ | `lib/artifact-commands.ts` | The `skill` and `agent` command groups, generic over artifact kind |
1529
+ | `lib/work-items.ts` | The `wi` command group — `list`, `prd`, `spec-context`, `bugs` and `prototypes` over `/cli/work-items/*` |
1530
+ | `lib/work-item-attachments.ts` | The `wi` writes — `comment` over `/cli/work-items/comments` and `evidence` (multipart) over `/cli/work-items/qa-evidence` |
1531
+ | `lib/code.ts` | The `code` command group — `map` and `search` over `/cli/code/*` |
1532
+ | `lib/phase-artifacts.ts` | The `artifact` command group — `submit` over `/cli/artifacts` and `commit` over `/cli/artifacts/commit`, body from a file |
1533
+ | `lib/prd-review.ts` | The `prd-review` command group — `get` (mandatory read-back) and `submit` over `/cli/prd-review` |
1534
+ | `lib/evaluations.ts` | The `eval` command group — `submit` over `/cli/evaluations`, envelope from a file, project-level |
1535
+ | `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 |
1536
+ | `lib/doctor.ts` | Diagnostics |
1537
+ | `lib/exit.ts` | Exit code taxonomy — `CliError` and the error → code mapping |
1538
+ | `lib/output.ts` | Output layer — JSON on `stdout`, prose on `stderr`, credential redaction |
1539
+ | `lib/tty.ts` | TTY guard — fails fast instead of blocking on a prompt |
1540
+ | `lib/types.d.ts` | Shared types — IDE keys, install targets, `productdock.json` shape |
1343
1541
 
1344
1542
  ### Building
1345
1543