@selesai/code 0.5.29 → 0.6.2

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.
Files changed (94) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +1 -1
  3. package/dist/config.d.ts +16 -3
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +106 -5
  6. package/dist/config.js.map +1 -1
  7. package/dist/core/system-prompt.d.ts.map +1 -1
  8. package/dist/core/system-prompt.js +18 -0
  9. package/dist/core/system-prompt.js.map +1 -1
  10. package/dist/core/system-prompt.test.d.ts +2 -0
  11. package/dist/core/system-prompt.test.d.ts.map +1 -0
  12. package/dist/core/system-prompt.test.js +89 -0
  13. package/dist/core/system-prompt.test.js.map +1 -0
  14. package/dist/defaults/models.json +13 -45
  15. package/dist/defaults/settings.json +5 -7
  16. package/dist/extensions/copy-turn.test.ts +131 -0
  17. package/dist/extensions/copy-turn.ts +6 -1
  18. package/dist/extensions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  19. package/dist/extensions/package.json +0 -1
  20. package/dist/extensions/pi-subagents/CHANGELOG.md +3 -0
  21. package/dist/extensions/pi-subagents/README.md +27 -32
  22. package/dist/extensions/pi-subagents/agents/architect.md +4 -4
  23. package/dist/extensions/pi-subagents/agents/builder.md +5 -4
  24. package/dist/extensions/pi-subagents/agents/commentator.md +3 -2
  25. package/dist/extensions/pi-subagents/agents/explorer.md +3 -2
  26. package/dist/extensions/pi-subagents/agents/recapper.md +3 -2
  27. package/dist/extensions/pi-subagents/agents/researcher.md +4 -3
  28. package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +2 -0
  29. package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +10 -9
  30. package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +12 -11
  31. package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +10 -11
  32. package/dist/extensions/pi-subagents/src/agents/agent-management.ts +56 -9
  33. package/dist/extensions/pi-subagents/src/agents/task-aware-routing.ts +125 -0
  34. package/dist/extensions/pi-subagents/src/api/preflight.ts +1 -1
  35. package/dist/extensions/pi-subagents/src/extension/index.ts +5 -1
  36. package/dist/extensions/pi-subagents/src/extension/schemas.ts +2 -2
  37. package/dist/extensions/pi-subagents/src/extension/tool-description.ts +24 -7
  38. package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +23 -5
  39. package/dist/extensions/pi-subagents/src/runs/background/notify.ts +27 -1
  40. package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +64 -6
  41. package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +16 -1
  42. package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +72 -18
  43. package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +19 -5
  44. package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +127 -31
  45. package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +4 -6
  46. package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +63 -9
  47. package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +21 -0
  48. package/dist/extensions/pi-subagents/src/shared/types.ts +41 -2
  49. package/dist/extensions/pi-subagents/src/shared/utils.ts +29 -1
  50. package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +5 -1
  51. package/dist/extensions/pi-subagents/src/tui/render.ts +32 -6
  52. package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +111 -6
  53. package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +74 -43
  54. package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +36 -21
  55. package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +5 -3
  56. package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +20 -8
  57. package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +14 -7
  58. package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +227 -0
  59. package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +81 -5
  60. package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +49 -10
  61. package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +18 -2
  62. package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +1 -1
  63. package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +70 -6
  64. package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +161 -1
  65. package/dist/extensions/pi-subagents/test/unit/builtin-agent-documentation.test.ts +63 -0
  66. package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +34 -0
  67. package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +24 -0
  68. package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +6 -1
  69. package/dist/extensions/pi-subagents/test/unit/notify.test.ts +29 -0
  70. package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +2 -0
  71. package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +12 -0
  72. package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +91 -1
  73. package/dist/extensions/pi-subagents/test/unit/task-aware-routing.test.ts +213 -0
  74. package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +23 -1
  75. package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +60 -9
  76. package/dist/extensions/pi-web-agent/package.json +1 -1
  77. package/dist/skills/pi-subagents/SKILL.md +43 -0
  78. package/dist/skills/pi-subagents/references/constraints-and-recipes.md +257 -0
  79. package/dist/skills/pi-subagents/references/execution-controls.md +431 -0
  80. package/dist/skills/pi-subagents/references/management-authoring-rpc.md +144 -0
  81. package/dist/skills/pi-subagents/references/prompting-and-roles.md +281 -0
  82. package/dist/skills/ponytail/SKILL.md +1 -3
  83. package/docs/plans/subagent-delegation/phase-0-correctness.md +265 -0
  84. package/docs/plans/subagent-delegation/phase-1-behavioral-contract.md +486 -0
  85. package/docs/plans/subagent-delegation/phase-2-context-controls.md +282 -0
  86. package/docs/plans/subagent-delegation/phase-3-advisory-routing.md +362 -0
  87. package/docs/plans/subagent-delegation/phase-4-optional-enforcement.md +381 -0
  88. package/package.json +2 -2
  89. package/dist/extensions/caveman/caveman-instructions.cjs +0 -11
  90. package/dist/extensions/caveman/index.js +0 -118
  91. package/dist/extensions/caveman/package.json +0 -8
  92. package/dist/extensions/caveman/test/extension.test.js +0 -203
  93. package/dist/extensions/caveman/test/helpers.test.js +0 -58
  94. package/dist/skills/caveman/SKILL.md +0 -50
@@ -17,9 +17,9 @@
17
17
  "input": ["text"],
18
18
  "contextWindow": 1000000,
19
19
  "cost": {
20
- "input": 0.14,
21
- "output": 0.28,
22
- "cacheRead": 0.0028,
20
+ "input": 0.15,
21
+ "output": 0.3,
22
+ "cacheRead": 0.003,
23
23
  "cacheWrite": 0
24
24
  },
25
25
  "compat": {
@@ -29,15 +29,15 @@
29
29
  }
30
30
  },
31
31
  {
32
- "id": "kimi-k2.7-code",
33
- "name": "Kimi K2.7 Code",
32
+ "id": "kimi-k3",
33
+ "name": "Kimi K3",
34
34
  "reasoning": true,
35
35
  "input": ["text", "image"],
36
36
  "contextWindow": 262128,
37
37
  "cost": {
38
- "input": 0.95,
39
- "output": 4,
40
- "cacheRead": 0.2375,
38
+ "input": 3,
39
+ "output": 15,
40
+ "cacheRead": 1.5,
41
41
  "cacheWrite": 0
42
42
  },
43
43
  "compat": {
@@ -46,15 +46,15 @@
46
46
  }
47
47
  },
48
48
  {
49
- "id": "kimi-k2.6",
50
- "name": "Kimi K2.6",
49
+ "id": "kimi-k2.7-code",
50
+ "name": "Kimi K2.7 Code",
51
51
  "reasoning": true,
52
52
  "input": ["text", "image"],
53
53
  "contextWindow": 262128,
54
54
  "cost": {
55
- "input": 0.69,
56
- "output": 3.22,
57
- "cacheRead": 0.1725,
55
+ "input": 0.95,
56
+ "output": 4,
57
+ "cacheRead": 0.2375,
58
58
  "cacheWrite": 0
59
59
  },
60
60
  "compat": {
@@ -96,22 +96,6 @@
96
96
  "supportsReasoningEffort": false
97
97
  }
98
98
  },
99
- {
100
- "id": "qwen3.6-35b-fast",
101
- "name": "Qwen3.6 35B Fast",
102
- "reasoning": false,
103
- "input": ["text", "image"],
104
- "contextWindow": 131056,
105
- "cost": {
106
- "input": 0.29,
107
- "output": 1.15,
108
- "cacheRead": 0.0725,
109
- "cacheWrite": 0
110
- },
111
- "compat": {
112
- "supportsReasoningEffort": false
113
- }
114
- },
115
99
  {
116
100
  "id": "glm-5.2",
117
101
  "name": "GLM-5.2",
@@ -128,22 +112,6 @@
128
112
  "supportsDeveloperRole": false,
129
113
  "supportsReasoningEffort": true
130
114
  }
131
- },
132
- {
133
- "id": "glm-5.2-fast",
134
- "name": "GLM-5.2 Fast",
135
- "reasoning": false,
136
- "input": ["text"],
137
- "contextWindow": 1000000,
138
- "cost": {
139
- "input": 1.45,
140
- "output": 4.5,
141
- "cacheRead": 0.3625,
142
- "cacheWrite": 0
143
- },
144
- "compat": {
145
- "supportsReasoningEffort": true
146
- }
147
115
  }
148
116
  ]
149
117
  }
@@ -25,8 +25,7 @@
25
25
  "lastChangelogVersion": "0.80.2",
26
26
  "packages": [
27
27
  "git:github.com/MasuRii/pi-tool-display",
28
- "git:github.com/omaclaren/pi-markdown-preview",
29
- "git:github.com/aliou/pi-guardrails"
28
+ "git:github.com/omaclaren/pi-markdown-preview"
30
29
  ],
31
30
  "quietStartup": true,
32
31
  "retry": {
@@ -39,16 +38,15 @@
39
38
  "showImages": true
40
39
  },
41
40
  "subagents": {
42
- "defaultModel": "tokenin/glm-5.2",
43
41
  "agentOverrides": {
44
42
  "architect": {
45
- "model": "tokenin/glm-5.2"
43
+ "model": "tokenin/kimi-k3"
46
44
  },
47
45
  "builder": {
48
- "model": "tokenin/kimi-k2.7-code"
46
+ "model": "tokenin/deepseek-v4-flash"
49
47
  },
50
48
  "commentator": {
51
- "model": "tokenin/kimi-k2.7-code"
49
+ "model": "tokenin/glm-5.2"
52
50
  },
53
51
  "explorer": {
54
52
  "model": "tokenin/deepseek-v4-flash"
@@ -57,7 +55,7 @@
57
55
  "model": "tokenin/deepseek-v4-flash"
58
56
  },
59
57
  "researcher": {
60
- "model": "tokenin/kimi-k2.7-code"
58
+ "model": "tokenin/deepseek-v4-flash"
61
59
  }
62
60
  }
63
61
  },
@@ -0,0 +1,131 @@
1
+ import { beforeEach, describe, expect, it, vi } from "vitest";
2
+ import copyTurnExtension from "./copy-turn.ts";
3
+
4
+ vi.mock("@selesai/code", () => ({
5
+ copyToClipboard: vi.fn(),
6
+ }));
7
+
8
+ import { copyToClipboard } from "@selesai/code";
9
+
10
+ type AnyMessage = any;
11
+ type Handler = (event: any, ctx: any) => any;
12
+ type Command = { description: string; handler: (args: string, ctx: any) => Promise<void> };
13
+
14
+ const MARK_RE = /\n?\n?\s*⧉ copy(?:\s+\w+)?: \/cp ([0-9a-f]{6,12})\s*$/;
15
+
16
+ function hashFromMarkedText(text: string): string {
17
+ const m = text.match(MARK_RE);
18
+ if (!m) throw new Error(`no copy marker found in: ${JSON.stringify(text)}`);
19
+ return m[1]!;
20
+ }
21
+
22
+ function createHarness() {
23
+ const handlers = new Map<string, Handler>();
24
+ const commands = new Map<string, Command>();
25
+ const sent: AnyMessage[] = [];
26
+ const pi = {
27
+ on: vi.fn((event: string, handler: Handler) => {
28
+ handlers.set(event, handler);
29
+ }),
30
+ registerCommand: vi.fn((name: string, opts: Command) => {
31
+ commands.set(name, opts);
32
+ }),
33
+ registerMessageRenderer: vi.fn(),
34
+ sendMessage: vi.fn((msg: AnyMessage) => {
35
+ sent.push(msg);
36
+ }),
37
+ };
38
+ copyTurnExtension(pi as any);
39
+ return { handlers, commands, sent, pi };
40
+ }
41
+
42
+ function branchCtx(messages: AnyMessage[]) {
43
+ return {
44
+ sessionManager: { getBranch: () => messages.map((message) => ({ type: "message", message })) },
45
+ ui: { notify: vi.fn() },
46
+ };
47
+ }
48
+
49
+ describe("copy-turn hash stability", () => {
50
+ beforeEach(() => {
51
+ vi.clearAllMocks();
52
+ });
53
+
54
+ it("recomputes the displayed assistant hash from the persisted message despite metadata changes", async () => {
55
+ const { handlers, commands } = createHarness();
56
+ const messageEnd = handlers.get("message_end")!;
57
+
58
+ // Transient message as seen by message_end (before persistence).
59
+ const transient = {
60
+ role: "assistant",
61
+ content: [{ type: "text", text: "Fix the copy bug now." }],
62
+ stopReason: "done",
63
+ };
64
+ const result = await messageEnd({ type: "message_end", message: transient }, {});
65
+ const markedText = result.message.content[0].text as string;
66
+ const displayedHash = hashFromMarkedText(markedText);
67
+ expect(displayedHash).toMatch(/^[0-9a-f]{6}$/);
68
+
69
+ // Persisted variant: same content plus the copy marker and changed metadata.
70
+ const persisted = {
71
+ ...result.message,
72
+ details: { latencyMs: 42 },
73
+ stopReason: "error",
74
+ timestamp: 1_700_000_000_000,
75
+ sessionId: "s-1",
76
+ msgId: "m-1",
77
+ usage: { inputTokens: 1, outputTokens: 2 },
78
+ };
79
+
80
+ const ctx = branchCtx([persisted]);
81
+ const cmd = commands.get("cp")!;
82
+ await cmd.handler(displayedHash, ctx);
83
+
84
+ expect(copyToClipboard).toHaveBeenCalledTimes(1);
85
+ expect(copyToClipboard).toHaveBeenCalledWith("Fix the copy bug now.");
86
+ expect(ctx.ui.notify).not.toHaveBeenCalledWith(`No message for hash ${displayedHash}`, "warning");
87
+ expect(ctx.ui.notify).toHaveBeenCalledWith(`Copied ${displayedHash} (21 chars)`, "info");
88
+ });
89
+
90
+ it("resolves the displayed user hash from the persisted user message despite metadata changes", async () => {
91
+ const { handlers, commands, sent } = createHarness();
92
+ const messageEnd = handlers.get("message_end")!;
93
+
94
+ await messageEnd({ type: "message_end", message: { role: "user", content: "show me the files" } }, {});
95
+ const copyRow = sent.find((m) => m.customType === "copy-turn");
96
+ expect(copyRow).toBeDefined();
97
+ const displayedHash: string = copyRow.details.hash;
98
+
99
+ // Persisted user message with metadata the transient object did not have.
100
+ const persisted = {
101
+ role: "user",
102
+ content: "show me the files",
103
+ details: { reranked: true },
104
+ timestamp: 42,
105
+ };
106
+
107
+ const ctx = branchCtx([persisted]);
108
+ const cmd = commands.get("cp")!;
109
+ await cmd.handler(displayedHash, ctx);
110
+
111
+ expect(copyToClipboard).toHaveBeenCalledTimes(1);
112
+ expect(copyToClipboard).toHaveBeenCalledWith("show me the files");
113
+ expect(ctx.ui.notify).not.toHaveBeenCalledWith(`No message for hash ${displayedHash}`, "warning");
114
+ });
115
+
116
+ it("strips existing copy markers before hashing", async () => {
117
+ const { handlers } = createHarness();
118
+ const messageEnd = handlers.get("message_end")!;
119
+
120
+ const plain = { role: "assistant", content: [{ type: "text", text: "Same content" }] };
121
+ const alreadyMarked = {
122
+ role: "assistant",
123
+ content: [{ type: "text", text: "Same content\n\n⧉ copy assistant: /cp abc123" }],
124
+ };
125
+
126
+ const r1 = await messageEnd({ type: "message_end", message: plain }, {});
127
+ const r2 = await messageEnd({ type: "message_end", message: alreadyMarked }, {});
128
+
129
+ expect(hashFromMarkedText(r1.message.content[0].text)).toBe(hashFromMarkedText(r2.message.content[0].text));
130
+ });
131
+ });
@@ -39,7 +39,12 @@ function resultOf(message: AnyMessage): string {
39
39
  }
40
40
 
41
41
  function hashFor(m: AnyMessage): string {
42
- return createHash("sha1").update(JSON.stringify(cleanMessage(m))).digest("hex").slice(0, HASH_LEN);
42
+ // Hash the stable copy identity (role + cleaned copy result) only, so the hash
43
+ // shown at display time (computed from the transient message) still matches the
44
+ // one /cp recomputes from the persisted message, whose metadata may have changed.
45
+ const role = m.role ?? "message";
46
+ const text = resultOf(m);
47
+ return createHash("sha1").update(JSON.stringify([role, text])).digest("hex").slice(0, HASH_LEN);
43
48
  }
44
49
 
45
50
  function addMarker(m: AnyMessage): AnyMessage {
@@ -0,0 +1 @@
1
+ {"version":"4.1.9","results":[[":handoff-new.test.ts",{"duration":0,"failed":true}]]}
@@ -5,7 +5,6 @@
5
5
  "description": "Built-in extensions shipped with @selesai/code, loaded via additionalExtensionPaths at boot.",
6
6
  "pi": {
7
7
  "extensions": [
8
- "./caveman/index.js",
9
8
  "./copy-turn.ts",
10
9
  "./context-compaction-reminder.ts",
11
10
  "./pi-intercom/index.ts",
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ### Changed
6
+ - Made per-child debug artifacts opt-in with `artifacts: true` instead of writing prompt, output, transcript, and metadata copies for every run by default.
7
+
5
8
  ## [0.40.0] - 2026-08-01
6
9
 
7
10
  ### Added
@@ -104,16 +104,14 @@ The extension ships with builtin agents you can use immediately.
104
104
 
105
105
  | Agent | Use it when you want... |
106
106
  |-------|--------------------------|
107
- | `explorer` | Fast local codebase recon: relevant files, entry points, data flow, risks, and where another agent should start. |
107
+ | `explorer` | Fast local codebase recon: relevant files, entry points, data flow, risks, and where another agent should start. It reads and reports; it does not edit. |
108
108
  | `researcher` | Web/docs research with sources: official docs, specs, benchmarks, recent changes, and a concise research brief. |
109
109
  | `architect` | A concrete implementation plan from existing context. It should read and plan, not edit code. |
110
110
  | `builder` | Implementation work, including approved commentator handoffs. It edits files, validates, and escalates unapproved decisions instead of guessing. |
111
- | `commentator` | Code review and small fixes. It checks the implementation against the task/plan, tests, edge cases, and simplicity. |
112
- | `explorer` | A stronger setup pass before planning: gathers code context and writes handoff material such as `context.md` and `meta-prompt.md`. |
113
- | `commentator` | A second opinion before acting. It challenges assumptions, catches drift, and recommends the safest next move without editing. |
114
- | `builder` | A lightweight general builder when you want a child agent that behaves close to the parent session. |
111
+ | `commentator` | Adversarial review only: checking direction, diffs, plans, and implemented work against the task/plan, tests, edge cases, and simplicity without editing files. |
112
+ | `recapper` | A clean current-state handoff: a self-contained summary of where a session stands so a later agent can continue from it. |
115
113
 
116
- A simple rule of thumb: use `explorer` before you understand the code, `researcher` before you trust external facts, `architect` before a bigger change, `builder` to implement, `commentator` to check, and `commentator` when the decision itself feels risky.
114
+ A simple rule of thumb: use `explorer` before you understand the code, `researcher` before you trust external facts, `architect` before a bigger change, `builder` to implement, `commentator` to check, and `recapper` when you need a clean current-state handoff.
117
115
 
118
116
  ## Changing an agent's model
119
117
 
@@ -160,7 +158,7 @@ For a persistent override, edit settings. This example pins the commentator ever
160
158
  A setup that works well in practice is routing agents by task shape instead of running everything on one model. Four tiers:
161
159
 
162
160
  1. **Fast workhorse** — the cheapest capable model at low thinking, for recon, lookups, and mechanical edits. Example: `openai-codex/gpt-5.6-luna:low` on `explorer`.
163
- 2. **Standard well-scoped** — a mid-tier model at medium thinking, for most delegations: routine multi-file edits, focused reviews, straightforward implementation. Example: `openai-codex/gpt-5.6-terra:medium` on `builder`, `commentator`, and a lightweight `builder` agent.
161
+ 2. **Standard well-scoped** — a mid-tier model at medium thinking, for most delegations: routine multi-file edits, focused reviews, straightforward implementation. Example: `openai-codex/gpt-5.6-terra:medium` on `builder` and `commentator`.
164
162
  3. **Deep but bounded** — a top reasoning model at high thinking, only for hard tasks that arrive with explicit goals and completion criteria. These models tend to loop on vague goals, so keep them off open-ended work. Example: `openai-codex/gpt-5.6-sol:high` on `architect` and commentator-style agents.
165
163
  4. **Taste and intent** — a model that reads human intent well and makes judgment calls without looping, for ambiguous work: UX and design decisions, product tradeoffs, planning from vague requirements, writing quality. Example: `anthropic/claude-fable-5` at `low` for lighter passes and `medium` for harder ones.
166
164
 
@@ -182,7 +180,7 @@ One more interaction worth knowing for tier 4: forked context over an Anthropic
182
180
 
183
181
  Use `~/.selesai/agent/settings.json` for a user override or the project config settings file (`.selesai/settings.json` in standard Pi) for a project override. `subagents.defaultModel` applies to builtin, package, user, and project agents that do not set `model` in frontmatter. Per-run model overrides and `agentOverrides.<name>.model` still win, and explicit agent frontmatter still wins over the global default. The same `agentOverrides` block can change `tools`, `skills`, inherited context, prompt text, or disable a builtin. Matching user and project agents also receive override fields that their frontmatter leaves unset, so a shared project config agent can keep the persona while local settings choose the model.
184
182
 
185
- By default, project settings resolve from the nearest parent directory that contains `.pi` or `.agents`, preserving existing nested-project behavior. In monorepos or git worktrees where an incidental nested `.pi` directory should not shadow the repository-level config, set this in the repository root `.selesai/settings.json`:
183
+ By default, project settings resolve from the nearest parent directory that contains a `.selesai` config dir or a legacy `.agents` agent dir, preserving existing nested-project behavior. In monorepos or git worktrees where an incidental nested `.selesai` directory should not shadow the repository-level config, set this in the repository root `.selesai/settings.json`:
186
184
 
187
185
  ```json
188
186
  {
@@ -404,7 +402,7 @@ clarify → architect → builder → fresh commentators → builder
404
402
 
405
403
  Use the optional prompt shortcuts below when you want the pattern to be repeatable.
406
404
 
407
- Packaged `architect`, `builder`, `commentator`, and `commentator` default to forked context when a launch omits `context`; pass `context: "fresh"` when you intentionally want a fresh child run.
405
+ Packaged `architect` and `recapper` default to forked context when a launch omits `context`; `builder`, `commentator`, `explorer`, and `researcher` default to fresh context. Pass explicit `context: "fresh"` or `context: "fork"` when you intentionally want one context for every child.
408
406
 
409
407
  Child-safety boundaries are enforced at runtime. Spawned child sessions do not receive the bundled `pi-subagents` skill, and forked child context filtering removes parent-only subagent artifacts (including old hidden orchestration-instruction messages, slash/status/control messages, and prior parent `subagent` tool-call/tool-result history) while preserving ordinary prose and unrelated tool calls/results. By default, children do not register the `subagent` tool and receive boundary instructions that they are not the parent orchestrator and must not propose or run subagents. The explicit exception is an agent whose resolved builtin `tools` includes `subagent`; that child gets a child-safe `subagent` tool for the fanout work the parent assigned, still bounded by `maxSubagentDepth`.
410
408
 
@@ -654,8 +652,8 @@ Append `[key=value,...]` to an agent name to override defaults. `/chain` applies
654
652
 
655
653
  | Key | Example | Description |
656
654
  |-----|---------|-------------|
657
- | `output` | `output=context.md` | Write results to a file. Absolute paths are used as-is. Relative paths in `/run` resolve under `singleRunOutputBaseDir` when configured, otherwise under the run's output artifact directory. Relative paths in `/chain` and `/parallel` live under the chain or parallel run directory. |
658
- | `outputMode` | `outputMode=file-only` | Return only a concise file reference for saved output instead of the full saved content. Requires `output`; default is `inline`. |
655
+ | `output` | `output=context.md` | Write results to a file. Absolute paths are used as-is. Relative paths in `/run` resolve under `singleRunOutputBaseDir` when configured, otherwise under the run's output artifact directory. Relative paths in `/chain` and `/parallel` live under the chain or parallel run directory. When omitted, a collision-safe per-run path is generated (`<singleRunOutputBaseDir>/<runId>/result.md` for `/run`; `<chainDir>/outputs/<flat-index>-<agent>.md` for chains; `<asyncDir>/outputs/<flat-index>-<agent>.md` for async) unless `output=false`. |
656
+ | `outputMode` | `outputMode=file-only` | Delivery is reference-first by default: completion returns a concise saved-output reference instead of full child content. Omitted `outputMode` resolves to `file-only` whenever an output path is active; explicit `outputMode=inline` keeps the legacy full inline delivery; explicit `outputMode=file-only` still requires an output path. |
659
657
  | `reads` | `reads=a.md+b.md` | Read files before executing. `+` separates multiple paths. |
660
658
  | `model` | `model=anthropic/claude-sonnet-4` | Override model for this step. |
661
659
  | `skills` | `skills=planning+review` | Override available skills. `+` separates multiple skills. |
@@ -703,7 +701,7 @@ A foreground child can detach while it waits for a supervisor reply. Reply first
703
701
 
704
702
  Headless sessions also auto-drain current-session subagent and registered provider work at `agent_end`, using one absolute timeout and continuing through attention states. This is a final lifecycle safeguard rather than a replacement for explicit orchestration: `subagent_wait` still lets a model react to each result during the turn. Provider, reconciliation, timeout, and malformed-state failures remain visible errors instead of being treated as successful drains.
705
703
 
706
- The `commentator`/`commentator` and `builder` builtins are designed for an explicit decision loop. A typical pattern is to ask `commentator` or its `commentator` alias for diagnosis and a recommended execution prompt, then only run `builder` after the main agent approves that direction.
704
+ The `commentator` and `builder` builtins are designed for an explicit decision loop. A typical pattern is to ask `commentator` for diagnosis and a recommended execution prompt, then only run `builder` after the main agent approves that direction.
707
705
 
708
706
  ## Clarify and launch UI
709
707
 
@@ -735,17 +733,11 @@ Agent locations, lowest to highest priority:
735
733
  | Builtin | `~/.selesai/agent/extensions/subagent/agents/` |
736
734
  | Installed package | `package.json` `pi-subagents.agents` or `pi.subagents.agents` |
737
735
  | User | `~/.selesai/agent/agents/**/*.md` |
738
- | Project | Project config `agents/**/*.md` (`.pi/agents/**/*.md` in standard Pi) |
736
+ | Project | Project config `agents/**/*.md` (`.selesai/agents/**/*.md` in standard Pi) |
739
737
 
740
738
  Project discovery also reads legacy `.agents/**/*.md` files. Nested subdirectories are discovered recursively. `.chain.md` files do not define agents. Installed Pi packages can expose agent directories from either `{"pi-subagents":{"agents":["./agents"]}}` or `{"pi":{"subagents":{"agents":["./agents"]}}}` in their package manifest. Package agents load above builtins and below user/project agents. If both `.agents/` and the project config agents directory define the same parsed runtime agent name, the project config directory wins. Use `agentScope: "user" | "project" | "both"` to control discovery; `both` is the default and project definitions win runtime-name collisions.
741
739
 
742
- Builtin agents load at the lowest priority, so a user or project agent with the same name overrides them. They do not pin a provider model; they inherit your current Pi default model unless you set `subagents.defaultModel` or `subagents.agentOverrides.<name>.model`. `commentator` is an advisory commentator that critiques direction and proposes an execution prompt without editing files; `commentator` is the same bundled role under the Claude Code-compatible name. `builder` is the implementation agent for normal tasks and approved commentator handoffs.
743
-
744
- The `researcher` builtin uses `web_search`, `fetch_content`, and `get_search_content`; those require [pi-web-access](https://github.com/nicobailon/pi-web-access):
745
-
746
- ```bash
747
- pi install npm:pi-web-access
748
- ```
740
+ Builtin agents load at the lowest priority, so a user or project agent with the same name overrides them. They do not pin a provider model; they inherit your current Pi default model unless you set `subagents.defaultModel` or `subagents.agentOverrides.<name>.model`. `commentator` is an advisory reviewer that critiques direction and proposes an execution prompt without editing files. `builder` is the implementation agent for normal tasks and approved commentator handoffs.
749
741
 
750
742
  ### Builtin overrides
751
743
 
@@ -870,7 +862,7 @@ Important fields:
870
862
  | `completionGuard` | Set `false` only for non-implementation agents that may mention implementation words while using mutation-capable tools such as `bash`. |
871
863
  | `interactive` | Parsed for compatibility but not enforced in v1. |
872
864
  | `maxSubagentDepth` | Tightens nested delegation for this agent's children. |
873
- | `memory` | Opt-in role-specific persistent memory. `memory: { scope: "project" \| "user", path: "<name>" }` injects the first lines of a `MEMORY.md` from a dedicated `agent-memory/` directory into the child system prompt. Agents with write tools (`edit`/`write`/`bash`) get a read-write block; read-only agents get a read-only fallback. Project scope resolves under `<project>/.pi/agent-memory/`, user scope under `~/.selesai/agent/agent-memory/`. Paths are validated against traversal and symlink escape. |
865
+ | `memory` | Opt-in role-specific persistent memory. `memory: { scope: "project" \| "user", path: "<name>" }` injects the first lines of a `MEMORY.md` from a dedicated `agent-memory/` directory into the child system prompt. Agents with write tools (`edit`/`write`/`bash`) get a read-write block; read-only agents get a read-only fallback. Project scope resolves under `<project>/.selesai/agent-memory/`, user scope under `~/.selesai/agent/agent-memory/`. Paths are validated against traversal and symlink escape. |
874
866
 
875
867
  Agent-local `skillPath` candidates never enter Pi's parent/global skills catalog. Pair `inheritSkills: false` with explicit `skills` and `skillPath` when a child should receive only its selected private skills.
876
868
 
@@ -886,7 +878,7 @@ memory:
886
878
 
887
879
  On each run, the first 200 lines of `MEMORY.md` in the resolved memory directory are injected into the child system prompt so the agent can recall accumulated role notes such as threat-model entries, release gotchas, or verified commands. Agents that have write tools (`edit`, `write`, or `bash`, or no `tools` allowlist at all) are told they may append concise dated entries to the file. Agents without write tools receive a read-only memory block and are not instructed to edit it, so a read-only commentator can still recall prior notes without being granted write capability. The memory directory is never created eagerly; the agent's own `write` tool creates it (and `MEMORY.md`) on the first persist. Memory paths are validated against `.`/`..` traversal and symlink escape, and an unsafe or unresolvable scope is silently skipped rather than breaking the run.
888
880
 
889
- Project-scoped memory resolves under `<project>/.pi/agent-memory/<path>` and travels with the repo. User-scoped memory resolves under `~/.selesai/agent/agent-memory/<path>` and is shared across projects for that agent.
881
+ Project-scoped memory resolves under `<project>/.selesai/agent-memory/<path>` and travels with the repo. User-scoped memory resolves under `~/.selesai/agent/agent-memory/<path>` and is shared across projects for that agent.
890
882
 
891
883
  ### Tool and extension selection
892
884
 
@@ -930,7 +922,7 @@ Chains are reusable workflows stored separately from agent files. Use `.chain.md
930
922
  |-------|------|
931
923
  | Installed package | `package.json` `pi-subagents.chains` or `pi.subagents.chains` |
932
924
  | User | `~/.selesai/agent/chains/**/*.chain.md`, `~/.selesai/agent/chains/**/*.chain.json` |
933
- | Project | Project config `chains/**/*.chain.md`, `chains/**/*.chain.json` (`.pi/chains/...` in standard Pi) |
925
+ | Project | Project config `chains/**/*.chain.md`, `chains/**/*.chain.json` (`.selesai/chains/...` in standard Pi) |
934
926
 
935
927
  Nested subdirectories are discovered recursively. Installed Pi packages can expose chain directories from either `{"pi-subagents":{"chains":["./chains"]}}` or `{"pi":{"subagents":{"chains":["./chains"]}}}` in their package manifest. Package chains load below user/project chains. If both `.chain.md` and `.chain.json` define the same parsed runtime chain name in the same scope, `.chain.json` wins. If user and project scopes define the same parsed runtime chain name, the project chain wins. Chains support the same optional `package` frontmatter as agents; `name: review-flow` plus `package: code-analysis` runs as `code-analysis.review-flow`.
936
928
 
@@ -1036,7 +1028,7 @@ Skills are `SKILL.md` files made available to an agent. The prompt includes skil
1036
1028
 
1037
1029
  Discovery uses project-first precedence:
1038
1030
 
1039
- 1. Project config `skills/{name}/SKILL.md` (`.pi/skills/{name}/SKILL.md` in standard Pi)
1031
+ 1. Project config `skills/{name}/SKILL.md` (`.selesai/skills/{name}/SKILL.md` in standard Pi)
1040
1032
  2. Project packages and project settings packages via `package.json -> pi.skills`
1041
1033
  3. Current task cwd package via `package.json -> pi.skills`
1042
1034
  4. Project config `settings.json -> skills`
@@ -1377,6 +1369,7 @@ Agent definitions are not loaded into context by default. Management actions let
1377
1369
  ```ts
1378
1370
  { action: "list" }
1379
1371
  { action: "list", agentScope: "project" }
1372
+ { action: "list", task: "Inspect the authentication flow and report findings only" }
1380
1373
  { action: "get", agent: "explorer" }
1381
1374
  { action: "models" }
1382
1375
  { action: "models", agent: "commentator" }
@@ -1429,6 +1422,8 @@ Agent definitions are not loaded into context by default. Management actions let
1429
1422
  { action: "reset", agent: "commentator" }
1430
1423
  ```
1431
1424
 
1425
+ `list` accepts an optional advisory `task` (the sole management-field exception): with a non-empty task it appends a text-only "Task-aware advisory routing" block that deterministically recommends one canonical executable agent for the task (implementation needs a writer role with write tools; read-only needs a read-only role without known write tools) or explains why none is safe. It only recommends and never launches: no agent is started, no params are changed, and executor selection is untouched. To proceed, make a separate explicit execution call with the recommended canonical agent name, e.g. `{ agent: "builder", task: "..." }`. `agentScope` narrows discovery for the recommendation exactly as it does for the rest of `list`.
1426
+
1432
1427
  `create` uses `config.scope`, not `agentScope`. `config.name` is the local frontmatter name; optional `config.package` registers the runtime name as `{package}.{name}` and is saved as separate `name` and `package` frontmatter. `config.aliases` accepts a comma-separated string, string array, or `false` to clear aliases; aliases resolve to the canonical agent name for execution and are shown by `list`/`get`. `update` and `delete` use the runtime name and `agentScope` only when the same runtime name exists in multiple scopes. To clear optional string fields, including `package`, set them to `false` or `""`.
1433
1428
 
1434
1429
  `eject` copies a bundled builtin or package agent verbatim into the user or project agent dir (default `user`) as an editable custom file that shadows the original, so you can customize a builtin without hunting package files. `disable` writes a reversible `agentOverrides.<name>.disabled: true` entry to the user or project settings file (default `user`); the agent stays on disk but is hidden from runtime discovery and `list`. `enable` removes that `disabled` field while preserving any other override fields on the same entry. `reset` deletes the scope's custom agent file and/or settings override entry, restoring the bundled default; it refuses if no bundled default exists (use `delete` for purely custom agents). All four accept `agentScope: "user" | "project"` and operate in one scope at a time; project overrides still win over user ones, so a project-scope disable survives a user-scope `enable` until you target the project scope.
@@ -1438,12 +1433,12 @@ Agent definitions are not loaded into context by default. Management actions let
1438
1433
  | Param | Type | Default | Description |
1439
1434
  |-------|------|---------|-------------|
1440
1435
  | `agent` | string | - | Agent name or alias for single mode, or target for management actions. Execution records use the canonical agent name. |
1441
- | `task` | string | - | Task string for single mode. |
1436
+ | `task` | string | - | Task for single mode, or an optional advisory intent for `action: "list"` (appends a task-aware recommendation to list output; never launches). |
1442
1437
  | `action` | string | - | `list`, `get`, `create`, `update`, `delete`, `status`, `interrupt`, `stop`, `resume`, `steer`, `append-step`, `approve-checkpoint`, `reject-checkpoint`, or `doctor`. |
1443
1438
  | `chainName` | string | - | Chain name for management actions. |
1444
1439
  | `config` | object/string | - | Agent or chain config for create/update. |
1445
1440
  | `output` | `string \| false` | agent default | Override single-agent output file. |
1446
- | `outputMode` | `"inline" \| "file-only"` | `inline` | Return saved output inline or as a concise saved-file reference. `file-only` requires an `output` path. |
1441
+ | `outputMode` | `"inline" \| "file-only"` | mode-dependent | Delivery of saved output. Explicit `"inline"` keeps legacy full inline output; explicit `"file-only"` returns a concise saved-file reference and requires an `output` path. Omitted, it resolves to `file-only` whenever an output path is active and `inline` otherwise. |
1447
1442
  | `skill` | `string \| string[] \| false` | agent default | Override skills or disable all. |
1448
1443
  | `model` | string | agent default | Override model. |
1449
1444
  | `outputSchema` | object | - | Require schema-valid structured output for a direct single-agent run. |
@@ -1452,7 +1447,7 @@ Agent definitions are not loaded into context by default. Management actions let
1452
1447
  | `concurrency` | number | config or `4` | Top-level parallel concurrency. |
1453
1448
  | `worktree` | boolean | false | Create isolated git worktrees for parallel tasks. |
1454
1449
  | `chain` | array | - | Sequential, checkpoint, static parallel, and dynamic fanout chain steps. Steps and chain parallel tasks support `phase`, `label`, `as`, `outputSchema`, `acceptance`, `agentContract`, and v1-only `gateOn` in addition to the usual execution fields. Dynamic fanout uses `expand`, one child `parallel` template, and `collect`. With `action: "append-step"`, pass exactly one step to append to a running async chain. |
1455
- | `context` | `fresh \| fork` | per-agent default or `fresh` | Explicit `fresh` or `fork` overrides every child. When omitted, each agent uses its own `defaultContext`; `fork` creates real branched sessions from the parent leaf. Packaged `architect`, `builder`, `commentator`, and `commentator` default to `fork`. |
1450
+ | `context` | `fresh \| fork` | per-agent default or `fresh` | Explicit `fresh` or `fork` overrides every child. When omitted, each agent uses its own `defaultContext`; `fork` creates real branched sessions from the parent leaf. Packaged `architect` and `recapper` default to `fork`; `builder`, `commentator`, `explorer`, and `researcher` default to `fresh`. |
1456
1451
  | `chainDir` | string | temp chain dir | Persistent directory for chain artifacts. Relative chain `output`, `reads`, and `progress` paths live under this directory. |
1457
1452
  | `view` | `fleet \| transcript` | - | Optional `status` view for the active fleet surface or transcript tail inspection. |
1458
1453
  | `lines` | number | `80` | Maximum transcript lines for `action: "status", view: "transcript"`; capped at 500. |
@@ -1465,7 +1460,7 @@ Agent definitions are not loaded into context by default. Management actions let
1465
1460
  | `usageBudget` | object | none | Optional root-only reported-usage budget `{ tokens?: { soft?, hard }, costUsd?: { soft?, hard } }`. Soft limits are status-only. Hard limits prevent later child launches after reported usage is reconciled; already-running children are not stopped and no reservations are made. |
1466
1461
  | `cwd` | string | runtime cwd | Override working directory. |
1467
1462
  | `maxOutput` | object | 200KB, 5000 lines | Final output truncation limits. |
1468
- | `artifacts` | boolean | true | Write debug artifacts. |
1463
+ | `artifacts` | boolean | false | Write debug artifacts. |
1469
1464
  | `includeProgress` | boolean | false | Include full progress in result. |
1470
1465
  | `share` | boolean | false | Upload session export to GitHub Gist. |
1471
1466
  | `sessionDir` | string | derived | Override session log directory. |
@@ -1479,9 +1474,9 @@ As a conservative orchestration policy, do not set `turnBudget`, a hard `toolBud
1479
1474
 
1480
1475
  Bound writer work with a narrow task and an outer `timeoutMs` or `maxRuntimeMs` that leaves enough margin for the slice. An elapsed timeout is not a mutation-safe boundary and may still signal a child during tool work. Before the deadline, use `steer` or an attention notice to request a checkpoint after the current tool returns, including changed files, build/test state, remaining work, and commit or PR state.
1481
1476
 
1482
- `context: "fork"` fails fast when the parent session is not persisted, the current leaf is missing, or the branched child session cannot be created. When the inherited transcript contains signed Anthropic `thinking` / `redacted_thinking` blocks, `pi-subagents` strips those provider-private blocks from the forked child session. It forces thinking `off` only when the child’s effective primary or fallback model resolves through the model registry to the Anthropic provider or `anthropic-messages` API; unresolved models are treated conservatively. The result reports every affected child, including on failed runs. Use `context: "fresh"` when an Anthropic child needs thinking. Forking never silently downgrades to `fresh`. In multi-agent runs that omit `context`, each agent/task/step follows its own `defaultContext`, so a fresh-default explorer can run fresh beside a fork-default builder. Pass explicit `context: "fork"` or `context: "fresh"` when you intentionally want one context for every child.
1477
+ `context: "fork"` fails fast when the parent session is not persisted, the current leaf is missing, or the branched child session cannot be created. When the inherited transcript contains signed Anthropic `thinking` / `redacted_thinking` blocks, `pi-subagents` strips those provider-private blocks from the forked child session. It forces thinking `off` only when the child’s effective primary or fallback model resolves through the model registry to the Anthropic provider or `anthropic-messages` API; unresolved models are treated conservatively. The result reports every affected child, including on failed runs. Use `context: "fresh"` when an Anthropic child needs thinking. Forking never silently downgrades to `fresh`. In multi-agent runs that omit `context`, each agent/task/step follows its own `defaultContext`, so a fresh-default explorer can run fresh beside a fork-default architect. Pass explicit `context: "fork"` or `context: "fresh"` when you intentionally want one context for every child.
1483
1478
 
1484
- Use `outputMode: "file-only"` when a saved output may be large and the parent only needs a pointer. The returned text is a compact reference like `Output saved to: /abs/report.md (48.2 KB, 2847 lines). Read this file if needed.` Failed runs and save errors still return normal inline output for debugging. In chains, relative `output` paths are resolved inside the chain artifact directory, not the caller's CWD; later `{previous}` steps receive the same compact reference when the prior step used file-only mode. To persist chain outputs outside the temp artifact area, pass a persistent `chainDir` or use an absolute `output` path. A child with only read-only tools does not need direct filesystem access for `output`: it returns the complete artifact in its final response and the runtime persists it. Children with mutation-capable tools retain the direct-write instruction.
1479
+ Delegated results are reference-first by default. Every child gets a durable saved output unless the caller explicitly uses `output: false`: omitted `output` uses a generated per-run path, omitted `outputMode` resolves to `file-only`, and completion returns a compact reference like `Output saved to: /abs/report.md (48.2 KB, 2847 lines). Read this file if needed.` Inspect full output through the saved path, async status/transcript, or resume. Explicit `outputMode: "inline"` restores legacy full inline delivery; `output: false` disables durable result persistence (follow-up visibility falls back to bounded excerpts). Failed runs with a successfully persisted result return the error/status plus the saved-output reference; when persistence or read-back fails, only a bounded excerpt (first 80 lines / 4 KiB) is returned together with the error, never raw unbounded output. Generated output files persist even with `artifacts: false`; debug `_input`, `_output`, metadata, and transcript artifacts remain opt-in. In chains, relative `output` paths are resolved inside the chain artifact directory, not the caller's CWD; later `{previous}` steps receive the same compact reference when the prior step used file-only mode. To persist chain outputs outside the temp artifact area, pass a persistent `chainDir` or use an absolute `output` path. A child with only read-only tools does not need direct filesystem access for `output`: it returns the complete artifact in its final response and the runtime persists it. Children with mutation-capable tools retain the direct-write instruction.
1485
1480
 
1486
1481
  Sequential and parallel chain tasks accept `agent`, `task`, `phase`, `label`, `as`, `outputSchema`, `cwd`, `output`, `outputMode`, `reads`, `progress`, `skill`, `model`, `toolBudget`, `acceptance`, `agentContract`, and v1-only `gateOn`. Parallel tasks also accept `count`. Parallel step groups accept `parallel`, `concurrency`, `failFast`, and `worktree`. If `outputSchema` is present, the child must call `structured_output` with schema-valid JSON; prose-only completion or invalid JSON fails the step. Validated structured values are preserved on the step result, and `as` also exposes a compact text representation through `{outputs.name}`.
1487
1482
 
@@ -1778,7 +1773,7 @@ Each chain run creates a user-scoped temp directory like:
1778
1773
 
1779
1774
  It may contain files such as `context.md`, `plan.md`, `progress.md`, and `parallel-{stepIndex}/.../output.md`. Directories older than 24 hours are cleaned up on extension startup.
1780
1775
 
1781
- Debug artifacts live under `{sessionDir}/subagent-artifacts/`, `.pi-subagents/artifacts/` for project-scoped runs, or a user-scoped temp artifact directory. Single-run relative `output` files are saved under `{artifactsDir}/outputs/{runId}/` unless `singleRunOutputBaseDir` is configured. Per task you may see:
1776
+ When explicitly enabled with `artifacts: true`, debug artifacts live under `{sessionDir}/subagent-artifacts/`, `.pi-subagents/artifacts/` for project-scoped runs, or a user-scoped temp artifact directory. Single-run relative `output` files are saved under `{artifactsDir}/outputs/{runId}/` unless `singleRunOutputBaseDir` is configured. Per task you may see:
1782
1777
 
1783
1778
  - `{runId}_{agent}_input.md`
1784
1779
  - `{runId}_{agent}_output.md`
@@ -1896,7 +1891,7 @@ The result watcher emits `subagent:async-complete`; `src/extension/index.ts` reg
1896
1891
 
1897
1892
  `pi-subagents` works standalone through natural language, the `subagent` tool, slash commands, and the packaged prompt shortcuts listed near the top of this README. It also includes a native prompt-workflow adapter for reusable subagent prompt templates, so you do not need `pi-prompt-template-model` for the common subagent workflow path.
1898
1893
 
1899
- Create a prompt in `.pi/prompts/` or `~/.selesai/agent/prompts/`:
1894
+ Create a prompt in `.selesai/prompts/` or `~/.selesai/agent/prompts/`:
1900
1895
 
1901
1896
  ```md
1902
1897
  ---
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: architect
3
- description: Creates implementation plans from context and requirements
3
+ description: Read-only architecture and implementation planning
4
4
  tools: read, grep, find, ls
5
5
  acceptanceRole: read-only
6
6
  systemPromptMode: replace
7
7
  inheritProjectContext: true
8
8
  inheritSkills: false
9
- skill: ponytail, caveman, planger
9
+ skill: ponytail, planger
10
10
  defaultContext: fork
11
11
  ---
12
12
 
@@ -35,7 +35,7 @@ Never assume:
35
35
  - Existing utilities
36
36
 
37
37
  If the code has not been inspected, the plan must begin with discovery.
38
- You research the codebase (using explore agent) → clarify with the user (using questions tool) → capture findings and decisions into a comprehensive plan. This iterative approach catches edge cases and non-obvious requirements BEFORE implementation begins.
38
+ Inspect the repository directly with your available read/search tools and capture findings and decisions into a comprehensive plan. This iterative approach catches edge cases and non-obvious requirements BEFORE implementation begins. Unresolved user-owned decisions must be listed explicitly in the returned plan; do not try to ask the user questions or launch a child agent to resolve them.
39
39
 
40
40
  ## Simplicity First
41
41
 
@@ -54,7 +54,7 @@ Choose the lowest-complexity solution that works.
54
54
 
55
55
  ## Reuse Before Build
56
56
 
57
- Before creating anything new (use explorer agent):
57
+ Before creating anything new, inspect the repository directly with your read/search tools:
58
58
 
59
59
  - Search for existing implementations
60
60
  - Search for existing utilities
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  name: builder
3
- description: Implementation agent for normal task handoffs
3
+ description: Mutation-capable scoped implementation
4
4
  aliases: developer, coder, implementer, develop
5
+ acceptanceRole: writer
5
6
  thinking: high
6
7
  systemPromptMode: replace
7
- tools: read, grep, find, ls, bash, edit, write, contact_supervisor
8
+ tools: read, grep, find, ls, bash, edit, write
8
9
  inheritSkills: false
9
- skill: ponytail, caveman, implanger
10
+ skill: ponytail, implanger
10
11
  inheritProjectContext: true
11
12
  defaultContext: fresh
12
13
  ---
@@ -18,7 +19,7 @@ Read the supplied task, artifacts, and relevant code before changing anything. I
18
19
  Rules:
19
20
  - Make only approved, in-scope changes. Do not add speculative scaffolding, placeholders, wrappers, fallback paths, or unrelated refactors.
20
21
  - Trace callers when changing shared behavior; fix the shared cause rather than patching one path.
21
- - If a required product, architecture, or scope decision is not approved, use `contact_supervisor` with `reason: "need_decision"` and wait. Do not guess.
22
+ - If a required product, architecture, or scope decision is not approved: when the injected bridge instructions make `contact_supervisor` available, use it with `reason: "need_decision"` and wait; otherwise stop, do not guess, and report the exact blocking decision in your final response.
22
23
  - Do not launch subagents. Do not send routine completion handoffs.
23
24
  - Do not claim success without making the requested edits, unless you are blocked and report why.
24
25
 
@@ -1,14 +1,15 @@
1
1
  ---
2
2
  name: commentator
3
- description: Evidence-based review specialist for diffs, plans, and proposed solutions
3
+ description: Read-only evidence-based review
4
4
  thinking: high
5
5
  tools: read, grep, find, ls, bash
6
6
  systemPromptMode: replace
7
7
  inheritProjectContext: true
8
8
  inheritSkills: false
9
9
  defaultContext: fresh
10
- skill: ponytail, caveman, planger
10
+ skill: ponytail, planger
11
11
  completionGuard: false
12
+ acceptanceRole: read-only
12
13
  ---
13
14
 
14
15
  You are a review-only subagent. Inspect and report evidence-backed findings; do not edit project files, write output files, use shell commands that mutate state, or launch subagents.
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  name: explorer
3
- description: Fast codebase recon that returns compressed context for handoff
3
+ description: Read-only local codebase reconnaissance
4
4
  tools: read, grep, find, ls
5
5
  systemPromptMode: replace
6
6
  inheritProjectContext: true
7
7
  inheritSkills: false
8
- skill: ponytail, caveman
8
+ skill: ponytail
9
9
  defaultContext: fresh
10
+ acceptanceRole: read-only
10
11
  ---
11
12
 
12
13
  You are a codebase reconnaissance subagent. Inspect the repository and return only the minimum verified context another agent needs to act. Do not edit project files, write output files, or launch subagents.