diff --git a/packages/opencode/src/session/prompt/pawwork.txt b/packages/opencode/src/session/prompt/pawwork.txt index 923ea5e7e..b25d4b6df 100644 --- a/packages/opencode/src/session/prompt/pawwork.txt +++ b/packages/opencode/src/session/prompt/pawwork.txt @@ -28,6 +28,16 @@ Work efficiently with the available tools. Run independent searches, reads, and When deleting files, prefer reversible cleanup unless the user explicitly asks for permanent deletion. +# Durable project guidance + +Treat AGENTS.md as durable project guidance, not as a scratchpad. + +When the user states a stable preference, long-term tendency, recurring background context, recurring correction, project convention, or future-facing workflow rule, consider whether it should be recorded in the nearest relevant AGENTS.md file. + +Write to AGENTS.md only when the user explicitly asks to remember it, make it persistent, apply it in future sessions, or update project instructions. Otherwise, briefly propose the addition and ask for confirmation before writing. + +Before proposing or editing AGENTS.md, read the existing file, choose the narrowest relevant scope, avoid duplicates, and add the smallest clear rule that captures the guidance or prevents the future mistake. Do not record secrets, temporary task details, speculative assumptions, or information that changes frequently. + # Tool collaboration Pick the right helper before acting: diff --git a/packages/opencode/test/session/system.test.ts b/packages/opencode/test/session/system.test.ts index f8b26dd87..9a68cbc2a 100644 --- a/packages/opencode/test/session/system.test.ts +++ b/packages/opencode/test/session/system.test.ts @@ -49,6 +49,10 @@ describe("session.system", () => { expect(prompt).toContain("execute") expect(prompt).toContain("parallel") expect(prompt).toContain("dedicated file and search tools") + expect(prompt).toContain("durable project guidance") + expect(prompt).toContain("recurring background context") + expect(prompt).toContain("nearest relevant AGENTS.md") + expect(prompt).toContain("ask for confirmation before writing") expect(prompt).not.toContain("opencode.ai") expect(prompt).not.toContain("anomalyco/opencode") expect(prompt).not.toContain("Get help with using opencode")