Aller au contenu
Skillpedia
Programmation générale7.1k · #13491

importing-a-codebase

Ce qu’il fait

Ce skill fait étudier à l'IA un projet qui a du code mais aucune spécification écrite, puis rédiger les documents clés qui décrivent sa conception et ses décisions. Il s'adresse aux équipes qui veulent documenter une application existante.

Quand l’utiliser

  • ✓Quand vous avez un projet existant avec du code mais sans documents d'architecture ni de produit.
  • ✓Quand vous voulez que l'IA rédige des spécifications à partir des fichiers README, des règles d'agent et du code lui-même.
  • ✓Quand vous voulez relire et corriger un brouillon de spécifications de projet avant de leur faire confiance.

Lien du skill

https://github.com/JetBrains/thinkrail/blob/main/packages/pi-thinkrail-workflow/skills/importing-a-codebase/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/JetBrains/thinkrail/blob/main/packages/pi-thinkrail-workflow/skills/importing-a-codebase/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Mon projet contient du code mais aucune documentation : lis-le et rédige les premières spécifications pour que je les relise.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'IA lit les notes du projet, ses fichiers de configuration et son code principal, rédige des documents marqués comme brouillons, et ne vous pose de questions que sur les intentions qu'elle ne peut pas trouver dans les fichiers.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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):

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.

Two kinds of question belong in the round whenever the files leave them open — the code shows what, rarely why:

  • The why behind each non-obvious decision in your working model that the files don't explain — "I see X is done this way — why?" — with your inferred reasons as options. The answer goes into the spec that owns the decision.
  • Known limitations — one multiSelect of the gaps you saw (unhandled cases, TODOs, missing tests, slow paths) for the user to confirm; confirmed ones are recorded in the owning spec.

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 — the whys and limitations included — 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.

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 c
Questions fréquentes

Les brouillons seront-ils définitifs ?

Non. Ils restent des brouillons jusqu'à votre relecture, et tout ce qui est deviné est marqué comme non confirmé.

Quels fichiers lit-il en premier ?

Les fichiers d'instructions de l'agent, le README, la documentation, les fichiers de paquets et les points d'entrée principaux.

Modifie-t-il mon code ?

Le skill se concentre sur la rédaction des spécifications, donc son résultat principal est de la documentation et non des modifications de code.

Détails

Description originale de l’auteur

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.

repo: JetBrains/thinkrail

Popularité

Étoiles GitHub
7.1k
Position au classement
#13491
Licence
Apache-2.0
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires