pi-cohort 6.1.1 → 7.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [7.0.0] - 2026-09-17
4
+
5
+ ### Removed
6
+
7
+ - Packaged prompts `/parallel-review`, `/review-loop`, `/parallel-cleanup`, `/gather-context-and-clarify`, `/parallel-context-build`, `/parallel-handoff-plan`. Review and delivery workflows live in pi-gauntlet.
8
+ - Remaining `interview` references left from the pi-intercom removal.
9
+
10
+ ### Added
11
+
12
+ - `/investigate <request> [--out path]`: parallel read-only recon (`scout`, `reviewer`, `context-builder` on refs), premise check, questions with recommendations, optional verification wave.
13
+ - `/handoff [--out path]`: fixed-template brief for a fresh session; `doc/handoff-template.md` is the contract consumers parse.
14
+
15
+ ### Changed
16
+
17
+ - `skills/pi-cohort/SKILL.md` covers only what the tool description and schema leave open (fresh vs fork, acceptance levels, per-task overrides, control actions); the prompt bodies, agent roster, and duplicated tool mechanics are gone.
18
+ - `reference/config-fields.md` separates management `skills` from execution-time `skill`.
19
+
3
20
  ## [6.1.1] - 2026-09-17
4
21
 
5
22
  ### Fixed
package/README.md CHANGED
@@ -117,6 +117,8 @@ Run parallel reviewers: one for correctness, one for tests, and one for unnecess
117
117
 
118
118
  That's the whole surface for day-to-day use. More phrasing patterns: [doc/commands.md](doc/commands.md#prompt-cookbook-appendix).
119
119
 
120
+ Review and delivery workflows live in pi-gauntlet; pi-cohort ships delegation primitives plus `/investigate` and `/handoff`.
121
+
120
122
  ## Architecture
121
123
 
122
124
  `subagent()` supports four dispatch shapes, all through the same tool:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-cohort",
3
- "version": "6.1.1",
3
+ "version": "7.0.0",
4
4
  "description": "Delegate Pi work to focused child agents: code review, scouting, implementation, parallel audits, saved chains, and background jobs.",
5
5
  "author": "Jacek Juraszek",
6
6
  "license": "MIT",
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: "Use when the context window is nearly full and the work must continue in a fresh session."
3
+ ---
4
+
5
+ Write a handoff brief for a fresh session. The template is the contract in `doc/handoff-template.md` of pi-cohort; section names are fixed.
6
+
7
+ Optional `--out <path>` (relative resolves against cwd):
8
+
9
+ $@
10
+
11
+ ## Rules
12
+
13
+ - `DIR=$(mktemp -d)`. The dispatch: `async: false` and `context: "fresh"` at the top level; `reads: false`; absolute `output` under `$DIR`. If it returns an async handle, a `forceTopLevelAsync` setting is active: stop and report it. Do not poll, relaunch, or continue.
14
+ - The child is read-only against the repository; its only write is its `output` file.
15
+ - You write `## Intent`, `## Decisions`, `## Open questions`, and `## Skills loaded` from your own transcript, before the call and after it returns. Do not fork a child for this: forking a near-full transcript is the cost this handoff avoids.
16
+ - Write nothing into the repository; the brief goes to `--out` or `$DIR/handoff.md`.
17
+
18
+ ## Repo snapshot
19
+
20
+ ```
21
+ subagent({ async: false, context: "fresh", tasks: [
22
+ { agent: "scout", cwd: "<cwd>", reads: false, output: "<DIR>/repo.md",
23
+ task: "Read-only; write only to your output path. Report each field on its own line, `unavailable` when a command fails: toplevel (git rev-parse --show-toplevel); `worktree: yes <path>` when git rev-parse --git-dir and --git-common-dir differ, else `worktree: no`; branch (git branch --show-current, `detached` when empty); HEAD SHA; base (origin/HEAD short name, else origin/main or origin/master if present, else `base: unknown`); dirty (git status --porcelain, or `clean`); diff-stat (git diff --stat <base>...HEAD; `diff-stat: unavailable` when base is unknown); test command (package.json scripts or AGENTS.md). Not a git repo -> the single line `not a git repo`." }
24
+ ]})
25
+ ```
26
+
27
+ ## Process state
28
+
29
+ Include `## Process state` only when both `phase_tracker` and `plan_tracker` tools exist AND `phase_tracker status` shows a phase `in_progress`. Then: `phase_tracker status` and `plan_tracker status` outputs verbatim; `Active task: <task name>` (the task you are working on; `none` when no plan is active or no task is active); the line `Gate history not restored - re-validate before advancing.`. Tools absent, all phases pending, or hotfix flow -> omit the section.
30
+
31
+ ## Brief
32
+
33
+ ```markdown
34
+ # Handoff: <one line>
35
+ ## Intent
36
+ ## Repo state (the snapshot fields; `## Repo state: not a git repo` when so)
37
+ ## Decisions (bullets; rejected alternatives marked `rejected:`)
38
+ ## Open questions
39
+ ## Skills loaded (frontmatter `name` of every skill whose SKILL.md body is in context - a `<skill>` block or a tool result on a `*/SKILL.md` path; `## Skills loaded: none` when there are none)
40
+ ## Process state (only per the rule above)
41
+ ```
42
+
43
+ Write it, print the path and the brief.
@@ -0,0 +1,60 @@
1
+ ---
2
+ description: "Use when a request's premises are unverified, the territory is unknown, or the user asks to look into something before planning or brainstorming."
3
+ ---
4
+
5
+ Investigate the request below with parallel read-only personas, then write a brief the user can paste into a fresh session or hand to brainstorming.
6
+
7
+ Request (text, or a path to a file holding it; optional trailing `--out <path>`):
8
+
9
+ $@
10
+
11
+ ## Rules
12
+
13
+ - Empty request -> stop and ask for it. A path that does not exist is request text.
14
+ - `DIR=$(mktemp -d)`. Every dispatch: `async: false` and `context: "fresh"` at the top level (never inside a task object); `cwd` = `git rev-parse --show-toplevel`; every task `reads: false` and an absolute `output` under `$DIR`. Interpolate shell variables into the call as absolute paths.
15
+ - If a dispatch returns an async handle, a `forceTopLevelAsync` setting is active: stop and report it. Do not poll, relaunch, or continue.
16
+ - Every child is read-only against the repository; its only write is its `output` file. Say so in every task text. `reads: false` is mandatory: persona `defaultReads` name chain files that do not exist here.
17
+ - Write nothing into the repository. The brief goes to `--out` if given (relative resolves against cwd), else `$DIR/brief.md`.
18
+ - A question whose answer is in code, docs, or the tracker is not asked; it is looked up in wave 1 or wave 2.
19
+ - A verification task that would run, build, or validate the proposed change is rejected at brief-writing time. Wave 2 exercises the system as it is today.
20
+
21
+ ## Wave 1
22
+
23
+ Detect refs in the request: `http(s)://` URLs; `owner/repo#N`; bare `#N` when `git remote get-url origin` is a GitHub URL; `[A-Z][A-Z0-9]+-\d+`.
24
+
25
+ One call, shape `subagent({ async: false, context: "fresh", tasks: [...] })`:
26
+
27
+ ```
28
+ subagent({ async: false, context: "fresh", tasks: [
29
+ { agent: "scout", cwd: "<root>", reads: false, output: "<DIR>/scout.md",
30
+ task: "Read-only recon; write only to your output path. Request: <request>. Map the territory: files with line ranges, patterns and conventions a change must match, test conventions, integration points, and whether the codebase or ecosystem already solves this. Cite paths." },
31
+ { agent: "reviewer", cwd: "<root>", reads: false, output: "<DIR>/premise.md",
32
+ task: "Read-only premise critique; do not edit any file, write only to your output path. Request: <request>. For each claim the request makes or assumes, classify: Confirmed (cite code), Contradicted (cite code), or Unverified (asserted, not shown). No design proposals." },
33
+ // only when refs were detected:
34
+ { agent: "context-builder", cwd: "<root>", reads: false, output: "<DIR>/external.md",
35
+ task: "Read-only; write only to your output path, context handoff only (no meta-prompt file). Request: <request>. Refs: <one per line>. For each: acceptance criteria, hard constraints, linked discussion that changes scope, contradictions with the request. A ref you cannot read -> `unreadable: <ref>` and continue." }
36
+ ]})
37
+ ```
38
+
39
+ A task that errored or left its output empty -> its section reads `<agent> failed: <reason>`. The brief is still written.
40
+
41
+ ## Brief
42
+
43
+ Read the outputs and write, section names fixed:
44
+
45
+ ```markdown
46
+ # Investigation: <slug>
47
+ ## Request
48
+ ## Findings (cited; `### Verified` appended after wave 2)
49
+ ## External context (only when context-builder ran; unreadable refs listed)
50
+ ## Premise check (Confirmed / Contradicted / Unverified - one line each, cited)
51
+ ## Open questions (numbered; each ends with `Recommendation: <answer> - <why>`)
52
+ ## Verification tasks (numbered; independent; each: one-paragraph read-only subagent task + `Expected:`; current behaviour only)
53
+ ## Next steps (suggestions only; no implementation task decomposition)
54
+ ```
55
+
56
+ Print the path and the brief.
57
+
58
+ ## Wave 2 (ask once)
59
+
60
+ Ask: "Run the verification tasks?" No -> stop. Yes -> one call `subagent({ async: false, context: "fresh", tasks })`, one task per verification task, `scout` by default or `reviewer` when judgement is needed, each task text containing the phrase "read-only", `reads: false`, absolute `output` under `$DIR`. Fold results into `## Findings` under `### Verified` and rewrite the brief at the same path.