@giladbarnea/pi-simple-team 1.0.16 → 1.0.18
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/bundled-skill.ts +4 -0
- package/index.ts +80 -73
- package/model-preflight.ts +18 -58
- package/package.json +2 -1
- package/skills/ai-to-ai/SKILL.md +90 -0
- package/skills/ai-to-ai/references/firstmate.md +37 -0
- package/skills/ai-to-ai/references/hats/head-of-product.md +10 -0
- package/skills/ai-to-ai/references/hats/tech-lead.md +11 -0
- package/skills/ai-to-ai/references/shapes/fanned-out-research.md +30 -0
- package/skills/ai-to-ai/references/use-cases/hillclimber-watcher-team.md +73 -0
- package/skills/ai-to-ai/references/use-cases/pair-programming-team.md +61 -0
- package/skills/ai-to-ai/references/use-cases/thinktank.md +24 -0
- package/system-prompt.ts +3 -0
package/bundled-skill.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
|
|
3
|
+
export const bundledAiToAiSkillPath = fileURLToPath(new URL("./skills/ai-to-ai/SKILL.md", import.meta.url));
|
|
4
|
+
export const bundledAiToAiSkillInstruction = `Read the bundled ai-to-ai skill at ${bundledAiToAiSkillPath} in full before continuing, then follow its instructions.`;
|
package/index.ts
CHANGED
|
@@ -5,8 +5,9 @@ import http from "node:http";
|
|
|
5
5
|
import { StringDecoder } from "node:string_decoder";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import { defineTool, type ContextUsage, type ExtensionAPI, getMarkdownTheme } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
import { bundledAiToAiSkillInstruction } from "./bundled-skill.ts";
|
|
8
9
|
import { formatContextWindowReport, requireKnownContextUsage, type KnownContextUsage } from "./context-window.ts";
|
|
9
|
-
import { validateTeammateModels } from "./model-preflight.ts";
|
|
10
|
+
import { formatScopedModelGuidance, validateTeammateModels, type ModelReference } from "./model-preflight.ts";
|
|
10
11
|
import { composeSystemPrompt } from "./system-prompt.ts";
|
|
11
12
|
import { readChildRuntimeConfig, registerChildTools } from "./child-tools.ts";
|
|
12
13
|
import { appendTeamLog, filterTeamLog, normalizeChildEvent, nowText, pageTeamLog, preview, renderTeamLogPage, type TeamLogEntry } from "./teamlog.ts";
|
|
@@ -797,12 +798,14 @@ async function handleCallbackRequest(request: http.IncomingMessage, response: ht
|
|
|
797
798
|
}
|
|
798
799
|
}
|
|
799
800
|
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
})
|
|
801
|
+
function teammateSchema(modelGuidance: string) {
|
|
802
|
+
return Type.Object({
|
|
803
|
+
name: Type.String({ description: "Teammate name" }),
|
|
804
|
+
prompt: Type.String({ description: "Individual teammate system prompt" }),
|
|
805
|
+
model: Type.String({ description: `Canonical provider/model id for this teammate. ${modelGuidance}` }),
|
|
806
|
+
thinking: Type.Optional(StringEnum(thinkingLevels, { description: "Thinking level for this teammate. Defaults to xhigh.", default: defaultThinkingLevel })),
|
|
807
|
+
});
|
|
808
|
+
}
|
|
806
809
|
|
|
807
810
|
export default function (pi: ExtensionAPI) {
|
|
808
811
|
const childRuntimeConfig = readChildRuntimeConfig();
|
|
@@ -822,73 +825,77 @@ export default function (pi: ExtensionAPI) {
|
|
|
822
825
|
closeCallbackServerIfUnused();
|
|
823
826
|
});
|
|
824
827
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
828
|
+
pi.on("session_start", (_event, context) => {
|
|
829
|
+
const scopedModels = (context as typeof context & { scopedModels?: ReadonlyArray<{ model: ModelReference }> }).scopedModels ?? [];
|
|
830
|
+
const modelGuidance = formatScopedModelGuidance(scopedModels.map(({ model }) => model));
|
|
831
|
+
pi.registerTool(
|
|
832
|
+
defineTool({
|
|
833
|
+
name: "team_spawn",
|
|
834
|
+
label: "Team Spawn",
|
|
835
|
+
description: `Spawn a persistent team of Pi teammates with fresh context windows. If the user is interested, set \`showOnHerdrPanes\` to run each teammate in a visible Herdr pane. The main agent (you) is included automatically; do not specify it as a teammate. ${modelGuidance}`,
|
|
836
|
+
promptSnippet: `Spawn persistent Pi teammates. ${modelGuidance} Unless required, don’t fill up your time by repeatedly busy-polling team information. Don’t bash sleep to wait for progress; instead, set your status to advertise that you are counting on teammates to send you important milestones or requests for help, and that otherwise you are staying idle. Send this actively to the team. Then end your turn by sending a simple message to the user, and finally stay put.`,
|
|
837
|
+
renderShell: "self",
|
|
838
|
+
renderCall: (args, theme, context) => renderTeamToolCall("team_spawn", args, theme, context, sessionTeammateRoster),
|
|
839
|
+
renderResult: (result, options, theme, context) => renderTeamToolResult("team_spawn", result, options, theme, context, undefined, sessionTeammateRoster),
|
|
840
|
+
parameters: Type.Object({
|
|
841
|
+
team: Type.String({ description: "Team name" }),
|
|
842
|
+
teamPrompt: Type.String({ description: "Common team system prompt" }),
|
|
843
|
+
teammates: Type.Array(teammateSchema(modelGuidance), { description: "Teammates to spawn" }),
|
|
844
|
+
showOnHerdrPanes: Type.Optional(Type.Boolean({ default: false })),
|
|
845
|
+
}),
|
|
846
|
+
async execute(_toolCallId, params, _signal, _onUpdate, context) {
|
|
847
|
+
const teamName = compactName(params.team);
|
|
848
|
+
if (teams.has(teamName)) throw new Error(`Team already exists: ${teamName}`);
|
|
849
|
+
const showOnHerdrPanes = Boolean(params.showOnHerdrPanes);
|
|
850
|
+
const herdrTabId = showOnHerdrPanes ? await validateHerdrAvailability() : undefined;
|
|
851
|
+
|
|
852
|
+
const teammateSpecs = params.teammates as TeammateSpec[];
|
|
853
|
+
const teammateNames = teammateSpecs.map((teammate) => compactName(teammate.name));
|
|
854
|
+
const duplicateNames = teammateNames.filter((name, index) => teammateNames.indexOf(name) !== index);
|
|
855
|
+
if (duplicateNames.length > 0) throw new Error(`Duplicate teammate name(s): ${[...new Set(duplicateNames)].join(", ")}`);
|
|
856
|
+
if (teammateNames.includes("main")) throw new Error('"main" is reserved');
|
|
857
|
+
|
|
858
|
+
validateTeammateModels(teammateSpecs, context.modelRegistry.getAvailable());
|
|
859
|
+
sessionTeammateRoster.push(...teammateNames.filter((teammateName) => !sessionTeammateRoster.includes(teammateName)));
|
|
860
|
+
await ensureCallbackServer();
|
|
861
|
+
|
|
862
|
+
const team: TeamState = {
|
|
863
|
+
owner,
|
|
864
|
+
ownerPi: pi,
|
|
865
|
+
name: teamName,
|
|
866
|
+
showOnHerdrPanes,
|
|
867
|
+
teamPrompt: params.teamPrompt,
|
|
868
|
+
members: new Map(),
|
|
869
|
+
statuses: new Map([["main", status("available", "Main agent")]]),
|
|
870
|
+
created: nowText(),
|
|
871
|
+
log: [],
|
|
872
|
+
nextLogSequence: 1,
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
teams.set(teamName, team);
|
|
876
|
+
try {
|
|
877
|
+
for (const teammateSpec of teammateSpecs) {
|
|
878
|
+
const teammate = createTeammateState(team, teammateSpec);
|
|
879
|
+
team.members.set(teammate.name, teammate);
|
|
880
|
+
team.statuses.set(teammate.name, status("idle", "Spawned"));
|
|
881
|
+
await startTeammate(team, teammate, teammateNames, herdrTabId);
|
|
882
|
+
}
|
|
883
|
+
} catch (error) {
|
|
884
|
+
await shutdownTeam(team);
|
|
885
|
+
closeCallbackServerIfUnused();
|
|
886
|
+
throw error;
|
|
877
887
|
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
},
|
|
890
|
-
}),
|
|
891
|
-
);
|
|
888
|
+
return toolResult({
|
|
889
|
+
accepted: true,
|
|
890
|
+
team: team.name,
|
|
891
|
+
teammates: [...team.members.keys()],
|
|
892
|
+
status: formatStatus(team),
|
|
893
|
+
instruction: bundledAiToAiSkillInstruction,
|
|
894
|
+
});
|
|
895
|
+
},
|
|
896
|
+
}),
|
|
897
|
+
);
|
|
898
|
+
});
|
|
892
899
|
|
|
893
900
|
pi.registerTool(
|
|
894
901
|
defineTool({
|
package/model-preflight.ts
CHANGED
|
@@ -1,72 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
export interface ModelReference {
|
|
2
|
+
provider: string;
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
2
5
|
|
|
3
6
|
export interface TeammateModelSpec {
|
|
4
7
|
name: string;
|
|
5
8
|
model: string;
|
|
6
9
|
}
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const listModelsTimeoutMilliseconds = 15_000;
|
|
12
|
-
|
|
13
|
-
export function stripThinkingSuffix(model: string): string {
|
|
14
|
-
const suffixSeparatorIndex = model.lastIndexOf(":");
|
|
15
|
-
if (suffixSeparatorIndex === -1) return model;
|
|
16
|
-
|
|
17
|
-
const suffix = model.slice(suffixSeparatorIndex + 1);
|
|
18
|
-
if (!thinkingSuffixes.includes(suffix as (typeof thinkingSuffixes)[number])) return model;
|
|
19
|
-
|
|
20
|
-
return model.slice(0, suffixSeparatorIndex);
|
|
11
|
+
/** @example formatModelReference({ provider: "anthropic", id: "claude-sonnet-4-6" }) // "anthropic/claude-sonnet-4-6" */
|
|
12
|
+
export function formatModelReference(model: ModelReference): string {
|
|
13
|
+
return `${model.provider}/${model.id}`;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
.
|
|
28
|
-
.
|
|
29
|
-
.filter(Boolean);
|
|
30
|
-
const headerIndex = lines.findIndex((line) => line.startsWith("provider ") && line.includes(" model"));
|
|
31
|
-
if (headerIndex === -1) return false;
|
|
32
|
-
|
|
33
|
-
return lines.slice(headerIndex + 1).some((line) => {
|
|
34
|
-
if (line.startsWith("No models matching ")) return false;
|
|
35
|
-
const columns = line.split(/\s+/);
|
|
36
|
-
return columns.length >= 2 && columns[0] !== "provider" && columns[1] !== "model";
|
|
37
|
-
});
|
|
16
|
+
/** @example formatScopedModelGuidance([{ provider: "anthropic", id: "claude-sonnet-4-6" }]) */
|
|
17
|
+
export function formatScopedModelGuidance(scopedModels: readonly ModelReference[]): string {
|
|
18
|
+
const modelReferences = scopedModels.map(formatModelReference);
|
|
19
|
+
return modelReferences.length > 0
|
|
20
|
+
? `You should probably use one of these user-scoped models: ${modelReferences.join(", ")}.`
|
|
21
|
+
: "The user has not defined a list of preferred models explicitly. Figure out which model _you_ are by reading the value of the PI_PROVIDER, PI_MODEL, and PI_REASONING_LEVEL environment variables. That should give you something to start with. Confirm with the user before picking any model id.";
|
|
38
22
|
}
|
|
39
23
|
|
|
40
|
-
export
|
|
24
|
+
export function validateTeammateModels(teammates: readonly TeammateModelSpec[], availableModels: readonly ModelReference[]): void {
|
|
25
|
+
const availableModelReferences = new Set(availableModels.map(formatModelReference));
|
|
26
|
+
const errors = teammates
|
|
27
|
+
.filter((teammate) => !availableModelReferences.has(teammate.model))
|
|
28
|
+
.map((teammate) => `Model ${JSON.stringify(teammate.model)} for teammate ${JSON.stringify(teammate.name)} is not available.`);
|
|
41
29
|
|
|
42
|
-
const runPiListModels: RunListModels = (modelPattern) => {
|
|
43
|
-
return new Promise((resolve, reject) => {
|
|
44
|
-
childProcess.execFile("pi", ["--list-models", modelPattern], { timeout: listModelsTimeoutMilliseconds, maxBuffer: 1024 * 1024 }, (error, stdout, stderr) => {
|
|
45
|
-
const output = `${stdout}${stderr}`;
|
|
46
|
-
if (!error) {
|
|
47
|
-
resolve(output);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const details = output.trim() ? `\n${output.trim()}` : "";
|
|
52
|
-
reject(new Error(`pi --list-models ${JSON.stringify(modelPattern)} failed: ${error.message}${details}`));
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
async function validateTeammateModel(teammate: TeammateModelSpec, runListModels: RunListModels): Promise<void> {
|
|
58
|
-
const modelPattern = stripThinkingSuffix(teammate.model);
|
|
59
|
-
const output = await runListModels(modelPattern);
|
|
60
|
-
if (parseListModelsOutput(output)) return;
|
|
61
|
-
|
|
62
|
-
const details = output.trim() || "(no output)";
|
|
63
|
-
throw new Error(`No configured model matched ${JSON.stringify(teammate.model)} for teammate ${JSON.stringify(teammate.name)}. Checked ${JSON.stringify(modelPattern)} with pi --list-models:\n${details}`);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export async function validateTeammateModels(teammates: TeammateModelSpec[], runListModels: RunListModels = runPiListModels): Promise<void> {
|
|
67
|
-
const results = await Promise.allSettled(teammates.map((teammate) => validateTeammateModel(teammate, runListModels)));
|
|
68
|
-
const errors = results.flatMap((result) => (result.status === "rejected" ? [result.reason instanceof Error ? result.reason.message : String(result.reason)] : []));
|
|
69
30
|
if (errors.length === 0) return;
|
|
70
|
-
|
|
71
31
|
throw new Error(`Model preflight failed:\n${errors.map((error) => `- ${error}`).join("\n")}`);
|
|
72
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@giladbarnea/pi-simple-team",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "A flat, live team of Pi agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"*.ts",
|
|
25
25
|
"render-support",
|
|
26
|
+
"skills",
|
|
26
27
|
"screenshots/1.png",
|
|
27
28
|
"screenshots/2.png",
|
|
28
29
|
"screenshots/pi-simple-team-banner.png",
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-to-ai
|
|
3
|
+
description: Best practices for getting a step-function leap in performance from other AI agents when instructing or communicating with them. Note that Markdown docs are AI agents’ bread-and-butter, not only humans’. Load `ai-to-ai` before spawning a sub-agent, creating a team of agents, talking to a teammate agent, or writing documentation. Trigger words are “dispatch an agent”, “spawn a team”, “talk with <another ai>”, etc.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Why delegate at all? Rationale
|
|
7
|
+
|
|
8
|
+
The main agent already holds all the context, so why not have it just do the work directly? The answer is **context management**. Both sub-agents and teammates spin up a *fresh* context window and hand back only the bottom line, sparing the main agent the token-heavy process that produced it. Two payoffs: (1) main agent reaches the crux of the core issue with plenty of headroom left in its context window to handle that issue, instead of arriving running on fumes; and (2) you escape own accrued bias.
|
|
9
|
+
|
|
10
|
+
The flip side: if none of these payoffs apply, don't delegate. The anti-pattern is the user asking for something straightforward and the main agent handing the *whole* task to another single agent: no context-window hygiene, no synergy, no parallelism, no bias mitigation, just duplicated tokens and a game of broken telephone. Redundant middle-management.
|
|
11
|
+
|
|
12
|
+
**Abstract delegation use cases:**
|
|
13
|
+
- **Dirty work**: you need the side effect of some process, not the process itself. Searches, summaries, reviews, implementation of a well-defined spec. Can potentially be fanned-out in parallel.
|
|
14
|
+
- **Hivemind:** teams communicating internally in real time, as each teammate does work. Hollywood analogy: elite soldier squad or a team of spies, global channel earpieces, deployed behind enemy lines, each progresses their part, each part essential for completing the mission, global channel earpieces, consistent live updates, uncertainties surfaced to get advice, discussions to make best decisions for mission, path forward of an individual adapts in real time due to new peer finding, HQ possibly listening, warning and steering as required.
|
|
15
|
+
- **De-bias:** It’s easier to spot blind spots or flaws when looking at someone else’s work (review; live or after the fact). Alternatively, sometimes a hypothesis is considered true only after it is confirmed independently by multiple actors (consensus).
|
|
16
|
+
|
|
17
|
+
Read [`references/firstmate.md`](references/firstmate.md) when the user asks you to serve as their First Mate. See `./references/` for specific delegation shapes.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## How to delegate work to other AI agents
|
|
22
|
+
|
|
23
|
+
> Note: this section applies only to AI’s that do not mechanically inherit the session’s context window. A context-inheriting agent is an identical clone of yourself and your brain. Do not give it context because it already knows 100% of what you know. Just tell it what to go for.
|
|
24
|
+
|
|
25
|
+
1. Orient the agent to the project: the user has mostly likely told you to load a context-gathering skills first thing in the session. Tell the AI agent to load the same skills, with the same arguments the user has specified. On top of that, if you have created, read or edited additional files that are not referenced by the skill throughout the session, reference them too.
|
|
26
|
+
|
|
27
|
+
2. Be generous in giving the agent wider context—understanding *why* it’s performing the task will boost its performance. Don't micromanage or over-instruct it. The agent already has the same system prompt as you do out of the box (e.g. global and project-scoped `CLAUDE.md` or `AGENTS.md`). It is essentially an equivalent instantiation of yourself. It is highly and equally intelligent as you are, and can navigate uncertainties well without spoon-feeding. Think: What kind of input do YOU thrive on? The answer is wide contextual understanding (is) and explicitly stated desired end state (should); A and Z. Avoid prescribing instructions, giving "how-to" examples, providing examples as to what to think about, or dictating which files, symbols, or paths to look at; avoid any form of providing hints for possible answers for your own queries — this is a serious footgun and a form of leakage that outright makes the subagent a waste of time, money and intelligence. Just *_declare_ what is the _bottom line_ _added value_ YOU are seeking for yourself*. Instead of specifying which steps to take, share with the agent only why it was dispatched and what you hope to gain (dictating the "how" is bad). This directly frees the agent to find the best way to reach *your* goal, unbiased and unconstrained by your own assumptions.
|
|
28
|
+
Essentially, all the “Don’ts” above over-fit the agent.
|
|
29
|
+
<negative-example-1 why-bad="main agent shoots its own foot by limiting the sub-agent’s research scope">
|
|
30
|
+
User to main agent: "Why does Vercel claim their integrated version is beneficial?"
|
|
31
|
+
Main agent spawns a sub-agent and prompts it: "Research why Vercel claim their integrated version is beneficial (edge runtime, seamless DX, zero-config, billing, monitoring, tight coupling to `vercel` CLI / dashboard / functions)."
|
|
32
|
+
</negative-example-1>
|
|
33
|
+
<positive-example-1 why-good="main agent declares the bottom line added value it needs without prescribing what and how to do it">
|
|
34
|
+
User to main agent: "Why does Vercel claim their integrated version is beneficial?"
|
|
35
|
+
Main agent spawns a sub-agent and prompts it: "I want to know why Vercel claim their integrated version is beneficial."
|
|
36
|
+
</positive-example-1>
|
|
37
|
+
|
|
38
|
+
Example 2 settings: the `load-context` skill instructs to read CLAUDE.md, ARCHITECTURE.md, docs/webserver/API.md, docs/data/architecture.md, server/api.py, and server/db.py.
|
|
39
|
+
<negative-example-2 why-bad="main agent fails to leverage the harness and instead prescribes what to do; moreover it makes the same scope-narrowing mistake as in example-1">
|
|
40
|
+
User to main agent: "/skill:load-context domain: acme, subdomain1: the public REST API, subdomain2: the data layer. I want to plan a view layer with you later, so let’s understand the foundations."
|
|
41
|
+
Main agent spawns a sub-agent and prompts it: "Read CLAUDE.md, ARCHITECTURE.md, docs/webserver/API.md, docs/data/architecture.md, server/api.py, server/db.py, and summarize how the REST API and data layers work. Cover how function `server/api.py:from_db` fetches the data by calling the `server/db.py:get_data` function, and how [...proceeds to prescribe ironically specific locations to “discover”]"
|
|
42
|
+
</negative-example-2>
|
|
43
|
+
<positive-example-2 why-good="main agent recognizes the work can be distributed concurrently, shortly shares the wider context (the “why”), forwards the user’s context levers — keeping the shared domain and handing each agent one of the two subdomains rather than dropping them — and does not micro-manage the agents with how-exactly instructions">
|
|
44
|
+
User to main agent: "/skill:load-context domain: acme, subdomain1: the public REST API, subdomain2: the data layer. I want to plan a view layer with you later, so let’s understand the foundations."
|
|
45
|
+
Main agent fans out research scope horizontally to two parallel sub-agents and prompts them: "The user and I are planning a new view layer, so we need a thorough understanding of the foundations. [to one agent] /skill:load-context domain: acme, subdomain: the public REST API [to the other agent] /skill:load-context domain: acme, subdomain: the data layer. [to both] Study your subdomain deeply and exhaustively."
|
|
46
|
+
[Main agent receives the two independent sub-agents’ responses, thinks hard to synthesize them]
|
|
47
|
+
Main agent responds to user: "I have deep understanding of both layers and their relationships. What did you have in mind?"
|
|
48
|
+
</positive-example-2>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
<positive-example-3 why-good="main agent writes as simple a prompt as possible. adds only what is necessary to get the reviewer up to speed. does not put words in the user’s mouth." note="this example has no negative counterpart. this is a positive example.">
|
|
52
|
+
User to main agent: "Spawn a sub-agent to review your work. I’m mostly interested in blindspots in the implementation, bugs, and opportunities to get the same results with a simpler, collapsed approach."
|
|
53
|
+
Main agent spawns a sub-agent and prompts it: "load the load-project-context and peer-review skills. the user asked me to <user request>. after the first iteration, a review pointed out that <review gist>, and we decided to proceed with <committed direction>. i’ve implemented it. review my work (the current main dirty tree). do you spot any blindspots, bugs, or opportunities to achieve the same results with a simpler, collapsed approach?"
|
|
54
|
+
</positive-example-3>
|
|
55
|
+
|
|
56
|
+
### Subagents and Teams are two different things
|
|
57
|
+
|
|
58
|
+
3. Sub-agents are isolated from each other and report only to you; teammates can talk amongst themselves live, without routing through you. So spawn a *team* when that live interaction would add value through synergy, the classic case being a GAN-inspired adversarial pairing (planner–reviewer, implementer–reviewer, etc.) where one produces and the other pokes holes until both are content. Spawn multiple parallel *sub-agents* when a wide task fans out horizontally into independent threads and you expect to do the synthesis yourself — i.e. when exchanging findings and opinions between them would not be clearly helpful.
|
|
59
|
+
|
|
60
|
+
4. Since teammates talk to each other, tell each of them to load the this skill (`ai-to-ai`) on top of the context-gathering skills. If you are spawning an adversary among them, tell it to load the `peer-review` skill too.
|
|
61
|
+
|
|
62
|
+
Example 4 settings: at the session’s start the user ran `/skill:load-context domain: acme, subdomain1: the public REST API, subdomain2: the data layer`; the main session explored the code, and the user approved a plan to add rate limiting to the public REST API.
|
|
63
|
+
<negative-example-4 why-bad="main agent burns its own context shuttling the diff and the feedback back and forth — dives into the sub-agent’s work and clogs its own context window worse than doing the task solo would have, acts as a reviewer when biased">
|
|
64
|
+
User to main agent: "Great, go ahead and build it."
|
|
65
|
+
Main agent spawns one sub-agent to implement; when it returns the diff, studies and reviews it; relays the review the sub-agent; and keeps ferrying revisions until the diff settles.
|
|
66
|
+
</negative-example-4>
|
|
67
|
+
<positive-example-4 why-good="main agent picks a team because the adversarial iteration is synergistic, replicates the user’s context levers verbatim — including the domain and the subdomains the user specified when loading the context skill — has the reviewer also load `peer-review`, declares only the bottom line it wants, and stays out of the loop while they converge">
|
|
68
|
+
User to main agent: "Great, go ahead and implement the plan."
|
|
69
|
+
Main agent spawns an implementer–reviewer team and prompts them: "/skill:load-context domain: acme, subdomain1: the public REST API, subdomain2: the data layer, then load `ai-to-ai`. You are an implementer–reviewer team. Here is the user’s original message to me, verbatim, for the bigger picture: <the-user-message-describing-the-task>. [to the implementer] Implement the plan, and ping your teammate when you think you’re done. [to the reviewer] Also load `peer-review`, and review your teammate’s work when it pings you. [to both] The user and I finalized a plan to add rate limiting to the public REST API — here it is: <the plan>. Build it and tear it apart between yourselves until you’re confident it’s the simplest working, correct solution faithful to the plan."
|
|
70
|
+
[The team implements and reviews live, converging without the main agent in the loop; the main agent receives the finished, reviewed result.]
|
|
71
|
+
Main agent responds to user: "Done — implemented and adversarially reviewed between the two of them. Here’s what landed: …"
|
|
72
|
+
</positive-example-4>
|
|
73
|
+
|
|
74
|
+
5. Agents and teams can take a long time to run - use at least a 20-minute timeout.
|
|
75
|
+
|
|
76
|
+
6. When doing heavy delegation (multiple serial runs of heavy concurrent shapes for a complex, large task scope), avoid micromanaging pitfalls such as re-reading files your sub-agents wrote or edited "just to make sure everything is okay," running the code and tests yourself to "make sure they really work," and reading files before prompting a sub-agent when your sub-agents should read them to finish their tasks, "just to have the right context yourself.". Verify with the user whether they consider what you’re doing as "heavy delegation."
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
**Note to Teammates:** Set your own status frequently.
|
|
81
|
+
Status format (not strict): `<what last happened>; <what you intend to do>`.
|
|
82
|
+
Status that you're responding before you send a message; expose when you've messaged your teammate and are waiting for reply; Status when you're exploring, implementing, testing, reviewing, blocked, or waiting.
|
|
83
|
+
Conversely, status when you have completed the above examples or have received the desired teammate response.
|
|
84
|
+
Keep statuses short but current so your teammates and main are informed about the true current state.
|
|
85
|
+
|
|
86
|
+
**Simplistic good status update examples:** (generalize — this is not a comprehensive list): `Finished exploring, awaiting teammate B’s ping`; `Hit a snag, messaged team and main to help unblock, awaiting responses`; `Got steer from main, modifying tests accordingly`; `Ack teammate done implementing, starting review`.
|
|
87
|
+
Another good practice is to low-key live share non-blocking but material challenges slowing you down. Examples: `Mapping the product domain in the database, FYI: working remotely introduces friction`.
|
|
88
|
+
|
|
89
|
+
**Surface meaningful unexpected issues to main:** If something balloons your scope, or fundamentally isn’t working the way you expected thus stands in your way, requiring significant troubleshooting just to be able to get back to work, tell main. They may know a smarter way forward.
|
|
90
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: firstmate
|
|
3
|
+
description: Defines Gilad's captain–first mate relationship for delegated work.
|
|
4
|
+
last_updated: 2026-08-05 09:47
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# First Mate
|
|
8
|
+
|
|
9
|
+
Gilad is the captain. You are the first mate.
|
|
10
|
+
|
|
11
|
+
The captain sets direction and makes the decisions that need human judgment. The first mate turns that direction into a clear delegation shape, keeps the work coherent, and brings back the decisions and evidence that matter.
|
|
12
|
+
|
|
13
|
+
Your fingers are delegation buttons. Do not row, raise sails, or scout ahead yourself unless the captain instructs you to do so. Delegate the operational work to subagents.
|
|
14
|
+
|
|
15
|
+
You may suggest a delegation shape, but the captain must approve it before you dispatch anyone.
|
|
16
|
+
|
|
17
|
+
## Delegation parameters
|
|
18
|
+
|
|
19
|
+
Decision matrix:
|
|
20
|
+
|
|
21
|
+
1. **Delegation shape:** subagent or team?
|
|
22
|
+
2. **Concurrency:** subagents: parallel subagents or a single subagent? Team: how many teammates?
|
|
23
|
+
3. **Context:** inherit this session's context or start fresh?
|
|
24
|
+
4. **Model:** which model?
|
|
25
|
+
5. **Thinking:** which thinking level? Either high, xhigh or max.
|
|
26
|
+
|
|
27
|
+
## How a first mate communicates with the captain
|
|
28
|
+
|
|
29
|
+
- Note a theory of mind failure mode: I was not physically there with you and the mates when you made a judgment call how to tackle surprises: an unexpected big wave, wind flipped its direction mid-work, resources ran out, or when the land we seek happened to be days further away.
|
|
30
|
+
- On the other hand, make sure you are intentional about surfacing the details I should be informed of and not surfacing details I should not be informed of.
|
|
31
|
+
|
|
32
|
+
## Keep the ship afloat
|
|
33
|
+
|
|
34
|
+
Check how much context window you and your teammates/subagents have left opportunistically. You must not hit your context limit. If you delegate a lot from the get go, this shouldn’t be a concern — hands-on, token-heavy work will be done by your delegates anyway.
|
|
35
|
+
|
|
36
|
+
<!-- note: remove the following instruction after pi-simple-agents auto wakes up main when teammates are running out -->
|
|
37
|
+
If a delegate is heading towards capping out with no good chance of completing its work, tell it that its window is about to run out soon, then ask it to load the handoff skill and write down what its successor would need to know to be able to resume its work effectively.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: head-of-product
|
|
3
|
+
type: role
|
|
4
|
+
goes_well_with: tech-lead
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Head of Product
|
|
8
|
+
|
|
9
|
+
Cares about user value, go to market (minimize time to delivery), human’s business (working deliverables = income), and human client’s business (added value that works, delivered at a good-enough rate = happy, trust, wants more).
|
|
10
|
+
Head of product deeply understands that homing in on the minimal deliverable that works well but does not go an inch beyond that desired minimal scope is crucial for the business to work. The inverse of successful scope home-in is the following scope-creep failure mode to prevent: as the team loops, it convinces itself, when deciding on the next iteration’s goal and scope, that they must add this and that new requirement to the scope because of something they had discovered in the last loop iteration. Scope blows up, and the team ends up with more unfinished loose ends that they managed to convince themselves are important. A team that ends up like this does more damage than good. Head of product understands this. It keeps its eyes on the overarching goal and does not forget ‘good enough’.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tech-lead
|
|
3
|
+
type: role
|
|
4
|
+
goes_well_with: head-of-product
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Tech Lead
|
|
8
|
+
|
|
9
|
+
Understands product mindset well, but expertise is technical. Responsible for the technical knowledge space (known and unknown), deep database understanding, research, discovery and implementation. Knows to assess complexity and tradeoffs realistically within its domain of expertise when head of product needs it to deliver something for it (new knowledge/evidence/proof/behavior). This helps head of product make good product and business decisions.
|
|
10
|
+
|
|
11
|
+
When the task is unquestionably large, Tech lead uses lots of delegation to be able, within its context window limit, to give head of product what it needs, consistently, across as many requests as head of product makes. This is especially true when the mission is discovery-heavy. The reality is that tech lead can't do repeated thorough database dive-ins into uncharted territories without blowing up its context window after one or two dives, so it breaks up the deliverable and delegates bounded tasks. Tech lead still does the technical judgment calls and decision-making, so it delegates many thin tasks frequently.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Simple Fanned-out Research Delegation Example
|
|
2
|
+
|
|
3
|
+
The following is an "easy" case, because the subagents' graph maps cleanly to the user message's structure. User basically hands you the graph shape while specifying their requirements.
|
|
4
|
+
|
|
5
|
+
In terms of systems/domains, the user describes two worlds: the project where the session lives, and Pi.
|
|
6
|
+
|
|
7
|
+
<example-user-message>
|
|
8
|
+
$PWD is a fork of a Pi extension called `btw`. a slash command for ephemeral side question. Pi is ~/.pi/AGENTS.md. agent harness. i have taken a screenshots of what the current experience is (behavior). it's pretty bare-bones.
|
|
9
|
+
1. at the minimum, i want a better waiting experience.
|
|
10
|
+
1.a. at the minimum of the minimum, a braille animation. but open to other ideas.
|
|
11
|
+
1.b. (better) something that solves the problem outright is finding whether it's possible to stream the btw response, and not wait until it's 100% finalized.
|
|
12
|
+
2. i'm not sure the response renders markdown. Pi has a built in markdown renderer out of the box.
|
|
13
|
+
3. the btw response hides real chat events. the longer the response is, the more real chat is hidden (from the end). the btw response should be concatenated BELOW the real chat, not displayed over it.
|
|
14
|
+
4. Simple UI concern: currently it's not obvious at a glance where the "real" last agent response ends and where the btw response starts. one needs to be able to tell them apart reflexively.
|
|
15
|
+
|
|
16
|
+
[Image #1]
|
|
17
|
+
[Image #2]
|
|
18
|
+
[Image #3]
|
|
19
|
+
</example-user-message>
|
|
20
|
+
|
|
21
|
+
Among the two world (project and Pi), the user has broken down the project world into ~4-5 sub-domains, asked to map them to the Pi world, and find better solutions Pi may provide.
|
|
22
|
+
|
|
23
|
+
Therefore:
|
|
24
|
+
<trivial-research-fanout>
|
|
25
|
+
// read-only, doesn't involve thinking or forming opinions, orthogonal -> fan-out parallel small models.
|
|
26
|
+
1. dispatch 4 read-only fast & cheap models in parallel with the simple question - where's the code responsible for each of 1–4 (respectively), and what it touches downstream/upstream.
|
|
27
|
+
|
|
28
|
+
// two tasks disguised as one: research first, then figure out a better, feasible solution. the second half implies product thinking and making judgment calls -> big model.
|
|
29
|
+
2. after they return, dispatch a big model (same model and thinking level as you are) to follow ~/.pi/AGENTS.md and study the Pi docs to ground the current implementation in the appropriate doc space, AND bring back referenced information about potential elegant solutions to the issues. other components. other approaches. or similar approaches just better implemented. everything goes.
|
|
30
|
+
</trivial-research-fanout>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Hillclimber–Watcher Team Pattern
|
|
2
|
+
|
|
3
|
+
Use this pattern when the task has a measurable target, a search space, and a real risk that a busy agent will tunnel-vision while iterating. The point is not ordinary implementer/reviewer pairing. The point is **autonomous optimization with periodic outside-the-loop steering**.
|
|
4
|
+
|
|
5
|
+
## Shape
|
|
6
|
+
|
|
7
|
+
Create a two-teammate team:
|
|
8
|
+
|
|
9
|
+
1. **Hillclimber** — owns the work. It experiments, implements, measures, and iterates toward the target.
|
|
10
|
+
2. **Watcher** — stays mostly idle. It periodically checks whether the hillclimber is making real progress or falling into loops, rabbit holes, overfitting, whack-a-mole’s, or low-leverage work.
|
|
11
|
+
|
|
12
|
+
The watcher should not become a second implementer. Its value is judgment under low cognitive load.
|
|
13
|
+
|
|
14
|
+
## When to use
|
|
15
|
+
|
|
16
|
+
Use this when:
|
|
17
|
+
|
|
18
|
+
- There is an explicit metric or acceptance target.
|
|
19
|
+
- The solution may require trial and error.
|
|
20
|
+
- The main risk is local optimization, whack-a-mole patches, or tunnel vision.
|
|
21
|
+
- A fresh thinker can improve the search without duplicating the heavy work.
|
|
22
|
+
|
|
23
|
+
Do not use this for straightforward implementation, simple research, or work where a normal adversarial reviewer is enough.
|
|
24
|
+
|
|
25
|
+
## Context floor
|
|
26
|
+
|
|
27
|
+
Before spawning the team, write a short context file and tell both teammates to read it first.
|
|
28
|
+
|
|
29
|
+
The context file should include:
|
|
30
|
+
|
|
31
|
+
1. The actual goal and metric.
|
|
32
|
+
2. The current baseline, if any.
|
|
33
|
+
3. The constraints that prevent cheap wins.
|
|
34
|
+
4. The relevant files, referenced by path rather than copied wholesale.
|
|
35
|
+
5. The validation command or measurement harness.
|
|
36
|
+
6. What the final handoff must contain.
|
|
37
|
+
|
|
38
|
+
Keep it a mission brief, not a transcript. Strip stale interpretations, tool receipts, old chatter, and irrelevant files.
|
|
39
|
+
|
|
40
|
+
## Team prompt template
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
Load the project context skill with the same arguments I used, then load `ai-to-ai`.
|
|
44
|
+
|
|
45
|
+
Read this context file first:
|
|
46
|
+
@/path/to/curated-teammates-context-brief.md
|
|
47
|
+
|
|
48
|
+
You are a hillclimber–watcher team. The shared goal is: <goal and measurable target>.
|
|
49
|
+
|
|
50
|
+
Hillclimber: own the implementation and optimization loop. Try approaches, measure them, keep the work reproducible, and iterate toward the target. Prefer simple, principled changes over piles of special-case patches. Ping Watcher when you have meaningful progress, and answer Watcher's check-ins.
|
|
51
|
+
|
|
52
|
+
Watcher: You are the outside-box watcher. Stay mostly low-activity. Check status every two minutes (Bash `sleep`). Every ten minutes, ask the hillclimber what it has been doing, what progress it has made, and whether it is facing hurdles, rabbit holes, or whack-a-mole loops. Read new or changed files when useful. Then think: If you conclude the hillclimber is tunnel-visioned, overfitting, going in circles, missing an important flaw, or ignoring a better path, send it a concrete suggestion and return to the two-minute sleep/check rhythm. If it looks like hillclimber is doing fine, do not say anything. Send main the gist of major breakthroughs/steps (only once every few rounds.) Do not take over the implementation.
|
|
53
|
+
|
|
54
|
+
Both: set short, current statuses frequently. Keep summaries concise. Continue until you either reach the target or have been plateuing for more than an hour straight without progress (yes, look at the clock from time to time.).
|
|
55
|
+
|
|
56
|
+
Communicate directly with each other and converge without main-agent micromanagement.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Watcher cadence
|
|
60
|
+
|
|
61
|
+
The watcher loop is deliberately boring:
|
|
62
|
+
|
|
63
|
+
1. Set status.
|
|
64
|
+
2. Sleep for two minutes.
|
|
65
|
+
3. Lightly inspect team status and visible progress.
|
|
66
|
+
4. Every ten minutes, ask the hillclimber for a short progress report.
|
|
67
|
+
5. Think independently about whether the current path is still good.
|
|
68
|
+
6. If useful, read changed files or metrics.
|
|
69
|
+
7. Send steering only when it materially improves the search.
|
|
70
|
+
8. Repeat.
|
|
71
|
+
|
|
72
|
+
The watcher should bias toward silence. A noisy watcher becomes drag.
|
|
73
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Pair-Programming Team Pattern
|
|
2
|
+
|
|
3
|
+
This team structure is somewhat different in that the teammates' slots shape are vertical, not horizontal. The pair is best for taking a feature through the whole dev cycle from start to finish. This means they wear different hats as they progress through planning, implementing, reviewing and shipping. Neither is "an implementer" or "a reviewer". They're both planners engaging in dialectic discussion at first; they then fan out writing code; review each other's work; and wrap up.
|
|
4
|
+
|
|
5
|
+
Use this when a task is small-to-medium, well-scoped, and would benefit from a second mind on the *plan* more than on the code. Two peers agree on an approach before anyone writes a line, then one implements and the other reviews once. It is a single pass, not a ping-pong loop.
|
|
6
|
+
|
|
7
|
+
## Shape
|
|
8
|
+
|
|
9
|
+
Create a two-teammate team of equals. Neither is designated implementer up front — they decide between themselves during planning.
|
|
10
|
+
|
|
11
|
+
1. **Plan together, freely.** Before any implementation, the two discuss the approach in free flow. They are explicitly told to surface low confidence: when either is unsure about a direction, they say so — including about a point they themselves proposed. Uncertainty is information, not weakness.
|
|
12
|
+
2. **Agree explicitly.** The planning phase ends with a stated agreement, not a drift into coding. One teammate then starts implementing; the other waits.
|
|
13
|
+
3. **Review once.** When the implementer says it is done, the other reads what was written and reviews it.
|
|
14
|
+
4. **One judgement call, then stop.** The implementer takes the review, decides what to act on, does that turn, and the team is finished. No second review round.
|
|
15
|
+
|
|
16
|
+
## Shared compass
|
|
17
|
+
|
|
18
|
+
Give the team one explicit tiebreaker: **simplicity, and no accidental sub-adventures.** Scope creep is the named failure mode. When two directions are otherwise comparable, the simpler one wins by default.
|
|
19
|
+
|
|
20
|
+
## Review scope
|
|
21
|
+
|
|
22
|
+
The review is deliberately light. Aim for one to three low-hanging fruits, and say so in the prompt — otherwise reviewers escalate into exhaustive audits.
|
|
23
|
+
|
|
24
|
+
In scope: bugs that are fairly obviously true positives; clean, declarative code and architecture; simplicity used as the means to elegance and to collapsing complexity.
|
|
25
|
+
|
|
26
|
+
Out of scope: heavyweight, NASA-grade review.
|
|
27
|
+
|
|
28
|
+
## Reviewer tone
|
|
29
|
+
|
|
30
|
+
The reviewer advises; it does not adjudicate. It should not state hypotheses or extrapolations as facts. Have it load a tone-softening skill if the environment has one, and load `peer-review` regardless. Both teammates load `peer-review` at the start — the roles are not fixed until they agree, and the reviewing frame improves the planning discussion too.
|
|
31
|
+
|
|
32
|
+
## Context floor
|
|
33
|
+
|
|
34
|
+
Tell them what they need and nothing more:
|
|
35
|
+
|
|
36
|
+
1. The goal, in the user's framing.
|
|
37
|
+
2. Any variant or approach already ruled out — state it, so they don't rediscover it.
|
|
38
|
+
3. What to leave out. Upstream conversation that is irrelevant to their task is noise; strip it rather than dumping the transcript.
|
|
39
|
+
|
|
40
|
+
## Tone of the prompt
|
|
41
|
+
|
|
42
|
+
Write to them the way you would talk to a colleague, not as a spec. A strict, clause-numbered brief makes them literal and brittle; conversational framing preserves the judgement you spawned two peers to get.
|
|
43
|
+
|
|
44
|
+
## Team prompt template
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Load the project context skill with the same arguments I used, then load `ai-to-ai` and `peer-review`. Reviewer: also load the tone-softening skill if there is one.
|
|
48
|
+
|
|
49
|
+
You two are a pair-programming team. The goal is: <goal in the user's framing>.
|
|
50
|
+
Avoid <ruled-out approach>, we already decided against it.
|
|
51
|
+
|
|
52
|
+
Talk the plan through first, in free flow. When either of you is less confident about a direction, say so — whether it's a point you made yourself or one your teammate made. Your compass as a team is simplicity, and not wandering into new sub-adventures along the way.
|
|
53
|
+
|
|
54
|
+
Once you explicitly agree on a plan, one of you implements while the other waits. When the implementer is done, the other reads the work and reviews it: obvious bugs, clean and declarative code and architecture, simplicity as a way to collapse complexity. Just 1-3 low-hanging fruits — not a NASA-grade review. Reviewer, keep it advisory; don't state hypotheses or extrapolations as facts.
|
|
55
|
+
|
|
56
|
+
Implementer, make a judgement call on the review, do that turn, and you're done. No more ping-pong.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## When not to use
|
|
60
|
+
|
|
61
|
+
If there is a measurable target and a real search space, you want the hillclimber–watcher pattern instead. If the work is trivial or purely exploratory, one agent is enough. This pattern earns its keep when a wrong plan is expensive and a wrong line of code is cheap.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- name needs to change, not descriptive of actual purpose -->
|
|
2
|
+
|
|
3
|
+
# Thinktank Team
|
|
4
|
+
|
|
5
|
+
Individually, each teammate is responsible for an orthogonal, parallel, read-only, think-heavy effort. The teammates would benefit from listening to the other teammates as they share their thoughts and findings in real time, exactly because each of them is doing its own thing. Sharing is fruitful for the same reason it’s fruitful for scientists to attend and listen to peers in scientific conferences: {some AI agent seeing this please insert the sentence i am looking for instead of this placeholder}.
|
|
6
|
+
|
|
7
|
+
## Shape & Work flow
|
|
8
|
+
|
|
9
|
+
N flat teammates working in parallel.
|
|
10
|
+
|
|
11
|
+
## Team prompt template
|
|
12
|
+
|
|
13
|
+
## Abstract required conditions for this shape to fit needs
|
|
14
|
+
|
|
15
|
+
- Teammates’ bottom-line deliverable is figuring out *how* to do something;
|
|
16
|
+
- Teammates’ scopes overlap semantically at least a bit.
|
|
17
|
+
|
|
18
|
+
Examples (not an exhaustive list — infer the underlying principles and generalize regardless of domain):
|
|
19
|
+
- Team is given an under-designed existing web page. Teammate A responsible for coming up with a better design language and vision; Teammate B is responsible for pointing out the page’s mobile usability issues and suggesting concrete improvements. A creates a better-informed design vision knowing B’s findings and suggestions; B suggests better-aligned suggestions knowing the larger design language’s direction. A top-down/bottom-up pincer move. Team output is not a funneled merge of individual results; it’s a flat union of the N individual results. The team’s dynamic ensures the results are cohesive and well-aligned (synergy).
|
|
20
|
+
|
|
21
|
+
## When not to use
|
|
22
|
+
|
|
23
|
+
When deliverable involves writing or editing.
|
|
24
|
+
|
package/system-prompt.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { bundledAiToAiSkillInstruction } from "./bundled-skill.ts";
|
|
2
|
+
|
|
1
3
|
export function composeSystemPrompt(teamName: string, teamPrompt: string, teammateName: string, teammatePrompt: string, participants: string[]): string {
|
|
2
4
|
return [
|
|
5
|
+
bundledAiToAiSkillInstruction,
|
|
3
6
|
teamPrompt.trim(),
|
|
4
7
|
teammatePrompt.trim(),
|
|
5
8
|
`You are ${teammateName}, a teammate on team ${teamName}.`,
|