spec-graph
What it does
This skill has the AI look up the project's specification documents before it changes behavior, boundaries or design choices. It keeps those documents accurate when the code changes. It is for teams that rely on written specs as the source of truth.
When to use it
- βWhen a change could affect a documented boundary, contract or architecture decision.
- βWhen you want the AI to explain how something is designed according to the project's specs.
- βWhen a change contradicts a recorded decision and the spec needs updating.
Skill link
https://github.com/JetBrains/thinkrail/blob/main/packages/spec-graph/skills/spec-graph/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βBefore we change how payments work, check the project specs and tell me which decisions this affects.β
5 new skills a week. 1 minute to read.
How it works
The AI searches and reads the linked spec documents, aligns the work with them, and updates the specs in the same change if the design shifts.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Spec graph
Specs are the ground truth
- Specs describe the architecture, decisions, contracts, and boundaries behind the code β the intent that the code alone does not reveal. Treat them as authoritative.
- Consult the owning spec when it governs the work. When work depends on, checks, explains, or
may alter a documented boundary, contract, invariant, behavior, or architecture decision, use
spec_grep/spec_get/spec_graphto find the applicable record and align with it. If a change contradicts a recorded decision, surface and reconcile the contradiction rather than silently diverging. - Keep lookup proportional. Specs are the map for decisions and boundaries; code confirms the implementation. A localized fix, explanation, or check that changes no documented decision may inspect only the files it needs without reading unrelated specs.
- Keep them honest. A change that moves or blurs a boundary, or overturns a decision, updates the spec as part of the same change. Specs that drift from the code stop being ground truth.
What a spec is
- A durable, declarative document. It states the world as it is β the intent, decisions, contracts, and boundaries behind the code β not plans, tasks, phases, or a work journey.
- Concise and readable. It captures what is not obvious from the code; it never restates the code.
- The bar: reading the relevant specs should be enough to understand an area and to formulate a task to improve it.
Keep specs lean
- Explain intent, not inventory. Describe what a module is for, what it owns, and where its boundaries are β not a file-by-file transcript of its directory. The reader can see the files; the spec exists for what the files don't say.
- Record the edges that matter. State the module's boundary (allowed / forbidden deps) and the
dependency edges between its sub-modules. List a part only when its role or its edges aren't obvious from
its name β e.g. a small table that carries a real dependency DAG earns its place; a table that just
pairs
foo.tswith "the foo tool" is noise, so say it in a sentence instead. - Say each thing once. A fact lives in exactly one spec; others link to it by
idrather than restate it. If a paragraph is being copied between specs, move it to the spec that owns the concept and point at it. Duplicated prose drifts and turns into contradictions. - Prefer prose to exhaustive tables, and cut anything that only paraphrases code, filenames, or a sibling spec.
The graph
parentlinks form a hierarchy that mirrors the code structure: aSPEC.mdsits beside the module it describes (fractal β a package and its sub-directories each have one), and root documents sit at the repository root.depends-on,references, andimplementsform a dependency layer across the tree.
Frontmatter
- Required:
id(a unique slug),type,title. - Optional:
status(lifecycle),parent(single link),depends-on/references/implements(link lists),covers,tags. - A file is a spec when its frontmatter carries
idandtype. statustracks a spec's lifecycle:draft(being written) βactive(in force), thenstale(drifting from the code),done, ordeprecated. It's optional, but keep it current as a spec firms up or ages.- Types:
goal-and-requirementsβ the product goal and scope; the root of the graph.architecture-designβ system-wide topology, cross-cutting decisions, and invariants.module-designβ a package or module's responsibility and boundary.submodule-designβ the same, for a directory-level module inside a package.task-specβ a temporary working document for a piece of work; not durable, and removed once the work lands.
Tools
Read:
spec_grepβ search within specs (content, narrowed by metadata filters).spec_getβ a spec's frontmatter, its resolved links, and its path. Read the body with the normalreadtool using that path.spec_graphβ a bounded slice of the graph: a subtree, ancestors, or a node's neighbors, to a depth.
Manage:
spec_createβ a new spec with scaffolded frontmatter and headings.spec_updateβ a spec's frontmatter (fields and links). It does not touch the body.spec_deleteβ remove a spec.spec_validateβ report dangling links, duplicate ids, and parent cycles.
Prose is written and edited with the normal write/edit tools; the spec tools own f
FAQ
Does it read every spec for small fixes?
No. Small fixes that change no documented decision only need the files they touch.
What if the code and a spec disagree?
The AI points out the contradiction so you can decide which one should change.
Is a spec the same as the code?
No. Specs describe intent and decisions, while the code shows how things are implemented.
Details
Original description by the author
Use 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 architecture decision.
repo: JetBrains/thinkrail
Popularity
- GitHub stars
- 7.1k
- Ranking position
- #13498
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
asking-user-questions
7.1kTeaches your agent how to ask you clear questions in rounds, with good answer options, until the open points are settled.
brainstorming
7.1kHelps your agent talk through a feature, behavior change or bug fix with you before building it, and record the agreed design.
choosing-a-workflow
7.1kHelps your agent pick the right ThinkRail workflow for a new project, a pull request, or any change to what the product does.
importing-a-codebase
7.1kTeaches your agent to read an existing codebase and draft its first set of project specs, asking you only where the code is unclear.
Similar skills
technical-documentation
394kHelps your agent write and review clear technical docs and agent instruction files, so people and AI tools can follow them easily.
architecture-decision-records
280kHas your agent record important project structure decisions. It helps to understand the reasoning behind choices and maintain a clear history of changes.
code-tour
280kLets your agent create step-by-step code walkthroughs with exact file and line references. Useful for intros, explanations, and reviews.