Skip to content

OpenSpec

OpenSpec là một spec framework nhẹ cho AI coding assistants. Triết lý của nó là fluid, iterative, easy, brownfield-first. Nó thêm spec layer nhưng không ép bạn vào quy trình phase-gate cứng.

Cách định vị ngắn nhất:

OpenSpec dành cho team muốn spec discipline nhưng không muốn ceremony nặng của lifecycle framework.

Link chính: Fission-AI/OpenSpec

Mental model

OpenSpec tách current truth khỏi proposed changes:

mermaid
flowchart LR
    A[openspec/specs] -->|source of truth| B[Current behavior]
    C[openspec/changes/change-id] -->|proposal + deltas| D[Proposed behavior]
    D -->|sync/archive| A
Khu vựcÝ nghĩa
openspec/specs/Source of truth mô tả hệ thống hiện hoạt động thế nào
openspec/changes/<change>/Proposed modification với artifacts và delta specs
proposal.mdVì sao thay đổi tồn tại và thay đổi gì
specs/ trong changeRequirements và scenarios cho behavior thay đổi
design.mdTechnical approach
tasks.mdImplementation checklist

Vì sao OpenSpec tồn tại?

OpenSpec tồn tại vì nhiều team muốn lợi ích của SDD nhưng thấy process nặng quá rigid. Project nhấn mạnh:

Nguyên tắcÝ nghĩa thực tế
Fluid not rigidCommands là actions, không phải phase locks
Iterative not waterfallArtifact có thể đổi khi hiểu biết sâu hơn
Easy not complexInit nhanh, customize sau
Brownfield-firstThiết kế cho thay đổi behavior hiện có, không chỉ greenfield

Setup

OpenSpec yêu cầu Node.js 20.19.0 trở lên.

bash
npm install -g @fission-ai/openspec@latest
cd your-project
openspec init

Sau đó bắt đầu trong AI coding assistant:

text
/opsx:propose add-dark-mode

Docs tham khảo:

Core workflow

OPSX core profile mặc định có:

CommandMục đích
/opsx:proposeTạo change và planning artifacts
/opsx:exploreExplore idea trước khi commit vào change
/opsx:applyImplement tasks từ change
/opsx:syncMerge delta specs vào main specs
/opsx:archiveArchive completed change
mermaid
flowchart LR
    A["/opsx:explore"] --> B["/opsx:propose"]
    B --> C["proposal.md + specs + design.md + tasks.md"]
    C --> D["/opsx:apply"]
    D --> E["/opsx:sync"]
    E --> F["/opsx:archive"]

Expanded workflow có thể bật bằng:

bash
openspec config profile
openspec update

Expanded commands gồm /opsx:new, /opsx:continue, /opsx:ff, /opsx:verify, /opsx:bulk-archive, /opsx:onboard.

Điểm mạnh

  1. Ít ceremony hơn Spec Kit và AI-DLC. Có structure nhưng không quá nhiều gate.
  2. Brownfield-friendly. Change/delta model hợp với hệ thống có sẵn.
  3. Tool-flexible. Hỗ trợ nhiều AI coding assistants qua generated instructions và slash commands.
  4. Fluid workflow. Có thể quay lại proposal, design, specs, tasks khi học thêm.
  5. Change isolation rõ. Mỗi change có folder riêng trước khi merge vào current specs.

Điểm yếu

Điểm yếuHệ quả thực tế
Governance yếu hơn AI-DLCHigh-risk enterprise work cần approval/audit bổ sung
Ít opinionated hơn Spec KitTeam phải tự quyết review strict đến đâu
Có thể quá nhẹ cho regulated workCần thêm security, NFR, operations gates
Cần artifact disciplineNếu bỏ /opsx:sync hoặc archive, specs có thể drift
Ecosystem mới hơnCần verify supported tools và workflow profile cho team

Use case tốt nhất

Use caseVì sao OpenSpec hợp
Brownfield feature changeProposed deltas được isolate trước khi thành source of truth
Solo/small-team AI codingSetup nhẹ, ít ceremony
Iterative product workArtifact có thể evolve khi học thêm
Team thấy SDD khác quá nặngGiữ specs mà không phase gates cứng
Multi-tool AI environmentsDùng generated agent instructions

Khi không nên dùng làm primary

Chọn framework khác khi:

  • Cần enterprise audit và approval: dùng AWS AI-DLC.
  • Cần high-throughput multi-agent execution: dùng GSD.
  • Cần TDD/review strict: kết hợp Superpowers.
  • Cần organization-level SDD standards rất formal: Spec Kit có thể dễ chuẩn hóa hơn.

OpenSpec vs Spec Kit

DimensionOpenSpecSpec Kit
PhilosophyFluid, iterative, lightweightStructured SDD với phase progression rõ hơn
SetupNode/npm CLISpecify CLI, templates, integrations
Artifact shapeopenspec/specsopenspec/changesspecs/plans/tasks theo templates
Change modelChange folders và delta specsFeature specs và implementation plans
Best fitBrownfield iterative changesFeature-level spec-first delivery
RiskQuá nhẹ nếu team cần strict gatesQuá nặng nếu team muốn iteration fluid

Step-by-step: feature change

Ví dụ: thêm customer export feature.

  1. Cài và initialize OpenSpec.
  2. Chạy:
text
/opsx:explore customer export requirements
  1. Khi scope rõ:
text
/opsx:propose add-customer-export
  1. Review generated artifacts:
    • proposal.md
    • change specs/
    • design.md
    • tasks.md
  2. Sửa artifact thủ công nếu sai.
  3. Chạy:
text
/opsx:apply
  1. Verify implementation thủ công hoặc dùng expanded /opsx:verify.
  2. Chạy:
text
/opsx:sync
/opsx:archive
  1. Xác nhận openspec/specs/ đã phản ánh current behavior.

Definition of done

Change done khi:

  1. Change folder giải thích vì sao thay đổi tồn tại.
  2. Specs mô tả behavior rõ.
  3. Design giải thích technical choices quan trọng.
  4. Tasks hoàn tất.
  5. Implementation có test evidence.
  6. Delta specs được sync vào current specs.
  7. Change được archive để traceability.

Built as a static bilingual AI engineering stack guide.