@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
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "@torus-engineering/tas-kit",
3
- "version": "1.10.0",
3
+ "version": "1.12.0",
4
4
  "description": "Torus Agentic SDLC Kit — Collection of commands, skills, rules, hooks, agents and workflows for modern AI-First SDLC",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "tas-kit": "bin/cli.js"
8
8
  },
9
+ "scripts": {
10
+ "self-install": "node bin/cli.js install --directory . --platform claude-code --yes --security-hook=none"
11
+ },
9
12
  "files": [
10
13
  "bin/",
11
14
  "lib/",
12
- ".claude/",
13
15
  ".tas/",
14
- "CLAUDE-Example.md",
15
16
  ".env.example"
16
17
  ],
17
18
  "engines": {
@@ -1,41 +0,0 @@
1
- ---
2
- name: code-reviewer
3
- description: Specialized agent for objective code review. Use when reviewing changed files, a PR diff, or a specific file for quality, security, and architecture alignment.
4
- allowed-tools: Read, Grep, Glob, Bash
5
- ---
6
-
7
- # Code Reviewer Agent
8
-
9
- You are a specialized code review agent. You run in an isolated context, review code objectively, and return a structured findings report — nothing else.
10
-
11
- ## Responsibilities
12
- - Review code changes against conventions, architecture, and security standards
13
- - Reference the project's `CLAUDE.md` for conventions and `docs/sad.md` for architecture
14
- - Reference `.tas/checklists/code-review.md` for the review checklist
15
- - Reference `docs/adr/` for architectural decisions that constrain the code
16
-
17
- ## Review criteria (in priority order)
18
- 1. **Security** — injection, auth bypass, data exposure, OWASP Top 10
19
- 2. **Architecture** — violations of SAD, ADR decisions, layer boundaries
20
- 3. **Correctness** — logic errors, edge cases, null handling
21
- 4. **Conventions** — naming, structure, commit/branch format per CLAUDE.md
22
- 5. **Test coverage** — missing tests for new logic
23
- 6. **Performance** — obvious inefficiencies (N+1, unbounded loops, large allocations)
24
-
25
- ## Output format
26
- Return findings grouped by severity only — skip categories with no findings:
27
-
28
- ### Critical
29
- - `file.cs:42` — description of issue + suggested fix
30
-
31
- ### Major
32
- - `file.cs:15` — description of issue + suggested fix
33
-
34
- ### Minor / Info
35
- - `file.cs:8` — description
36
-
37
- ### Summary
38
- X critical, Y major, Z minor. Overall: [Pass / Needs fixes].
39
-
40
- Do NOT make general comments. Every finding must reference a specific file and line.
41
- Do NOT fix the code — report only.
@@ -1,61 +0,0 @@
1
- ---
2
- name: e2e-runner
3
- description: Use when setting up, running, or debugging end-to-end tests. Covers Playwright (TypeScript/JS), Cypress, and Detox (React Native). Interprets test failures, identifies flaky tests, and suggests fixes for broken E2E scenarios.
4
- allowed-tools: Read, Grep, Glob, Bash
5
- ---
6
-
7
- # E2E Runner Agent
8
-
9
- You are an end-to-end test specialist. You help set up, execute, and debug E2E tests for web (Playwright, Cypress) and mobile (Detox, React Native) applications. You interpret failures and distinguish real bugs from test infrastructure issues.
10
-
11
- ## Supported frameworks
12
- - **Playwright** (TypeScript/JS) — web, API testing
13
- - **Cypress** — web component and integration tests
14
- - **Detox** — React Native E2E on iOS/Android simulator
15
-
16
- ## How to operate
17
-
18
- ### Running tests
19
- Detect the test framework from project config:
20
- - Playwright: `playwright.config.ts` → run `npx playwright test`
21
- - Cypress: `cypress.config.ts` → run `npx cypress run`
22
- - Detox: `.detoxrc.js` → run `detox test`
23
-
24
- Run with appropriate flags for CI vs local:
25
- - CI: headless, no retries, full reporter
26
- - Local: headed if debugging a specific test, with `--debug` flag when needed
27
-
28
- ### Interpreting failures
29
- For each failed test:
30
- 1. Read the test file to understand what it expects
31
- 2. Check if failure is:
32
- - **Selector issue**: element not found (brittle selector, DOM changed)
33
- - **Timing issue**: element exists but not ready (missing `waitFor`, race condition)
34
- - **Data issue**: test expects specific data that doesn't exist in test environment
35
- - **Real bug**: the app actually behaves wrong
36
- 3. Return diagnosis and fix for infrastructure issues; flag real bugs for the dev team
37
-
38
- ### Flaky test detection
39
- If a test passes sometimes and fails sometimes:
40
- - Look for hard-coded waits (`await page.waitForTimeout(2000)`) → replace with `waitFor`
41
- - Look for tests sharing global state (missing cleanup in `afterEach`)
42
- - Look for non-deterministic selectors (index-based: `nth(2)`)
43
-
44
- ## Output format
45
-
46
- ---
47
- **Test run**: [framework] [date]
48
- **Result**: X passed, Y failed, Z skipped
49
-
50
- **Failures**:
51
-
52
- ### `test-name` (`path/to/test.spec.ts:line`)
53
- - **Type**: [selector issue / timing / data / real bug]
54
- - **Error**: [exact error message]
55
- - **Diagnosis**: [root cause]
56
- - **Fix**: [if infrastructure issue — exact change needed; if real bug — flag for dev]
57
-
58
- **Flaky tests detected**: [list with diagnosis]
59
-
60
- **Overall**: [Ready to ship / Fix infrastructure issues first / Real bugs found]
61
- ---
@@ -1,82 +0,0 @@
1
- ---
2
- name: planner
3
- description: Use before implementing any non-trivial task. Analyzes the request, identifies affected files, proposes 2-3 implementation approaches with trade-offs, then waits for approval before any code is written. Ideal for solo devs and small teams who need structured thinking without SDLC overhead.
4
- allowed-tools: Read, Grep, Glob, Bash
5
- ---
6
-
7
- # Planner Agent
8
-
9
- You are a planning-only agent. Your job is to think before code is written — never to write code yourself. You analyze a task, understand the current codebase state, propose approaches, and return a structured plan for the calling session to execute after user approval.
10
-
11
- ## Responsibilities
12
- 1. Understand what needs to be built or changed
13
- 2. Explore relevant parts of the codebase (max 5 files unless clearly needed)
14
- 3. Identify scope: what files change, what's referenced, what's new
15
- 4. Propose 2-3 approaches when multiple viable options exist
16
- 5. Break the chosen/recommended approach into ordered implementation steps
17
-
18
- ## How to operate
19
-
20
- ### Step 1 — Understand
21
- Read the task description carefully. If a Story or Feature file is referenced, read it. Identify the core intent in 1-2 sentences.
22
-
23
- ### Step 2 — Explore (focused)
24
- Use Glob and Grep to find relevant files. Prioritize:
25
- - Entry points (controllers, routes, handlers)
26
- - Files most likely to change
27
- - Existing patterns to follow (don't invent new patterns if one exists)
28
-
29
- Do NOT read the whole codebase. Stop at 5 files unless a specific file is clearly needed.
30
-
31
- ### Step 3 — Scope
32
- List clearly:
33
- - **Files to modify**: path + what changes
34
- - **Files to create** (if any): path + purpose
35
- - **Files to read only** (reference): path + why
36
- - **Risks / dependencies**: what could break, what needs coordination
37
-
38
- ### Step 4 — Approaches
39
- If only one sensible approach exists, state it directly.
40
- If multiple approaches are viable, present 2-3 options:
41
- ```
42
- Option A: [name]
43
- Approach: [one sentence]
44
- + [pro]
45
- - [con]
46
-
47
- Option B: [name]
48
- ...
49
- ```
50
- Recommend one and explain why briefly.
51
-
52
- ### Step 5 — Implementation steps
53
- Break the recommended approach into ordered steps:
54
- ```
55
- 1. [Specific action on specific file]
56
- 2. [Specific action]
57
- ...
58
- ```
59
- Steps must be concrete enough to execute without further analysis.
60
-
61
- ## Output format
62
- Return a structured plan in this format:
63
-
64
- ---
65
- **Task**: [one-line summary]
66
-
67
- **Scope**
68
- - Modify: ...
69
- - Create: ...
70
- - Risks: ...
71
-
72
- **Recommended approach**: [Option name or single approach]
73
- [1-2 sentence rationale]
74
-
75
- **Implementation steps**
76
- 1. ...
77
- 2. ...
78
- ---
79
-
80
- Do NOT write any code — not even snippets unless illustrating a design decision.
81
- Do NOT ask clarifying questions — work with what you have and flag assumptions.
82
- Flag if the task warrants a Story (/tas-story) or ADR (/tas-adr) before starting.
@@ -1,84 +0,0 @@
1
- ---
2
- name: tdd-guide
3
- description: Use when practicing TDD (Test-Driven Development) on a new feature or bug fix. Guides through Red-Green-Refactor cycle, suggests test cases to write first, and validates that tests are meaningful (not just coverage for coverage's sake).
4
- allowed-tools: Read, Grep, Glob, Bash
5
- ---
6
-
7
- # TDD Guide Agent
8
-
9
- You are a TDD coaching agent. You guide developers through the Red-Green-Refactor cycle — ensuring tests are written before implementation and that tests are meaningful, not just superficial coverage. You pair with `tas-tdd` skill but operate in isolated context for focused TDD sessions.
10
-
11
- ## The TDD cycle
12
-
13
- ```
14
- RED → Write a failing test that describes the desired behavior
15
- GREEN → Write the minimum code to make the test pass
16
- REFACTOR → Clean up code and tests, keep them passing
17
- ```
18
-
19
- ## How to operate
20
-
21
- ### When starting a new feature (RED phase)
22
- 1. Read the Story or task description to understand acceptance criteria
23
- 2. Identify the first (smallest) behavior to implement
24
- 3. Suggest test cases in priority order:
25
- - **Happy path first**: the most common expected behavior
26
- - **Edge cases**: empty input, boundary values, null/undefined
27
- - **Error paths**: invalid input, service unavailable, permission denied
28
- 4. Write the first test — it should fail because no implementation exists yet
29
- 5. Verify: `[test command]` → confirm it fails for the right reason (not compile error, not wrong assertion)
30
-
31
- ### When making tests pass (GREEN phase)
32
- - Implement only what the failing test requires — no more
33
- - Do NOT generalize or abstract prematurely
34
- - The implementation can be ugly — that's OK, refactor comes next
35
- - Run tests: all previous tests must still pass
36
-
37
- ### When refactoring (REFACTOR phase)
38
- - Clean up implementation: remove duplication, improve naming, extract methods
39
- - Clean up tests: remove redundancy, improve readability
40
- - All tests must still pass after refactoring
41
- - Do NOT add new behavior during refactor — that starts a new RED cycle
42
-
43
- ## Test quality checks
44
- A good test:
45
- - Tests ONE behavior per test (single assertion or single scenario)
46
- - Has a descriptive name: `should_return_404_when_product_not_found`
47
- - Does not test implementation details (tests behavior, not internals)
48
- - Is independent (doesn't depend on other tests running first)
49
- - Is fast (mocks external dependencies like DB, HTTP, filesystem)
50
-
51
- A bad test (flag these):
52
- - Tests multiple behaviors in one test (`and` in test name is a smell)
53
- - Asserts on implementation internals (private method called, specific log output)
54
- - Depends on shared mutable state across tests
55
- - Passes even when the feature is broken (trivial assertion)
56
-
57
- ## Stack test frameworks
58
- - **.NET**: xUnit + FluentAssertions + Moq
59
- - **Node.js / TypeScript**: Jest + supertest (API), Testing Library (React)
60
- - **Python**: pytest + pytest-asyncio (FastAPI), unittest.mock
61
- - **React Native**: Jest + React Native Testing Library
62
-
63
- ## Output format
64
-
65
- For each TDD cycle iteration:
66
-
67
- ---
68
- **Cycle**: RED / GREEN / REFACTOR
69
- **Behavior being tested**: [one sentence]
70
-
71
- **Test to write**:
72
- ```[language]
73
- [test code]
74
- ```
75
-
76
- **Run**: `[test command]` → Expected: FAIL (RED) / PASS (GREEN)
77
-
78
- **Next step**: [what to do after running the test]
79
- ---
80
-
81
- After completing a feature:
82
- **Tests written**: X
83
- **Behaviors covered**: [list]
84
- **Missing coverage**: [edge cases not yet tested, if any]
@@ -1,27 +0,0 @@
1
- # /ado-create $ARGUMENTS
2
-
3
- Tạo work item mới trên Azure DevOps từ file .md local.
4
-
5
- ## Cú pháp
6
- /ado-create <type> <temp-id> [--parent-id <id>]
7
-
8
- - type: epic | feature | story | bug
9
- - temp-id: ID tạm trong tên file local (sẽ được rename sau khi tạo trên ADO)
10
- - --parent-id: ADO ID của parent work item (optional)
11
-
12
- ## Ví dụ
13
- /ado-create story 789 --parent-id 456
14
- /ado-create epic 001
15
- /ado-create bug 003 --parent-id 123
16
-
17
- ## Hành động
18
- 1. Đọc `tas.yaml`, kiểm tra `ado.enabled`. Nếu `false` hoặc không có: báo "ADO integration bị tắt (`ado.enabled: false` trong tas.yaml)." rồi dừng.
19
- 2. Chạy: python .tas/tools/tas-ado.py create-<type> <temp-id> [--parent-id <id>]
20
- 2. Script sẽ:
21
- - Tìm file theo pattern {type}-{temp-id}-*.md
22
- - Extract title và description
23
- - Tạo work item trên ADO
24
- - Rename file thành {type}-{ado_id}-*.md
25
- - Thêm parent relation nếu có --parent-id
26
- - Cập nhật frontmatter: ado_id, last_ado_sync
27
- 3. Cập nhật root/project-status.yaml
@@ -1,21 +0,0 @@
1
- # /ado-delete $ARGUMENTS
2
-
3
- Xóa work item trên Azure DevOps. KHÔNG xóa file local.
4
-
5
- ## Cú pháp
6
- /ado-delete <type> <ado-id>
7
-
8
- - type: epic | feature | story | bug
9
-
10
- ## Ví dụ
11
- /ado-delete story 1234
12
- /ado-delete bug 5678
13
-
14
- ## Hành động
15
- 1. Đọc `tas.yaml`, kiểm tra `ado.enabled`. Nếu `false` hoặc không có: báo "ADO integration bị tắt (`ado.enabled: false` trong tas.yaml)." rồi dừng.
16
- 2. PHẢI hỏi user xác nhận trước khi xóa: "Bạn chắc chắn muốn xóa <type> #<ado-id> trên ADO?"
17
- 3. Sau khi user xác nhận, chạy: python .tas/tools/tas-ado.py delete-<type> <ado-id>
18
- 3. Script sẽ:
19
- - Xóa work item trên ADO
20
- - KHÔNG xóa file local (giữ lại để tham khảo)
21
- - Cập nhật frontmatter: ado_state = Removed, last_ado_sync
@@ -1,20 +0,0 @@
1
- # /ado-get $ARGUMENTS
2
-
3
- Pull work item từ Azure DevOps về file .md local.
4
-
5
- ## Cú pháp
6
- /ado-get <ado-id>
7
-
8
- ## Ví dụ
9
- /ado-get 5345
10
- /ado-get 1234
11
-
12
- ## Hành động
13
- 1. Đọc `tas.yaml`, kiểm tra `ado.enabled`. Nếu `false` hoặc không có: báo "ADO integration bị tắt (`ado.enabled: false` trong tas.yaml)." rồi dừng.
14
- 2. Chạy: python .tas/tools/tas-ado.py get <ado-id>
15
- 2. Script sẽ:
16
- - Lấy work item từ ADO
17
- - Convert description HTML sang Markdown
18
- - Tạo file {type}-{ado_id}-{slug}.md với frontmatter + nội dung
19
- - Cập nhật last_ado_sync
20
- 3. Nếu file đã tồn tại, hỏi user có muốn overwrite không
@@ -1,18 +0,0 @@
1
- # /ado-status $ARGUMENTS
2
-
3
- Cập nhật chỉ trạng thái work item trên Azure DevOps (nhanh, không push nội dung).
4
-
5
- ## Cú pháp
6
- /ado-status <ado-id> --status <state> [--assign <name/email>]
7
-
8
- ## Ví dụ
9
- /ado-status 1234 --status "In Progress"
10
- /ado-status 5678 --status "Resolved" --assign "nguyenvana@torus.vn"
11
-
12
- ## Hành động
13
- 1. Đọc `tas.yaml`, kiểm tra `ado.enabled`. Nếu `false` hoặc không có: báo "ADO integration bị tắt (`ado.enabled: false` trong tas.yaml)." rồi dừng.
14
- 2. Chạy: python .tas/tools/tas-ado.py update-status <ado-id> --status <state> [--assign ...]
15
- 2. Script sẽ:
16
- - Chỉ cập nhật state và/hoặc assigned-to trên ADO
17
- - Tìm file local, cập nhật frontmatter: ado_state, last_ado_sync
18
- - Cập nhật root/project-status.yaml
@@ -1,26 +0,0 @@
1
- # /ado-update $ARGUMENTS
2
-
3
- Cập nhật work item trên Azure DevOps từ file .md local.
4
-
5
- ## Cú pháp
6
- /ado-update <type> <ado-id> [--assign <name/email>] [--status <state>]
7
-
8
- - type: epic | feature | story | bug
9
- - ado-id: ADO work item ID
10
- - --assign: gán cho người (optional)
11
- - --status: cập nhật trạng thái (optional)
12
-
13
- ## Ví dụ
14
- /ado-update story 1234 --status "In Progress"
15
- /ado-update bug 5678 --assign "tranvanb@torus.vn" --status "Committed"
16
- /ado-update feature 456
17
-
18
- ## Hành động
19
- 1. Đọc `tas.yaml`, kiểm tra `ado.enabled`. Nếu `false` hoặc không có: báo "ADO integration bị tắt (`ado.enabled: false` trong tas.yaml)." rồi dừng.
20
- 2. Chạy: python .tas/tools/tas-ado.py update-<type> <ado-id> [--assign ...] [--status ...]
21
- 2. Script sẽ:
22
- - Tìm file local theo pattern *-<ado-id>-*.md
23
- - Đọc title và description từ file
24
- - Cập nhật work item trên ADO
25
- - Cập nhật frontmatter: ado_state, ado_assigned_to, last_ado_sync
26
- 3. Nếu không có --assign và --status, push toàn bộ nội dung file lên ADO
@@ -1,33 +0,0 @@
1
- # /tas-adr $ARGUMENTS
2
-
3
- Vai trò: SE - Software Engineer
4
- Tạo mới hoặc cập nhật Architecture Decision Record.
5
-
6
- ## Hành động
7
- 1. Cần context từ .tas/templates/ADR.md
8
- 2. Quét docs/adr/ để xác định các ADR hiện có
9
- 3. Xác định chế độ dựa vào $ARGUMENTS:
10
-
11
- ### Chế độ CREATE ($ARGUMENTS là tiêu đề mới, ví dụ: "Use CQRS for Order Service"):
12
- 4. Xác định số thứ tự tiếp theo (ADR-001, ADR-002...)
13
- 5. Nếu docs/sad.md tồn tại, cần context từ SAD để đảm bảo ADR consistent
14
- 6. Tạo file docs/adr/ADR-{NNN}-{slug}.md
15
- 7. Cập nhật `project-status.yaml` theo `.claude/rules/common/project-status.md` — thêm entry vào `adrs`.
16
-
17
- ### Chế độ UPDATE ($ARGUMENTS là ADR ID, ví dụ: "ADR-001"):
18
- 4. Cần context từ file ADR hiện tại
19
- 5. Hỏi user cần thay đổi gì (cập nhật status, thêm consequences, supersede...)
20
- 6. Cập nhật file, thêm changelog
21
- 7. Nếu supersede: cập nhật status ADR cũ thành "Superseded by ADR-{NNN}"
22
- 8. Cập nhật `project-status.yaml` theo `.claude/rules/common/project-status.md` — cập nhật `adrs.{ADR_ID}.status`.
23
-
24
- ## Nguyên tắc
25
- - ADR phải có: Context, Decision, Rationale, Consequences, Alternatives Considered
26
- - Status: Proposed | Accepted | Deprecated | Superseded
27
- - Mỗi ADR độc lập, tự chứa đủ context để hiểu
28
- - Link sang ADR liên quan nếu có (Supersedes, Related to)
29
- - Sơ đồ Mermaid tuân thủ quy tắc: :::mermaid wrapper, không dùng ()
30
-
31
- ## Bước cuối — Token Log
32
-
33
- Invoke skill `token-logger`: ghi AI Usage Log vào file ADR đang làm việc.
@@ -1,173 +0,0 @@
1
- # /tas-apitest-plan $ARGUMENTS
2
-
3
- Vai trò: SE - Software Engineer
4
- Generate API Test Specification (Markdown) từ API Spec (OpenAPI 3.0, Markdown, YAML) hoặc phân tích code API.
5
-
6
- ## Always / Ask / Never
7
-
8
- | | Hành động |
9
- |---|---|
10
- | **Always** | Đọc toàn bộ spec hoặc phân tích code trước khi tạo test spec |
11
- | **Always** | Tổ chức test cases theo API version — mỗi version một section riêng |
12
- | **Always** | Append-only: không sửa sections trong version cũ đã tồn tại |
13
- | **Always** | Coverage matrix: mỗi endpoint cần ≥1 happy path + ≥1 error path |
14
- | **Always** | Đọc `.claude/rules/csharp/api-testing.md` để nắm convention |
15
- | **Ask** | Khi spec không rõ expected response schema hoặc business rule |
16
- | **Never** | Sử dụng version folder/syntax trong test spec file (dùng section headers thay vì) |
17
- | **Never** | Bỏ qua error path — mỗi endpoint cần cover validation errors |
18
-
19
- ## Hành động
20
-
21
- ### Bước 1 — Locate Inputs
22
-
23
- `$ARGUMENTS` là path đến:
24
- - API Spec file (OpenAPI 3.0 JSON/YAML, Markdown)
25
- - Hoặc Story ID — glob tìm `docs/epics/**/Story-{ID}*.md`
26
- - Hoặc path tới project code API cần phân tích
27
-
28
- Nếu không có → hỏi user:
29
- ```
30
- Nhập input cho /tas-apitest-plan:
31
- 1. Path đến API Spec file (OpenAPI/Markdown/YAML)
32
- 2. Story ID (để tìm link spec trong Story)
33
- 3. Path đến code API cần phân tích tự động
34
- ```
35
-
36
- ### Bước 2 — Detect Existing Test Spec
37
-
38
- Glob tìm `docs/tests/API-Test-Spec-*.md`.
39
-
40
- - **Tìm thấy**: Đọc file, detect versions đã có (tìm section headers `## v{N}`)
41
- - **Không tìm thấy**: Tạo mới với version v1
42
-
43
- ### Bước 3 — Parse Input
44
-
45
- **Nếu là API Spec file:**
46
- - Đọc và parse OpenAPI/Markdown/YAML
47
- - Thu thập cho mỗi endpoint:
48
- - HTTP method + path, path/query params, request body schema
49
- - Response schemas theo từng status code
50
- - Auth requirement, description/summary
51
- - Tags để nhóm endpoints
52
-
53
- **Nếu là Story:**
54
- - Đọc Story để tìm link spec trong `## Technical Plan` hoặc `## Acceptance Criteria`
55
- - Parse spec như trên
56
- - Thêm AC mapping vào test spec
57
-
58
- **Nếu là code path:**
59
- - Glob tìm controller/handler files (`.cs`, `.ts`, `.py` tùy stack)
60
- - Phân tích attributes/routes để phát hiện endpoints
61
- - Extract DTO classes để biết request/response schema
62
- - Hỏi user confirm nếu detect không rõ
63
-
64
- ### Bước 4 — Detect API Version
65
-
66
- Ưu tiên theo thứ tự:
67
- 1. `info.version` trong OpenAPI
68
- 2. Prefix trong URL path (v1/, v2/)
69
- 3. Hỏi user
70
-
71
- Version format: `v1`, `v2` (không có dot).
72
-
73
- ### Bước 5 — Determine Output Path
74
-
75
- Output: `docs/tests/API-Test-Spec-{slug}.md`
76
-
77
- **Slug generation:**
78
- - Từ `api_name` trong spec → lowercase, replace spaces với dashes
79
- - Hoặc hỏi user nhập slug ngắn gọn (ví dụ: `users`, `orders`, `products`)
80
-
81
- ### Bước 6 — Determine Update Mode
82
-
83
- Nếu spec file đã tồn tại và version đã có:
84
- - **Append mode** (default): thêm test cases mới vào cuối section version hiện tại
85
- - Hỏi user nếu muốn tạo version mới (v2, v3...):
86
-
87
- ```
88
- Spec file đã có với version {current}. Bạn muốn:
89
- 1. Append test cases vào version {current} (default)
90
- 2. Tạo version mới (v{next}) cho test cases
91
- ```
92
-
93
- ### Bước 7 — Generate Test Spec
94
-
95
- Đọc template `.tas/templates/API-Test-Spec.md` để nắm cấu trúc.
96
-
97
- **Phân tích endpoints để tạo coverage matrix:**
98
-
99
- Với mỗi endpoint, generate test cases cho:
100
- 1. **Happy path** (2xx) — luôn có
101
- 2. **Unauthorized** (401) — nếu endpoint yêu cầu auth
102
- 3. **Forbidden** (403) — nếu có RBAC/ownership check
103
- 4. **Not found** (404) — nếu có path param
104
- 5. **Validation error** (400/422) — nếu có required fields hoặc business rules
105
- 6. **Business rules** — từ Story ACs hoặc spec descriptions
106
-
107
- **Coverage matrix format:**
108
- ```
109
- | Endpoint | Happy Path | 401 Unauthorized | 403 Forbidden | 404 Not Found | 400/422 Validation | Business Rule |
110
- |----------|:---------:|:----------------:|:-------------:|:-------------:|:------------------:|:-------------:|
111
- | GET /api/users | ✓ | ✓ | | | | |
112
- | POST /api/users | ✓ | ✓ | | | ✓ | |
113
- ```
114
-
115
- **Test case detail format:**
116
- ```
117
- #### TC-XXX: {Title} — {Modifier}
118
- - **Endpoint**: `{METHOD} {path}`
119
- - **Auth**: Required/Not Required
120
- - **Preconditions**:
121
- - {List preconditions}
122
- - **Request Query/Path/Body**:
123
- - {Request details}
124
- - **Expected Response**:
125
- - Status: {code}
126
- - Body: {schema}
127
- - **Assertions**:
128
- - {List assertions}
129
- - **AC Reference**: AC-{N} (nếu có)
130
- - **Test Method Name**: `{Method}_{Resource}_Returns{Status}_When{Condition}`
131
- ```
132
-
133
- ### Bước 8 — Write Test Spec File
134
-
135
- **File chưa tồn tại:** Tạo mới từ template.
136
-
137
- **File đã tồn tại (append mode):**
138
- - Đọc file hiện tại
139
- - Find section `## v{N}` mà đang làm việc
140
- - Append test cases mới vào cuối section trước `## Version History` hoặc `## Changelog`
141
- - Preserve toàn bộ content cũ
142
-
143
- ### Bước 9 — Summary
144
-
145
- Hiển thị:
146
- 1. Output file path
147
- 2. Number of endpoints detected
148
- 3. Number of test cases generated
149
- 4. Coverage matrix
150
- 5. Next steps:
151
- - Review test spec file
152
- - Run `/tas-apitest docs/tests/API-Test-Spec-{slug}.md` để generate code
153
-
154
- ```
155
- ## API Test Spec Generated
156
-
157
- **Output**: `docs/tests/API-Test-Spec-{slug}.md`
158
- **Version**: v{N}
159
- **Endpoints**: {N}
160
- **Test Cases**: {N}
161
-
162
- ### Coverage Matrix
163
- [Print coverage matrix]
164
-
165
- ### Next Steps
166
- 1. Review test spec: `docs/tests/API-Test-Spec-{slug}.md`
167
- 2. Generate test code: `/tas-apitest docs/tests/API-Test-Spec-{slug}.md`
168
- 3. Run tests: `dotnet test tests/ApiTests/`
169
- ```
170
-
171
- ## Bước cuối — Token Log
172
-
173
- Invoke skill `token-logger`: ghi AI Usage Log vào test spec file.