Mapwrite
Purpose
Use this skill to keep project context discovery small, layered, and current. Treat wiki indexes and
code indexes as one navigation workflow with separate artifacts.
First Pass
- Read the repo's root agent instructions, usually
AGENTS.md and/or CLAUDE.md.
- Read
wiki/index.md when it exists.
- Read
wiki/code-index/index.md when it exists and the task touches code.
- Follow only the relevant narrow spec, plan, or code-index shard.
- Use
rg or rg --files to verify symbols and files before opening large code files.
Do not read all wiki files, all logs, generated mega-indexes, caches, env files, session data, or
test scratch directories unless the user explicitly asks for that history or artifact.
Artifact Roles
Keep these responsibilities separate:
wiki/index.md: wiki-only map for specs, plans, shards, runbooks, and high-level knowledge
documents.
wiki/code-index/index.md: top-level human-readable code navigation map.
wiki/code-index/**/*.md: narrow maps for subsystems, entrypoints, facades, boundaries, and
related tests.
wiki/spec/**/*.md: behavior and architecture source of truth.
wiki/plan/**/*.md: implementation sequence and acceptance criteria.
wiki/log.md: append-only change history; inspect recent headings or tail only unless a
historical task requires more.
.agent-index/: optional generated symbol or call-graph helpers, not a substitute for targeted
reads and rg verification.
Code-Index Protocol
When creating or updating code indexes:
- Prefer a nested map over one large file.
- Start with
wiki/code-index/index.md, then add subsystem shards only as needed.
- Keep each shard concise and navigational; do not turn it into a behavior spec.
- Include subsystem purpose, read-first files, entrypoints/facades, boundaries, related tests, and
common spec/plan links.
- Add more shards when a parent file becomes too broad.
Recommended shape:
wiki/code-index/
index.md
backend.md
bot.md
tests.md
scripts.md
alembic.md
backend/
api.md
services.md
workers.md
db.md
bot/
engagement.md
search.md
accounts.md
formatting.md
Generated Index Policy
Generated symbol indexes are optional helper artifacts. Keep them outside the human-authored wiki
maps, preferably under .agent-index/, and exclude:
wiki/llm-wiki.md
wiki/llm-wiki-md.txt
wiki/log.md
.claude/
- env files
- sessions, data volumes, caches, and pytest scratch directories
Never rely on generated indexes alone before editing. Verify with rg and targeted file reads.
After Changes
Update only the artifacts whose responsibility changed:
- Update
wiki/index.md when specs, plans, shard directories, runbooks, or code-index entrypoints
change.
- Update the relevant
wiki/code-index/ shard when code files, ownership boundaries, facades,
entrypoints, or related test maps change.
- Update relevant specs only when behavior or architecture changed.
- Append
wiki/log.md for code or wiki changes.
- Run the repo's local validation gates from
AGENTS.md or CLAUDE.md; if a gate cannot run, note
why in the handoff and, when required by the repo, in wiki/log.md.
1---2name: mapwrite3description: Navigate repo-specific wiki protocols, code-index maps, and agent update rules. Use when Codex needs to work in a repository that has `wiki/index.md`, `wiki/code-index/`, `AGENTS.md`, or `CLAUDE.md`; when creating, updating, or following wiki specs/plans; when creating or maintaining nested code indexes; when deciding which project files to read before code changes; or when updating agent-facing project navigation instructions.4---56# Mapwrite78## Purpose910Use this skill to keep project context discovery small, layered, and current. Treat wiki indexes and11code indexes as one navigation workflow with separate artifacts.1213## First Pass14151. Read the repo's root agent instructions, usually `AGENTS.md` and/or `CLAUDE.md`.162. Read `wiki/index.md` when it exists.173. Read `wiki/code-index/index.md` when it exists and the task touches code.184. Follow only the relevant narrow spec, plan, or code-index shard.195. Use `rg` or `rg --files` to verify symbols and files before opening large code files.2021Do not read all wiki files, all logs, generated mega-indexes, caches, env files, session data, or22test scratch directories unless the user explicitly asks for that history or artifact.2324## Artifact Roles2526Keep these responsibilities separate:2728- `wiki/index.md`: wiki-only map for specs, plans, shards, runbooks, and high-level knowledge29 documents.30- `wiki/code-index/index.md`: top-level human-readable code navigation map.31- `wiki/code-index/**/*.md`: narrow maps for subsystems, entrypoints, facades, boundaries, and32 related tests.33- `wiki/spec/**/*.md`: behavior and architecture source of truth.34- `wiki/plan/**/*.md`: implementation sequence and acceptance criteria.35- `wiki/log.md`: append-only change history; inspect recent headings or tail only unless a36 historical task requires more.37- `.agent-index/`: optional generated symbol or call-graph helpers, not a substitute for targeted38 reads and `rg` verification.3940## Code-Index Protocol4142When creating or updating code indexes:43441. Prefer a nested map over one large file.452. Start with `wiki/code-index/index.md`, then add subsystem shards only as needed.463. Keep each shard concise and navigational; do not turn it into a behavior spec.474. Include subsystem purpose, read-first files, entrypoints/facades, boundaries, related tests, and48 common spec/plan links.495. Add more shards when a parent file becomes too broad.5051Recommended shape:5253```text54wiki/code-index/55 index.md56 backend.md57 bot.md58 tests.md59 scripts.md60 alembic.md61 backend/62 api.md63 services.md64 workers.md65 db.md66 bot/67 engagement.md68 search.md69 accounts.md70 formatting.md71```7273## Generated Index Policy7475Generated symbol indexes are optional helper artifacts. Keep them outside the human-authored wiki76maps, preferably under `.agent-index/`, and exclude:7778- `wiki/llm-wiki.md`79- `wiki/llm-wiki-md.txt`80- `wiki/log.md`81- `.claude/`82- env files83- sessions, data volumes, caches, and pytest scratch directories8485Never rely on generated indexes alone before editing. Verify with `rg` and targeted file reads.8687## After Changes8889Update only the artifacts whose responsibility changed:9091- Update `wiki/index.md` when specs, plans, shard directories, runbooks, or code-index entrypoints92 change.93- Update the relevant `wiki/code-index/` shard when code files, ownership boundaries, facades,94 entrypoints, or related test maps change.95- Update relevant specs only when behavior or architecture changed.96- Append `wiki/log.md` for code or wiki changes.97- Run the repo's local validation gates from `AGENTS.md` or `CLAUDE.md`; if a gate cannot run, note98 why in the handoff and, when required by the repo, in `wiki/log.md`.