pi-cohort 6.1.1 → 7.0.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/CHANGELOG.md +23 -0
- package/README.md +2 -0
- package/package.json +1 -1
- package/prompts/handoff.md +54 -0
- package/prompts/investigate.md +60 -0
- package/skills/pi-cohort/SKILL.md +79 -733
- package/skills/pi-cohort/reference/config-fields.md +20 -6
- package/prompts/gather-context-and-clarify.md +0 -13
- package/prompts/parallel-cleanup.md +0 -59
- package/prompts/parallel-context-build.md +0 -55
- package/prompts/parallel-handoff-plan.md +0 -61
- package/prompts/parallel-review.md +0 -54
- package/prompts/review-loop.md +0 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [7.0.1] - 2026-09-17
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- `/handoff` records the run's linked worktree instead of the session cwd: the producer names it, the scout validates it against `git worktree list --porcelain` and snapshots it via `git -C`; a rejected candidate is surfaced under `## Open questions`; the `worktree:` field no longer misreports `yes` from a primary subdirectory. ([#17](https://github.com/jjuraszek/pi-cohort/issues/17))
|
|
8
|
+
|
|
9
|
+
## [7.0.0] - 2026-09-17
|
|
10
|
+
|
|
11
|
+
### Removed
|
|
12
|
+
|
|
13
|
+
- 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.
|
|
14
|
+
- Remaining `interview` references left from the pi-intercom removal.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `/investigate <request> [--out path]`: parallel read-only recon (`scout`, `reviewer`, `context-builder` on refs), premise check, questions with recommendations, optional verification wave.
|
|
19
|
+
- `/handoff [--out path]`: fixed-template brief for a fresh session; `doc/handoff-template.md` is the contract consumers parse.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- `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.
|
|
24
|
+
- `reference/config-fields.md` separates management `skills` from execution-time `skill`.
|
|
25
|
+
|
|
3
26
|
## [6.1.1] - 2026-09-17
|
|
4
27
|
|
|
5
28
|
### 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": "
|
|
3
|
+
"version": "7.0.1",
|
|
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,54 @@
|
|
|
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
|
+
## Run worktree
|
|
19
|
+
|
|
20
|
+
Before the snapshot dispatch, determine the run worktree from your own transcript and interpolate it into the scout task as `Run worktree: <abs path>` or `Run worktree: none`:
|
|
21
|
+
|
|
22
|
+
- A flow-level worktree the run created (any `git worktree add <path>` you ran, or a `Worktree ready at <path>` report from `/skill:using-git-worktrees`) or was told to work in (a resume brief's `worktree: yes <path>`, or a user instruction).
|
|
23
|
+
- Never inferred from the session cwd; a created or assigned worktree still qualifies when it happens to equal the cwd. Never a per-task worktree from `tasks[].worktree: true` or `worktree: true` dispatches - those are ephemeral.
|
|
24
|
+
- Two flow-level worktrees in the transcript: the candidate is the one most recently used by later work (a dispatch `cwd`, a `git -C <path>`, or a `cd <path>`); if that does not distinguish them, the most recent creation or assignment. The other goes into `## Open questions` as `Also seen: <path> - not recorded as the run worktree`.
|
|
25
|
+
- No flow-level worktree created or named: `Run worktree: none`.
|
|
26
|
+
|
|
27
|
+
After the scout returns, copy any `open-question:` line from `repo.md` into `## Open questions` without the `open-question:` prefix; it never appears in `## Repo state`.
|
|
28
|
+
|
|
29
|
+
## Repo snapshot
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
subagent({ async: false, context: "fresh", tasks: [
|
|
33
|
+
{ agent: "scout", cwd: "<cwd>", reads: false, output: "<DIR>/repo.md",
|
|
34
|
+
task: "Read-only; write only to your output path. Run worktree: <abs path|none>. Steps: (1) linked set: git worktree list --porcelain | awk '/^worktree /{print substr($0,10)}' - the first line is the primary checkout, the rest are the linked worktrees; a relative candidate resolves against the primary toplevel, not cwd. (2) candidate `none` or line absent -> target is cwd, go to (4). Otherwise if the candidate is relative, prefix it with the primary toplevel (first linked-set line) first; C=$(git -C <candidate> rev-parse --show-toplevel); valid when that succeeds and C equals one of the linked lines exactly (a line after the first; equality with the first, primary line is invalid); anything else (failure, not listed, the primary itself, prunable) is invalid -> target is cwd and emit the open-question line in (5). (3) valid -> target is $C and `worktree: yes $C`. (4) target cwd -> T=$(git rev-parse --show-toplevel); `worktree: yes $T` when $T equals one of the linked lines exactly (a line after the first; the first, primary line gives `worktree: no`), else `worktree: no`. (5) report each field on its own line, `unavailable` when a command fails, every git command as `git -C <target>`: toplevel (git -C <target> rev-parse --show-toplevel); the worktree line from (3) or (4); branch (git -C <target> 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 -C <target> status --porcelain, or `clean`); diff-stat (git -C <target> diff --stat <base>...HEAD; `diff-stat: unavailable` when base is unknown); test command (<target>/package.json scripts or <target>/AGENTS.md). Invalid candidate: after the fields add the single line `open-question: producer named <candidate as submitted> as the run worktree; it is not a linked worktree of this repo`. cwd not a git repo -> the single line `not a git repo`, plus the same open-question line if a candidate was submitted." }
|
|
35
|
+
]})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Process state
|
|
39
|
+
|
|
40
|
+
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.
|
|
41
|
+
|
|
42
|
+
## Brief
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
# Handoff: <one line>
|
|
46
|
+
## Intent
|
|
47
|
+
## Repo state (the snapshot fields; `## Repo state: not a git repo` when so)
|
|
48
|
+
## Decisions (bullets; rejected alternatives marked `rejected:`)
|
|
49
|
+
## Open questions
|
|
50
|
+
## 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)
|
|
51
|
+
## Process state (only per the rule above)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
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.
|