diff --git a/src/services/entity-context.test.ts b/src/services/entity-context.test.ts new file mode 100644 index 0000000..ec18b5b --- /dev/null +++ b/src/services/entity-context.test.ts @@ -0,0 +1,11 @@ +import { describe, expect, test } from "bun:test"; + +import { AGENT_ENTITY_CONTEXT } from "./entity-context.js"; + +describe("capture entity context", () => { + test("prioritizes human-memorable knowledge over transient Git state", () => { + expect(AGENT_ENTITY_CONTEXT).toContain("human teammate"); + expect(AGENT_ENTITY_CONTEXT).toContain("decisions, lessons, preferences"); + expect(AGENT_ENTITY_CONTEXT).toContain("Transient repository state Git already tracks"); + }); +}); diff --git a/src/services/entity-context.ts b/src/services/entity-context.ts index 4cd6f02..0ddc8cf 100644 --- a/src/services/entity-context.ts +++ b/src/services/entity-context.ts @@ -1,12 +1,14 @@ export const AGENT_ENTITY_CONTEXT = `Shared coding-agent memory for one software repository. RULES: -- Preserve durable context that helps Claude Code, Codex, OpenCode, or Cursor continue the work +- Remember what a human teammate would remember: decisions, lessons, preferences, and durable project knowledge +- Preserve context that helps Claude Code, Codex, OpenCode, or Cursor continue the work later - Condense assistant responses into decisions, outcomes, and reusable knowledge - Keep user preferences and project facts concise and independently understandable +- Prefer why a choice was made and what was learned over mechanical progress updates EXTRACT: -- User preferences, accepted decisions, durable workflows, actions, and learnings +- User preferences, accepted decisions, durable workflows, outcomes, and lessons learned - Architecture: "uses monorepo with turborepo", "API in /apps/api" - Conventions: "components in PascalCase", "hooks prefixed with use" - Patterns: "all API routes use withAuth wrapper", "errors thrown as ApiError" @@ -15,6 +17,7 @@ EXTRACT: SKIP: - Generic assistant suggestions the user did not accept +- Transient repository state Git already tracks: current branch or commit, uncommitted files and diffs, and in-flight commit, push, or PR status - Transient command output and low-value implementation chatter - Granular details that do not help future work`;