spec-graph
Skill này làm gì
Skill này để AI tra cứu các tài liệu đặc tả của dự án trước khi thay đổi hành vi, ranh giới hoặc lựa chọn thiết kế. Nó giữ các tài liệu đó chính xác khi mã thay đổi. Phù hợp với nhóm dựa vào đặc tả viết làm nguồn sự thật.
Khi nào nên dùng
- ✓Khi một thay đổi có thể ảnh hưởng đến một ranh giới, hợp đồng hoặc quyết định kiến trúc đã được ghi tài liệu.
- ✓Khi bạn muốn AI giải thích một thứ được thiết kế thế nào theo đặc tả của dự án.
- ✓Khi một thay đổi mâu thuẫn với một quyết định đã ghi lại và đặc tả cần được cập nhật.
Liên kết skill
https://github.com/JetBrains/thinkrail/blob/main/packages/spec-graph/skills/spec-graph/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Trước khi chúng ta thay đổi cách hoạt động của thanh toán, hãy kiểm tra đặc tả dự án và cho tôi biết những quyết định nào bị ảnh hưởng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI tìm kiếm và đọc các tài liệu đặc tả được liên kết, căn chỉnh công việc theo chúng, và cập nhật đặc tả trong cùng một thay đổi nếu thiết kế thay đổi.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Nó có đọc mọi đặc tả cho các sửa lỗi nhỏ không?
Không. Các sửa lỗi nhỏ không thay đổi quyết định nào đã được ghi lại chỉ cần các tệp chúng chạm đến.
Điều gì xảy ra nếu mã và đặc tả không khớp nhau?
AI chỉ ra mâu thuẫn để bạn quyết định phần nào nên thay đổi.
Đặc tả có giống mã không?
Không. Đặc tả mô tả ý định và quyết định, còn mã cho thấy cách mọi thứ được triển khai.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 7.1k
- Vị trí xếp hạng
- #13498
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
asking-user-questions
7.1kDạy agent của bạn cách hỏi bạn những câu hỏi rõ ràng theo từng vòng, với các lựa chọn trả lời tốt, cho đến khi các điểm còn mở được giải quyết.
brainstorming
7.1kGiúp agent của bạn bàn bạc với bạn về một tính năng, thay đổi hành vi hoặc sửa lỗi trước khi xây dựng, rồi ghi lại thiết kế đã thống nhất.
choosing-a-workflow
7.1kGiúp agent của bạn chọn đúng quy trình ThinkRail cho một dự án mới, một pull request hoặc bất kỳ thay đổi nào về những gì sản phẩm làm.
importing-a-codebase
7.1kDạy agent của bạn đọc một codebase đã có sẵn và soạn bộ đặc tả dự án đầu tiên, chỉ hỏi bạn khi mã nguồn chưa rõ.
Skill tương tự
technical-documentation
394kGiúp agent của bạn viết và rà soát tài liệu kỹ thuật cùng file hướng dẫn cho agent, rõ ràng để mọi người và công cụ AI đều dễ làm theo.
architecture-decision-records
280kGiúp agent của bạn ghi lại các quyết định quan trọng về cấu trúc dự án, giúp hiểu lý do đằng sau các lựa chọn và giữ lịch sử thay đổi rõ ràng.
code-tour
280kGiúp agent của bạn tạo các hướng dẫn đọc code từng bước, có tham chiếu chính xác đến file và dòng, hữu ích cho phần giới thiệu, giải thích và rà soát.