Official agent skill

Importing A Codebase

by JetBrains in JetBrains/thinkrail

A skill your agent uses when asked to create the initial spec graph for an existing codebase that has source code but no specs.

OfficialApache-2.0Auto-check passedDevelopment

Install Importing A Codebase

skills CLI
$ npx skills add JetBrains/thinkrail --skill importing-a-codebase -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install JetBrains/thinkrail importing-a-codebase --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/JetBrains/thinkrail.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/pi-thinkrail-workflow/skills/importing-a-codebase .claude/skills/importing-a-codebase && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
importing-a-codebase
GitHub stars
513
Token cost
~1.6k tokens
SKILL.md length
843 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when asked to create the initial spec graph for an existing codebase that has source code but no specs.

  • Works in 5 steps: Read first, ask last → Build a working model → Interview only the gaps → …
  • Asked to create the initial spec graph for an existing codebase that has source code but no specs
  • SKILL.md covers 1. Read first, ask last, 2. Build a working model, 3. Interview only the gaps and 4. Draft the graph, top-down, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Importing A Codebase is an agent skill from JetBrains/thinkrail, published by the product's own GitHub organization. Use when asked to create the initial spec graph for an existing codebase that has source code but no specs. Normally reached via setting-up-a-project.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. The repository describes itself as: Vibe code with pi in a lightweight, real IDE that customises itself around the way you work — The Vibe You Need. The licence is Apache-2.0.

When your agent uses it

  • Asked to create the initial spec graph for an existing codebase that has source code but no specs

Example prompts

  • “/importing-a-codebase”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Read first, ask last
  2. Build a working model
  3. Interview only the gaps
  4. Draft the graph, top-down
  5. Validate & hand off

What it can do on your machine

Read from SKILL.md and the folder at commit 3f7e0d4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Importing A Codebase loads about 1.6k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 843 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from JetBrains/thinkrail at commit 3f7e0d4, republished under its Apache-2.0 licence (© JetBrains). 843 words, ~1,611 tokens.

Download SKILL.mdSave it as .claude/skills/importing-a-codebase/SKILL.md (or your agent's skills folder).
name
importing-a-codebase
description
Use when asked to create the initial spec graph for an existing codebase that has source code but no specs. Normally reached via setting-up-a-project.

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):

what:       one-sentence purpose (the job the codebase does)
domain:     the space it's in
stack:      languages / frameworks / runtime
modules:    the real boundaries + the dependency edges between them (who imports whom)
invariants: rules the code already enforces (layering, "X never imports Y", public surfaces)
decisions:  non-obvious choices visible in the code (and where the "why" is missing)

Agent files and READMEs usually hand you what, invariants, and decisions for free — prefer them over re-deriving from code.

3. Interview only the gaps

Ask only what the files can't answer and that would change a spec — typically: the primary job / who it's for, explicit non-goals, and the why behind a non-obvious decision. Interview them in rounds per the asking-user-questions concept skill; infer a concrete answer and let the user correct it rather than asking open-ended.

If adoption candidates exist, add one question to the same round: a multiSelect listing them (grouped when many — an adr/ set is one option) — which should become spec-graph nodes? A contradiction between a candidate and the code found by now goes into the round too (confirm the correction). Skipped or declined → adopt none; candidates stay input, noted at hand-off.

If the files answered everything material, skip the interview and say so — don't manufacture questions (adoption candidates alone still make a round — the offer is never dropped as "no gaps"). A skipped/declined question is not a blocker: record the assumption inline in the spec, marked unconfirmed.

Show full SKILL.md (383 more words)Show less

4. Draft the graph, top-down

Save with the spec tools as you go (spec_create per node, edit for prose). Order:

  1. goal-and-requirements.md (type: goal-and-requirements) — what the product is and why, in the goal-doc shape writing-specs sets; capabilities are what the code already does. This is the graph root; the confirmed intent lives here.
  2. architecture.md (type: architecture-design, parent: <goal id>) — topology, the module boundaries, the real dependency edges (a small DAG only if it carries real information), and the invariants the code enforces.
  3. One short SPEC.md per genuine module (type: module-design, or submodule-design for a directory-level module inside a package; parent: its enclosing module or architecture). Each states its responsibility and its boundary (allowed deps / forbidden reaches).

Adopted docs become nodes in place. First, for each accepted candidate: read it carefully, then add spec frontmatter where the file lies (id, type, title, status: draft, parent; depends-on/references only where real) — content untouched. A slot an adopted doc fills is not drafted again: an adopted architecture doc is the architecture-design node, an adopted module design doc is that module's node, an ADR earns a node only while its decision is still in force. Build the rest of the graph around them, linked by id. One exception to "content untouched": where an adopted doc is unclear or has drifted from the code, correct that content as part of adoption and call the correction out (in the interview round when caught in time, at hand-off otherwise).

Wire parent to mirror the code hierarchy and depends-on only on edges the code actually shows. Keep each file you draft to the writing-specs bar — its granularity and say-it-once rules decide what counts as a module and where shared edges live. If a boundary is genuinely unclear, ask, or leave that spec draft with a one-line note — don't guess elaborately.

5. Validate & hand off

  • Run spec_validate; fix dangling links, duplicate ids, parent cycles.
  • Tell the user the specs are drafted on this workspace's branch — review them in Changes; nothing merges until they approve — and summarize what you inferred vs. what they confirmed, which docs were adopted vs. left as input, and any drift corrections made.
  • Point at brainstorming only for later work that requires choosing product scope, user-visible behavior, or architecture; fully specified work proceeds directly. This workflow ends here.

© JetBrains, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in packages/pi-thinkrail-workflow/skills/importing-a-codebase of JetBrains/thinkrail.

Open the folder on GitHubat commit 3f7e0d4

Compare with similar skills

Importing A Codebase next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Importing A Codebase compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Importing A Codebase this skillJetBrains/thinkrail513—~1.6kAutomated safety check: PassApache-2.0
Trellis Session Insightmindfold-ai/Trellis15k4 repos~1.7kAutomated safety check: PassAGPL-3.0
Openspec Verify ChangeFission-AI/OpenSpec71k2 repos~4.6kAutomated safety check: PassMIT
Warp Factory Fileswarpdotdev/warp65k1 repos~2.5kAutomated safety check: PassAGPL-3.0
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Analyze Logsactivepieces/activepieces25k1 repos~1.6kAutomated safety check: PassMIT

Similar skills

  • Trellis Session Insight

    mindfold-ai/Trellis

    Reach into past AI conversation history through the trellis mem CLI.

    15k GitHub starsUsed in 4 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Openspec Verify Change

    Fission-AI/OpenSpec

    Verify implementation matches OpenSpec change artifacts. An agent skill from Fission-AI/OpenSpec.

    71k GitHub starsUsed in 2 repos~4.6k tokens
    DevelopmentAuto-check passed
  • Warp Factory Files

    warpdotdev/warp

    Authors and edits file-based Warp software factory definitions rooted at factory.yaml, covering agents, automations, scorers and webhooks, and validates them before a pull request.

    65k GitHub starsUsed in 1 repo~2.5k tokens
    DevelopmentAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Analyze Logs

    activepieces/activepieces

    Analyze application logs from the .evlog/logs/ directory. An agent skill from activepieces/activepieces.

    25k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Official

    Runs a loop on a GitHub pull request: fetch review state, triage comments into actions, implement them and resolve threads, repeating until nothing actionable is left.

    48k GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed

More from JetBrains/thinkrail

All 11 skills in this repo
  • Starting A New Project

    JetBrains/thinkrail

    Official

    A skill your agent uses when the workspace is empty, has no code, and the user brings a raw project idea.

    513 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Asking User Questions

    JetBrains/thinkrail

    Official

    A skill your agent uses when composing an askuserquestion round inside a workflow, or when a workflow skill names it at a question step.

    513 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Setting Up A Project

    JetBrains/thinkrail

    Official

    A skill your agent uses when asked to set up, onboard, initialize, or spec a project with no spec graph, or when invoked by the app's Set-up-project card.

    513 GitHub stars~500 tokensUpdated today
    Auto-check passed
  • Shipping A PR

    JetBrains/thinkrail

    Official

    A skill your agent uses when finished work needs to ship as a pull request, or when creating, syncing, updating metadata, checking status, monitoring CI, or addressing review comments on a PR.

    513 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Spec Graph

    JetBrains/thinkrail

    Official

    A skill your agent uses when locating, reading, creating, updating, or validating project specs, or when work is governed by or may alter a documented boundary, contract, invariant, behavior, or…

    513 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Todos

    JetBrains/thinkrail

    Official

    A skill your agent uses when the user asks for a shared plan, a task needs at least three substantive execution steps, or a loose TODO is pending.

    513 GitHub stars~3.2k tokensUpdated today
    Auto-check passed

Questions about Importing A Codebase

What does Importing A Codebase do?

A skill your agent uses when asked to create the initial spec graph for an existing codebase that has source code but no specs. Importing A Codebase is an agent skill from JetBrains/thinkrail, published by the product's own GitHub organization. Use when asked to create the initial spec graph for an existing codebase that has source code but no specs.

When should I use Importing A Codebase?

Importing A Codebase fits situations like: asked to create the initial spec graph for an existing codebase that has source code but no specs.

How do I install Importing A Codebase in Claude Code?

Run `npx skills add JetBrains/thinkrail --skill importing-a-codebase -a claude-code`. Or copy the skill folder (packages/pi-thinkrail-workflow/skills/importing-a-codebase in JetBrains/thinkrail) into .claude/skills/importing-a-codebase in your project. Claude Code loads it when a task matches its description.

How do I install Importing A Codebase in Codex?

Run `npx skills add JetBrains/thinkrail --skill importing-a-codebase -a codex`. Or copy the skill folder (packages/pi-thinkrail-workflow/skills/importing-a-codebase in JetBrains/thinkrail) into .agents/skills/importing-a-codebase in your project. Codex loads it when a task matches its description.

Can I use Importing A Codebase in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JetBrains/thinkrail --skill importing-a-codebase -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/importing-a-codebase, .gemini/skills/importing-a-codebase, .github/skills/importing-a-codebase and .opencode/skills/importing-a-codebase in your project.

What does Importing A Codebase need to run?

SKILL.md names no scripts, command-line tools or credentials: Importing A Codebase is instructions for the agent only.

Does Importing A Codebase access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Importing A Codebase safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Importing A Codebase use?

Importing A Codebase is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Importing A Codebase use?

About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Importing A Codebase?

Skills that share tags, products or a category with Importing A Codebase: Trellis Session Insight (mindfold-ai/Trellis, 15k stars), Openspec Verify Change (Fission-AI/OpenSpec, 71k stars), Warp Factory Files (warpdotdev/warp, 65k stars) and Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Importing A Codebase?

JetBrains (a GitHub organization, an official publisher) maintains it in JetBrains/thinkrail, which has 513 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 7, 2026.

Source: JetBrains/thinkrail on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.