@difflab/pi 0.5.0 → 0.6.0-rc.202609270756.7689e22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +8 -6
  2. package/agents/diffpi-copilot.md +6 -3
  3. package/agents/diffpi-orchestrator.md +6 -4
  4. package/agents/diffpi-planner.md +3 -3
  5. package/agents/diffpi-reviewer.md +3 -3
  6. package/agents/diffpi-worker.md +1 -1
  7. package/dist/assets.d.ts +0 -1
  8. package/dist/assets.d.ts.map +1 -1
  9. package/dist/cli.js +417 -84
  10. package/dist/commands/plan.d.ts +2 -2
  11. package/dist/commands/plan.d.ts.map +1 -1
  12. package/dist/commands/review.d.ts +2 -3
  13. package/dist/commands/review.d.ts.map +1 -1
  14. package/dist/environment.d.ts +2 -0
  15. package/dist/environment.d.ts.map +1 -1
  16. package/dist/extensions/index.js +1147 -3634
  17. package/dist/index.js +437 -99
  18. package/dist/plan/markdown.d.ts +4 -1
  19. package/dist/plan/markdown.d.ts.map +1 -1
  20. package/dist/{tools/plan-schema.d.ts → plan/schema.d.ts} +113 -75
  21. package/dist/plan/schema.d.ts.map +1 -0
  22. package/dist/plan/store.d.ts +39 -1
  23. package/dist/plan/store.d.ts.map +1 -1
  24. package/dist/plan/types.d.ts +27 -3
  25. package/dist/plan/types.d.ts.map +1 -1
  26. package/dist/review/local-reviews.d.ts +31 -0
  27. package/dist/review/local-reviews.d.ts.map +1 -0
  28. package/dist/review/review-markdown.d.ts.map +1 -1
  29. package/dist/tools/index.js +879 -420
  30. package/dist/tools/plan.d.ts.map +1 -1
  31. package/dist/tools/review.d.ts +9 -1
  32. package/dist/tools/review.d.ts.map +1 -1
  33. package/package.json +2 -4
  34. package/skills/plan/SKILL.md +8 -14
  35. package/skills/plan/references/design-quality.md +41 -0
  36. package/skills/plan/references/workflows/annotate.md +11 -0
  37. package/skills/plan/references/workflows/finalize.md +7 -0
  38. package/skills/plan/references/workflows/go.md +8 -0
  39. package/skills/plan/references/workflows/help.md +10 -0
  40. package/skills/plan/references/workflows/init.md +5 -0
  41. package/skills/plan/references/workflows/new.md +7 -0
  42. package/skills/plan/references/workflows/update.md +7 -0
  43. package/skills/review/SKILL.md +7 -9
  44. package/skills/review/references/review-standards.md +8 -1
  45. package/skills/review/references/workflows/address.md +4 -4
  46. package/skills/review/references/workflows/auto.md +4 -4
  47. package/skills/review/references/workflows/complete.md +2 -2
  48. package/skills/review/references/workflows/edit.md +3 -3
  49. package/skills/review/references/workflows/help.md +8 -2
  50. package/skills/review/references/workflows/merge.md +2 -2
  51. package/skills/review/references/workflows/new.md +5 -5
  52. package/skills/review/references/workflows/open.md +1 -1
  53. package/skills/review/references/workflows/publish.md +2 -2
  54. package/skills/review/references/workflows/status.md +3 -0
  55. package/templates/plan/PLAN.md +2 -2
  56. package/templates/plan/implementation.md +16 -10
  57. package/dist/commands.d.ts +0 -22
  58. package/dist/commands.d.ts.map +0 -1
  59. package/dist/extensions/cmdtsx.d.ts +0 -2
  60. package/dist/extensions/cmdtsx.d.ts.map +0 -1
  61. package/dist/tools/plan-schema.d.ts.map +0 -1
  62. package/dist/workflow.d.ts +0 -33
  63. package/dist/workflow.d.ts.map +0 -1
  64. package/workflows/plan/annotate.md +0 -13
  65. package/workflows/plan/finalize.md +0 -15
  66. package/workflows/plan/go.md +0 -20
  67. package/workflows/plan/help.md +0 -20
  68. package/workflows/plan/init.md +0 -13
  69. package/workflows/plan/new.md +0 -20
  70. package/workflows/plan/update.md +0 -18
@@ -1 +1 @@
1
- {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/tools/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAQpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/C,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAmBhE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,iBAAiB,CAAC,GAC5E,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;AAE7C,wBAAgB,eAAe,CAC7B,GAAG,EAAE,eAAe,EACpB,MAAM,EAAE,cAAc,EACtB,KAAK,GAAE,SAA6B,GACnC,SAAS,cAAc,EAAE,CA6W3B"}
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/tools/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAQpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/C,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAchE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,iBAAiB,CAAC,GAC5E,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;AAE7C,wBAAgB,eAAe,CAC7B,GAAG,EAAE,eAAe,EACpB,MAAM,EAAE,cAAc,EACtB,KAAK,GAAE,SAA6B,GACnC,SAAS,cAAc,EAAE,CAkR3B"}
@@ -1,6 +1,12 @@
1
1
  import { type ToolDefinition } from '@earendil-works/pi-coding-agent';
2
- import { type ReviewComment, type ReviewThreadRecord } from '../review';
2
+ import { run } from '../extensions/processx';
3
+ import { type ReviewComment, type ReviewDraft, type ReviewThreadRecord } from '../review';
3
4
  export declare function hasReviewDraft(comments: readonly ReviewComment[], body: string): boolean;
5
+ export declare function reviewBrowserCommand(url: string, platform?: NodeJS.Platform): {
6
+ command: string;
7
+ args: string[];
8
+ };
9
+ export declare function openReviewUrl(url: string, execute?: typeof run, platform?: NodeJS.Platform): Promise<boolean>;
4
10
  export declare function partitionReviewComments(comments: readonly ReviewComment[], knownFingerprints: ReadonlySet<string>, model: string): {
5
11
  checkpointed: {
6
12
  source: ReviewComment;
@@ -27,6 +33,8 @@ export declare function partitionReviewComments(comments: readonly ReviewComment
27
33
  fingerprint: string;
28
34
  }[];
29
35
  };
36
+ export declare function reviewResponseResolution(question: boolean, requested?: boolean): boolean;
37
+ export declare function workingTreeReplyDraft(thread: ReviewThreadRecord, body: string): ReviewDraft;
30
38
  export declare function resolveReviewThread(comment: ReviewComment, threads: readonly ReviewThreadRecord[]): ReviewThreadRecord | undefined;
31
39
  export declare function workingTreeDiff(cwd: string): Promise<string>;
32
40
  export declare function createReviewTools(): readonly ToolDefinition[];
@@ -1 +1 @@
1
- {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/tools/review.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAMzG,OAAO,EAwBL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AAwEnB,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAExF;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,EACtC,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EAUd;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,kBAAkB,GAAG,SAAS,CAmBhC;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAalE;AAID,wBAAgB,iBAAiB,IAAI,SAAS,cAAc,EAAE,CAyc7D;AAID,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAwB/B"}
1
+ {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/tools/review.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAKzG,OAAO,EAAE,GAAG,EAAc,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAwBL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AAwEnB,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAExF;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B;;;EAM7F;AAED,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,OAAO,GAAS,EACzB,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,EACtC,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EAUd;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAExF;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAY3F;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,kBAAkB,GAAG,SAAS,CAmBhC;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAalE;AAID,wBAAgB,iBAAiB,IAAI,SAAS,cAAc,EAAE,CAof7D;AAID,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAwB/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difflab/pi",
3
- "version": "0.5.0",
3
+ "version": "0.6.0-rc.202609270756.7689e22",
4
4
  "description": "Tools and skills for the pi coding agent",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,8 +34,7 @@
34
34
  "agents/",
35
35
  "dist/",
36
36
  "skills/",
37
- "templates/",
38
- "workflows/"
37
+ "templates/"
39
38
  ],
40
39
  "pi": {
41
40
  "extensions": [
@@ -58,7 +57,6 @@
58
57
  },
59
58
  "dependencies": {
60
59
  "@juicesharp/rpiv-ask-user-question": "^2.10.1",
61
- "cmd-ts": "^0.15.0",
62
60
  "commander": "^14.0.0",
63
61
  "mdast-builder": "1.1.1",
64
62
  "pi-mcp-adapter": "^2.33.0",
@@ -1,23 +1,17 @@
1
1
  ---
2
2
  name: plan
3
- description: Route natural-language planning requests to Diffpi's /plan commands. Use when a user wants to create, revise, annotate, finalize, or execute a durable plan, or asks which /plan command to run.
4
- allowed-tools: ask_user_question
3
+ description: Create, revise, annotate, finalize, and execute durable Diffpi plans. Use for /skill:plan, /plan, or natural-language planning requests.
4
+ allowed-tools: read grep find symbol_search module_report read_symbol ask_user_question Agent get_subagent_result steer_subagent plan_context plan_init plan_apply_revision plan_validate plan_review plan_annotate plan_start_execution plan_update_status plan_log_progress plan_run_gates plan_record_ci watch_ci
5
5
  ---
6
6
 
7
- # Plan Command Guide
7
+ # Plan
8
8
 
9
- Use `/plan` commands as the execution boundary. Do not reproduce their workflows, call `plan_*` tools directly, or edit managed plan files.
9
+ This skill owns the workflow. `/plan` only forwards its raw arguments to `/skill:plan`. Do not emit another command to paste or rely on a command handler to select an agent, parse flags, or inject a workflow. Call plan tools directly; never edit managed PLAN.md, implementation briefs, revisions, reviews, or logs with file tools.
10
10
 
11
- ## Natural-language routing
11
+ Identify the first explicit verb (`init`, `new`, `update`, `annotate`, `finalize`, `go`, `help`) or infer one from the user's request. If the verb or required plan is ambiguous, call `plan_context` and ask only for a material decision using `ask_user_question`. Read exactly the corresponding [workflow reference](references/workflows/) before acting. Preserve the exact incoming user request (and applied review feedback) as revision input; do not paraphrase it.
12
12
 
13
- Map the user's intent to one command:
13
+ `new` creates a complete plan without launching an editor; `init` creates a phase-less draft and opens it. For content changes, build a complete candidate and apply it **once per user request** with `plan_apply_revision`. Phase/task status and gates use their dedicated tools and do not constitute a new content revision. Strict `plan_validate` checks document and brief structure, not whether source code implements the plan. `go` calls `plan_start_execution` before any code change; if the plan is draft or on the wrong branch, stop.
14
14
 
15
- - Create an empty plan shell: `/plan init <short-slug> [--branch <name>]`
16
- - Research and author a complete plan: `/plan new <short-slug> [--branch <name>] [--bg] [prompt...]`
17
- - Revise a plan from chat instructions or its current plan review: `/plan update [short-slug] [--branch <name>] [--bg] [instructions...]`
18
- - Review a plan in tuicr and save the result: `/plan annotate [short-slug]`
19
- - Validate and mark a plan ready: `/plan finalize [short-slug]`
20
- - Execute a plan: `/plan go <short-slug> [--mode <no-commit|commit|push>] [--bg]`
21
- - Show command help: `/plan help`
15
+ `--bg` requests one named background agent through `Agent` (Planner for authoring, Orchestrator for execution); pass the verb, exact arguments, cwd, and a `background: true` instruction. Remove `--bg` from the child's request and explicitly forbid redispatch. Return after launching it. A background child must not ask user questions. If `Agent` is unavailable, stop and report that background execution cannot be started; never silently execute inline. Without `--bg`, execute in the current turn: author as Planner, coordinate go as Orchestrator and delegate bounded Worker tasks; do not assume an inline mode switch occurred. Do not launch a multi-agent workflow unless the user explicitly opts into one.
22
16
 
23
- Infer the command, slug, branch, and free-text arguments from recent conversation when they are clear. If a required value cannot be inferred, use `ask_user_question`; do not ask in plain chat. Then give the user one exact, copyable `/plan` command. Explain defaults only when relevant: `go` uses `--mode no-commit` when `--mode` is omitted.
17
+ Operational references: [init](references/workflows/init.md), [new](references/workflows/new.md), [update](references/workflows/update.md), [annotate](references/workflows/annotate.md), [finalize](references/workflows/finalize.md), [go](references/workflows/go.md), [help](references/workflows/help.md).
@@ -0,0 +1,41 @@
1
+ # Plan authoring quality
2
+
3
+ Build the design from repository evidence, not generic slogans. Keep it concise enough to scan, but never shrink a section into an uninformative one-line paragraph just to reach a word count.
4
+
5
+ ## Big Ideas
6
+
7
+ Use outcome-oriented bullets. Each bullet says what will become different and why it belongs in this plan; do not repeat the phase titles. For example:
8
+
9
+ - Keep task status and phase ordering in `PLAN.md` so readers can see progress without reading implementation instructions.
10
+ - Write one numbered brief per phase so Workers receive concrete steps and file/API contracts.
11
+ - Reject incomplete briefs at finalization instead of handing placeholders to execution agents.
12
+
13
+ ## Key API Addition/Updates
14
+
15
+ Use explanatory paragraphs and illustrative fenced examples showing the actual public call and data contract. Explain which previous call is removed, who calls the new API, what arguments/return value mean, and how errors are surfaced. Do not invent details that the repository has not established; call out a genuine unresolved choice instead. For example:
16
+
17
+ ```ts
18
+ await plan_apply_revision({
19
+ mode: 'amend', // use 'create' with shortSlug instead for revision 0
20
+ plan,
21
+ expectedPlanRevision,
22
+ request: { kind: 'user', text: exactRequest },
23
+ title,
24
+ intent,
25
+ requirements,
26
+ design: { bigIdeas, keyApiUpdates, consequences },
27
+ references,
28
+ phases,
29
+ briefs,
30
+ });
31
+ ```
32
+
33
+ Follow the example with a paragraph describing revision creation and validation, then another covering old mutators or callers being replaced. `mode: 'create'` instead takes `shortSlug` (and optional branch/issue fields) and writes revision 0 directly; `mode: 'amend'` takes `plan` and `expectedPlanRevision` and writes the next revision. Both modes require the same `request`, overview fields, ordered `phases`, and matching `briefs`; there is no `inputs` field and no separate `complete` field. If no public API changes, say so explicitly and show the relevant internal interface or data flow instead.
34
+
35
+ ## Consequences
36
+
37
+ Write distinct before/after paragraphs: how a user invokes the workflow, what a client or Worker reads/calls, and how failure looks. Describe concrete behavior: editor launch, status transitions, validation, snapshots, and review visibility as applicable. Include at least one trade-off, such as storage cost or compatibility break; do not substitute a generic maintainability claim.
38
+
39
+ ## PLAN.md versus briefs
40
+
41
+ Under each PLAN.md phase, make **each discrete implementation action a separate stable task checkbox**. Do not embed Steps, File scopes, or Acceptance criteria below its checkbox. In `implementation/phase-<ordinal>.md`, relist every stable task ID and title and provide ordered implementation steps, exact affected files, API/data-contract changes, algorithms/libraries, constraints, and acceptance criteria. A lightweight Worker must be able to implement the task from the brief without guessing. Before finalization, inspect each rendered brief and require strict validation; no scaffold comments or “define during implementation” placeholders are acceptable.
@@ -0,0 +1,11 @@
1
+ # `/plan annotate`
2
+
3
+ ## PLAN.md task
4
+
5
+ Review the selected plan in tuicr and save one immutable review.
6
+
7
+ ## Brief
8
+
9
+ 1. Call `plan_context` and resolve the exact plan ID from the slug or conversation; ask the user only if candidates remain ambiguous.
10
+ 2. Call `plan_annotate` using the plan file; it owns the tuicr session and review artifact.
11
+ 3. Report the selected plan, launch result, and copyable fallback command. Tell the user to run `/plan update <plan-id>` after closing tuicr.
@@ -0,0 +1,7 @@
1
+ # Finalize
2
+
3
+ 1. Call `plan_context` to resolve exactly one persisted plan. Call `plan_review` once for that plan and revision. If a current annotation exists, incorporate its exact feedback as one content request through `plan_apply_revision` before finalizing; do not mutate the plan per individual comment. A stale review must not be applied.
4
+ 2. Call `plan_validate` with `strict: true` on the resulting revision. Stop if any error remains; this validates plan structure, detailed briefs, and revision snapshots, **not implementation correctness**. Do not mark a plan with empty briefs ready.
5
+ 3. Call `plan_update_status` to mark the draft `ready`. Do not call `plan_start_execution` until the user chooses execution.
6
+ 4. In foreground mode, use one `ask_user_question` for next action (execute now in foreground/background, later, or keep planning); if executing, also obtain commit mode (`no-commit`, `commit`, or `push`; default `no-commit` if already specified). If they choose execution, follow the [go workflow](go.md) directly in the selected mode; background execution launches one child, not another slash command. If they choose later or planning, return the ready state. Background finalization cannot ask and must leave execution for an explicit request.
7
+ 5. No inline mode was selected by a command, so do not unset one as a side effect of finalization.
@@ -0,0 +1,8 @@
1
+ # Go
2
+
3
+ 1. Call `plan_context` with the supplied slug. Accept only `no-commit`, `commit`, or `push`; omitted `--mode` means `no-commit`. Do not ask for a mode if the user already chose it.
4
+ 2. If the resolved plan is `draft`, finalize it inline before execution: call `plan_review` for the current revision and consume only a current review (apply its exact feedback as one `plan_apply_revision` amend when present; ignore stale reviews), then call `plan_validate` with `strict: true`. If validation passes, call `plan_update_status` for the plan from `draft` to `ready`. Do not invoke the finalize workflow or ask its next-action question. An already `ready` or `blocked` plan needs no review or readiness transition; pass it to `plan_start_execution`, which owns restart and blocker eligibility checks.
5
+ 3. Call `plan_start_execution` **before** modifying source, delegating work, or running gates. This enforces ready/blocked status, correct branch, clean worktree when committing, and durable execution ownership. On failure, stop and report the exact blocker; never implement a draft plan speculatively.
6
+ 4. Use the returned execution ID and packet. Read the complete phase briefs, assign bounded tasks in dependency order to Workers, and track progress and status through plan tools. Workers do not commit or restructure the plan. Run `plan_run_gates` when a phase's tasks are complete. Failed gates block that phase until repaired and rerun.
7
+ 5. In `no-commit`, make no commits or pushes. In `commit`, commit once per phase **after** gates pass; do not push or watch CI. In `push`, push each gated phase commit and monitor CI for its exact SHA, collecting the monitor before the next push and all monitors before completion. Persist the observed commit/CI metadata through plan tools.
8
+ 6. Complete the plan only after every task, phase, gate, and required CI settles. Report execution ID, mode, and evidence. Background execution must not affect foreground mode; foreground execution does not require a mode reset because this skill did not select one.
@@ -0,0 +1,10 @@
1
+ # `/plan help`
2
+
3
+ ## PLAN.md task
4
+
5
+ Show the available plan commands and their concise purposes.
6
+
7
+ ## Brief
8
+
9
+ 1. List `init` (phase-less draft), `new` (research and author), `update` (apply review/instructions), `annotate` (tuicr review), `finalize` (validate and mark ready), `go` (start execution), and `help`.
10
+ 2. State that `--branch` records or filters metadata, `go` defaults to `--mode no-commit`, and background workflows do not ask questions.
@@ -0,0 +1,5 @@
1
+ # Init
2
+
3
+ 1. Resolve the supplied short slug and optional branch, title, intent, issue ID, and URL. `--branch` records metadata; it does not switch branches. Call `plan_context` first and stop if the selected plan already exists.
4
+ 2. Call `plan_init` with `open: true` and `request: {kind: "user", text: <exact incoming request>}`. The tool creates one phase-less draft and its initial request-scoped revision snapshot, then opens `PLAN.md` in a supported adjacent editor tab. Do not perform additional content mutations for this request.
5
+ 3. Return the plan ID, clickable path, and actual launch outcome or fallback path. Explain that `annotate` stores a plan review, `update` applies review or further instructions, and `finalize` checks completeness before execution.
@@ -0,0 +1,7 @@
1
+ # New
2
+
3
+ 1. Call `plan_context` for the supplied slug and branch. If a matching plan already exists, stop rather than silently overwriting it. If the goal is unspecified in foreground mode, use `ask_user_question` for the material scope decision; in background mode, state a blocker if no safe assumption exists.
4
+ 2. Research the relevant repository files, APIs, tests, and constraints before drafting. Follow [plan authoring quality](../design-quality.md): substantive Big Ideas bullets, illustrated API contracts, explicit before/after consequences, one stable PLAN.md task per implementation action, and a fully specified numbered brief per phase. Each brief must use numbered phase files, preserve exact phase/task IDs and order parity with PLAN.md, give ordered steps, exact file scopes, API/data contracts, algorithms/libraries, constraints, and acceptance criteria; inspect every rendered brief strictly for accuracy and completeness.
5
+ 3. Preserve the exact user request as a typed revision input. Build the **complete** candidate overview, ordered phases and task IDs, and matching briefs in memory. Call `plan_apply_revision` **once** with `mode: "create"`, the short slug, `request: {kind: "user", text: <exact incoming request>}`, a full overview and phase list, and one complete brief per phase; `create` writes revision 0 directly, so `/plan new` works without `plan_init`; do not create a phase-less shell first or open an editor.
6
+ 4. Validate the result strictly and inspect the generated brief paths. If any placeholders, missing task steps, mismatched IDs, or incomplete sections remain, report the failure rather than claiming readiness. A validation result is structural, not a check that source code already implements the plan.
7
+ 5. Report the plan ID and paths. Continue discussing changes in the same conversation; a later user request is a separate revision. Offer `annotate` for human review and `finalize` when ready, without making the user paste a command merely to continue this request.
@@ -0,0 +1,7 @@
1
+ # Update
2
+
3
+ 1. Call `plan_context` for the slug/branch; never guess among multiple candidates. Call `plan_review` once for the selected current revision before interpreting the request. A review of an older revision is stale; do not reapply it.
4
+ 2. Preserve the exact incoming request in `request.text` and select `request.kind` (`user`, `annotation`, or `blocker`) according to the trigger. When applying a plan review, read its full feedback; when unblocking execution, preserve the worker's blocker in the request. For annotation requests, include the exact LLM response/outcome in `request.response` and classify every comment as applied, answered, or unresolved with a concrete reason. Do not use vague “later” or “follow-up” deferrals unless the user explicitly requested that deferral. Research affected source files. Follow [plan authoring quality](../design-quality.md), including substantive Design sections and complete per-task implementation briefs. For both new and amended content, briefs must use numbered phase files, exact phase/task ID and order parity, ordered steps, exact file scopes, API/data contracts, algorithms/libraries, constraints, and acceptance criteria; strictly inspect every rendered brief for accuracy and completeness.
5
+ 3. Build the **entire resulting plan and numbered briefs in memory**, preserving completed task IDs, ownership, evidence, and dependencies. For a single authoring request, call `plan_apply_revision` with `mode: "amend"` exactly once, passing `plan`, `expectedPlanRevision`, `request`, the entire overview, ordered phases, and matching briefs. Do not mutate overview/phase/task content with separate tools, edit managed files by hand, or create a revision per comment.
6
+ 4. In foreground mode, ask only for missing decisions that materially affect scope; background work must not ask. Strictly validate the saved plan and briefs; stop with precise errors if they are incomplete. Do not treat structural validation as evidence that implementation already meets requirements.
7
+ 5. Report the one new revision and its snapshot path, what changed, and any remaining blocker. Further chat instructions form a future separate revision; `annotate` reviews the plan and `finalize` marks it ready.
@@ -1,17 +1,15 @@
1
1
  ---
2
2
  name: review
3
- description: Code review workflows over GitHub, GitLab, or the local tuicr backend. Use for auto reviews, review opening and editing, addressing, publishing, completing, merging, or local review requests.
4
- allowed-tools: ask_user_question review_context review_new review_edit review_diff review_gates review_submit review_add_comment review_comments review_respond review_publish review_complete review_merge review_launch_ui diffpi_template
3
+ description: Create, edit, review, address, publish, complete, and merge GitHub/GitLab or local tuicr reviews. Use for /skill:review, /review, or natural-language review requests.
4
+ allowed-tools: read ask_user_question Agent get_subagent_result steer_subagent review_context review_status review_new review_open review_edit review_diff review_gates review_submit review_add_comment review_comments review_respond review_publish review_complete review_merge review_launch_ui diffpi_template
5
5
  ---
6
6
 
7
- # review
7
+ # Review
8
8
 
9
- Treat `--local` as a backend selector. It always uses the local `tuicr` working-tree backend; without it, the detected GitHub or GitLab forge owns the remote target. Treat `--bg` as an execution selector handled by the `/review` command; it is removed before workflow parsing. Target selection, storage, provenance, templates, comment staging, replies, publication, and forge calls belong to the tools.
9
+ This skill owns the workflow. `/review` only forwards raw arguments to `/skill:review`; never rely on command-side flag parsing or mode activation. Parse the first non-flag argument as the verb and preserve remaining arguments and their order. Normalize `create`, `draft` → `new`; `launch` → `auto`; `ready` → `publish`; `close` → `complete`; `land` → `merge`. `open` and `status` are first-class lifecycle workflows. Empty/unknown verb shows [help](references/workflows/help.md).
10
10
 
11
- Parse the first non-flag argument as VERB and preserve remaining flags. Normalize `open`, `create`, and `draft` to `new`; normalize `launch` to `auto`, `ready` to `publish`, `close` to `complete`, and `land` to `merge`. An empty or unknown verb uses `references/workflows/help.md`.
11
+ `--local` selects the working-tree tuicr backend and **must be preserved** for the selected workflow; without it, use the forge. `--bg` is an execution flag: remove it from the child request and launch exactly one named background Orchestrator through `Agent`, passing verb, arguments, cwd, and an explicit `background: true` instruction. The child executes the workflow once without redispatch or interactive questions; the current foreground role remains unchanged. Without `--bg`, execute directly in this turn. Do not change inline modes or emit a command for the user to paste. Do not launch a multi-agent workflow unless the user explicitly opts into one.
12
12
 
13
- Read and follow `references/workflows/{VERB}.md`. Call `review_context` first in every workflow. Use `ask_user_question` for choices that cannot be derived from the request. Never ask those questions as plain chat text.
13
+ Read [the selected reference](references/workflows/) before acting. Every operational workflow calls `review_context` first with the same target and `local` setting. Use `ask_user_question` only for material decisions not derivable from the request; never ask as plain chat text. `auto` and `address` require reviewer judgment and thread classification; if a background Orchestrator is running, delegate that bounded judgment to a Reviewer via `Agent`, then collect the result. Delegate non-overlapping implementation only where useful. Lifecycle verbs retain the coordinator role. Tools own target selection, templates, comment staging, replies, publication, and forge calls; do not reimplement them with shell commands.
14
14
 
15
- For inline execution, `/review auto` and `/review address` activate the reviewer profile on Sol; lifecycle verbs activate the orchestrator profile on Luna. The reviewer coordinates `address`, classifies every thread, and delegates bounded implementation to lightweight worker agents. With `--bg`, the command leaves the current chat mode unchanged and launches one named background orchestrator through the pi-subagents cross-extension RPC. Do not add an extra model turn or use recursive Pi or `/bg --agent` for this dispatch. For further delegation, use `Agent`, `get_subagent_result`, and `steer_subagent`; use `SubagentWorkflow` for deterministic multi-stage orchestration. Reserve pi-background-tasks for ordinary long-running shell commands, tests, builds, and servers.
16
-
17
- Workflow index: `auto` generates findings and leaves remote comments pending; `new` creates a local review or remote draft PR/MR; `edit` opens an existing local or remote review for the user; `address` fixes local or remote comments, commits remote fixes through `/git`, and records or posts replies; `publish` promotes pending review work; `complete` approves, rejects, abandons, or archives a review without merging; `merge` is the separate GitHub-only merge action; `help` prints the reference.
15
+ References: [auto](references/workflows/auto.md), [new](references/workflows/new.md), [open](references/workflows/open.md), [status](references/workflows/status.md), [edit](references/workflows/edit.md), [address](references/workflows/address.md), [publish](references/workflows/publish.md), [complete](references/workflows/complete.md), [merge](references/workflows/merge.md), [help](references/workflows/help.md). Keep publication separate from completion and merge; `review_merge` remains GitHub-only.
@@ -2,6 +2,13 @@
2
2
 
3
3
  Use these rules for review and address workflows.
4
4
 
5
+ ## Operational workflow rules
6
+
7
+ - Each workflow parses its own arguments. Do not assume a parent `/review` command stripped `--bg` or selected a backend.
8
+ - Call `review_context` first, with `local: true` for `--local` and `local: false` for forge-backed work. Pass the same target and backend to every later lifecycle tool.
9
+ - Skill-owned aliases (`open`, `create`, `draft`, `launch`, and `close`) follow their named workflow; they do not bypass argument parsing or safety checks.
10
+ - `--bg` runs the complete workflow in a tracked background Orchestrator. Lifecycle ownership and publication/completion/merge safety remain unchanged.
11
+
5
12
  ## Intent
6
13
 
7
14
  Check that the change serves the stated PR intent. Treat a missing required behavior as blocking.
@@ -20,4 +27,4 @@ Prefer existing package APIs and small public surfaces. Add a dependency when it
20
27
 
21
28
  ## Responses
22
29
 
23
- Respond to every addressed thread. State what changed and include verification evidence. Keep every thread open for the user to resolve. Address workflows must never resolve or delete threads.
30
+ Respond to every thread with an explicit outcome and verification evidence. Apply every relevant requested change now; “deferred”, “later”, and “follow-up” are not acceptable unless the user explicitly requested deferral. Mark a thread unresolved only for a concrete external blocker or material user decision, and include attempted fixes and evidence. Keep every thread open for the user to resolve. Address workflows must never resolve or delete threads.
@@ -1,10 +1,10 @@
1
1
  # address
2
2
 
3
- 1. Parse an optional PR/MR id or URL and `--local`. The `/review` command has already removed `--bg`.
4
- 2. Run this workflow as the reviewer coordinator. Call `review_context` with the target and backend selection.
5
- 3. Call `review_comments`. With `--local`, it synchronizes every comment in the selected tuicr session to `.diffpi/review/<session-slug>.md`. Existing replies and statuses remain; source comments removed by the user become resolved ledger entries.
3
+ 1. Parse an optional PR/MR id or URL and `--local`. The skill owns `--bg` dispatch before this reference is followed; a background child executes these steps directly and must not redispatch.
4
+ 2. Run this workflow as the reviewer coordinator. Call `review_context` first with the same target and `local: true` when `--local` is present, otherwise `local: false`.
5
+ 3. Call `review_comments` with the same target and backend. With `--local`, it synchronizes every comment in the selected tuicr session to `.diffpi/review/<session-slug>.md`. Existing replies and statuses remain; source comments removed by the user become resolved ledger entries.
6
6
  4. Classify every thread, group justified code changes into bounded non-overlapping tasks, and delegate those tasks to lightweight worker agents. Keep questions, outcome decisions, integration, and response text in the reviewer coordinator. With `--local`, workers modify the current working tree without committing. Without `--local`, apply a fix only when the comment requests a change.
7
- 5. Respond to every thread with its outcome. Answer questions and leave them open. For substantive requests, state what changed and whether it is resolved, but leave every thread open for the user to resolve. Do not resolve remote threads or delete local source comments in this workflow, including for trivial requests.
7
+ 5. Apply every relevant requested change in this workflow. Do not label a relevant request deferred, later, or follow-up unless the user explicitly requested deferral. Use unresolved only for a concrete external blocker or material user decision, and state the attempted fixes and evidence. Respond to every thread with an explicit outcome and verification evidence. Answer questions and leave them open. For substantive requests, state what changed and whether it is resolved, but leave every thread open for the user to resolve. Do not resolve remote threads or delete local source comments in this workflow, including for trivial requests.
8
8
  6. When a remote address flow changes code, invoke the upstream `/git commit --no-push` workflow after checks pass and before drafting responses. Use `--atomic` when the fixes form separate logical commits.
9
9
  7. Call `review_respond` for each thread with `resolve: false`. With `--local`, every response is posted to tuicr and recorded in the session ledger. Without `--local`, replies post to the forge immediately. The user owns thread resolution.
10
10
  8. With `--local`, call `review_launch_ui` with `local: true` after replies are recorded so the user can inspect the working-tree review in tuicr.
@@ -1,8 +1,8 @@
1
1
  # auto
2
2
 
3
- 1. Parse an optional PR/MR id or URL and `--local`. The `/review` command has already removed `--bg`. `launch` is an alias for this workflow.
4
- 2. Call `review_context` with the same target and backend selection.
5
- 3. Call `review_new` to create the local tuicr review or remote draft PR/MR and open its tuicr UI. A remote branch must be clean and pushed. If the review already exists, use `review_edit` to open it.
3
+ 1. Parse an optional PR/MR id or URL and `--local`. The skill owns `--bg` dispatch before this reference is followed; a background child executes the remaining steps directly and must not redispatch. `launch` aliases this workflow.
4
+ 2. Call `review_context` first with the same target and `local: true` when `--local` is present, otherwise `local: false`.
5
+ 3. Call `review_new` with the same target and backend selection to create the local tuicr review or remote draft PR/MR and open its tuicr UI. A remote branch must be clean and pushed. If the review already exists, use `review_edit` with the same backend instead.
6
6
  4. Before reviewing, run `review_gates` so the project's discovered format-check and lint tasks run first, followed by its other gates. Preserve and report failures; do not substitute visual inspection for failed or skipped checks.
7
7
  5. Run review judgment as the reviewer agent. Inline, the reviewer performs the workflow tool calls directly. In background execution, the orchestrator delegates judgment to the reviewer and retains lifecycle calls. The reviewer fetches the diff with `review_diff` and may launch parallel lightweight subagents for independent areas when useful.
8
8
  6. Review the change for:
@@ -14,5 +14,5 @@
14
14
  - documentation accuracy and completeness; and
15
15
  - reviewer coordination, including keeping lifecycle ownership clear and avoiding duplicate or conflicting findings.
16
16
  Use parallel lightweight workers for independent review areas when useful, then reconcile their results before submission.
17
- 7. Produce only grounded findings, then call `review_submit`. Pass `local: true` for local findings; remote findings remain pending for `publish` or `complete`.
17
+ 7. Produce only grounded findings, then call `review_submit` with the same target and backend (`local: true` for `--local`, otherwise `local: false`). Remote findings remain pending for `publish` or `complete`.
18
18
  8. Report the artifact or pending-review state, finding count, gate results, backend, and any launch instruction. Do not complete or merge the review.
@@ -1,7 +1,7 @@
1
1
  # complete
2
2
 
3
- 1. Parse an optional PR/MR id or URL, `--local`, and exactly one remote action: `--approve`, `--reject`, or `--abandon`. `close` is an alias for this workflow. If the action is omitted, ask the user with `header: "Action"`; all question headers must be 16 characters or fewer.
4
- 2. Call `review_context` with the same target and backend selection.
3
+ 1. Parse an optional PR/MR id or URL, `--local`, and exactly one remote action: `--approve`, `--reject`, or `--abandon`. The skill-owned `close` alias follows this workflow. Skill-owned `--bg` dispatch has already occurred; a background child must not redispatch or ask questions. If a remote action is missing in foreground mode, ask the user with `header: "Action"`; all question headers must be 16 characters or fewer. In background mode, stop with a blocker instead of guessing.
4
+ 2. Call `review_context` first with the same target and `local: true` when `--local` is present, otherwise `local: false`.
5
5
  3. With `--local`, call `review_complete` with `local: true`. It archives the reply overlay to `.diffpi/reviews/<session-slug>.md`, then deletes the exact persisted tuicr session. This is destructive and prevents its comments from appearing in future tuicr sessions.
6
6
  4. Without `--local`, map `--approve`, `--reject`, or `--abandon` to the `review_complete` action `approve`, `reject`, or `abandon`. The tool applies the remote lifecycle action but does not merge.
7
7
  5. Report the archive path or remote result. Do not call `review_merge`.
@@ -1,7 +1,7 @@
1
1
  # edit
2
2
 
3
- 1. Parse an optional PR/MR number, URL, or branch target and `--local`.
4
- 2. Call `review_context` with the same target and backend selection.
5
- 3. Call `review_edit`. With `--local`, it opens an existing local tuicr session. Without `--local`, it opens an existing PR/MR in tuicr, including a non-draft PR/MR for continued work on its comments.
3
+ 1. Parse an optional PR/MR number, URL, or branch target and `--local`. Skill-owned background dispatch has already occurred; a background child follows these steps without redispatch.
4
+ 2. Call `review_context` first with the same target and `local: true` when `--local` is present, otherwise `local: false`.
5
+ 3. Call `review_edit` with the same target and backend. With `--local`, it opens an existing local tuicr session. Without `--local`, it opens an existing PR/MR in tuicr, including a non-draft PR/MR for continued work on its comments.
6
6
  4. If no matching local session or remote PR/MR exists, report the error and direct the user to `new`. Do not create a review, generate findings, publish, complete, or merge.
7
7
  5. Report whether tuicr opened in a mux, prepared a Zed task, or returned a command.
@@ -11,7 +11,13 @@ Create a review and generate findings:
11
11
  Create a local review or remote draft PR/MR:
12
12
  /review new [title] [--intent text] [--base branch] [--local] [--bg]
13
13
 
14
- Open an existing review without generating findings:
14
+ Open an existing remote PR/MR in the system browser (never creates one):
15
+ /review open [pr-number|pr-url|branch] [--local]
16
+
17
+ Show review and worktree lifecycle status:
18
+ /review status [pr-number|pr-url|branch] [--local]
19
+
20
+ Open an existing review in tuicr without generating findings:
15
21
  /review edit [pr-number|pr-url|branch] [--local] [--bg]
16
22
 
17
23
  Address review comments:
@@ -27,4 +33,4 @@ Merge an approved remote review:
27
33
  /review merge [pr-number|pr-url|branch] [--bg]
28
34
  ```
29
35
 
30
- `--local` selects the working-tree tuicr backend. Otherwise, a target is a PR/MR number, URL, or branch; no target means the current branch. `--bg` launches a tracked background Orchestrator and leaves the current chat mode unchanged. `new` creates a review. `edit` only opens an existing local session or remote PR/MR. `auto` creates a review, then delegates findings to the reviewer agent. `open`, `create`, and `draft` alias `new`; `launch` aliases `auto`; `close` aliases `complete`. `publish` publishes remote draft PR/MR review comments and status or promotes local comments. `complete` makes a lifecycle decision without merging, or archives the local overlay and deletes its tuicr session.
36
+ `--local` selects the working-tree tuicr backend. Otherwise, a target is a PR/MR number, URL, or branch; no target means the current branch. `--bg` launches a tracked background Orchestrator and leaves the current chat mode unchanged. `new` creates a review. `open` opens an existing remote URL in the system browser, or directs to `new`; with `--local` it creates/opens the local working-tree review. `status` reports local and remote state without requiring a forge or tuicr binary. `edit` only opens an existing local session or remote PR/MR in tuicr. `auto` creates a review, then delegates findings to the reviewer agent. `create` and `draft` alias `new`; `launch` aliases `auto`; `close` aliases `complete`. `publish` publishes remote draft PR/MR review comments and status or promotes local comments. `complete` makes a lifecycle decision without merging, or archives the local overlay and deletes its tuicr session.
@@ -1,6 +1,6 @@
1
1
  # merge
2
2
 
3
- 1. Call `review_context` and confirm the GitHub PR is open, non-draft, clean, and its checks are settled. Do not require an approval from the current user; authors cannot approve their own PRs. GitHub branch protection remains authoritative.
3
+ 1. Parse an optional PR number, URL, or branch. This workflow is remote-only; reject `--local`. The skill has already handled `--bg`; a background child must not redispatch. Call `review_context` first with the target and `local: false`. Do not query the forge through MCP or duplicate merge-readiness checks: `review_merge` uses the GitHub CLI to confirm the PR is open, non-draft, clean, and its checks are settled before merging. Do not require approval from the current user; authors cannot approve their own PRs. GitHub branch protection remains authoritative.
4
4
  2. If a conventional squash subject is required and the subject is unclear, use `ask_user_question`.
5
- 3. Call `review_merge` with the chosen subject.
5
+ 3. Call `review_merge` with the chosen subject. Treat its CLI-backed readiness result as authoritative.
6
6
  4. Report the merge result.
@@ -3,17 +3,17 @@
3
3
  ## Arguments
4
4
 
5
5
  ```text
6
- /review new [title] [--intent text] [--base branch] [--local]
6
+ /review new [title] [--intent text] [--base branch] [--local] [--bg]
7
7
  ```
8
8
 
9
9
  - `title` is the optional first positional argument; quote a title containing spaces.
10
- - `--intent` and `--base` each consume the following value. `--local` is a boolean flag.
10
+ - `--intent` and `--base` each consume the following value. `--local` is a boolean backend flag; the skill handles `--bg` before this workflow.
11
11
  - Flags may appear in any order. Reject unknown or duplicate flags, missing flag values, and extra positional arguments. Stating this grammar before the procedure is intentional: an explicit argument contract is the best practice for making workflow behavior predictable and preventing ambiguous execution.
12
12
 
13
13
  ## Workflow
14
14
 
15
- 1. Parse the arguments using the grammar above. A remote target is the current branch; `new` creates a new review rather than opening an existing one.
16
- 2. Call `review_context` with the same backend selection.
17
- 3. Call `review_new` with the parsed title, intent, base branch, and backend selection. With `--local`, it creates and opens a local tuicr working-tree review. Without `--local`, it requires a clean, pushed branch, creates a draft PR/MR, and opens that PR/MR in tuicr.
15
+ 1. Parse the arguments using the grammar above after skill-owned background dispatch. A background child follows these steps directly and must not redispatch. A remote target is the current branch; `new` creates a new review rather than opening an existing one.
16
+ 2. Call `review_context` first with `local: true` when `--local` is present, otherwise `local: false`.
17
+ 3. Call `review_new` with the parsed title, intent, base branch, and the same explicit backend selection (`local: true` for `--local`, otherwise `local: false`). With `--local`, it creates and opens a local tuicr working-tree review. Without `--local`, it requires a clean, pushed branch, creates a draft PR/MR, and opens that PR/MR in tuicr.
18
18
  4. If a local session or remote PR/MR already exists, direct the user to `edit` instead.
19
19
  5. Report the PR/MR URL and whether tuicr opened in a mux, prepared a Zed task, or returned a command. Do not generate findings, publish, complete, or merge.
@@ -1,3 +1,3 @@
1
1
  # open
2
2
 
3
- `open` is an alias for `new`. Follow `new.md`.
3
+ Call `review_context` first. Without `--local`, call `review_open` to resolve an existing PR/MR and open its URL in the system browser. It must never create a PR/MR; if none exists, direct the user to `/review new`. If browser launch fails, show the plain URL. With `--local`, call `review_new` with `local=true` to preserve local working-tree behavior.
@@ -1,7 +1,7 @@
1
1
  # publish
2
2
 
3
- 1. Parse an optional PR/MR id or URL, `--local`, and one status: `--comment`, `--approve`, `--request-changes`, or `--close`. The default is comment.
4
- 2. Call `review_context` with the target and `local: true` so the exact tuicr PR session can be inspected. If that session exists and has drafts, publish through the local promotion path even when the user omitted `--local`. Use `local: false` only when no matching tuicr session exists or when the target has forge-native pending review work.
3
+ 1. Parse an optional PR/MR id or URL, `--local`, and one status: `--comment`, `--approve`, `--request-changes`, or `--close`. The default is comment. The skill has already handled `--bg`; a background child follows these steps without redispatch.
4
+ 2. Call `review_context` first with the target and `local: true` so the exact tuicr PR session can be inspected. If no matching local session exists, continue with `local: false` only for forge-native pending review work. If that session exists and has drafts, publish through the local promotion path even when the user omitted `--local`. Use `local: false` only when no matching tuicr session exists or when the target has forge-native pending review work.
5
5
  3. The local promotion path reads the exact tuicr session. A local line comment on the same file and line as an existing remote thread is treated as a response, not a new comment. A leading `[REOPEN]`, `[RESOLVE]`, or `[DELETE]` changes the thread state; the marker is removed from the response body. `[DELETE]` deletes the matched remote thread when the forge supports it. Other unpublished line comments become new review comments. The tool follows the stored local overlay path, posts unpublished replies to their remote threads, and then publishes the selected status. Question replies remain open. The tool does not post an overall review comment.
6
6
  4. For a forge-native review without a matching tuicr session, call `review_publish` without `local`. Existing pending forge comments already contain provenance, so the tool only publishes them with the selected status and no overall comment.
7
7
  5. Comment, approve, and request-changes mark a draft PR/MR ready before publication. Close publishes pending work as comment status and then closes the PR/MR. GitLab rejects request-changes because it has no equivalent review state.
@@ -0,0 +1,3 @@
1
+ # status
2
+
3
+ Call `review_context` first, then `review_status` with the same target and local setting. Report branch, worktree counts, local and remote review state, URLs, and remote tuicr state. Status must remain useful when no forge or tuicr binary is installed.
@@ -1,4 +1,4 @@
1
- <!-- diffpi-plan: {"schemaVersion":1,"id":"{{id}}","revision":0,"branch":"{{branch}}","status":"draft","createdAt":"{{created_at}}","updatedAt":"{{updated_at}}"} -->
1
+ <!-- diffpi-plan: {"schemaVersion":1,"id":"{{id}}","revision":0,"branch":"{{branch}}","issueId":"{{issue_id}}","issueUrl":"{{issue_url}}","status":"draft","createdAt":"{{created_at}}","updatedAt":"{{updated_at}}"} -->
2
2
 
3
3
  # {{title}}
4
4
 
@@ -33,7 +33,7 @@
33
33
 
34
34
  ## Implementation
35
35
 
36
- <!-- Add phases with plan_add_phase. -->
36
+ <!-- Add phases with one complete plan_apply_revision request. -->
37
37
 
38
38
  ## References
39
39
 
@@ -1,24 +1,30 @@
1
- # Phase {{phase_id}}: {{phase_title}}
1
+ <!-- diffpi-implementation: {"schemaVersion":1,"planRevision":{{plan_revision}},"ordinal":{{phase_ordinal}},"phaseId":"{{phase_id}}"} -->
2
+
3
+ # Phase {{phase_ordinal}}: {{phase_title}}
4
+
5
+ - **Phase ID:** {{phase_id}}
6
+ - **Plan Revision:** {{plan_revision}}
2
7
 
3
8
  ## Summary
4
9
 
5
- <!-- State the change delivered by this phase in one short paragraph or up to three bullets. -->
10
+ {{phase_summary}}
11
+
12
+ ## Objective
6
13
 
7
- ## Scope
14
+ {{phase_objective}}
8
15
 
9
- **Objective:** {{phase_objective}}
16
+ ## Tasks
10
17
 
11
- **Tasks:**
12
18
  {{phase_tasks}}
13
19
 
14
- ## Files Changed
20
+ ## API Changes
15
21
 
16
- <!-- Show the directory tree. Annotate files added, removed, and updated. -->
22
+ {{phase_api}}
17
23
 
18
- ## API Changes
24
+ ## Libraries and Algorithms
19
25
 
20
- <!-- Document each public app, library, module, class, or function. Include behavior, data contracts, and imperative or declarative APIs. -->
26
+ {{phase_libraries}}
21
27
 
22
28
  ## Implementation Constraints
23
29
 
24
- <!-- State required libraries, algorithms, patterns, restrictions, and important implementation details. -->
30
+ {{phase_constraints}}
@@ -1,22 +0,0 @@
1
- import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';
2
- import { type Runner } from './extensions/cmdtsx';
3
- import type { ModeController } from './modes';
4
- import { type PlanWorkflowArguments, type PlanWorkflowName } from './workflow';
5
- export type WorkflowAgent = 'planner' | 'orchestrator' | 'reviewer' | 'worker';
6
- export type WorkflowRuntime = {
7
- pi: ExtensionAPI;
8
- ctx: ExtensionContext;
9
- modes: ModeController;
10
- };
11
- export type WorkflowInvocation = {
12
- [Name in PlanWorkflowName]: {
13
- workflow: Name;
14
- arguments: PlanWorkflowArguments[Name];
15
- agent?: WorkflowAgent;
16
- isBackground?: boolean;
17
- };
18
- }[PlanWorkflowName];
19
- export declare function tokenizeCommandArgs(raw: string): string[];
20
- export declare function generateCommandHelp<Args, Result>(command: Runner<Args, Result>): Promise<string>;
21
- export declare function createWorkflowInvoker(runtime: WorkflowRuntime): (invocation: WorkflowInvocation) => Promise<void>;
22
- //# sourceMappingURL=commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAoB,KAAK,qBAAqB,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAIjG,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,YAAY,CAAC;IACjB,GAAG,EAAE,gBAAgB,CAAC;IACtB,KAAK,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;KAC9B,IAAI,IAAI,gBAAgB,GAAG;QAC1B,QAAQ,EAAE,IAAI,CAAC;QACf,SAAS,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACvC,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB;CACF,CAAC,gBAAgB,CAAC,CAAC;AAIpB,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAwBzD;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAItG;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,eAAe,IACvB,YAAY,kBAAkB,KAAG,OAAO,CAAC,IAAI,CAAC,CAwBpF"}
@@ -1,2 +0,0 @@
1
- export { command, dryRun, flag, oneOf, option, optional, positional, restPositionals, string, subcommands, type Runner, } from 'cmd-ts/dist/esm/index.js';
2
- //# sourceMappingURL=cmdtsx.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cmdtsx.d.ts","sourceRoot":"","sources":["../../src/extensions/cmdtsx.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,MAAM,EACN,IAAI,EACJ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,eAAe,EACf,MAAM,EACN,WAAW,EACX,KAAK,MAAM,GACZ,MAAM,0BAA0B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plan-schema.d.ts","sourceRoot":"","sources":["../../src/tools/plan-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,mBAAmB;;;;;;;kBASd,CAAC;AAEZ,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;kBAQf,CAAC;AAYZ,eAAO,MAAM,2BAA2B;;;;;;;;;;;kBAO7B,CAAC;AAEZ,eAAO,MAAM,wBAAwB;;;;;;;;;kBAW1B,CAAC;AAEZ,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;kBAa3C,CAAC;AAEL,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;kBAQ9B,CAAC;AAEZ,eAAO,MAAM,+BAA+B;;;;;;kBAQjC,CAAC;AAEZ,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;kBAejC,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;;kBAE9B,CAAC;AAEZ,eAAO,MAAM,+BAA+B;;;;;;;;;;kBAYjC,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;;;;;kBAS9B,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;kBAY9B,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;kBAAkE,CAAC;AAE1G,eAAO,MAAM,kCAAkC;;;;;;;;;kBAOpC,CAAC;AAEZ,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+BlC,CAAC;AAEZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,33 +0,0 @@
1
- export type PlanWorkflowName = 'init' | 'new' | 'update' | 'annotate' | 'finalize' | 'go' | 'help';
2
- export type PlanWorkflowArguments = {
3
- init: {
4
- plan: string;
5
- branch?: string;
6
- };
7
- new: {
8
- plan: string;
9
- branch?: string;
10
- background: boolean;
11
- prompt?: string;
12
- };
13
- update: {
14
- plan?: string;
15
- branch?: string;
16
- background: boolean;
17
- instructions?: string;
18
- };
19
- annotate: {
20
- plan?: string;
21
- };
22
- finalize: {
23
- plan?: string;
24
- };
25
- go: {
26
- plan: string;
27
- commitMode: 'no-commit' | 'commit' | 'push';
28
- background: boolean;
29
- };
30
- help: Record<string, never>;
31
- };
32
- export declare function loadPlanWorkflow<Name extends PlanWorkflowName>(name: Name, args: PlanWorkflowArguments[Name]): Promise<string>;
33
- //# sourceMappingURL=workflow.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC;AAEnG,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7E,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvF,QAAQ,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B,QAAQ,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC;IACvF,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAC7B,CAAC;AAIF,wBAAsB,gBAAgB,CAAC,IAAI,SAAS,gBAAgB,EAClE,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC,GAChC,OAAO,CAAC,MAAM,CAAC,CAMjB"}
@@ -1,13 +0,0 @@
1
- # annotate
2
-
3
- ## Arguments
4
-
5
- - **Invocation:** `/plan annotate [short-slug]`
6
- - `[short-slug]` (optional): Plan to annotate. Omit it only when context resolves exactly one plan.
7
-
8
- ## Instructions
9
-
10
- 1. Call `plan_context` and infer planId from the provided short slug/conversation context. Fall back to looking at available active plan candidates, and ask user which to annotate listing available options.
11
- 2. Call `plan_annotate`; it uses `tuicr --file .diffpi/plan/{planId}`, never `-p` or `--path`.
12
- 3. Report the selected plan, launch result, and copyable fallback command. Closing tuicr saves one immutable plan review for the current plan revision.
13
- 4. Tell the user to run `/plan update <plan-id>` after closing tuicr.