Fernando Ramos← All skills03 of 09
← All skills

/cartographer

Orient · Domain and execution-flow mapper

Maps one requested domain or flow to verified symbols, invariants, and tests in .ramos/maps/<flow>.md (≤120 lines) using git, rg, and ast-grep, with optional freshness-checked GitNexus queries.

npx skills@latest add luci-efe/skills -s cartographer

  • OrientStage
  • 04 Context continues · 01 ObservableMethod
  • .ramos/maps/<flow>.mdProduced artifact / output

Use when

You need one domain or flow mapped to real code before planning or editing.

Support & adapters

  • Instructions usable across harnesses

Decision tree

  1. 01

    1. Check index & working-tree freshness

    Bound to one <flow> slug (never a repo-wide DOMAIN_MAP.md). Run cartographer.mjs status; if status: "blocked", resolve the reported tool error first (never an empty baseline)

    → fresh | stale | absent/unindexed | blocked
  2. 02

    2A–2B. GitNexus fresh or stale-overlay branch

    If fresh + clean, query GitNexus processes/callers; if stale or dirty files intersect, run kind-aware ast-grep verification within ±3–20 lines and stamp "stale_overlay": true

    → Verified symbols + live_line
  3. 03

    2C. Stateless baseline branch (rg + ast-grep)

    When GitNexus is absent/unindexed or a symbol is unverified, trace 1–3 hops with literal rg and structural ast-grep (--pattern); never auto-run gitnexus analyze

    → mode: baseline (rg + ast-grep)
  4. 04

    3. Write bounded flow slice

    Write .ramos/maps/<flow>.md (strictly ≤120 lines) with Header, Entrypoints & Call Chain, State & Invariants, Tests, and ## Unknowns / not covered

    → .ramos/maps/<flow>.md

Prerequisites & install recipes

  • gitrequired · baseline & gitnexus branchesgit
    brew install git
  • rgrequired · baseline branchrg
    brew install ripgrep
  • ast-greprequired · baseline branchast-grep
    brew install ast-grep
  • gitnexusoptional · gitnexus branchgitnexus
    npm i -g gitnexusoptional · PolyForm Noncommercial license, check before commercial use

Completion criteria

  • .ramos/maps/<flow>.md exists, is strictly ≤120 lines, and maps one bounded flow (never a repo-wide static DOMAIN_MAP.md).
  • Every symbol and invariant cites a verified path:line in the live checkout (live_line when stale_overlay is true).
  • Includes an explicit ## Unknowns / not covered section for unresolved dynamic edges, unindexed external services, or untested branches.
  • Missing required tools (git, rg, ast-grep) return status: "blocked" with install commands (exit 2); never auto-runs gitnexus analyze, setup, or clean.

Example

Mapping the mission cancel flow (CLI, then plugin HTTP, then process terminate) in a public project with no code index, so the skill falls back to its rg and ast-grep baseline mode.

What was run

C=$SKILLS/cartographer/scripts/cartographer.mjs
node $C status
node $C query "cancelMissionRunViaPlugin" --pattern 'cancelMissionRunViaPlugin($$$)' --lang ts

Output (excerpt)

status:"ok"  mode:"baseline"  ast_scope:"rg_files"  truncated:false
rg_matches (8):  src/cli.ts:28 (import), src/cli.ts:1250 (call), src/harness/mission-cancel.ts:31 (def),
                 tests/mission-cancel.test.ts:3, :21, :24, :40, :44
ast_matches (4): tests/mission-cancel.test.ts:24, :40, :44 and the call in src/cli.ts:1250

# Flow: mission cancel (uh mission cancel)   [written by hand from the queries plus rg -n]
1. CLI command "cancel"                            src/cli.ts:1224-1225
2. cancelMissionRunViaPlugin(opts.pluginUrl, ...)  call src/cli.ts:1250, def src/harness/mission-cancel.ts:31
3. POST ${base}/runs/<id>/cancel                   src/harness/mission-cancel.ts:39
4. Plugin route cancel_run                         apps/hermes-plugin/dashboard/plugin_api.py:1283-1284
5. proc.terminate(), status -> cancelled           plugin_api.py:1308, 1319
Unknowns:   Python lines found with rg, not ast-grep; dynamic route registration not traced

What it found. The whole TypeScript side of the flow and its covering tests in two queries; every line cited in the flow slice was re-checked against the file.

Caveat. It does not follow HTTP edges: the Python hop needed a manual rg and was recorded under Unknowns. AST results are scoped to the files the text search hit, not exhaustive. The script writes nothing; the flow slice was written by hand.

View skill source on GitHub

Want something like this built for your company?

Book a callMessage me on LinkedInSee Agentic Engineering
← All skills