npx skills add ...
npx skills add alvinunreal/oh-my-opencode-slim --skill codemap
Generate comprehensive hierarchical codemaps for UNFAMILIAR repositories. Expensive operation - only use when explicitly asked for codebase documentation or initial repository mapping
npx skills add alvinunreal/oh-my-opencode-slim --skill codemap
You help users understand and map repositories by creating hierarchical codemaps.
First, check if .slim/codemap.json exists in the repo root.
If it does not exist, check for legacy state at .slim/cartography.json.
If legacy state exists: move .slim/cartography.json to .slim/codemap.json, then continue with change detection.
If .slim/codemap.json exists: Skip to Step 3 (Detect Changes) - no need to re-initialize.
If neither file exists: Continue to Step 2 (Initialize).
src/**/*.ts, package.json, etc.**/*.test.ts, **/*.spec.ts, tests/**, __tests__/**docs/**, *.md (except root README.md if needed), LICENSEnode_modules/**, dist/**, build/**, *.min.js.gitignore automaticallyscripts/codemap.mjs is relative to this skill's base directory — the host prints it as Base directory for this skill):This creates:
.slim/codemap.json - File and folder hashes for change detectioncodemap.md files in all relevant subdirectoriescodemap.md file.Review the output - It shows:
Only update affected codemaps - Spawn one fixer per affected folder to update its codemap.md.
Run update to save new state:
Once all specific directories are mapped, the Orchestrator must create or update the root codemap.md. This file serves as the Master Entry Point for any agent or human entering the repository.
package.json, index.ts, plugin.json) and the project's overall purpose.codemap.md, extract its Responsibility summary and include it in a table or list in the root map.OpenCode auto-loads AGENTS.md into agent context on every session. To ensure agents automatically discover and use the codemap, update (or create) AGENTS.md at the repo root:
AGENTS.md already exists and already contains a ## Repository Map section, skip this step - the reference is already set up.AGENTS.md exists but has no ## Repository Map section, append the section below.AGENTS.md doesn't exist, create it with the section below.This is idempotent - repeated codemap runs will detect the existing section and skip. No duplication.
Fixers are responsible for writing codemap.md files during this workflow. Use precise technical terminology to document the implementation:
Example codemap:
Example Root Codemap (Atlas):
node scripts/codemap.mjs changes \
--root ./node scripts/codemap.mjs update \
--root ./## Repository Map
A full codemap is available at `codemap.md` in the project root.
Before working on any task, read `codemap.md` to understand:
- Project architecture and entry points
- Directory responsibilities and design patterns
- Data flow and integration points between modules
For deep work on a specific folder, also read that folder's `codemap.md`.# src/agents/
## Responsibility
Defines agent personalities and manages their configuration lifecycle.
## Design
Each agent is a prompt + permission set. Config system uses:
- Default prompts (orchestrator.ts, explorer.ts, etc.)
- User overrides from ~/.config/opencode/oh-my-opencode-slim.json
- Permission wildcards for skill/MCP access control
## Flow
1. Plugin loads → calls getAgentConfigs()
2. Reads user config preset
3. Merges defaults with overrides
4. Applies permission rules (wildcard expansion)
5. Returns agent configs to OpenCode
## Integration
- Consumed by: Main plugin (src/index.ts)
- Depends on: Config loader, skills registry