Логотип Codebase Map

Codebase Map

Спільнота
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.

Огляд

Видавецьdotslashsimran
Репозиторійsimcraft
Назва навичкиcodebase-map
Зірки
362
Форки
25
Файли в пакеті
8
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 8

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем dotslashsimran. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Codebase Map у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/dotslashsimran/simcraft/tree/main/skills/coding/codebase-map
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

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
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Codebase Map в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Codebase Map, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Codebase Map не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

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.

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ 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...

Навіщо використовувати Codebase Map у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Codebase Map — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Codebase Map у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/dotslashsimran/simcraft/tree/main/skills/coding/codebase-map. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Codebase Map?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Codebase Map?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Codebase Map — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Codebase Map?

Так. Навичку опубліковано на GitHub: dotslashsimran, за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇