AGENT SKILL

spec-kit

Spec-Driven Development (SDD) advisor using GitHub Spec Kit methodology. Kích hoạt skill này khi user muốn: (1) bắt đầu build feature/project mới với AI coding agent, (2) tạo specification từ requirements, (3) tạo technical plan từ spec, (4) breakdown tasks từ plan, (5) hỏi về SDD workflow, slash commands speckit.*, specify CLI, hoặc bất kỳ câu hỏi nào liên quan đến Spec-Driven Development. Trigger aggressively cho: "tạo spec", "viết spec", "SDD", "spec kit", "spec-driven", "speckit", "feature spec", "tạo feature mới", "plan feature", "breakdown tasks", "specify init", "speckit.specify", "speckit.plan", "speckit.tasks", "speckit.implement".

License 许可
MIT
最近更新
2026-07-21
Stars
★ 0
Forks
0

01 前言 Front Matter

name
spec-kit
description
Spec-Driven Development (SDD) advisor using GitHub Spec Kit methodology. Kích hoạt skill này khi user muốn: (1) bắt đầu build feature/project mới với AI coding agent, (2) tạo specification từ requirements, (3) tạo technical plan từ spec, (4) breakdown tasks từ plan, (5) hỏi về SDD workflow, slash commands speckit.*, specify CLI, hoặc bất kỳ câu hỏi nào liên quan đến Spec-Driven Development. Trigger aggressively cho: "tạo spec", "viết spec", "SDD", "spec kit", "spec-driven", "speckit", "feature spec", "tạo feature mới", "plan feature", "breakdown tasks", "specify init", "speckit.specify", "speckit.plan", "speckit.tasks", "speckit.implement".

03 SKILL.md 正文

Spec Kit — Spec-Driven Development Advisor

Core Philosophy

Spec-Driven Development (SDD) flips traditional workflow:

  • ❌ Truyền thống: Code → (Spec là scaffolding bỏ đi)
  • ✅ SDD: Spec → executable → Code (Spec trở thành source of truth)

3 nguyên tắc:

  1. Intent-driven — Spec định nghĩa what + why, không phải how
  2. Multi-step refinement — Không one-shot generation từ prompt
  3. Heavy AI — AI interpret spec, không phải viết code từ đầu

Workflow Chuẩn (7 Bước)

STEP 1: Constitution  →  project principles & guidelines
STEP 2: Specify       →  functional spec (what + why, NO tech stack)
STEP 3: Clarify       →  refine underspecified areas (BEFORE plan)
STEP 4: Plan          →  technical implementation plan (tech stack ở đây)
STEP 5: Validate      →  cross-check plan, remove over-engineering
STEP 6: Tasks         →  actionable task breakdown với dependencies
STEP 7: Implement     →  execute tasks theo order

Slash Commands Reference

Core Commands (bắt buộc)

Command Mục đích
/speckit.constitution Tạo/update project governing principles
/speckit.specify Mô tả feature cần build (what + why)
/speckit.plan Tech stack + architecture choices
/speckit.tasks Generate actionable task list
/speckit.implement Execute tất cả tasks
/speckit.converge Assess codebase vs spec → append remaining work

Optional Commands (nâng cao)

Command Mục đích
/speckit.clarify Hỏi về underspecified areas (chạy trước /plan)
/speckit.analyze Cross-artifact consistency check (sau tasks, trước implement)
/speckit.checklist Generate quality checklist — "unit tests for English"
/speckit.taskstoissues Convert tasks → GitHub Issues

Setup

Cài đặt

# Requires Python 3.11+ và uv
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git@vX.Y.Z

# Init project
specify init my-project --integration claude  # hoặc copilot, gemini, codex

# Self-upgrade
specify self upgrade
specify self check  # kiểm tra version mới

Supported Integrations

Claude Code, GitHub Copilot, Gemini CLI, Codex CLI, Kiro CLI, và 25+ agents khác.


Directory Structure Sau Khi Setup

project/
├── CLAUDE.md (hoặc AGENTS.md)
├── .specify/
│   ├── memory/
│   │   └── constitution.md          ← Project principles
│   ├── scripts/bash/                ← Automation scripts
│   └── templates/
│       ├── spec-template.md
│       ├── plan-template.md
│       └── tasks-template.md
└── specs/
    └── 001-feature-name/
        ├── spec.md                  ← Output of /speckit.specify
        ├── plan.md                  ← Output of /speckit.plan
        ├── tasks.md                 ← Output of /speckit.tasks
        ├── data-model.md
        ├── research.md
        └── contracts/
            └── api-spec.json

Hướng Dẫn Từng Bước

STEP 1 — Constitution

/speckit.constitution Create principles focused on:
- Code quality standards
- Testing requirements (unit/integration coverage %)
- Performance targets
- Security constraints
- Naming conventions

Output: .specify/memory/constitution.md


STEP 2 — Specify (QUAN TRỌNG)

⚠️ Chỉ mô tả WHAT + WHY. Không đề cập tech stack.

Prompt tốt:

/speckit.specify Build a [feature] that allows [who] to [do what].
Key behaviors: [behavior 1], [behavior 2].
Constraints: [no login required / 5 predefined users / etc].

Prompt xấu ❌:

/speckit.specify Build a REST API with Spring Boot, MySQL, Redis cache...

STEP 3 — Clarify (bắt buộc trước Plan)

/speckit.clarify

→ Agent hỏi structured questions về underspecified areas. → Answers được ghi vào spec.md trong section Clarifications.


STEP 4 — Plan (Tech Stack vào đây)

/speckit.plan Use [tech stack]:
- Backend: Spring Boot 3, PostgreSQL
- Frontend: React + Vite
- Auth: Keycloak

Output: plan.md, data-model.md, research.md, contracts/


STEP 5 — Validate Plan

Prompt gợi ý:

Audit the plan. Check:
1. Anything missing or ambiguous?
2. Any over-engineered components? Remove them.
3. Does it follow constitution.md?
4. Research rapidly-changing libs (spawn parallel tasks if needed).

STEP 6 — Tasks

/speckit.tasks

Output tasks.md chứa:

  • Tasks grouped by user story
  • [P] = parallel-safe tasks
  • Exact file paths
  • Dependencies
  • Checkpoint validations

STEP 7 — Implement

/speckit.implement

Prerequisites được validate tự động (constitution → spec → plan → tasks).


Customization: Extensions vs Presets vs Bundles

Goal Dùng
Thêm command/workflow mới Extension
Customize format spec/plan/tasks Preset
Integrate external tool (Jira, Slack) Extension
Enforce org/regulatory standards Preset
Provision full role-based setup 1 lệnh Bundle
# Extension
specify extension search
specify extension add <name>

# Preset
specify preset search
specify preset add <name>

# Bundle
specify bundle search
specify bundle install <bundle-id>
specify bundle validate --path ./my-bundle
specify bundle build --path ./my-bundle

Development Phases

Phase Khi nào dùng
0-to-1 (Greenfield) Project mới từ đầu
Creative Exploration Explore parallel implementations
Iterative (Brownfield) Add feature vào project hiện tại

Brownfield rule: Giữ Spec Kit tooling updates tách biệt với feature artifact evolution.


Anti-Patterns Cần Tránh

  1. ❌ Skip /speckit.clarify → rework plan downstream
  2. ❌ Đưa tech stack vào /speckit.specify → làm hỏng intent-driven approach
  3. ❌ Accept first attempt của agent → luôn iterate
  4. ❌ Over-engineering — agent có xu hướng thêm components không cần thiết → luôn audit
  5. ❌ One-shot generation từ 1 prompt dài → dùng multi-step workflow

Quick Reference cho Android Automotive Projects

Khi dùng Spec Kit cho AAOS/IVI feature:

Constitution nên include:

  • CarNotConnectedException handling pattern
  • Thread safety requirements (main thread vs binder thread)
  • @GuardedBy annotation enforcement
  • Null safety cho CarService callbacks
  • Timeout handling cho VHAL requests

Specify nên mô tả:

  • Use case từ góc nhìn driver/passenger
  • Safety constraints (ví dụ: không block UI thread)
  • CarUxRestrictions compliance

Plan nên specify:

  • AAOS version (AAOS13 vs AAOS15)
  • CarService APIs cụ thể
  • AIDL interface design
  • Multi-user behavior

04 同仓库更多 Skills