@torus-engineering/tas-kit 1.10.0 → 1.12.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 (162) hide show
  1. package/.tas/README.md +70 -70
  2. package/{.claude → .tas/_platform/claude-code}/settings.json +0 -12
  3. package/{.claude → .tas/_platform}/hooks/code-quality.js +1 -1
  4. package/{.claude → .tas/_platform}/hooks/session-end.js +20 -25
  5. package/.tas/commands/ado-create.md +28 -0
  6. package/.tas/commands/ado-delete.md +22 -0
  7. package/.tas/commands/ado-get.md +20 -0
  8. package/.tas/commands/ado-status.md +18 -0
  9. package/.tas/commands/ado-update.md +27 -0
  10. package/.tas/commands/tas-adr.md +33 -0
  11. package/.tas/commands/tas-apitest-plan.md +173 -0
  12. package/.tas/commands/tas-apitest.md +143 -0
  13. package/.tas/commands/tas-brainstorm.md +19 -0
  14. package/.tas/commands/tas-bug.md +113 -0
  15. package/.tas/commands/tas-design.md +37 -0
  16. package/.tas/commands/tas-dev.md +125 -0
  17. package/{.claude → .tas}/commands/tas-e2e-mobile.md +155 -155
  18. package/{.claude → .tas}/commands/tas-e2e-web.md +163 -163
  19. package/.tas/commands/tas-e2e.md +102 -0
  20. package/.tas/commands/tas-epic.md +35 -0
  21. package/.tas/commands/tas-feature.md +47 -0
  22. package/.tas/commands/tas-fix.md +51 -0
  23. package/.tas/commands/tas-functest-mobile.md +144 -0
  24. package/{.claude → .tas}/commands/tas-functest-web.md +192 -192
  25. package/.tas/commands/tas-functest.md +76 -0
  26. package/.tas/commands/tas-init.md +17 -0
  27. package/.tas/commands/tas-plan.md +198 -0
  28. package/.tas/commands/tas-prd.md +37 -0
  29. package/.tas/commands/tas-review.md +113 -0
  30. package/.tas/commands/tas-sad.md +43 -0
  31. package/.tas/commands/tas-security.md +87 -0
  32. package/.tas/commands/tas-spec.md +50 -0
  33. package/.tas/commands/tas-status.md +16 -0
  34. package/.tas/commands/tas-story.md +91 -0
  35. package/.tas/platforms.json +5 -0
  36. package/.tas/project-status-example.yaml +17 -17
  37. package/.tas/rules/ado-integration.md +65 -0
  38. package/{.claude/skills/api-design/SKILL.md → .tas/rules/common/api-design.md} +517 -530
  39. package/{.claude → .tas}/rules/common/code-review.md +30 -6
  40. package/.tas/rules/common/post-implementation-review.md +51 -0
  41. package/{.claude → .tas}/rules/common/project-status.md +80 -80
  42. package/.tas/rules/common/stack-detection.md +29 -0
  43. package/.tas/rules/common/story-done.md +30 -0
  44. package/.tas/rules/common/tdd.md +89 -0
  45. package/{.claude → .tas}/rules/common/testing.md +3 -8
  46. package/.tas/rules/common/token-logging.md +36 -0
  47. package/{.claude → .tas}/rules/csharp/api-testing.md +20 -20
  48. package/{.claude → .tas}/rules/csharp/coding-style.md +0 -2
  49. package/{.claude → .tas}/rules/csharp/security.md +10 -0
  50. package/{.claude → .tas}/rules/python/coding-style.md +0 -2
  51. package/{.claude → .tas}/rules/typescript/coding-style.md +0 -2
  52. package/.tas/rules/typescript/patterns.md +142 -0
  53. package/.tas/rules/typescript/security.md +88 -0
  54. package/{.claude → .tas}/rules/typescript/testing.md +0 -4
  55. package/{.claude → .tas}/rules/web/coding-style.md +0 -2
  56. package/.tas/tas-example.yaml +10 -11
  57. package/.tas/templates/ADR.md +47 -47
  58. package/.tas/templates/AGENTS.md +37 -0
  59. package/.tas/templates/API-Test-Spec.md +3 -3
  60. package/.tas/templates/Bug.md +67 -67
  61. package/.tas/templates/Design-Spec.md +36 -36
  62. package/.tas/templates/E2E-Execution-Report.md +1 -1
  63. package/.tas/templates/Epic.md +46 -46
  64. package/.tas/templates/Feature.md +10 -10
  65. package/.tas/templates/Func-Test-Spec.md +3 -3
  66. package/.tas/templates/SAD.md +106 -106
  67. package/.tas/templates/Security-Report.md +27 -27
  68. package/.tas/templates/Story.md +9 -9
  69. package/.tas/tools/tas-ado-readme.md +68 -68
  70. package/.tas/tools/tas-ado.py +621 -621
  71. package/README.md +78 -78
  72. package/bin/cli.js +91 -73
  73. package/lib/adapters/antigravity.js +137 -0
  74. package/lib/adapters/claude-code.js +35 -0
  75. package/lib/adapters/codex.js +163 -0
  76. package/lib/adapters/cursor.js +80 -0
  77. package/lib/adapters/index.js +20 -0
  78. package/lib/adapters/utils.js +81 -0
  79. package/lib/deleted-files.json +99 -0
  80. package/lib/install.js +403 -327
  81. package/package.json +4 -3
  82. package/.claude/agents/code-reviewer.md +0 -41
  83. package/.claude/agents/e2e-runner.md +0 -61
  84. package/.claude/agents/planner.md +0 -82
  85. package/.claude/agents/tdd-guide.md +0 -84
  86. package/.claude/commands/ado-create.md +0 -27
  87. package/.claude/commands/ado-delete.md +0 -21
  88. package/.claude/commands/ado-get.md +0 -20
  89. package/.claude/commands/ado-status.md +0 -18
  90. package/.claude/commands/ado-update.md +0 -26
  91. package/.claude/commands/tas-adr.md +0 -33
  92. package/.claude/commands/tas-apitest-plan.md +0 -173
  93. package/.claude/commands/tas-apitest.md +0 -143
  94. package/.claude/commands/tas-brainstorm.md +0 -19
  95. package/.claude/commands/tas-bug.md +0 -113
  96. package/.claude/commands/tas-design.md +0 -37
  97. package/.claude/commands/tas-dev.md +0 -128
  98. package/.claude/commands/tas-e2e.md +0 -102
  99. package/.claude/commands/tas-epic.md +0 -35
  100. package/.claude/commands/tas-feature.md +0 -47
  101. package/.claude/commands/tas-fix.md +0 -51
  102. package/.claude/commands/tas-functest-mobile.md +0 -144
  103. package/.claude/commands/tas-functest.md +0 -76
  104. package/.claude/commands/tas-init.md +0 -17
  105. package/.claude/commands/tas-plan.md +0 -200
  106. package/.claude/commands/tas-prd.md +0 -37
  107. package/.claude/commands/tas-review.md +0 -111
  108. package/.claude/commands/tas-sad.md +0 -43
  109. package/.claude/commands/tas-security.md +0 -87
  110. package/.claude/commands/tas-spec.md +0 -50
  111. package/.claude/commands/tas-status.md +0 -16
  112. package/.claude/commands/tas-story.md +0 -91
  113. package/.claude/commands/tas-verify.md +0 -51
  114. package/.claude/rules/common/post-review-agent.md +0 -49
  115. package/.claude/rules/common/stack-detection.md +0 -29
  116. package/.claude/rules/common/token-logging.md +0 -27
  117. package/.claude/rules/typescript/patterns.md +0 -62
  118. package/.claude/rules/typescript/security.md +0 -28
  119. package/.claude/settings.local.json +0 -38
  120. package/.claude/skills/ado-integration/SKILL.md +0 -75
  121. package/.claude/skills/ai-regression-testing/SKILL.md +0 -364
  122. package/.claude/skills/architecture-decision-records/SKILL.md +0 -184
  123. package/.claude/skills/benchmark/SKILL.md +0 -98
  124. package/.claude/skills/browser-qa/SKILL.md +0 -92
  125. package/.claude/skills/canary-watch/SKILL.md +0 -104
  126. package/.claude/skills/js-backend-patterns/SKILL.md +0 -603
  127. package/.claude/skills/tas-conventions/SKILL.md +0 -65
  128. package/.claude/skills/tas-implementation-complete/SKILL.md +0 -99
  129. package/.claude/skills/tas-tdd/SKILL.md +0 -123
  130. package/.claude/skills/token-logger/SKILL.md +0 -19
  131. package/.tas/checklists/code-review.md +0 -29
  132. package/.tas/checklists/security.md +0 -21
  133. package/.tas/checklists/story-done.md +0 -23
  134. package/CLAUDE-Example.md +0 -61
  135. /package/{.claude → .tas}/agents/architect.md +0 -0
  136. /package/{.claude → .tas}/agents/aws-reviewer.md +0 -0
  137. /package/{.claude → .tas}/agents/build-resolver.md +0 -0
  138. /package/{.claude → .tas}/agents/code-explorer.md +0 -0
  139. /package/{.claude → .tas}/agents/csharp-reviewer.md +0 -0
  140. /package/{.claude → .tas}/agents/database-reviewer.md +0 -0
  141. /package/{.claude → .tas}/agents/doc-updater.md +0 -0
  142. /package/{.claude → .tas}/agents/python-reviewer.md +0 -0
  143. /package/{.claude → .tas}/agents/security-reviewer.md +0 -0
  144. /package/{.claude → .tas}/agents/typescript-reviewer.md +0 -0
  145. /package/{.claude → .tas}/rules/.gitkeep +0 -0
  146. /package/{.claude → .tas}/rules/common/hooks.md +0 -0
  147. /package/{.claude → .tas}/rules/common/patterns.md +0 -0
  148. /package/{.claude → .tas}/rules/common/security.md +0 -0
  149. /package/{.claude → .tas}/rules/csharp/hooks.md +0 -0
  150. /package/{.claude → .tas}/rules/csharp/patterns.md +0 -0
  151. /package/{.claude → .tas}/rules/csharp/testing.md +0 -0
  152. /package/{.claude → .tas}/rules/python/hooks.md +0 -0
  153. /package/{.claude → .tas}/rules/python/patterns.md +0 -0
  154. /package/{.claude → .tas}/rules/python/security.md +0 -0
  155. /package/{.claude → .tas}/rules/python/testing.md +0 -0
  156. /package/{.claude → .tas}/rules/typescript/hooks.md +0 -0
  157. /package/{.claude → .tas}/rules/web/design-quality.md +0 -0
  158. /package/{.claude → .tas}/rules/web/hooks.md +0 -0
  159. /package/{.claude → .tas}/rules/web/patterns.md +0 -0
  160. /package/{.claude → .tas}/rules/web/performance.md +0 -0
  161. /package/{.claude → .tas}/rules/web/security.md +0 -0
  162. /package/{.claude → .tas}/rules/web/testing.md +0 -0
@@ -1,144 +0,0 @@
1
- # /tas-functest-mobile $ARGUMENTS
2
-
3
- Vai tro: SE / QA
4
- Generate tat ca Detox automation test scripts cho mot mobile Feature.
5
-
6
- ## QUAN TRONG - Layer 2: Mobile Functional Test Scripts
7
- - Tao Detox test scripts tu Func-Test-Spec (markdown)
8
- - Scripts nam trong `apps/mobile/e2e/features/`
9
- - Reusable helpers duoc export de Layer 3 (E2E) tai su dung
10
- - Data hardcoded trong test, credentials tu .env
11
-
12
- ## Hanh dong
13
-
14
- ### Buoc 1: Xac dinh Feature
15
- 1. $ARGUMENTS la Feature ID hoac file path
16
- 2. Neu khong co: scan `docs/epics/**/Feature-*.md` tim features co status In Progress
17
- 3. Doc Feature file de lay Epic/Feature numbers va danh sach Stories
18
-
19
- ### Buoc 2: Kiem tra Prerequisites
20
- 1. Kiem tra `apps/mobile/` ton tai. Neu khong → bao loi:
21
- > "Mobile app chua ton tai trong project nay. Vui long tao apps/mobile/ truoc."
22
- 2. Tim tat ca `Func-Test-*.md` files trong Feature directory:
23
- ```
24
- docs/epics/{epic-dir}/{feature-dir}/Func-Test-*.md
25
- ```
26
- 3. Neu khong co Func-Test-Spec nao → bao loi:
27
- > "Chua co Func-Test-Spec nao cho Feature nay. Chay /tas-functest {story-ID} truoc."
28
- 4. Doc `apps/mobile/e2e/test-ids.ts` de biet testID hien co
29
- 5. Doc `apps/mobile/e2e/helpers/data-loader.ts` va `test-utils.ts` de hieu patterns
30
-
31
- ### Buoc 3: Aggregate FT Test Cases
32
- - Tu tat ca Func-Test-Spec files, tong hop danh sach FT test cases
33
- - Nhom theo Story
34
- - Lay test data requirements tu moi spec
35
-
36
- ### Buoc 4: Generate Test Scripts
37
- Voi MOI Story co Func-Test-Spec:
38
-
39
- **File output**: `apps/mobile/e2e/features/{epic-slug}/{feature-slug}/{story-slug}.func.e2e.ts`
40
-
41
- **Structure**:
42
- ```typescript
43
- /**
44
- * Functional Tests: {Story Name}
45
- * Story: {Story_ID}
46
- * Feature: {Feature_ID}
47
- * Epic: {Epic_ID}
48
- *
49
- * Generated by /tas-functest-mobile
50
- * Spec: docs/epics/{epic-dir}/{feature-dir}/Func-Test-{story-slug}.md
51
- */
52
-
53
- import { device, element, expect, by, waitFor } from 'detox';
54
- import { TEST_IDS } from '../../../test-ids';
55
- import { loadTestData, getCredentials } from '../../../helpers/data-loader';
56
- import { login, navigateTo } from '../../../helpers/test-utils';
57
-
58
- const testData = loadTestData();
59
-
60
- describe('{Feature Name} - {Story Name}', () => {
61
- beforeAll(async () => {
62
- await device.launchApp({ newInstance: true });
63
- });
64
-
65
- beforeEach(async () => {
66
- await device.reloadReactNative();
67
- });
68
-
69
- // AC Reference: AC-1
70
- describe('{PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_001_H', () => {
71
- it('should {description from spec}', async () => {
72
- // Given: {precondition}
73
- // When: {action}
74
- // Then: {expected}
75
- });
76
- });
77
- });
78
- ```
79
-
80
- ### Buoc 5: Update test-ids.ts (neu can)
81
- - Neu test cases can testID chua co trong test-ids.ts
82
- - Them testID moi theo naming convention hien tai
83
- - Giu nguyen structure: nested object voi dot notation
84
-
85
- ### Buoc 6: Generate Feature Helpers
86
- Tao file `apps/mobile/e2e/features/{epic-slug}/{feature-slug}/helpers.ts`:
87
- ```typescript
88
- /**
89
- * Reusable helpers cho {Feature Name}
90
- * Duoc tai su dung boi Layer 3 E2E scripts
91
- */
92
-
93
- export async function {featureSpecificHelper}() {
94
- // Helper logic extracted from functional tests
95
- }
96
- ```
97
-
98
- ### Buoc 7: Update package.json Script
99
- Them hoac update script trong `apps/mobile/package.json`:
100
- ```json
101
- "functest:mobile:{feature-slug}": "detox test --configuration ios.sim.debug --testPathPattern='e2e/features/{epic-slug}/{feature-slug}'"
102
- ```
103
-
104
- ### Buoc 8: Generate Index
105
- Tao `apps/mobile/e2e/features/{epic-slug}/{feature-slug}/index.ts`:
106
- ```typescript
107
- export * from './helpers';
108
- ```
109
-
110
- ## File Structure Output
111
- ```
112
- apps/mobile/e2e/features/
113
- └── {epic-slug}/
114
- └── {feature-slug}/
115
- ├── {story-1-slug}.func.e2e.ts
116
- ├── {story-2-slug}.func.e2e.ts
117
- ├── helpers.ts
118
- └── index.ts
119
- ```
120
-
121
- ## Test Data Convention
122
- - **Hardcoded values**: Truc tiep trong test (vd: "invalid@email", "short")
123
- - **Credentials**: `const creds = getCredentials();` → password tu process.env
124
- - **Environment data**: `const testData = loadTestData();` → doc tu test-data.{env}.json
125
- - **KHONG BAO GIO** hardcode passwords/tokens trong test files
126
-
127
- ## Chay Tests
128
- ```bash
129
- # Chay tat ca func tests cho feature
130
- yarn functest:mobile:{feature-slug}
131
-
132
- # Chay chi mot story
133
- npx detox test --configuration ios.sim.debug --testPathPattern='e2e/features/{epic}/{feature}/{story}'
134
-
135
- # Chay voi Android
136
- npx detox test --configuration android.emu.debug --testPathPattern='e2e/features/{epic}/{feature}'
137
- ```
138
-
139
- ## Nguyen tac
140
- - Script PHAI chay duoc ngay tu CLI, KHONG can cua so Claude
141
- - Moi describe block dung full FT ID de grep duoc
142
- - Helpers PHAI export de Layer 3 reuse
143
- - KHONG import tu Layer 3 (flows/), chi export LEN Layer 3
144
- - Neu apps/mobile/ khong ton tai → bao loi graceful, KHONG tao
@@ -1,76 +0,0 @@
1
- # /tas-functest $ARGUMENTS
2
-
3
- Vai tro: SE / QA
4
- Generate Functional Test Specification tu mot User Story, lien ket test cases voi Acceptance Criteria (AC).
5
-
6
- ## QUAN TRONG - Layer 2: Functional Testing
7
- - Functional tests (FT) nam giua Unit tests (Layer 1) va E2E tests (Layer 3)
8
- - FT test tung chuc nang/story rieng le, KHONG test flow lien ket giua nhieu features
9
- - Moi FT case PHAI reference AC-ID de traceability
10
-
11
- ## Hanh dong
12
-
13
- ### Buoc 1: Xac dinh Story
14
- 1. $ARGUMENTS la Story ID hoac file path
15
- 2. Neu khong co $ARGUMENTS: scan `docs/epics/**/Story-*.md` tim stories co status In Progress hoac Committed
16
- 3. Doc Story file de lay:
17
- - Tat ca Acceptance Criteria (AC-1, AC-2, ...)
18
- - Epic/Feature/Story numbers (tu frontmatter hoac file path)
19
- - Platform context (mobile/web/backend)
20
- 4. Doc `root/tas.yaml` de lay project code (vd: "AL")
21
-
22
- ### Buoc 2: Auto-detect Platform
23
- Tu Story context, xac dinh platform:
24
- - **Mobile**: Keywords "screen", "navigation", "React Native", "Detox"; paths `apps/mobile/src/features/*`
25
- - **Web**: Keywords "browser", "page", "Playwright", "React"; paths `apps/web/*`
26
- - **Backend**: Keywords "API endpoint", "service", "controller"; paths `src/Torus.*`, `tests/`
27
- - Neu khong xac dinh duoc: hoi user
28
-
29
- ### Buoc 3: Generate FT Test Cases
30
- Doc template tu `.tas/templates/Func-Test-Spec.md`
31
-
32
- Naming format:
33
- ```
34
- {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_{NNN}_{MODIFIER}
35
- ```
36
-
37
- Voi moi AC, generate:
38
- - **BAT BUOC**: 1 Happy path test (H)
39
- - **NEN CO**: 1 Negative test (N) neu co error scenarios
40
- - **TUY CHON**: 1 Edge case test (E) neu co boundary conditions
41
-
42
- Moi test case PHAI co cot AC-ID trong bang mapping.
43
-
44
- ### Buoc 4: Generate Test Data Requirements
45
- - Xac dinh data can thiet cho moi test case
46
- - Data hardcoded: ghi truc tiep trong scenario
47
- - Credentials: chi reference `process.env.TEST_USER_PASSWORD`, KHONG hardcode
48
- - Data per environment: reference `test-data.{env}.json`
49
-
50
- ### Buoc 5: Output File
51
- Luu file tai:
52
- ```
53
- docs/epics/{epic-dir}/{feature-dir}/Func-Test-{story-slug}.md
54
- ```
55
-
56
- ### Buoc 6: Prompting
57
- Sau khi generate, hoi user:
58
- - "Co edge case nao can them khong?"
59
- - "Co negative test scenario nao bi bo sot khong?"
60
- - "Co test case nao can danh dau P0 Critical khong?"
61
- - "Test data va fixtures can chuan bi gi them?"
62
-
63
- ## Traceability Feature
64
- - Moi FT case gan AC-ID trong cot mapping
65
- - Khi AC thay doi: grep AC-ID trong Func-Test-*.md de biet FT nao can update
66
- - Trong test script, moi describe block co comment `// AC Reference: AC-{N}`
67
-
68
- ## Status Flow
69
- Draft → Ready → Implemented → Verified
70
-
71
- ## Nguyen tac
72
- - KHONG tao test code, chi tao specification (markdown)
73
- - Test code duoc tao boi `/tas-functest-mobile` hoac `/tas-functest-web`
74
- - Func-Test-Spec la input cho Layer 2 script generation
75
- - Moi AC phai co it nhat 1 FT case
76
- - FT dung type code `FT`, KHONG dung `E2E` hay `UT`
@@ -1,17 +0,0 @@
1
- # /tas-init
2
-
3
- Khởi tạo bộ TAS cho dự án hiện tại.
4
-
5
- ## Hành động
6
- 1. Cần context từ root/tas.yaml. Nếu chưa có, copy từ .tas/tas-example.yaml ra root và hỏi user điền thông tin cần thiết.
7
- 2. Tạo cấu trúc thư mục: .tas/templates/, .tas/checklists/, docs/, docs/adr/, docs/epics/, docs/bugs/
8
- 3. Tạo file root/project-status.yaml với trạng thái ban đầu (artifacts, epics, adrs đều rỗng).
9
- 4. Copy các template mặc định vào .tas/templates/ nếu chưa có.
10
- 5. Nếu project type là brownfield và codebase_scan_on_init = true:
11
- - Quét codebase hiện tại
12
- - Tạo file docs/codebase-overview.md tóm tắt kiến trúc hiện có
13
- 6. Hiển thị trạng thái: project type, team roles, workflow phases đang bật.
14
-
15
- ## Lưu ý
16
- - KHÔNG tạo lại file nếu đã tồn tại
17
- - Hỏi xác nhận trước khi thực hiện
@@ -1,200 +0,0 @@
1
- # /tas-plan $ARGUMENTS
2
-
3
- Vai trò: SE - Software Engineer
4
- Cầu nối giữa nghiệp vụ (Story) và kỹ thuật (code).
5
- Phân tích Story, lập kế hoạch kỹ thuật, break tasks — trước khi bắt đầu implement.
6
-
7
- **Output bắt buộc:** Technical Plan được ghi vào Story file + `plan_status: completed`.
8
-
9
- ## Always / Ask / Never
10
-
11
- | | Hành động |
12
- |---|---|
13
- | **Always** | Đọc Story file trước khi làm bất cứ điều gì |
14
- | **Always** | Chờ user approve plan trước khi ghi vào Story |
15
- | **Always** | Ghi Technical Plan vào Story file sau khi approved |
16
- | **Ask** | Khi cần tham khảo SAD/ADR — xác nhận với user trước khi đọc |
17
- | **Ask** | Khi Story scope > 8 giờ — gợi ý tách Story |
18
- | **Never** | Bắt đầu implement ở command này |
19
- | **Never** | Tự đọc SAD/ADR mà không hỏi user trước |
20
- | **Never** | Ghi plan vào Story mà chưa có approval |
21
-
22
- ## Hành động
23
-
24
- ### Bước 1 — Xác định Story
25
-
26
- `$ARGUMENTS` có thể là: Story ID (`Story-005`), file path, hoặc mô tả Story.
27
-
28
- - Nếu là Story ID: tìm file qua glob `docs/epics/**/*-Story-{ID}-*.md`
29
- - Nếu là file path: đọc trực tiếp
30
- - Nếu là mô tả: hỏi user Story ID/file cụ thể
31
- - Đọc Story file
32
-
33
- **Check re-plan:** Nếu `plan_status: completed` → hỏi user:
34
- > "Story này đã có Technical Plan rồi. Bạn muốn lập lại kế hoạch không?"
35
- Nếu user xác nhận → tiếp tục. Nếu không → dừng.
36
-
37
- ### Bước 2 — Parallel Context Gathering
38
-
39
- Launch 2 agents ĐỒNG THỜI:
40
-
41
- **Agent 1 — `code-explorer`** (luôn chạy):
42
- > Khảo sát codebase liên quan đến Story: "{Story title + tóm tắt AC}".
43
- > Tìm: entry points, files có khả năng thay đổi, existing patterns, dependencies.
44
- > Đọc tối đa 10 files liên quan nhất.
45
- > Trả về: map ngắn gọn — what exists, what needs to change, potential conflicts.
46
-
47
- **Agent 2 — `architect`** (chỉ chạy khi Story có dấu hiệu thay đổi kiến trúc:
48
- thêm service/module mới, thay đổi data flow, tích hợp external system,
49
- thay đổi database schema, thêm mới design pattern):
50
- > Đánh giá architectural implications của Story: "{Story title}".
51
- > Đọc `docs/sad.md` (nếu tồn tại) và files trong `docs/adr/`.
52
- > Đọc `.claude/rules/common/patterns.md`.
53
- > Trả về: ADR nào liên quan, patterns cần follow, rủi ro kiến trúc, constraints.
54
-
55
- Chờ TẤT CẢ agents xong, tổng hợp findings.
56
-
57
- ### Bước 3 — Hỏi về SAD/ADR (nếu chưa rõ)
58
-
59
- Sau khi xem findings từ agents, nếu cần tham khảo thêm SAD hoặc ADR cụ thể:
60
- > "Tôi cần đọc thêm [SAD / ADR-XXX] để làm rõ [lý do]. Được không?"
61
-
62
- Chỉ đọc sau khi user xác nhận.
63
-
64
- ### Bước 4 — API Design (nếu Story liên quan đến backend API)
65
-
66
- **Nếu Story có dấu hiệu thiết kế API** (thêm endpoint mới, thay đổi API contract, expose service ra ngoài):
67
- Invoke skill `api-design` để thiết kế API Spec trước khi lập plan:
68
- - URL structure, HTTP methods, status codes
69
- - Request/response payload shape
70
- - Pagination, filtering nếu cần
71
- - Error response format
72
-
73
- Gắn API Spec vào section **Technical Plan → API Contract** trong Story.
74
- Nếu Story không liên quan API → bỏ qua bước này.
75
-
76
- ### Bước 5 — Phân tích kỹ thuật
77
-
78
- Dựa trên Story + agent findings, liệt kê rõ:
79
-
80
- **Files sẽ thay đổi:**
81
- | File | Thay đổi gì | Lý do |
82
- |------|-------------|-------|
83
-
84
- **Files mới cần tạo** (nếu có):
85
- | File | Mục đích |
86
- |------|----------|
87
-
88
- **Database changes** (nếu có): migration, schema changes, seed data
89
-
90
- **Config/Infrastructure changes** (nếu có): env vars, feature flags, dependencies mới
91
-
92
- **Cần cập nhật SAD?** Yes/No + lý do ngắn gọn
93
-
94
- **Cần tạo ADR mới?** Yes/No + lý do ngắn gọn
95
-
96
- ### Bước 6 — Đề xuất approach
97
-
98
- Nếu có nhiều cách làm khả thi, liệt kê 2-3 options:
99
- ```
100
- Option A: [mô tả ngắn]
101
- + [ưu điểm]
102
- - [nhược điểm]
103
-
104
- Option B: [mô tả ngắn]
105
- + [ưu điểm]
106
- - [nhược điểm]
107
- ```
108
- Đề xuất option tốt nhất và lý do. Nếu chỉ có 1 cách → trình bày trực tiếp.
109
-
110
- ### Bước 7 — Break Tasks
111
-
112
- Breakdown thành tasks theo thứ tự implement. Mỗi task ~1-2 giờ:
113
- ```
114
- - [ ] Task 1: [hành động cụ thể — file nào, thay đổi gì]
115
- - [ ] Task 2: [hành động cụ thể]
116
- - [ ] Task 3: Viết unit tests cho [AC-1, AC-2...]
117
- - [ ] Task 4: [nếu cần] Tạo ADR / cập nhật SAD
118
- ```
119
-
120
- Nếu tổng estimate > 8 giờ → gợi ý tách Story trước khi tiếp tục.
121
-
122
- ### Bước 8 — Chờ approval
123
-
124
- **DỪNG LẠI.** Hiển thị toàn bộ plan và hỏi:
125
- > "Technical Plan trên có OK không? Muốn điều chỉnh gì không?"
126
-
127
- - Nếu user approve → Bước 9
128
- - Nếu user có feedback → cập nhật plan, hỏi lại
129
- - KHÔNG ghi gì vào Story trước khi có approval
130
-
131
- ### Bước 9 — Ghi Technical Plan vào Story
132
-
133
- Sau khi approved, cập nhật Story file:
134
-
135
- **1. Thêm section `## Technical Plan`** vào Story (thay thế comment placeholder):
136
-
137
- ```markdown
138
- ## Technical Plan
139
- > **Plan by:** {SE name} | **Date:** {ngày hiện tại}
140
-
141
- ### Approach
142
- {Mô tả ngắn về approach đã chọn và lý do}
143
-
144
- ### Files to Change
145
- | File | Change | Reason |
146
- |------|--------|--------|
147
-
148
- ### Files to Create
149
- | File | Purpose |
150
- |------|---------|
151
-
152
- ### Database Changes
153
- {Nếu không có: "None"}
154
-
155
- ### Config Changes
156
- {Nếu không có: "None"}
157
-
158
- ### Architecture Notes
159
- - SAD update needed: Yes/No
160
- - New ADR needed: Yes/No — {tiêu đề nếu Yes}
161
-
162
- ### Tasks
163
- - [ ] Task 1: ...
164
- - [ ] Task 2: ...
165
- - [ ] Task 3: Viết unit tests
166
- ```
167
-
168
- **2. Cập nhật frontmatter:**
169
- - `plan_status: completed`
170
- - `plan_date: {ngày giờ hiện tại}`
171
-
172
- **3. Cập nhật `project-status.yaml`:**
173
- - `last_updated: {ngày hiện tại}`
174
- - `epics.{EPIC_ID}.features.{FEATURE_ID}.stories.{STORY_ID}.plan_status: completed`
175
-
176
- **4. Nếu cần ADR:** chạy `/tas-adr "{Tiêu đề quyết định}"` ngay sau khi ghi plan xong.
177
-
178
- ### Bước 10 — Thông báo next step
179
- > "Technical Plan đã ghi vào Story. SE có thể bắt đầu implement với `/tas-dev {Story-ID}`."
180
-
181
- ---
182
-
183
- ## Quick Mode (require_plan: false trong tas.yaml)
184
-
185
- Dành cho: solo dev, prototype, spike, hotfix khẩn.
186
-
187
- - `/tas-dev` sẽ KHÔNG bắt buộc chạy `/tas-plan` trước
188
- - `/tas-plan` vẫn có thể chạy tự nguyện khi Story phức tạp
189
- - Trade-off: tốc độ cao hơn, traceability thấp hơn
190
-
191
- ## Nguyên tắc
192
- - Technical Plan sống trong Story file — không tạo file plan riêng
193
- - Mỗi task ~1-2 giờ; cả Story ~4-8 giờ
194
- - Nếu estimate > 8 giờ → tách Story
195
- - Nếu task ảnh hưởng architecture → suggest ADR
196
- - Giữ plan ngắn gọn, actionable — không viết essay
197
-
198
- ## Bước cuối — Token Log
199
-
200
- Invoke skill `token-logger`: ghi AI Usage Log vào file Story đang làm việc.
@@ -1,37 +0,0 @@
1
- # /tas-prd $ARGUMENTS
2
-
3
- Vai trò: PE - Product Engineer
4
- Tạo hoặc cập nhật Product Requirements Document.
5
-
6
- ## Hành động
7
- 1. Cần context từ root/tas.yaml để lấy project context
8
- 2. Kiểm tra docs/prd.md đã tồn tại chưa:
9
-
10
- ### Chế độ CREATE (file chưa tồn tại):
11
- 3. Cần context từ .tas/templates/PRD.md
12
- 4. Nếu $ARGUMENTS có nội dung, dùng làm input mô tả sản phẩm
13
- 5. Nếu không có $ARGUMENTS, hỏi user:
14
- - Sản phẩm giải quyết vấn đề gì?
15
- - Đối tượng người dùng chính?
16
- - Các tính năng cốt lõi?
17
- - Ràng buộc kỹ thuật/kinh doanh?
18
- 6. Tạo file docs/prd.md theo template
19
- 7. Cập nhật `project-status.yaml` theo `.claude/rules/common/project-status.md` — thêm `artifacts.prd`.
20
-
21
- ### Chế độ UPDATE (file đã tồn tại):
22
- 3. Cần context từ docs/prd.md hiện tại
23
- 4. $ARGUMENTS là mô tả thay đổi. Nếu không có, hỏi user cần cập nhật section nào.
24
- 5. Cập nhật file, giữ nguyên các section không thay đổi
25
- 6. Thêm dòng vào section Changelog cuối file: ngày, mô tả thay đổi
26
- 7. Cập nhật `project-status.yaml` theo `.claude/rules/common/project-status.md` — cập nhật `artifacts.prd`.
27
-
28
- ## Nguyên tắc
29
- - Viết ở mức đủ chi tiết để SE có thể hiểu và thiết kế kiến trúc
30
- - Phân loại requirements theo MoSCoW: Must/Should/Could/Won't
31
- - Mỗi requirement có ID duy nhất: FR-001, NFR-001
32
- - Luôn có section Non-Goals để giới hạn scope
33
- - Sơ đồ Mermaid phải dùng :::mermaid wrapper, KHÔNG dùng ký tự ()
34
-
35
- ## Bước cuối — Token Log
36
-
37
- Invoke skill `token-logger`: ghi AI Usage Log vào `docs/prd.md`.
@@ -1,111 +0,0 @@
1
- # /tas-review $ARGUMENTS
2
-
3
- Review code thay đổi gần nhất hoặc một file/PR cụ thể.
4
- Bao gồm hygiene scan, test run, và parallel multi-agent review.
5
-
6
- ## Stack Detection
7
- Đọc `.claude/rules/common/stack-detection.md`.
8
-
9
- ## Hành động
10
-
11
- ### Bước 1 — Xác định scope review
12
- `$ARGUMENTS` có thể là: file path, Story ID, hoặc để trống (review git diff).
13
- - Nếu trống: lấy `git diff HEAD` (staged + unstaged) hoặc last commit
14
- - Nếu Story ID: tìm file Story tương ứng để lấy danh sách files đã thay đổi
15
- - Nếu file path: review trực tiếp file đó
16
-
17
- ### Bước 2 — Pre-checks (PHẢI pass mới tiếp tục)
18
-
19
- **Hygiene scan** — scan nhanh các files trong scope:
20
- - Debug code còn sót: `console.log`, `print(`, `Debug.WriteLine`, `debugger`
21
- - Secrets hardcoded: password/key/token/secret gán bằng string literal
22
- - Commented-out code block lớn (>5 dòng) không có comment lý do
23
-
24
- → Nếu có blocker: liệt kê ngay, yêu cầu fix trước khi tiếp tục.
25
-
26
- **Run tests** — detect từ project structure:
27
- - `package.json` → `yarn test --ci` hoặc `npm test`
28
- - `*.csproj` / `*.sln` → `dotnet test`
29
- - `pytest.ini` / `pyproject.toml` → `python -m pytest`
30
-
31
- → Nếu **FAIL**: thêm finding **"Unit Test Failure"** severity **Critical**, dừng lại, KHÔNG tiếp tục review.
32
- → Nếu **PASS**: ghi chú "Unit Tests: ✓ PASS" vào Review Summary.
33
- → Nếu không detect được: ghi chú "No test runner detected" và tiếp tục.
34
-
35
- ### Bước 3 — Parallel Multi-Agent Review
36
-
37
- Launch các agents ĐỒNG THỜI (không chờ nhau):
38
-
39
- **Agent 1 — `code-reviewer`** (luôn chạy):
40
- > Review [scope]. Đọc `.tas/checklists/code-review.md` và `.claude/rules/common/code-review.md`.
41
- > Tập trung: naming, architecture alignment, error handling, DRY, function size, nesting depth.
42
- > Format: findings nhóm theo Critical / High / Medium / Low, mỗi finding có file:line và fix cụ thể.
43
-
44
- **Agent 2 — `security-reviewer`** (luôn chạy):
45
- > Security audit [scope]. Đọc `.claude/rules/common/security.md`.
46
- > Nếu stack đã xác định, đọc thêm `.claude/rules/[stack]/security.md`.
47
- > Tập trung: OWASP Top 10, injection, hardcoded secrets, auth/authz, data exposure.
48
- > Format: findings nhóm theo Critical / High / Medium / Low, mỗi finding có file:line và remediation.
49
-
50
- **Agent 3 — Language reviewer** (dựa theo `lang_agent` từ stack detection):
51
- > Language-specific review [scope].
52
- > Đọc `.claude/rules/[stack]/coding-style.md`, `.claude/rules/[stack]/patterns.md`, `.claude/rules/[stack]/testing.md`.
53
- > Nếu stack có React: đọc thêm `.claude/rules/web/design-quality.md`, `.claude/rules/web/testing.md`, `.claude/rules/web/performance.md`.
54
- > Tập trung: async/await patterns, null handling, type safety, anti-patterns đặc thù của stack.
55
- > Format: findings theo Critical / High / Medium / Low với file:line.
56
-
57
- **Agent 4 — `aws-reviewer`** (chỉ khi `infra_agent = aws-reviewer`):
58
- > AWS infrastructure review [scope].
59
- > Tập trung: IAM policies, secrets trong env/config, S3 permissions, Lambda security.
60
- > Format: findings theo Critical / High / Medium / Low.
61
-
62
- Chờ TẤT CẢ agents hoàn thành, sau đó tổng hợp.
63
-
64
- ### Bước 4 — Tổng hợp kết quả
65
-
66
- Gộp findings từ tất cả agents, deduplicate (cùng file:line từ nhiều agent → gộp lại), sort theo severity:
67
-
68
- ```
69
- ## Review Summary
70
-
71
- ### Critical (phải fix trước khi merge)
72
- - [file:line] Issue — Fix: ...
73
-
74
- ### High (nên fix trước khi merge)
75
- - [file:line] Issue — Fix: ...
76
-
77
- ### Medium (cân nhắc fix)
78
- - [file:line] Issue — Fix: ...
79
-
80
- ### Low / Info (optional)
81
- - [file:line] Issue — Fix: ...
82
- ```
83
-
84
- ## Sau khi review
85
-
86
- **Nếu có Critical/High:**
87
- → Liệt kê rõ, yêu cầu human fix. KHÔNG tiếp tục flow.
88
-
89
- **Nếu chỉ có Medium/Low:**
90
- → List gợi ý, hỏi human có muốn fix không, sau đó tiếp tục.
91
-
92
- **Khi human xác nhận đã fix:**
93
- 1. Tick `- [x] Code review passed` trong section `## Definition of Done` của Story
94
- 2. Hỏi: "Bạn đã tự test lại ở local chưa? Nếu OK, có muốn chuyển ticket sang Deploy Test không?"
95
- 3. Nếu Yes:
96
- a. Cập nhật `Status:` trong Story → `Deploy Test`
97
- b. Thêm dòng Changelog trong Story: ngày, "Code review passed, moved to Deploy Test"
98
- c. Cập nhật `Status:` trong Feature cha → `In Progress`, update bảng Stories
99
- d. Thêm Changelog trong Feature
100
- e. Cập nhật `project-status.yaml`
101
- f. Gợi ý: chạy `/ado-update story <ado-id> --status "Deploy Test"` nếu dùng ADO
102
-
103
- ## Nguyên tắc
104
- - Review khách quan — chỉ ra file:line cụ thể và lý do
105
- - Đề xuất fix cụ thể, không chỉ nói "code xấu"
106
- - Check xem code có vi phạm ADR nào không (đọc từ Technical Notes trong Story)
107
- - KHÔNG tự động chuyển status mà không có xác nhận của human
108
-
109
- ## Bước cuối — Token Log
110
-
111
- Invoke skill `token-logger`: ghi AI Usage Log vào file Story đang review (nếu có).
@@ -1,43 +0,0 @@
1
- # /tas-sad $ARGUMENTS
2
-
3
- Vai trò: SE - Software Engineer
4
- Tạo hoặc cập nhật Solution Architecture Document.
5
-
6
- ## Prerequisite
7
- - docs/prd.md phải tồn tại. Nếu chưa có, thông báo user chạy /tas-prd trước.
8
-
9
- ## Hành động
10
- 1. Cần context từ root/tas.yaml để lấy project info, workflow config
11
- 2. Cần context từ docs/prd.md để hiểu requirements
12
- 3. Nếu brownfield: cần context từ docs/codebase-overview.md nếu có
13
- 4. Kiểm tra docs/sad.md đã tồn tại chưa:
14
-
15
- ### Chế độ CREATE (file chưa tồn tại):
16
- 5. Cần context từ .tas/templates/SAD.md
17
- 6. Tạo file docs/sad.md theo template SAD của Torus
18
- 7. Cập nhật `project-status.yaml` theo `.claude/rules/common/project-status.md` — thêm `artifacts.sad`.
19
-
20
- ### Chế độ UPDATE (file đã tồn tại):
21
- 5. Cần context từ docs/sad.md hiện tại
22
- 6. $ARGUMENTS là mô tả thay đổi. Nếu không có, hỏi user cần cập nhật section nào.
23
- 7. Cập nhật file, giữ nguyên các section không thay đổi
24
- 8. Thêm dòng vào section Changelog cuối file
25
- 9. Nếu thay đổi là quyết định kiến trúc quan trọng, gợi ý user chạy /tas-adr
26
- 10. Cập nhật `project-status.yaml` theo `.claude/rules/common/project-status.md` — cập nhật `artifacts.sad`.
27
-
28
- ## Quy tắc Mermaid
29
- - Các sơ đồ C4 PHẢI dùng Mermaid flow diagram
30
- - Bắt đầu bằng :::mermaid, kết thúc bằng :::
31
- - KHÔNG dùng ký tự () trong node labels, thay bằng []
32
- - Ví dụ: A["Web App"] --> B["API Gateway"]
33
- - Bao gồm các view: System Context, Container, Component, Data, Deployment
34
-
35
- ## Nguyên tắc
36
- - SAD phải align với tech stack trong CLAUDE.md
37
- - Mỗi architectural decision quan trọng cần reference sang ADR
38
- - ERD phải dùng Mermaid erDiagram
39
- - Sequence diagram dùng Mermaid sequenceDiagram
40
-
41
- ## Bước cuối — Token Log
42
-
43
- Invoke skill `token-logger`: ghi AI Usage Log vào `docs/sad.md`.