Skip to content

Importing a Codebase

Reverse-engineers a spec graph for an existing repo that has code but no specs

Stars
7,089
Licence
Apache-2.0
Files
1 file

What it does

When pointed at a codebase that has source code but no specification documents, the agent reads the project's agent files, docs, manifests and code, then drafts a set of linked spec documents (a goal document, an architecture document, and one short spec per module) describing what the project should have had. It asks the user only the questions the code cannot answer, such as the why behind non-obvious decisions, and marks anything it inferred but the user has not confirmed. Existing design docs and decision records can be adopted into the graph in place.

Great for

  • Teams with an existing codebase that want to start a spec-driven workflow without writing every spec from scratch
  • Developers onboarding onto an un-documented repo who want a structured map of modules and their dependencies
  • Users of the ThinkRail workflow who need to bring an existing project under its spec tooling

Skip it if

  • Repositories that already have specs: the skill tells the agent to stop and hand back to the setup dispatcher, so it adds nothing there
  • Projects where inferred specs would be trusted without review: everything is drafted from inference and needs human checking before approval, and the skill itself says the output is not confirmed
  • Anyone outside the ThinkRail toolchain: the skill refers to spec_grep, spec_graph, spec_create, spec_validate and sibling skills, which are not included in this file, so it will not work as a standalone instruction set

Try asking

  • “Create the initial spec graph for this existing codebase that has no specs yet”
  • “Reverse-engineer the specs this project should have had from its code and docs”
  • “Import our existing architecture doc and ADRs into the spec graph and draft the rest around them”
Step-by-step guide: how to use Importing a CodebaseInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.

    importing-a-codebase.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip importing-a-codebase.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip importing-a-codebase.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Put AGENTS.md, CLAUDE.md or a README with the project's purpose and decisions in the repo first, since the skill reads these before code and they reduce questions
  • Review the drafted specs in the Changes view before approving, because everything inferred is unconfirmed until you check it
  • Answer the interview questions about why decisions were made, since the code shows what the project does but rarely why

What's inside

  • SKILL.md

Redistributed unmodified from JetBrains/thinkrail under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-11-02. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.