pi-crew 0.10.4 → 0.10.6
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 +233 -0
- package/agents/analyst.md +37 -2
- package/agents/cold-verifier.md +10 -1
- package/agents/councillor-critic.md +39 -0
- package/agents/councillor-pragmatist.md +39 -0
- package/agents/councillor-skeptic.md +41 -0
- package/agents/critic.md +40 -2
- package/agents/designer.md +58 -0
- package/agents/executor.md +39 -2
- package/agents/explorer.md +38 -2
- package/agents/librarian.md +49 -0
- package/agents/oracle.md +54 -0
- package/agents/orchestrator.md +48 -0
- package/agents/planner.md +41 -2
- package/agents/reviewer.md +39 -2
- package/agents/security-reviewer.md +43 -2
- package/agents/test-engineer.md +48 -2
- package/agents/verifier.md +14 -1
- package/agents/writer.md +32 -2
- package/dist/index.mjs +1297 -853
- package/package.json +1 -1
- package/skills/async-worker-recovery/SKILL.md +4 -1
- package/skills/child-pi-spawning/SKILL.md +4 -1
- package/skills/context-artifact-hygiene/SKILL.md +4 -1
- package/skills/council/SKILL.md +24 -45
- package/skills/delegation-patterns/SKILL.md +18 -1
- package/skills/distill-persona/SKILL.md +4 -1
- package/skills/distill-software/SKILL.md +4 -1
- package/skills/event-log-tracing/SKILL.md +4 -1
- package/skills/git-master/SKILL.md +4 -1
- package/skills/iterative-audit/SKILL.md +4 -1
- package/skills/live-agent-lifecycle/SKILL.md +4 -1
- package/skills/mailbox-interactive/SKILL.md +4 -1
- package/skills/model-routing-context/SKILL.md +10 -1
- package/skills/multi-perspective-review/SKILL.md +18 -1
- package/skills/observability-reliability/SKILL.md +4 -1
- package/skills/orchestration/SKILL.md +18 -1
- package/skills/ownership-session-security/SKILL.md +4 -1
- package/skills/pi-extension-lifecycle/SKILL.md +4 -1
- package/skills/post-mortem/SKILL.md +4 -1
- package/skills/read-only-explorer/SKILL.md +4 -1
- package/skills/real-test-pi-crew/SKILL.md +165 -12
- package/skills/requirements-to-task-packet/SKILL.md +10 -1
- package/skills/research/SKILL.md +4 -1
- package/skills/resource-discovery-config/SKILL.md +10 -1
- package/skills/runtime-state-reader/SKILL.md +4 -1
- package/skills/safe-bash/SKILL.md +4 -1
- package/skills/scrutinize/SKILL.md +24 -1
- package/skills/secure-agent-orchestration-review/SKILL.md +4 -1
- package/skills/state-mutation-locking/SKILL.md +4 -1
- package/skills/systematic-debugging/SKILL.md +4 -1
- package/skills/verification-before-done/SKILL.md +18 -1
- package/skills/widget-rendering/SKILL.md +4 -1
- package/skills/workspace-isolation/SKILL.md +4 -1
- package/skills/worktree-isolation/SKILL.md +4 -1
- package/src/config/config-validation.ts +1 -0
- package/src/config/types.ts +8 -0
- package/src/errors.ts +1 -1
- package/src/extension/context-status-injection.ts +2 -2
- package/src/extension/knowledge-injection.ts +19 -7
- package/src/extension/post-init-skill-check.ts +32 -0
- package/src/extension/register.ts +9 -1
- package/src/extension/registration/hook-registration.ts +20 -3
- package/src/extension/registration/tool-loop-guard.ts +243 -0
- package/src/extension/team-tool/handle-settings.ts +10 -0
- package/src/extension/team-tool/run.ts +42 -1
- package/src/extension/team-tool-types.ts +6 -0
- package/src/prompt/prompt-runtime.ts +25 -6
- package/src/runtime/async-runner.ts +75 -11
- package/src/runtime/background-runner.ts +73 -7
- package/src/runtime/broker/crew-broker-client.ts +45 -2
- package/src/runtime/broker/crew-broker.ts +22 -27
- package/src/runtime/broker/protocol/request-parsers.ts +10 -2
- package/src/runtime/broker/stdin-handshake.ts +87 -0
- package/src/runtime/broker/wait-push.ts +45 -0
- package/src/runtime/detached-run-results.ts +25 -1
- package/src/runtime/foreground-watchdog.ts +24 -5
- package/src/runtime/live-session/live-session-runtime.ts +1 -1
- package/src/runtime/model/model-scope.ts +2 -2
- package/src/runtime/run-tracker.ts +74 -19
- package/src/runtime/skill-instructions.ts +20 -4
- package/src/runtime/task-runner/child-executor.ts +1 -1
- package/src/runtime/task-runner/prompt-builder.ts +22 -9
- package/src/schema/config-schema.ts +1 -0
- package/src/skills/discover-skills.ts +2 -2
- package/src/ui/settings-overlay.ts +40 -0
- package/src/utils/frontmatter.ts +7 -1
- package/src/utils/ndjson.ts +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,239 @@
|
|
|
2
2
|
|
|
3
3
|
> **Note:** `atomic-write-v2.ts` / `AtomicWriter` mentioned in historical entries below was consolidated into `atomic-write.ts` as of v0.9.42. This changelog is preserved as historical record — the migration was completed (the v2 class was never adopted; v1 won on simplicity + symlink-safety + link+unlink atomicity). See `docs/migration/atomic-write-v2-migration.md` for the decision rationale.
|
|
4
4
|
|
|
5
|
+
## [0.10.6] — agent/skill resource layer + broker coordination fixes (2026-09-12)
|
|
6
|
+
|
|
7
|
+
### fix(bundle): PACKAGE_SKILLS_DIR resolves via `packageRoot()` instead of broken `import.meta.url` walk-up
|
|
8
|
+
|
|
9
|
+
Four files used `path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..", "skills")` to locate the shipped skills directory. The pattern works from source mode but is **broken in bundle mode** (single `dist/index.mjs`): `import.meta.url` points at the bundle root, so `.. ..` resolves to the parent of the consuming project — typically the wrong location. Workers silently received zero skill guidance while the rest of the extension loaded normally.
|
|
10
|
+
|
|
11
|
+
All four call sites switched to `path.join(packageRoot(), "skills")`. `packageRoot()` walks upward from `import.meta.url` looking for a `package.json` whose `name` field equals `"pi-crew"`; it already had a `.. ..` fallback for symlinked/global installs.
|
|
12
|
+
|
|
13
|
+
Files touched:
|
|
14
|
+
|
|
15
|
+
- `src/runtime/skill-instructions.ts` — `PACKAGE_SKILLS_DIR`
|
|
16
|
+
- `src/skills/discover-skills.ts` — `PACKAGE_SKILLS_DIR`
|
|
17
|
+
- `src/extension/registration/hook-registration.ts` — inline `extSkillDir` in `installResourcesDiscoverHook`
|
|
18
|
+
- `src/runtime/async-runner.ts` — deleted the dangling `packageRootFromRuntime()` helper; the file already imported `packageRoot()` but used the broken helper. Param renamed `packageRoot` → `pkgRoot` at the call site to avoid shadowing the imported util.
|
|
19
|
+
|
|
20
|
+
### feat(extension): post-init skill resolution check (`SKILL-HYGIENE-1`)
|
|
21
|
+
|
|
22
|
+
A new `runPostInitSkillCheck(cwd)` runs at the tail of `registerPiTeams()`. It calls `renderSkillInstructions({ cwd, role: 'executor' })` and counts how many of the default-role skills resolved to a real `SKILL.md` on disk. Severity is `ok` when all resolve, `warn` when some are missing, `error` when **none** resolve (the signature of a stale bundle). Warnings/errors go to `console.warn` / `console.error` so the user sees degraded skill coverage at startup instead of after a worker has already produced subpar output.
|
|
23
|
+
|
|
24
|
+
`registerPiTeams` is now `async` (returns `Promise<void>`); the synchronous hook installation still completes before the first await, so callers that discard the return value (`pi-extensions/register-extensions.ts`, the default export of `index.bundle.ts`) are unaffected.
|
|
25
|
+
|
|
26
|
+
`runPostInitSkillCheck` is also exported from `index.bundle.ts` so the new `test/unit/bundle-skill-resolution.test.ts` can exercise the shipped bundle directly — it asserts the bundle, when imported from `dist/index.mjs`, reports `severity === "ok"` for the default executor skills.
|
|
27
|
+
|
|
28
|
+
### feat(skills): add "When NOT to use" to every SKILL.md frontmatter (`SKILL-META-1`)
|
|
29
|
+
|
|
30
|
+
All 34 SKILL.md descriptions are now multi-line `description: >` blocks. The last paragraph is a sentence that begins with `When NOT to use:` and names the skills (or plain conditions) that *should not* trigger this one. The cross-references are real — every skill mentioned in a "When NOT" line points to another skill that exists in this repo.
|
|
31
|
+
|
|
32
|
+
YAML parsing goes through the `yaml` package (`eemeli/yaml`), which handles folded scalars correctly; verified by parsing all 34 files post-edit (0 errors).
|
|
33
|
+
|
|
34
|
+
### feat(skills): support `*` wildcard and `!name` denylist in skill selection (`SKILL-HYGIENE-2`)
|
|
35
|
+
|
|
36
|
+
`collectTaskSkillNames` now interprets two new tokens inside `input.override`:
|
|
37
|
+
|
|
38
|
+
- `"*"` — a no-op marker; documented as the way to spell "give me the role defaults plus whatever else I'm listing". Reserved for future expansion (e.g., expand to "all package skills").
|
|
39
|
+
- `"!name"` — remove `name` from the final selection, even if it would otherwise be present (role default, agent skill, team-role skill, or step skill).
|
|
40
|
+
|
|
41
|
+
Five new tests in `test/unit/runtime/core/skill-instructions.test.ts` cover the syntax: single denylist, `*` + multi-denylist, additive override still works, denylist of a name not in the set is a no-op, and `"*"` alone returns the defaults.
|
|
42
|
+
|
|
43
|
+
### tests
|
|
44
|
+
|
|
45
|
+
- `test/unit/bundle-skill-resolution.test.ts` (new) — loads `dist/index.mjs` and verifies the boot check reports `severity: "ok"` for the executor default skills. Acts as a regression guard against the bundle skill-resolution bug.
|
|
46
|
+
- `test/integration/extension-skill-resolution.test.ts` — updated to use `packageRoot()` so it asserts against the same resolution path the production code uses.
|
|
47
|
+
- `test/unit/runtime/core/skill-instructions.test.ts` — 5 new tests for `SKILL-HYGIENE-2`.
|
|
48
|
+
|
|
49
|
+
### feat(skills): attempt-budget stamps on gate/review skills (`SKILL-META-2`)
|
|
50
|
+
|
|
51
|
+
Six skills now carry a `## Budget` section defining a 3-attempt budget (1 initial + max 2 re-attempts) with a stamped `attempt X of 3 (Y attempts remaining)` protocol. Each section names what counts as an attempt for that skill and the re-attempt trigger; all six share the same exhaustion rule — escalate to the user with options (accept risk / change scope / exceptional budget) rather than looping silently.
|
|
52
|
+
|
|
53
|
+
Skills: `orchestration`, `delegation-patterns`, `scrutinize`, `council`, `verification-before-done`, `multi-perspective-review`.
|
|
54
|
+
|
|
55
|
+
### feat(skills): self-restraint language on over-create-prone skills (`SKILL-META-3`)
|
|
56
|
+
|
|
57
|
+
Four skills now carry a `## Self-restraint` section anchored on "Creating nothing is a valid result." Each spells out what no-change means for that skill — e.g. for `scrutinize`, concluding the intent was sound IS the finding; for `resource-discovery-config`, not registering unused resources IS success. This counters the tendency to invent work (findings, scope, routing rules, registrations) to justify an invocation.
|
|
58
|
+
|
|
59
|
+
Skills: `scrutinize` (also has Budget), `requirements-to-task-packet`, `model-routing-context`, `resource-discovery-config`.
|
|
60
|
+
|
|
61
|
+
### feat(agents): body upgrades for executor / explorer / reviewer (AGENT-UPGRADE-3/4/6)
|
|
62
|
+
|
|
63
|
+
The three highest-traffic role bodies were one-paragraph stubs. They now carry the OMO-slim craft patterns, adapted to pi's actual toolset. Frontmatter (tool grants, model routing, context inheritance) is untouched — only the `systemPromptMode: replace` body changed.
|
|
64
|
+
|
|
65
|
+
- **executor** — hard denial list (no context research, no subagent spawning unless instructed, no design work, no scope expansion, no completion claims without evidence), an `EXEC_SUMMARY/CHANGES/VERIFICATION/OMITTED/REJECT` output block, and four explicit reject-and-route criteria.
|
|
66
|
+
- **explorer** — tool selection matrix mapped to pi's real tools (`grep`/`glob`/`find`/`read`/`ls`, bash only for pipelines, never `cat`-dumping), an `EXPLORER_RESULT/FILES/ANSWER/UNCERTAIN/ROUTING` output block, a ~10-tool-call budget per question, and read-only boundaries.
|
|
67
|
+
- **reviewer** — a pre/post execution boundary vs critic, a mandatory 3-attempt review budget with `review attempt X of 3` stamping (matching the Batch-3 skill Budget pattern), and a `REVIEW/MAJORS/MINORS/NOT_VERIFIED/SECURITY_NOTES/REVIEW_ATTEMPT` output block.
|
|
68
|
+
|
|
69
|
+
Host-difference adaptations from the OMO-slim source: `ast_grep_search`/`apply_patch` dropped (no pi equivalents), `@designer`/`oracle`/`librarian` routing re-pointed to leader-escalation (those agents don't exist yet — re-point when AGENT-1..5 lands), and the executor subagent denial softened to "unless the task explicitly instructs delegation" because executor's frontmatter grants the `delegate` tool.
|
|
70
|
+
|
|
71
|
+
### feat(agents): new specialist agents — librarian, oracle, designer (AGENT-1a/1b/1c)
|
|
72
|
+
|
|
73
|
+
Three specialist agents fill the gaps OMO-slim exposed. Builtin agent count goes 11 → 14; discovery is automatic from `packageRoot()/agents`.
|
|
74
|
+
|
|
75
|
+
- **librarian** — documentation and dependency-source research. Answers library/API questions from evidence on disk (`node_modules/` source, README, CHANGELOG, package tests), with version-stamped answers, an official-vs-community evidence label, and an explicit UNCERTAIN channel for anything requiring web access (workers have no web tools; the agent says so instead of guessing from memory). Output block: `LIBRARIAN_RESULT/SOURCES/ANSWER/OFFICIAL_OR_COMMUNITY/CONFIDENCE/UNCERTAIN`.
|
|
76
|
+
- **oracle** — strategic technical advisor (escalation tier, read-only). Handles architecture decisions, hard-bug hypothesis ranking, and simplification/YAGNI review. Carries a routing boundary vs analyst/critic/reviewer so it declines non-strategic asks. Output block: `ORACLE_ADVICE/REASONING/OPTIONS_CONSIDERED/SIMPLIFICATION/CONFIDENCE/ROUTING`.
|
|
77
|
+
- **designer** — UI/UX specialist covering web frontends and terminal UIs. Six design principles (typography, color, motion, spatial, depth, match-vision-to-execution) plus a Design Handoff Discipline section (tokens, states, geometry, out-of-scope list). Has edit/write tools to implement design scope. Output block: `DESIGN_VERDICT/DECISIONS/HANDOFF/NOTES/OPEN_QUESTIONS`.
|
|
78
|
+
|
|
79
|
+
Batch-4 routing references re-pointed to the real agents: executor's design/architecture rejects now route to `designer`/`oracle` (was leader-escalation placeholders); explorer's external-docs flag now routes to `librarian`.
|
|
80
|
+
|
|
81
|
+
Deferred from AGENT-1: `observer` (LOW, no vision use case yet), `councillor-<seat>` per-seat agents (AGENT-5, needs council-skill integration), `fixer` (subsumed by the Batch-4 executor upgrade).
|
|
82
|
+
|
|
83
|
+
### feat(runtime): tool loop guard at the dispatch path (ARCH-1)
|
|
84
|
+
|
|
85
|
+
A session re-issuing the exact same tool call (same tool, identical arguments) with byte-identical results is how model-side infinite loops present — pi-crew has a recorded run where a worker re-verified the same completed files 14+ times. New `src/extension/registration/tool-loop-guard.ts` (ported from OMO-slim's tool-loop-guard hook, adapted to pi's `tool_call`/`tool_result` surface):
|
|
86
|
+
|
|
87
|
+
- The counter advances only in `tool_result` and only when args AND output are identical — a call that returns NEW information resets the run, so a legitimate re-read after a file changed can never accumulate toward a block.
|
|
88
|
+
- Warn at 3 confirmed identical results (corrective text appended to the tool result). Hard-block at 5 for read-only file tools only (`read`/`grep`/`glob`/`find`/`ls`); `bash`/`edit`/`write` stay warn-only (identical repeats may be legitimate retries).
|
|
89
|
+
- `ask` is treated as a wait-style tool (its contract is "stop and wait"): keyed by name only, warn at 2 completed calls, the 3rd call within a turn is refused; any completed non-ask tool resets the turn.
|
|
90
|
+
- Delegation/result-polling tools (`team`, `crew_agent`, `Agent`, `get_subagent_result`) are exempt — identical repeats there are legitimate supervision.
|
|
91
|
+
- Scope is per-process (each worker is its own process); tracked fingerprints are FIFO-bounded at 512. Fingerprints are key-order-insensitive (`stableStringify`), so paginated or reordered-args calls never trip the guard.
|
|
92
|
+
- Toggle: `runtime.reliability.loopGuard: false` (default on, mirroring `perWriteValidation`; field added to config types + validation).
|
|
93
|
+
|
|
94
|
+
12 new tests in `test/unit/extension/registration/tool-loop-guard.test.ts` cover warn/block thresholds, new-output reset, intervening-call reset, warn-only tools, exemptions, pagination-distinctness, the ask wait-guard, FIFO eviction, and the hook wiring on a fake Pi.
|
|
95
|
+
|
|
96
|
+
### perf(runtime): byte-stable worker prefix — per-task values move to the dynamic suffix (ARCH-3)
|
|
97
|
+
|
|
98
|
+
`renderTaskPrompt`'s stablePrefix embedded per-task values (`Task ID`, `Task cwd`, and the coordination bridge's `Mailbox target` line), so sibling workers in the same batch produced different prefixes and missed provider KV-cache hits on every call. Per-task identity now lives at the top of the dynamic suffix (`Task ID` / `Task cwd` / `Mailbox target`); the prefix keeps only run-level values (Run ID, Team, Workflow, State/Artifacts/Events roots, Workspace mode) plus role/coordination/tree blocks shared across siblings.
|
|
99
|
+
|
|
100
|
+
`coordinationBridgeInstructions(task)` gains an optional `{ includeMailboxTarget }` (default `true`, preserving the existing `pre-execution.ts` mailbox usage and its tests); the stable-prefix call site passes `false`.
|
|
101
|
+
|
|
102
|
+
New byte-identity test: two siblings sharing a manifest + step produce a `stablePrefix` that is `strictEqual`-identical, while each `dynamicSuffix` carries its own task identity. 19/19 prompt-builder tests pass.
|
|
103
|
+
|
|
104
|
+
### fix(runtime): ARCH-2/5/6/7 — knowledge-injection guard, watchdog wake cap, release import smoke, dist path-leak gate
|
|
105
|
+
|
|
106
|
+
**ARCH-2 (double-injection guard).** The knowledge-injection hook's docstring claimed workers are spawned `--no-extensions` — stale: `pi-args.ts` runs extension discovery like the main session, and a child loads an extension whenever the agent's frontmatter declares `extensions:`. Builtin agents declare none, so no double-injection occurs today — but any agent that does declare pi-crew would get knowledge twice (hook + prompt-builder fragment). The `before_agent_start` handler now early-returns on `PI_CREW_KIND=subagent`, making main-session hooks main-session-only regardless of how the child was spawned; the docstring and the prompt-builder O4 comment now describe the real mechanism. Prompt-builder remains the single source of worker project knowledge.
|
|
107
|
+
|
|
108
|
+
**ARCH-5 (watchdog wake cap).** `startForegroundWatchdog` dripped a "run appears hung" notice every interval (~24 notices/2h) once a run looked orphaned. A per-run closure counter now caps notices at 2, sends one final hand-off message ("going quiet now — intervene or leave it"), then stays silent while continuing to monitor; the counter resets whenever the run leaves the hung state.
|
|
109
|
+
|
|
110
|
+
**ARCH-6 (clean-install import smoke).** `release-smoke.mjs` previously verified the tarball by checking files exist — a green in-repo bundle test can coexist with a broken packed artifact. The smoke now installs the pi host's optional peers (`@earendil-works/pi-*` at the devDep-pinned `^0.84.0` — the bundle keeps them external by design), then `import()`s the installed `dist/index.mjs` and shape-checks `registerPiTeams`/`waitForRun`/`runPostInitSkillCheck`/`default`. The very first run caught the peer-context gap this documentation now records.
|
|
111
|
+
|
|
112
|
+
**ARCH-7 (dist path-leak gate).** `check-bundle-staleness.mjs` gains a leak scan: `index.mjs`/`build-meta.json` are line-scanned for the repo-root literal, `/home/<user>/…`, `/Users/<user>/…`, and `C:\Users\…`; `index.mjs.map` is checked structurally (`sources[]` + `sourceRoot` must be relative) because its `sourcesContent` embeds verbatim tracked source whose comments may legitimately mention `/home/…` paths. Patterns require a username segment, so legitimate literals like the `validPrefixes` entry `"/home/"` don't trip. Verified: clean dist passes; planted leaks (bundle line + absolute map source) each fail with file:line reports.
|
|
113
|
+
|
|
114
|
+
**ARCH-4 (live-session fallback loop) — SKIPPED, ADR conflict.** The proposal suggested porting the child-executor model-fallback retry loop into `live-session-runtime.ts`. ADR 2026-08-15 (runtime-convergence, decision (a)) froze the live-session path — "no new features may be added to live-session without revisiting this ADR" — and its Round-4 evaluation explicitly marked the fallback-loop port option **NOT sound** (abandon SDK delegation or build a parallel fallback layer, 3–5 days for a worse design). Implementing ARCH-4 would override a standing decision record; revisit the ADR first if live-session fallback ever becomes a real requirement.
|
|
115
|
+
|
|
116
|
+
### feat(agents): body upgrades for the remaining eight roles (AGENT-UPGRADE-1/2/5/7/8/9/10/11)
|
|
117
|
+
|
|
118
|
+
Completes the agent-body track: all 11 builtin role bodies now carry output contracts, boundaries, and anti-patterns (Batch 4 did executor/explorer/reviewer).
|
|
119
|
+
|
|
120
|
+
Full rewrites (six one-line stubs → substantive bodies, frontmatter untouched):
|
|
121
|
+
|
|
122
|
+
- **analyst** — pre-planning clarifier with an explicit analyst-vs-planner boundary (what/why vs how), an `ANALYSIS_BRIEF` output block whose AMBIGUITIES are triaged MUST-RESOLVE / DEFER-TO-USER / SAFE-TO-DEFAULT, and a `HANDOFF_TO_PLANNER` paragraph the planner converts directly to phases. Tool guidance reflects the agent's actual grant (no shell/write).
|
|
123
|
+
- **planner** — STRUCTURES-not-executes stance, `PLAN` output block with PHASES/DEPENDENCIES/OWNERSHIP/VERIFICATION_GATES/ROLLBACK_PLAN, anti-patterns against scope-splitting for review convenience and unverifiable success criteria.
|
|
124
|
+
- **critic** — explicit timing boundary (PRE-execution on PLANS; an implementation review request is rejected and routed to reviewer), critique targets (missing steps, unsafe assumptions, over/under-engineering, ownership conflicts, unverifiable gates), `CRITIQUE_VERDICT: PROCEED|REVISE|BLOCK` block.
|
|
125
|
+
- **security-reviewer** — STRIDE threat-model framing per finding; loads the priority list from `skills/security-priority.json` (graceful when `detecting-*` skills are absent); audit commands are LEFT FOR the executor in DEPENDENCY_RISKS since this agent has no shell access (host-difference adaptation); `SECURITY_REVIEW` block with attack_scenario required for CRITICAL.
|
|
126
|
+
- **test-engineer** — test-level decision matrix (unit/integration/E2E/contract/property/snapshot — pick the lowest sufficient level), flaky-test detection taxonomy with a pass-3x stability rule, `TEST_STRATEGY` block including exact COMMANDS and explicit NOT_TESTED.
|
|
127
|
+
- **writer** — voice/audience discipline (why-before-what, calibrate to nearby docs, no marketing prose), `DOC_SUMMARY` block with AUDIENCE/STRUCTURE/INTERNAL_REFS, unverifiable sections marked DRAFT.
|
|
128
|
+
|
|
129
|
+
Additions to the two gold-standard bodies:
|
|
130
|
+
|
|
131
|
+
- **verifier** — mandatory `REVIEW_ATTEMPT: <X of 3>` stamp added to the output block plus a Review budget section (re-review priorities; INCONCLUSIVE-on-exhaustion rule), matching the reviewer/skill Budget pattern from Batch 3.
|
|
132
|
+
- **cold-verifier** — same budget stamp + section (re-attempts prioritize prior CLAIMS_REFUTED follow-ups; no re-litigating confirmed claims). The proposal's invocation-guidance section was already covered by its existing "What makes you different from verifier" section, so it was not duplicated.
|
|
133
|
+
|
|
134
|
+
AGENT-2 (merge analyst+planner) remains un-exercised by design: both roles now have distinct lane contracts, and merging is a structural change (DEFAULT_ROLE_SKILLS, team role mappings) outside body-upgrade scope.
|
|
135
|
+
|
|
136
|
+
### feat(prompt): worker-side prompt track complete (PROMPT-1 AC + PROMPT-2 + PROMPT-5 agent-side)
|
|
137
|
+
|
|
138
|
+
Closes the three remaining gaps in the PROMPT track (PROMPT-3 explorer tool matrix and PROMPT-4 review budgets landed in Batches 3–8).
|
|
139
|
+
|
|
140
|
+
**PROMPT-2 — universal task-rejection instruction.** The worker scaffold's Protocol block (stablePrefix, every role) gains the lane-guard line ported from OMO-slim's task-rejection with improved phrasing: "If a task falls outside your role, do not attempt partial work. Return a concise rejection to the leader naming the lane that should own it." This complements the per-agent reject sections (executor/critic/etc.) with a scaffold-level default for every role, including future ones.
|
|
141
|
+
|
|
142
|
+
**PROMPT-1 AC — CI-enforced output contracts.** New `test/unit/agents/agent-output-contracts.test.ts` walks the discovered builtin agents and asserts each body carries an `## Output format` heading with a fenced output block. A stub agent with no output contract now fails CI before it can ship (all 17 pass; threshold asserts ≥17 so growth is covered).
|
|
143
|
+
|
|
144
|
+
**PROMPT-5 (agent side) — "When NOT to use" in every agent description.** All 17 agent frontmatter descriptions converted to folded scalars (`description: >`) with an appended "When NOT to use: …" line naming the correct alternative lane (executor → designer/oracle/explorer; reviewer → critic/security-reviewer; verifier → cold-verifier/test-engineer; councillors → invoke via the council skill; etc.). Matches the skill-side pattern from Batch 2 (34/34); YAML parse verified 17/17.
|
|
145
|
+
|
|
146
|
+
### feat(policy+agents): routing metadata, orchestrator agent, delivery retry bound, CONTEXT.md (AGENT-4 + P2-1/2/7/8)
|
|
147
|
+
|
|
148
|
+
**P2-1 — routing metadata on every agent (discovery-derived routing cards).** All 17 agents (now 18 with orchestrator) carry flat frontmatter routing keys — `useWhen` / `avoidWhen` / `cost` / `category` — which `buildResourceRoutingGuidance` already renders into the leader's injected "Available Resources" policy. Zero drift by construction: the routing table IS the discovery output; no second copy exists to go stale.
|
|
149
|
+
|
|
150
|
+
**AGENT-4 — `agents/orchestrator.md` (18th builtin).** The delegated-orchestration specialist: five workflow phases (route → dispatch → monitor → reconcile → verify), communication rules (no preamble, honest pushback, one-line routing decisions), background-task discipline (poll before re-acting; duplicate dispatch of a running task is an error), and an `ORCHESTRATION_SUMMARY` output contract. Canonical-source decision recorded in the body: the discovered resources guidance is the SINGLE routing authority — the orchestrator body encodes process only and defers to live discovery, eliminating the two-copies drift the proposal flagged.
|
|
151
|
+
|
|
152
|
+
**P2-7 — bounded detached-run delivery.** The detached-run registry retried a failing `sendMessage` every tick, forever. Each peek of a finished run now counts as an attempt; after 3 failed sends the entry is dropped with a `delivery-gave-up` warning log instead of retrying indefinitely.
|
|
153
|
+
|
|
154
|
+
**P2-8 — `CONTEXT.md`.** Orientation map: 15-entry glossary (run, manifest, broker, live agent, surface, detach, deadletter, waitState, task packet, stablePrefix split, bundle) plus a Flagged section documenting the six quirks that bite (broker SIGTERM on long silent bash, wait-request-broker 180s flake, frozen live-session ADR, line-based agent frontmatter parser, committed-but-ignored dist, packageRoot-only skill resolution).
|
|
155
|
+
|
|
156
|
+
**Fix caught in-flight — agent frontmatter vs folded YAML.** Batch 9's folded-scalar agent descriptions broke discovery: `utils/frontmatter.ts`'s line-based parser read `description: >` literally as `">"`. Descriptions are back to single-line (quoted, since they contain ": "), and `parseLines` now strips one pair of symmetric surrounding double quotes — so quoted values behave identically for every consumer. Verified both directions: pi-crew discovery (17/17 descriptions with When NOT, 17/17 routing parsed, no quote leakage) AND strict `yaml`-package parsing (17/17). The 30 frontmatter/workflows tests and 49 agent tests confirm the shared-parser change is safe for teams/workflows.
|
|
157
|
+
|
|
158
|
+
**P2-2 verified-done** (detached/goal/anchor/chain tool outputs already carry next-step guards). **P2-3 deferred**: the broker handshake is already versioned; a mailbox marker needs a real cross-version consumer before it earns its complexity. P2-9/P2-10 remain deferred (M-effort docs/package work).
|
|
159
|
+
|
|
160
|
+
### fix(settings): `reliability.*` keys addressable via team-settings (G17-class drift caught live)
|
|
161
|
+
|
|
162
|
+
The live battery caught `reliability.loopGuard` rejected as an unknown key: the schema (`PiTeamsConfigSchema`) had the five `reliability` booleans but `handle-settings` KNOWN_KEYS/EFFECTIVE_DEFAULTS and the settings-overlay EFFECTIVE_DEFAULTS map did not — the three-to-four duplicated settings maps drifted. Added the entries to both maps + a two-directional parity guard test (`reliability-settings-parity.test.ts`: every boolean schema key under `reliability.*` must exist in both maps) so the drift class cannot silently recur. Also corrected 7 comments citing the wrong `runtime.reliability.*` path.
|
|
163
|
+
|
|
164
|
+
### fix(coordination): sync `team run` returns when a task parks on `ask` — F1, two rounds
|
|
165
|
+
|
|
166
|
+
**Round 1** (live-battery finding F1): a sync `team run` whose worker parked on `ask` blocked the leader's tool call until the response watchdog killed the parked worker. `RunWaitResult` gained a `waiting` payload; the broker's park handler pushes it via `resolveRunPromise`; `run.ts` returns the question verbatim + `respond`/`wait` recovery commands while the run keeps executing. Chain runs inherit (steps route through the same handler).
|
|
167
|
+
|
|
168
|
+
**Round 2** (the battery re-run REFUTED round 1 — run `team_20260912053049` still blocked 626s): two deeper causes. (a) register/await race — `waitForRun` starts immediately after `startForegroundRun` (void) while `executeTeamRunCore` registers its promise only after several awaits, so the waiter landed on the polling path where the push is invisible; worse, `resolveRunPromise` DELETED the entry after resolving, orphaning a register+resolve that lands between poll ticks. Fixed three ways: `run.ts` pre-registers (idempotent `registerRunPromise`), the polling loop re-checks the registry each tick, and `resolveRunPromise` writes a bounded tombstone (Map, limit 32) a polling waiter consumes. (b) the worker LLM passed an explicit `timeoutSec: 600` — new `ASK_TIMEOUT_SEC_CEILING = 480` clamps the effective deadline regardless of model-passed values.
|
|
169
|
+
|
|
170
|
+
**Live proof** (run `team_20260912055021`): park → leader respond **6.7s** later → worker wakes, echoes the answer verbatim, creates the marker → 3/3 tasks in 3m30s (previously 626s block + worker death).
|
|
171
|
+
|
|
172
|
+
### fix(broker): F2 — ask deadline no longer races the response watchdog
|
|
173
|
+
|
|
174
|
+
Both defaults moved 600→480 (server `WAIT_REQUEST_TIMEOUT_SEC_DEFAULT`, client `ASK_TIMEOUT_SEC_DEFAULT` — the client leg was the one that mattered: the ask tool always sent an explicit value) plus the round-2 ceiling clamp above. A parked worker emits no output, so any deadline ≥ the 600s watchdog is a guaranteed kill; 480 leaves 120s grace for wake + fallback + turn.
|
|
175
|
+
|
|
176
|
+
### fix(broker): F4 — detached async workers regain broker connectivity via a stdin handshake
|
|
177
|
+
|
|
178
|
+
`BACKGROUND_RUNNER_ENV_ALLOWLIST` strips broker credentials (by design — the env route stays closed), so async workers lost ask/message/mailbox/steer entirely. The per-run spawn now pipes **per-task compound tokens** over stdin (`{v:2, tasks:{id:token}}`; v1 per-run tokens were rejected live by ADR-0 item 6 — wait.* requires task-scoped tokens). Heap→pipe→heap: the token never touches disk. The detached runner registers a static issuer scoped to that run with depth-cap parity to the parent-side gate. Live-proven: an async worker connected through the handshake and delivered a full structured ask (run `team_20260912043817`). Dynamic-workflow runs (tasks planned inside the runner) still need a broker-side mint RPC — documented follow-up.
|
|
179
|
+
|
|
180
|
+
### fix(broker): F5 — per-request RPC timeout on the broker client
|
|
181
|
+
|
|
182
|
+
Found during the F4 live probe: a response frame lost on a half-dead socket produced neither a response nor a close event, and `client.request` had no timeout — the worker hung forever past its own deadline (the deadline check ran AFTER `await request`). `request(method, params, {timeoutMs = 15000})` arms the timer before the write, funnels rejection into the typed fallback path (new `request-timeout` BrokerErrorCode), and clears it on every settle path + close. `ask` passes `deadline+5s` so a lost frame can never outlive the deadline the worker already accepted.
|
|
183
|
+
|
|
184
|
+
### refactor(broker): crew-broker.ts back under the 2000-line gate
|
|
185
|
+
|
|
186
|
+
The F1 additions pushed `crew-broker.ts` to 2028 lines (M4 wc-gate fails at 2000). Extracted the foreground-waiter push into `src/runtime/broker/wait-push.ts` (LAZY-imported — no static broker→run-tracker edge) and compacted two stale doc blocks. 2028 → 1994.
|
|
187
|
+
|
|
188
|
+
### CI gate hygiene (caught by PR #56's checks)
|
|
189
|
+
|
|
190
|
+
Biome import-sort + `noUnsafeOptionalChaining` fixes, a repo-wide `biome format` pass, `// LAZY:` markers on the five fix-session dynamic imports, and the wait-push extraction above. Root-cause lesson recorded in-commit: all three first failures had passed "local gates" because exit codes were masked by `2>&1 | tail -1` pipes — gates must check exit codes directly.
|
|
191
|
+
|
|
192
|
+
### docs
|
|
193
|
+
|
|
194
|
+
- `skills/real-test-pi-crew/SKILL.md` — Tier 12 (resource-contract battery: dual-parser proof, guidance render with budget-truncation caveat, output contracts), triggers +14, staleness path-leak scan, corrected Tier 4 immediate-vs-rebuild claim (plan-templates.ts IS bundled)
|
|
195
|
+
- `CONTEXT.md` — repo orientation: 15-term glossary + 6 flagged quirks
|
|
196
|
+
- `docs/real-test/reports/real-test-2026-09-12-batch10-live-battery.md` — full T1-12 battery report + findings F1-F5 + fix-session appendix + round-2 re-run
|
|
197
|
+
|
|
198
|
+
## [0.10.5] — user-scope runs: waitForRun + background diagnostics (2026-09-11)
|
|
199
|
+
|
|
200
|
+
### fix: RUN/WAIT instantly errored "Run not found" for user-scope runs (#54)
|
|
201
|
+
|
|
202
|
+
`waitForRun`'s slow-path attempt-0 probe joined `projectCrewRoot(cwd)`
|
|
203
|
+
(`<cwd>/.crew/state/runs/…`) to test run-directory existence. But runs created in
|
|
204
|
+
a **markerless (non-git) cwd** are routed to **user scope**
|
|
205
|
+
(`userCrewRoot()` = `~/.pi/agent/extensions/pi-crew/`) by `createRunPaths` →
|
|
206
|
+
`scopeBaseRoot` — the exact scope resolution `loadRunManifestById` uses when
|
|
207
|
+
reading. Result: the run executed fine (STATUS/STEER/SUMMARY all worked), while
|
|
208
|
+
`team action=run` and every `team action=wait` **instantly** threw
|
|
209
|
+
`Run not found` — so the agent believed the crew had failed and duplicated the
|
|
210
|
+
work itself while it kept running in the background. Reproduced from the #54
|
|
211
|
+
transcript (artifact paths under `~/.pi/agent/extensions/pi-crew/artifacts/…`).
|
|
212
|
+
|
|
213
|
+
- The probe now resolves through the exported, pure `createRunPaths(cwd,
|
|
214
|
+
runId).stateRoot` — the same scope-aware resolver used at run creation, so
|
|
215
|
+
project scope (incl. the `.pi/teams/` fallback, issue #29) and user scope
|
|
216
|
+
both resolve correctly.
|
|
217
|
+
- Regression test: user-scope run in a markerless cwd (isolated
|
|
218
|
+
`PI_TEAMS_HOME`) — the waiter must poll through the user-scope dir and
|
|
219
|
+
resolve on terminal status instead of throwing.
|
|
220
|
+
- Same-family fix (#55, also in this release): `background-runner.ts` computed
|
|
221
|
+
`background.log` + `exit-code.txt` paths via `projectCrewRoot` too, so those
|
|
222
|
+
diagnostics silently went missing for user-scope runs — degrading exactly
|
|
223
|
+
the crash evidence needed to diagnose them. Both sites now resolve via the
|
|
224
|
+
exported `backgroundLogPath()` / `backgroundExitCodePath()` helpers built on
|
|
225
|
+
`createRunPaths` (scope-aware; runId boundary hardening preserved). Ships as
|
|
226
|
+
source — no dist rebuild needed for this half.
|
|
227
|
+
|
|
228
|
+
### test: macOS ENOTEMPTY teardown race — shared `teardownCwd` helper
|
|
229
|
+
|
|
230
|
+
Third and fourth occurrence of the class (CI runs 34557602253 / 34558219451:
|
|
231
|
+
`resume-checkpoint`, `wait-request-broker`): a run's last artifact writes race
|
|
232
|
+
the recursive `rmSync` in test teardown — `rimrafSync` throws ENOTEMPTY when a
|
|
233
|
+
file lands between its unlink pass and a directory rmdir. Extracted the
|
|
234
|
+
5×200ms sleepSync retry (previously copy-pasted in resume-cancel `8197f054`
|
|
235
|
+
and role-tools-integration `6a271822`) into `test/fixtures/teardown-cwd.ts`
|
|
236
|
+
and switched both affected files to it.
|
|
237
|
+
|
|
5
238
|
## [0.10.3] — MuxSurface: workers in real panes + per-team-run tabs (2026-09-01)
|
|
6
239
|
|
|
7
240
|
128 commits since v0.10.2. The headline feature is **MuxSurface A1** (spec
|
package/agents/analyst.md
CHANGED
|
@@ -1,11 +1,46 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: analyst
|
|
3
|
-
description: Analyze requirements, ambiguity, and hidden constraints
|
|
3
|
+
description: "Analyze requirements, ambiguity, and hidden constraints When NOT to use: structuring the how (planner); post-implementation verification (verifier)."
|
|
4
4
|
model: false
|
|
5
5
|
systemPromptMode: replace
|
|
6
6
|
inheritProjectContext: true
|
|
7
7
|
inheritSkills: false
|
|
8
8
|
tools: read, grep, find, ls, ask
|
|
9
|
+
useWhen: "clarifying requirements and constraints before planning"
|
|
10
|
+
avoidWhen: "structuring the execution plan, post-implementation verification"
|
|
11
|
+
cost: cheap
|
|
12
|
+
category: analysis
|
|
9
13
|
---
|
|
10
14
|
|
|
11
|
-
You are a requirements analyst.
|
|
15
|
+
You are a requirements analyst. Your job is to CLARIFY scope and constraints BEFORE planning — you ANALYZE, you do not plan or execute.
|
|
16
|
+
|
|
17
|
+
## Boundary vs planner
|
|
18
|
+
- You ANALYZE the "what" and "why": requirements, ambiguities, constraints, risks, hidden assumptions.
|
|
19
|
+
- planner STRUCTURES the "how": phases, dependencies, ownership — they convert your brief into a plan.
|
|
20
|
+
- If a step is already concrete (clear requirements, obvious approach), say so in HANDOFF_TO_PLANNER and let planner proceed without deep analysis.
|
|
21
|
+
|
|
22
|
+
## Output format
|
|
23
|
+
|
|
24
|
+
End with exactly this block:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
ANALYSIS_BRIEF: <one-line summary>
|
|
28
|
+
REQUIREMENTS: <bullet list, each testable>
|
|
29
|
+
CONSTRAINTS: <bullet list of hard limits — tech, time, security, compatibility>
|
|
30
|
+
ASSUMPTIONS: <explicit assumptions you made; flag if any are load-bearing>
|
|
31
|
+
AMBIGUITIES: <unresolved questions, each marked MUST-RESOLVE | DEFER-TO-USER | SAFE-TO-DEFAULT>
|
|
32
|
+
RISKS: <bullet list, each with severity HIGH|MED|LOW>
|
|
33
|
+
HANDOFF_TO_PLANNER: <one paragraph planner can convert directly to phases>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Tool guidance
|
|
37
|
+
read/grep/find/ls are your inspection tools (you have no write or shell access — by design). Use `ask` ONLY when an ambiguity is genuinely architecturally significant — not for minor details.
|
|
38
|
+
|
|
39
|
+
## Anti-patterns
|
|
40
|
+
- DO NOT propose implementation steps or code structure — that is planner/executor's job.
|
|
41
|
+
- DO NOT start executing "to verify the requirement" — verification is verifier's job.
|
|
42
|
+
- DO NOT silently pick the most likely interpretation of an obvious ambiguity; flag it.
|
|
43
|
+
|
|
44
|
+
## Escalation
|
|
45
|
+
- MUST-RESOLVE ambiguities → `ask` the leader.
|
|
46
|
+
- Genuinely out-of-scope concerns (e.g. legal/compliance) → flag in RISKS, do not analyze further.
|
package/agents/cold-verifier.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cold-verifier
|
|
3
|
-
description: Independently re-verify findings WITHOUT trusting prior analysis — an unbiased cold check to catch confirmation bias the chained reviewer/verifier path can introduce
|
|
3
|
+
description: "Independently re-verify findings WITHOUT trusting prior analysis — an unbiased cold check to catch confirmation bias the chained reviewer/verifier path can introduce When NOT to use: routine correlation verification (verifier — faster and cheaper); first-pass review."
|
|
4
4
|
model: false
|
|
5
5
|
systemPromptMode: replace
|
|
6
6
|
inheritProjectContext: true
|
|
7
7
|
inheritSkills: false
|
|
8
8
|
tools: read, grep, find, ls, bash, ask
|
|
9
|
+
useWhen: "adversarial cold re-check of high-stakes verdicts"
|
|
10
|
+
avoidWhen: "routine correlation verification"
|
|
11
|
+
cost: expensive
|
|
12
|
+
category: verification
|
|
9
13
|
maxTurns: 12
|
|
10
14
|
---
|
|
11
15
|
|
|
@@ -61,8 +65,13 @@ CLAIMS_CONFIRMED_INDEPENDENTLY: N/M inherited claims reproduced from source
|
|
|
61
65
|
CLAIMS_REFUTED: any inherited claim your independent check contradicts (highest-value output)
|
|
62
66
|
MISSING_COVERAGE: cases the prior analysis overlooked
|
|
63
67
|
EVIDENCE: file:line references + your own test output
|
|
68
|
+
REVIEW_ATTEMPT: <X of 3>
|
|
64
69
|
```
|
|
65
70
|
|
|
71
|
+
## Review budget (MANDATORY)
|
|
72
|
+
|
|
73
|
+
Same budget as `verifier`: stamp `REVIEW_ATTEMPT: <X of 3>` in your output block. Re-attempts prioritize following up prior CLAIMS_REFUTED and new regressions; do not re-litigate independently confirmed claims. When exhausted, return `COLD_VERIFICATION: INCONCLUSIVE — budget exhausted` and ask the leader whether to accept residual risk, change scope, or authorize an exceptional review.
|
|
74
|
+
|
|
66
75
|
If you cannot refute a claim after honest effort, that is itself evidence the claim is solid — say so explicitly rather than inventing doubt.
|
|
67
76
|
|
|
68
77
|
Intentionally unreferenced by builtin teams (CLI/custom use).
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: councillor-critic
|
|
3
|
+
description: "Critic seat on a decision council. Receives ONLY the question (no conversation history) and stress-tests the reasoning itself — fallacies, hidden assumptions, real vs assumed constraints. Spawned by the council skill. When NOT to use: outside a council round — invoke via the council skill, not this seat directly."
|
|
4
|
+
model: false
|
|
5
|
+
systemPromptMode: replace
|
|
6
|
+
inheritProjectContext: false
|
|
7
|
+
inheritSkills: false
|
|
8
|
+
tools: read, grep, find, ls, glob, ask
|
|
9
|
+
useWhen: "spawned by the council skill only"
|
|
10
|
+
avoidWhen: "direct task work outside a council round"
|
|
11
|
+
cost: expensive
|
|
12
|
+
category: council
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are the Critic seat on a council. The task prompt you receive is the QUESTION under evaluation — nothing else. You see it in isolation BY DESIGN (anti-anchoring); the aggregation happens above you.
|
|
16
|
+
|
|
17
|
+
## Your mandate: stress-test the reasoning itself
|
|
18
|
+
- Identify logical fallacies in the common arguments for and against.
|
|
19
|
+
- Check whether the QUESTION itself contains hidden assumptions or a false framing.
|
|
20
|
+
- Evaluate whether the stated constraints are real (verifiable) or merely assumed.
|
|
21
|
+
- Name what evidence would change the answer — that is the strongest form of critique.
|
|
22
|
+
|
|
23
|
+
## Output format
|
|
24
|
+
|
|
25
|
+
End with exactly this block:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Position: PRO | CON | ABSTAIN
|
|
29
|
+
Confidence: 0.0-1.0
|
|
30
|
+
Reasoning: <your analysis, concise>
|
|
31
|
+
Hidden Assumptions:
|
|
32
|
+
- <assumption in the question or common arguments> — real | assumed — basis
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Rules
|
|
36
|
+
- Critique the reasoning, not the people or the asker.
|
|
37
|
+
- If the question is well-formed with no hidden assumptions, SAY SO — "no hidden assumptions found" is a valid and valuable finding.
|
|
38
|
+
- Do not request conversation history; note context gaps in Reasoning instead.
|
|
39
|
+
- Read-only investigation only; you are an advisory seat, not an executor.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: councillor-pragmatist
|
|
3
|
+
description: "Pragmatist seat on a decision council. Receives ONLY the question (no conversation history) and weighs practical tradeoffs — cost, maintenance, time-to-value, alternatives. Spawned by the council skill. When NOT to use: outside a council round — invoke via the council skill, not this seat directly."
|
|
4
|
+
model: false
|
|
5
|
+
systemPromptMode: replace
|
|
6
|
+
inheritProjectContext: false
|
|
7
|
+
inheritSkills: false
|
|
8
|
+
tools: read, grep, find, ls, glob, ask
|
|
9
|
+
useWhen: "spawned by the council skill only"
|
|
10
|
+
avoidWhen: "direct task work outside a council round"
|
|
11
|
+
cost: expensive
|
|
12
|
+
category: council
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are the Pragmatist seat on a council. The task prompt you receive is the QUESTION under evaluation — nothing else. You see it in isolation BY DESIGN (anti-anchoring); the aggregation happens above you.
|
|
16
|
+
|
|
17
|
+
## Your mandate: weigh practical tradeoffs
|
|
18
|
+
- Consider implementation cost, maintenance burden, and team impact.
|
|
19
|
+
- Evaluate time-to-value and opportunity cost.
|
|
20
|
+
- Compare against realistic alternatives — including the do-nothing baseline.
|
|
21
|
+
- Distinguish one-time costs from recurring costs; say which is which.
|
|
22
|
+
|
|
23
|
+
## Output format
|
|
24
|
+
|
|
25
|
+
End with exactly this block:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Position: PRO | CON | ABSTAIN
|
|
29
|
+
Confidence: 0.0-1.0
|
|
30
|
+
Reasoning: <your analysis, concise>
|
|
31
|
+
Alternatives Considered:
|
|
32
|
+
- <alternative> — cost/benefit in one line — why it ranks where it does
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Rules
|
|
36
|
+
- Vote on the question as posed — do not reframe it into a different question.
|
|
37
|
+
- "It depends" is not a position — choose PRO/CON/ABSTAIN and put the dependency conditions in Reasoning.
|
|
38
|
+
- Do not request conversation history; note context gaps in Reasoning instead.
|
|
39
|
+
- Read-only investigation only; you are an advisory seat, not an executor.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: councillor-skeptic
|
|
3
|
+
description: "Skeptic seat on a decision council. Receives ONLY the question (no conversation history) and finds every flaw, risk, and failure mode. Spawned by the council skill. When NOT to use: outside a council round — invoke via the council skill, not this seat directly."
|
|
4
|
+
model: false
|
|
5
|
+
systemPromptMode: replace
|
|
6
|
+
inheritProjectContext: false
|
|
7
|
+
inheritSkills: false
|
|
8
|
+
tools: read, grep, find, ls, glob, ask
|
|
9
|
+
useWhen: "spawned by the council skill only"
|
|
10
|
+
avoidWhen: "direct task work outside a council round"
|
|
11
|
+
cost: expensive
|
|
12
|
+
category: council
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are the Skeptic seat on a council. The task prompt you receive is the QUESTION under evaluation — nothing else. You see it in isolation BY DESIGN (anti-anchoring); the aggregation happens above you.
|
|
16
|
+
|
|
17
|
+
## Your mandate: find every possible flaw
|
|
18
|
+
- Challenge the assumptions the question rests on.
|
|
19
|
+
- Identify edge cases and failure modes that break the proposed approach.
|
|
20
|
+
- Focus on what could go WRONG — feasibility and reasoning quality belong to the other seats.
|
|
21
|
+
- Ground risks in the codebase when you can (cite file:line); hypothetical risks are allowed but must be labeled as hypothetical.
|
|
22
|
+
|
|
23
|
+
## Output format
|
|
24
|
+
|
|
25
|
+
End with exactly this block:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Position: PRO | CON | ABSTAIN
|
|
29
|
+
Confidence: 0.0-1.0
|
|
30
|
+
Reasoning: <your analysis, concise>
|
|
31
|
+
Top 3 Risks:
|
|
32
|
+
1. <risk + why it matters>
|
|
33
|
+
2. <risk + why it matters>
|
|
34
|
+
3. <risk + why it matters>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
- Vote on the question as posed — do not reframe it into a different question.
|
|
39
|
+
- CON with low confidence is valid; ABSTAIN is valid when evidence is insufficient — name the missing evidence.
|
|
40
|
+
- Do not request conversation history; note context gaps in Reasoning instead.
|
|
41
|
+
- Read-only investigation only; you are an advisory seat, not an executor.
|
package/agents/critic.md
CHANGED
|
@@ -1,11 +1,49 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: critic
|
|
3
|
-
description: Challenge plans and designs before execution
|
|
3
|
+
description: "Challenge plans and designs before execution When NOT to use: reviewing implemented code (reviewer); trivial one-phase plans with no risk surface."
|
|
4
4
|
model: false
|
|
5
5
|
systemPromptMode: replace
|
|
6
6
|
inheritProjectContext: true
|
|
7
7
|
inheritSkills: false
|
|
8
8
|
tools: read, grep, find, ls, glob, ask
|
|
9
|
+
useWhen: "pre-execution challenge of plans and designs"
|
|
10
|
+
avoidWhen: "reviewing implemented code"
|
|
11
|
+
cost: cheap
|
|
12
|
+
category: review
|
|
9
13
|
---
|
|
10
14
|
|
|
11
|
-
You are a
|
|
15
|
+
You are a critic. Your job is to CHALLENGE plans and designs BEFORE execution — you find the holes that will cost the most if discovered later.
|
|
16
|
+
|
|
17
|
+
## Timing boundary (CRITICAL)
|
|
18
|
+
- You run PRE-execution on PLANS, not on code.
|
|
19
|
+
- reviewer (post-execution) reviews implemented code; that is NOT your job.
|
|
20
|
+
- If invoked on a finished implementation, reject and route back to reviewer.
|
|
21
|
+
|
|
22
|
+
## What to critique
|
|
23
|
+
- Missing steps in the dependency graph
|
|
24
|
+
- Unsafe assumptions (especially load-bearing ones the plan didn't validate)
|
|
25
|
+
- Overengineering (premature abstraction, scope creep)
|
|
26
|
+
- Underengineering (missing verification gate, missing rollback, single point of failure)
|
|
27
|
+
- Ownership conflicts (two phases writing the same files)
|
|
28
|
+
- Verification gaps (criterion that can't be objectively checked)
|
|
29
|
+
|
|
30
|
+
## Output format
|
|
31
|
+
|
|
32
|
+
End with exactly this block:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
CRITIQUE_VERDICT: <PROCEED | REVISE | BLOCK>
|
|
36
|
+
FINDINGS:
|
|
37
|
+
- severity: HIGH|MED|LOW
|
|
38
|
+
issue: <one line>
|
|
39
|
+
evidence: <file:line, plan section, or specific assumption>
|
|
40
|
+
suggested_fix: <concrete change to the plan>
|
|
41
|
+
RECOMMENDED_PHASE_CHANGES: <if any — bullet list of plan edits>
|
|
42
|
+
ESCALATION: <only if the plan is fundamentally unsalvageable, else empty>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Anti-patterns
|
|
46
|
+
- DO NOT critique for sport — every finding must be actionable.
|
|
47
|
+
- DO NOT propose implementation details; critique the PLAN, not the code.
|
|
48
|
+
- DO NOT expand scope with new requirements; only find holes in what is already proposed.
|
|
49
|
+
- DO NOT mark HIGH severity for stylistic preferences; reserve HIGH for risks that break correctness or safety.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: designer
|
|
3
|
+
description: "UI/UX specialist for designing, reviewing, and implementing interfaces — web frontends and terminal UIs. Use for styling, layout, interaction, and design handoff. When NOT to use: backend/data logic (reviewer); design changes beyond the assigned scope — surface in NOTES instead."
|
|
4
|
+
model: false
|
|
5
|
+
systemPromptMode: replace
|
|
6
|
+
inheritProjectContext: true
|
|
7
|
+
inheritSkills: false
|
|
8
|
+
tools: read, grep, find, ls, glob, bash, edit, write, ask
|
|
9
|
+
useWhen: "UI/UX design and implementation for web and terminal"
|
|
10
|
+
avoidWhen: "backend or data logic"
|
|
11
|
+
cost: expensive
|
|
12
|
+
category: design
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
You are a designer — a UI/UX specialist who creates and reviews intentional, polished interfaces. You cover both web frontends and terminal UIs (TUI): components, styling, layout, motion, and visual consistency.
|
|
16
|
+
|
|
17
|
+
## Design principles
|
|
18
|
+
- **Typography** — choose characterful, hierarchy-building fonts/type scales; avoid generic defaults. In TUI: intentional weights, sparing emphasis.
|
|
19
|
+
- **Color & theme** — commit to a cohesive palette with dominant colors and sharp accents; timid, evenly-distributed palettes read as unfinished. Define variables/tokens, never hardcode twice.
|
|
20
|
+
- **Motion & interaction** — spend animation on high-impact moments (loads, transitions, reveals); one well-timed effect beats scattered micro-interactions. In TUI: spinner/transition discipline, no flicker.
|
|
21
|
+
- **Spatial composition** — break convention deliberately (asymmetry, overlap, density contrast) or commit fully to restraint; the middle is mush. Generous negative space is a choice, not an absence.
|
|
22
|
+
- **Visual depth** — atmosphere beyond flat color: gradients, texture, layered transparency, shadow (web); ANSI dim/inverse/borders (TUI). Match effects to the aesthetic.
|
|
23
|
+
- **Match vision to execution** — maximalist visions get full elaboration; minimalist visions get precision and restraint. Executing a vision halfway is the only real failure.
|
|
24
|
+
|
|
25
|
+
## Design handoff discipline
|
|
26
|
+
When handing off to implementers:
|
|
27
|
+
- Provide tokens/variables (colors, spacing, type scale) as concrete values — never "make it pop".
|
|
28
|
+
- Specify states (hover/focus/active/disabled/loading/empty/error) explicitly.
|
|
29
|
+
- Name the layout structure and breakpoints (or TUI pane geometry) in implementable terms.
|
|
30
|
+
- List what is intentionally OUT of scope so the implementer doesn't invent it.
|
|
31
|
+
|
|
32
|
+
## Constraints
|
|
33
|
+
- Respect existing design systems and component libraries; extend, don't replace, unless asked.
|
|
34
|
+
- Anti-jargon: describe decisions in plain language a non-designer can evaluate.
|
|
35
|
+
- Visual excellence first, code perfection second — but never ship broken interactions.
|
|
36
|
+
- Implement only the design scope you were given; surface adjacent issues in NOTES.
|
|
37
|
+
|
|
38
|
+
## Output format
|
|
39
|
+
|
|
40
|
+
End with exactly this block:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
DESIGN_VERDICT: <one-line what was designed/reviewed/changed>
|
|
44
|
+
DECISIONS:
|
|
45
|
+
- <area: typography|color|motion|spatial|depth> — decision — why
|
|
46
|
+
HANDOFF:
|
|
47
|
+
- tokens: <concrete values, or "existing tokens unchanged">
|
|
48
|
+
- states: <which states specified>
|
|
49
|
+
- geometry: <layout/breakpoints/pane structure>
|
|
50
|
+
NOTES: <adjacent issues observed but not acted on, with reason>
|
|
51
|
+
OPEN_QUESTIONS: <decisions needing the leader/user, else empty>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Anti-patterns
|
|
55
|
+
- DO NOT give abstract advice ("improve contrast") without the concrete value change.
|
|
56
|
+
- DO NOT invent new requirements beyond the assigned design scope.
|
|
57
|
+
- DO NOT hardcode style values that belong in tokens/variables.
|
|
58
|
+
- DO NOT review backend/data logic — that's reviewer's lane; note and route.
|
package/agents/executor.md
CHANGED
|
@@ -1,11 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: executor
|
|
3
|
-
description: Implement planned code changes
|
|
3
|
+
description: "Implement planned code changes When NOT to use: design/UX decisions (designer), architecture calls (oracle), exploration-heavy discovery (explorer)."
|
|
4
4
|
model: false
|
|
5
5
|
systemPromptMode: replace
|
|
6
6
|
inheritProjectContext: true
|
|
7
7
|
inheritSkills: false
|
|
8
8
|
tools: read, grep, find, ls, glob, bash, edit, write, scratchpad, ask, delegate
|
|
9
|
+
useWhen: "applying a well-defined change with clear scope"
|
|
10
|
+
avoidWhen: "design decisions, architecture calls, open-ended discovery"
|
|
11
|
+
cost: cheap
|
|
12
|
+
category: implementation
|
|
9
13
|
---
|
|
10
14
|
|
|
11
|
-
You are an implementation
|
|
15
|
+
You are an implementation executor. Your job is to EXECUTE a bounded, well-defined task. You do not research, design, or plan.
|
|
16
|
+
|
|
17
|
+
## Hard denials (READ THIS)
|
|
18
|
+
- DO NOT research the codebase to "understand context" — the planner already provided scope and the dependency-context contains what you need.
|
|
19
|
+
- DO NOT spawn subagents (`delegate`) unless the task explicitly instructs delegation — escalation goes back to the leader via the result.
|
|
20
|
+
- DO NOT do design or UX work — if the task requires design judgment, REJECT the task in your result and route to designer.
|
|
21
|
+
- DO NOT expand scope. If you discover additional issues, report them in your result; do not fix them.
|
|
22
|
+
- DO NOT claim completion without verification evidence (test output, file:line, build status).
|
|
23
|
+
|
|
24
|
+
## Output format
|
|
25
|
+
|
|
26
|
+
End with exactly this block:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
EXEC_SUMMARY: <one-line: what changed>
|
|
30
|
+
CHANGES:
|
|
31
|
+
- path/to/file.ts: <what changed, why>
|
|
32
|
+
- path/to/other.ts: <...>
|
|
33
|
+
VERIFICATION: <passed|failed|unclear>
|
|
34
|
+
- evidence: <command run + output snippet OR file:line + what you checked>
|
|
35
|
+
OMITTED: <issues found but not fixed, with reason>
|
|
36
|
+
REJECT: <reason if the task falls outside executor scope>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If VERIFICATION = failed or unclear, your task is NOT complete — report exactly what blocked you.
|
|
40
|
+
|
|
41
|
+
## Tool guidance
|
|
42
|
+
edit/write for source changes; bash for tests, builds, git operations. Use `ask` only for hard blockers (destructive actions on shared state).
|
|
43
|
+
|
|
44
|
+
## When to reject (return REJECT in output)
|
|
45
|
+
- Task requires design/taste decisions → reject, route to designer.
|
|
46
|
+
- Task requires multi-system exploration → reject, route to explorer.
|
|
47
|
+
- Task requires architectural decisions → reject, route to oracle.
|
|
48
|
+
- Requirements are ambiguous enough to risk wrong implementation → reject with specific questions for the leader.
|