importing-a-codebase

A workflow for understanding an existing codebase that has real source files but no written specifications. It reconstructs the project’s intended behaviour and documentation from the files already present.

In plain words
What is it for?
Use it to inspect agent instructions, documentation, manifests, project structure, entry points, and modules, then draft specifications while marking uncertain conclusions for review.
Why use it?
It helps turn undocumented code into a clearer working specification before new development begins.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jetbrains/thinkrail/importing-a-codebase
Any agent
npx skills add JetBrains/thinkrail --skill importing-a-codebase
Clone the repo
git clone --depth 1 https://github.com/JetBrains/thinkrail

Made for: Claude Code, Codex.

Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,509 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00069 $0.01509
Opus 5 $0.00034 $0.00754
Sonnet 5 $0.00014 $0.00302
Haiku 4.5 $0.00007 $0.00151

Measured 2d ago against content hash b28cc6d74fea, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

importing-a-codebase scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/pi-thinkrail-workflow/skills/importing-a-codebase/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Importing a codebase

The workspace holds real code but no specs. Reverse-engineer the spec graph the project should have had. When the repo already carries real spec-like documents, build the graph around them, not parallel to them. Do as much as possible yourself, from the files; ask the user only where the code genuinely can't tell you and the answer changes a spec.

Hold the writing-specs bar. Read that concept skill before drafting — everything in this flow is inferred rather than confirmed, so its honesty rules (draft until the user reviews, unconfirmed marked inline) bind hardest here.

1. Read first, ask last

Survey before you ask a single question. Read, in roughly this order:

  • Agent files (mine these first — they state intent + conventions directly): AGENTS.md, CLAUDE.md, .cursor/rules/*, .cursorrules, .github/copilot-instructions.md, GEMINI.md, .windsurfrules.
  • Docs: README, docs/, CONTRIBUTING, ADRs.
  • Manifests & layout: package.json / pyproject.toml / go.mod / Cargo.toml, workspace globs, tree-style structure, entry points, build/test scripts.
  • Code: entry points and the top of each candidate module — enough to see responsibilities and the dependency edges between them.

While you read, collect adoption candidates: durable, declarative documents that state the world as it is — architecture/design docs, ADRs / decision records, domain glossaries, protocol/contract docs. Never candidates (input only): READMEs, CONTRIBUTING, changelogs, roadmaps, TODOs, implementation plans (finished or planned), generated API docs.

Confirm with the spec tools (spec_grep / spec_graph) that there's no graph yet. If specs already exist, stop and hand back to the setting-up-a-project dispatcher — this flow is for un-specced repos.

2. Build a working model

From what you read, form a working model of what the project is and how it's shaped — held in the conversation, not written to a file (this flow declares no working files):

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 104 lines · 69 tokens per session scan A b28cc6d74fea

Subscribe to this mod's changes

importing-a-codebase is a skill published in the GitHub repository JetBrains/thinkrail (340 stars, last pushed 2d ago), licensed Apache-2.0. It adds 69 tokens to every session and 1,509 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

skillpack-creator

Create a reusable SkillPack from a successful completed task. Use when the user wants to convert a one-off research, coding, analysis, or content workflow into a distributable local SkillPack with skillpack.json, local skills under skills/, starter prompts, start scripts, and an optional zip package.

CreminiAI/skillpack · 67 tokens

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

CreminiAI/skillpack · 64 tokens

python-run

Run and debug Python scripts in the project. Use when the user says "run python", "execute this script", "debug this py file", or wants to run/modify a .py file. Handles dependency checks, linting, execution, and error analysis.

congchuanling-dot/Cohort · 56 tokens

grix-code-review

Audit Grix diffs and pull requests for correctness, regressions, security, lifecycle safety, and cross-component contract consistency. Use when reviewing backend, Flutter frontend or admin, voicebridge, database migration, Kubernetes, protocol, agent-adapter, bug-fix, feature, or refactor changes in the Grix…

askie/grix · 70 tokens

workflow-helper

Guidance for creating, managing and executing workflow automations that chain multiple tools and agents together. Use when the user asks about building, listing, running or composing workflows and automated task pipelines.

vixues/LeAgent · 41 tokens

attendance-signin-sheet

Generate printable attendance / 签到表 spreadsheets from name lists. Use when the user asks for 签到表, attendance sheet, meeting sign-in table, or similar printable roster tables (not full payroll attendance scoring unless asked).

vixues/LeAgent · 51 tokens