@softdesignbrasil/productdock-cli 0.5.0 → 0.7.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 CHANGED
@@ -274,10 +274,16 @@ productdock agent install pd-reviewer
274
274
  # Pin a specific version
275
275
  productdock skill install pd-workflow --version 1.4.0
276
276
 
277
+ # Overwrite something already on disk
278
+ productdock skill install pd-workflow --force
279
+
277
280
  # Update one, or everything installed
278
281
  productdock skill update pd-workflow
279
282
  productdock agent update
280
283
 
284
+ # Reinstall the latest even if up to date or locally modified (discards local edits)
285
+ productdock skill update pd-workflow --force
286
+
281
287
  # Compare what is on disk against the registry
282
288
  productdock skill status
283
289
  productdock agent status
@@ -286,8 +292,8 @@ productdock agent status
286
292
  | Subcommand | Description |
287
293
  | ----------------------- | ------------------------------------------------------------------------------- |
288
294
  | `list` | List what the registry offers. `--source internal\|third-party\|productdock` |
289
- | `install <name>` | Install into every target derived from `productdock.json`. `--version <version>` |
290
- | `update [name]` | Update one, or every installed item. Locally modified items are skipped |
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` |
291
297
  | `status` | Report `up to date` / `outdated` / `modified` per installed item |
292
298
 
293
299
  `status` compares a SHA256 fingerprint of the installed directory against the versions the registry knows about:
@@ -303,9 +309,9 @@ productdock agent status
303
309
 
304
310
  ### `productdock wi` — work items
305
311
 
306
- Five operations over the work items of a project, served by the
307
- `/cli/work-items/*` endpoints of the ProductDock API. Three of them read
308
- (`list`, `prd`, `spec-context`); two of them write to the work item —
312
+ Six operations over the work items of a project, served by the
313
+ `/cli/work-items/*` endpoints of the ProductDock API. Four of them read
314
+ (`list`, `prd`, `spec-context`, `bugs`); two of them write to the work item —
309
315
  `comment` posts a comment, `evidence` uploads a QA screenshot. Each has its own
310
316
  subsection below.
311
317
 
@@ -381,6 +387,76 @@ The general table above holds; this is how each condition maps to it:
381
387
  | `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 |
382
388
  | `2` | The API rejected the token (`401`) — run `productdock login` again |
383
389
 
390
+ #### `productdock wi bugs`
391
+
392
+ Lists the bugs of a work item's **Quality** tab, served by the
393
+ `/cli/work-items/qa-issues` endpoint of the ProductDock API. It is the same
394
+ operation the MCP server exposes as the `get_qa_issues` tool, and it returns the
395
+ same body — the CLI and the MCP call the same code on the server, so reading
396
+ every lineage, keeping one entry per bug id at its latest version, the status
397
+ filter and the `summary` are one implementation, not two.
398
+
399
+ **A bug belongs to the work item, not to a repository.** The bugs recorded on
400
+ the platform carry no repository and the ones recorded by the skill do, and the
401
+ command returns both: the `project.repository` of `productdock.json` is **not**
402
+ sent, exactly as in `wi prd`.
403
+
404
+ ```bash
405
+ # Every bug of the work item, whatever its status
406
+ productdock wi bugs PROD-222
407
+
408
+ # Only the open ones, machine-readable — what the workflow skill reads
409
+ productdock wi bugs PROD-222 --status open --json
410
+
411
+ # Saved to a file
412
+ productdock wi bugs PROD-222 --json --out bugs.json
413
+ ```
414
+
415
+ ##### Parameters
416
+
417
+ | Subcommand | Argument | Options |
418
+ | ------------- | -------- | -------------------------------------- |
419
+ | `bugs <ref>` | `<ref>` | `--status <status>` · `--out <file>` |
420
+
421
+ | Parameter | Description |
422
+ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
423
+ | `<ref>` | **Required.** Work item reference in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
424
+ | `--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 |
426
+
427
+ ##### Response format
428
+
429
+ Under `--json`, `stdout` carries one document with the API response untouched
430
+ under `data`:
431
+
432
+ ```jsonc
433
+ { "ok": true, "operation": "get_qa_issues", "data": { /* the body below */ } }
434
+ ```
435
+
436
+ Without `--json`, `stdout` stays empty and a summary goes to `stderr`: one line
437
+ per bug — id, status, severity, title — and the count of open ones.
438
+
439
+ `data` is `{ summary, count, issues[] }`:
440
+
441
+ | Field | Meaning |
442
+ | ------------------ | -------------------------------------------------------------------------------------------------------------------------- |
443
+ | `summary` | Bug counts by status — `{ open, resolved, invalid }` — over the bugs that came back, after `--status` |
444
+ | `count` | How many bugs came back |
445
+ | `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
+
447
+ A work item with no bugs returns `count: 0` and `issues: []`, which is a
448
+ **success**, not an error.
449
+
450
+ ##### Exit codes
451
+
452
+ The general table above holds; this is how each condition maps to it:
453
+
454
+ | Code | When |
455
+ | ---- | ---------------------------------------------------------------------------------------------------------------------------- |
456
+ | `0` | The bugs were read — including a work item with no bugs |
457
+ | `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 |
459
+
384
460
  #### `productdock wi comment`
385
461
 
386
462
  Posts a comment on a work item, served by the `/cli/work-items/comments`
@@ -1116,6 +1192,7 @@ the `ignored_fields` warning, spelled out as "not stored".
1116
1192
  | `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 |
1117
1193
  | `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 |
1118
1194
  | `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 |
1195
+ | `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) |
1119
1196
  | `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 |
1120
1197
 
1121
1198
  `update_state`:
@@ -1322,7 +1399,7 @@ bun test test/output.test.ts
1322
1399
  | `lib/artifacts.ts` | Install core: destinations, zip extraction, SHA256 fingerprint, drift |
1323
1400
  | `lib/frontmatter.ts` | Frontmatter adaptation per platform (agents) — port of the ai-tools installer |
1324
1401
  | `lib/artifact-commands.ts`| The `skill` and `agent` command groups, generic over artifact kind |
1325
- | `lib/work-items.ts` | The `wi` command group — `list`, `prd` and `spec-context` over `/cli/work-items/*` |
1402
+ | `lib/work-items.ts` | The `wi` command group — `list`, `prd`, `spec-context` and `bugs` over `/cli/work-items/*` |
1326
1403
  | `lib/work-item-attachments.ts` | The `wi` writes — `comment` over `/cli/work-items/comments` and `evidence` (multipart) over `/cli/work-items/qa-evidence` |
1327
1404
  | `lib/code.ts` | The `code` command group — `map` and `search` over `/cli/code/*` |
1328
1405
  | `lib/phase-artifacts.ts` | The `artifact` command group — `submit` over `/cli/artifacts` and `commit` over `/cli/artifacts/commit`, body from a file |