chore: align opencode memory docs with .memory project
This commit is contained in:
@@ -19,7 +19,8 @@ so future sessions can resume quickly.
|
||||
|
||||
Use `list_memory_projects` to check whether this repo already has a basic-memory
|
||||
project. If not, create one with `create_memory_project` using a short kebab-case
|
||||
name (e.g., `my-web-app`) and the repo's root directory as `project_path`.
|
||||
name (e.g., `my-web-app`) and the repo's `.memory/` subdirectory as `project_path`
|
||||
(e.g., `/path/to/repo/.memory`).
|
||||
|
||||
All subsequent `write_note`, `search_notes`, and `build_context` calls in this
|
||||
command must pass `project="<repo-project-name>"` for project-specific notes, or
|
||||
@@ -36,9 +37,9 @@ current state prevents duplication and helps you decide what to create vs update
|
||||
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`,
|
||||
`.cursorrules`, `.github/copilot-instructions.md`) — they may contain project
|
||||
knowledge from other tools or team members that should be incorporated.
|
||||
Also check whether any legacy tool-specific instruction files exist alongside
|
||||
`AGENTS.md` — they may contain project knowledge from other tools or team
|
||||
members that should be consolidated into `AGENTS.md`.
|
||||
|
||||
Identify:
|
||||
- What the project does (primary capabilities)
|
||||
@@ -81,9 +82,9 @@ Do not store project-specific plans, decisions, or session state in `main`.
|
||||
If `AGENTS.md` exists, update it with any new project knowledge discovered
|
||||
during bootstrap (architecture, conventions, commands). Add the repo's
|
||||
basic-memory project name (e.g., `opencode-config`) to `AGENTS.md` so
|
||||
agents know which project to target. The symlinks (`CLAUDE.md`,
|
||||
`.cursorrules`, `.github/copilot-instructions.md`) will automatically
|
||||
reflect changes.
|
||||
agents know which project to target. If legacy tool-specific instruction files
|
||||
exist, consolidate any durable repo guidance into `AGENTS.md` and stop
|
||||
maintaining duplicate copies.
|
||||
|
||||
If the instruction file doesn't exist, note that `/init` should be run to create it.
|
||||
|
||||
@@ -94,4 +95,4 @@ If the instruction file doesn't exist, note that `/init` should be run to create
|
||||
- Prefer durable knowledge over transient status notes.
|
||||
- Use WikiLinks `[[Topic]]` to create relations between related notes.
|
||||
- Use tags for categorization: `#pattern`, `#convention`, `#decision`, `#architecture`.
|
||||
- Always pass the `project` parameter on every MCP call.
|
||||
- Always pass the `project` parameter on every MCP call.
|
||||
|
||||
@@ -47,10 +47,7 @@ Delegate to the `coder` subagent with explicit mode (`new_project` or `existing_
|
||||
|
||||
- Required scaffold targets:
|
||||
- `README.md` — title, purpose, tech stack, quick-start, project structure overview
|
||||
- `AGENTS.md` — real instruction file containing shared project guidance
|
||||
- `CLAUDE.md` — symlink to `AGENTS.md`
|
||||
- `.cursorrules` — symlink to `AGENTS.md`
|
||||
- `.github/copilot-instructions.md` — symlink to `../AGENTS.md`
|
||||
- `AGENTS.md` — instruction file containing shared project guidance
|
||||
- `docs/architecture.md` — stub with title + purpose
|
||||
- `.gitignore` — add stack-appropriate ignores (e.g., `node_modules/`, `__pycache__/`, `target/`)
|
||||
- other stack-specific scaffold files if clearly implied (e.g., `package.json`, `pyproject.toml`)
|
||||
@@ -60,14 +57,9 @@ Delegate to the `coder` subagent with explicit mode (`new_project` or `existing_
|
||||
- create or fill in only missing pieces
|
||||
- **do not overwrite existing files**
|
||||
- explicitly instruct coder to check existence before creating each target
|
||||
- ensure `AGENTS.md` exists as the real instruction file
|
||||
- create missing symlinks:
|
||||
- `ln -s AGENTS.md CLAUDE.md`
|
||||
- `ln -s AGENTS.md .cursorrules`
|
||||
- `ln -s ../AGENTS.md .github/copilot-instructions.md`
|
||||
- if `AGENTS.md` is missing but `.github/copilot-instructions.md` exists as a real file, move its content into `AGENTS.md`, then recreate `.github/copilot-instructions.md` as a symlink
|
||||
- ensure `AGENTS.md` exists as the project instruction file
|
||||
- if legacy tool-specific instruction files exist, consolidate any repo-specific guidance into `AGENTS.md` and stop maintaining duplicate copies
|
||||
- examples:
|
||||
- if `README.md` exists and only `CLAUDE.md` is missing, create `CLAUDE.md` as a symlink to `AGENTS.md`
|
||||
- if `docs/` is missing, create it and add `docs/architecture.md`
|
||||
|
||||
## Step 4 — Documentation review (delegate to `librarian`)
|
||||
@@ -76,7 +68,7 @@ Always delegate to the `librarian` subagent, for both new and existing projects.
|
||||
|
||||
- Ensure `README.md` is accurate and complete for the current project state.
|
||||
- Ensure `AGENTS.md` exists and captures project-specific workflow decisions from Step 2.
|
||||
- Verify `CLAUDE.md`, `.cursorrules`, and `.github/copilot-instructions.md` are symlinks to `AGENTS.md`.
|
||||
- Ensure repo instruction guidance lives in `AGENTS.md` only.
|
||||
- Ensure stubs are explicitly marked for later completion.
|
||||
- Keep edits additive and non-destructive for existing projects.
|
||||
|
||||
@@ -84,7 +76,7 @@ Always delegate to the `librarian` subagent, for both new and existing projects.
|
||||
|
||||
Always create or update basic-memory project notes for this project.
|
||||
|
||||
- **Ensure a dedicated per-repo basic-memory project exists.** Use `list_memory_projects` to check. If not found, create one with `create_memory_project` using a short kebab-case name (e.g., `my-web-app`) and the repo's root directory as `project_path`.
|
||||
- **Ensure a dedicated per-repo basic-memory project exists.** Use `list_memory_projects` to check. If not found, create one with `create_memory_project` using a short kebab-case name (e.g., `my-web-app`) and the repo's `.memory/` subdirectory as `project_path` (e.g., `/path/to/repo/.memory`).
|
||||
- All subsequent note operations in this step must pass `project="<repo-project-name>"`.
|
||||
- Use `search_notes` (with `project`) to check for existing project notes to avoid duplicates.
|
||||
- Use `write_note` (with `project`) to create or update a `knowledge/overview` note with:
|
||||
@@ -114,4 +106,4 @@ Delegate git operations to `coder` based on discovered state.
|
||||
Summarize:
|
||||
- Files created and files updated, with purpose.
|
||||
- Decisions made and decisions deferred.
|
||||
- What the user should fill in next (stubs, open questions, follow-up documentation).
|
||||
- What the user should fill in next (stubs, open questions, follow-up documentation).
|
||||
|
||||
@@ -15,7 +15,8 @@ you noticed, or intent the user shared.
|
||||
|
||||
Use `list_memory_projects` to find this repo's dedicated basic-memory project.
|
||||
If it doesn't exist, create one with `create_memory_project` using a short
|
||||
kebab-case name and the repo's root directory as `project_path`.
|
||||
kebab-case name and the repo's `.memory/` subdirectory as `project_path`
|
||||
(e.g., `/path/to/repo/.memory`).
|
||||
|
||||
All project-specific notes must target `project="<repo-project-name>"`.
|
||||
Cross-project reusable knowledge must target `project="main"`.
|
||||
@@ -68,7 +69,7 @@ Report what was added/updated, where, and in which project.
|
||||
|
||||
If project `knowledge/` notes were **materially** updated (architecture, conventions,
|
||||
commands — not just plans/research), update `AGENTS.md` to reflect the changes.
|
||||
The symlinks automatically propagate to all tools.
|
||||
Keep repo instruction guidance in `AGENTS.md` only.
|
||||
|
||||
If updates were only plans/research/tracking details, skip this step.
|
||||
|
||||
@@ -80,4 +81,4 @@ If updates were only plans/research/tracking details, skip this step.
|
||||
- Keep hierarchy shallow (max 2 heading levels preferred).
|
||||
- Be specific. "Handles auth" is weak. "JWT auth with RS256, validated in
|
||||
`src/middleware/auth.ts`, refresh tokens in Redis with 7d TTL" is useful.
|
||||
- Always pass the `project` parameter on every MCP call.
|
||||
- Always pass the `project` parameter on every MCP call.
|
||||
|
||||
Reference in New Issue
Block a user