Validation
Implement a feature from a GitHub Issue. Use when user asks "implement issue 1, implement
From cc-auto-workflownpx claudepluginhub nxhung2304/cc-auto-workflow-pluginThis skill is limited to using the following tools:
Validation
Before implementing, validate:
- ✅ Issue number is provided and valid (e.g.,
1or#1) - ✅ Issue file exists in
specs/issues/folder - ✅ Issue status is
approved(notpending) - ✅ Git repository is initialized
- ✅ GitHub authentication is configured
If validation fails:
❌ Cannot implement issue — validation failed!
Possible issues:
- Issue #42 not found in specs/issues/
- Issue status is Pending (not Approved)
- specs/issues/ folder doesn't exist
- Not in a git repository
Solution:
1. Run /generate-issues first
2. Approve the issue (change Status: Pending → Approved)
3. Run /sync-github-issues to create GitHub issue
4. Then retry /implement-issue [number]
Mục đích
Đọc spec từ GitHub Issue, implement feature theo đúng spec, chạy quality checks, commit, và notify Slack.
Điều kiện tiên quyết
- Ưu tiên dùng MCP Slack và Github, nếu bị lỗi thì dùng fallback là gh và slack cli
Slack Notification Strategy
- Use
mcp__slack__slack_post_messagetool directly (NOT bash, NOT env var checks) - Parameters:
- channel_id: "C0AGTJ0EE6B"
- text: [message]
- For replies: use
mcp__slack__slack_reply_to_thread - channel_id: "C0AGTJ0EE6B"
- thread_ts: [ts from initial post]
- text: [message]
- DO NOT check for SLACK_API_TOKEN or SLACK_BOT_TOKEN env vars
- DO NOT skip Slack — always attempt the MCP call
- If MCP call fails → log the error and continue (don't block implementation)
1. Xác định issue number từ lệnh
User gọi: implement issue #42 → extract number 42
2. Đọc issue spec
gh issue view 42 --json title,body,labels
3. Tìm file spec local tương ứng
grep -rl "GitHub Issue:** #42" specs/issues/
→ Đọc file đó để lấy đầy đủ context: Acceptance Criteria, Implementation Checklist, Wireframe Reference, Notes
4. Kiểm tra status file phải là approved
Nếu Review là Pending` → dừng lại, thông báo:
❌ Issue #42 chưa được Approve. Dev cần đổi Review → Approved trước.
Các bước thực hiện
0. Pull code
git checkout develop
git pull origin develop
1. Tạo branch mới
git checkout -b feature/hung-#[issue-number]-[slug-title]
Slug từ title: lowercase, space → -, bỏ ký tự đặc biệt
Step 2: Notify Slack — bắt đầu
Use mcp__slack__slack_post_message:
- channel: "C0AGTJ0EE6B"
- text: "🚀 Bắt đầu implement Issue #[N]: [title]\nBranch:
feature/hung-#[N]-[slug]" - Save the returned
tsvalue for threading later If MCP fails → fallback to slack CLI
3. Đọc rules trước khi code
Đọc các file sau trước khi viết bất kỳ dòng code nào:
specs/rules/coding.mdspecs/rules/flutter.mdspecs/rules/design.md
3.5. Cross-check colors against HTML design
Before writing any code, if the spec references colors or design tokens:
- Open the relevant HTML design file in
specs/designs/(referenced in the issue spec) - Compare hex values in CSS
--variablesagainstAppColorsconstants inlib/core/constants/app_colors.dart - HTML design files are the source of truth for hex values — if
AppColorsdisagrees with the HTML, updateAppColorsfirst - Also update
specs/rules/design.mdto stay in sync
4. Implement theo spec
Làm tuần tự từng item trong ## Implementation Checklist của file spec:
- Tạo file structure
- Implement UI theo wireframe trong
specs/designs/ - Extract widget nếu > 50 lines
- Thêm
constconstructors - Thêm
TODOcomment cho data placeholder - Tuân thủ conventions trong
specs/rules/
Quy tắc khi code:
- Không implement logic ngoài spec
- Không tự thêm feature
- Nếu spec không rõ → dừng lại, hỏi dev, không tự assume
5. Chạy quality checks
flutter analyze
→ Phải đạt 0 warnings, 0 errors trước khi tiếp tục
flutter test
→ Tất cả tests phải pass
Nếu có lỗi → tự fix trước khi commit, không commit code lỗi
6. Commit
git add .
git commit -m "feat: [title] (#42)"
git push origin feature/issue-42-[slug]
7. Cập nhật status trong file spec
Sửa dòng status:
## **Status:**
- PR: Todo
Thành:
## **Status:**
- PR: Draft
8. Cập nhật GitHub Issue label
gh issue edit 42 --add-label "coding-done"
9. Tạo Draft PR
THREAD_TS=$(cat .claude/tmp/thread_${ISSUE_NUMBER}.txt)
gh pr create --draft \
--title "[title]" \
--body "## Summary
[Tóm tắt ngắn gọn những gì đã implement]
## Designs
- [Tham chiếu file Designs nếu có trong specs/designs dựa vào tệp specs/issues]
## Changes
[Liệt kê các file/widget đã tạo]
## Issue
Closes #42
<!-- slack-thread-ts: $THREAD_TS -->"
Step 10: Notify Slack — hoàn thành
Use mcp__slack__slack_reply_to_thread:
- channel: [channel-id]
- thread_ts: [saved ts from step 2]
- text: "✅ Code xong — Draft PR đã tạo\nPR: [url]\n @[user-id] review & test nghe"
If MCP fails → fallback to slack CLI
Quy tắc quan trọng
- KHÔNG code ngoài những gì spec mô tả
- KHÔNG commit nếu
flutter analyzecòn warning - Nếu gặp ambiguity → hỏi ngay, không assume
- Mỗi issue = 1 branch riêng, không code trực tiếp trên
main
Xử lý lỗi
| Lỗi | Xử lý |
|---|---|
| Issue không tồn tại | Dừng, thông báo issue number không hợp lệ |
| Status không phải approved | Dừng, nhắc dev đổi status |
| flutter analyze có lỗi | Tự fix, không được skip |
| flutter test fail | Tự fix, không được skip |
| Spec không rõ | Dừng, hỏi dev — không tự assume |