Goal: reduce token usage by reading indexed repo context first, then reading only relevant source files.
Core idea
Read .aix context before deep code exploration.
Do minimal reads.
Avoid full-repo scan unless required.
Required workflow
- Before coding, read
.aix/AI_CONTEXT.md. - From
AI_CONTEXT.md, choose only 1-2 relevant map files in.aix/maps/. - Read only source files listed in chosen map files.
- Do not scan full repo unless:
.aixmissing, or.aixoutdated, or- task cannot be understood from available maps.
- After coding, update only relevant
.aixfiles. - Keep
.aixdocs short, factual, AI-friendly.
Outdated rules
Treat .aix as outdated when one or more applies:
AI_CONTEXT.mdcontradicts current repo layout.- map files reference missing or renamed files.
- task target area not represented in maps.
.aix/recent-changes.mdhas no fresh entry for major recent work.
When outdated:
- perform smallest possible targeted scan to recover context.
- update only affected
.aixdocs.
Read policy
- Prefer map-listed files over discovery scans.
- If map uses globs, expand only needed matches.
- Do not open unrelated files.
- Explain fallback reason when broader scan is unavoidable.
Update policy after changes
Always do both when relevant:
- append one short line to
.aix/recent-changes.md. - update impacted map file(s) when file list/ownership changes.
Do not rewrite entire .aix set when only one area changed.
Writing style for .aix
- Short sections.
- Concrete file paths.
- No long narrative.
- No marketing language.
Map file pattern
Maps must list only files that exist in this repository. Do not add assumed paths, directories, or files that are not present.
When creating or editing a map follow these steps:
- Run a glob search for candidate files inside repo (e.g.,
src/**/*.js). - Include only the concrete matches returned by the glob. If a glob matches nothing, do not add that glob to the map.
- Prefer explicit file paths to broad globs. If using a glob, expand it and paste the matched file paths into
files:so the map contains concrete file names. - If the map would be empty for this project, omit the map file or leave
files:empty and document why.
Map schema example (must reference existing files):
Description: One-line area summary.
files:
- src/api/users.js
- src/models/user.js
why: One-line reason this map should be chosen.
Language: All map files and .aix documentation MUST be written in English. Use concise, factual English for Description and why fields so AI agents and reviewers can parse reliably.
Quick execution checklist
- Read
.aix/AI_CONTEXT.md. - Pick 1-2 maps.
- Read listed files only.
- Implement change.
- Update relevant
.aixdocs.
AIX Pack Compliance
- This skill is part of AIX skill pack.
- User-facing alias: aix-map.
- When user invokes aix-map, use this skill.
- Write generated artifacts under .aix/.
- Before writing generated files, ensure directory exists with mkdir -p .aix.
- Generated files in .aix/ may be overwritten by default.
- Do not write generated files to project root unless explicitly requested.