@torus-engineering/tas-kit 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/.claude/agents/README.md +83 -0
  2. package/.claude/agents/architect.md +53 -0
  3. package/.claude/agents/aws-reviewer.md +71 -0
  4. package/.claude/agents/build-resolver.md +59 -0
  5. package/.claude/agents/code-architect.md +62 -0
  6. package/.claude/agents/code-explorer.md +63 -0
  7. package/.claude/agents/code-simplifier.md +53 -0
  8. package/.claude/agents/comment-analyzer.md +59 -0
  9. package/.claude/agents/conversation-analyzer.md +57 -0
  10. package/.claude/agents/csharp-reviewer.md +62 -0
  11. package/.claude/agents/database-reviewer.md +73 -0
  12. package/.claude/agents/doc-updater.md +66 -0
  13. package/.claude/agents/docs-lookup.md +55 -0
  14. package/.claude/agents/e2e-runner.md +61 -0
  15. package/.claude/agents/harness-optimizer.md +62 -0
  16. package/.claude/agents/loop-operator.md +56 -0
  17. package/.claude/agents/performance-optimizer.md +78 -0
  18. package/.claude/agents/planner.md +82 -0
  19. package/.claude/agents/pr-test-analyzer.md +68 -0
  20. package/.claude/agents/python-reviewer.md +67 -0
  21. package/.claude/agents/pytorch-build-resolver.md +76 -0
  22. package/.claude/agents/refactor-cleaner.md +70 -0
  23. package/.claude/agents/security-reviewer.md +79 -0
  24. package/.claude/agents/seo-specialist.md +75 -0
  25. package/.claude/agents/silent-failure-hunter.md +69 -0
  26. package/.claude/agents/tdd-guide.md +84 -0
  27. package/.claude/agents/type-design-analyzer.md +75 -0
  28. package/.claude/agents/typescript-reviewer.md +65 -0
  29. package/.claude/commands/ado-create.md +2 -1
  30. package/.claude/commands/ado-delete.md +3 -2
  31. package/.claude/commands/ado-get.md +2 -1
  32. package/.claude/commands/ado-status.md +2 -1
  33. package/.claude/commands/ado-update.md +2 -1
  34. package/.claude/commands/tas-adr.md +13 -12
  35. package/.claude/commands/tas-bug.md +97 -50
  36. package/.claude/commands/tas-design.md +3 -1
  37. package/.claude/commands/tas-dev.md +115 -0
  38. package/.claude/commands/tas-epic.md +4 -2
  39. package/.claude/commands/tas-feature.md +5 -3
  40. package/.claude/commands/tas-fix.md +47 -0
  41. package/.claude/commands/tas-plan.md +184 -0
  42. package/.claude/commands/tas-prd.md +3 -1
  43. package/.claude/commands/tas-review.md +104 -0
  44. package/.claude/commands/tas-sad.md +3 -1
  45. package/.claude/commands/tas-security.md +80 -0
  46. package/.claude/commands/tas-spec.md +50 -0
  47. package/.claude/commands/tas-story.md +77 -40
  48. package/.claude/commands/tas-verify.md +8 -0
  49. package/.claude/hooks/code-quality.js +127 -0
  50. package/.claude/hooks/session-end.js +116 -0
  51. package/.claude/rules/.gitkeep +0 -0
  52. package/.claude/rules/common/agents.md +65 -0
  53. package/.claude/rules/common/code-review.md +124 -0
  54. package/.claude/rules/common/coding-style.md +90 -0
  55. package/.claude/rules/common/development-workflow.md +44 -0
  56. package/.claude/rules/common/git-workflow.md +24 -0
  57. package/.claude/rules/common/hooks.md +30 -0
  58. package/.claude/rules/common/patterns.md +31 -0
  59. package/.claude/rules/common/performance.md +55 -0
  60. package/.claude/rules/common/post-review-agent.md +39 -0
  61. package/.claude/rules/common/project-status.md +80 -0
  62. package/.claude/rules/common/security.md +29 -0
  63. package/.claude/rules/common/stack-detection.md +29 -0
  64. package/.claude/rules/common/testing.md +57 -0
  65. package/.claude/rules/csharp/coding-style.md +72 -0
  66. package/.claude/rules/csharp/hooks.md +25 -0
  67. package/.claude/rules/csharp/patterns.md +50 -0
  68. package/.claude/rules/csharp/security.md +58 -0
  69. package/.claude/rules/csharp/testing.md +46 -0
  70. package/.claude/rules/python/coding-style.md +42 -0
  71. package/.claude/rules/python/hooks.md +19 -0
  72. package/.claude/rules/python/patterns.md +39 -0
  73. package/.claude/rules/python/security.md +30 -0
  74. package/.claude/rules/python/testing.md +38 -0
  75. package/.claude/rules/typescript/coding-style.md +199 -0
  76. package/.claude/rules/typescript/hooks.md +22 -0
  77. package/.claude/rules/typescript/patterns.md +52 -0
  78. package/.claude/rules/typescript/security.md +28 -0
  79. package/.claude/rules/typescript/testing.md +18 -0
  80. package/.claude/rules/web/coding-style.md +96 -0
  81. package/.claude/rules/web/design-quality.md +63 -0
  82. package/.claude/rules/web/hooks.md +120 -0
  83. package/.claude/rules/web/patterns.md +79 -0
  84. package/.claude/rules/web/performance.md +64 -0
  85. package/.claude/rules/web/security.md +57 -0
  86. package/.claude/rules/web/testing.md +55 -0
  87. package/.claude/settings.json +37 -0
  88. package/.claude/settings.local.json +38 -0
  89. package/.claude/skills/ado-integration/SKILL.md +44 -1
  90. package/.claude/skills/agent-harness-construction/SKILL.md +77 -0
  91. package/.claude/skills/agent-introspection-debugging/SKILL.md +157 -0
  92. package/.claude/skills/ai-regression-testing/SKILL.md +364 -0
  93. package/.claude/skills/api-design/SKILL.md +528 -0
  94. package/.claude/skills/architecture-decision-records/SKILL.md +184 -0
  95. package/.claude/skills/backend-patterns/SKILL.md +602 -0
  96. package/.claude/skills/benchmark/SKILL.md +98 -0
  97. package/.claude/skills/browser-qa/SKILL.md +92 -0
  98. package/.claude/skills/canary-watch/SKILL.md +104 -0
  99. package/.claude/skills/tas-conventions/SKILL.md +51 -3
  100. package/.claude/skills/tas-implementation-complete/SKILL.md +97 -0
  101. package/.claude/skills/tas-tdd/SKILL.md +72 -16
  102. package/.tas/README.md +29 -24
  103. package/.tas/tas-example.yaml +2 -1
  104. package/.tas/templates/Story.md +18 -18
  105. package/CLAUDE-Example.md +1 -1
  106. package/README.md +20 -5
  107. package/package.json +1 -1
  108. package/.claude/commands/tas-dev-story.md +0 -61
  109. package/.claude/commands/tas-review-code.md +0 -42
  110. package/.claude/commands/tas-security-check.md +0 -30
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: browser-qa
3
+ description: |
4
+ Auto-invoke when verifying UI behavior after a frontend feature deploy or PR,
5
+ running accessibility audits, or doing pre-ship validation of forms, navigation,
6
+ and critical user journeys. Requires browser automation MCP (claude-in-chrome or Playwright).
7
+ SKIP if no browser MCP is available — note the dependency gap to user instead.
8
+ origin: ECC
9
+ allowed-tools: Read, Bash
10
+ ---
11
+
12
+ # Browser QA — Automated Visual Testing & Interaction
13
+
14
+ ## When to Use
15
+
16
+ - After deploying a feature to staging/preview
17
+ - When you need to verify UI behavior across pages
18
+ - Before shipping — confirm layouts, forms, interactions actually work
19
+ - When reviewing PRs that touch frontend code
20
+ - Accessibility audits and responsive testing
21
+
22
+ ## How It Works
23
+
24
+ Uses the browser automation MCP (claude-in-chrome, Playwright, or Puppeteer) to interact with live pages like a real user.
25
+
26
+ ### Phase 1: Smoke Test
27
+ ```
28
+ 1. Navigate to target URL
29
+ 2. Check for console errors (filter noise: analytics, third-party)
30
+ 3. Verify no 4xx/5xx in network requests
31
+ 4. Screenshot above-the-fold on desktop + mobile viewport
32
+ 5. Check Core Web Vitals: LCP < 2.5s, CLS < 0.1, INP < 200ms
33
+ ```
34
+
35
+ ### Phase 2: Interaction Test
36
+ ```
37
+ 1. Click every nav link — verify no dead links
38
+ 2. Submit forms with valid data — verify success state
39
+ 3. Submit forms with invalid data — verify error state
40
+ 4. Test auth flow: login → protected page → logout
41
+ 5. Test critical user journeys (checkout, onboarding, search)
42
+ ```
43
+
44
+ ### Phase 3: Visual Regression
45
+ ```
46
+ 1. Screenshot key pages at 3 breakpoints (375px, 768px, 1440px)
47
+ 2. Compare against baseline screenshots (if stored)
48
+ 3. Flag layout shifts > 5px, missing elements, overflow
49
+ 4. Check dark mode if applicable
50
+ ```
51
+
52
+ ### Phase 4: Accessibility
53
+ ```
54
+ 1. Run axe-core or equivalent on each page
55
+ 2. Flag WCAG AA violations (contrast, labels, focus order)
56
+ 3. Verify keyboard navigation works end-to-end
57
+ 4. Check screen reader landmarks
58
+ ```
59
+
60
+ ## Output Format
61
+
62
+ ```markdown
63
+ ## QA Report — [URL] — [timestamp]
64
+
65
+ ### Smoke Test
66
+ - Console errors: 0 critical, 2 warnings (analytics noise)
67
+ - Network: all 200/304, no failures
68
+ - Core Web Vitals: LCP 1.2s ✓, CLS 0.02 ✓, INP 89ms ✓
69
+
70
+ ### Interactions
71
+ - [✓] Nav links: 12/12 working
72
+ - [✗] Contact form: missing error state for invalid email
73
+ - [✓] Auth flow: login/logout working
74
+
75
+ ### Visual
76
+ - [✗] Hero section overflows on 375px viewport
77
+ - [✓] Dark mode: all pages consistent
78
+
79
+ ### Accessibility
80
+ - 2 AA violations: missing alt text on hero image, low contrast on footer links
81
+
82
+ ### Verdict: SHIP WITH FIXES (2 issues, 0 blockers)
83
+ ```
84
+
85
+ ## Integration
86
+
87
+ Works with any browser MCP:
88
+ - `mChild__claude-in-chrome__*` tools (preferred — uses your actual Chrome)
89
+ - Playwright via `mcp__browserbase__*`
90
+ - Direct Puppeteer scripts
91
+
92
+ Pair with `/canary-watch` for post-deploy monitoring.
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: canary-watch
3
+ description: |
4
+ Auto-invoke after deploying to production or staging, after merging a risky PR,
5
+ after dependency upgrades, or when monitoring a URL for regressions during a launch window.
6
+ Requires HTTP access to the target URL or browser MCP.
7
+ SKIP if target URL is not accessible — note the gap to user.
8
+ origin: ECC
9
+ allowed-tools: Read, Bash
10
+ ---
11
+
12
+ # Canary Watch — Post-Deploy Monitoring
13
+
14
+ ## When to Use
15
+
16
+ - After deploying to production or staging
17
+ - After merging a risky PR
18
+ - When you want to verify a fix actually fixed it
19
+ - Continuous monitoring during a launch window
20
+ - After dependency upgrades
21
+
22
+ ## How It Works
23
+
24
+ Monitors a deployed URL for regressions. Runs in a loop until stopped or until the watch window expires.
25
+
26
+ ### What It Watches
27
+
28
+ ```
29
+ 1. HTTP Status — is the page returning 200?
30
+ 2. Console Errors — new errors that weren't there before?
31
+ 3. Network Failures — failed API calls, 5xx responses?
32
+ 4. Performance — LCP/CLS/INP regression vs baseline?
33
+ 5. Content — did key elements disappear? (h1, nav, footer, CTA)
34
+ 6. API Health — are critical endpoints responding within SLA?
35
+ ```
36
+
37
+ ### Watch Modes
38
+
39
+ **Quick check** (default): single pass, report results
40
+ ```
41
+ /canary-watch https://myapp.com
42
+ ```
43
+
44
+ **Sustained watch**: check every N minutes for M hours
45
+ ```
46
+ /canary-watch https://myapp.com --interval 5m --duration 2h
47
+ ```
48
+
49
+ **Diff mode**: compare staging vs production
50
+ ```
51
+ /canary-watch --compare https://staging.myapp.com https://myapp.com
52
+ ```
53
+
54
+ ### Alert Thresholds
55
+
56
+ ```yaml
57
+ critical: # immediate alert
58
+ - HTTP status != 200
59
+ - Console error count > 5 (new errors only)
60
+ - LCP > 4s
61
+ - API endpoint returns 5xx
62
+
63
+ warning: # flag in report
64
+ - LCP increased > 500ms from baseline
65
+ - CLS > 0.1
66
+ - New console warnings
67
+ - Response time > 2x baseline
68
+
69
+ info: # log only
70
+ - Minor performance variance
71
+ - New network requests (third-party scripts added?)
72
+ ```
73
+
74
+ ### Notifications
75
+
76
+ When a critical threshold is crossed:
77
+ - Desktop notification (macOS/Linux)
78
+ - Optional: Slack/Discord webhook
79
+ - Log to `~/logs/canary-watch.log`
80
+
81
+ ## Output
82
+
83
+ ```markdown
84
+ ## Canary Report — myapp.com — 2026-03-23 03:15 PST
85
+
86
+ ### Status: HEALTHY ✓
87
+
88
+ | Check | Result | Baseline | Delta |
89
+ |-------|--------|----------|-------|
90
+ | HTTP | 200 ✓ | 200 | — |
91
+ | Console errors | 0 ✓ | 0 | — |
92
+ | LCP | 1.8s ✓ | 1.6s | +200ms |
93
+ | CLS | 0.01 ✓ | 0.01 | — |
94
+ | API /health | 145ms ✓ | 120ms | +25ms |
95
+
96
+ ### No regressions detected. Deploy is clean.
97
+ ```
98
+
99
+ ## Integration
100
+
101
+ Pair with:
102
+ - `/browser-qa` for pre-deploy verification
103
+ - Hooks: add as a PostToolUse hook on `git push` to auto-check after deploys
104
+ - CI: run in GitHub Actions after deploy step
@@ -9,9 +9,57 @@ allowed-tools: Read, Grep, Glob
9
9
 
10
10
  # TAS Conventions
11
11
 
12
- Khi generate hoặc review code, PHẢI tuân thủ conventions được định nghĩa trong CLAUDE.md của project.
12
+ Khi generate hoặc review code, PHẢI tuân thủ conventions được định nghĩa trong `CLAUDE.md` của project.
13
+
14
+ ## When to Use
15
+
16
+ - Trước khi generate code mới (check conventions)
17
+ - Khi review code của user (verify compliance)
18
+ - Khi user hỏi "đặt tên thế nào?", "format như thế nào?"
19
+ - KHÔNG invoke khi: đọc file thuần, không liên quan đến code output
20
+
21
+ ## Always / Ask / Never
22
+
23
+ | | Hành động |
24
+ |---|---|
25
+ | **Always** | Đọc `CLAUDE.md` trước khi áp dụng convention |
26
+ | **Always** | Chỉ ra file:line cụ thể khi phát hiện vi phạm |
27
+ | **Ask** | Khi convention trong CLAUDE.md mơ hồ hoặc có conflict |
28
+ | **Never** | Hardcode convention (naming, format) mà không đọc CLAUDE.md trước |
29
+ | **Never** | Áp dụng convention từ project khác vào project hiện tại |
13
30
 
14
31
  ## Checklist
15
- - Đọc CLAUDE.md để lấy naming conventions, branching, commit format
32
+
33
+ - Đọc `CLAUDE.md` để lấy naming conventions, branching, commit format, stack rules
16
34
  - Enforce các conventions đó trong code output
17
- - Nếu code vi phạm conventions, chỉ ra cụ thể
35
+ - Nếu code vi phạm conventions, chỉ ra cụ thể: file:line + convention bị vi phạm + cách sửa
36
+
37
+ ## Common Conventions (Default — override bằng CLAUDE.md)
38
+
39
+ Các conventions mặc định này chỉ áp dụng khi `CLAUDE.md` không định nghĩa khác:
40
+
41
+ - Variables/functions: `camelCase`
42
+ - Types/Interfaces/Components: `PascalCase`
43
+ - Constants: `UPPER_SNAKE_CASE`
44
+ - Boolean vars: prefix `is`, `has`, `should`, `can`
45
+ - File naming: kebab-case cho files, PascalCase cho components
46
+ - Commit format: `<type>: <description>` (feat, fix, refactor, docs, test, chore)
47
+
48
+ ## Red Flags
49
+
50
+ - Magic numbers trong code (e.g. `if (count > 50)`) → phải dùng named constant
51
+ - Deep nesting >4 levels → dùng early return hoặc extract method
52
+ - Function >50 lines → extract thành functions nhỏ hơn
53
+ - File >800 lines → extract thành modules
54
+ - Variable tên 1-2 ký tự (`x`, `t`, `d`) trong production code → đặt tên mô tả
55
+ - `any` type trong TypeScript → dùng type cụ thể hoặc generic
56
+ - Commented-out code block lớn → xóa nếu không cần, dùng git history thay thế
57
+
58
+ ## Verification
59
+
60
+ - [ ] CLAUDE.md đã được đọc trước khi review/generate code
61
+ - [ ] Naming tuân thủ conventions trong CLAUDE.md
62
+ - [ ] Không có magic numbers
63
+ - [ ] Không có deep nesting (>4 levels)
64
+ - [ ] Functions < 50 lines, files < 800 lines
65
+ - [ ] Commit message theo format đã định nghĩa
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: tas-implementation-complete
3
+ description: |
4
+ Auto-invoke khi user báo hiệu đã hoàn thành implement: "done", "xong", "finished",
5
+ "đã xong", "đã implement xong", "implementation complete", "code xong rồi",
6
+ "viết xong rồi", "đã code xong". Trigger parallel post-implementation review gate.
7
+ allowed-tools: Read, Bash, Grep, Glob, Agent
8
+ ---
9
+
10
+ # TAS Implementation Complete
11
+
12
+ Khi user báo hiệu implementation xong, tự động trigger post-implementation review gate.
13
+ Không chờ user chạy `/tas-review-code` thủ công.
14
+
15
+ ## When to Use
16
+
17
+ - User vừa implement xong một Story hoặc một feature
18
+ - User nói "xong", "done", "finished" sau khi viết code
19
+ - KHÔNG invoke khi: user đang hỏi về trạng thái, hỏi về plan, hay chưa có code thay đổi
20
+
21
+ ## Always / Ask / Never
22
+
23
+ | | Hành động |
24
+ |---|---|
25
+ | **Always** | Xác nhận scope với user trước khi launch agents |
26
+ | **Always** | Launch code-reviewer + security-reviewer đồng thời |
27
+ | **Always** | Báo cáo gate result rõ ràng: pass hoặc block với lý do |
28
+ | **Ask** | Khi không chắc scope review là gì (file path? git diff? Story?) |
29
+ | **Ask** | Khi có >5 files thay đổi — confirm user muốn review toàn bộ |
30
+ | **Never** | Tự động commit sau khi review pass |
31
+ | **Never** | Skip review và báo "looks good" mà không chạy agents |
32
+
33
+ ## Process
34
+
35
+ ### Bước 1 — Xác định scope
36
+ Hỏi user hoặc tự suy luận từ context:
37
+ - Có Story ID? → lấy danh sách files từ Story
38
+ - Không có? → dùng `git diff HEAD --name-only` để lấy files vừa thay đổi
39
+
40
+ ### Bước 2 — Stack Detection
41
+ Đọc `CLAUDE.md` tại root, tìm section `## Tech Stack`:
42
+ - Backend chứa `.NET` / `C#` → `lang_agent = csharp-reviewer`
43
+ - Backend chứa `Node.js` / `TypeScript` → `lang_agent = typescript-reviewer`
44
+ - Backend chứa `Python` / `FastAPI` / `Django` → `lang_agent = python-reviewer`
45
+ - Frontend chứa `React` → bổ sung `typescript-reviewer`
46
+
47
+ ### Bước 3 — Launch Parallel Review Gate
48
+
49
+ Launch các agents ĐỒNG THỜI:
50
+
51
+ **Agent 1 — `code-reviewer`** (luôn chạy):
52
+ > Review [scope]. Đọc `.tas/checklists/code-review.md`.
53
+ > Tập trung: acceptance criteria compliance, naming, error handling, test coverage, DRY.
54
+ > Format: Critical / High / Medium / Low với file:line và fix cụ thể.
55
+
56
+ **Agent 2 — `security-reviewer`** (luôn chạy):
57
+ > Security audit [scope]. Đọc `.claude/rules/common/security.md`.
58
+ > Tập trung: user input handling, SQL injection, hardcoded secrets, auth checks.
59
+ > Format: Critical / High / Medium / Low với file:line và remediation.
60
+
61
+ **Agent 3 — Language reviewer** (theo stack detection):
62
+ > Language-specific review [scope].
63
+ > Đọc `.claude/rules/[stack]/coding-style.md` và `.claude/rules/[stack]/patterns.md`.
64
+ > Format: Critical / High / Medium / Low với file:line.
65
+
66
+ Chờ TẤT CẢ agents hoàn thành.
67
+
68
+ ### Bước 4 — Gate Decision
69
+
70
+ **Có Critical/High findings:**
71
+ → Liệt kê rõ từng finding, DỪNG, yêu cầu fix trước khi tiếp tục.
72
+ → Không tick Definition of Done.
73
+
74
+ **Chỉ có Medium/Low:**
75
+ → List gợi ý, hỏi user có muốn fix không.
76
+ → Sau khi user confirm: nhắc chạy `/tas-review-code` để review đầy đủ (hygiene scan + test run).
77
+
78
+ ## Red Flags
79
+
80
+ - User nói "xong" nhưng không có file nào thay đổi trong git diff → hỏi lại
81
+ - Review gate bị skip vì "code đơn giản" → không có ngoại lệ, luôn chạy gate
82
+ - Agent trả về "No issues found" trên codebase lớn → verify agent đã đọc đúng files
83
+
84
+ ## Verification
85
+
86
+ - [ ] `git diff HEAD --name-only` có ít nhất 1 file thay đổi
87
+ - [ ] Tất cả agents đã chạy và trả về kết quả (không timeout)
88
+ - [ ] Gate decision được đưa ra rõ ràng: pass hoặc block
89
+ - [ ] Nếu pass: user biết bước tiếp theo là `/tas-review-code`
90
+
91
+ ## Anti-Rationalization
92
+
93
+ | Rationalization | Counter |
94
+ |---|---|
95
+ | "Code đơn giản, không cần review" | Review gate luôn chạy — đây là safety net, không phải quality judgment |
96
+ | "Security reviewer sẽ slow down workflow" | Parallel execution — 3 agents chạy cùng lúc, không cộng thêm thời gian |
97
+ | "User chưa hỏi về review" | Skill auto-invoke khi user nói "done" — đây là expected behavior |
@@ -1,26 +1,82 @@
1
- ---
1
+ ---
2
2
  name: tas-tdd
3
3
  description: |
4
- TDD workflow. Auto-invoke khi implement feature,
5
- write tests, hoặc khi use_tdd=true trong tas.yaml.
4
+ TDD workflow. Auto-invoke khi: user implement feature mới, viết tests,
5
+ hoặc khi use_tdd=true trong tas.yaml. Enforce Red-Green-Refactor cycle
6
+ với verification gates giữa mỗi phase.
6
7
  allowed-tools: Read, Write, Edit, Bash, Grep
7
8
  ---
8
9
 
9
10
  # TAS TDD Workflow
10
11
 
11
- Khi use_tdd=true trong tas.yaml, enforce Red-Green-Refactor cycle:
12
+ Khi `use_tdd=true` trong `tas.yaml`, enforce strict Red-Green-Refactor cycle.
13
+ Không có ngoại lệ — mọi feature đều bắt đầu từ test.
14
+
15
+ ## When to Use
16
+
17
+ - Implement feature mới theo Story với acceptance criteria rõ ràng
18
+ - Bug fix: viết regression test trước khi fix
19
+ - Refactor: đảm bảo test coverage trước khi thay đổi code
20
+ - KHÔNG dùng TDD cho: config changes, documentation, migration scripts thuần data
21
+
22
+ ## Always / Ask / Never
23
+
24
+ | | Hành động |
25
+ |---|---|
26
+ | **Always** | Viết test TRƯỚC, chạy để xác nhận FAIL, sau đó mới viết code |
27
+ | **Always** | Commit sau mỗi Green phase thành công |
28
+ | **Always** | Chạy full test suite sau Refactor phase |
29
+ | **Ask** | Khi acceptance criteria mơ hồ — làm rõ trước khi viết test |
30
+ | **Ask** | Khi test quá khó viết — có thể interface/design cần cải thiện |
31
+ | **Never** | Viết implementation trước test (dù "chỉ để thử") |
32
+ | **Never** | Bỏ qua Red phase vì "test rõ ràng sẽ fail" |
33
+ | **Never** | Viết nhiều hơn code tối thiểu cần thiết để pass test ở Green phase |
34
+
35
+ ## Process
36
+
37
+ ### Red Phase — Viết Test Trước
38
+
39
+ 1. Đọc acceptance criteria trong Story
40
+ 2. Viết test cases cover từng criteria
41
+ 3. Chạy tests: `npm test` / `dotnet test` / `python -m pytest`
42
+ 4. **Verify**: tests PHẢI FAIL — nếu pass ngay → test sai, viết lại
43
+
44
+ ### Green Phase — Code Tối Thiểu
45
+
46
+ 1. Viết code tối thiểu để pass tests
47
+ 2. Không refactor, không optimize ở phase này
48
+ 3. Chạy tests: xác nhận PASS
49
+ 4. **Verify**: tất cả tests mới phải pass, không có regression
50
+
51
+ ### Refactor Phase — Clean Up
52
+
53
+ 1. Loại bỏ duplication, cải thiện naming, giảm complexity
54
+ 2. KHÔNG thay đổi behavior — tests là safety net
55
+ 3. Chạy full test suite sau mỗi refactor step
56
+ 4. **Verify**: coverage >= 80%, tất cả tests vẫn pass
57
+ 5. Commit sau khi refactor thành công
58
+
59
+ ## Red Flags
60
+
61
+ - Test pass ngay lần đầu khi chưa viết implementation → test không test đúng thứ cần test
62
+ - Test quá broad ("everything works") → không có giá trị, viết test cụ thể hơn
63
+ - Green phase code quá nhiều logic → chỉ viết đủ để pass, không hơn
64
+ - Refactor phase làm test fail → refactor sai, roll back từng bước
65
+ - Viết nhiều test cùng lúc trước khi fix từng cái → chỉ fix một test tại một thời điểm
66
+
67
+ ## Verification
12
68
 
13
- ## Red Phase
14
- 1. Viết test case TRƯỚC dựa trên acceptance criteria trong Story
15
- 2. Chạy test, xác nhận FAIL
16
- 3. KHÔNG viết implementation code phase này
69
+ - [ ] Red: test file tồn tại và chạy ra FAIL output
70
+ - [ ] Green: test output chuyển từ FAIL PASS sau khi thêm implementation
71
+ - [ ] Refactor: `npm test` / `dotnet test` / `pytest` toàn bộ suite PASS
72
+ - [ ] Coverage report: >= 80% cho files vừa thay đổi
73
+ - [ ] Không có test nào bị skip hay comment out
17
74
 
18
- ## Green Phase
19
- 1. Viết code TỐI THIỂU để pass tests
20
- 2. Chạy test, xác nhận PASS
21
- 3. KHÔNG refactor ở phase này
75
+ ## Anti-Rationalization
22
76
 
23
- ## Refactor Phase
24
- 1. Clean up code, loại bỏ duplication
25
- 2. Chạy test, xác nhận vẫn PASS
26
- 3. Commit sau mỗi refactor thành công
77
+ | Rationalization | Counter |
78
+ |---|---|
79
+ | "Test rõ ràng sẽ fail, không cần chạy" | Bỏ qua Red phase làm mất điểm kiểm chứng — luôn chạy |
80
+ | "Viết test sau nhanh hơn" | TDD tiết kiệm debugging time nhiều hơn thời gian viết test trước |
81
+ | "Code này quá đơn giản cần test" | Đơn giản hôm nay, phức tạp sau refactor — test bảo vệ future changes |
82
+ | "Interface chưa clear, viết code trước cho rõ" | Test khó viết là signal interface cần cải thiện — Ask, không skip |
package/.tas/README.md CHANGED
@@ -38,11 +38,14 @@ your-project/
38
38
  │ │ ├── tas-story.md # /tas-story - Tạo hoặc cập nhật Story
39
39
  │ │ ├── tas-sad.md # /tas-sad - Tạo hoặc cập nhật SAD
40
40
  │ │ ├── tas-adr.md # /tas-adr - Tạo hoặc cập nhật ADR
41
- │ │ ├── tas-dev-story.md # /tas-dev-story - Implement story
42
- │ │ ├── tas-review-code.md # /tas-review-code
41
+ │ │ ├── tas-spec.md # /tas-spec - Lightweight spec (solo/prototype)
42
+ │ │ ├── tas-plan.md # /tas-plan - Technical implementation plan
43
+ │ │ ├── tas-dev.md # /tas-dev - Implement story
44
+ │ │ ├── tas-fix.md # /tas-fix - Quick fix without full story flow
45
+ │ │ ├── tas-review.md # /tas-review - Code review with checklist
43
46
  │ │ ├── tas-brainstorm.md # /tas-brainstorm
44
47
  │ │ ├── tas-bug.md # /tas-bug - Bug lifecycle
45
- │ │ ├── tas-security-check.md # /tas-security-check
48
+ │ │ ├── tas-security.md # /tas-security - Security review
46
49
  │ │ ├── tas-verify.md # /tas-verify - PE verify Feature trên Staging
47
50
  │ │ ├── ado-create.md # /ado-create - Tạo work item trên ADO
48
51
  │ │ ├── ado-get.md # /ado-get - Pull work item từ ADO
@@ -250,13 +253,15 @@ models:
250
253
  tas-epic: sonnet
251
254
  tas-feature: sonnet
252
255
  tas-story: sonnet
253
- tas-dev-story: sonnet # Code generation, Sonnet đủ tốt
254
- tas-review-code: opus # Review cần phân tích sâu
256
+ tas-dev: sonnet # Code generation, Sonnet đủ tốt
257
+ tas-spec: sonnet
258
+ tas-fix: sonnet
259
+ tas-review: opus # Review cần phân tích sâu
255
260
  tas-brainstorm: opus # Suy luận đa chiều
256
261
  tas-bug: sonnet # Fix code, Sonnet đủ tốt
257
262
  tas-verify: haiku # Chủ yếu đọc checklist, hỏi pass/fail
258
263
  tas-status: haiku # Chỉ đọc và format
259
- tas-security-check: opus # Security cần kỹ
264
+ tas-security: opus # Security cần kỹ
260
265
  ```
261
266
 
262
267
  ---
@@ -340,7 +345,7 @@ epics:
340
345
  ## 3. Chi tiết từng Command
341
346
 
342
347
  > **Quy tắc Context-Aware (áp dụng cho TẤT CẢ commands):**
343
- > Mỗi command phase code (/tas-dev-story, /tas-bug fix) PHẢI chạy trong session mới. Story.md đã chứa đủ context (Acceptance Criteria, Technical Notes, Unit Test Cases, references SAD/ADR) — KHÔNG cần đọc PRD, SAD, ADR, Feature trong session implement. Chỉ đọc thêm khi user yêu cầu cụ thể. Nguyên tắc này tránh phình Window Context do tích lũy artifact từ session cũ.
348
+ > Mỗi command phase code (/tas-dev, /tas-bug fix) PHẢI chạy trong session mới. Story.md đã chứa đủ context (Acceptance Criteria, Technical Notes, Unit Test Cases, references SAD/ADR) — KHÔNG cần đọc PRD, SAD, ADR, Feature trong session implement. Chỉ đọc thêm khi user yêu cầu cụ thể. Nguyên tắc này tránh phình Window Context do tích lũy artifact từ session cũ.
344
349
 
345
350
  > **Quy tắc Project Status (áp dụng cho TẤT CẢ commands có thay đổi artifact hoặc status):**
346
351
  > Sau khi hoàn thành tạo/cập nhật artifact hoặc thay đổi status, PHẢI cập nhật file `root/project-status.yaml` ngay lập tức. Cụ thể:
@@ -355,10 +360,10 @@ epics:
355
360
  > | /tas-epic | epics.Epic-{NNN}: title + status + path, tạo features rỗng |
356
361
  > | /tas-feature | epics.Epic-{NNN}.features.Feature-{NNN}: title + status + path, tạo stories rỗng |
357
362
  > | /tas-story | epics...stories.Story-{NNN}: title + status + assigned |
358
- > | /tas-dev-story | Story status: Committed → In Progress → (done) cập nhật theo progress |
363
+ > | /tas-dev | Story status: Committed → In Progress → (done) cập nhật theo progress |
359
364
  > | /tas-verify | Feature status: Ready To Verify → Verified (hoặc giữ nguyên nếu fail). Story status cập nhật tương ứng. |
360
365
  > | /tas-bug | Tạo mới: thêm bug entry trong Feature. Update: cập nhật bug status theo lifecycle. |
361
- > | /tas-security-check | artifacts.security_report: status + path + last_scan date |
366
+ > | /tas-security | artifacts.security_report: status + path + last_scan date |
362
367
  >
363
368
  > Luôn cập nhật `last_updated` timestamp. Quy tắc này đảm bảo /tas-status chỉ cần đọc 1 file duy nhất thay vì quét toàn bộ thư mục.
364
369
 
@@ -661,10 +666,10 @@ Tạo mới hoặc cập nhật User Story document.
661
666
  - Story status: New → Committed → In Progress → Deploy Test → Verify Test → Deploy Stag → Verify Stag → Deploy Prod → Verify Prod → Done
662
667
  ```
663
668
 
664
- ### 3.9 /tas-dev-story - Implement Story
669
+ ### 3.9 /tas-dev - Implement Story
665
670
 
666
671
  ```markdown
667
- # /tas-dev-story $ARGUMENTS
672
+ # /tas-dev $ARGUMENTS
668
673
 
669
674
  Vai trò: SE - Software Engineer
670
675
  Implement một User Story.
@@ -703,10 +708,10 @@ c. Chạy tests, fix nếu fail
703
708
  - Mỗi public method PHẢI có XML doc comment
704
709
  ```
705
710
 
706
- ### 3.10 /tas-review-code - Review Code
711
+ ### 3.10 /tas-review - Review Code
707
712
 
708
713
  ```markdown
709
- # /tas-review-code $ARGUMENTS
714
+ # /tas-review $ARGUMENTS
710
715
 
711
716
  Vai trò: SE - Software Engineer
712
717
  Review code thay đổi gần nhất hoặc một file/PR cụ thể.
@@ -820,10 +825,10 @@ Tìm file Bug trong cây docs/epics/ (dùng glob), detect status hiện tại:
820
825
  - Bug Critical/High phải fix trước khi Feature được Verified
821
826
  ```
822
827
 
823
- ### 3.13 /tas-security-check - Security Check
828
+ ### 3.13 /tas-security - Security Check
824
829
 
825
830
  ```markdown
826
- # /tas-security-check $ARGUMENTS
831
+ # /tas-security $ARGUMENTS
827
832
 
828
833
  Vai trò: DSE - DevSecOps Engineer
829
834
  Kiểm tra bảo mật codebase, lưu báo cáo vào docs/security-report.md.
@@ -1388,9 +1393,9 @@ This project uses Torus-Agentic-SDLC (TAS) kit.
1388
1393
  ## Commands
1389
1394
  Type /tas-status to see current project state.
1390
1395
  Type /tas-[artifact] to create or update artifacts (prd, sad, adr, epic, feature, story, design).
1391
- Type /tas-dev-story to implement a story.
1396
+ Type /tas-dev to implement a story.
1392
1397
  Type /tas-verify to verify a Feature on Staging (Phase 2).
1393
- Type /tas-review-code, /tas-brainstorm, /tas-bug, /tas-security-check for dev workflows.
1398
+ Type /tas-review, /tas-brainstorm, /tas-bug, /tas-security for dev workflows.
1394
1399
  ```
1395
1400
 
1396
1401
  ---
@@ -1412,8 +1417,8 @@ Phase 0: Discovery & Design (Human-led, AI-powered)
1412
1417
  ↓ Gate: PE confirm "Ready for Development"
1413
1418
 
1414
1419
  Phase 1: Develop (Orchestrated Agentic) → Test
1415
- ├── /tas-dev-story (implement each story, TDD)
1416
- ├── /tas-review-code (auto hoặc manual)
1420
+ ├── /tas-dev (implement each story, TDD)
1421
+ ├── /tas-review (auto hoặc manual)
1417
1422
  └── /tas-bug (nếu phát sinh)
1418
1423
  ↓ Per Feature completed:
1419
1424
 
@@ -1421,7 +1426,7 @@ Phase 2: Verify (Agentic + PE Review) → Staging
1421
1426
  ├── /tas-verify (PE verify per Feature)
1422
1427
  ├── Integration test chạy trên Staging
1423
1428
  ├── PE verify acceptance criteria per Feature
1424
- └── /tas-security-check
1429
+ └── /tas-security
1425
1430
  ↓ Gate: PE approved
1426
1431
 
1427
1432
  Phase 3: Deploy with Feature Flag → Production
@@ -1459,9 +1464,9 @@ Phase 0: Discovery & Design
1459
1464
  ↓ Gate: PE confirm "Ready for Development"
1460
1465
 
1461
1466
  Phase 1: Develop → Test
1462
- ├── /tas-dev-story
1467
+ ├── /tas-dev
1463
1468
  ├── /tas-bug (bug fixes không cần full Phase 0)
1464
- └── /tas-review-code
1469
+ └── /tas-review
1465
1470
  ↓ Per Feature:
1466
1471
 
1467
1472
  Phase 2 → 3 → 4: Giống Greenfield Flow
@@ -1548,12 +1553,12 @@ parent_ado_id: 456
1548
1553
  - Tất cả templates + tas.yaml config
1549
1554
 
1550
1555
  ### Triển khai Phase 2 - Phase 1 commands (Tuần 3-4)
1551
- - tas-dev-story, tas-review-code, tas-bug
1556
+ - tas-dev, tas-review, tas-bug
1552
1557
  - Checklists: code-review, story-done
1553
1558
  - Skills: tas-conventions, tas-tdd
1554
1559
 
1555
1560
  ### Triển khai Phase 3 - Phase 2+3 commands (Tuần 5)
1556
- - tas-security-check
1561
+ - tas-security
1557
1562
  - Checklist: security
1558
1563
  - ADO integration: auto update work items
1559
1564
 
@@ -11,6 +11,7 @@ project:
11
11
 
12
12
  # Azure DevOps integration
13
13
  ado:
14
+ enabled: true # false nếu project không dùng ADO
14
15
  organization: "https://dev.azure.com/torus-bellesoft"
15
16
  project_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
16
17
 
@@ -99,7 +100,7 @@ models:
99
100
  tas-epic: sonnet
100
101
  tas-feature: sonnet
101
102
  tas-story: sonnet
102
- tas-dev-story: sonnet
103
+ tas-dev: sonnet
103
104
  tas-review-code: opus
104
105
  tas-brainstorm: opus
105
106
  tas-bug: sonnet