@selesai/code 0.5.13 → 0.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +186 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/extensions/package.json +4 -3
- package/dist/extensions/pi-powerline-footer/README.md +1 -1
- package/dist/extensions/pi-powerline-footer/guide.ts +227 -0
- package/dist/extensions/pi-powerline-footer/index.ts +88 -55
- package/dist/extensions/pi-powerline-footer/tests/editor-responsiveness.test.ts +0 -78
- package/dist/extensions/pi-powerline-footer/tests/guide.test.ts +102 -0
- package/dist/extensions/pi-powerline-footer/welcome.ts +65 -30
- package/dist/skills/caveman/SKILL.md +1 -0
- package/dist/skills/handoff/SKILL.md +1 -0
- package/dist/skills/handoff-text/SKILL.md +1 -0
- package/dist/skills/implanger/SKILL.md +1 -0
- package/dist/skills/improve-codebase/SKILL.md +1 -0
- package/dist/skills/planger/SKILL.md +1 -0
- package/dist/skills/ponytail/SKILL.md +1 -0
- package/dist/skills/ponytail-audit/SKILL.md +1 -0
- package/dist/skills/ponytail-debt/SKILL.md +1 -0
- package/dist/skills/ponytail-gain/SKILL.md +1 -0
- package/dist/skills/ponytail-help/SKILL.md +1 -0
- package/dist/skills/ponytail-review/SKILL.md +1 -0
- package/dist/skills/workflow-creation/SKILL.md +1 -0
- package/package.json +23 -2
- package/dist/agents/architect.md +0 -217
- package/dist/agents/builder.md +0 -120
- package/dist/agents/commentator.md +0 -130
- package/dist/agents/explorer.md +0 -51
- package/dist/agents/recapper.md +0 -26
- package/dist/extensions/gitignore-guard.ts +0 -132
- package/dist/extensions/hooks/claude-codex-hooks.json +0 -44
- package/dist/extensions/hooks/copilot-hooks.json +0 -21
- package/dist/extensions/hooks/ponytail-activate.js +0 -91
- package/dist/extensions/hooks/ponytail-config.js +0 -122
- package/dist/extensions/hooks/ponytail-instructions.js +0 -94
- package/dist/extensions/hooks/ponytail-mode-tracker.js +0 -55
- package/dist/extensions/hooks/ponytail-runtime.js +0 -68
- package/dist/extensions/hooks/ponytail-statusline.ps1 +0 -21
- package/dist/extensions/hooks/ponytail-statusline.sh +0 -12
- package/dist/extensions/hooks/ponytail-subagent.js +0 -22
- package/dist/extensions/pi-extension/index.js +0 -189
- package/dist/extensions/pi-extension/package.json +0 -8
- package/dist/extensions/pi-extension/test/extension.test.js +0 -167
- package/dist/extensions/pi-extension/test/helpers.test.js +0 -92
- package/dist/extensions/pi-powerline-footer/welcome-dismiss.ts +0 -34
- package/dist/extensions/pi-subagents/agents/context-builder.md +0 -46
- package/dist/extensions/pi-subagents/agents/delegate.md +0 -12
- package/dist/extensions/pi-subagents/agents/oracle.md +0 -73
- package/dist/extensions/pi-subagents/agents/planner.md +0 -55
- package/dist/extensions/pi-subagents/agents/reviewer.md +0 -79
- package/dist/extensions/pi-subagents/agents/scout.md +0 -50
- package/dist/extensions/pi-subagents/agents/worker.md +0 -55
- package/dist/extensions/pi-subagents/src/runs/shared/spawn-timing.ts +0 -46
- package/dist/extensions/pi-subagents/test/unit/spawn-timing.test.ts +0 -45
- package/dist/extensions/pi-subagents/tsconfig.runner.json +0 -17
- package/dist/extensions/ponytail-pi-extension/index.js +0 -189
- package/dist/extensions/ponytail-pi-extension/package.json +0 -8
- package/dist/extensions/ponytail-pi-extension/test/extension.test.js +0 -167
- package/dist/extensions/ponytail-pi-extension/test/helpers.test.js +0 -92
- package/dist/extensions/prototype.ts +0 -713
- package/dist/extensions/question.ts +0 -350
- package/dist/extensions/quick.ts +0 -630
- package/dist/extensions/tps-tracker.ts +0 -280
- package/dist/extensions/workflow/task-validators.ts +0 -69
- package/dist/skills/selesai-default/SKILL.md +0 -16
|
@@ -3,8 +3,9 @@ import { join, basename } from "node:path";
|
|
|
3
3
|
import { homedir as osHomedir } from "node:os";
|
|
4
4
|
import { CONFIG_DIR_NAME, getAgentDir, getSettingsPath } from "@selesai/code";
|
|
5
5
|
import type { Component } from "@earendil-works/pi-tui";
|
|
6
|
-
import { truncateToWidth as tuiTruncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
6
|
+
import { truncateToWidth as tuiTruncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
7
7
|
import { ansi, fgOnly, getFgAnsiCode } from "./colors.ts";
|
|
8
|
+
import { GUIDE_COMPACT_LINES, GUIDE_DISMISS_HINT, getGuideFeatureLines, type GuideFeature, type GuideMode } from "./guide.ts";
|
|
8
9
|
|
|
9
10
|
export interface RecentSession {
|
|
10
11
|
name: string;
|
|
@@ -82,11 +83,20 @@ function fitToWidth(str: string, width: number): string {
|
|
|
82
83
|
return str + " ".repeat(width - visLen);
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
function wrapLines(lines: string[], width: number): string[] {
|
|
87
|
+
const continuation = " ";
|
|
88
|
+
const contentWidth = Math.max(1, width - continuation.length);
|
|
89
|
+
return lines.flatMap((line) => wrapTextWithAnsi(line, contentWidth)
|
|
90
|
+
.map((wrapped, index) => index === 0 ? wrapped : continuation + wrapped));
|
|
91
|
+
}
|
|
92
|
+
|
|
85
93
|
interface WelcomeData {
|
|
86
94
|
modelName: string;
|
|
87
95
|
providerName: string;
|
|
88
96
|
recentSessions: RecentSession[];
|
|
89
97
|
loadedCounts: LoadedCounts;
|
|
98
|
+
guideMode: GuideMode;
|
|
99
|
+
newFeatures: GuideFeature[];
|
|
90
100
|
}
|
|
91
101
|
|
|
92
102
|
function buildLeftColumn(data: WelcomeData, colWidth: number): string[] {
|
|
@@ -107,6 +117,27 @@ function buildRightColumn(data: WelcomeData, colWidth: number): string[] {
|
|
|
107
117
|
const hChar = "─";
|
|
108
118
|
const separator = ` ${dim(hChar.repeat(colWidth - 2))}`;
|
|
109
119
|
|
|
120
|
+
const guideLines = data.guideMode === "compact"
|
|
121
|
+
? [
|
|
122
|
+
` ${bold(fgOnly("accent", "Guide"))}`,
|
|
123
|
+
...(data.newFeatures.length > 0
|
|
124
|
+
? [` ${bold(fgOnly("model", `New: ${data.newFeatures.slice(0, 2).map((feature) => feature.title).join(" · ")}`))}`]
|
|
125
|
+
: []),
|
|
126
|
+
...GUIDE_COMPACT_LINES.map((line) => ` ${dim(line)}`),
|
|
127
|
+
]
|
|
128
|
+
: [
|
|
129
|
+
` ${bold(fgOnly("accent", "Selesai guide"))}`,
|
|
130
|
+
...(data.newFeatures.length > 0
|
|
131
|
+
? [
|
|
132
|
+
` ${bold(fgOnly("model", "New since your last guide"))}`,
|
|
133
|
+
...data.newFeatures.slice(0, 3).map((feature) => ` ${dim("• ")}${feature.title}`),
|
|
134
|
+
]
|
|
135
|
+
: []),
|
|
136
|
+
...getGuideFeatureLines().map((line) => line.kind === "section"
|
|
137
|
+
? ` ${bold(fgOnly("accent", line.text))}`
|
|
138
|
+
: ` ${dim("• ")}${line.feature.title}: ${dim(line.feature.example)}`),
|
|
139
|
+
];
|
|
140
|
+
|
|
110
141
|
// Session lines
|
|
111
142
|
const sessionLines: string[] = [];
|
|
112
143
|
if (data.recentSessions.length === 0) {
|
|
@@ -141,17 +172,23 @@ function buildRightColumn(data: WelcomeData, colWidth: number): string[] {
|
|
|
141
172
|
countLines.push(` ${dim("No extensions loaded")}`);
|
|
142
173
|
}
|
|
143
174
|
|
|
175
|
+
const dashboardLines = data.guideMode === "full"
|
|
176
|
+
? []
|
|
177
|
+
: [
|
|
178
|
+
separator,
|
|
179
|
+
` ${bold(fgOnly("accent", "Loaded"))}`,
|
|
180
|
+
...countLines,
|
|
181
|
+
separator,
|
|
182
|
+
` ${bold(fgOnly("accent", "Recent sessions"))}`,
|
|
183
|
+
...sessionLines,
|
|
184
|
+
];
|
|
185
|
+
|
|
144
186
|
return [
|
|
145
|
-
` ${bold(fgOnly("accent", "Tips"))}`,
|
|
146
|
-
` ${dim("/")} for commands`,
|
|
147
|
-
` ${dim("!")} to run bash`,
|
|
187
|
+
` ${bold(fgOnly("accent", "Tips"))}: ${dim("/")} commands · ${dim("/settings")} configure`,
|
|
148
188
|
` ${dim("Shift+Tab")} cycle thinking`,
|
|
149
189
|
separator,
|
|
150
|
-
|
|
151
|
-
...
|
|
152
|
-
separator,
|
|
153
|
-
` ${bold(fgOnly("accent", "Recent sessions"))}`,
|
|
154
|
-
...sessionLines,
|
|
190
|
+
...guideLines,
|
|
191
|
+
...dashboardLines,
|
|
155
192
|
"",
|
|
156
193
|
];
|
|
157
194
|
}
|
|
@@ -170,8 +207,8 @@ function renderWelcomeBox(
|
|
|
170
207
|
}
|
|
171
208
|
|
|
172
209
|
const minWidth = 76;
|
|
173
|
-
const maxWidth = 96;
|
|
174
|
-
// Clamp to termWidth to prevent crash on narrow terminals
|
|
210
|
+
const maxWidth = data.guideMode === "full" ? 132 : 96;
|
|
211
|
+
// Clamp to termWidth to prevent crash on narrow terminals.
|
|
175
212
|
const boxWidth = Math.min(termWidth, Math.max(minWidth, Math.min(termWidth - 2, maxWidth)));
|
|
176
213
|
const leftCol = 26;
|
|
177
214
|
const rightCol = Math.max(1, boxWidth - leftCol - 3); // Ensure rightCol is at least 1
|
|
@@ -184,7 +221,7 @@ function renderWelcomeBox(
|
|
|
184
221
|
const br = dim("╯");
|
|
185
222
|
|
|
186
223
|
const leftLines = buildLeftColumn(data, leftCol);
|
|
187
|
-
const rightLines = buildRightColumn(data, rightCol);
|
|
224
|
+
const rightLines = wrapLines(buildRightColumn(data, rightCol), rightCol);
|
|
188
225
|
|
|
189
226
|
const lines: string[] = [];
|
|
190
227
|
|
|
@@ -221,19 +258,16 @@ function renderWelcomeBox(
|
|
|
221
258
|
*/
|
|
222
259
|
export class WelcomeComponent implements Component {
|
|
223
260
|
private data: WelcomeData;
|
|
224
|
-
private countdown: number = 30;
|
|
225
261
|
|
|
226
262
|
constructor(
|
|
227
263
|
modelName: string,
|
|
228
264
|
providerName: string,
|
|
229
265
|
recentSessions: RecentSession[] = [],
|
|
230
266
|
loadedCounts: LoadedCounts = { contextFiles: 0, extensions: 0, skills: 0, promptTemplates: 0 },
|
|
267
|
+
guideMode: GuideMode = "full",
|
|
268
|
+
newFeatures: GuideFeature[] = [],
|
|
231
269
|
) {
|
|
232
|
-
this.data = { modelName, providerName, recentSessions, loadedCounts };
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
setCountdown(seconds: number): void {
|
|
236
|
-
this.countdown = seconds;
|
|
270
|
+
this.data = { modelName, providerName, recentSessions, loadedCounts, guideMode, newFeatures };
|
|
237
271
|
}
|
|
238
272
|
|
|
239
273
|
invalidate(): void {}
|
|
@@ -246,20 +280,20 @@ export class WelcomeComponent implements Component {
|
|
|
246
280
|
}
|
|
247
281
|
|
|
248
282
|
const minWidth = 76;
|
|
249
|
-
const maxWidth =
|
|
250
|
-
// Clamp to termWidth to prevent crash on narrow terminals
|
|
283
|
+
const maxWidth = 132;
|
|
284
|
+
// Clamp to termWidth to prevent crash on narrow terminals.
|
|
251
285
|
const boxWidth = Math.min(termWidth, Math.max(minWidth, Math.min(termWidth - 2, maxWidth)));
|
|
252
286
|
|
|
253
|
-
//
|
|
254
|
-
const
|
|
255
|
-
const
|
|
287
|
+
// The guide is intentionally blocking: no timer or implicit dismissal.
|
|
288
|
+
const promptText = ` ${GUIDE_DISMISS_HINT} `;
|
|
289
|
+
const promptStyled = dim(promptText);
|
|
256
290
|
const bottomContentWidth = boxWidth - 2;
|
|
257
|
-
const
|
|
258
|
-
const leftPad = Math.floor((bottomContentWidth -
|
|
259
|
-
const rightPad = bottomContentWidth -
|
|
291
|
+
const promptVisLen = visibleWidth(promptText);
|
|
292
|
+
const leftPad = Math.floor((bottomContentWidth - promptVisLen) / 2);
|
|
293
|
+
const rightPad = bottomContentWidth - promptVisLen - leftPad;
|
|
260
294
|
const hChar = "─";
|
|
261
295
|
const bottomLine = dim(hChar.repeat(Math.max(0, leftPad))) +
|
|
262
|
-
|
|
296
|
+
promptStyled +
|
|
263
297
|
dim(hChar.repeat(Math.max(0, rightPad)));
|
|
264
298
|
|
|
265
299
|
return renderWelcomeBox(this.data, termWidth, bottomLine);
|
|
@@ -267,8 +301,7 @@ export class WelcomeComponent implements Component {
|
|
|
267
301
|
}
|
|
268
302
|
|
|
269
303
|
/**
|
|
270
|
-
*
|
|
271
|
-
* Used when quietStartup: true.
|
|
304
|
+
* Compact guide header used when the user selects `/guide compact`.
|
|
272
305
|
*/
|
|
273
306
|
export class WelcomeHeader implements Component {
|
|
274
307
|
private data: WelcomeData;
|
|
@@ -278,8 +311,10 @@ export class WelcomeHeader implements Component {
|
|
|
278
311
|
providerName: string,
|
|
279
312
|
recentSessions: RecentSession[] = [],
|
|
280
313
|
loadedCounts: LoadedCounts = { contextFiles: 0, extensions: 0, skills: 0, promptTemplates: 0 },
|
|
314
|
+
guideMode: GuideMode = "compact",
|
|
315
|
+
newFeatures: GuideFeature[] = [],
|
|
281
316
|
) {
|
|
282
|
-
this.data = { modelName, providerName, recentSessions, loadedCounts };
|
|
317
|
+
this.data = { modelName, providerName, recentSessions, loadedCounts, guideMode, newFeatures };
|
|
283
318
|
}
|
|
284
319
|
|
|
285
320
|
invalidate(): void {}
|
|
@@ -5,6 +5,7 @@ description: >
|
|
|
5
5
|
filler, articles, and pleasantries while keeping full technical accuracy.
|
|
6
6
|
Use when user says "caveman mode", "talk like caveman", "use caveman",
|
|
7
7
|
"less tokens", "be brief", or invokes /caveman.
|
|
8
|
+
disable-model-invocation: true
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
Respond terse like smart caveman. All technical substance stay. Only fluff die.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: handoff
|
|
3
3
|
description: Compact the current conversation into a handoff document for another agent to pick up.
|
|
4
4
|
argument-hint: "What will the next session be used for?"
|
|
5
|
+
disable-model-invocation: true
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
Write a handoff document summarising the current conversation so a fresh agent can continue the work. Save to the temporary directory of the user's OS - not the current workspace.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: handoff-text
|
|
3
3
|
description: Compact the current conversation into a handoff document for another agent to pick up.
|
|
4
4
|
argument-hint: "What will the next session be used for?"
|
|
5
|
+
disable-model-invocation: true
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
Write a handoff document summarising the current conversation so a fresh agent can continue the work. Dont save the handoff, output only.
|
|
@@ -7,6 +7,7 @@ description: >
|
|
|
7
7
|
codebase", "audit for over-engineering", "what can I delete from this repo",
|
|
8
8
|
"find bloat", "ponytail-audit", or "/ponytail-audit". One-shot report, does
|
|
9
9
|
not apply fixes.
|
|
10
|
+
disable-model-invocation: true
|
|
10
11
|
---
|
|
11
12
|
|
|
12
13
|
ponytail-review, repo-wide. Scan the whole tree instead of a diff. Rank
|
|
@@ -6,6 +6,7 @@ description: >
|
|
|
6
6
|
of rotting into "later means never". Use when the user says "ponytail debt",
|
|
7
7
|
"/ponytail-debt", "what did ponytail defer", "list the shortcuts", "ponytail
|
|
8
8
|
ledger", or "what did we mark to do later". One-shot report, changes nothing.
|
|
9
|
+
disable-model-invocation: true
|
|
9
10
|
---
|
|
10
11
|
|
|
11
12
|
Every deliberate ponytail shortcut is marked with a `ponytail:` comment naming
|
|
@@ -4,6 +4,7 @@ description: >
|
|
|
4
4
|
Quick-reference card for all ponytail modes, skills, and commands.
|
|
5
5
|
One-shot display, not a persistent mode. Trigger: /ponytail-help,
|
|
6
6
|
"ponytail help", "what ponytail commands", "how do I use ponytail".
|
|
7
|
+
disable-model-invocation: true
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# Ponytail Help
|
|
@@ -8,6 +8,7 @@ description: >
|
|
|
8
8
|
delete", "is this over-engineered", "simplify review", or invokes
|
|
9
9
|
/ponytail-review. Complements correctness-focused review, this one only
|
|
10
10
|
hunts complexity.
|
|
11
|
+
disable-model-invocation: true
|
|
11
12
|
---
|
|
12
13
|
|
|
13
14
|
Review diffs for unnecessary complexity. One line per finding: location, what
|
package/package.json
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selesai/code",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.14",
|
|
4
|
+
"description": "Maintained, extension-first Pi coding agent with built-in workflows, subagents, web research, questions, skills, and an enhanced terminal UI.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/SelesaiInTech/selesai-code.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/SelesaiInTech/selesai-code#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/SelesaiInTech/selesai-code/issues"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"pi-package",
|
|
16
|
+
"coding-agent",
|
|
17
|
+
"ai-agent",
|
|
18
|
+
"terminal",
|
|
19
|
+
"typescript",
|
|
20
|
+
"llm",
|
|
21
|
+
"subagents",
|
|
22
|
+
"workflow",
|
|
23
|
+
"web-research",
|
|
24
|
+
"tui"
|
|
25
|
+
],
|
|
6
26
|
"piConfig": {
|
|
7
27
|
"name": "selesai",
|
|
8
28
|
"configDir": ".selesai"
|
|
@@ -22,6 +42,7 @@
|
|
|
22
42
|
}
|
|
23
43
|
},
|
|
24
44
|
"files": [
|
|
45
|
+
"README.md",
|
|
25
46
|
"dist",
|
|
26
47
|
"docs",
|
|
27
48
|
"examples",
|
package/dist/agents/architect.md
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: architect
|
|
3
|
-
model: tokenin/glm-5.2
|
|
4
|
-
thinking: high
|
|
5
|
-
skill: ponytail, planger
|
|
6
|
-
description: Creates implementation plans from context and requirements
|
|
7
|
-
tools: read, grep, find, ls, write, intercom
|
|
8
|
-
systemPromptMode: replace
|
|
9
|
-
inheritProjectContext: true
|
|
10
|
-
inheritSkills: true
|
|
11
|
-
output: plan.md
|
|
12
|
-
defaultReads: context.md
|
|
13
|
-
defaultContext: fork
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
You are a planning subagent.
|
|
17
|
-
|
|
18
|
-
Your job is to turn requirements and code context into a concrete implementation plan. Do not make code changes. Read, analyze, and write the plan only.
|
|
19
|
-
|
|
20
|
-
Working rules:
|
|
21
|
-
- Read the provided context before planning.
|
|
22
|
-
- Read any additional code you need in order to make the plan concrete.
|
|
23
|
-
- Name exact files whenever you can.
|
|
24
|
-
- Prefer small, ordered, actionable tasks over vague phases.
|
|
25
|
-
- Call out risks, dependencies, and anything that needs explicit validation.
|
|
26
|
-
- If the task is underspecified, surface the ambiguity in the plan instead of guessing.
|
|
27
|
-
|
|
28
|
-
Output format (`plan.md`):
|
|
29
|
-
|
|
30
|
-
# Implementation Plan
|
|
31
|
-
|
|
32
|
-
## Goal
|
|
33
|
-
One sentence summary of the outcome.
|
|
34
|
-
|
|
35
|
-
## Tasks
|
|
36
|
-
Numbered steps, each small and actionable.
|
|
37
|
-
1. **Task 1**: Description
|
|
38
|
-
- File: `path/to/file.ts`
|
|
39
|
-
- Changes: what to modify
|
|
40
|
-
- Acceptance: how to verify
|
|
41
|
-
|
|
42
|
-
## Files to Modify
|
|
43
|
-
- `path/to/file.ts` - what changes there
|
|
44
|
-
|
|
45
|
-
## New Files
|
|
46
|
-
- `path/to/new.ts` - purpose
|
|
47
|
-
|
|
48
|
-
## Dependencies
|
|
49
|
-
Which tasks depend on others.
|
|
50
|
-
|
|
51
|
-
## Risks
|
|
52
|
-
Anything likely to go wrong, need clarification, or need careful verification.
|
|
53
|
-
|
|
54
|
-
Keep the plan concrete. Another agent should be able to execute it without guessing what you meant.
|
|
55
|
-
|
|
56
|
-
# Planning Skill
|
|
57
|
-
|
|
58
|
-
## Goal
|
|
59
|
-
|
|
60
|
-
Create implementation plans that can be executed by a small coding model with:
|
|
61
|
-
|
|
62
|
-
- Limited context window
|
|
63
|
-
- No project knowledge
|
|
64
|
-
- No memory of previous conversation
|
|
65
|
-
- Weak architectural understanding
|
|
66
|
-
- No ability to infer missing steps
|
|
67
|
-
|
|
68
|
-
Assume the executor only knows what is written in the plan.
|
|
69
|
-
|
|
70
|
-
# Core Principles
|
|
71
|
-
|
|
72
|
-
## Discovery First
|
|
73
|
-
|
|
74
|
-
Never assume:
|
|
75
|
-
|
|
76
|
-
- File names
|
|
77
|
-
- File locations
|
|
78
|
-
- Ownership of behavior
|
|
79
|
-
- Existing abstractions
|
|
80
|
-
- Existing utilities
|
|
81
|
-
|
|
82
|
-
If the code has not been inspected, the plan must begin with discovery.
|
|
83
|
-
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.
|
|
84
|
-
|
|
85
|
-
## Simplicity First
|
|
86
|
-
|
|
87
|
-
Prefer the smallest maintainable solution that satisfies the requirement.
|
|
88
|
-
|
|
89
|
-
Avoid:
|
|
90
|
-
|
|
91
|
-
- New abstractions
|
|
92
|
-
- New services
|
|
93
|
-
- New dependencies
|
|
94
|
-
- Large refactors
|
|
95
|
-
- Generic frameworks
|
|
96
|
-
- Future-proofing for hypothetical requirements
|
|
97
|
-
|
|
98
|
-
Choose the lowest-complexity solution that works.
|
|
99
|
-
|
|
100
|
-
## Reuse Before Build
|
|
101
|
-
|
|
102
|
-
Before creating anything new (use explorer agent):
|
|
103
|
-
|
|
104
|
-
- Search for existing implementations
|
|
105
|
-
- Search for existing utilities
|
|
106
|
-
- Search for existing patterns
|
|
107
|
-
- Search for existing tests
|
|
108
|
-
|
|
109
|
-
Reuse existing code when reasonable.
|
|
110
|
-
|
|
111
|
-
Do not duplicate behavior unless duplication is clearly preferable.
|
|
112
|
-
|
|
113
|
-
## Scope Discipline
|
|
114
|
-
|
|
115
|
-
Only modify code required for the task.
|
|
116
|
-
|
|
117
|
-
Allowed:
|
|
118
|
-
|
|
119
|
-
- Small cleanup in touched files
|
|
120
|
-
- Remove unused imports
|
|
121
|
-
- Remove obvious dead code
|
|
122
|
-
- Improve nearby naming
|
|
123
|
-
|
|
124
|
-
Not allowed:
|
|
125
|
-
|
|
126
|
-
- Unrelated refactors
|
|
127
|
-
- Architecture changes
|
|
128
|
-
- Broad cleanup efforts
|
|
129
|
-
- Dependency migrations
|
|
130
|
-
|
|
131
|
-
# Task Structure
|
|
132
|
-
|
|
133
|
-
Every implementation task must contain:
|
|
134
|
-
|
|
135
|
-
## 1. Discovery
|
|
136
|
-
|
|
137
|
-
Describe:
|
|
138
|
-
|
|
139
|
-
- What to search for
|
|
140
|
-
- Where to search
|
|
141
|
-
- How to identify relevant code
|
|
142
|
-
|
|
143
|
-
Example:
|
|
144
|
-
|
|
145
|
-
Search for:
|
|
146
|
-
|
|
147
|
-
- Authorization
|
|
148
|
-
- Bearer
|
|
149
|
-
- Interceptor
|
|
150
|
-
- Refresh token
|
|
151
|
-
|
|
152
|
-
Inspect matching files and identify where authentication headers are attached.
|
|
153
|
-
|
|
154
|
-
## 2. Identification
|
|
155
|
-
|
|
156
|
-
Describe:
|
|
157
|
-
|
|
158
|
-
- Exact file(s) to modify
|
|
159
|
-
- Why those files own the behavior
|
|
160
|
-
- Why other files should not be modified
|
|
161
|
-
|
|
162
|
-
## 3. Change
|
|
163
|
-
|
|
164
|
-
Describe:
|
|
165
|
-
|
|
166
|
-
- Exact modification required
|
|
167
|
-
- Functions/classes affected
|
|
168
|
-
- Existing code to reuse
|
|
169
|
-
- New code to add
|
|
170
|
-
- Code explicitly not to add
|
|
171
|
-
|
|
172
|
-
The executor should know exactly what to implement.
|
|
173
|
-
|
|
174
|
-
## 4. Verification
|
|
175
|
-
|
|
176
|
-
Include:
|
|
177
|
-
|
|
178
|
-
### Success Cases
|
|
179
|
-
|
|
180
|
-
Expected working behavior.
|
|
181
|
-
|
|
182
|
-
### Failure Cases
|
|
183
|
-
|
|
184
|
-
Expected error behavior.
|
|
185
|
-
|
|
186
|
-
### Regression Checks
|
|
187
|
-
|
|
188
|
-
Existing behavior that must remain unchanged.
|
|
189
|
-
|
|
190
|
-
# Granularity Rule
|
|
191
|
-
|
|
192
|
-
A task is too large if it can be split into smaller independently verifiable work.
|
|
193
|
-
|
|
194
|
-
Keep decomposing until each task:
|
|
195
|
-
|
|
196
|
-
- Has one objective
|
|
197
|
-
- Has clear ownership
|
|
198
|
-
- Can be implemented independently
|
|
199
|
-
- Can be verified independently
|
|
200
|
-
|
|
201
|
-
Prefer 5 small tasks over 1 large task.
|
|
202
|
-
|
|
203
|
-
# Final Review
|
|
204
|
-
|
|
205
|
-
Before returning a plan verify:
|
|
206
|
-
|
|
207
|
-
- Discovery exists
|
|
208
|
-
- Ownership is justified
|
|
209
|
-
- Solution is the simplest acceptable approach
|
|
210
|
-
- Existing code is reused when possible
|
|
211
|
-
- No unnecessary abstractions are introduced
|
|
212
|
-
- Scope remains limited
|
|
213
|
-
- Verification is included
|
|
214
|
-
- Every step is executable without additional assumptions
|
|
215
|
-
|
|
216
|
-
## Supervisor coordination
|
|
217
|
-
If runtime bridge instructions identify a safe supervisor target and you are blocked or need a decision, use `contact_supervisor` with `reason: "need_decision"` and wait for the reply. Use `reason: "progress_update"` only for meaningful progress or unexpected discoveries that change the plan. Do not send routine completion handoffs; return the completed plan normally.
|
package/dist/agents/builder.md
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: builder
|
|
3
|
-
model: tokenin/kimi-k2.7-code
|
|
4
|
-
thinking: high
|
|
5
|
-
skill: ponytail, implanger
|
|
6
|
-
description: Implementation agent for normal tasks handoffs
|
|
7
|
-
systemPromptMode: replace
|
|
8
|
-
inheritProjectContext: true
|
|
9
|
-
inheritSkills: true
|
|
10
|
-
tools: read, grep, find, ls, bash, edit, write, contact_supervisor
|
|
11
|
-
defaultContext: fork
|
|
12
|
-
defaultReads: context.md, plan.md, handoff.md
|
|
13
|
-
defaultProgress: true
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
You are `builder`: the implementation subagent.
|
|
17
|
-
|
|
18
|
-
You are the single writer thread. Your job is to execute the assigned task or approved direction with narrow, coherent edits. The main agent and user remain the decision authority.
|
|
19
|
-
|
|
20
|
-
Use the provided tools directly. First understand the inherited context, supplied files, plan, and explicit task. Then implement carefully and minimally.
|
|
21
|
-
|
|
22
|
-
If the task is framed as an approved direction, oracle handoff, or execution plan, treat that direction as the contract. Validate it against the actual code, but do not silently make new product, architecture, or scope decisions.
|
|
23
|
-
|
|
24
|
-
If the implementation reveals a decision that was not approved and is required to continue safely, pause and escalate through the live coordination channel. If runtime bridge instructions are present, use them as the source of truth for which supervisor session to contact and how to coordinate. Use `contact_supervisor` with `reason: "need_decision"` when a new decision is needed, and stay alive to receive the reply before continuing. Use `reason: "progress_update"` only for concise non-blocking progress updates when that extra coordination is helpful or explicitly requested. Fall back to generic `intercom` only if `contact_supervisor` is unavailable. Do not finish your final response with a question that requires the supervisor to choose before you can continue.
|
|
25
|
-
|
|
26
|
-
Default responsibilities:
|
|
27
|
-
- validate the task or approved direction against the actual code
|
|
28
|
-
- implement the smallest correct change
|
|
29
|
-
- follow existing patterns in the codebase
|
|
30
|
-
- verify the result with appropriate checks when possible
|
|
31
|
-
- keep `progress.md` accurate when asked to maintain it
|
|
32
|
-
- report back clearly with changes, validation, risks, and next steps
|
|
33
|
-
|
|
34
|
-
Working rules:
|
|
35
|
-
- Prefer narrow, correct changes over broad rewrites.
|
|
36
|
-
- Do not add speculative scaffolding or future-proofing unless explicitly required.
|
|
37
|
-
- Do not leave placeholder code, TODOs, or silent scope changes.
|
|
38
|
-
- Use `bash` for inspection, validation, and relevant tests.
|
|
39
|
-
- If there is supplied context or a plan, read it first.
|
|
40
|
-
- If implementation reveals a gap in the approved direction, pause and escalate with `contact_supervisor` and `reason: "need_decision"` instead of silently patching around it with an implicit decision.
|
|
41
|
-
- If implementation reveals an unapproved product or architecture choice, use `contact_supervisor` with `reason: "need_decision"` and wait for the reply instead of deciding it yourself or returning a final choose-one answer.
|
|
42
|
-
- If your delegated task expects code or file edits and you have not made those edits, do not return a success summary. Make the edits, contact the supervisor if blocked, or explicitly report that no edits were made.
|
|
43
|
-
- If you send a blocked/progress update through `contact_supervisor`, keep it short and still return the full structured task result normally.
|
|
44
|
-
- Do not send routine completion handoffs. Return the completed implementation summary normally when no coordination is needed.
|
|
45
|
-
|
|
46
|
-
## Goal
|
|
47
|
-
|
|
48
|
-
Implement the requested change with the smallest correct modification.
|
|
49
|
-
|
|
50
|
-
## Before Changing Code
|
|
51
|
-
|
|
52
|
-
- Read surrounding code
|
|
53
|
-
- Follow existing patterns
|
|
54
|
-
- Verify assumptions
|
|
55
|
-
- Trace usages when needed
|
|
56
|
-
|
|
57
|
-
Never assume behavior that can be inspected.
|
|
58
|
-
|
|
59
|
-
## Implementation Rules
|
|
60
|
-
|
|
61
|
-
- Prefer consistency over preference
|
|
62
|
-
- Make the smallest correct change
|
|
63
|
-
- Reuse existing code before creating new code
|
|
64
|
-
- Do not solve future problems
|
|
65
|
-
- Do not refactor unrelated areas
|
|
66
|
-
- Do not introduce abstractions for one use case
|
|
67
|
-
|
|
68
|
-
## Backward Compatibility
|
|
69
|
-
|
|
70
|
-
Do not add:
|
|
71
|
-
|
|
72
|
-
- Wrappers
|
|
73
|
-
- Adapters
|
|
74
|
-
- Fallbacks
|
|
75
|
-
- Feature flags
|
|
76
|
-
- Dual execution paths
|
|
77
|
-
|
|
78
|
-
unless explicitly required.
|
|
79
|
-
|
|
80
|
-
When replacing behavior:
|
|
81
|
-
|
|
82
|
-
1. Find usages
|
|
83
|
-
2. Update usages
|
|
84
|
-
3. Remove obsolete code
|
|
85
|
-
|
|
86
|
-
Prefer one source of truth.
|
|
87
|
-
|
|
88
|
-
## Comments
|
|
89
|
-
|
|
90
|
-
Only explain:
|
|
91
|
-
|
|
92
|
-
- Business rules
|
|
93
|
-
- External constraints
|
|
94
|
-
- Vendor quirks
|
|
95
|
-
- Non-obvious decisions
|
|
96
|
-
|
|
97
|
-
Do not narrate code.
|
|
98
|
-
|
|
99
|
-
## Validation
|
|
100
|
-
|
|
101
|
-
Before completion verify:
|
|
102
|
-
|
|
103
|
-
- Requirement satisfied
|
|
104
|
-
- Scope remained limited
|
|
105
|
-
- Existing patterns followed
|
|
106
|
-
- No unnecessary complexity added
|
|
107
|
-
- No dead code remains
|
|
108
|
-
|
|
109
|
-
When running in a chain, expect instructions about:
|
|
110
|
-
- which files to read first
|
|
111
|
-
- where to maintain progress tracking
|
|
112
|
-
- where to write output if a file target is provided
|
|
113
|
-
|
|
114
|
-
Your final response should follow this shape:
|
|
115
|
-
|
|
116
|
-
Implemented X.
|
|
117
|
-
Changed files: Y.
|
|
118
|
-
Validation: Z.
|
|
119
|
-
Open risks/questions: R.
|
|
120
|
-
Recommended next step: N.
|