diff --git a/packages/coding-agent/src/core/resource-loader.ts b/packages/coding-agent/src/core/resource-loader.ts index 7466e69..ac2680f 100644 --- a/packages/coding-agent/src/core/resource-loader.ts +++ b/packages/coding-agent/src/core/resource-loader.ts @@ -126,7 +126,6 @@ const companionContextFilenames = [ "USER.md", "TOOLS.md", "MEMORY.md", - "BOOTSTRAP.md", ]; function loadNamedContextFilesFromDir( diff --git a/packages/coding-agent/src/core/system-prompt.ts b/packages/coding-agent/src/core/system-prompt.ts index cd9e860..5d2dc95 100644 --- a/packages/coding-agent/src/core/system-prompt.ts +++ b/packages/coding-agent/src/core/system-prompt.ts @@ -52,35 +52,19 @@ function buildProjectContextSection( ); let section = "\n\n# Context\n\n"; - section += - "These files define who you are, what you know, and how you operate.\n"; const guides: string[] = []; if (hasFile("SOUL.md")) { - guides.push( - "**SOUL.md** defines your personality and tone. Embody it fully.", - ); + guides.push("**SOUL.md** is who you are."); } if (hasFile("USER.md")) { guides.push( - "**USER.md** is what you know about your user. Update it when you learn new facts. Don't ask for info that's already here.", + "**USER.md** is what you know about your user. Add to it as you learn.", ); } if (hasFile("MEMORY.md")) { - guides.push( - "**MEMORY.md** is your long-term memory. Reference it. Update it when you learn something durable.", - ); - } - if (hasFile("TOOLS.md")) { - guides.push( - "**TOOLS.md** is your environment reference: paths, ports, installed software. Trust it over assumptions.", - ); - } - if (hasFile("BOOTSTRAP.md")) { - guides.push( - "**BOOTSTRAP.md** is your onboarding checklist. Execute it before other work.", - ); + guides.push("**MEMORY.md** is what you remember. Keep it current."); } if (guides.length > 0) { @@ -221,7 +205,7 @@ export function buildSystemPrompt( // Browser workflow if (hasBrowser) { addGuideline( - "Browser: open the URL, snapshot to see interactive elements, then click/fill/wait. Always snapshot before interacting", + "Browser: snapshot before interacting with elements. Use it for research and learning too, not just automation", ); } @@ -252,12 +236,14 @@ export function buildSystemPrompt( const guidelines = guidelinesList.map((g) => `- ${g}`).join("\n"); - let prompt = `You are a personal companion with a persistent sandbox. You write code, run commands, browse the web, and build applications. Your workspace and memory carry over between sessions. + let prompt = `You are a companion who lives in a persistent sandbox. You have a filesystem, a shell, and a browser. Your workspace and memories carry over between sessions. This sandbox is your home. + +You're not just a request handler. You have your own curiosity and initiative. Use the browser to research things that interest you or your user. Build things you think would be useful. Notice things worth fixing or improving and act on them. Not every message needs a tool call - sometimes the best response is just a good conversation. Tools: ${toolsList} -Guidelines: +When using tools: ${guidelines}`; if (appendSection) { diff --git a/packages/coding-agent/test/resource-loader.test.ts b/packages/coding-agent/test/resource-loader.test.ts index 6b9253f..0e53864 100644 --- a/packages/coding-agent/test/resource-loader.test.ts +++ b/packages/coding-agent/test/resource-loader.test.ts @@ -327,7 +327,6 @@ Content`, mkdirSync(appDir, { recursive: true }); writeFileSync(join(workspaceDir, "IDENTITY.md"), "# Identity\n\nPi"); writeFileSync(join(workspaceDir, "TOOLS.md"), "# Tools\n\nUse ~/.pi"); - writeFileSync(join(workspaceDir, "BOOTSTRAP.md"), "# Bootstrap\n\nDo it"); const loader = new DefaultResourceLoader({ cwd: appDir, agentDir }); await loader.reload(); @@ -337,9 +336,6 @@ Content`, true, ); expect(agentsFiles.some((f) => f.path.endsWith("TOOLS.md"))).toBe(true); - expect(agentsFiles.some((f) => f.path.endsWith("BOOTSTRAP.md"))).toBe( - true, - ); }); it("should discover SYSTEM.md from cwd/.pi", async () => { diff --git a/packages/coding-agent/test/system-prompt.test.ts b/packages/coding-agent/test/system-prompt.test.ts index 7985767..cfd1631 100644 --- a/packages/coding-agent/test/system-prompt.test.ts +++ b/packages/coding-agent/test/system-prompt.test.ts @@ -83,8 +83,8 @@ describe("buildSystemPrompt", () => { }); }); - describe("SOUL.md context", () => { - test("adds persona guidance when SOUL.md is present", () => { + describe("context files", () => { + test("adds soul guidance when SOUL.md is present", () => { const prompt = buildSystemPrompt({ contextFiles: [ { @@ -95,31 +95,23 @@ describe("buildSystemPrompt", () => { skills: [], }); - expect(prompt).toContain("SOUL.md** defines your personality and tone"); + expect(prompt).toContain("SOUL.md** is who you are"); expect(prompt).toContain("## /tmp/project/SOUL.md"); }); - test("adds companion context guidance for tools and bootstrap files", () => { + test("includes file contents in context section", () => { const prompt = buildSystemPrompt({ contextFiles: [ { - path: "/home/node/.pi/workspace/TOOLS.md", - content: "# Tools\n\nUse ~/.pi/apps", - }, - { - path: "/home/node/.pi/workspace/BOOTSTRAP.md", - content: "# Bootstrap\n\nDo the setup", + path: "/home/node/.pi/workspace/USER.md", + content: "# User\n\nLikes coffee.", }, ], skills: [], }); - expect(prompt).toContain( - "TOOLS.md** is your environment reference", - ); - expect(prompt).toContain( - "BOOTSTRAP.md** is your onboarding checklist", - ); + expect(prompt).toContain("USER.md** is what you know about your user"); + expect(prompt).toContain("Likes coffee."); }); }); });