Logotipo de Codebase Map

Codebase Map

Comunidad
dotslashsimran
codebase-map

Understand an unfamiliar codebase fast, the way senior engineers do. Reads the orientation signals (README, manifests, CI, Dockerfiles, routes, migrations), mines git history for hotspots, hidden coupling and ownership, builds the import graph to find layers, cycles, load-bearing and dead code, then traces one real request or command end to end by actually running it. Writes MAP.md with a one-paragraph purpose, a Mermaid architecture diagram, the traced path as file:line hops, hotspot and coupling tables, a glossary, gotchas and first tasks, plus an optional SVG. Use when the user says "explain this codebase", "I'm new to this repo", "map the architecture", "onboard me", "where does X happen", "how is this project structured", or joins a new team or project.

Descripción general

Editordotslashsimran
Repositoriosimcraft
Nombre de la habilidadcodebase-map
Estrellas
362
Forks
25
Archivos incluidos
8
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando una petición es realmente relevante.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • 8 archivos incluidos

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por dotslashsimran en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Codebase Map en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/dotslashsimran/simcraft/tree/main/skills/coding/codebase-map
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → Desde URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dotslashsimran/simcraft.git /tmp/simcraft
mkdir -p .claude/skills
cp -r /tmp/simcraft/skills/coding/codebase-map .claude/skills/codebase-map
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Codebase Map en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición es relevante, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Codebase Map automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Codebase Map no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición relevante, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Codebase map

Reading files top to bottom is the slow way in. Senior engineers ask four questions instead, in this order: what does it do, how is it run, where does the important work happen, and what path does one real request take. The first three come from cheap signals (manifests, CI, git history, imports). The fourth only comes from running the code. Everything ends up in one file, MAP.md, that a new person can read in ten minutes.

Work read-only on the repo. Put every output in a temp folder (out=$(mktemp -d)) unless the user asks for MAP.md in the repo. Never run migrations, deploys or anything that touches a shared database or real credentials.

Scripts are in scripts/, Python 3.9+ standard library and git only. S=~/simcraft/skills/coding/codebase-map/scripts.

0. Ask one thing

"Is there a specific thing you need to do here (fix a bug, own an area, review a change), or a general map?" A goal decides which path to trace. If there is no answer, map the whole repo and trace its most important user action.

1. Orient (15 minutes)

python3 $S/entrypoints.py <repo> > $out/entry.md

It lists docs to read first, build and run commands (package.json scripts, console scripts, Makefile, Procfile, Dockerfile CMD, compose services), CI pipelines and the commands they run, mains, servers, CLI commands, HTTP routes, background jobs, the data model, environment variables (with a flag when the .env template is missing one), and tests. Every hit is file:line.

Then read, in this order: README and contributor docs, the CI file (it is the only build recipe that is known to work), the main manifest, the entrypoint files. Write the one-paragraph purpose now, before reading more code: who uses it, what goes in, what comes out, what it talks to.

2. The data model is the backbone

Read the schema before the logic. Migrations (oldest shows the original core, newest shows where the product is going), ORM models, Prisma or SQL files, or, if there is no database, the main data shapes (pydantic models, TS types, JSON files on disk). Write down the 3 to 7 core entities and how they relate. Most business logic is "load these, change them, save them", so knowing the nouns makes the code readable.

3. Structure from imports

python3 $S/deps.py <repo> --json $out/deps.json --mermaid $out/deps.mmd --svg $out/deps.svg > $out/deps.md

Read: the layers (level 0 is the foundation, top is entry code), folder cycles (tangled modules, with the cheapest edge to cut), load-bearing files (most importers: change carefully), possibly dead files (no importers), and the main external packages. If one folder holds most of the code, run again with --under <that folder> to see inside it.

4. History: where the work and the risk are

python3 $S/hotspots.py <repo> --deps $out/deps.json > $out/hot.md
  • Hotspots (changes x complexity): the few files where most bugs and most of your future work will be.
  • Change coupling: files that change in the same commits. A pair with import link = NO is a hidden dependency, for example two copies of the same logic, or a client and server that share a format. These are the best gotchas.
  • Ownership and knowledge at risk: who to ask about each area, and complex files whose main author has gone quiet.
  • Bug magnets, frozen code and new code.

Add --anonymize if the map will be shared outside the team. Under about 30 commits, git signals are weak: say so and lean on steps 3 and 5.

5. Trace one real path by running it

This is the step that turns guesses into knowledge. Pick one real user action (the one the top hotspots serve, or the user's goal). Get it running using the CI steps. Then either:

  • find the sink (the DB write, the HTTP response, the output file), put a stack dump or breakpoint there (breakpoint(), traceback.print_stack(), console.trace(), debug.PrintStack()), trigger the action once, and read the stack bottom-up; or
  • for Python, run it under the tracer: python3 $S/trace_py.py --repo <repo> --out $out/trace.txt -- <script or -m module> <args>. It prints every repo function the run touched, by depth, as file:line.

If the path calls paid or external services, stub them at the edge (patch the HTTP call to return a canned response) instead of using real keys. Record each hop as file:line what happens here, and mark anything surprising.

6. Load-bearing vs dead

Load-bearing = many importers, on the traced path, or a hotspot. Dead candidates = no importers and frozen for a year. Before calling anything dead, grep for its name as a string (plugin registries, getattr, dynamic imports, config files, framework conventions). Say "probably dead, because..." rather than "dead".

7. Write MAP.md

Use the template in reference.md: purpose, how to run it, architecture diagram (Mermaid, drawn from what you learned, not just the raw import graph), the traced path, data model, hotspots, coupling pairs, who knows what, glossary, gotchas, first tasks. Mark each claim ran (you saw it happen) or read (from the code). Then check every reference:

python3 $S/check_map.py $out/MAP.md <repo>

Fix every broken one. Finish with a five-line summary in chat and the path to MAP.md (and the SVG if made).

Rules

  • Never claim a hop you did not see in code or in a run. A wrong map is worse than none.
  • Explain jargon the first time it appears, and put every project-specific term in the glossary.
  • First tasks must be small, real and safe: a test to add for a hotspot, a log line on the traced path, a dead file to confirm.
  • Depth, per-language tracing recipes, heuristics and their limits: reference.md. A real example: examples/MAP.md.

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Se ofrecen como archivos de lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Codebase Map?

Understand an unfamiliar codebase fast, the way senior engineers do. Reads the orientation signals (README, manifests, CI, Dockerfiles, routes, migrations), mines git history for hotspots, hidden coupling and ownership, builds the import graph to find layers, cycles, load-bearing and dead code, then traces one real request or command end to end by actually running it. Writes MAP.md with a one-paragraph purpose, a Mermaid architecture diagram, the traced path as file:line hops, hotspot and coupling tables, a glossary, gotchas and first tasks, plus an optional SVG. Use when the user says "exp...

¿Por qué usar Codebase Map en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Codebase Map está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Codebase Map en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/dotslashsimran/simcraft/tree/main/skills/coding/codebase-map. TypingMind lee su archivo SKILL.md, empaqueta sus archivos y la instala como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Codebase Map?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Codebase Map?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Codebase Map con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Codebase Map?

Sí. dotslashsimran la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇