@torus-engineering/tas-kit 1.9.0 → 1.11.1

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 (68) hide show
  1. package/.claude/commands/ado-create.md +17 -17
  2. package/.claude/commands/ado-delete.md +11 -11
  3. package/.claude/commands/ado-get.md +12 -12
  4. package/.claude/commands/ado-status.md +12 -12
  5. package/.claude/commands/ado-update.md +15 -15
  6. package/.claude/commands/tas-adr.md +33 -33
  7. package/.claude/commands/tas-apitest-plan.md +173 -173
  8. package/.claude/commands/tas-apitest.md +143 -143
  9. package/.claude/commands/tas-brainstorm.md +14 -14
  10. package/.claude/commands/tas-bug.md +113 -113
  11. package/.claude/commands/tas-design.md +37 -37
  12. package/.claude/commands/tas-dev.md +128 -128
  13. package/.claude/commands/tas-e2e-mobile.md +155 -155
  14. package/.claude/commands/tas-e2e-web.md +163 -163
  15. package/.claude/commands/tas-e2e.md +102 -102
  16. package/.claude/commands/tas-epic.md +35 -35
  17. package/.claude/commands/tas-feature.md +47 -47
  18. package/.claude/commands/tas-fix.md +51 -51
  19. package/.claude/commands/tas-functest-mobile.md +144 -144
  20. package/.claude/commands/tas-functest-web.md +192 -192
  21. package/.claude/commands/tas-functest.md +76 -76
  22. package/.claude/commands/tas-init.md +14 -14
  23. package/.claude/commands/tas-plan.md +198 -200
  24. package/.claude/commands/tas-prd.md +37 -37
  25. package/.claude/commands/tas-review.md +111 -111
  26. package/.claude/commands/tas-sad.md +43 -43
  27. package/.claude/commands/tas-security.md +87 -81
  28. package/.claude/commands/tas-spec.md +20 -20
  29. package/.claude/commands/tas-status.md +13 -13
  30. package/.claude/commands/tas-story.md +91 -91
  31. package/.claude/commands/tas-verify.md +51 -51
  32. package/.claude/rules/common/post-review-agent.md +49 -49
  33. package/.claude/rules/common/project-status.md +14 -14
  34. package/.claude/rules/common/stack-detection.md +6 -6
  35. package/.claude/rules/common/token-logging.md +27 -27
  36. package/.claude/rules/csharp/api-testing.md +171 -171
  37. package/.claude/skills/ado-integration/SKILL.md +36 -36
  38. package/.claude/skills/tas-conventions/SKILL.md +32 -32
  39. package/.claude/skills/tas-implementation-complete/SKILL.md +100 -99
  40. package/.claude/skills/tas-tdd/SKILL.md +123 -123
  41. package/.claude/skills/token-logger/SKILL.md +19 -19
  42. package/.tas/README.md +266 -1520
  43. package/.tas/checklists/code-review.md +13 -13
  44. package/.tas/checklists/security.md +3 -3
  45. package/.tas/checklists/story-done.md +11 -11
  46. package/.tas/hooks/README.md +138 -0
  47. package/.tas/hooks/pre-commit +26 -0
  48. package/.tas/hooks/security-scan.js +599 -0
  49. package/.tas/project-status-example.yaml +3 -3
  50. package/.tas/tas-example.yaml +25 -8
  51. package/.tas/templates/ADR.md +16 -16
  52. package/.tas/templates/API-Test-Spec.md +3 -3
  53. package/.tas/templates/Bug.md +12 -12
  54. package/.tas/templates/Design-Spec.md +8 -8
  55. package/.tas/templates/E2E-Execution-Report.md +1 -1
  56. package/.tas/templates/Epic.md +1 -1
  57. package/.tas/templates/Feature.md +10 -10
  58. package/.tas/templates/Func-Test-Spec.md +3 -3
  59. package/.tas/templates/SAD.md +106 -106
  60. package/.tas/templates/Security-Report.md +3 -3
  61. package/.tas/templates/Story.md +9 -9
  62. package/.tas/tools/tas-ado-readme.md +169 -169
  63. package/.tas/tools/tas-ado.py +1 -1
  64. package/CLAUDE-Example.md +37 -58
  65. package/README.md +294 -42
  66. package/bin/cli.js +24 -7
  67. package/lib/install.js +161 -47
  68. package/package.json +1 -1
@@ -1,111 +1,111 @@
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, 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` 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 comment lý do
23
-
24
- Nếu 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" 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` `.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 file:line 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 file:line 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 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 agentgộ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 Critical/High:**
87
- Liệt rõ, yêu cầu human fix. KHÔNG tiếp tục flow.
88
-
89
- **Nếu chỉ Medium/Low:**
90
- → List gợi ý, hỏi human 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, 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 vi phạm ADR nào không (đọc từ Technical Notes trong Story)
107
- - KHÔNG tự động chuyển status 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 ).
1
+ # /tas-review $ARGUMENTS
2
+
3
+ Review recently changed code or a specific file/PR.
4
+ Includes hygiene scan, test run, and parallel multi-agent review.
5
+
6
+ ## Stack Detection
7
+ Read `.claude/rules/common/stack-detection.md`.
8
+
9
+ ## Actions
10
+
11
+ ### Step 1 — Determine review scope
12
+ `$ARGUMENTS` can be: file path, Story ID, or empty (review git diff).
13
+ - If empty: get `git diff HEAD` (staged + unstaged) or last commit
14
+ - If Story ID: find corresponding Story file to get changed files list
15
+ - If file path: review that file directly
16
+
17
+ ### Step 2 — Pre-checks (MUST pass before continuing)
18
+
19
+ **Hygiene scan** — quick scan of files in scope:
20
+ - Debug code leftovers: `console.log`, `print(`, `Debug.WriteLine`, `debugger`
21
+ - Hardcoded secrets: password/key/token/secret assigned as string literal
22
+ - Large commented-out code blocks (>5 lines) without reason comment
23
+
24
+ If blockers found: list immediately, require fix before continuing.
25
+
26
+ **Run tests** — detect from project structure:
27
+ - `package.json` → `yarn test --ci` or `npm test`
28
+ - `*.csproj` / `*.sln` → `dotnet test`
29
+ - `pytest.ini` / `pyproject.toml` → `python -m pytest`
30
+
31
+ If **FAIL**: add finding **"Unit Test Failure"** severity **Critical**, stop, DO NOT continue review.
32
+ If **PASS**: note "Unit Tests: ✓ PASS" in Review Summary.
33
+ If cannot detect: note "No test runner detected" and continue.
34
+
35
+ ### Step 3 — Parallel Multi-Agent Review
36
+
37
+ Launch agents SIMULTANEOUSLY (don't wait for each other):
38
+
39
+ **Agent 1 — `code-reviewer`** (always run):
40
+ > Review [scope]. Read `.tas/checklists/code-review.md` and `.claude/rules/common/code-review.md`.
41
+ > Focus: naming, architecture alignment, error handling, DRY, function size, nesting depth.
42
+ > Format: findings grouped by Critical / High / Medium / Low, each with file:line and specific fix.
43
+
44
+ **Agent 2 — `security-reviewer`** (always run):
45
+ > Security audit [scope]. Read `.claude/rules/common/security.md`.
46
+ > If stack identified, also read `.claude/rules/[stack]/security.md`.
47
+ > Focus: OWASP Top 10, injection, hardcoded secrets, auth/authz, data exposure.
48
+ > Format: findings grouped by Critical / High / Medium / Low, each with file:line and remediation.
49
+
50
+ **Agent 3 — Language reviewer** (per `lang_agent` from stack detection):
51
+ > Language-specific review [scope].
52
+ > Read `.claude/rules/[stack]/coding-style.md`, `.claude/rules/[stack]/patterns.md`, `.claude/rules/[stack]/testing.md`.
53
+ > If stack has React: also read `.claude/rules/web/design-quality.md`, `.claude/rules/web/testing.md`, `.claude/rules/web/performance.md`.
54
+ > Focus: async/await patterns, null handling, type safety, stack-specific anti-patterns.
55
+ > Format: findings by Critical / High / Medium / Low with file:line.
56
+
57
+ **Agent 4 — `aws-reviewer`** (only when `infra_agent = aws-reviewer`):
58
+ > AWS infrastructure review [scope].
59
+ > Focus: IAM policies, secrets in env/config, S3 permissions, Lambda security.
60
+ > Format: findings by Critical / High / Medium / Low.
61
+
62
+ Wait for ALL agents to complete, then synthesize.
63
+
64
+ ### Step 4 — Synthesize results
65
+
66
+ Combine findings from all agents, deduplicate (same file:line from multiple agentsmerge), sort by severity:
67
+
68
+ ```
69
+ ## Review Summary
70
+
71
+ ### Critical (must fix before merge)
72
+ - [file:line] Issue — Fix: ...
73
+
74
+ ### High (should fix before merge)
75
+ - [file:line] Issue — Fix: ...
76
+
77
+ ### Medium (consider fixing)
78
+ - [file:line] Issue — Fix: ...
79
+
80
+ ### Low / Info (optional)
81
+ - [file:line] Issue — Fix: ...
82
+ ```
83
+
84
+ ## After review
85
+
86
+ **If Critical/High present:**
87
+ List clearly, require human fix. DO NOT continue flow.
88
+
89
+ **If only Medium/Low:**
90
+ → List suggestions, ask if human wants to fix, then continue.
91
+
92
+ **When human confirms fixed:**
93
+ 1. Tick `- [x] Code review passed` in Story's `## Definition of Done` section
94
+ 2. Ask: "Have you tested locally again? If OK, want to move ticket to Deploy Test?"
95
+ 3. If Yes:
96
+ a. Update Story `Status:` → `Deploy Test`
97
+ b. Add Changelog line in Story: date, "Code review passed, moved to Deploy Test"
98
+ c. Update parent Feature `Status:` → `In Progress`, update Stories table
99
+ d. Add Changelog in Feature
100
+ e. Update `project-status.yaml`
101
+ f. Suggest: run `/ado-update story <ado-id> --status "Deploy Test"` if using ADO
102
+
103
+ ## Principles
104
+ - Objective reviewpoint to specific file:line and reason
105
+ - Propose specific fix, don't just say "code is bad"
106
+ - Check if code violates any ADR (read from Story's Technical Notes)
107
+ - DO NOT auto-change status without human confirmation
108
+
109
+ ## Final Step — Token Log
110
+
111
+ Invoke skill `token-logger`: write AI Usage Log to Story file being reviewed (if any).
@@ -1,43 +1,43 @@
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
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 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 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 đồ 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 tự () trong node labels, thay bằng []
32
- - 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`.
1
+ # /tas-sad $ARGUMENTS
2
+
3
+ Role: SE - Software Engineer
4
+ Create or update Solution Architecture Document.
5
+
6
+ ## Prerequisite
7
+ - docs/prd.md must exist. If not, notify user to run /tas-prd first.
8
+
9
+ ## Actions
10
+ 1. Need context from root/tas.yaml for project info, workflow config
11
+ 2. Need context from docs/prd.md to understand requirements
12
+ 3. If brownfield: need context from docs/codebase-overview.md if available
13
+ 4. Check if docs/sad.md already exists:
14
+
15
+ ### CREATE mode (file doesn't exist):
16
+ 5. Need context from .tas/templates/SAD.md
17
+ 6. Create file docs/sad.md per Torus SAD template
18
+ 7. Update `project-status.yaml` per `.claude/rules/common/project-status.md` — add `artifacts.sad`.
19
+
20
+ ### UPDATE mode (file exists):
21
+ 5. Need context from current docs/sad.md
22
+ 6. $ARGUMENTS is change description. If not provided, ask user which section to update.
23
+ 7. Update file, keep unchanged sections as-is
24
+ 8. Add line to Changelog section at end
25
+ 9. If change is important architectural decision, suggest user run /tas-adr
26
+ 10. Update `project-status.yaml` per `.claude/rules/common/project-status.md` — update `artifacts.sad`.
27
+
28
+ ## Mermaid Rules
29
+ - C4 diagrams MUST use Mermaid flow diagram
30
+ - Start with :::mermaid, end with :::
31
+ - DO NOT use () in node labels, use [] instead
32
+ - Example: A["Web App"] --> B["API Gateway"]
33
+ - Include views: System Context, Container, Component, Data, Deployment
34
+
35
+ ## Principles
36
+ - SAD must align with tech stack in CLAUDE.md
37
+ - Each important architectural decision should reference ADR
38
+ - ERD must use Mermaid erDiagram
39
+ - Sequence diagram uses Mermaid sequenceDiagram
40
+
41
+ ## Final Step — Token Log
42
+
43
+ Invoke skill `token-logger`: write AI Usage Log to `docs/sad.md`.
@@ -1,81 +1,87 @@
1
- # /tas-security $ARGUMENTS
2
-
3
- Kiểm tra bảo mật codebase, lưu báo cáo vào docs/security-report.md.
4
-
5
- ## Stack Detection
6
- Đọc `.claude/rules/common/stack-detection.md`.
7
-
8
- ## Hành động
9
-
10
- ### Bước 1 — Xác định scope
11
- `$ARGUMENTS` thể là: file path, directory, hoặc để trống (scan toàn bộ codebase).
12
- Đọc `.tas/checklists/security.md` để lấy checklist.
13
-
14
- ### Bước 2 Parallel Security Scan
15
-
16
- Launch các agents ĐỒNG THỜI dựa theo stack:
17
-
18
- **Agent 1 — `security-reviewer`** (luôn chạy):
19
- > Security audit [scope].
20
- > Đọc `.claude/rules/common/security.md`.
21
- > Nếu stack đã xác định, đọc thêm `.claude/rules/[stack]/security.md`.
22
- > Kiểm tra OWASP Top 10: injection, broken auth, XSS, IDOR, security misconfiguration,
23
- > sensitive data exposure, insecure deserialization, vulnerable components, logging/monitoring.
24
- > Kiểm tra thêm: hardcoded secrets, CORS config, anti-forgery tokens, rate limiting.
25
- > Format: findings theo Critical / High / Medium / Low với file:line và remediation cụ thể.
26
- > Mỗi finding có: status = Open.
27
-
28
- **Agent 2 `database-reviewer`** (chỉ khi `db_agent = database-reviewer`):
29
- > Database security review [scope].
30
- > Tập trung: parameterized queries vs string concatenation, ORM raw query usage,
31
- > sensitive data stored in plaintext, missing field-level encryption, excessive permissions.
32
- > Format: findings theo Critical / High / Medium / Low với file:line và remediation.
33
-
34
- **Agent 3 — `aws-reviewer`** (chỉ khi `infra_agent = aws-reviewer`):
35
- > AWS infrastructure security review [scope].
36
- > Tập trung: IAM overpermission, S3 public access, secrets trong env/config/code,
37
- > Lambda environment variables, API Gateway auth, VPC security groups.
38
- > Format: findings theo Critical / High / Medium / Low với file:line remediation.
39
-
40
- Chờ TẤT CẢ agents hoàn thành.
41
-
42
- ### Bước 3 Tổng hợp lưu báo cáo
43
-
44
- Gộp findings từ tất cả agents, deduplicate (cùng file:line gộp), sort theo severity.
45
-
46
- Kiểm tra `docs/security-report.md`:
47
- - **Chưa có**: tạo mới theo template `.tas/templates/Security-Report.md`
48
- - **Đã có**: append report mới, cập nhật status findings cũ nếu đã được fix
49
-
50
- Nội dung report bao gồm:
51
- - Scan date, scope, stack
52
- - Findings theo Critical / High / Medium / Low
53
- - Mỗi finding: file:line, mô tả, remediation, status (Open / Fixed / Accepted Risk)
54
- - Summary: tổng số findings mỗi severity, số đã fix vs còn open
55
-
56
- ### Bước 4 — Cập nhật project-status.yaml
57
-
58
- ```yaml
59
- artifacts:
60
- security_report:
61
- file: docs/security-report.md
62
- status: [Critical findings present | Clean]
63
- last_updated: [ngày hôm nay]
64
- ```
65
-
66
- ### Bước 5 — Hành động tiếp theo
67
-
68
- Nếu có **Critical findings**:
69
- Liệt kê rõ, yêu cầu fix ngay trước khi deploy bất kỳ môi trường nào.
70
-
71
- Nếu có **High findings**:
72
- Liệt kê, khuyến nghị fix trước khi merge vào main.
73
-
74
- Nếu chỉ có **Medium/Low**:
75
- Tóm tắt, gợi ý fix theo thứ tự ưu tiên.
76
-
77
- ## Nguyên tắc
78
- - Phân loại: Critical / High / Medium / Low
79
- - Mỗi finding phải có recommended fix cụ thể
80
- - Finding có status: Open | In Progress | Fixed | Accepted Risk
81
- - KHÔNG hardcode fix — đề xuất remediation pattern, không viết code thay thế
1
+ # /tas-security $ARGUMENTS
2
+
3
+ Check codebase security, save report to docs/security-report.md.
4
+
5
+ ## Stack Detection
6
+ Read `.claude/rules/common/stack-detection.md`.
7
+
8
+ ## Actions
9
+
10
+ ### Step 1 — Determine scope
11
+ `$ARGUMENTS` can be:
12
+ - File path or directory → scan specified scope only
13
+ - Empty → scan entire codebase
14
+ - `--staged` only scan staged files (like pre-commit hook), fast + used to self-test before commit
15
+
16
+ With `--staged`: get list from `git diff --cached --name-only --diff-filter=ACM` and only review those files. Use same regex patterns as `.tas/hooks/security-scan.js` then supplement with deep review by agents below.
17
+
18
+ Read `.tas/checklists/security.md` for checklist.
19
+
20
+ ### Step 2 — Parallel Security Scan
21
+
22
+ Launch agents SIMULTANEOUSLY based on stack:
23
+
24
+ **Agent 1 `security-reviewer`** (always run):
25
+ > Security audit [scope].
26
+ > Read `.claude/rules/common/security.md`.
27
+ > If stack identified, also read `.claude/rules/[stack]/security.md`.
28
+ > Check OWASP Top 10: injection, broken auth, XSS, IDOR, security misconfiguration,
29
+ > sensitive data exposure, insecure deserialization, vulnerable components, logging/monitoring.
30
+ > Also check: hardcoded secrets, CORS config, anti-forgery tokens, rate limiting.
31
+ > Format: findings by Critical / High / Medium / Low with file:line and specific remediation.
32
+ > Each finding has: status = Open.
33
+
34
+ **Agent 2 — `database-reviewer`** (only when `db_agent = database-reviewer`):
35
+ > Database security review [scope].
36
+ > Focus: parameterized queries vs string concatenation, ORM raw query usage,
37
+ > sensitive data stored in plaintext, missing field-level encryption, excessive permissions.
38
+ > Format: findings by Critical / High / Medium / Low with file:line and remediation.
39
+
40
+ **Agent 3 `aws-reviewer`** (only when `infra_agent = aws-reviewer`):
41
+ > AWS infrastructure security review [scope].
42
+ > Focus: IAM overpermission, S3 public access, secrets in env/config/code,
43
+ > Lambda environment variables, API Gateway auth, VPC security groups.
44
+ > Format: findings by Critical / High / Medium / Low with file:line and remediation.
45
+
46
+ Wait for ALL agents to complete.
47
+
48
+ ### Step 3 Synthesize and save report
49
+
50
+ Combine findings from all agents, deduplicate (same file:line → merge), sort by severity.
51
+
52
+ Check `docs/security-report.md`:
53
+ - **Doesn't exist**: create new per template `.tas/templates/Security-Report.md`
54
+ - **Exists**: append new report, update old findings status if fixed
55
+
56
+ Report content includes:
57
+ - Scan date, scope, stack
58
+ - Findings by Critical / High / Medium / Low
59
+ - Each finding: file:line, description, remediation, status (Open / Fixed / Accepted Risk)
60
+ - Summary: total findings per severity, fixed vs open counts
61
+
62
+ ### Step 4 Update project-status.yaml
63
+
64
+ ```yaml
65
+ artifacts:
66
+ security_report:
67
+ file: docs/security-report.md
68
+ status: [Critical findings present | Clean]
69
+ last_updated: [today's date]
70
+ ```
71
+
72
+ ### Step 5 Next actions
73
+
74
+ If **Critical findings**:
75
+ List clearly, require fix immediately before deploying to any environment.
76
+
77
+ If **High findings**:
78
+ List, recommend fixing before merging to main.
79
+
80
+ If only **Medium/Low**:
81
+ Summarize, suggest fixing in priority order.
82
+
83
+ ## Principles
84
+ - Classification: Critical / High / Medium / Low
85
+ - Each finding must have specific recommended fix
86
+ - Finding has status: Open | In Progress | Fixed | Accepted Risk
87
+ - DO NOT hardcode fix — propose remediation pattern, don't write replacement code
@@ -1,20 +1,20 @@
1
1
  # /tas-spec $ARGUMENTS
2
2
 
3
- Tạo lightweight spec trước khi code cho solo dev, prototype, spike, internal tool.
4
- Khác với `/tas-fix`: spec document, phù hợp task > 2 giờ hoặc cần track AC.
3
+ Create lightweight spec before codingfor solo dev, prototype, spike, internal tool.
4
+ Differs from `/tas-fix`: has spec document, suitable for tasks > 2 hours or needs AC tracking.
5
5
 
6
6
  ## Steps
7
7
 
8
- ### 1 — Thu thập thông tin
9
- `$ARGUMENTS` tả task. Nếu chưa đủ rõ, hỏi tối đa 3 câu:
10
- - **Goal**: Build cái gì? Giải quyết vấn đề gì?
11
- - **AC**: Done trông như thế nào? (2-5 criteria cụ thể, testable)
8
+ ### 1 — Gather information
9
+ `$ARGUMENTS` is task description. If not clear enough, ask max 3 questions:
10
+ - **Goal**: What to build? What problem to solve?
11
+ - **AC**: What does done look like? (2-5 specific, testable criteria)
12
12
  - **Constraints**: Tech constraints, out of scope?
13
13
 
14
- Không hỏi nếu $ARGUMENTS đã đủ rõ.
14
+ Don't ask if $ARGUMENTS is already clear enough.
15
15
 
16
- ### 2 — Tạo SPEC.md
17
- Tạo file `SPEC.md` project root:
16
+ ### 2 — Create SPEC.md
17
+ Create file `SPEC.md` at project root:
18
18
 
19
19
  ```markdown
20
20
  # {Title}
@@ -23,28 +23,28 @@ Tạo file `SPEC.md` ở project root:
23
23
  **Status:** Draft | **Date:** {today}
24
24
 
25
25
  ## Goal
26
- {Vấn đề cần giải quyết không phải solution}
26
+ {Problem to solvenot solution}
27
27
 
28
28
  ## Acceptance Criteria
29
- - [ ] {Given/When/Then hoặc testable statement}
29
+ - [ ] {Given/When/Then or testable statement}
30
30
  - [ ] ...
31
31
 
32
32
  ## Out of Scope
33
- - { sẽ không làm}
33
+ - {What won't be done}
34
34
 
35
35
  ## Constraints
36
- {Tech constraints, patterns phải follow — bỏ qua nếu không có}
36
+ {Tech constraints, patterns to follow — omit if none}
37
37
 
38
38
  ## Open Questions
39
- {Câu hỏi chưa có câu trả lời bỏ qua nếu không có}
39
+ {Unanswered questionsomit if none}
40
40
  ```
41
41
 
42
42
  ### 3 — Next step
43
- > "SPEC.md đã tạo.
44
- > - Plan kỹ hơn: `/tas-plan SPEC.md`
45
- > - Code ngay: `/tas-dev` (cần `require_plan: false` trong tas.yaml)"
43
+ > "SPEC.md created.
44
+ > - Plan in detail: `/tas-plan SPEC.md`
45
+ > - Code immediately: `/tas-dev` (requires `require_plan: false` in tas.yaml)"
46
46
 
47
47
  ## Principles
48
- - SPEC.md single source of truth — không tạo thêm file khác
49
- - Giữ ngắn: mục tiêu < 1 trang
50
- - AC > 8 items hoặc task > 1 ngàygợi ý dùng `/tas-story` thay thế
48
+ - SPEC.md is single source of truth — don't create additional files
49
+ - Keep short: target < 1 page
50
+ - If AC > 8 items or task > 1 daysuggest using `/tas-story` instead
@@ -1,16 +1,16 @@
1
- # /tas-status
1
+ # /tas-status
2
2
 
3
- Kiểm tra trạng thái hiện tại của dự án TAS.
3
+ Check current status of TAS project.
4
4
 
5
- ## Hành động
6
- 1. Cần context từ root/project-status.yaml (CHỈ đọc file này, KHÔNG quét thư mục docs/)
7
- 2. Cần context từ root/tas.yaml để biết workflow config
8
- 3. Dựa vào project-status.yaml, tổng hợp:
9
- - Số lượng artifacts đã tạo status
10
- - Số lượng epics/features/stories theo từng status
11
- - Phase hiện tại dựa trên trạng thái tổng hợp
12
- 4. Hiển thị bảng trạng thái phases chi tiết stories theo status.
5
+ ## Actions
6
+ 1. Need context from root/project-status.yaml (ONLY read this file, DO NOT scan docs/ directory)
7
+ 2. Need context from root/tas.yaml to know workflow config
8
+ 3. Based on project-status.yaml, summarize:
9
+ - Number of artifacts created and their status
10
+ - Number of epics/features/stories by each status
11
+ - Current phase based on aggregated status
12
+ 4. Display phase status table and story details by status.
13
13
 
14
- ## Lưu ý
15
- - Đây command chỉ đọc, không thay đổi
16
- - Nếu nghi ngờ project-status.yaml lệch thực tế, user thể chạy /tas-init để quét lại và đồng bộ
14
+ ## Notes
15
+ - This is read-only command, does not change anything
16
+ - If project-status.yaml seems out of sync, user can run /tas-init to rescan and sync