Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/services/entity-context.test.ts
Original file line number Diff line number Diff line change
@@ -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");
});
});
7 changes: 5 additions & 2 deletions src/services/entity-context.ts
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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`;

Expand Down
Loading