agentleFS
AlmxndBLAlmxndBL/Apex-core/skills/cartography/SKILL.md

cartography

Skill1 starsChanged 3 months agoMITView on GitHub

AST Codebase Skeleton Mapping, Selective Token Diet, and Project Exploration for Fast Onboarding

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. matthewharrilal/claude-skills★ 0same name
    2. open-science-pillars/core★ 0same name
    3. TerraLabAI/geoai-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When onboarding to a new codebase or re-entering an existing project, generate a compact skeleton map of types, function signatures, and …

    line 14
  2. Distinctive:

    Keep the initial structural overview within 500–800 tokens to preserve working memory without reading full implementation files.

    line 15
  3. Distinctive:

    Use the available search / symbol / file-name tools (grep, symbol search, directory listing) to pinpoint exact symbols, functions, or file …

    line 23
  4. Distinctive:

    Use bounded file reads with explicit line ranges (150–200 lines maximum).

    line 24
  5. Very specific:

    Use the dedicated TypeScript Compiler AST engine located at skills/cartography/scripts/ast-extractor.js:

    line 32

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Codebase Cartography & Token Diet Skill (v7.0.0)

Fast codebase discovery using AST Skeleton Mapping and strict token diet controls to prevent context window bloat and hallucination.


1. AST Skeleton Mapping (Fast Discovery in 1s)

  • When onboarding to a new codebase or re-entering an existing project, generate a compact skeleton map of types, function signatures, and endpoint routes.
  • Keep the initial structural overview within 500–800 tokens to preserve working memory without reading full implementation files.

2. Selective Token Diet (Search First, Read Second)

  • [FORBIDDEN] Never view entire 1,000+ line files or load unrequested adjacent modules into context.
  • [STANDARD] Selective Retrieval Protocol (use the host agent's equivalent tools):
    1. Use the available search / symbol / file-name tools (grep, symbol search, directory listing) to pinpoint exact symbols, functions, or file targets first.
    2. Use bounded file reads with explicit line ranges (150–200 lines maximum).
    3. Exception for Schemas/Contracts: Allow viewing up to 600 lines for schema.prisma, OpenAPI specs, and core shared type definitions to prevent broken inverse relations (@relation) or missing discriminated union variants.
    4. Rely on Type Definitions and Schema Interfaces to plan changes instead of reading full implementation details.

3. High-Precision Compiler AST Extraction Tool

  • Use the dedicated TypeScript Compiler AST engine located at skills/cartography/scripts/ast-extractor.js:
    import { extractAstSkeleton } from './scripts/ast-extractor.js';
    const skeleton = extractAstSkeleton('service.ts', fullCode);
  • Capabilities:
    • TypeScript & JavaScript (.ts, .tsx, .js, .jsx): Parses top-level declarations with the TypeScript compiler API and prunes implementation bodies. It is a compact contract view, not a complete semantic model; inspect source when control flow, imports, or inferred types matter.
    • Vue SFC (.vue): Automatically extracts and parses <script lang="ts"> / <script setup> contracts.
    • Prisma Schema (.prisma): Uses a lightweight line-based contract extraction that retains common fields and attributes. Inspect the schema directly when parsing edge cases or relation syntax matters.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.