@softdesignbrasil/productdock-cli 0.7.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.
- package/README.md +449 -322
- package/dist/productdock.js +107 -201
- 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
|
|
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
|
|
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
|
|
253
|
-
|
|
|
254
|
-
| Claude Code (`claude-code`, `claude-desktop`) | `.claude/agents/{name}.md`
|
|
255
|
-
| GitHub Copilot (`vscode`)
|
|
256
|
-
| Cursor
|
|
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
|
|
293
|
-
|
|
|
294
|
-
| `list`
|
|
295
|
-
| `install <name>`
|
|
296
|
-
| `update [name]`
|
|
297
|
-
| `status`
|
|
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
|
-
|
|
313
|
-
`/cli/work-items/*` endpoints of the ProductDock API.
|
|
314
|
-
(`list`, `prd`, `spec-context`, `bugs`); 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
|
|
354
|
-
|
|
|
355
|
-
| `<ref>`
|
|
356
|
-
| `--status <status>`
|
|
357
|
-
| `--search <term>`
|
|
358
|
-
| `--repository-name <name
|
|
359
|
-
| `--out <file>`
|
|
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,34 @@ Under `--json`, `stdout` carries one document with the API response untouched
|
|
|
364
364
|
under `data`:
|
|
365
365
|
|
|
366
366
|
```jsonc
|
|
367
|
-
{
|
|
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
|
|
375
|
-
|
|
|
376
|
-
| `prd`
|
|
377
|
-
| `list`
|
|
378
|
-
| `spec-context`
|
|
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 |
|
|
389
395
|
|
|
390
396
|
#### `productdock wi bugs`
|
|
391
397
|
|
|
@@ -414,15 +420,15 @@ productdock wi bugs PROD-222 --json --out bugs.json
|
|
|
414
420
|
|
|
415
421
|
##### Parameters
|
|
416
422
|
|
|
417
|
-
| Subcommand
|
|
418
|
-
|
|
|
419
|
-
| `bugs <ref>`
|
|
423
|
+
| Subcommand | Argument | Options |
|
|
424
|
+
| ------------ | -------- | ------------------------------------ |
|
|
425
|
+
| `bugs <ref>` | `<ref>` | `--status <status>` · `--out <file>` |
|
|
420
426
|
|
|
421
|
-
| Parameter | Description
|
|
422
|
-
| ------------------- |
|
|
423
|
-
| `<ref>` | **Required.** Work item reference in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title
|
|
427
|
+
| Parameter | Description |
|
|
428
|
+
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
429
|
+
| `<ref>` | **Required.** Work item reference in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
|
|
424
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 |
|
|
425
|
-
| `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically
|
|
431
|
+
| `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
|
|
426
432
|
|
|
427
433
|
##### Response format
|
|
428
434
|
|
|
@@ -430,7 +436,13 @@ Under `--json`, `stdout` carries one document with the API response untouched
|
|
|
430
436
|
under `data`:
|
|
431
437
|
|
|
432
438
|
```jsonc
|
|
433
|
-
{
|
|
439
|
+
{
|
|
440
|
+
"ok": true,
|
|
441
|
+
"operation": "get_qa_issues",
|
|
442
|
+
"data": {
|
|
443
|
+
/* the body below */
|
|
444
|
+
},
|
|
445
|
+
}
|
|
434
446
|
```
|
|
435
447
|
|
|
436
448
|
Without `--json`, `stdout` stays empty and a summary goes to `stderr`: one line
|
|
@@ -438,11 +450,11 @@ per bug — id, status, severity, title — and the count of open ones.
|
|
|
438
450
|
|
|
439
451
|
`data` is `{ summary, count, issues[] }`:
|
|
440
452
|
|
|
441
|
-
| Field
|
|
442
|
-
|
|
|
443
|
-
| `summary`
|
|
444
|
-
| `count`
|
|
445
|
-
| `issues[]`
|
|
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? }` |
|
|
446
458
|
|
|
447
459
|
A work item with no bugs returns `count: 0` and `issues: []`, which is a
|
|
448
460
|
**success**, not an error.
|
|
@@ -451,11 +463,82 @@ A work item with no bugs returns `count: 0` and `issues: []`, which is a
|
|
|
451
463
|
|
|
452
464
|
The general table above holds; this is how each condition maps to it:
|
|
453
465
|
|
|
454
|
-
| Code | When
|
|
455
|
-
| ---- |
|
|
456
|
-
| `0` | The bugs were read — including a work item with no bugs
|
|
466
|
+
| Code | When |
|
|
467
|
+
| ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
468
|
+
| `0` | The bugs were read — including a work item with no bugs |
|
|
457
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 |
|
|
458
|
-
| `2` | The API rejected the token (`401`) — run `productdock login` again
|
|
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 |
|
|
459
542
|
|
|
460
543
|
#### `productdock wi comment`
|
|
461
544
|
|
|
@@ -487,17 +570,17 @@ productdock wi comment qa-summary.md --ref PROD-168 \
|
|
|
487
570
|
|
|
488
571
|
##### Parameters
|
|
489
572
|
|
|
490
|
-
| Subcommand
|
|
491
|
-
|
|
|
492
|
-
| `comment [file]`
|
|
573
|
+
| Subcommand | Argument | Options |
|
|
574
|
+
| ---------------- | -------- | ------------------------------------------- |
|
|
575
|
+
| `comment [file]` | `[file]` | `--ref` · `--content` · `--label` · `--out` |
|
|
493
576
|
|
|
494
|
-
| Parameter
|
|
495
|
-
|
|
|
496
|
-
| `[file]`
|
|
497
|
-
| `--ref <ref>`
|
|
498
|
-
| `--content <text>`
|
|
499
|
-
| `--label <label>`
|
|
500
|
-
| `--out <file>`
|
|
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 |
|
|
501
584
|
|
|
502
585
|
##### Response format
|
|
503
586
|
|
|
@@ -505,26 +588,32 @@ Under `--json`, `stdout` carries one document with the API response untouched
|
|
|
505
588
|
under `data`:
|
|
506
589
|
|
|
507
590
|
```jsonc
|
|
508
|
-
{
|
|
591
|
+
{
|
|
592
|
+
"ok": true,
|
|
593
|
+
"operation": "post_work_item_comment",
|
|
594
|
+
"data": {
|
|
595
|
+
/* the body below */
|
|
596
|
+
},
|
|
597
|
+
}
|
|
509
598
|
```
|
|
510
599
|
|
|
511
600
|
Without `--json`, `stdout` stays empty and a one-line summary goes to `stderr`.
|
|
512
601
|
|
|
513
|
-
| Field | Meaning
|
|
514
|
-
| -------------- |
|
|
515
|
-
| `success` | Always `true` on a `0` exit — the comment was written
|
|
516
|
-
| `comment_id` | Id of the comment just created
|
|
517
|
-
| `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` |
|
|
518
607
|
|
|
519
608
|
##### Exit codes
|
|
520
609
|
|
|
521
610
|
The general table above holds; this is how each condition maps to it:
|
|
522
611
|
|
|
523
|
-
| Code | When
|
|
524
|
-
| ---- |
|
|
525
|
-
| `0` | The comment was written
|
|
612
|
+
| Code | When |
|
|
613
|
+
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
614
|
+
| `0` | The comment was written |
|
|
526
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 |
|
|
527
|
-
| `2` | The API rejected the token (`401`) — run `productdock login` again
|
|
616
|
+
| `2` | The API rejected the token (`401`) — run `productdock login` again |
|
|
528
617
|
|
|
529
618
|
#### `productdock wi evidence`
|
|
530
619
|
|
|
@@ -538,7 +627,7 @@ difference is the point of the command.
|
|
|
538
627
|
Over MCP the tool cannot see your filesystem, so it returns a `signed_url` per
|
|
539
628
|
filename and instructs the caller to `PUT` the bytes to Storage itself: the
|
|
540
629
|
second half happens outside the contract, and the server never sees the file —
|
|
541
|
-
the MIME and the size it checks are the ones you
|
|
630
|
+
the MIME and the size it checks are the ones you _declared_. Here the file goes
|
|
542
631
|
up in a single call, and MIME and size are revalidated **on the bytes that
|
|
543
632
|
arrived**. Anything that is not a PNG, JPEG, GIF or WEBP is refused, as is
|
|
544
633
|
anything over 10 MB.
|
|
@@ -572,15 +661,15 @@ done
|
|
|
572
661
|
|
|
573
662
|
##### Parameters
|
|
574
663
|
|
|
575
|
-
| Subcommand
|
|
576
|
-
|
|
|
577
|
-
| `evidence <file>`
|
|
664
|
+
| Subcommand | Argument | Options |
|
|
665
|
+
| ----------------- | -------- | ----------------- |
|
|
666
|
+
| `evidence <file>` | `<file>` | `--ref` · `--out` |
|
|
578
667
|
|
|
579
|
-
| Parameter
|
|
580
|
-
|
|
|
581
|
-
| `<file>`
|
|
582
|
-
| `--ref <ref>`
|
|
583
|
-
| `--out <file>`
|
|
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 |
|
|
584
673
|
|
|
585
674
|
The work item and the project travel as **query parameters**, not as form
|
|
586
675
|
fields. That is not a preference: on the server, guards run before the multipart
|
|
@@ -593,13 +682,19 @@ Under `--json`, `stdout` carries one document with the API response untouched
|
|
|
593
682
|
under `data`:
|
|
594
683
|
|
|
595
684
|
```jsonc
|
|
596
|
-
{
|
|
685
|
+
{
|
|
686
|
+
"ok": true,
|
|
687
|
+
"operation": "upload_qa_evidence",
|
|
688
|
+
"data": {
|
|
689
|
+
/* the body below */
|
|
690
|
+
},
|
|
691
|
+
}
|
|
597
692
|
```
|
|
598
693
|
|
|
599
694
|
Without `--json`, `stdout` stays empty and a two-line summary goes to `stderr`.
|
|
600
695
|
|
|
601
|
-
| Field | Meaning
|
|
602
|
-
| -------------- |
|
|
696
|
+
| Field | Meaning |
|
|
697
|
+
| -------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
603
698
|
| `success` | Always `true` on a `0` exit — the object was written |
|
|
604
699
|
| `bucket` | `qa-evidence` — the private bucket, the same one the portal and the IDE write to |
|
|
605
700
|
| `path` | Path of the object, **derived server-side**. This is the value that goes in `evidence[].url` of `qa-result/v1` |
|
|
@@ -612,11 +707,11 @@ Without `--json`, `stdout` stays empty and a two-line summary goes to `stderr`.
|
|
|
612
707
|
|
|
613
708
|
The general table above holds; this is how each condition maps to it:
|
|
614
709
|
|
|
615
|
-
| Code | When
|
|
616
|
-
| ---- |
|
|
617
|
-
| `0` | The evidence was stored
|
|
710
|
+
| Code | When |
|
|
711
|
+
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
712
|
+
| `0` | The evidence was stored |
|
|
618
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 |
|
|
619
|
-
| `2` | The API rejected the token (`401`) — run `productdock login` again
|
|
714
|
+
| `2` | The API rejected the token (`401`) — run `productdock login` again |
|
|
620
715
|
|
|
621
716
|
### `productdock code` — reading the repository and its code
|
|
622
717
|
|
|
@@ -649,17 +744,17 @@ documented once at the top of this section.
|
|
|
649
744
|
|
|
650
745
|
#### Parameters
|
|
651
746
|
|
|
652
|
-
| Subcommand
|
|
653
|
-
|
|
|
654
|
-
| `map`
|
|
655
|
-
| `search <query>`
|
|
747
|
+
| Subcommand | Argument | Options |
|
|
748
|
+
| ---------------- | --------- | ------------------------------ |
|
|
749
|
+
| `map` | — | `--out <file>` |
|
|
750
|
+
| `search <query>` | `<query>` | `--top-k <n>` · `--out <file>` |
|
|
656
751
|
|
|
657
|
-
| Parameter | Description
|
|
658
|
-
| ------------------------ |
|
|
659
|
-
| `<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 |
|
|
660
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 |
|
|
661
|
-
| `--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
|
|
662
|
-
| `--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 |
|
|
663
758
|
|
|
664
759
|
#### Response format
|
|
665
760
|
|
|
@@ -667,27 +762,33 @@ Under `--json`, `stdout` carries one document with the API response untouched
|
|
|
667
762
|
under `data`:
|
|
668
763
|
|
|
669
764
|
```jsonc
|
|
670
|
-
{
|
|
765
|
+
{
|
|
766
|
+
"ok": true,
|
|
767
|
+
"operation": "search_code",
|
|
768
|
+
"data": {
|
|
769
|
+
/* the body below */
|
|
770
|
+
},
|
|
771
|
+
}
|
|
671
772
|
```
|
|
672
773
|
|
|
673
774
|
`operation` is the canonical operation name — `get_repo_map` or `search_code`.
|
|
674
775
|
Without `--json`, `stdout` stays empty and a human-readable summary goes to
|
|
675
776
|
`stderr`.
|
|
676
777
|
|
|
677
|
-
| Subcommand | `data`
|
|
678
|
-
| ---------- |
|
|
778
|
+
| Subcommand | `data` |
|
|
779
|
+
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
679
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 |
|
|
680
|
-
| `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 |
|
|
681
782
|
|
|
682
783
|
#### Exit codes
|
|
683
784
|
|
|
684
785
|
The general table above holds; this is how each condition maps to it:
|
|
685
786
|
|
|
686
|
-
| Code | When
|
|
687
|
-
| ---- |
|
|
688
|
-
| `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 |
|
|
689
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 |
|
|
690
|
-
| `2` | The API rejected the token (`401`) — run `productdock login` again
|
|
791
|
+
| `2` | The API rejected the token (`401`) — run `productdock login` again |
|
|
691
792
|
|
|
692
793
|
### `productdock artifact` — writing SDLC phase artifacts
|
|
693
794
|
|
|
@@ -744,23 +845,23 @@ documented once at the top of this section.
|
|
|
744
845
|
|
|
745
846
|
##### Parameters
|
|
746
847
|
|
|
747
|
-
| Subcommand
|
|
748
|
-
|
|
|
749
|
-
| `submit [file]`
|
|
750
|
-
|
|
751
|
-
| Parameter | Description
|
|
752
|
-
| -------------------------- |
|
|
753
|
-
| `[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
|
|
754
|
-
| `--ref <ref>` | **Required.** Work item the artifact belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title
|
|
755
|
-
| `--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
|
|
756
|
-
| `--type <type>` | **Required.** Artifact type — e.g. `spec`, `design`, `tasks`, `qa-plan`, `qa-result`, `qa-issue`. Same rule as `--phase`
|
|
757
|
-
| `--content <text>` | The artifact body inline, as an alternative to the file
|
|
758
|
-
| `--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
|
|
759
|
-
| `--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
|
|
760
|
-
| `--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 |
|
|
761
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` |
|
|
762
|
-
| `--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
|
|
763
|
-
| `--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 |
|
|
764
865
|
|
|
765
866
|
##### Response format
|
|
766
867
|
|
|
@@ -768,32 +869,38 @@ Under `--json`, `stdout` carries one document with the API response untouched
|
|
|
768
869
|
under `data`:
|
|
769
870
|
|
|
770
871
|
```jsonc
|
|
771
|
-
{
|
|
872
|
+
{
|
|
873
|
+
"ok": true,
|
|
874
|
+
"operation": "submit_artifact",
|
|
875
|
+
"data": {
|
|
876
|
+
/* the body below */
|
|
877
|
+
},
|
|
878
|
+
}
|
|
772
879
|
```
|
|
773
880
|
|
|
774
881
|
Without `--json`, `stdout` stays empty and a one-line summary goes to `stderr`.
|
|
775
882
|
|
|
776
|
-
| Field | Meaning
|
|
777
|
-
| ------------------- |
|
|
778
|
-
| `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`
|
|
779
|
-
| `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
|
|
780
|
-
| `version` | Version number within the lineage, starting at 1. It never collides: concurrent submissions retry server-side
|
|
781
|
-
| `phase_advanced_to` | The phase the work item moved to, or `null`. Submitting an artifact does not advance a phase by itself
|
|
782
|
-
| `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)
|
|
783
|
-
| `repository_name` | Reserved; currently `null`
|
|
784
|
-
| `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
|
|
785
|
-
| `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
|
|
786
|
-
| `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 |
|
|
787
894
|
|
|
788
895
|
##### Exit codes
|
|
789
896
|
|
|
790
897
|
The general table above holds; this is how each condition maps to it:
|
|
791
898
|
|
|
792
|
-
| Code | When
|
|
793
|
-
| ---- |
|
|
794
|
-
| `0` | The version was written
|
|
899
|
+
| Code | When |
|
|
900
|
+
| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
901
|
+
| `0` | The version was written |
|
|
795
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 |
|
|
796
|
-
| `2` | The API rejected the token (`401`) — run `productdock login` again
|
|
903
|
+
| `2` | The API rejected the token (`401`) — run `productdock login` again |
|
|
797
904
|
|
|
798
905
|
#### `productdock artifact commit`
|
|
799
906
|
|
|
@@ -842,20 +949,20 @@ documented once at the top of this section.
|
|
|
842
949
|
|
|
843
950
|
##### Parameters
|
|
844
951
|
|
|
845
|
-
| Subcommand
|
|
846
|
-
|
|
|
847
|
-
| `commit [file]`
|
|
952
|
+
| Subcommand | Argument | Options |
|
|
953
|
+
| --------------- | -------- | ----------------------------------------------------------------------------------------- |
|
|
954
|
+
| `commit [file]` | `[file]` | `--ref` · `--phase` · `--type` · `--content` · `--branch` · `--repository-name` · `--out` |
|
|
848
955
|
|
|
849
|
-
| Parameter | Description
|
|
850
|
-
| -------------------------- |
|
|
956
|
+
| Parameter | Description |
|
|
957
|
+
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
851
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** |
|
|
852
|
-
| `--ref <ref>` | **Required.** Work item the artifact belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title
|
|
853
|
-
| `--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
|
|
854
|
-
| `--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`
|
|
855
|
-
| `--content <text>` | The artifact body inline, as an alternative to the file
|
|
856
|
-
| `--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
|
|
857
|
-
| `--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`)
|
|
858
|
-
| `--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 |
|
|
859
966
|
|
|
860
967
|
##### Response format
|
|
861
968
|
|
|
@@ -863,27 +970,33 @@ Under `--json`, `stdout` carries one document with the API response untouched
|
|
|
863
970
|
under `data`:
|
|
864
971
|
|
|
865
972
|
```jsonc
|
|
866
|
-
{
|
|
973
|
+
{
|
|
974
|
+
"ok": true,
|
|
975
|
+
"operation": "commit_artifact",
|
|
976
|
+
"data": {
|
|
977
|
+
/* the body below */
|
|
978
|
+
},
|
|
979
|
+
}
|
|
867
980
|
```
|
|
868
981
|
|
|
869
982
|
Without `--json`, `stdout` stays empty and a two-line summary goes to `stderr`.
|
|
870
983
|
|
|
871
|
-
| Field | Meaning
|
|
872
|
-
| ----------- |
|
|
873
|
-
| `success` | Always `true` on a `0` exit — the push was applied
|
|
874
|
-
| `path` | Path the artifact was written to, **derived server-side** from the work item
|
|
875
|
-
| `branch` | Branch the commit landed on — the one you asked for, or the repository default
|
|
876
|
-
| `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 |
|
|
877
990
|
|
|
878
991
|
##### Exit codes
|
|
879
992
|
|
|
880
993
|
The general table above holds; this is how each condition maps to it:
|
|
881
994
|
|
|
882
|
-
| Code | When
|
|
883
|
-
| ---- |
|
|
884
|
-
| `0` | The commit was pushed
|
|
995
|
+
| Code | When |
|
|
996
|
+
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
997
|
+
| `0` | The commit was pushed |
|
|
885
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 |
|
|
886
|
-
| `2` | The API rejected the token (`401`) — run `productdock login` again
|
|
999
|
+
| `2` | The API rejected the token (`401`) — run `productdock login` again |
|
|
887
1000
|
|
|
888
1001
|
### `productdock prd-review` — the PRD critical review
|
|
889
1002
|
|
|
@@ -924,19 +1037,19 @@ documented once at the top of this section.
|
|
|
924
1037
|
|
|
925
1038
|
#### Parameters
|
|
926
1039
|
|
|
927
|
-
| Subcommand
|
|
928
|
-
|
|
|
929
|
-
| `get <ref>`
|
|
930
|
-
| `submit [file]`
|
|
1040
|
+
| Subcommand | Argument | Options |
|
|
1041
|
+
| --------------- | -------- | ---------------------------------------------------- |
|
|
1042
|
+
| `get <ref>` | `<ref>` | `--status <status>` · `--limit <n>` · `--out <file>` |
|
|
1043
|
+
| `submit [file]` | `[file]` | `--ref` · `--content` · `--out` |
|
|
931
1044
|
|
|
932
|
-
| Parameter
|
|
933
|
-
|
|
|
934
|
-
| `<ref>` / `--ref`
|
|
935
|
-
| `--status <status>`
|
|
936
|
-
| `--limit <n>`
|
|
937
|
-
| `[file]`
|
|
938
|
-
| `--content <text>`
|
|
939
|
-
| `--out <file>`
|
|
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 |
|
|
940
1053
|
|
|
941
1054
|
#### Response format
|
|
942
1055
|
|
|
@@ -944,7 +1057,13 @@ Under `--json`, `stdout` carries one document with the API response untouched
|
|
|
944
1057
|
under `data`:
|
|
945
1058
|
|
|
946
1059
|
```jsonc
|
|
947
|
-
{
|
|
1060
|
+
{
|
|
1061
|
+
"ok": true,
|
|
1062
|
+
"operation": "get_prd_review",
|
|
1063
|
+
"data": {
|
|
1064
|
+
/* the body below */
|
|
1065
|
+
},
|
|
1066
|
+
}
|
|
948
1067
|
```
|
|
949
1068
|
|
|
950
1069
|
`operation` is the canonical operation name — `get_prd_review` or
|
|
@@ -953,39 +1072,39 @@ summary goes to `stderr`.
|
|
|
953
1072
|
|
|
954
1073
|
`get` returns `{ work_item_id, brief_version, summary, count, threads[] }`:
|
|
955
1074
|
|
|
956
|
-
| Field
|
|
957
|
-
|
|
|
958
|
-
| `summary`
|
|
959
|
-
| `count`
|
|
960
|
-
| `threads[].finding_key`
|
|
961
|
-
| `threads[].status`
|
|
962
|
-
| `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
|
|
963
|
-
| `threads[].messages[]`
|
|
964
|
-
| `threads[].outdated`
|
|
965
|
-
| `brief_version`
|
|
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 |
|
|
966
1085
|
|
|
967
1086
|
`submit` returns the round's outcome — this is what decides the next round:
|
|
968
1087
|
|
|
969
|
-
| Field
|
|
970
|
-
|
|
|
971
|
-
| `success`
|
|
972
|
-
| `review_round`
|
|
973
|
-
| `threads_created`
|
|
974
|
-
| `threads_updated`
|
|
975
|
-
| `threads_skipped_closed`
|
|
976
|
-
| `threads_superseded`
|
|
977
|
-
| `tech_review`
|
|
978
|
-
| `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 |
|
|
979
1098
|
|
|
980
1099
|
#### Exit codes
|
|
981
1100
|
|
|
982
1101
|
The general table above holds; this is how each condition maps to it:
|
|
983
1102
|
|
|
984
|
-
| Code | When
|
|
985
|
-
| ---- |
|
|
986
|
-
| `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** |
|
|
987
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 |
|
|
988
|
-
| `2` | The API rejected the token (`401`) — run `productdock login` again
|
|
1107
|
+
| `2` | The API rejected the token (`401`) — run `productdock login` again |
|
|
989
1108
|
|
|
990
1109
|
### `productdock eval` — project evaluations
|
|
991
1110
|
|
|
@@ -1030,15 +1149,15 @@ top of this section.
|
|
|
1030
1149
|
|
|
1031
1150
|
#### Parameters
|
|
1032
1151
|
|
|
1033
|
-
| Subcommand
|
|
1034
|
-
|
|
|
1035
|
-
| `submit <file>`
|
|
1152
|
+
| Subcommand | Argument | Options |
|
|
1153
|
+
| --------------- | -------- | ----------------------------- |
|
|
1154
|
+
| `submit <file>` | `<file>` | `--repository-name` · `--out` |
|
|
1036
1155
|
|
|
1037
|
-
| Parameter | Description
|
|
1038
|
-
| -------------------------- |
|
|
1156
|
+
| Parameter | Description |
|
|
1157
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1039
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 |
|
|
1040
|
-
| `--repository-name <name>` | Label of the evaluated repository, used only when the envelope carries no `target.repositories`. There is no repository
|
|
1041
|
-
| `--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 |
|
|
1042
1161
|
|
|
1043
1162
|
#### Response format
|
|
1044
1163
|
|
|
@@ -1046,27 +1165,33 @@ Under `--json`, `stdout` carries one document with the API response untouched
|
|
|
1046
1165
|
under `data`:
|
|
1047
1166
|
|
|
1048
1167
|
```jsonc
|
|
1049
|
-
{
|
|
1168
|
+
{
|
|
1169
|
+
"ok": true,
|
|
1170
|
+
"operation": "submit_eval",
|
|
1171
|
+
"data": {
|
|
1172
|
+
/* the body below */
|
|
1173
|
+
},
|
|
1174
|
+
}
|
|
1050
1175
|
```
|
|
1051
1176
|
|
|
1052
1177
|
Without `--json`, `stdout` stays empty and a one-line summary goes to `stderr`.
|
|
1053
1178
|
|
|
1054
|
-
| Field | Meaning
|
|
1055
|
-
| --------------- |
|
|
1056
|
-
| `success` | Always `true` on a `0` exit
|
|
1179
|
+
| Field | Meaning |
|
|
1180
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1181
|
+
| `success` | Always `true` on a `0` exit |
|
|
1057
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 |
|
|
1058
|
-
| `project_id` | The project the evaluation was recorded under — the one the server authorized, not the one you asked for
|
|
1059
|
-
| `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 |
|
|
1060
1185
|
|
|
1061
1186
|
#### Exit codes
|
|
1062
1187
|
|
|
1063
1188
|
The general table above holds; this is how each condition maps to it:
|
|
1064
1189
|
|
|
1065
|
-
| Code | When
|
|
1066
|
-
| ---- |
|
|
1067
|
-
| `0` | The evaluation was recorded
|
|
1190
|
+
| Code | When |
|
|
1191
|
+
| ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1192
|
+
| `0` | The evaluation was recorded |
|
|
1068
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 |
|
|
1069
|
-
| `2` | The API rejected the token (`401`) — run `productdock login` again
|
|
1194
|
+
| `2` | The API rejected the token (`401`) — run `productdock login` again |
|
|
1070
1195
|
|
|
1071
1196
|
### `productdock state` — the SDLC state of a work item
|
|
1072
1197
|
|
|
@@ -1116,14 +1241,12 @@ productdock state update --ref PROD-168 --type lesson \
|
|
|
1116
1241
|
`productdock state update --help` prints the accepted `content` fields **per
|
|
1117
1242
|
`--type`**, so finding them out does not cost a probe against a real work item.
|
|
1118
1243
|
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
1244
|
Both subcommands also accept `--json`, `--project-id` and `--repository-id`,
|
|
1122
1245
|
documented once at the top of this section.
|
|
1123
1246
|
|
|
1124
1247
|
**The repository travels with both.** The state is repo-aware: `feature_state`
|
|
1125
1248
|
has one row per `(work item, repository)`, and the artifact list is filtered the
|
|
1126
|
-
same way. The repository of `productdock.json` is sent by `phase`
|
|
1249
|
+
same way. The repository of `productdock.json` is sent by `phase` _and_ by
|
|
1127
1250
|
`update`, so reading with one scope and writing with another — two truths for
|
|
1128
1251
|
the same work item, with no error anywhere — cannot happen by accident.
|
|
1129
1252
|
|
|
@@ -1144,27 +1267,27 @@ the same work item, with no error anywhere — cannot happen by accident.
|
|
|
1144
1267
|
and one where a decision/blocker/lesson would end up with an empty body
|
|
1145
1268
|
because the text arrived under keys this operation does not read. An entry
|
|
1146
1269
|
with only a title is still accepted — a short record is not a loss;
|
|
1147
|
-
- in a `lesson`, the four fields of the skill's
|
|
1270
|
+
- in a `lesson`, the four fields of the skill's _Lessons Learned_ template
|
|
1148
1271
|
(`context`, `problem`, `solution`, `prevents`) are accepted and composed into
|
|
1149
1272
|
`description`. They used to be dropped in silence, leaving the lesson with
|
|
1150
1273
|
nothing but its title.
|
|
1151
1274
|
|
|
1152
1275
|
#### Parameters
|
|
1153
1276
|
|
|
1154
|
-
| Subcommand
|
|
1155
|
-
|
|
|
1156
|
-
| `phase <ref>`
|
|
1157
|
-
| `update [file]`
|
|
1158
|
-
|
|
1159
|
-
| Parameter | Description
|
|
1160
|
-
| ------------------ |
|
|
1161
|
-
| `<ref>` | **Required** on `phase`. The work item — `PREFIX-N` (`PROD-168`), a number, a UUID or a title
|
|
1162
|
-
| `--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
|
|
1163
|
-
| `--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
|
|
1164
|
-
| `[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
|
|
1165
|
-
| `--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 |
|
|
1166
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` |
|
|
1167
|
-
| `--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 |
|
|
1168
1291
|
|
|
1169
1292
|
#### Response format
|
|
1170
1293
|
|
|
@@ -1181,44 +1304,44 @@ the `ignored_fields` warning, spelled out as "not stored".
|
|
|
1181
1304
|
|
|
1182
1305
|
`detect_phase`:
|
|
1183
1306
|
|
|
1184
|
-
| Field
|
|
1185
|
-
|
|
|
1186
|
-
| `feature_id`
|
|
1187
|
-
| `status`
|
|
1307
|
+
| Field | Meaning |
|
|
1308
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1309
|
+
| `feature_id` | The work item the reference resolved to |
|
|
1310
|
+
| `status` | Kanban column (`backlog` … `production`) |
|
|
1188
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` |
|
|
1189
|
-
| `artifacts_found`
|
|
1190
|
-
| `work_item_type`/`flow_mode` | Type and **Fluxo Rápido** of the item (`full`/`fast`, only meaningful on `improvement`)
|
|
1191
|
-
| `uses_plan`
|
|
1192
|
-
| `mode`
|
|
1193
|
-
| `tasks_progress`
|
|
1194
|
-
| `implementation_complete`
|
|
1195
|
-
| `open_qa_bugs`
|
|
1196
|
-
| `state_content`
|
|
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 |
|
|
1197
1320
|
|
|
1198
1321
|
`update_state`:
|
|
1199
1322
|
|
|
1200
|
-
| Field
|
|
1201
|
-
|
|
|
1202
|
-
| `success`
|
|
1203
|
-
| `work_item_id`
|
|
1204
|
-
| `applied`
|
|
1205
|
-
| `current_phase`
|
|
1206
|
-
| `accepted_fields`
|
|
1207
|
-
| `ignored_fields`
|
|
1208
|
-
| `dry_run`
|
|
1209
|
-
| `idempotent`
|
|
1210
|
-
| `flow_mode`/`previous_flow_mode` | Only on `flow_change`
|
|
1211
|
-
| `progress`
|
|
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`) |
|
|
1212
1335
|
|
|
1213
1336
|
#### Exit codes
|
|
1214
1337
|
|
|
1215
1338
|
The general table above holds; this is how each condition maps to it:
|
|
1216
1339
|
|
|
1217
|
-
| Code | When
|
|
1218
|
-
| ---- |
|
|
1219
|
-
| `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 |
|
|
1220
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 |
|
|
1221
|
-
| `2` | The API rejected the token (`401`) — run `productdock login` again
|
|
1344
|
+
| `2` | The API rejected the token (`401`) — run `productdock login` again |
|
|
1222
1345
|
|
|
1223
1346
|
### `productdock doctor`
|
|
1224
1347
|
|
|
@@ -1265,11 +1388,11 @@ Checks performed:
|
|
|
1265
1388
|
|
|
1266
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:
|
|
1267
1390
|
|
|
1268
|
-
| IDE key | Target | Skills
|
|
1269
|
-
| ------------------------------- | --------- |
|
|
1270
|
-
| `claude-code`, `claude-desktop` | `claude` | `.claude/skills/<name>/`
|
|
1271
|
-
| `vscode` | `copilot` | `.github/skills/<name>/`
|
|
1272
|
-
| `cursor` | `cursor` | `.cursor/skills/<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>/` |
|
|
1273
1396
|
|
|
1274
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.
|
|
1275
1398
|
|
|
@@ -1278,20 +1401,24 @@ Everything installed is recorded in `productdock.json`, which is what `update` a
|
|
|
1278
1401
|
```jsonc
|
|
1279
1402
|
{
|
|
1280
1403
|
"ides": ["claude-code", "cursor"],
|
|
1281
|
-
"project": {
|
|
1404
|
+
"project": {
|
|
1405
|
+
"id": "…",
|
|
1406
|
+
"name": "ProductDock",
|
|
1407
|
+
"repositoryName": "productdock-cli",
|
|
1408
|
+
},
|
|
1282
1409
|
"mcp": { "url": "https://productdock-api.softdesign.com.br/mcp" },
|
|
1283
1410
|
"skills": {
|
|
1284
1411
|
"pd-workflow": {
|
|
1285
1412
|
"version": "1.4.0",
|
|
1286
|
-
"sha256": "…",
|
|
1413
|
+
"sha256": "…", // fingerprint of the installed tree
|
|
1287
1414
|
"targets": ["claude", "cursor"],
|
|
1288
1415
|
"installedAt": "2026-08-31T12:00:00.000Z",
|
|
1289
|
-
"branch": "feature/new-phases" // only when it differs from `main`; absent means `main`
|
|
1290
|
-
}
|
|
1416
|
+
"branch": "feature/new-phases", // only when it differs from `main`; absent means `main`
|
|
1417
|
+
},
|
|
1291
1418
|
},
|
|
1292
1419
|
"agents": {
|
|
1293
1420
|
/* same shape as skills */
|
|
1294
|
-
}
|
|
1421
|
+
},
|
|
1295
1422
|
}
|
|
1296
1423
|
```
|
|
1297
1424
|
|
|
@@ -1345,12 +1472,12 @@ productdock login IDE (Claude Code / Cursor / VS Code)
|
|
|
1345
1472
|
|
|
1346
1473
|
All optional — defaults point at production.
|
|
1347
1474
|
|
|
1348
|
-
| Variable | Default
|
|
1349
|
-
| -------------------------- |
|
|
1350
|
-
| `PRODUCTDOCK_API_URL` | `https://productdock-api.softdesign.com.br`
|
|
1351
|
-
| `PRODUCTDOCK_MCP_URL` | `<PRODUCTDOCK_API_URL>/mcp`
|
|
1352
|
-
| `PRODUCTDOCK_REGISTRY_URL` | `https://productdock-core-api.softdesign.com.br`
|
|
1353
|
-
| `AI_TOOLS_BRANCH` | _(registry default branch, `main`)_
|
|
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 |
|
|
1354
1481
|
|
|
1355
1482
|
When running from source, these are also read from a `.env` file in the repository root — see `.env.example`.
|
|
1356
1483
|
|
|
@@ -1384,33 +1511,33 @@ bun test test/output.test.ts
|
|
|
1384
1511
|
|
|
1385
1512
|
### Source layout
|
|
1386
1513
|
|
|
1387
|
-
| File
|
|
1388
|
-
|
|
|
1389
|
-
| `bin/productdock.ts`
|
|
1390
|
-
| `lib/constants.ts`
|
|
1391
|
-
| `lib/auth.ts`
|
|
1392
|
-
| `lib/config.ts`
|
|
1393
|
-
| `lib/api.ts`
|
|
1394
|
-
| `lib/git.ts`
|
|
1395
|
-
| `lib/ide.ts`
|
|
1396
|
-
| `lib/registry.ts`
|
|
1397
|
-
| `lib/http.ts`
|
|
1398
|
-
| `lib/scope.ts`
|
|
1399
|
-
| `lib/artifacts.ts`
|
|
1400
|
-
| `lib/frontmatter.ts`
|
|
1401
|
-
| `lib/artifact-commands.ts
|
|
1402
|
-
| `lib/work-items.ts`
|
|
1403
|
-
| `lib/work-item-attachments.ts` | The `wi` writes — `comment` over `/cli/work-items/comments` and `evidence` (multipart) over `/cli/work-items/qa-evidence`
|
|
1404
|
-
| `lib/code.ts`
|
|
1405
|
-
| `lib/phase-artifacts.ts`
|
|
1406
|
-
| `lib/prd-review.ts`
|
|
1407
|
-
| `lib/evaluations.ts`
|
|
1408
|
-
| `lib/sdlc-state.ts`
|
|
1409
|
-
| `lib/doctor.ts`
|
|
1410
|
-
| `lib/exit.ts`
|
|
1411
|
-
| `lib/output.ts`
|
|
1412
|
-
| `lib/tty.ts`
|
|
1413
|
-
| `lib/types.d.ts`
|
|
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 |
|
|
1414
1541
|
|
|
1415
1542
|
### Building
|
|
1416
1543
|
|