sdd-lint · git:20260824.63449ef · 2026-08-24 · sha256 fe45a583d8048b1c
sdd-lint git:20260824.63449efA
Immutable. This exact content is served forever at /api/v1/blob/fe45a583d8048b1c.
---
name: sdd-lint
description: Lint và kiểm định cú pháp EARS, SemVer và điều kiện biên trong SPEC.md
user-invocable: true
---
# SDD Spec Linter (`/sdd-lint`)
Dùng để lint và kiểm định `.sdd/features/{feature-slug}/SPEC.md`, phát hiện requirement mơ hồ, vi phạm EARS hoặc thiếu edge case trước khi Human Director hoặc Tech Lead review Spec.
## Tham số
- `--feature=<feature-slug>`: Feature slug cần lint.
## Quy trình kiểm tra
1. **Cú pháp EARS**
- Kiểm tra mọi Functional Requirement thuộc một trong năm mẫu EARS:
- **Ubiquitous**: `The <system> SHALL <action>`
- **Event-driven**: `WHEN <trigger>, the <system> SHALL <action>`
- **State-driven**: `WHILE <in state>, the <system> SHALL <action>`
- **Optional**: `WHERE <feature is included>, the <system> SHALL <action>`
- **Unwanted**: `IF <error/invalid condition>, THEN the <system> SHALL <action>`
- Cảnh báo cụm từ mơ hồ như “nhanh chóng”, “giao diện đẹp”, “xử lý linh hoạt”, “nếu cần thiết”.
2. **Unwanted Behavior coverage**
- Mỗi happy path (`WHEN`) cần ít nhất một `IF ... THEN ...` cho lỗi tương ứng, như timeout, duplicate, invalid input hoặc unauthorized.
3. **REQ và metadata**
- Kiểm tra `REQ-XXX` duy nhất/liên tục, header có status và SemVer hợp lệ.
4. **Báo cáo**
- Liệt kê warning/error cùng dòng liên quan và đề xuất câu EARS chuẩn hóa.
## AI Recommendation và Human Final Review
Sau lint, tạo canonical recommendation từ `.claude/skills/_shared/ai-review-protocol.md`, gồm error, warning, EARS correction đề xuất, edge-case gap và residual risk. Lưu trong feature `SPEC.md` hoặc `.sdd/reviews/lint-<slug>.md` với `PENDING HUMAN REVIEW`. Human Director quyết định có chấp thuận correction hay không; lint failure vẫn bị block đến khi được khắc phục hoặc disposition rõ ràng. Agent không tự approve Spec.