From f9880638e989a61928a03e67a1765c54051d5725 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 8 Mar 2026 19:51:37 +0000 Subject: [PATCH] feat: agents read cross-tool instruction files at session start AGENTS.md, CLAUDE.md, copilot-instructions.md, and .cursorrules may contain project knowledge added by other tools or people. Agents now read these files at session start and merge new knowledge into .memory/knowledge.md as the canonical source. --- .config/opencode/AGENTS.md | 3 ++- .config/opencode/agents/lead.md | 1 + .config/opencode/commands/bootstrap-memory.md | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/opencode/AGENTS.md b/.config/opencode/AGENTS.md index e3df3c1..da7c50c 100644 --- a/.config/opencode/AGENTS.md +++ b/.config/opencode/AGENTS.md @@ -16,7 +16,7 @@ Use markdown files in `.memory/` as the persistent project memory across session **Workflow: read files → work → update files** -1. **Session start:** Read `.memory/` directory contents and skim `.memory/knowledge.md`. +1. **Session start:** Read `.memory/` directory contents and skim `.memory/knowledge.md`. Also check for cross-tool instruction files (`CLAUDE.md`, `.github/copilot-instructions.md`, `.cursorrules`) — they may contain project knowledge added by other tools. 2. **Before each task:** Read relevant `.memory/*.md` files before reading source files for project understanding. 3. **After each task:** Update the appropriate `.memory/*.md` files with what was built. @@ -45,6 +45,7 @@ Be specific in summaries: include parameter names, defaults, file locations, and - When project knowledge changes significantly, update **all** cross-tool instruction files. - When initializing or bootstrapping a project, create **all** cross-tool instruction files. - Do not duplicate `.memory/` internals in these files; they describe how to work with the project, not project tracking state. +- **Read existing instruction files** at session start or when joining a new project. Other tools/people may have added project knowledge to `CLAUDE.md` or `.cursorrules` that isn't yet in `.memory/`. Merge any new knowledge into `.memory/knowledge.md` as the canonical source. ## Session Continuity diff --git a/.config/opencode/agents/lead.md b/.config/opencode/agents/lead.md index 2e338b3..a08f670 100644 --- a/.config/opencode/agents/lead.md +++ b/.config/opencode/agents/lead.md @@ -280,6 +280,7 @@ Never jump directly to user interruption. - Before each phase, read only relevant `.memory/` files when context is likely to exist. - **Recording discipline:** Only record outcomes, decisions, and discoveries — not phase transitions or ceremony checkpoints. - **Read discipline:** Skip redundant reads when this session already showed no relevant notes in that domain, and avoid immediately re-reading content you just wrote. +- **Commit shared memory artifacts.** The `.memory/` directory should be committed to git for collaboration — it contains project knowledge, plans, decisions, and research in human-readable markdown. ## Parallelization Mandate diff --git a/.config/opencode/commands/bootstrap-memory.md b/.config/opencode/commands/bootstrap-memory.md index da346ec..6a16ff5 100644 --- a/.config/opencode/commands/bootstrap-memory.md +++ b/.config/opencode/commands/bootstrap-memory.md @@ -28,6 +28,10 @@ Create (if missing): Run `git ls-files` to understand the project layout, then read `README.md` and the highest-signal files for architecture and conventions. +Also check for existing cross-tool instruction files (`AGENTS.md`, `CLAUDE.md`, +`.github/copilot-instructions.md`, `.cursorrules`) — they may contain project +knowledge from other tools or team members that should be incorporated. + Identify: - What the project does (primary capabilities) - Core modules/subsystems and responsibilities