This commit is contained in:
2026-03-10 13:09:47 +00:00
parent e0c4c2ed7b
commit ffd0d31fa5
43 changed files with 532 additions and 749 deletions

View File

@@ -1,27 +1,35 @@
# Bootstrap Project Memory Files
---
title: bootstrap-memory
type: note
permalink: opencode-config/commands/bootstrap-memory
---
# Bootstrap Project Memory
RUN { git ls-files; git ls-files --others --exclude-standard; } 2>/dev/null | sort -u
READ README.md
You are bootstrapping `.memory/` files for this project.
You are bootstrapping basic-memory project notes for this project.
Your job is to inspect the codebase and create an initial memory baseline in plain
markdown files. Capture architecture, core modules, conventions, and key decisions
Your job is to inspect the codebase and create an initial knowledge baseline in
basic-memory. Capture architecture, core modules, conventions, and key decisions
so future sessions can resume quickly.
## Step 1: Create `.memory/` structure
## Step 0: Ensure a dedicated per-repo basic-memory project exists
Create (if missing):
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`.
```
.memory/
knowledge.md
decisions.md
plans/
research/
```
All subsequent `write_note`, `search_notes`, and `build_context` calls in this
command must pass `project="<repo-project-name>"` for project-specific notes, or
`project="main"` for cross-project reusable knowledge.
`.memory/` is tracked in git.
## Step 1: Check existing basic-memory state
Use `search_notes` and `build_context` (with `project="<repo-project-name>"`) to
check whether this project already has notes in basic-memory. Understanding
current state prevents duplication and helps you decide what to create vs update.
## Step 2: Inspect project structure
@@ -37,35 +45,45 @@ Identify:
- Core modules/subsystems and responsibilities
- Key patterns/conventions (naming, layering, testing, config)
## Step 3: Write initial `knowledge.md`
## Step 3: Write initial knowledge notes
Populate `.memory/knowledge.md` with:
Use `write_note` (with `project="<repo-project-name>"`) to create project
knowledge notes under the `knowledge/` folder:
- Project purpose and scope
- Architecture overview
- Key modules with file paths
- Important implementation patterns/conventions
Use markdown sections with max 2 heading levels.
## Step 4: Seed decisions notes
## Step 4: Seed `decisions.md`
Use `write_note` (with `project="<repo-project-name>"`) to create a `decisions/`
note with any clear, durable decisions found in docs or code patterns (for
example: stack choices, testing strategy, architectural constraints). Include
rationale when known.
Populate `.memory/decisions.md` with any clear, durable decisions found in docs
or code patterns (for example: stack choices, testing strategy, architectural
constraints). Include rationale when known.
## Step 5: Initialize plans/research notes
## Step 5: Initialize plans/research folders
- If active in-progress work is discoverable, use `write_note` (with
`project="<repo-project-name>"`) to create a `plans/<feature>` note with scope,
tasks, and acceptance criteria.
- If research artifacts are discovered, use `write_note` (with
`project="<repo-project-name>"`) to create a `research/<topic>` note with
findings and references.
- If active in-progress work is discoverable, create `.memory/plans/<feature>.md`
with scope, tasks, and acceptance criteria.
- If research artifacts are discovered, create `.memory/research/<topic>.md`
with findings and references.
## Step 6: Record cross-project reusable knowledge
## Step 6: Update instruction file
If you discover patterns, conventions, or tech knowledge that would benefit other
projects, use `write_note` with `project="main"` to record them as global notes.
Do not store project-specific plans, decisions, or session state in `main`.
## Step 7: Update instruction file
If `AGENTS.md` exists, update it with any new project knowledge discovered
during bootstrap (architecture, conventions, commands). The symlinks
(`CLAUDE.md`, `.cursorrules`, `.github/copilot-instructions.md`) will
automatically reflect changes.
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.
If the instruction file doesn't exist, note that `/init` should be run to create it.
@@ -74,5 +92,6 @@ If the instruction file doesn't exist, note that `/init` should be run to create
- Be specific with file paths, APIs, parameters, and behavioral details.
- Keep sections concise and scannable.
- Prefer durable knowledge over transient status notes.
- Add markdown cross-references between related entries (for example,
knowledge entries linking to decisions).
- 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.