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,5 +1,7 @@
---
description: Initialize or update a project with scaffold, docs, and .memory files — adapts to both new and existing projects.
description: Initialize or update a project with scaffold, docs, and basic-memory
notes — adapts to both new and existing projects.
permalink: opencode-config/commands/init
---
You are initializing or updating a project. Follow these steps in order.
@@ -51,7 +53,6 @@ Delegate to the `coder` subagent with explicit mode (`new_project` or `existing_
- `.github/copilot-instructions.md` — symlink to `../AGENTS.md`
- `docs/architecture.md` — stub with title + purpose
- `.gitignore` — add stack-appropriate ignores (e.g., `node_modules/`, `__pycache__/`, `target/`)
- `.memory/` — create and/or update `knowledge.md`, `decisions.md`, `plans/`, `research/`
- other stack-specific scaffold files if clearly implied (e.g., `package.json`, `pyproject.toml`)
- If `new_project`:
- create all required scaffold files/directories
@@ -65,7 +66,6 @@ Delegate to the `coder` subagent with explicit mode (`new_project` or `existing_
- `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
- if `.memory/` is missing, create the full `.memory/` directory structure
- 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`
@@ -80,17 +80,19 @@ Always delegate to the `librarian` subagent, for both new and existing projects.
- Ensure stubs are explicitly marked for later completion.
- Keep edits additive and non-destructive for existing projects.
## Step 5 — Initialize or update `.memory` project overview (Lead)
## Step 5 — Initialize or update basic-memory project notes (Lead)
Always create or update `.memory/knowledge.md` for this project.
Always create or update basic-memory project notes for this project.
- Read existing `.memory/knowledge.md` (if present) to avoid duplicate sections.
- Create or update a project overview section with:
- **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`.
- 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:
- Project name
- Purpose and stack
- Key files (`README.md`, `AGENTS.md`, `docs/architecture.md` when present)
- Notable init/update decisions
- Add markdown cross-references to related sections in `.memory/decisions.md` when applicable.
- Add WikiLink cross-references to related notes (e.g., `[[decisions/...]]`).
## Step 6 — Git handling (delegate to `coder`)
@@ -112,4 +114,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).