@difflab/pi 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +5 -5
  2. package/agents/diffpi-copilot.md +6 -3
  3. package/agents/diffpi-reviewer.md +3 -3
  4. package/dist/commands/review.d.ts +0 -1
  5. package/dist/commands/review.d.ts.map +1 -1
  6. package/dist/extensions/index.js +344 -810
  7. package/dist/extensions/tuicrx.d.ts +1 -8
  8. package/dist/extensions/tuicrx.d.ts.map +1 -1
  9. package/dist/index.d.ts +7 -8
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +197 -458
  12. package/dist/review/github-review-backend.d.ts.map +1 -1
  13. package/dist/review/gitlab-review-backend.d.ts.map +1 -1
  14. package/dist/review/index.d.ts +6 -6
  15. package/dist/review/index.d.ts.map +1 -1
  16. package/dist/review/local-reviews.d.ts +31 -0
  17. package/dist/review/local-reviews.d.ts.map +1 -0
  18. package/dist/review/review-backend.d.ts +2 -3
  19. package/dist/review/review-backend.d.ts.map +1 -1
  20. package/dist/review/review-markdown.d.ts +1 -4
  21. package/dist/review/review-markdown.d.ts.map +1 -1
  22. package/dist/review/types.d.ts +0 -28
  23. package/dist/review/types.d.ts.map +1 -1
  24. package/dist/store.d.ts +0 -2
  25. package/dist/store.d.ts.map +1 -1
  26. package/dist/tools/index.js +185 -783
  27. package/dist/tools/review.d.ts +0 -30
  28. package/dist/tools/review.d.ts.map +1 -1
  29. package/dist/workflow.d.ts +47 -0
  30. package/dist/workflow.d.ts.map +1 -1
  31. package/package.json +1 -1
  32. package/skills/review/SKILL.md +6 -8
  33. package/workflows/review/address.md +8 -0
  34. package/workflows/review/auto.md +8 -0
  35. package/workflows/review/complete.md +7 -0
  36. package/workflows/review/edit.md +7 -0
  37. package/workflows/review/help.md +14 -0
  38. package/workflows/review/merge.md +6 -0
  39. package/workflows/review/new.md +7 -0
  40. package/workflows/review/publish.md +6 -0
  41. package/dist/review/local-review-backend.d.ts +0 -3
  42. package/dist/review/local-review-backend.d.ts.map +0 -1
  43. package/dist/review/review-state.d.ts +0 -20
  44. package/dist/review/review-state.d.ts.map +0 -1
  45. package/skills/review/references/workflows/address.md +0 -11
  46. package/skills/review/references/workflows/auto.md +0 -18
  47. package/skills/review/references/workflows/complete.md +0 -7
  48. package/skills/review/references/workflows/edit.md +0 -7
  49. package/skills/review/references/workflows/help.md +0 -30
  50. package/skills/review/references/workflows/merge.md +0 -6
  51. package/skills/review/references/workflows/new.md +0 -19
  52. package/skills/review/references/workflows/open.md +0 -3
  53. package/skills/review/references/workflows/publish.md +0 -8
@@ -1,34 +1,4 @@
1
1
  import { type ToolDefinition } from '@earendil-works/pi-coding-agent';
2
- import { type ReviewComment, type ReviewThreadRecord } from '../review';
3
- export declare function hasReviewDraft(comments: readonly ReviewComment[], body: string): boolean;
4
- export declare function partitionReviewComments(comments: readonly ReviewComment[], knownFingerprints: ReadonlySet<string>, model: string): {
5
- checkpointed: {
6
- source: ReviewComment;
7
- published: {
8
- body: string;
9
- file: string;
10
- line?: number;
11
- side?: import("..").ReviewSide;
12
- author?: string;
13
- sourceCommentId?: string;
14
- };
15
- fingerprint: string;
16
- }[];
17
- candidates: {
18
- source: ReviewComment;
19
- published: {
20
- body: string;
21
- file: string;
22
- line?: number;
23
- side?: import("..").ReviewSide;
24
- author?: string;
25
- sourceCommentId?: string;
26
- };
27
- fingerprint: string;
28
- }[];
29
- };
30
- export declare function resolveReviewThread(comment: ReviewComment, threads: readonly ReviewThreadRecord[]): ReviewThreadRecord | undefined;
31
2
  export declare function workingTreeDiff(cwd: string): Promise<string>;
32
3
  export declare function createReviewTools(): readonly ToolDefinition[];
33
- export declare function syncLocalThreadArtifact(path: string, title: string, sessionSlug: string, threads: readonly ReviewThreadRecord[]): Promise<ReviewThreadRecord[]>;
34
4
  //# sourceMappingURL=review.d.ts.map
@@ -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;AA2EzG,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAalE;AAID,wBAAgB,iBAAiB,IAAI,SAAS,cAAc,EAAE,CAma7D"}
@@ -1,4 +1,5 @@
1
1
  export type PlanWorkflowName = 'init' | 'new' | 'update' | 'annotate' | 'finalize' | 'go' | 'help';
2
+ export type ReviewWorkflowName = 'auto' | 'new' | 'edit' | 'address' | 'publish' | 'complete' | 'merge' | 'help';
2
3
  export type PlanWorkflowArguments = {
3
4
  init: {
4
5
  plan: string;
@@ -29,5 +30,51 @@ export type PlanWorkflowArguments = {
29
30
  };
30
31
  help: Record<string, never>;
31
32
  };
33
+ export type ReviewWorkflowArguments = {
34
+ auto: {
35
+ target?: string;
36
+ local: boolean;
37
+ background: boolean;
38
+ };
39
+ new: {
40
+ title?: string;
41
+ intent?: string;
42
+ base?: string;
43
+ local: boolean;
44
+ background: boolean;
45
+ };
46
+ edit: {
47
+ target?: string;
48
+ local: boolean;
49
+ background: boolean;
50
+ };
51
+ address: {
52
+ target?: string;
53
+ local: boolean;
54
+ background: boolean;
55
+ };
56
+ publish: {
57
+ target?: string;
58
+ comment: boolean;
59
+ approve: boolean;
60
+ requestChanges: boolean;
61
+ close: boolean;
62
+ background: boolean;
63
+ };
64
+ complete: {
65
+ target?: string;
66
+ local: boolean;
67
+ approve: boolean;
68
+ reject: boolean;
69
+ abandon: boolean;
70
+ background: boolean;
71
+ };
72
+ merge: {
73
+ target?: string;
74
+ background: boolean;
75
+ };
76
+ help: Record<string, never>;
77
+ };
32
78
  export declare function loadPlanWorkflow<Name extends PlanWorkflowName>(name: Name, args: PlanWorkflowArguments[Name]): Promise<string>;
79
+ export declare function loadReviewWorkflow<Name extends ReviewWorkflowName>(name: Name, args: ReviewWorkflowArguments[Name]): Promise<string>;
33
80
  //# sourceMappingURL=workflow.d.ts.map
@@ -1 +1 @@
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,MAA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AO,CAAA;KAAE,CAAC;IAC/D,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC;IAClE,OAAO,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,cAAc,EAAE,OAAO,CAAC;QACxB,KAAK,EAAE,OAAO,CAAC;QACf,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,OAAO,CAAC;QACf,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,OAAO,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,KAAK,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAC7B,CAAC;AAIF,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,gBAAgB,EAC5D,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC,GAChC,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,SAAS,kBAAkB,EAChE,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC,GAClC,OAAO,CAAC,MAAM,CAAC,CAEjB"}
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",
4
4
  "description": "Tools and skills for the pi coding agent",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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: Code review workflows over GitHub, GitLab, or local tuicr revision dumps. 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_dump review_respond review_publish review_complete review_merge review_launch_ui
5
5
  ---
6
6
 
7
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
+ Use the exact package workflow supplied by the `/review` command. Do not look for workflow files inside this skill.
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
+ Call `review_context` first. Treat `--local` as a working-tree tuicr flow. A completed local session becomes one immutable review dump; applying feedback starts a new revision. Local reviews have no thread ledger, replies, resolution state, or remote promotion.
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
+ Without `--local`, use the detected GitHub or GitLab target directly. Stage findings, read forge threads, post replies, publish status, and perform lifecycle actions through the remote review tools.
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
+ Use `ask_user_question` only for decisions that cannot be derived. Inline `auto` and `address` run under Reviewer; lifecycle workflows run under Orchestrator. Background execution is already routed by the command and must not change the foreground mode.
@@ -0,0 +1,8 @@
1
+ # address
2
+
3
+ 1. Read `Arguments.target` and `Arguments.local`.
4
+ 2. Call `review_context`.
5
+ 3. In local mode, call `review_dump`. This saves one immutable review revision and removes the completed tuicr session. Apply its feedback to the working tree, run relevant checks, then call `review_launch_ui` with `local: true` to begin the next revision. Local reviews have no replies or resolution state.
6
+ 4. In remote mode, call `review_comments`. Classify every thread and apply only justified changes. Run relevant checks and commit fixes through `/git commit --no-push` when code changes.
7
+ 5. For remote threads, call `review_respond` with a concise outcome. Leave the thread open unless the user explicitly requested resolution.
8
+ 6. Report changed, answered, skipped, and remaining items. Do not publish, complete, or merge.
@@ -0,0 +1,8 @@
1
+ # auto
2
+
3
+ 1. Read `Arguments.target` and `Arguments.local`.
4
+ 2. Call `review_context` with the selected target and backend.
5
+ 3. Create or open the review with `review_new` or `review_edit`.
6
+ 4. Run `review_gates`, then call `review_diff` and review only that change.
7
+ 5. Produce grounded findings and call `review_submit`. Local findings stay in tuicr. Remote findings stay pending until `/review publish`.
8
+ 6. Report the backend, findings, gate results, artifact, and launch instruction. Do not publish, complete, or merge.
@@ -0,0 +1,7 @@
1
+ # complete
2
+
3
+ 1. Read the typed target, local mode, and lifecycle action from `Arguments`.
4
+ 2. Call `review_context`.
5
+ 3. In local mode, call `review_dump` to save the final immutable revision and remove the completed tuicr session.
6
+ 4. In remote mode, ask for a missing action, then call `review_complete` with `approve`, `reject`, or `abandon`.
7
+ 5. Report the dump path or remote result. Do not merge.
@@ -0,0 +1,7 @@
1
+ # edit
2
+
3
+ 1. Read `Arguments.target` and `Arguments.local`.
4
+ 2. Call `review_context`, then `review_edit`.
5
+ 3. Local mode opens the current working-tree review revision. Remote mode opens the existing PR/MR in tuicr.
6
+ 4. If no review exists, direct the user to `/review new`.
7
+ 5. Report the launch result. Do not create findings or change lifecycle state.
@@ -0,0 +1,14 @@
1
+ # help
2
+
3
+ Show these commands:
4
+
5
+ - `/review auto [target] [--local] [--bg]` generates findings.
6
+ - `/review new [title] [--intent text] [--base branch] [--local] [--bg]` starts a review.
7
+ - `/review edit [target] [--local] [--bg]` opens an existing review.
8
+ - `/review address [target] [--local] [--bg]` applies feedback. Local mode dumps one revision and starts the next.
9
+ - `/review publish [target] [--comment|--approve|--request-changes|--close] [--bg]` publishes remote review work.
10
+ - `/review complete [target] [--local|--approve|--reject|--abandon] [--bg]` finishes without merging.
11
+ - `/review merge [target] [--bg]` merges a green remote review.
12
+ - `/review help` shows this reference.
13
+
14
+ `--local` selects the working-tree tuicr flow. Local reviews are immutable revision dumps with no replies, resolution state, or remote promotion. Remote reviews use GitHub or GitLab comments and lifecycle operations directly. `--bg` launches an Orchestrator without changing the foreground mode.
@@ -0,0 +1,6 @@
1
+ # merge
2
+
3
+ 1. Local mode is not accepted; only remote reviews can merge.
4
+ 2. Call `review_context` and confirm the PR is open, non-draft, mergeable, and green.
5
+ 3. Ask for a conventional squash subject only when it cannot be derived.
6
+ 4. Call `review_merge` and report the resulting merge.
@@ -0,0 +1,7 @@
1
+ # new
2
+
3
+ 1. Read `Arguments.title`, `Arguments.intent`, `Arguments.base`, and `Arguments.local`.
4
+ 2. Call `review_context` with the selected backend.
5
+ 3. Call `review_new`. Local mode opens a working-tree review in tuicr. Remote mode creates a draft PR/MR from a clean pushed branch and opens it in tuicr.
6
+ 4. If the target exists, direct the user to `/review edit` instead.
7
+ 5. Report the created target and launch instruction. Do not generate findings or publish it.
@@ -0,0 +1,6 @@
1
+ # publish
2
+
3
+ 1. Read the typed target and status flags from `Arguments`. The default is comment.
4
+ 2. Local mode is not accepted; local reviews use immutable revision dumps and have no publish step.
5
+ 3. Call `review_context`, then `review_publish` with the selected status.
6
+ 4. Report the public review status and final PR/MR state. Publishing never merges.
@@ -1,3 +0,0 @@
1
- import type { LocalReviewBackendOptions, ReviewBackend } from './types';
2
- export declare function LocalReviewBackend(options: LocalReviewBackendOptions): ReviewBackend;
3
- //# sourceMappingURL=local-review-backend.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"local-review-backend.d.ts","sourceRoot":"","sources":["../../src/review/local-review-backend.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,aAAa,CAqCpF"}
@@ -1,20 +0,0 @@
1
- import type { VcsInfo } from '../environment';
2
- import type { ReviewComment } from './types';
3
- export interface ReviewPublicationState {
4
- target: string;
5
- bodies: string[];
6
- comments: string[];
7
- stagedComments: string[];
8
- replies: string[];
9
- overlayPath?: string;
10
- }
11
- export declare function reviewBodyFingerprint(body: string): string;
12
- export declare function reviewCommentFingerprint(comment: ReviewComment): string;
13
- export declare function reviewReplyFingerprint(threadId: string, body: string): string;
14
- export declare function unpublishedReviewComments(comments: readonly ReviewComment[], knownFingerprints: ReadonlySet<string>): ReviewComment[];
15
- export declare function loadReviewPublicationState(cwd: string, vcs: VcsInfo, number: number, homeDir?: string): Promise<{
16
- path: string;
17
- state: ReviewPublicationState;
18
- }>;
19
- export declare function saveReviewPublicationState(path: string, state: ReviewPublicationState): Promise<void>;
20
- //# sourceMappingURL=review-state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"review-state.d.ts","sourceRoot":"","sources":["../../src/review/review-state.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAY7C,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAEvE;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GACrC,aAAa,EAAE,CAEjB;AAED,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,sBAAsB,CAAA;CAAE,CAAC,CAe1D;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAI3G"}
@@ -1,11 +0,0 @@
1
- # address
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.
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.
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
- 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
- 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.
11
- 9. Report fixed, committed, answered, addressed, unresolved, and skipped counts. Resolved must always be zero in this workflow. Do not publish, complete, or merge.
@@ -1,18 +0,0 @@
1
- # auto
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.
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
- 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
- 6. Review the change for:
9
- - whether it accomplishes the stated intent;
10
- - whether the technical approach is the best practical way to accomplish that intent;
11
- - correctness, including failure paths and edge cases;
12
- - code quality, readability, and maintainability;
13
- - minimality and conciseness, including unnecessary agent-generated changes;
14
- - documentation accuracy and completeness; and
15
- - reviewer coordination, including keeping lifecycle ownership clear and avoiding duplicate or conflicting findings.
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`.
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 +0,0 @@
1
- # complete
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.
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
- 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
- 5. Report the archive path or remote result. Do not call `review_merge`.
@@ -1,7 +0,0 @@
1
- # edit
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.
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
- 5. Report whether tuicr opened in a mux, prepared a Zed task, or returned a command.
@@ -1,30 +0,0 @@
1
- # help
2
-
3
- Print the following help text:
4
-
5
- ```text
6
- Workflows for PRs and local review. Use:
7
-
8
- Create a review and generate findings:
9
- /review auto [pr-or-branch] [--local] [--bg]
10
-
11
- Create a local review or remote draft PR/MR:
12
- /review new [title] [--intent text] [--base branch] [--local] [--bg]
13
-
14
- Open an existing review without generating findings:
15
- /review edit [pr-number|pr-url|branch] [--local] [--bg]
16
-
17
- Address review comments:
18
- /review address [pr-number|pr-url|branch] [--local] [--bg]
19
-
20
- Publish comments and a review status:
21
- /review publish [pr-number|pr-url|branch] [--local] [--comment|--approve|--request-changes|--close] [--bg]
22
-
23
- Complete a review without merging:
24
- /review complete [pr-number|pr-url|branch] [--local|--approve|--reject|--abandon] [--bg]
25
-
26
- Merge an approved remote review:
27
- /review merge [pr-number|pr-url|branch] [--bg]
28
- ```
29
-
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.
@@ -1,6 +0,0 @@
1
- # merge
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.
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.
6
- 4. Report the merge result.
@@ -1,19 +0,0 @@
1
- # new
2
-
3
- ## Arguments
4
-
5
- ```text
6
- /review new [title] [--intent text] [--base branch] [--local]
7
- ```
8
-
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.
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
-
13
- ## Workflow
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.
18
- 4. If a local session or remote PR/MR already exists, direct the user to `edit` instead.
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 +0,0 @@
1
- # open
2
-
3
- `open` is an alias for `new`. Follow `new.md`.
@@ -1,8 +0,0 @@
1
- # publish
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.
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
- 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
- 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.
8
- 6. Report promoted comment and reply counts, the public status, and the final PR/MR state. Publishing never merges. If a response cannot be matched by file and line, report it as a new comment rather than silently attaching it to the wrong thread.