@difflab/pi 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -39
- package/agents/diffpi-copilot.md +2 -2
- package/agents/diffpi-orchestrator.md +9 -14
- package/agents/diffpi-plan-reviewer.md +4 -12
- package/agents/diffpi-planner.md +6 -12
- package/agents/diffpi-reviewer.md +6 -10
- package/agents/diffpi-tutor.md +2 -2
- package/agents/diffpi-worker.md +3 -6
- package/dist/commands/dispatch.d.ts +4 -0
- package/dist/commands/dispatch.d.ts.map +1 -0
- package/dist/commands/index.d.ts +1 -3
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/plan.d.ts +1 -1
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/review.d.ts +1 -1
- package/dist/commands/review.d.ts.map +1 -1
- package/dist/doctor.d.ts +9 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/extensions/index.js +2705 -3114
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -403
- package/dist/tools/ci.d.ts +1 -1
- package/dist/tools/doctor.d.ts +3 -0
- package/dist/tools/doctor.d.ts.map +1 -0
- package/dist/tools/index.d.ts +2 -3
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2601 -2610
- package/package.json +2 -2
- package/skills/diffpi-doctor/SKILL.md +10 -0
- package/skills/diffpi-setup/SKILL.md +1 -1
- package/skills/plan/SKILL.md +13 -23
- package/skills/plan/references/design-quality.md +3 -3
- package/skills/plan/references/workflows/annotate.md +9 -3
- package/skills/plan/references/workflows/finalize.md +10 -6
- package/skills/plan/references/workflows/go.md +25 -7
- package/skills/plan/references/workflows/help.md +20 -3
- package/skills/plan/references/workflows/init.md +23 -6
- package/skills/plan/references/workflows/inline-fallback.md +9 -0
- package/skills/plan/references/workflows/new.md +22 -7
- package/skills/plan/references/workflows/update.md +22 -6
- package/skills/plan/references/workflows/validate.md +31 -0
- package/skills/review/SKILL.md +15 -7
- package/skills/review/references/workflows/address.md +19 -6
- package/skills/review/references/workflows/auto.md +21 -5
- package/skills/review/references/workflows/complete.md +17 -4
- package/skills/review/references/workflows/edit.md +8 -2
- package/skills/review/references/workflows/foreground-fallback.md +7 -0
- package/skills/review/references/workflows/help.md +22 -13
- package/skills/review/references/workflows/merge.md +17 -2
- package/skills/review/references/workflows/new.md +17 -5
- package/skills/review/references/workflows/open.md +8 -2
- package/skills/review/references/workflows/publish.md +17 -4
- package/skills/review/references/workflows/status.md +7 -2
- package/templates/plan/PLAN.md +1 -1
- package/dist/commands/mode.d.ts +0 -5
- package/dist/commands/mode.d.ts.map +0 -1
- package/dist/modes.d.ts +0 -75
- package/dist/modes.d.ts.map +0 -1
- package/dist/tools/modes.d.ts +0 -4
- package/dist/tools/modes.d.ts.map +0 -1
- package/skills/mode/SKILL.md +0 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difflab/pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Tools and skills for the pi coding agent",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@juicesharp/rpiv-ask-user-question": "^2.10.1",
|
|
60
60
|
"commander": "^14.0.0",
|
|
61
61
|
"mdast-builder": "1.1.1",
|
|
62
|
-
"pi-mcp-adapter": "^2.
|
|
62
|
+
"pi-mcp-adapter": "^2.38.0",
|
|
63
63
|
"remark-stringify": "11.0.0",
|
|
64
64
|
"unified": "11.0.5",
|
|
65
65
|
"zod": "^4.6.5"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: diffpi-doctor
|
|
3
|
+
description: Check and repair stale global Diffpi agent profiles after a Pi package update. Use when plan or review agents request removed diffpi_modes_* tools or their installed profiles differ from @difflab/pi.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Diffpi Doctor
|
|
7
|
+
|
|
8
|
+
1. Call `diffpi_doctor` with `apply: false` to inspect the bundled agent profiles against Pi's global agent directory. This check does not install packages, run full setup, or change settings.
|
|
9
|
+
2. If any profile needs repair, call `diffpi_doctor` with `apply: true`. It updates only bundled `diffpi-*.md` agent profiles from the installed @difflab/pi package and backs up each replaced file. If the package or target cannot be read safely, stop and report the blocker.
|
|
10
|
+
3. Report changed paths and backup location. In each affected Pi session, reload resources or start a new conversation if an old inline system prompt persists. Do not claim this repair validates, marks READY, or executes any plan.
|
|
@@ -47,4 +47,4 @@ Map `None`, `Linear`, and `Jira` to `none`, `linear`, and `jira`. Infer the revi
|
|
|
47
47
|
|
|
48
48
|
When the user is using Zed, ask separately whether to bind `cmd-alt-r` to the `diffpi: tuicr review` task. Only pass `bindZedKey: true` when the user opts in; otherwise pass `false`.
|
|
49
49
|
|
|
50
|
-
Setup installs Diffpi's bundled agent Markdown into Pi's standard global agent directory.
|
|
50
|
+
Setup installs Diffpi's bundled agent Markdown into Pi's standard global agent directory. The agents run through the subagent plugin; no inline profile selection is required for plan or review workflows.
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: plan
|
|
2
|
+
name: diffpi-plan
|
|
3
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
4
|
---
|
|
6
5
|
|
|
7
6
|
# Plan
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
Route the verb and remaining request to its workflow. Fuzzy-match recognizable natural language; treat argument shapes as hints, not rigid gates.
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
| Input | Workflow |
|
|
11
|
+
| -------------------------------------------- | -------------------------------------------- |
|
|
12
|
+
| `init <slug> [--branch <branch>]` | [init](references/workflows/init.md) |
|
|
13
|
+
| `new <slug> <request>` | [new](references/workflows/new.md) |
|
|
14
|
+
| `update <slug> <request>` | [update](references/workflows/update.md) |
|
|
15
|
+
| `annotate <plan-path>` | [annotate](references/workflows/annotate.md) |
|
|
16
|
+
| `validate <slug>` | [validate](references/workflows/validate.md) |
|
|
17
|
+
| `finalize <slug>` | [finalize](references/workflows/finalize.md) |
|
|
18
|
+
| `go <slug> [--mode no-commit\|commit\|push]` | [go](references/workflows/go.md) |
|
|
19
|
+
| `help`, missing or unrecognizable request | [help](references/workflows/help.md) |
|
|
12
20
|
|
|
13
|
-
|
|
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.
|
|
16
|
-
|
|
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.
|
|
18
|
-
|
|
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).
|
|
21
|
+
Follow the selected workflow. For `init`, `new`, `update`, DRAFT `validate`, `finalize`, or `go` when no native subagents are available, follow [the explicit inline exception](references/workflows/inline-fallback.md) only after the caller obtains confirmation; never silently fall back.
|
|
@@ -11,7 +11,7 @@ Build from repository evidence. Keep the result compact and useful to a Worker.
|
|
|
11
11
|
|
|
12
12
|
## Implementation brief
|
|
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.
|
|
14
|
+
- Give tasks ordered implementation steps. Add nested `Verify` bullets under the relevant task; verification is part of the task, not a separate task. Every Verify command must be executable when that task finishes: do not require a test file, build artifact, dependency, or command created only by a later task. Use an inline smoke check or move the test creation earlier when needed.
|
|
15
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
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
17
|
- Read back each file after writing it. Normal successive write/edit calls are intentional: incomplete drafts remain visible until the plan is ready.
|
|
@@ -20,9 +20,9 @@ Build from repository evidence. Keep the result compact and useful to a Worker.
|
|
|
20
20
|
|
|
21
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.
|
|
22
22
|
|
|
23
|
-
After writing the current `PLAN.md` and all numbered briefs,
|
|
23
|
+
After writing the current `PLAN.md` and all numbered briefs, perform observed read-only structural verification, then invoke the independent `diffpi-plan-reviewer` exactly once per authoring cycle over the complete snapshot. Require the actual completed independent `diffpi-plan-reviewer` result, record its verdict and findings, and compare plan hashes and Git state around it; a reviewer mutation invalidates the round. The reviewer is instructed not to mutate but inherits ambient capabilities, so read-only behavior is a policy, not a sandbox.
|
|
24
24
|
|
|
25
|
-
The Planner
|
|
25
|
+
The Planner documents each actionable finding and its disposition, repairs it, rereads changed files, and reruns only observed read-only structural verification. Do not automatically rerun the reviewer. Keep the plan DRAFT until explicit finalize/go checks completed review evidence and dispositions. A BLOCKING verdict remains BLOCKING even when repaired; a passing review does not prove source implementation. `annotate` is optional human review, not a replacement for the automated round.
|
|
26
26
|
|
|
27
27
|
## Contracts and consequences
|
|
28
28
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# `/plan annotate`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Syntax: `annotate <plan-path>` (no flags required; use an explicit target if supplied).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
1. Match `annotate` or clear intent to inspect a plan with a human. Resolve one plan path from explicit input before inferred request/repository context, then a safe default if unique. Do not require a positional path when a single target is evident. Ask via `ask_user_question` only for material ambiguity; route truly insufficient intent to full [help](help.md).
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. Open the selected PLAN.md and numbered briefs in `tuicr --file` or a direct-file human review in the foreground. Do not launch an automatic Plan Reviewer.
|
|
12
|
+
2. Tie human comments to current plan file paths. Leave plan files, status and checkboxes unchanged. Direct requested edits to a separate explicit `/plan update`, or readiness to `/plan finalize`.
|
|
13
|
+
3. Report exact file or review UI failures; do not turn annotation into an automated second reviewer round.
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
# `/plan finalize`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
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`.
|
|
5
|
+
Syntax: `finalize <slug>` (optional `--plan <plan-path>` or `--target <plan-path>`).
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
1. Infer readiness intent and unique target from explicit args/flags first, then natural language and repository context. Do not require an inferable slug. Ask `ask_user_question` in the caller for material ambiguity; send insufficient intent to [help](help.md).
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
If DRAFT and no native subagents are available, ask for explicit confirmation in the caller and follow [the inline exception](inline-fallback.md); a passing inline structural and review/disposition validation under that recorded exception permits READY. Otherwise stop with a blocker.
|
|
12
|
+
|
|
13
|
+
1. Resolve the initiating Git root, absolute PLAN.md and numbered briefs. If DRAFT, invoke [validate](validate.md) through its **one** separate frontier/high `diffpi-planner` background child with the resolved path, filling the self-contained fenced `text` prompt in validate.md before launch and collecting the completed result. Do not launch a second child or another reviewer. If validation is incomplete or blocked, leave DRAFT and report the blocker.
|
|
14
|
+
2. The **calling agent** (not the child) checks the completed validation result and durable evidence against the current files, then makes the short DRAFT → READY transition and reads it back. If the plan is already READY, read it back without revalidation. Do not execute tasks. Report status and evidence or exact blocker.
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
# `/plan go`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
5
|
+
Syntax: `go <slug> [--mode no-commit|commit|push]` (optional `--plan <plan-path>` or `--target <plan-path>`).
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
1. Infer execution intent, unique target and mode from explicit args/flags first, then natural language and repository context. Default mode to `no-commit`; never infer commit or push authorization from silence. Do not require an inferable slug. Ask `ask_user_question` in the caller for material ambiguity; send insufficient intent to [help](help.md).
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
If no native subagents are available, ask for explicit confirmation in the caller and follow [the inline exception](inline-fallback.md) for DRAFT readiness and/or READY execution; otherwise stop with a blocker. Never silently execute inline.
|
|
12
|
+
|
|
13
|
+
1. Resolve the initiating Git root, absolute PLAN.md and all numbered briefs. An explicit `go` authorizes readiness after passing validation: DRAFT alone is not a blocker and a separate `finalize` is not required. If DRAFT, launch [validate](validate.md) through its separate frontier/high `diffpi-planner` background child with resolved paths and collect actual completion; do not require any retired mode tool. On failed/incomplete validation leave DRAFT and stop. On PASS the calling agent checks current evidence, changes only `**Status:** DRAFT` to `**Status:** READY` in PLAN.md using ordinary file editing, and reads the status back before execution. If already READY, **skip validate**, reviewer and structural revalidation; read status and proceed. Do not send DRAFT to the orchestrator.
|
|
14
|
+
2. Fill every placeholder with actual request, paths and chosen mode before launch (no literal placeholders). Launch a medium `diffpi-orchestrator` background agent with ambient capabilities and this prompt:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
Execute this READY live plan under the user-approved policy. Do not run a plan reviewer or revalidate READY for readiness.
|
|
18
|
+
- Exact request: {exact-request}
|
|
19
|
+
- Initiating Git root: {repo-root}
|
|
20
|
+
- Absolute READY PLAN.md path: {plan-path}
|
|
21
|
+
- Absolute numbered brief paths: {brief-paths}
|
|
22
|
+
- Mode: {mode} (no-commit|commit|push)
|
|
23
|
+
- Read PLAN.md and every brief; require READY. Own execution status and checkboxes, schedule phases after prerequisites and persist actual results before more work.
|
|
24
|
+
- Derive bounded task scopes from steps and each brief's sole action-labeled fenced `text` Files Affected tree; serialize uncertain/overlapping scopes. Delegate disjoint tasks to lightweight `diffpi-worker` background agents with concrete scopes, acceptance checks and ambient capabilities. Collect completed results, escalate blocked work and route bounded fixes; reload plan state before rescheduling. Workers edit only assigned source/test files, never plan lifecycle or commits.
|
|
25
|
+
- Run project format, lint and tests after phase work; preserve failures, warnings and attempts; block on failed gates. In no-commit, do not commit or push. In commit, create exactly one phase commit after gates, do not push. In push, commit and push, then wait for settled CI on the exact observed SHA before the next phase. Block on unavailable exact-SHA monitoring, timeout, partial or failed CI. Local gates cannot be replaced by CI.
|
|
26
|
+
- Return actual completed results or precise blockers, without background questions.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. Report the job ID and actual completed result or precise background-capability blocker.
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
# `/plan help`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Syntax: `help` (no flags or positional arguments required).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
1. Match `help`, a missing/unrecognizable verb, or genuinely insufficient intent. Fuzzy-match recognizable natural-language plan requests to their verb before showing help. Do not treat an inferable missing positional argument as insufficient; give explicit arguments/flags precedence over request/repository inference, then safe defaults.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. Show the complete usage below for explicit help or truly unrecognizable/insufficient intent. Identify any invalid argument in the error context without losing the original request.
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
/plan init <slug> [--branch <branch>]
|
|
15
|
+
/plan new <slug> <request>
|
|
16
|
+
/plan update <slug> <request>
|
|
17
|
+
/plan annotate <plan-path>
|
|
18
|
+
/plan validate <slug> [--plan <plan-path>]
|
|
19
|
+
/plan finalize <slug>
|
|
20
|
+
/plan go <slug> [--mode no-commit|commit|push]
|
|
21
|
+
/plan help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
2. Describe these argument shapes as guidance rather than rigid gates; send a recognizable request to its verb for inference. Make no plan changes.
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
# `/plan init`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
5
|
+
Syntax: `init <slug> [--branch <branch>]` (optional target/issue inferred from request).
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
1. Infer scaffold intent, slug, branch and issue from explicit args/flags first, then natural language and the initiating Git root, then safe defaults. A positional slug is not required when inferable. Ask `ask_user_question` in the caller only for material ambiguity; send insufficient intent to [help](help.md).
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
If no native subagents are available, ask for explicit confirmation in the caller and follow [the inline exception](inline-fallback.md); otherwise stop with a blocker. Do not silently scaffold inline.
|
|
12
|
+
|
|
13
|
+
1. Resolve the unique initiating Git root and absolute PLAN.md target. Replace every placeholder below with actual values (use `none` for absent issue/branch); never pass literal placeholders. Launch a low `diffpi-worker` background agent with this bounded prompt and ambient capabilities:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Scaffold an incomplete live plan, and do nothing else.
|
|
17
|
+
- Exact request: {exact-request}
|
|
18
|
+
- Initiating Git root: {repo-root}
|
|
19
|
+
- Absolute PLAN.md target: {plan-path}
|
|
20
|
+
- Branch and issue: {branch-and-issue}
|
|
21
|
+
- Check collisions before writing. Use one flat `.diffpi/plan/<YYMMDD[-ticket]-short-slug>/` directory, never `date/slug`.
|
|
22
|
+
- Create PLAN.md and phase scaffolds with ordinary writes, DRAFT and a visible INCOMPLETE marker (not a status). This init-only exception permits plan-file creation, but not status transitions beyond the initial DRAFT scaffold, source edits, execution or review.
|
|
23
|
+
- Reread created files. Do not validate or launch a reviewer for the incomplete scaffold.
|
|
24
|
+
- Return created paths or the exact failed operation/path/error; return unresolved decisions as blockers without interactive questions.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
2. Report the job ID and actual completed result or precise background-capability blocker. Do not scaffold in the caller.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Explicit inline exception when no native subagents exist
|
|
2
|
+
|
|
3
|
+
Apply this policy only to `init`, `new`, `update`, DRAFT `validate`, `finalize`, or `go` when **no native subagent mechanism is available** to the initiating conversation. Try any available attached subagent dispatch/completion transport before treating native subagents as unavailable; a missing named tool alone is not proof. A failed reviewer, gate, implementation, structural check, CI check, or unavailable particular model is **not** an excuse to switch inline. Do not silently fall back after a child is queued, stopped, incomplete, or fails; return its actual blocker.
|
|
4
|
+
|
|
5
|
+
Before substantive inline work, the **calling agent** must ask `ask_user_question` and receive explicit confirmation for the inline exception. State that this is a last resort with reduced isolation/model-tier guarantees and that review in the same thread is **not independent**. Offer a choice to proceed inline or stop; a declined, abandoned, or unavailable questionnaire (including in a background child or noninteractive eval) means **stop and report the blocker to the initiating thread**. Do not infer consent from the request, a prior unrelated approval, or silence. Record the confirmation and its scope with the authoring-cycle evidence; one confirmation can cover the named operation and its chained validation/readiness/execution steps, but a later user-initiated update requires confirmation again. Noninteractive evals still require an actual completed child; they cannot opt into inline fallback.
|
|
6
|
+
|
|
7
|
+
After confirmation, perform the **same selected workflow** in the caller, with the same paths, collision checks, statuses, role boundaries, snapshots, Git evidence, findings, repairs, one-round budget, gates, CI and commit/push authorization. For `init`, create only an incomplete DRAFT scaffold. For `new` and `update`, make requested draft edits, then validate; `update` must preserve completed work and earlier evidence. For DRAFT `validate`, first run a working read-only structural check and repair structural defects as in the normal workflow. Capture every plan path/hash and Git HEAD, porcelain status, diff and untracked inventory before the review and again immediately afterward. Perform **one distinct read-only inline Plan Reviewer checklist pass** on the whole draft per authoring cycle, checking structure and parity, phase prerequisites/constraints, tree placement, ordered steps and temporally runnable Verify commands, intent/design consistency, risks and Worker executability. Record provenance as **INLINE reviewer (same thread, not independent)**, the actual verdict and line-specific BLOCKING/CONSIDER/NOTE findings (or explicit empty list), reviewed and post-review snapshots, Git evidence, and concrete dispositions in References or a linked durable artifact. Never fabricate a child ID, completed subagent, independent verdict or independent PASS. Reuse a valid completed round from the cycle rather than automatically reviewing a second time. Reviewer pass is read-only: if the pass mutates files or evidence changes unexplained, invalidate it. Repair actionable findings outside that pass, preserve an original BLOCKING verdict, reread and rerun **only** the structural check; do not call repaired content reviewer-approved. Failed structural checks, unresolved BLOCKING findings or unexplained changes block readiness.
|
|
8
|
+
|
|
9
|
+
For `finalize` or DRAFT `go`, after **passing inline structural verification and inline review/disposition validation under the recorded approved exception**, the caller may mark DRAFT → READY, reread it, and continue the selected workflow. This exception does not waive any failed check. Already-READY `go` still skips readiness validation. If no native subagents remain for execution, the confirmed caller performs Orchestrator and bounded Worker steps inline with serialized uncertain/overlapping scopes and the same phase gates, no-commit/commit/push policy and exact-SHA CI requirements. Do not claim inline work was delegated or independently reviewed. If the user declines or cannot be asked, return the blocker rather than modifying the plan or executing work.
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
# `/plan new`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
5
|
+
Syntax: `new <slug> <request>` (optional `--target <plan-path>`, `--issue <id>`, `--issue-url <url>`).
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
1. Infer creation intent, slug, target, branch, issue and requested outcome from explicit args/flags first, then natural language and repository context, then safe defaults. Do not require inferable positionals. Ask `ask_user_question` in the caller for material ambiguity; send insufficient intent to [help](help.md).
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
If no native subagents are available, ask for explicit confirmation in the caller and follow [the inline exception](inline-fallback.md), including chained validation; otherwise stop with a blocker. Never silently draft inline.
|
|
12
|
+
|
|
13
|
+
1. Resolve the initiating Git root and unique absolute PLAN.md target. Fill every placeholder with actual values before launch (use `none` for absent context). Launch a frontier/high `diffpi-planner` background agent with ambient capabilities:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Draft a complete live plan; do not dispatch a reviewer or mark READY.
|
|
17
|
+
- Exact request: {exact-request}
|
|
18
|
+
- Initiating Git root: {repo-root}
|
|
19
|
+
- Absolute PLAN.md target, branch and issue: {plan-path-and-context}
|
|
20
|
+
- Reject collisions; use a flat `.diffpi/plan/<YYMMDD[-ticket]-short-slug>/` directory.
|
|
21
|
+
- Inspect the repository and resolve design questions. Write PLAN.md with intent, requirements, design, references, stable phase/task IDs, phase prerequisites and constraints (or None), and flat task checkboxes.
|
|
22
|
+
- Write every numbered brief. Put exactly one action-labeled fenced `text` Files Affected tree immediately after Objective. Include ordered task steps, Verify commands runnable before later tasks, acceptance criteria and free-form Implementation Constraints.
|
|
23
|
+
- Reread all files. Leave DRAFT. Return paths and completed result or exact blocker; do not ask background questions.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
2. Collect the completed draft result. On success run [validate](validate.md) once in this authoring cycle, using the resolved plan path; its own child owns the independent review round. Leave DRAFT even on validation PASS. Report actual result and blockers, not just the job ID.
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
# `/plan update`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
5
|
+
Syntax: `update <slug> <request>` (optional `--plan <plan-path>` or `--target <plan-path>`).
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
1. Infer revision intent, unique target and requested edits from explicit args/flags first, then natural language and repository context. Do not require inferable positionals. Ask `ask_user_question` in the caller for material ambiguity; send insufficient intent to [help](help.md).
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
If no native subagents are available, ask for explicit confirmation in the caller **before edits** and follow [the inline exception](inline-fallback.md), including chained validation; otherwise stop with a blocker. Never silently revise inline.
|
|
12
|
+
|
|
13
|
+
1. Resolve the initiating Git root, absolute PLAN.md and numbered brief paths. Fill all placeholders with actual values before launch. Launch `diffpi-planner` on its configured frontier model with explicit **low** thinking and `inherit_context: true` (fork the parent conversation at launch), in the background with ambient capabilities:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Revise only the requested unfinished plan work in a new user-initiated authoring cycle. Do not validate or dispatch a reviewer.
|
|
17
|
+
- Exact requested edits: {exact-request}
|
|
18
|
+
- Initiating Git root: {repo-root}
|
|
19
|
+
- Absolute PLAN.md path: {plan-path}
|
|
20
|
+
- Absolute numbered brief paths: {brief-paths}
|
|
21
|
+
- Read PLAN.md and all briefs. Preserve stable IDs, dependencies, completed work, prior reviewed snapshots, verdicts, dispositions and execution history. Amend only draft/pending/blocked work; preserve INCOMPLETE if still incomplete.
|
|
22
|
+
- Research affected code and make only requested changes. Keep phase prerequisites/constraints (or None), flat task checkboxes and exactly one action-labeled fenced `text` Files Affected tree immediately after Objective in each brief. Keep ordered steps, acceptance criteria, temporally runnable Verify commands and free-form Implementation Constraints.
|
|
23
|
+
- Reread files, leave DRAFT, return changed paths and exact result or blocker. Do not ask background questions.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
2. Collect the completed edit result. On success the caller launches the separate [validate](validate.md) child for this new authoring cycle (one independent review round maximum) and reports its result; leave DRAFT. Do not put review inside the edit child or discard earlier evidence.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# `/plan validate`
|
|
2
|
+
|
|
3
|
+
## Parse arguments
|
|
4
|
+
|
|
5
|
+
Syntax: `validate <slug>` (optional `--plan <plan-path>` or `--target <plan-path>`).
|
|
6
|
+
|
|
7
|
+
1. Infer validation intent and a unique target from explicit args/flags first, then natural language and repository context. Do not require an inferable slug. Ask `ask_user_question` in the caller for material ambiguity; send insufficient intent to [help](help.md).
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
If DRAFT and no native subagents are available, ask for explicit confirmation in the caller and follow [the inline exception](inline-fallback.md), including a distinct read-only inline Plan Reviewer pass; otherwise stop with a blocker. Never claim an independent review for inline work.
|
|
12
|
+
|
|
13
|
+
1. Resolve the initiating Git root, absolute PLAN.md and every numbered brief path. If READY, return its status; READY does not require revalidation for go. For DRAFT, fill all placeholders with real values before launch (use `none` where appropriate). Launch a separate frontier/high `diffpi-planner` background agent with ambient capabilities:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Validate this DRAFT without marking it READY or executing tasks.
|
|
17
|
+
- Exact request: {exact-request}
|
|
18
|
+
- Initiating Git root: {repo-root}
|
|
19
|
+
- Absolute PLAN.md path: {plan-path}
|
|
20
|
+
- Absolute numbered brief paths: {brief-paths}
|
|
21
|
+
- Read PLAN.md, all numbered briefs and durable review evidence. Run a working read-only structural check of the whole current draft; name the capability used or block if none works. Check task ID/title parity, prerequisites/constraints, sole action-labeled fenced `text` Files Affected tree immediately after Objective, ordered tasks and temporally runnable Verify commands. Repair structural errors only within the plan and rerun the structural check.
|
|
22
|
+
- Identify this authoring cycle. If one independent completed whole-plan diffpi-plan-reviewer round already exists for the cycle with valid before/after snapshot evidence, reuse it; never dispatch a second reviewer on repeated validate or after repairs. Otherwise capture every plan file path/hash plus Git HEAD, porcelain status, diff and untracked inventory, then launch at most ONE independent frontier/high diffpi-plan-reviewer background agent. Fill its prompt with the actual absolute plan/brief paths, hashes and Git evidence before dispatch:
|
|
23
|
+
|
|
24
|
+
Reviewer task: Read PLAN.md and every numbered brief at {reviewed-plan-paths-and-hashes} with Git evidence {git-head-status-diff-untracked}. Make no mutations. Review structure, parity, phase prerequisites/constraints, Files Affected tree placement, ordered steps, temporally runnable Verify commands, intent/design consistency, risks and lightweight Worker executability. Return completed verdict and findings; each finding includes file, line, BLOCKING/CONSIDER/NOTE severity, reason and concrete fix. Return an explicit empty findings list for PASS. Do not claim source implementation is verified.
|
|
25
|
+
|
|
26
|
+
- Require the reviewer's actual completed result, not queued/partial/stopped output or self-reported identity. Compare plan hashes and Git HEAD/status/diff/untracked inventory immediately after review. Invalidate the round on reviewer mutation, incomplete evidence or unexplained change. Use any real available dispatch/completion implementation, not one named tool prerequisite.
|
|
27
|
+
- Record the reviewed snapshot, Git evidence, completed verdict, findings and concrete disposition of each finding under References or a linked durable artifact. Repair actionable findings, reread changed files and rerun ONLY the read-only structural check. Record post-fix snapshot separately. Preserve the original BLOCKING verdict; never claim reviewer PASS for repaired content. A later user-initiated change starts a new authoring cycle, but repeated validation does not.
|
|
28
|
+
- Return validation PASS only when structural checks pass, the one completed review round and evidence are valid, every BLOCKING finding has a resolved disposition, and all post-review changes are explained. Otherwise return precise blockers. Leave DRAFT; no background questions.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. Collect the actual completed result, not only a job ID. Report validation verdict, reviewed and current snapshots, dispositions or blockers. Do not mark READY.
|
package/skills/review/SKILL.md
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: review
|
|
2
|
+
name: diffpi-review
|
|
3
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
4
|
---
|
|
6
5
|
|
|
7
6
|
# Review
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
Infer the verb from the request. Route it with its arguments to the selected workflow:
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
| Command | Reference |
|
|
11
|
+
| ------------------------------------------------------------------------------- | -------------------------------------------- |
|
|
12
|
+
| `new [title] [--intent text] [--base branch] [--local]` | [new](references/workflows/new.md) |
|
|
13
|
+
| `auto [target] [--local]` | [auto](references/workflows/auto.md) |
|
|
14
|
+
| `address [target] [--local]` | [address](references/workflows/address.md) |
|
|
15
|
+
| `publish [target] [--local] [--comment\|--approve\|--request-changes\|--close]` | [publish](references/workflows/publish.md) |
|
|
16
|
+
| `complete [target] [--local\|--approve\|--reject\|--abandon]` | [complete](references/workflows/complete.md) |
|
|
17
|
+
| `merge [target]` | [merge](references/workflows/merge.md) |
|
|
18
|
+
| `status [target] [--local]` | [status](references/workflows/status.md) |
|
|
19
|
+
| `open [target] [--local]` | [open](references/workflows/open.md) |
|
|
20
|
+
| `edit [target] [--local]` | [edit](references/workflows/edit.md) |
|
|
21
|
+
| `help` | [help](references/workflows/help.md) |
|
|
12
22
|
|
|
13
|
-
|
|
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). `review_merge` is GitHub-only; approval by the current user is not required.
|
|
23
|
+
Map `create`/`draft` → `new`, `launch` → `auto`, `ready` → `publish`, `close` → `complete`, `land` → `merge`. Route missing or unrecognizable intent → [help](references/workflows/help.md). For substantive work without native subagents, use the selected workflow's [foreground fallback](references/workflows/foreground-fallback.md) only after explicit confirmation.
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
# address
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
5
|
+
Accept `address [target] [--local]`. Fuzzy-match the review target/backend from the request and repository. Prefer explicit target/`--local`, then safe inference, then the current-review default. Select local for an explicit working-tree request. Infer commit approval only from an actual user instruction. Call `ask_user_question` only for material ambiguity before launch; return a precise blocker if a new decision arises later.
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. Resolve the concrete target/backend/local and review scope with `review_context` without classifying threads. Read [review standards](../review-standards.md). Substitute actual values for every placeholder, including the exact request, resolved review-context target, review scope, issue URL if applicable, and standards; never send raw `{placeholders}`. When native subagents are available, launch a frontier/high `diffpi-reviewer` background subagent with the following self-contained prompt and ambient capabilities:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Address every thread on this review.
|
|
13
|
+
- Repository: {absolute repo cwd}; exact request: {exact request}.
|
|
14
|
+
- Resolved review-context target: {target}; backend: {backend}; local: {local}; review scope: {review scope}; issue URL: {issue URL or none}; approved commit policy: {policy}.
|
|
15
|
+
- Review standards: {standards}.
|
|
16
|
+
- Call review_context first; reuse its target/backend/local/cwd. Call review_comments; classify every thread, preserve IDs and report unmatched threads. Apply every relevant requested change now unless explicitly deferred by the user or concretely blocked.
|
|
17
|
+
- Delegate independent, bounded non-overlapping source/test edits to lightweight/low diffpi-worker agents with ambient capabilities. Each self-contained fenced text task prompt must supply the actual repository, target/backend/local, thread IDs and exact requests, assigned file scope, acceptance checks and no-lifecycle-mutation policy; fill real values before launch, never raw placeholders. Serialize uncertain or overlapping scopes. Keep your source review read-only. Collect completed worker results, inspect actual edits and verification; escalate hard or ambiguous work instead of silently deferring it. Workers must not commit, reply, publish, complete, merge, resolve or mutate review state.
|
|
18
|
+
- Run review_gates after edits; record failed and skipped checks. For remote source changes, commit after checks and before replies through the user-approved upstream /git commit --no-push workflow (--atomic for separate logical commits). Do not commit without approval. Leave local source edits uncommitted.
|
|
19
|
+
- Call review_respond for every thread with resolve:false, explicit fixed/answered/unresolved outcome and verification evidence. Do not claim blocked work was delivered. Keep questions and all threads open for user resolution. Optionally call review_launch_ui for local replies.
|
|
20
|
+
- Never delete or resolve threads, publish, complete or merge. Report fixed, committed, answered, unresolved, skipped and failed counts, unmatched replies, gate evidence and blockers; resolved count is zero. Preserve local replies and thread state between runs.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. If no native subagents are available, follow [foreground fallback](foreground-fallback.md) before classifying threads or editing. Only after explicit confirmation, perform the address steps above inline, including source/test edits directly where needed (do not invent Worker results), checks, approved commit policy, and `review_respond(resolve:false)` for every thread; report unresolved and blocked work honestly. Otherwise verify the attached launch. Stop on failure; report the actual completed child outcome, not merely its queued ID or claim of success.
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
# auto
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
5
|
+
Accept `auto [target] [--local]`. Fuzzy-match review intent and infer the current branch, PR/MR or working-tree target/backend from the request and repository. Prefer explicit arguments/flags, then safe inference, then current-review defaults. Select local for an explicit working-tree request. Call `ask_user_question` only for material ambiguity before launch; return a precise blocker if a new decision arises later.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. Resolve the concrete target/backend/local and diff scope with `review_context` without analyzing the diff. Read [review standards](../review-standards.md). Substitute actual values for every placeholder, including the exact request, resolved review-context target, diff scope, issue URL if applicable, and standards; never send raw `{placeholders}`. When native subagents are available, launch a frontier/high `diffpi-reviewer` background subagent with the following self-contained prompt and ambient capabilities:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Review this change without editing source.
|
|
13
|
+
- Repository: {absolute repo cwd}; exact request: {exact request}.
|
|
14
|
+
- Resolved review-context target: {target}; backend: {backend}; local: {local}; diff scope: {diff scope}; issue URL: {issue URL or none}; approved policy: {policy}.
|
|
15
|
+
- Review standards: {standards}.
|
|
16
|
+
- Call review_context first; reuse its target/backend/local/cwd. Reject unsupported forge, missing integration or unavailable local base without switching backend.
|
|
17
|
+
- Use review_status if needed to distinguish an existing review. Call review_new for a new local session or remote draft PR/MR; call review_edit for an existing review.
|
|
18
|
+
- Run review_gates, then review_diff. Judge intent, correctness, negative/security paths, scope and duplicate findings. Record failed and skipped format/lint/test/subject/CI checks; stop with evidence if the diff is unavailable.
|
|
19
|
+
- Stage changed-file-and-line-grounded BLOCKING, CONSIDER or NOTE findings with review_submit; submit [] if clean. Include overall issues and not-verified checks where needed. Keep remote findings pending and local findings in draft.
|
|
20
|
+
- Do not edit source, publish, complete, merge or resolve threads.
|
|
21
|
+
- Delegate bounded independent checks when useful, with self-contained task prompts and ambient capabilities. The plan's exactly-one independent review limit does not apply to PR/MR code review.
|
|
22
|
+
- Verify and report artifact, backend, gates, finding count and blockers.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
2. If no native subagents are available, follow [foreground fallback](foreground-fallback.md) before analysis or creation. Only after explicit confirmation, execute the review steps above inline without source edits, following the same standards and staging findings via `review_submit`; label the result foreground fallback. Otherwise verify the attached launch. Stop on failure; report the actual completed child outcome, not merely its queued ID or claim of success.
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
# complete
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Accept `complete [target] [--local|--approve|--reject|--abandon]`. Fuzzy-match target/backend/action from the request and repository. Prefer explicit arguments/flags, then safe inference, then current-review target; do not invent a remote action. Call `ask_user_question` only for material ambiguity before launch; return a precise blocker if a new decision arises later.
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. Call `review_context` first with the selected target/backend/local. For a short, explicitly approved completion with no substantive inspection, call `review_complete` directly using its resolved values: `local:true` archives only the matching local review and removes its tuicr session; a remote review needs an explicit `approve`, `reject`, or `abandon` action. Verify and report the actual result or exact failure. Do not publish pending comments, merge or resolve threads.
|
|
10
|
+
2. If substantive inspection or judgment is required, when native subagents are available, delegate only that analysis to medium `diffpi-orchestrator` in the background with ambient capabilities. Fill every field in this self-contained prompt with actual values (or `none`), including the exact request; never send raw placeholders:
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
Inspect completion readiness without changing review state.
|
|
14
|
+
- Repository: {absolute repo cwd}; exact request: {exact request}.
|
|
15
|
+
- Resolved target: {target}; backend: {backend}; local: {local}; issue URL: {issue URL or none}; approved remote action: {action or none for local}.
|
|
16
|
+
- Call review_context first; reuse its target/backend/local/cwd. Inspect only the matching review/session and report outstanding findings, status and material decisions. Do not switch backend.
|
|
17
|
+
- Return actual completed evidence and a go/no-go recommendation or precise blocker. Do not complete, publish, merge or resolve threads.
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
3. If no native subagents are available for step 2, follow [foreground fallback](foreground-fallback.md) before inspection; only after explicit confirmation inspect inline and report actual evidence without claiming an Orchestrator result. Otherwise require the completed result, not a queued job or claim. Resolve material decisions with the user before calling `review_complete` in the initiating thread if approval still applies.
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# edit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Parse arguments
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Accept `edit [target] [--local]`. Fuzzy-match the existing tuicr or PR/MR session from the request and repository. Prefer explicit arguments/flags, then safe inference, then the current-review target. Select local for an explicit working-tree request. Call `ask_user_question` only for material ambiguity.
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. Call `review_context` first with the selected target/backend/local; reuse its target/backend/local/cwd. Reject unsupported selections without switching backend.
|
|
10
|
+
2. Call `review_edit` with those values to open the existing local session or remote PR/MR in tuicr without generating findings. Keep remote-session draft comments associated with that PR/MR for later promotion at publish.
|
|
11
|
+
3. Report the opened session, returned launch command or exact missing-session/launch failure. Do not create, publish, complete, merge, resolve or generate findings.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Foreground fallback (review only)
|
|
2
|
+
|
|
3
|
+
Use this policy only when **no native subagents are available** for the required background `diffpi-worker`, `diffpi-reviewer`, or `diffpi-orchestrator` work. This is not a recovery path for a failed launch, child/tool error, unavailable result, authentication failure, failed checks, or a reviewer's BLOCKING findings. Do not substitute a shell process or claim a child launched or completed.
|
|
4
|
+
|
|
5
|
+
After `review_context` resolves the target/backend/local, but **before substantive creation, diff analysis, thread classification, source edits, or lifecycle-readiness inspection**, call `ask_user_question` in the initiating conversation. State that the named background agent is unavailable and that running the work here loses the intended model tier and agent isolation. Offer `Stop and report blocker` (no substantive work; report missing native agents) and `Run inline` (continue in this conversation without the intended model tier or isolation) as options; a custom response must clearly authorize inline work. Do not interpret a previous lifecycle approval or absence of a refusal as consent. If the user declines, the question tool is unavailable, or this is a background child unable to ask, stop and return a precise blocker to the initiating conversation. Never silently continue inline.
|
|
6
|
+
|
|
7
|
+
On explicit confirmation only, the calling agent performs the selected workflow's substantive steps inline, using the same resolved target/backend/local/cwd and the child prompt's constraints, tools, checks, and evidence requirements. For `address`, perform the needed source/test edits directly without inventing Worker results; keep `review_respond(resolve:false)` and user-owned thread resolution. For `publish`, `complete`, or `merge`, inline inspection is read-only; the lifecycle call remains in the initiating conversation only after its existing approval and readiness requirements are satisfied. Report actual inline actions and outcomes as **foreground fallback**, not as a completed child. The ordinary short, explicitly approved lifecycle calls, `status`, `open`, `edit`, and `help` do not need this fallback.
|