Initialize or refresh the .ai-map/ context framework in any project. Use when the user asks to "set up ai-map", "init ai-map", "refresh the map", or when opening a project where .ai-map/README.md contains the marker "AUTO-FILL: PENDING". Scans the repo via bundled parser (.ai-map/_parser/scan.sh), writes graph.json, then auto-populates all .ai-map markdown files from that graph.
Initializes the .ai-map/ framework in the current project, or refreshes it after major changes. Works on any stack with fallbacks for unsupported languages.
.ai-map/README.md contains AUTO-FILL: PENDING, run init.If .ai-map/ does not exist:
.ai-map/ found. Install the framework here? (y/n)"bash setup.sh (from framework repo) or curl -fsSL https://raw.githubusercontent.com/<org>/ai-map-framework/main/setup.sh | bashpowershell -File setup.ps1template/.ai-map/ into project root.bash .ai-map/_parser/scan.sh # Unix
powershell -File .ai-map/_parser/scan.ps1 # Windows
Outputs .ai-map/_cache/graph.json with stack, tree, routes, exports, imports, todos, stubs, stats.
If scanner exits non-zero (unsupported stack, missing runtime), fall through to Lite Mode in .ai-map/INIT.md.
graph.json, populate map filesFollow .ai-map/INIT.md Step 2A exactly. Replace every AUTO-FILL: PENDING block with real content pulled from graph data:
README.md ← stack, description, top depsARCHITECTURE.md ← tree, entry points, modulesSOP.md ← framework, TS, test runner, observed conventionsFLOW_MAP.md ← routes grouped by prefix, ORM + schema locationGOAL_TRACKER.md ← built (folders + routes), in-progress (stubs + WIP commits)KNOWN_ISSUES.md ← todos + stubsDECISIONS.md ← only seed if commits/README reveal non-obvious choices; never fabricateSESSION_LOG.md ← first-entry init line with statsPost one short summary:
Auto-filled
.ai-map/from repo scan. Detected<framework>+<orm>,<N>routes,<N>TODOs,<N>stubs across<N>files. ReviewREADME.mdandARCHITECTURE.md— flag anything wrong.
Do not dump file contents into chat.
If .ai-map/ already populated (no AUTO-FILL markers) and user asks to refresh:
graph.json against existing map files.Do NOT overwrite DECISIONS.md or human-written sections of README.md on refresh.
After this skill completes, respect the triggers in .ai-map/INIT.md Step 3: any code change should update the matching map file in the same turn.
AUTO-FILL: PENDING markers in place.node_modules/, .next/, dist/, build/, .git/, venv/, target/, vendor/..ai-map/_cache/graph.json which is gitignored. Don't commit it.