spec-graph
できること
このスキルは、振る舞い、境界、設計の選択を変える前に、AIがプロジェクトのスペック文書を調べるようにします。コードが変わったとき、それらの文書を正確に保ちます。書かれたスペックを正とするチーム向けです。
使う場面
- ✓変更が、文書化された境界、契約、アーキテクチャの決定に影響するかもしれないとき。
- ✓プロジェクトのスペックに沿って、何かがどう設計されているかを説明してほしいとき。
- ✓変更が記録された決定と矛盾し、スペックを更新する必要があるとき。
スキルのリンク
https://github.com/JetBrains/thinkrail/blob/main/packages/spec-graph/skills/spec-graph/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“支払いの仕組みを変える前に、プロジェクトのスペックを確認して、この変更が影響する決定を教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは、リンクされたスペック文書を検索して読み、作業を文書と合わせ、設計が変わる場合は同じ変更の中でスペックも更新します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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
よくある質問
小さな修正でもすべてのスペックを読みますか?
いいえ。文書化された決定を変えない小さな修正では、触れるファイルだけが必要です。
コードとスペックが食い違ったらどうしますか?
AIは矛盾を指摘し、どちらを直すべきかあなたが決められるようにします。
スペックはコードと同じですか?
いいえ。スペックは意図と決定事項を説明し、コードは物事がどう実装されているかを示します。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 7.1k
- ランキング
- #13498
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
asking-user-questions
7.1kエージェントが、明確な質問を、良い回答の選択肢とともに何回かに分けて行い、未解決の点が決まるまで続けるやり方を教えます。
brainstorming
7.1kエージェントが、機能、振る舞いの変更、またはバグ修正について、作る前にあなたと話し合い、合意した設計を記録できるよう支援します。
choosing-a-workflow
7.1kエージェントが、新しいプロジェクト、プルリクエスト、製品の振る舞いの変更のために、適切なThinkRainのワークフローを選べるよう支援します。
importing-a-codebase
7.1kエージェントが、既存のコードベースを読み、最初のプロジェクトのスペック案を作り、コードが不明確な点だけを尋ねられるよう支援します。
似ているスキル
technical-documentation
394k明確な技術ドキュメントやエージェントの指示ファイルを書いて確認し、人やAIツールが簡単に従えるようエージェントを支援します。
architecture-decision-records
280kエージェントがプロジェクト構成に関する重要な決定を記録できるようにします。選択の理由を把握しやすくし、変更履歴を明確に残すのに役立ちます。
code-tour
280kエージェントが正確なファイル名と行番号を示しながら、コードを段階的に解説できるようにします。紹介、説明、レビューに役立ちます。