The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Let Buddies offer proposals for ready ideas (#3418)
harness-for-autonomous[bot]0d0ad9b4e3a9
diff --git a/cli/src/lib/swarmSkills.spec.ts b/cli/src/lib/swarmSkills.spec.tsindex 04d42435e..aa8545fac 100644--- a/cli/src/lib/swarmSkills.spec.ts+++ b/cli/src/lib/swarmSkills.spec.ts@@ -875,14 +875,19 @@ describe('built-in Swarm skills', () => {})describe('the Buddy skill (Ken\'s Buddy spec, 10-28)', () => {- it.each([undefined, 'default', 'orchestration'] as const)('brainstorms and proposes only when asked, the same in every mode (%s)', mode => {+ it.each([undefined, 'default', 'orchestration'] as const)('offers ready ideas and sends only with consent, the same in every mode (%s)', mode => {expect(parseSwarmSkill({ role: 'buddy', key: 'session', ...(mode ? { mode } : {}) })).toEqual({ role: 'buddy', key: 'session', ...(mode ? { mode } : {}) })const prepared = prepareSwarmSkill(fixture(), { role: 'buddy', key: 'session', ...(mode ? { mode } : {}) })const text = readFileSync(prepared.file, 'utf8')expect(text.startsWith('---\nname: swarm-buddy\n')).toBe(true)// Harness Instructions' brainstorming: the goal first, options with a recommendation, an agreed scope.for (const step of ['Ask the goal first', 'Offer 2 or 3 options', 'Agree the scope']) expect(text).toContain(step)- expect(text).toContain('Only when your owner asks')+ expect(text).toContain('clear goal, why it matters and how to know it is done')+ expect(text).toContain('check the project for an existing proposal or task')+ expect(text).toContain('point to a match instead of duplicating it')+ expect(text).toContain('offer without waiting to be asked: "Want me to propose this to <project>?"')+ expect(text).toContain('Send only after your owner says yes to that proposal')+ expect(text).toContain('One offer per idea; never repeat an ignored or declined offer')expect(text).toContain('harness super-tab --tab TAB propose OPERATION_ID')// Scholes (11-02): its one Buddy sends, naming the project, and asks which when it is unclear; never "open a session".expect(text).toContain('"projectId":"PROJECT"')diff --git a/cli/src/lib/swarmSkills.ts b/cli/src/lib/swarmSkills.tsindex 0389ed2ce..9d59e38ab 100644--- a/cli/src/lib/swarmSkills.ts+++ b/cli/src/lib/swarmSkills.ts@@ -662,7 +662,7 @@ Mark your review done with the verdict and revision.* same in every mode: a Buddy is not a task's agent, so neither mode's team process applies to it. */const buddy = `---name: swarm-buddy-description: Use when you are a person's Buddy in a Harness Swarm, brainstorming with them in your private chat, doing what they ask on their own machine and, only when they ask, sending their proposal to a project's Product Manager.+description: Use when you are a person's Buddy in a Harness Swarm, brainstorming with them in your private chat, doing what they ask on their own machine, offering ready ideas as proposals and, only with their agreement, sending their proposal to a project's Product Manager.---# Brainstorm with your owner@@ -697,7 +697,8 @@ You are one person's Buddy. Your start note says which: their one Buddy for ever## Send to the PM- As your owner's one Buddy, you send to the PM of a project they read yourself, and name it: never tell them to open a session just to send. If they read several and it is unclear which one this is for, ask them first. A session in one project sends only to that project's PM.-- Only when your owner asks (for example "send to the PM"), never on your own, and once for each time they ask.+- When your discussion has a clear goal, why it matters and how to know it is done, check the project for an existing proposal or task in its status and project chat; point to a match instead of duplicating it. Otherwise offer without waiting to be asked: "Want me to propose this to <project>?" Show the exact proposal below that question, in the quoted format below.+- Send only after your owner says yes to that proposal (or explicitly asks you to send their own words), once. One offer per idea; never repeat an ignored or declined offer. Silence, a vague reaction or approval of the idea alone is not consent to send.- Write the goal, the scope and a priority (low, normal or high) from what you agreed. Put in only what your owner wants sent; anything private stays in your chat.- Before you send, show your owner the exact line you will post as them, in their voice: I'll post this as you: "…", and wait for their ok. It is their message to the team: one plain line, as they would say it. Quotes around that line are required. Only the quoted line immediately after "I'll post this as you:" counts as shown; nothing after its closing quote counts. Put nothing after it but that line in quotes; send the words inside the quotes whole, never a piece of them. If an unquoted line is refused, show it again in quotes and wait for a new ok. When they wrote the words to send themselves, send those. A change they ask for is a new line to show them.- Send it with harness super-tab --tab TAB propose OPERATION_ID '{"conversationId":"CHAT","ownerMessageId":"MESSAGE","projectId":"PROJECT","text":"the line they okayed, or their own words","goal":"...","scope":"...","priority":"normal"}', where MESSAGE is the id of your owner's message saying ok or asking you to send it and PROJECT is the project's id from status (a session in one project leaves projectId out). One message sends one proposal, to one project.diff --git a/cli/src/superTabs/start.spec.ts b/cli/src/superTabs/start.spec.tsindex 2f8d631a7..59041841d 100644--- a/cli/src/superTabs/start.spec.ts+++ b/cli/src/superTabs/start.spec.ts@@ -445,6 +445,26 @@ it.each(['claude', 'codex'])('starts a %s Buddy with the built-in swarm-buddy skexpect(payload.prompt).not.toContain('swarm-dev')})+it.each([+ ['main', {}],+ ['Swarm', { buddyScope: 'swarm' }],+ ['thread', { buddySession: { thread: 'root-1', from: 1 } }],+ ['project session', { buddySession: { thread: 'root-1', from: 1, projectId: 'project' } }],+])('tells the %s Buddy to offer ready ideas once and wait for consent (task #3865)', async (_name, context) => {+ const f = fixture()+ Object.assign(f.start.request, { buddyOf: { personId: 'peer', generation: 'g' }, ...context })+ ownMachine(f)+ await startAgent({ ...OWN_HOST, action: 'start', tabId: 'tab', operationId: 'buddy-offer', request: f.start.request } as never, f.scoped, where, f.open)+ const prompt = String(f.request.mock.calls.find(call => call[0] === 'agent_create')![1]!.prompt)+ expect(prompt).toContain('clear goal, why it matters and how to know it is done')+ expect(prompt).toContain('check the project for an existing proposal or task')+ expect(prompt).toContain('point to a match instead of duplicating it')+ expect(prompt).toContain('offer without waiting to be asked: "Want me to propose this to <project>?"')+ expect(prompt).toContain('show the exact proposal')+ expect(prompt).toContain('Send only after your owner says yes to that proposal')+ expect(prompt).toContain('One offer per idea; never repeat an ignored or declined offer')+})+it('admits a person\'s one Buddy by the disk its folder is made on, as the folder its start names is never made', async () => {// The real disk reading, on a folder that is not there: measured as it stands it is refused, and the Buddy never starts (2026-11-02).const root = mkdtempSync(join(tmpdir(), 'swarm-buddy-disk-'))diff --git a/cli/src/superTabs/start.ts b/cli/src/superTabs/start.tsindex b5e5ee6b8..dd4271036 100644--- a/cli/src/superTabs/start.ts+++ b/cli/src/superTabs/start.ts@@ -79,13 +79,15 @@ function workerPrompt(tabId: string, chat: string, roleName: string): string {return `You are joining a shared Super Tab. ${roleLine(roleName)}Run harness super-tab --tab ${tabId} status until this harness appears in the roster. Read the conversation with harness super-tab --tab ${tabId} messages ${chat}. Reply in that conversation using harness super-tab --tab ${tabId} post ${chat} 'your message' UNIQUE_OPERATION_ID. ${INSTRUCTIONS_LINE(tabId)} Run harness super-tab help for commands. If sandbox restrictions block this local command, request permission to run it outside the sandbox.`}+const buddyProposalOffer = `When your discussion has a clear goal, why it matters and how to know it is done, check the project for an existing proposal or task; point to a match instead of duplicating it. Otherwise offer without waiting to be asked: "Want me to propose this to <project>?" Then show the exact proposal as a quoted line after "I'll post this as you:". Send only after your owner says yes to that proposal. One offer per idea; never repeat an ignored or declined offer.`+function buddyPrompt(tabId: string, chat: string, mode: SwarmSkillMode | null): string {- return `You are a person's Buddy in a shared Super Tab. ${mode ? `${swarmSkillUse({ role: 'buddy' }, mode)} ` : ''}Run harness super-tab --tab ${tabId} status until this harness appears in the roster. Your chat with your owner is conversation ${chat}: read it with harness super-tab --tab ${tabId} messages ${chat}, and reply there with harness super-tab --tab ${tabId} post ${chat} 'your message' UNIQUE_OPERATION_ID. Then greet your owner there and ask what they have in mind. If sandbox restrictions block this local command, request permission to run it outside the sandbox.`+ return `You are a person's Buddy in a shared Super Tab. ${mode ? `${swarmSkillUse({ role: 'buddy' }, mode)} ` : ''}Run harness super-tab --tab ${tabId} status until this harness appears in the roster. Your chat with your owner is conversation ${chat}: read it with harness super-tab --tab ${tabId} messages ${chat}, and reply there with harness super-tab --tab ${tabId} post ${chat} 'your message' UNIQUE_OPERATION_ID. Then greet your owner there and ask what they have in mind. ${buddyProposalOffer} If sandbox restrictions block this local command, request permission to run it outside the sandbox.`}/** A thread session's start note (docs/superpowers/specs/2026-10-30-buddy-thread-sessions-design.md): the same Buddy, for one* thread of its owner's chat. Ids only, never a message's text: a start record is listed in the Lead's status. */function buddySessionPrompt(tabId: string, chat: string, thread: string, mode: SwarmSkillMode | null): string {- return `You are a person's Buddy in a shared Super Tab, in a session of your own for one thread of your owner's chat. ${mode ? `${swarmSkillUse({ role: 'buddy' }, mode)} ` : ''}Run harness super-tab --tab ${tabId} status until this harness appears in the roster. Your thread is the one rooted at message ${thread} in conversation ${chat}. Read it, with the main-chat messages it started from, with harness super-tab --tab ${tabId} messages ${chat} --thread ${thread}. Answer your owner only in this thread: harness super-tab --tab ${tabId} post ${chat} 'your message' UNIQUE_OPERATION_ID --reply-to MESSAGE_ID, naming a message in this thread. Your owner's newest message in the thread is the one to answer first. Your Buddy's other rules are unchanged. If sandbox restrictions block this local command, request permission to run it outside the sandbox.`+ return `You are a person's Buddy in a shared Super Tab, in a session of your own for one thread of your owner's chat. ${mode ? `${swarmSkillUse({ role: 'buddy' }, mode)} ` : ''}Run harness super-tab --tab ${tabId} status until this harness appears in the roster. Your thread is the one rooted at message ${thread} in conversation ${chat}. Read it, with the main-chat messages it started from, with harness super-tab --tab ${tabId} messages ${chat} --thread ${thread}. Answer your owner only in this thread: harness super-tab --tab ${tabId} post ${chat} 'your message' UNIQUE_OPERATION_ID --reply-to MESSAGE_ID, naming a message in this thread. Your owner's newest message in the thread is the one to answer first. Your Buddy's other rules are unchanged. ${buddyProposalOffer} If sandbox restrictions block this local command, request permission to run it outside the sandbox.`}/** A person's one Buddy for the Swarm (docs/specs/2026-10-31-one-buddy-per-swarm.md): it reads every project its person@@ -94,12 +96,12 @@ function buddySessionPrompt(tabId: string, chat: string, thread: string, mode: Sfunction swarmBuddyPrompt(tabId: string, chat: string, home: { ready: string[]; missing: string[] }, mode: SwarmSkillMode | null): string {const code = home.ready.length ? `Each project's code is in its own folder under projects/ (${home.ready.join(', ')}). Each copy follows its project's default branch, moved at your start and at most hourly after that. ${BUDDY_COPIES_FILE} in your folder says which revision each copy is at: read it before saying what the code does or does not have. Say your copy is behind only when that file says it may be; otherwise, what is not in the copy is not on the default branch yet.` : 'No project\'s code is on this machine.'const none = home.missing.length ? ` Not on this machine: ${home.missing.join(', ')}; you still read their chats and tasks.` : ''- return `You are a person's one Buddy in a shared Super Tab, for every project they read. ${mode ? `${swarmSkillUse({ role: 'buddy' }, mode)} ` : ''}Run harness super-tab --tab ${tabId} status until this harness appears in the roster: it lists your owner's projects, one line each, and the newest tasks; status --project NAME reads one project's tasks. ${code}${none} Your chat with your owner is conversation ${chat}: read it with harness super-tab --tab ${tabId} messages ${chat}, and reply there with harness super-tab --tab ${tabId} post ${chat} 'your message' UNIQUE_OPERATION_ID. When your owner asks you to send something to a project's PM, send their proposal yourself, naming that project; if it is unclear which project, ask them first. Then greet your owner there and ask what they have in mind. If sandbox restrictions block this local command, request permission to run it outside the sandbox.`+ return `You are a person's one Buddy in a shared Super Tab, for every project they read. ${mode ? `${swarmSkillUse({ role: 'buddy' }, mode)} ` : ''}Run harness super-tab --tab ${tabId} status until this harness appears in the roster: it lists your owner's projects, one line each, and the newest tasks; status --project NAME reads one project's tasks. ${code}${none} Your chat with your owner is conversation ${chat}: read it with harness super-tab --tab ${tabId} messages ${chat}, and reply there with harness super-tab --tab ${tabId} post ${chat} 'your message' UNIQUE_OPERATION_ID. When your owner asks you to send something to a project's PM, send their proposal yourself, naming that project; if it is unclear which project, ask them first. Then greet your owner there and ask what they have in mind. ${buddyProposalOffer} If sandbox restrictions block this local command, request permission to run it outside the sandbox.`}/** A project session of a person's one Buddy chat: the Buddy for that one project, in one thread, the only Buddy that sends* into it. It reads that project and its owner's words in its thread alone. */function projectSessionPrompt(tabId: string, chat: string, thread: string, mode: SwarmSkillMode | null): string {- return `You are a person's Buddy in a shared Super Tab, in a session of your own for one project, in one thread of your owner's chat. ${mode ? `${swarmSkillUse({ role: 'buddy' }, mode)} ` : ''}Run harness super-tab --tab ${tabId} status until this harness appears in the roster: it is your project's tasks, and your folder is its code. Your thread is the one rooted at message ${thread} in conversation ${chat}. Read it with harness super-tab --tab ${tabId} messages ${chat} --thread ${thread}: you read your owner's words there and your own, nothing else of the chat. Answer your owner only in this thread: harness super-tab --tab ${tabId} post ${chat} 'your message' UNIQUE_OPERATION_ID --reply-to MESSAGE_ID, naming a message in this thread. When your owner asks, send their proposal to this project's PM, for their message in this thread. Your owner's newest message in the thread is the one to answer first. If sandbox restrictions block this local command, request permission to run it outside the sandbox.`+ return `You are a person's Buddy in a shared Super Tab, in a session of your own for one project, in one thread of your owner's chat. ${mode ? `${swarmSkillUse({ role: 'buddy' }, mode)} ` : ''}Run harness super-tab --tab ${tabId} status until this harness appears in the roster: it is your project's tasks, and your folder is its code. Your thread is the one rooted at message ${thread} in conversation ${chat}. Read it with harness super-tab --tab ${tabId} messages ${chat} --thread ${thread}: you read your owner's words there and your own, nothing else of the chat. Answer your owner only in this thread: harness super-tab --tab ${tabId} post ${chat} 'your message' UNIQUE_OPERATION_ID --reply-to MESSAGE_ID, naming a message in this thread. When your owner asks, send their proposal to this project's PM, for their message in this thread. Your owner's newest message in the thread is the one to answer first. ${buddyProposalOffer} If sandbox restrictions block this local command, request permission to run it outside the sandbox.`}/** Why a thread session that is not Claude Code's never starts. */diff --git a/docs/plans/2026-11-06-buddy-proposal-offers-plan.md b/docs/plans/2026-11-06-buddy-proposal-offers-plan.mdnew file mode 100644index 000000000..31620c991--- /dev/null+++ b/docs/plans/2026-11-06-buddy-proposal-offers-plan.md@@ -0,0 +1,56 @@+# Buddy proposal offers implementation plan++> Implemented by the Engineer in this session, task by task, test first; one independent review of the pull request.++**Goal:** A Buddy offers to propose a ready idea once, checks existing work first, and sends the exact shown proposal only after its owner agrees.++**Architecture:** Update the four Buddy launch prompts and the shared built-in Buddy skill. Keep the existing proposal command, quoted-message consent contract and project boundaries.++**Tech Stack:** TypeScript and Vitest; no dependencies.++**Spec:** Harness task #3865, “A Buddy offers to turn a good idea into a proposal,” requested by Dee on 2026-11-06 (conversation `6c9be92915cf280cbc548667`).++## Global Constraints++- Prompt text only, plus tests of the built instructions.+- A ready idea has a clear goal, why it matters and a done-when condition.+- Check for an existing proposal or task before offering; point to a match instead of duplicating it.+- Show the exact proposal and ask “Want me to propose this to <project>?” without waiting to be asked.+- Never send without the person's agreement. One offer per idea; no nagging.+- Keep the quoted `I'll post this as you:` consent format and the existing project scope.++## Review Focus++- All four launch paths must carry the offer, duplicate-check and consent instructions.+- The built skill must agree with the launch prompt in every skill mode.+- An ignored or declined offer must not be repeated or sent.+- A matching existing proposal/task must be surfaced instead of another offer.+- Ambiguous project choice and changed proposal wording still need the owner's answer.++## Design++No storage, query, lock, audience, identity, telemetry or API changes. Growth, concurrency, read-cost and scale changes are N/A: this modifies instructions only. Existing bounded project reads and proposal consent enforcement remain in use. Compatibility requires no backend deployment or migration; rollback reverts the prompt text. Platforms: Buddy instructions on macOS, Linux and Windows; local tests on macOS and Linux CI.++## Conversation example++```text+Person: Reconnecting loses my draft. Keep it until I send or discard it.+Buddy: [Checks the project's existing proposals and tasks.]+Buddy: Want me to propose this to Harness?+ I'll post this as you: "Keep my unsent draft through a reconnect so I don't lose work; done when it stays until I send or discard it."+Person: Yes.+Buddy: [Sends those exact words once.]+```++## Task 1: Offer ready ideas in every Buddy context++**Files:** Modify `cli/src/superTabs/start.ts`, `cli/src/lib/swarmSkills.ts`; test `cli/src/superTabs/start.spec.ts` and `cli/src/lib/swarmSkills.spec.ts`.++**Interfaces:** Consume `startAgent(...)`'s emitted `agent_create.prompt` and `prepareSwarmSkill(...)`'s written Buddy skill. No new public interfaces; keep all command payloads unchanged.++- [ ] Add table-driven assertions on the emitted main, Swarm, thread and project-session prompts: readiness, unsolicited offer, duplicate lookup, exact shown text, owner's yes, and no repeated offer. Assert the same requirements on the built skill in all modes, preserving quoted-consent and project-selection checks.+- [ ] Commit the tests and run `npm test -- src/superTabs/start.spec.ts src/lib/swarmSkills.spec.ts --maxWorkers=2`; record the missing-instruction failures.+- [ ] Update the launch text and shared skill with the proactive offer and explicit consent boundary, removing contradictory passive-only wording.+- [ ] Run the two changed test files plus affected importer tests and `npm run typecheck`. Use automatic PR CI for the full CLI suite; no coverage/PTY gates are touched.+- [ ] Run a synthetic transcript against a native agent using the built instructions: a ready idea should produce the exact proposal and offer, without a send. Include duplicate and declined-offer cases; record the actual output and limitations in the PR.+- [ ] Commit and push the passing change, mark the PR ready, and hand review/testing to the Integrator.