@difflab/pi 0.7.0 → 0.7.1
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 +7 -7
- package/agents/diffpi-orchestrator.md +8 -4
- package/agents/diffpi-plan-reviewer.md +33 -0
- package/agents/diffpi-planner.md +11 -8
- package/agents/diffpi-reviewer.md +5 -2
- package/agents/diffpi-worker.md +5 -8
- package/dist/cli/plan.d.ts +5 -4
- package/dist/cli/plan.d.ts.map +1 -1
- package/dist/cli.js +21 -6090
- package/dist/extensions/index.js +549 -7225
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +344 -5985
- package/dist/modes.d.ts +15 -0
- package/dist/modes.d.ts.map +1 -1
- package/dist/plan/verify.d.ts +15 -0
- package/dist/plan/verify.d.ts.map +1 -0
- package/dist/setup.d.ts.map +1 -1
- package/dist/tools/ci.d.ts +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +454 -7224
- package/dist/tools/modes.d.ts.map +1 -1
- package/dist/tools/plan.d.ts +3 -5
- package/dist/tools/plan.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/mode/SKILL.md +3 -3
- package/skills/plan/SKILL.md +21 -7
- package/skills/plan/references/design-quality.md +17 -29
- package/skills/plan/references/workflows/annotate.md +3 -7
- package/skills/plan/references/workflows/finalize.md +9 -6
- package/skills/plan/references/workflows/go.md +10 -7
- package/skills/plan/references/workflows/help.md +3 -6
- package/skills/plan/references/workflows/init.md +9 -4
- package/skills/plan/references/workflows/new.md +10 -6
- package/skills/plan/references/workflows/update.md +9 -6
- package/skills/review/SKILL.md +6 -6
- package/skills/review/references/workflows/address.md +8 -9
- package/skills/review/references/workflows/auto.md +7 -16
- package/skills/review/references/workflows/complete.md +5 -5
- package/skills/review/references/workflows/edit.md +3 -5
- package/skills/review/references/workflows/help.md +10 -31
- package/skills/review/references/workflows/merge.md +3 -4
- package/skills/review/references/workflows/new.md +5 -15
- package/skills/review/references/workflows/open.md +3 -1
- package/skills/review/references/workflows/publish.md +5 -6
- package/skills/review/references/workflows/status.md +3 -1
- package/templates/plan/PLAN.md +18 -11
- package/templates/plan/implementation.md +25 -14
- package/dist/plan/index.d.ts +0 -4
- package/dist/plan/index.d.ts.map +0 -1
- package/dist/plan/markdown.d.ts +0 -9
- package/dist/plan/markdown.d.ts.map +0 -1
- package/dist/plan/operations.d.ts +0 -43
- package/dist/plan/operations.d.ts.map +0 -1
- package/dist/plan/reviews.d.ts +0 -28
- package/dist/plan/reviews.d.ts.map +0 -1
- package/dist/plan/schema.d.ts +0 -249
- package/dist/plan/schema.d.ts.map +0 -1
- package/dist/plan/store.d.ts +0 -75
- package/dist/plan/store.d.ts.map +0 -1
- package/dist/plan/types.d.ts +0 -151
- package/dist/plan/types.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../src/tools/modes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGlF,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,UAAU,CAAC;AAiB5D,wBAAgB,eAAe,CAAC,UAAU,EAAE,cAAc,GAAG,SAAS,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../src/tools/modes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGlF,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,UAAU,CAAC;AAiB5D,wBAAgB,eAAe,CAAC,UAAU,EAAE,cAAc,GAAG,SAAS,cAAc,EAAE,CAiFrF"}
|
package/dist/tools/plan.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type PlanToolRuntime = Pick<ExtensionAPI, 'events' | 'sendUserMessage'> & Partial<Pick<ExtensionAPI, 'sendMessage'>>;
|
|
5
|
-
export declare function createPlanTools(_pi: PlanToolRuntime, _modes: ModeController, store?: PlanStore): readonly ToolDefinition[];
|
|
1
|
+
import { type ToolDefinition } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
/** Mechanical checks only; independent human-quality review remains required. */
|
|
3
|
+
export declare const planVerifyTool: ToolDefinition;
|
|
6
4
|
//# sourceMappingURL=plan.d.ts.map
|
package/dist/tools/plan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/tools/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/tools/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAMlF,iFAAiF;AACjF,eAAO,MAAM,cAAc,EAAE,cAoB3B,CAAC"}
|
package/package.json
CHANGED
package/skills/mode/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mode
|
|
3
3
|
description: List, select, or clear an inline agent profile. Use when the user invokes /skill:mode or asks to change the current Diffpi mode.
|
|
4
|
-
allowed-tools: ask_user_question diffpi_modes_list diffpi_modes_set diffpi_modes_unset
|
|
4
|
+
allowed-tools: ask_user_question diffpi_modes_list diffpi_modes_set diffpi_modes_unset diffpi_modes_status
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Mode
|
|
@@ -12,7 +12,7 @@ Pi appends `/skill:mode` arguments as `User: <arguments>`. Route those arguments
|
|
|
12
12
|
|
|
13
13
|
- If the argument is `help`, `-h`, or `--help`, print the usage and examples below. Do not call a tool.
|
|
14
14
|
- If the argument is `clear`, call `diffpi_modes_unset` and stop.
|
|
15
|
-
- If the argument is one agent id, call `diffpi_modes_set` with that exact id and
|
|
15
|
+
- If the argument is one agent id, call `diffpi_modes_set` with that exact id. On the next model turn, call `diffpi_modes_status` to verify the selected model, thinking level, and active tools; if preflight or verification fails, report the exact capability error and do not claim an active mode.
|
|
16
16
|
- A qualified id such as `spec:planner` is one agent id. The tool enables skill-agent discovery for it.
|
|
17
17
|
- If the request contains multiple agent ids or an unsupported flag, print the usage and stop.
|
|
18
18
|
|
|
@@ -33,6 +33,6 @@ Use the picker when there are no arguments or when the only argument is `--inclu
|
|
|
33
33
|
2. Call `ask_user_question` with one single-select question. Do not ask as plain chat text.
|
|
34
34
|
3. Put the complete list of valid ids in the question text. Offer Default plus at most three relevant agents as structured options. The custom-answer row lets the user enter any other valid id.
|
|
35
35
|
4. If the user selects Default or enters `clear`, call `diffpi_modes_unset`.
|
|
36
|
-
5. Otherwise, call `diffpi_modes_set` with the selected or entered id.
|
|
36
|
+
5. Otherwise, call `diffpi_modes_set` with the selected or entered id. On the next model turn, call `diffpi_modes_status` and verify the selected model, thinking level, and active tools. If selection or post-turn verification fails, report the exact capability error and ensure no ghost active mode is claimed.
|
|
37
37
|
|
|
38
38
|
Do not perform unrelated work. Explain that the selected prompt, preferred available model, thinking level, and tool set start on the next turn. Mode selection is not a security boundary.
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan
|
|
3
|
-
description: Create, revise,
|
|
4
|
-
allowed-tools: read grep find
|
|
3
|
+
description: Create, revise, review, finalize, and execute live Diffpi plans with direct files and one verified plan reviewer.
|
|
4
|
+
allowed-tools: read grep find write edit ask_user_question Agent get_subagent_result steer_subagent diffpi_modes_set diffpi_modes_status plan_verify bash ctx_execute ctx_execute_file watch_ci
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Plan
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
`/plan` forwards raw arguments to this skill. Parse the first explicit verb (`init`, `new`, `update`, `annotate`, `finalize`, `go`, `help`); for unknown or empty input, infer a verb from a clear natural-language request. Use `help` only when neither verb nor intent is identifiable; when plan/intent is ambiguous, ask one structured material-decision question. Preserve the exact incoming user request for the Planner. Read the matching reference first. Keep the alias handler thin. Git and project tasks run through `bash` (or the upstream git skill); do not invent tool names for tasks, format, lint, test, CI, or push.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Roles and preflight
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- **Planner** authors and repairs live `PLAN.md` and numbered briefs with frontier/high thinking.
|
|
14
|
+
- **diffpi-plan-reviewer** is exactly one independent frontier/high, read/search-only child. It first calls `diffpi_modes_status` and returns actual model, thinking, and tools evidence, then reviews structure, parity, action labels, quality, risk, and Worker executability. Reject missing or unverifiable evidence; do not use a fallback reviewer.
|
|
15
|
+
- **Orchestrator** owns go coordination, live-file checkboxes/status, project gates, Git, push, and CI. **Worker** edits only its declared source/test scope and never changes plan files or commits.
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
For foreground authoring, call `diffpi_modes_set({agent: "planner"})` using the shared inline id (never `plan:planner`); on the next model turn call `diffpi_modes_status` and stop if the switch or evidence is unavailable. For foreground `go`, call `diffpi_modes_set({agent: "orchestrator"})` and verify its status on the next turn. `--bg` launches exactly one named same-session child with `Agent` (Planner for `init/new/update/finalize`, Orchestrator for `go`), passing the exact verb, target, cwd, mode, and `background: true`; remove `--bg`. The child never redispatches, asks questions, or falls back inline.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
## Live-file contract
|
|
20
|
+
|
|
21
|
+
Plans live under the initiating nested Git root in one flat `.diffpi/plan/<YYMMDD[-ticket]-short-slug>/` directory. The date and slug are parts of ONE directory name, never nested `date/slug` directories. Resolve collisions before writing. Use ordinary `read`/`write`/`edit` calls, read every file back, and preserve intent, IDs, completed evidence, order, dependencies, scopes, and constraints. Document phase constraints in each phase's `PLAN.md` entry (use `None` if empty). Each brief puts its sole action-labeled, fenced `text` file tree under `## Files Affected` immediately after `## Objective` (never a bullet list); `## Implementation Constraints` is free-form with optional subheadings. Edit only live plan files; never managed records, plugin source, tests, or profiles. `INCOMPLETE` is a visible marker inside an open `DRAFT`, not a status enum.
|
|
22
|
+
|
|
23
|
+
`new` and `update` run the stateless read-only `plan_verify` on the current files, then review the complete current draft with one reviewer profile. Repair actionable findings, rerun mechanical verification after each repair, and invoke the same named reviewer again in a fresh `Agent` call (never resume a finished child) within bounded attempts. They remain `DRAFT` after a successful review. Require the child to complete with an attested explicit PASS; partial, steered, stopped, missing, and BLOCKING reports never count. `finalize` and draft `go` write `READY` only after both a passing `plan_verify` on current files and that completed reviewer PASS; do not dispatch Workers or write ready after repairing a failed review without a new completed review. An already-ready plan is reread and mechanically verified too. `plan_verify` does not judge quality, change status, freeze files, or replace the reviewer. No retired managed-plan tools.
|
|
24
|
+
|
|
25
|
+
## Execution
|
|
26
|
+
|
|
27
|
+
`go --mode no-commit|commit|push` defaults to `no-commit`. The Orchestrator is the only writer of plan status/checkboxes and coordinates Workers. A draft gets one mechanical `plan_verify` check and one reviewer per pass; both must pass on current files before ready. Schedule a phase only after all prerequisites complete; derive each bounded Worker's task scope from its steps and the phase's sole Files Affected tree. Serialize tasks with overlapping or uncertain derived scopes; independent tasks may run concurrently only when scopes are unambiguously disjoint and prerequisites are satisfied. Run project format, lint, test, and CI checks via `bash`/`ctx_execute` as appropriate. On any failure, preserve the exact command/output, attempts, and affected role and block.
|
|
28
|
+
|
|
29
|
+
With `commit`, after gates pass make one phase commit. With `push`, push it and call `watch_ci` for that exact SHA; do not push the next phase until settled. `--bg` has one child only and that child does not redispatch. No stateful plan tools.
|
|
30
|
+
|
|
31
|
+
Read: [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).
|
|
@@ -1,41 +1,29 @@
|
|
|
1
1
|
# Plan authoring quality
|
|
2
2
|
|
|
3
|
-
Build
|
|
3
|
+
Build from repository evidence. Keep the result compact and useful to a Worker.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## PLAN.md
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- Keep intent, requirements, design, references, and numbered phases in `PLAN.md`.
|
|
8
|
+
- Give each phase a stable ID, title, objective, prerequisites, and documented phase-wide guardrails (use `None` if there are none). Prerequisites and phase constraints belong in `PLAN.md` only; keep detailed technology, algorithm, and invariant instructions for the brief instead of copying them into both places.
|
|
9
|
+
- Put each discrete implementation action in a flat task checkbox with a stable task ID and title. Do not put dependency metadata, steps, file scopes, or acceptance criteria under the checkbox.
|
|
10
|
+
- Preserve phase/task ID and order parity in every implementation brief.
|
|
8
11
|
|
|
9
|
-
|
|
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
|
+
## Implementation brief
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
- Give tasks ordered implementation steps. Add nested `Verify` bullets under the relevant task; verification is part of the task, not a separate task.
|
|
15
|
+
- Put `## Files Affected` immediately after `## Objective` and before `## Tasks`. It is the sole phase-level file scope: include exactly one fenced `text` file tree with a directory root and branches whose file leaves start with `[ADD]`, `[MODIFY]`, `[REMOVE]`, `[MOVE from: old/path]`, or `[VERIFY]`. Do not replace the tree with Markdown bullets or add per-task file scopes. Include acceptance criteria for every task.
|
|
16
|
+
- Write `## Implementation Constraints` as useful free-form implementation guidance. Add `### Required Libraries & Technology Choices`, `### Key Algorithm Specifications`, or `### Core Invariants` only when useful; do not require any of them. Do not restate or paraphrase the phase-wide guardrails in `PLAN.md` here; refer to the phase ID when a connection is needed.
|
|
17
|
+
- Read back each file after writing it. Normal successive write/edit calls are intentional: incomplete drafts remain visible until the plan is ready.
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
## Review and repair
|
|
16
20
|
|
|
17
|
-
|
|
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
|
-
```
|
|
21
|
+
Template metadata such as managed revisions or snapshots is not part of the live-file contract. Leave historical plan files untouched; current plans use the direct-file format.
|
|
32
22
|
|
|
33
|
-
|
|
23
|
+
After writing the current `PLAN.md` and all numbered briefs, independently invoke exactly one VERIFIED frontier/high-thinking `diffpi-plan-reviewer` in read-only mode. The reviewer checks structure and parity, action labels, whole-plan quality, consistency and risk, and whether every task is executable by a lightweight Worker without guessing, in one pass. Do not replace this with cheap separate reviewers or tiered checks.
|
|
34
24
|
|
|
35
|
-
|
|
25
|
+
The Planner repairs actionable findings and reruns the same reviewer within bounded attempts. A passing review does not prove that source code implements the plan. `annotate` is optional human review; it does not replace the automated reviewer.
|
|
36
26
|
|
|
37
|
-
|
|
27
|
+
## Contracts and consequences
|
|
38
28
|
|
|
39
|
-
|
|
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.
|
|
29
|
+
Describe real API or data-flow changes. If there is no public API change, say so and show the relevant internal contract. Explain before/after invocation, what readers or Workers consume, validation and failure visibility, and at least one concrete trade-off. Do not use scaffold placeholders in a plan marked ready.
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
# `/plan annotate`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Owner/tier:** Human, interactive/read-only coordinator. **Tools:** tuicr `--file` or direct-file review plus read. **Children:** none; no automatic reviewer.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Open the selected live plan in tuicr with `--file`, or conduct a direct-file human review. Keep comments tied to current PLAN.md/brief paths. The human decides whether to apply edits; if edits are requested, return to `/plan update` or `/plan finalize` explicitly.
|
|
6
6
|
|
|
7
|
-
|
|
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.
|
|
7
|
+
**Effects:** only the human review artifact/comments may change. **Failure:** report the exact file or tuicr error and leave plan files unchanged. Do not rewrite, dispatch, mark ready, or run an automated second pass.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `/plan finalize`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
**Owner/tier:** Planner, frontier/high. **Tools:** read/write/edit, `diffpi_modes_set`, `diffpi_modes_status`, `plan_verify`, Agent, get_subagent_result, steer_subagent. **Child:** exactly one independent `diffpi-plan-reviewer`, frontier/high, read/search-only.
|
|
4
|
+
|
|
5
|
+
1. Select the shared inline profile with `diffpi_modes_set({agent: "planner"})` (not `plan:planner`) and verify `diffpi_modes_status` on the next turn; stop on unavailable switch or unverifiable evidence.
|
|
6
|
+
2. Select one live plan. Reread `PLAN.md` and all numbered briefs.
|
|
7
|
+
3. Run read-only `plan_verify` and repair any structural issues. Invoke exactly one reviewer for structure/parity, action labels, quality/risk, consistency, and Worker executability. Verify its attestation before trusting the report.
|
|
8
|
+
4. If findings are actionable, repair the live files, rerun `plan_verify`, and invoke the same named reviewer profile again with a fresh `Agent` call (not `resume`) within bounded attempts. Only after a current mechanical PASS and a completed attested reviewer PASS, write `READY` to `PLAN.md`.
|
|
9
|
+
|
|
10
|
+
**Effects:** only direct plan repairs and the `READY` marker change. Do not execute or freeze files. **Failure:** preserve evidence and remain `DRAFT`; report exact reviewer/preflight/error details. No fallback, redispatch, background questions, or retired plan tools.
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `/plan go`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
**Owner/tier:** Orchestrator, medium. **Tools:** read/write/edit, `diffpi_modes_set`, `diffpi_modes_status`, `plan_verify`, Agent, get_subagent_result, steer_subagent, bash, ctx_execute, ctx_execute_file, watch_ci. **Children:** one same-session Orchestrator for `--bg`; thereafter one bounded low-thinking Worker per eligible task; one frontier/high reviewer only when the plan is draft.
|
|
4
|
+
|
|
5
|
+
1. Parse `--mode no-commit|commit|push`; default is `no-commit`. Select the shared inline profile with `diffpi_modes_set({agent: "orchestrator"})` and verify `diffpi_modes_status` on the next turn. If switching or evidence fails, stop with the exact error. Git/project tasks and gates run through `bash` (or `ctx_execute` for large output); there are no `task`, `format`, `lint`, `test`, `ci`, `git`, or `push` tools.
|
|
6
|
+
2. Select and reread the current live `PLAN.md` and all numbered briefs. Run `plan_verify` on that exact plan directory; if it reports issues, stop in its current state and repair through Planner before trying again. If `DRAFT`, invoke exactly one named `diffpi-plan-reviewer` per pass with `Agent(run_in_background:false)`; do not impose a short turn limit. Independently verify runtime attestation and require a **completed** child result with an explicit PASS and no BLOCKING findings. A `steered`, partial, stopped, missing, or failed result is NOT a pass. On findings, hand repairs to Planner, reread live files, rerun `plan_verify`, then invoke the same named reviewer profile in a fresh `Agent` call (not `resume`) within bounded attempts. Write `READY` and dispatch Workers ONLY after a current mechanical PASS and a completed attested reviewer PASS; otherwise leave `DRAFT` and stop with exact evidence. Do not launch a duplicate background child or recursively dispatch. If already `READY`, reread and verify current files as-is.
|
|
7
|
+
3. The Orchestrator alone writes live plan checkboxes/status. Schedule a phase only after every prerequisite is complete. Derive a bounded Worker scope per task from that phase brief's sole fenced Files Affected tree and the task's steps; never invent separate per-task scope fields. Serialize when task-to-file ownership is uncertain or scopes overlap. Dispatch disjoint Workers concurrently only when prerequisites are complete and ownership is unambiguous. The Worker never edits plan files, commits, redispatches, asks questions, or falls back inline.
|
|
8
|
+
4. Run the declared project format, lint, test, and CI gates through `bash`/`ctx_execute`. On Worker, gate, preflight, reviewer, or command failure, block; preserve the exact command/output, attempts, and affected role.
|
|
9
|
+
5. In `no-commit`, continue only with verified gates. In `commit`, after all phase gates pass, make exactly one commit for that phase. In `push`, push that phase commit, obtain its exact SHA, and call `watch_ci` for that SHA; do not push or schedule the next phase until CI settles successfully.
|
|
10
|
+
|
|
11
|
+
**Effects:** declared source/test changes plus serialized live-file status/checkboxes. Never edit plugin source or managed plan records. `--bg` launches one child only; it never redispatches.
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
# `/plan help`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Owner/tier:** User, read-only. **Tools:** read/grep/find only. **Children:** none.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Explain the verbs and ownership: `init` creates an `INCOMPLETE` live draft; `new` creates a complete plan; `update` edits one selected plan; `annotate` is optional human tuicr/direct-file review; `finalize` reviews and marks `READY`; `go` reviews drafts then orchestrates execution; `help` does nothing. Explain `--bg` launches exactly one named same-session Planner or Orchestrator child with the exact verb/target/cwd/commitMode, without redispatch or questions.
|
|
6
6
|
|
|
7
|
-
|
|
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.
|
|
7
|
+
**Effects:** none. **Failure:** unknown or missing input returns this help; no files, reviewer, dispatch, or managed plan calls.
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `/plan init`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
**Owner/tier:** Planner, frontier/high. **Tools:** read/write/edit/find/grep, `diffpi_modes_set`, `diffpi_modes_status`. **Children:** none.
|
|
4
|
+
|
|
5
|
+
1. Select the shared inline profile with `diffpi_modes_set({agent: "planner"})` (not `plan:planner`); on the next turn verify `diffpi_modes_status`. If either call or evidence is unavailable, stop with the exact error.
|
|
6
|
+
2. Resolve the initiating nested Git root and unique flat `.diffpi/plan/<YYMMDD[-ticket]-short-slug>/` directory (one date-prefixed name, not `date/slug`). Inspect collisions before creating anything; on collision, stop without overwriting.
|
|
7
|
+
3. Successively create the live directory, `PLAN.md`, and phase scaffolds with ordinary writes. Put `INCOMPLETE` in the visible `DRAFT` document; it is a marker, not a status enum.
|
|
8
|
+
4. Read every created file back and report paths.
|
|
9
|
+
|
|
10
|
+
**Effects:** only live plan files change. **Failure:** preserve partial files and report the exact path, command, and error; do not dispatch or ask questions in background. Foreground may ask one material goal question before writing.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `/plan new`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
**Owner/tier:** Planner, frontier/high. **Tools:** read/write/edit/find/grep, `diffpi_modes_set`, `diffpi_modes_status`, `plan_verify`, Agent, get_subagent_result, steer_subagent. **Child:** exactly one independent `diffpi-plan-reviewer`, frontier/high, read/search-only.
|
|
4
|
+
|
|
5
|
+
1. Select the shared inline profile with `diffpi_modes_set({agent: "planner"})` (not `plan:planner`) and verify `diffpi_modes_status` on the next turn; stop on unavailable switch or unverifiable evidence.
|
|
6
|
+
2. Resolve the initiating nested Git root and a flat `.diffpi/plan/<YYMMDD[-ticket]-short-slug>/` directory (one date-prefixed directory, not `date/slug`). Check collisions and stop before writing an existing match. Research only after selection.
|
|
7
|
+
3. Successively write `PLAN.md` and one numbered brief per phase. Document each phase's high-level constraints in `PLAN.md` (use `None` if empty) without copying implementation details there. Do not repeat or paraphrase those phase constraints in a brief; reference the phase ID instead. Give each brief a `## Files Affected` section immediately after `## Objective` and before `## Tasks`, containing exactly one fenced `text` action-labeled file tree rather than Markdown bullets, with free-form `## Implementation Constraints` after tasks; optional implementation subheadings are not mandatory. Preserve phase/task parity, dependencies, scopes, and acceptance criteria; read every file back.
|
|
8
|
+
4. Run read-only `plan_verify` against the live directory and repair structural issues before invoking exactly one reviewer. Verify its attestation and review the complete current draft. Repair actionable findings, rerun `plan_verify`, then invoke the same named reviewer profile in a fresh `Agent` call (not `resume`) within bounded attempts.
|
|
9
|
+
5. Leave the plan marked `DRAFT` after a successful review. Do not write `READY`; only `/plan finalize` or draft `/plan go` may do that.
|
|
10
|
+
|
|
11
|
+
**Failure:** preserve visible files and exact evidence; block on collision, failed/unverifiable review, or exhausted repairs. Background never asks questions or redispatches.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `/plan update`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
**Owner/tier:** Planner, frontier/high. **Tools:** read/write/edit/find/grep, `diffpi_modes_set`, `diffpi_modes_status`, `plan_verify`, Agent, get_subagent_result, steer_subagent. **Child:** exactly one independent `diffpi-plan-reviewer`, frontier/high, read/search-only.
|
|
4
|
+
|
|
5
|
+
1. Select the shared inline profile with `diffpi_modes_set({agent: "planner"})` (not `plan:planner`) and verify `diffpi_modes_status` on the next turn; stop on unavailable switch or unverifiable evidence.
|
|
6
|
+
2. Select exactly one plan by repository-root path. Read current `PLAN.md`, every numbered brief, and the request. Preserve intent, IDs, completed evidence, ownership, dependencies, and order.
|
|
7
|
+
3. Research affected code, then successively edit/write authoritative live files and read each back. Keep the marker `DRAFT` (and any `INCOMPLETE` marker) until explicit finalize or go.
|
|
8
|
+
4. Run read-only `plan_verify` against the current plan directory and repair structural issues. Invoke exactly one reviewer over the complete current plan. Verify actual model, thinking, and tools evidence. Repair actionable findings, rerun `plan_verify`, and reinvoke that named reviewer profile with a fresh `Agent` call (not `resume`) within bounded attempts.
|
|
9
|
+
|
|
10
|
+
**Failure:** preserve visible edits and report exact evidence; block on ambiguity, unavailable role/reviewer evidence, failed review, or exhausted repair. No fallback reviewer, redispatch, or background questions.
|
package/skills/review/SKILL.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review
|
|
3
|
-
description: Create, edit, review, address, publish, complete, and merge GitHub/GitLab or local tuicr reviews.
|
|
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
|
|
3
|
+
description: Create, edit, review, address, publish, complete, and merge GitHub/GitLab or local tuicr reviews.
|
|
4
|
+
allowed-tools: read ask_user_question Agent get_subagent_result steer_subagent bash 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
7
|
# Review
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Parse the first non-flag argument as the verb; preserve remaining arguments. Aliases: `create`/`draft` → `new`, `launch` → `auto`, `ready` → `publish`, `close` → `complete`, `land` → `merge`. Unknown or empty verbs show [help](references/workflows/help.md). `--local` selects tuicr working-tree state and must be preserved; otherwise use the selected forge. `--bg` removes itself and launches exactly one named same-session background Orchestrator with verb, arguments, cwd, exact target/backend, and `background: true`; it must not redispatch or ask questions. Foreground execution stays in this turn and never changes inline mode.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Read the selected reference before acting. Every target-bearing workflow calls `review_context` FIRST, then uses the same target, backend, `local` value, and cwd for every call; help is informational and may run without a target or repository. Tools own target selection, lifecycle, templates, comments, replies, publication, and forge calls. Do not reimplement them or invent tools. Report failed and skipped gates as such. Keep remote findings/comments pending until publish; local work remains tuicr state until promotion or completion. Do not publish, complete, merge, or resolve threads from auto/address.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
The foreground high-tier Reviewer owns only auto judgment and address classification/replies; lifecycle coordination belongs to the coordinator, which owns new/open/status/edit/publish/complete/merge and does not delegate these to a Reviewer child. In background mode the Orchestrator retains lifecycle coordination and delegates exactly one bounded high-tier Reviewer judgment child for auto/address only; the child does not edit source or recurse. `address` lets the Reviewer classify threads and delegate bounded, non-overlapping source edits to low-thinking Workers. Workers never commit, reply, publish, complete, merge, or resolve. Remote code changes are committed by the coordinator through the upstream `/git commit --no-push` workflow after checks and before replies (use `--atomic` for separate logical commits); local changes remain uncommitted. Address replies always use `review_respond(resolve:false)`; local thread resolution remains user-owned.
|
|
14
14
|
|
|
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).
|
|
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). `review_merge` is GitHub-only; approval by the current user is not required.
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
# address
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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.
|
|
3
|
+
**Owner/tier:** foreground high-tier Reviewer-coordinator; background Orchestrator coordinates and delegates bounded low-thinking Workers. Reviewer classifies threads; Workers may edit source only.
|
|
4
|
+
|
|
5
|
+
1. Call `review_context` first with exact target/backend/local, then `review_comments` with the same values.
|
|
6
|
+
2. Reviewer classifies every thread and groups only bounded, non-overlapping requested source changes. Delegate those edits to Workers. Workers never commit, reply, publish, complete, merge, resolve, or recurse. Questions remain open. Report unmatched threads and blockers.
|
|
7
|
+
3. Run `review_gates` after edits and report failures/skips. For remote code changes, coordinator invokes upstream `/git commit --no-push` after checks and before replies (`--atomic` for separate logical commits). Local changes stay uncommitted.
|
|
8
|
+
4. Coordinator calls `review_respond` for every outcome with `resolve:false`; never resolve or delete threads. With local state, optionally call `review_launch_ui` after replies. Do not publish, complete, or merge.
|
|
9
|
+
|
|
10
|
+
Report fixed, committed, answered, unresolved, skipped, and failed counts; resolved is always zero.
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
# auto
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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` with the same target and backend (`local: true` for `--local`, otherwise `local: false`). 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.
|
|
3
|
+
**Owner/tier:** foreground high-tier Reviewer-coordinator; background Orchestrator coordinates and delegates one high-tier Reviewer child. No source edits.
|
|
4
|
+
|
|
5
|
+
1. Parse target and `--local` (and let the skill handle `--bg` before this file). Call `review_context` first, then keep exact target/backend/local/cwd.
|
|
6
|
+
2. Call `review_new`; if the review already exists, call `review_edit`. Call `review_gates`, then `review_diff`.
|
|
7
|
+
3. Reviewer judges intent, correctness, edge cases, quality, minimality, docs, and duplicate findings. Report every gate failure or skip. Submit only grounded findings with `review_submit`; remote findings remain pending. Do not call publish, complete, merge, or resolve threads.
|
|
8
|
+
|
|
9
|
+
On missing target/backend, unsupported forge, failed creation, or failed gates, preserve state, report exact evidence, and stop or continue only with clearly reported skipped checks. Return artifact, backend, gate results, and finding count.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# complete
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
**Owner/tier:** lifecycle coordinator; no Reviewer or Worker.
|
|
4
|
+
|
|
5
|
+
1. Parse target, `--local`, or exactly one remote action: approve, reject, abandon. Call `review_context` first with the same values. If a remote action is missing, ask with `ask_user_question`; background mode must stop rather than guess.
|
|
6
|
+
2. Call `review_complete` with local true for local archive or the mapped remote action. Local completion archives the overlay and removes the matching tuicr session; remote completion does not merge.
|
|
7
|
+
3. Report archive/result and any failure. Never publish or call `review_merge`.
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# edit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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.
|
|
3
|
+
**Owner/tier:** lifecycle coordinator; no findings judgment.
|
|
4
|
+
|
|
5
|
+
Call `review_context` first, then `review_edit` with the same target/backend/local. It opens an existing local session or remote PR/MR in tuicr without generating findings. Report missing sessions, unsupported targets, and launch failures. Do not create, publish, complete, merge, or resolve.
|
|
@@ -1,36 +1,15 @@
|
|
|
1
1
|
# help
|
|
2
2
|
|
|
3
|
-
Print the following help text:
|
|
4
|
-
|
|
5
3
|
```text
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
21
|
-
/review edit [pr-number|pr-url|branch] [--local] [--bg]
|
|
22
|
-
|
|
23
|
-
Address review comments:
|
|
24
|
-
/review address [pr-number|pr-url|branch] [--local] [--bg]
|
|
25
|
-
|
|
26
|
-
Publish comments and a review status:
|
|
27
|
-
/review publish [pr-number|pr-url|branch] [--local] [--comment|--approve|--request-changes|--close] [--bg]
|
|
28
|
-
|
|
29
|
-
Complete a review without merging:
|
|
30
|
-
/review complete [pr-number|pr-url|branch] [--local|--approve|--reject|--abandon] [--bg]
|
|
31
|
-
|
|
32
|
-
Merge an approved remote review:
|
|
33
|
-
/review merge [pr-number|pr-url|branch] [--bg]
|
|
4
|
+
/review auto [target] [--local] [--bg]
|
|
5
|
+
/review new [title] [--intent text] [--base branch] [--local] [--bg]
|
|
6
|
+
/review open [target] [--local]
|
|
7
|
+
/review status [target] [--local]
|
|
8
|
+
/review edit [target] [--local] [--bg]
|
|
9
|
+
/review address [target] [--local] [--bg]
|
|
10
|
+
/review publish [target] [--local] [--comment|--approve|--request-changes|--close] [--bg]
|
|
11
|
+
/review complete [target] [--local|--approve|--reject|--abandon] [--bg]
|
|
12
|
+
/review merge [target] [--bg]
|
|
34
13
|
```
|
|
35
14
|
|
|
36
|
-
|
|
15
|
+
Every target-bearing workflow calls `review_context` first; help is informational and may run without a target or repository. `--local` selects working-tree tuicr state and is preserved; otherwise use the forge. `--bg` launches one named same-session Orchestrator child without redispatch or mode changes. `auto` reviews and stages grounded findings; `new` creates a draft; `open` opens an existing target; `status` is read-only; `edit` opens without findings; `address` fixes and replies without resolving; `publish` publishes/promotes pending work; `complete` approves/rejects/abandons or archives local state without merging; `merge` is GitHub-only and requires clean settled readiness. Aliases: create/draft=new, launch=auto, ready=publish, close=complete, land=merge. Unknown verbs show this help.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# merge
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
4. Report the merge result.
|
|
3
|
+
**Owner/tier:** lifecycle coordinator; remote GitHub-only, no Reviewer or Worker.
|
|
4
|
+
|
|
5
|
+
Reject `--local`. Call `review_context` first with `local:false`, then `review_merge`; the tool checks open, non-draft, clean PR and settled checks and uses branch protection as authoritative. Approval by the current user is not required. Ask only when a conventional squash subject is materially unclear. Report merge or readiness failure. Merge never publishes or completes review state.
|