| name | review-specs |
| description | Review và phân tích spec issue từ file specs/issues/*.md. Trigger khi user nói: "review spec #1", "phân tích issue 1", "xem spec login", "review specs/issue #X", "check issue plan", "đánh giá spec này". Tự động tìm file specs/issues/{number}-*.md hoặc specs/issues/{title-slug}.md. |
Review Specs Skill
Overview
Đọc, tóm tắt và phân tích spec issue từ file trong thư mục specs/issues/.
Skill này giúp:
- Tóm tắt nhanh nội dung issue + mentor analysis + plan
- Đánh giá tính khả thi, scope creep, missing parts
- Gợi ý cải thiện plan (nếu cần)
- Chuẩn bị implement (danh sách files, decisions, flow)
- Không tự code hoặc edit file trừ khi user yêu cầu rõ ràng ("implement theo spec", "code theo plan")
Quick Reference
- File spec thường nằm ở: specs/issues/{issue_number}-*.md hoặc specs/issues/{slug}.md
- Cấu trúc file mong đợi: Raw Issue Content + Mentor Analysis + Approaches + Recommendation + Final Implementation Plan + Flow + Code Sketch + File Structure
- Output luôn dùng Markdown rõ ràng: headings, tables, code blocks
Steps (thực hiện tuần tự)
-
Xác định file spec cần review
- Nếu user đưa issue number (#1, #45...) → tìm file: specs/issues/{number}-.md hoặc specs/issues/{number}_.md
- Nếu user đưa title hoặc slug → tìm bằng glob: specs/issues/{slug}.md
- Dùng Bash/Glob:
find specs/issues -type f -name "*$ISSUE_NUMBER*" -o -name "*$SLUG*"
- Nếu nhiều file → hỏi user chọn cái nào
- Nếu không tìm thấy → báo lỗi và gợi ý: "Không thấy file specs/issues/#X-*.md, bạn có thể tạo hoặc paste link/content?"
-
Đọc và parse nội dung file
- Read toàn bộ file (hoặc dùng cat/grep để extract sections)
- Phân tích các phần chính:
- Raw Issue Content (Title, State, Author, Content)
- Mentor Analysis (Overview, Approaches, Recommendation)
- Final Implementation Plan (Behavior, Flow, Final Code Sketch, File Structure)
- Nếu file không có cấu trúc rõ → fallback: tóm tắt toàn bộ nội dung
-
Phân tích và review spec
- Tóm tắt ngắn gọn (1-2 đoạn): issue là gì, scope, tech (Ruby CLI ở ví dụ), goal cuối
- Đánh giá chất lượng spec:
- Có rõ ràng không? (requirements, edge cases)
- Có validation/input handling tốt? (email format, password length, masked input)
- Scope creep? (có thêm thứ ngoài yêu cầu không?)
- Best practices? (stdlib only, security UX, error handling)
- Missing parts? (exit codes, help message, tests?)
- So sánh với Approaches (nếu có): Option nào được recommend? Tại sao tốt hơn?
- Đánh giá Implementation Plan:
- Flow logic có hợp lý?
- Code sketch có clean, đúng Ruby idiom?
- File structure đơn giản phù hợp CLI?
-
Output cấu trúc đẹp (Markdown)
Summary
- Issue #: X - Title
- Tech: Ruby CLI
- Scope: [mô tả ngắn]
- Status: [OPEN/CLOSED]
Key Takeaways from Mentor
- Recommended: Option B (masked password with io/console)
- Decisions: validate email, min password 8 chars, loop re-prompt
Strengths
Potential Improvements / Missing
- Thêm: rescue interrupt (Ctrl+C), add --help flag
- Consider: env var for password nếu cần (nhưng out of scope)
- Security note: ...
Ready to Implement?
- Yes/No + lý do
- Suggested next steps: create login.rb, test manual, commit
Questions for User (nếu cần clarify)
- Bạn muốn implement luôn không?
- Có thêm requirement nào?
-
Kết thúc
- Hỏi user: "Bạn muốn mình implement code theo plan này không?" hoặc "Cần chỉnh sửa spec thêm?"
- Nếu user yêu cầu code → chuyển sang skill khác (implement-feature) hoặc dùng Write/Edit (nhưng confirm trước)
Lưu ý quan trọng
- Luôn dùng Read/Glob để tìm và đọc file → không giả định path