Logo Spec Driven Development

Spec Driven Development

Cộng đồng
pimenov
spec-driven-development

Defines the implementation contract before planning or coding so work is built against explicit goals, users, scope, non-goals, assumptions, acceptance criteria, and verification. Use when creating or changing a feature, product workflow, API, integration, migration, user-facing behavior, cross-team handoff, or any task where Codex could implement the wrong thing correctly; when the user asks for a spec, requirements, PRD, contract, acceptance criteria, or "what exactly are we building".

Tổng quan

Nhà phát hànhpimenov
Kho mãcodex-first-skills-pack
Tên kỹ năngspec-driven-development
Sao
28
Bản fork
5
Tệp đi kèm
Chỉ có hướng dẫn
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được pimenov công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Spec Driven Development trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/pimenov/codex-first-skills-pack/tree/main/skills/spec-driven-development
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pimenov/codex-first-skills-pack.git /tmp/codex-first-skills-pack
mkdir -p .claude/skills
cp -r /tmp/codex-first-skills-pack/skills/spec-driven-development .claude/skills/spec-driven-development
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Spec Driven Development trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Spec Driven Development ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Spec Driven Development không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Spec-Driven Development

Overview

Use this skill before planning or implementation when the contract is not already explicit. The output should make it clear what is being built, why, for whom, what counts as done, and what is intentionally out of scope.

Spec-driven development is a guard against technically clean work that solves the wrong problem.

Relationship To Other Skills

  • Use context-engineering first when the source of truth or current project state is unclear.
  • Use planning-and-task-breakdown after the spec is accepted or the contract is clear.
  • Use incremental-implementation after planning to execute the work in verified slices.
  • Use test-driven-development to turn acceptance criteria into failing checks.
  • Use source-driven-development when spec choices depend on current external API, SDK, framework, or platform behavior.
  • Use doubt-driven-review before high-stakes specs involving production, auth, data, billing, security, or irreversible operations.

Do Not Use

  • Tiny implementation tasks with clear requirements and low risk.
  • Pure bug reproduction where expected behavior is already obvious; use debugging-and-error-recovery and test-driven-development.
  • Emergency incident stabilization before safe state is restored.
  • Pure writing/copy tasks unless the acceptance criteria are unclear.
  • Creating a durable spec artifact when a short chat contract is enough.

Core Loop

text
INTENT -> CONTRACT -> BOUNDARIES -> ACCEPTANCE -> STORAGE -> HANDOFF

1. INTENT: Name The Problem And Audience

Before writing tasks or code, answer:

  • who is this for;
  • what problem or job-to-be-done it addresses;
  • what current pain or failure it removes;
  • what will be different when it works;
  • which source artifacts support this intent.

If the user intent is ambiguous, ask the smallest clarifying question or run read-only discovery. Do not fill product gaps with implementation guesses.

2. CONTRACT: Define The Desired Behavior

Write the behavior contract in concrete terms:

  • primary scenarios;
  • inputs and outputs;
  • user/system actions;
  • states and transitions;
  • data or API contracts;
  • permissions and roles;
  • error and empty states;
  • performance or reliability requirements when relevant;
  • compatibility and migration expectations.

Prefer observable behavior over internal implementation details.

3. BOUNDARIES: State Scope And Non-Goals

A good spec says what not to do.

Include:

  • in scope;
  • explicitly out of scope;
  • assumptions;
  • dependencies;
  • constraints;
  • stop-lines;
  • approval gates;
  • risks and open questions.

If a hidden product decision appears, stop and mark it as an open question. Do not bury it inside implementation.

4. ACCEPTANCE: Make Done Testable

Acceptance criteria should be observable and verifiable.

Use this shape:

text
Acceptance criteria:
- Given <state>, when <action>, then <observable result>.
- <System/API/data behavior> is true and verified by <test/check/smoke>.
- <Non-goal or excluded behavior> remains unchanged.

Map acceptance to proof:

  • unit/integration/component test;
  • typecheck/build/lint;
  • browser/manual smoke;
  • read-only live check;
  • screenshots or artifacts;
  • human approval when automation cannot verify the outcome.

If acceptance cannot be tested, the spec is not ready for implementation.

5. STORAGE: Choose The Right Artifact

Do not default to SPEC.md.

Choose the smallest durable layer that will actually be used:

SituationArtifact
Small clear changeChat contract or issue comment
New product/user workflowMini-PRD
Implementation-ready project workWork Packet
Execution across chats/peopleLinear document or issue
Human/client-facing explanationNotion
Technical contract owned by codeRepo docs / ADR / spec file
Local sandbox or reusable processLocal RUNBOOK.md / SESSION_NOTES.md

For user-facing durable prose, match the user's language. Keep commands, paths, package names, API identifiers, env vars, issue keys, and canonical product names exact.

6. HANDOFF: Prepare For Planning Or Implementation

A spec is ready to hand off when:

  • intent is clear;
  • scenarios are concrete;
  • non-goals are explicit;
  • acceptance criteria are testable;
  • source of truth is named;
  • risks and approval gates are visible;
  • unresolved questions are separated from ready work.

Then route:

  • ready implementation -> planning-and-task-breakdown;
  • behavior tests -> test-driven-development;
  • thin execution -> incremental-implementation;
  • risky decision -> doubt-driven-review;
  • unclear product intent -> keep in discovery or mini-PRD refinement.

Mini-PRD Shape

Use when the work is product-new, UX/operationally new, or could be technically right but product-wrong.

text
Mini-PRD:
- Audience:
- Problem:
- Current state:
- Target state:
- Key scenarios:
- Success criteria:
- Non-goals:
- Risks/dependencies:
- Open questions:
- Next safe step:

Mini-PRD answers "what and why", not full implementation detail.

Technical Spec Shape

Use when behavior and product intent are clear, but the implementation contract needs precision.

text
Technical spec:
- Goal:
- Existing behavior:
- Desired behavior:
- Contract/API/schema/state changes:
- Edge cases:
- Compatibility/migration:
- Security/data considerations:
- Acceptance criteria:
- Verification plan:
- Rollback/stop-lines:

Technical specs should be close to code when they define durable code-owned contracts.

Work Packet Bridge

After the spec is accepted, a Work Packet can answer "how to execute the next chunk safely".

Do not mix the two:

  • Spec: what, why, for whom, success, non-goals.
  • Work Packet: scope, tasks, approach, checks, approval gates, Definition of Done.

If both are needed, keep the spec concise and let planning-and-task-breakdown create the execution plan.

Production And External Systems

Specs touching production, live data, auth, billing, DNS, routing, webhooks, migrations, external SaaS, VPS, Cloudflare, Linear, Notion, GitHub, Gmail, Calendar, Drive, or similar systems must include:

  • read-only discovery first, unless exact mutation approval already exists;
  • explicit no-touch systems;
  • data classification and secret-handling assumptions;
  • backup/evidence/rollback expectation;
  • dry-run or staging path where available;
  • live approval gate before mutation.

Do not let a spec imply permission to mutate production.

Output Shape

For compact specs:

text
Spec:
- Goal:
- Audience:
- Scenarios:
- Scope:
- Non-goals:
- Acceptance:
- Verification:
- Open questions:
- Next safe step:

For specs that should become durable artifacts, use Russian headings by default and state where the artifact belongs.

If the spec is not ready, do not pretend it is:

text
Spec readiness:
- Ready:
- Not ready:
- Blocking questions:
- Safe next step:

Common Rationalizations

RationalizationReality
"The feature is obvious."Obvious features still hide audience, edge cases, and non-goals.
"We can clarify while coding."Coding turns unclear requirements into accidental architecture.
"A task list is enough."A task list without a contract can execute the wrong intent efficiently.
"We'll write acceptance later."Acceptance after implementation often blesses what was built, not what was needed.
"It is internal, so no spec needed."Internal operational work can still touch real systems and needs boundaries.

Red Flags

  • No named audience or operator.
  • No non-goals.
  • Acceptance criteria are subjective or untestable.
  • Product decisions are hidden in technical tasks.
  • API/schema/state changes are vague.
  • Production/data/auth behavior is implied but not approved.
  • Spec duplicates Linear, Notion, and repo docs without purpose.
  • The next step is implementation while open questions still block correctness.

Verification

Before handing off a spec, confirm:

  • Intent and audience are explicit.
  • Desired behavior is observable.
  • Scope and non-goals are clear.
  • Assumptions, dependencies, risks, and approval gates are named.
  • Acceptance criteria are testable.
  • Verification plan matches the risk.
  • Artifact location is correct, or chat-only contract is enough.
  • Ready work is separated from open questions.

Câu hỏi thường gặp

Kỹ năng AI Spec Driven Development làm được gì?

Defines the implementation contract before planning or coding so work is built against explicit goals, users, scope, non-goals, assumptions, acceptance criteria, and verification. Use when creating or changing a feature, product workflow, API, integration, migration, user-facing behavior, cross-team handoff, or any task where Codex could implement the wrong thing correctly; when the user asks for a spec, requirements, PRD, contract, acceptance criteria, or "what exactly are we building".

Vì sao nên dùng Spec Driven Development trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Spec Driven Development là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Spec Driven Development trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/pimenov/codex-first-skills-pack/tree/main/skills/spec-driven-development. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Spec Driven Development?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Spec Driven Development với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Spec Driven Development với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Spec Driven Development có miễn phí không?

Kỹ năng này được pimenov phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇