@torus-engineering/tas-kit 1.7.0 → 1.8.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 (71) hide show
  1. package/.claude/commands/tas-adr.md +33 -29
  2. package/.claude/commands/tas-api-test.md +95 -0
  3. package/.claude/commands/tas-bug.md +113 -109
  4. package/.claude/commands/tas-design.md +37 -33
  5. package/.claude/commands/tas-dev.md +128 -115
  6. package/.claude/commands/tas-e2e-mobile.md +155 -0
  7. package/.claude/commands/tas-e2e-web.md +163 -0
  8. package/.claude/commands/tas-e2e.md +102 -0
  9. package/.claude/commands/tas-epic.md +35 -31
  10. package/.claude/commands/tas-feature.md +47 -43
  11. package/.claude/commands/tas-fix.md +51 -47
  12. package/.claude/commands/tas-functest-mobile.md +144 -0
  13. package/.claude/commands/tas-functest-web.md +192 -0
  14. package/.claude/commands/tas-functest.md +76 -0
  15. package/.claude/commands/tas-plan.md +200 -184
  16. package/.claude/commands/tas-prd.md +37 -33
  17. package/.claude/commands/tas-review.md +111 -104
  18. package/.claude/commands/tas-sad.md +43 -39
  19. package/.claude/commands/tas-security.md +81 -80
  20. package/.claude/commands/tas-story.md +91 -87
  21. package/.claude/commands/tas-verify.md +51 -41
  22. package/.claude/rules/common/post-review-agent.md +49 -39
  23. package/.claude/rules/common/testing.md +24 -0
  24. package/.claude/rules/common/token-logging.md +27 -0
  25. package/.claude/rules/csharp/api-testing.md +171 -0
  26. package/.claude/rules/csharp/patterns.md +10 -0
  27. package/.claude/rules/python/patterns.md +10 -0
  28. package/.claude/rules/typescript/patterns.md +10 -0
  29. package/.claude/rules/web/performance.md +9 -0
  30. package/.claude/skills/api-design/SKILL.md +3 -1
  31. package/.claude/skills/{backend-patterns → js-backend-patterns}/SKILL.md +2 -1
  32. package/.claude/skills/tas-implementation-complete/SKILL.md +99 -97
  33. package/.claude/skills/tas-tdd/SKILL.md +123 -82
  34. package/.claude/skills/token-logger/SKILL.md +19 -0
  35. package/.tas/templates/E2E-Execution-Report.md +198 -0
  36. package/.tas/templates/E2E-Mobile-Spec.md +130 -0
  37. package/.tas/templates/E2E-Report.md +174 -0
  38. package/.tas/templates/E2E-Scenario.md +180 -0
  39. package/.tas/templates/E2E-Web-Spec.md +164 -0
  40. package/.tas/templates/Feature.md +55 -55
  41. package/.tas/templates/Func-Test-Script.md +254 -0
  42. package/.tas/templates/Func-Test-Spec.md +187 -0
  43. package/.tas/templates/SAD.md +274 -274
  44. package/.tas/templates/Story.md +90 -88
  45. package/bin/cli.js +56 -56
  46. package/lib/deleted-files.json +33 -0
  47. package/lib/install.js +213 -176
  48. package/package.json +34 -34
  49. package/.claude/agents/README.md +0 -83
  50. package/.claude/agents/ado-agent.md +0 -39
  51. package/.claude/agents/code-architect.md +0 -62
  52. package/.claude/agents/code-simplifier.md +0 -53
  53. package/.claude/agents/comment-analyzer.md +0 -59
  54. package/.claude/agents/conversation-analyzer.md +0 -57
  55. package/.claude/agents/docs-lookup.md +0 -55
  56. package/.claude/agents/harness-optimizer.md +0 -62
  57. package/.claude/agents/loop-operator.md +0 -56
  58. package/.claude/agents/performance-optimizer.md +0 -78
  59. package/.claude/agents/pr-test-analyzer.md +0 -68
  60. package/.claude/agents/pytorch-build-resolver.md +0 -76
  61. package/.claude/agents/refactor-cleaner.md +0 -70
  62. package/.claude/agents/seo-specialist.md +0 -75
  63. package/.claude/agents/silent-failure-hunter.md +0 -69
  64. package/.claude/agents/type-design-analyzer.md +0 -75
  65. package/.claude/rules/common/agents.md +0 -65
  66. package/.claude/rules/common/coding-style.md +0 -90
  67. package/.claude/rules/common/development-workflow.md +0 -44
  68. package/.claude/rules/common/git-workflow.md +0 -24
  69. package/.claude/rules/common/performance.md +0 -55
  70. package/.claude/skills/agent-harness-construction/SKILL.md +0 -77
  71. package/.claude/skills/agent-introspection-debugging/SKILL.md +0 -157
@@ -0,0 +1,187 @@
1
+ ---
2
+ created_date:
3
+ updated_date:
4
+ executor:
5
+ status: Draft
6
+ story_id:
7
+ feature_id:
8
+ epic_id:
9
+ platform: # mobile | web | backend
10
+ ---
11
+
12
+ # Functional Test Specification: {Story Name}
13
+
14
+ **Epic**: [{Epic_ID}]({Epic_LINK})
15
+ **Feature**: [{Feature_ID}]({FEATURE_LINK})
16
+ **Story**: [{Story_ID}]({STORY_LINK})
17
+ **Platform**: {{platform}}
18
+ **Author**: @[executor]
19
+ **Created**: [created_date]
20
+ **Status**: [status] (Draft | Ready | Implemented | Verified)
21
+
22
+ ---
23
+
24
+ ## Test Case Naming Convention
25
+
26
+ > Functional Tests dung type code **FT** theo format chuẩn TAS
27
+
28
+ ### Format
29
+ ```
30
+ {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_{NUMBER}_{MODIFIER}
31
+ ```
32
+
33
+ ### Example
34
+ ```
35
+ AL_E002_F002_S001_FT_001_H - Functional Test Happy path
36
+ AL_E002_F002_S001_FT_002_N - Functional Test Negative
37
+ AL_E002_F002_S001_FT_003_E - Functional Test Edge case
38
+ ```
39
+
40
+ ### Modifier Codes
41
+
42
+ | Code | Modifier | Description |
43
+ |------|----------|-------------|
44
+ | H | Happy | Positive test - success scenario |
45
+ | N | Negative | Negative test - failure scenario |
46
+ | E | Edge | Edge case - boundary conditions |
47
+ | S | Security | Security test |
48
+ | P | Performance | Performance test |
49
+
50
+ ---
51
+
52
+ ## Overview
53
+
54
+ > Brief description of what this functional test suite validates for the Story
55
+
56
+ **Scope**: {What user functionality is being tested}
57
+ **Target Users**: {Clinical / Organic / Both}
58
+
59
+ ---
60
+
61
+ ## AC to Functional Test Mapping
62
+
63
+ > QUAN TRONG: Moi FT case PHAI reference AC-ID de dam bao traceability.
64
+ > Khi AC thay doi, grep theo AC-ID de biet FT nao can update.
65
+
66
+ | AC ID | AC Description (Given/When/Then) | FT Test ID | Test Scenario | Modifier | Priority | Status |
67
+ |-------|----------------------------------|------------|---------------|----------|----------|--------|
68
+ | AC-1 | {Given...When...Then...} | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_001_H | {Happy path description} | Happy | P0 | Draft |
69
+ | AC-1 | {Given...When...Then...} | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_002_N | {Negative scenario} | Negative | P0 | Draft |
70
+ | AC-1 | {Given...When...Then...} | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_003_E | {Edge case} | Edge | P1 | Draft |
71
+ | AC-2 | {Given...When...Then...} | {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_004_H | {Happy path description} | Happy | P0 | Draft |
72
+
73
+ ### Coverage Requirements
74
+ - Each AC MUST have at minimum **1 Happy path (H)** test
75
+ - Each AC SHOULD have **1 Negative (N)** test if error scenarios exist
76
+ - Each AC MAY have **1 Edge case (E)** test if boundary conditions apply
77
+
78
+ ---
79
+
80
+ ## Test Scenarios
81
+
82
+ ### FT_001_H: {Title - Happy Path}
83
+ - **AC Reference**: AC-1
84
+ - **Preconditions**:
85
+ - {List preconditions}
86
+ - **Test Data**:
87
+ - {Hardcoded values used in test}
88
+ - {Env-specific: from test-data.{env}.json}
89
+ - {Credentials: from .env via process.env}
90
+ - **Steps**:
91
+ 1. **Given** {initial state}
92
+ 2. **When** {user action}
93
+ 3. **Then** {expected outcome}
94
+ - **Expected Result**: {Detailed expected behavior}
95
+
96
+ ### FT_002_N: {Title - Negative Scenario}
97
+ - **AC Reference**: AC-1
98
+ - **Preconditions**:
99
+ - {List preconditions}
100
+ - **Test Data**:
101
+ - {Invalid/error data}
102
+ - **Steps**:
103
+ 1. **Given** {initial state}
104
+ 2. **When** {user performs invalid action}
105
+ 3. **Then** {expected error handling}
106
+ - **Expected Result**: {Error message, recovery option}
107
+
108
+ ### FT_003_E: {Title - Edge Case}
109
+ - **AC Reference**: AC-1
110
+ - **Preconditions**:
111
+ - {Boundary condition setup}
112
+ - **Test Data**:
113
+ - {Boundary values}
114
+ - **Steps**:
115
+ 1. **Given** {boundary state}
116
+ 2. **When** {boundary action}
117
+ 3. **Then** {graceful handling}
118
+ - **Expected Result**: {Handled gracefully without crash}
119
+
120
+ ---
121
+
122
+ ## Test Data Requirements
123
+
124
+ | Data Item | Value | Source | Environment-Specific | Notes |
125
+ |-----------|-------|--------|---------------------|-------|
126
+ | User Email | test@example.com | test-data.{env}.json | Yes | Different per env |
127
+ | User Password | (from .env) | process.env.TEST_USER_PASSWORD | Yes | NEVER hardcode |
128
+ | {Entity} ID | {value} | test-data.{env}.json | Yes | Pre-seeded |
129
+ | {Static Data} | {value} | Hardcoded in test | No | Same all envs |
130
+
131
+ ### Environment Data Files
132
+ - **Dev**: `apps/{platform}/e2e/data/test-data.dev.json`
133
+ - **Staging**: `apps/{platform}/e2e/data/test-data.staging.json`
134
+ - **Prod**: `apps/{platform}/e2e/data/test-data.prod.json` (smoke tests only)
135
+
136
+ ### Credentials
137
+ > NEVER put passwords/tokens in JSON files or test code.
138
+ > Always use `.env` via `process.env`.
139
+
140
+ ---
141
+
142
+ ## Platform-Specific Implementation
143
+
144
+ {{#if platform === "mobile"}}
145
+ ### Mobile (Detox)
146
+ - **Script Location**: `apps/mobile/e2e/features/{epic-slug}/{feature-slug}/{story-slug}.func.e2e.ts`
147
+ - **Test IDs**: Import from `apps/mobile/e2e/test-ids.ts`
148
+ - **Data Loader**: Import from `apps/mobile/e2e/helpers/data-loader.ts`
149
+ - **Test Helpers**: Import from `apps/mobile/e2e/helpers/test-utils.ts`
150
+ - **Run Command**: `yarn functest:mobile:{feature-slug}`
151
+ {{/if}}
152
+ {{#if platform === "web"}}
153
+ ### Web (Playwright)
154
+ - **Script Location**: `apps/web/e2e/features/{epic-slug}/{feature-slug}/{story-slug}.func.spec.ts`
155
+ - **Selectors**: Use `data-testid` attributes
156
+ - **Data Loader**: Import from `apps/web/e2e/helpers/data-loader.ts`
157
+ - **Test Helpers**: Import from `apps/web/e2e/helpers/test-utils.ts`
158
+ - **Run Command**: `yarn functest:web:{feature-slug}`
159
+ - **Viewports**: Test mobile (375px), tablet (768px), desktop (1280px)
160
+ {{/if}}
161
+
162
+ ---
163
+
164
+ ## Traceability
165
+
166
+ > This section enables impact analysis when requirements change.
167
+
168
+ ### How to find impacted tests when AC changes:
169
+ 1. Note the AC-ID that changed (e.g., AC-1)
170
+ 2. Search this document's "AC to Functional Test Mapping" table
171
+ 3. All FT Test IDs in rows matching that AC-ID need review
172
+ 4. Find corresponding script files using the FT Test ID as describe block name
173
+
174
+ ### Reverse traceability (test to requirement):
175
+ Each test script `describe` block includes the AC-ID in comments:
176
+ ```typescript
177
+ // AC Reference: AC-1
178
+ describe('{PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_001_H', () => { ... });
179
+ ```
180
+
181
+ ---
182
+
183
+ ## Changelog
184
+
185
+ | Date | Changes | Author |
186
+ |------|---------|--------|
187
+ | [created_date] | Initial functional test spec created | @[executor] |