@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,163 +1,163 @@
1
- # /tas-e2e-web $ARGUMENTS
2
-
3
- Vai tro: SE / QA
4
- Generate Playwright E2E test scripts tu mot E2E Scenario markdown file.
5
-
6
- ## QUAN TRONG - Layer 3: Web E2E Scripts
7
- - Tao Playwright test scripts tu E2E-Scenario (markdown)
8
- - Scripts nam trong `apps/web/e2e/flows/`
9
- - REUSE helpers tu Layer 2 functional tests (features/)
10
- - Cross-browser testing (Chromium, Firefox, WebKit)
11
- - Chain functional test steps thanh end-to-end flows
12
-
13
- ## Hanh dong
14
-
15
- ### Buoc 1: Xac dinh Scenario
16
- 1. $ARGUMENTS la path den E2E-Scenario-*.md file
17
- 2. Neu khong co: scan `docs/epics/**/E2E-Scenario-*.md` va `docs/e2e-scenarios/E2E-Scenario-*.md`
18
- 3. List scenarios va hoi user chon
19
-
20
- ### Buoc 2: Kiem tra Prerequisites
21
- 1. Kiem tra `apps/web/` ton tai. Neu khongbao:
22
- > "Web app chua ton tai trong project nay. Neu project chi co mobile, dung /tas-e2e-mobile."
23
- > DUNG LAI, KHONG tao file.
24
- 2. Doc scenario file de lay:
25
- - Scenario steps va flow
26
- - FT ID references
27
- - FT Reuse Map
28
- - Test data per environment
29
- 3. Doc `apps/web/playwright.config.ts` (neu co)
30
-
31
- ### Buoc 3: Tim Functional Test Helpers
32
- Tu FT Reuse Map trong scenario:
33
- 1. Tim source files trong `apps/web/e2e/features/`
34
- 2. Verify helper functions va page objects ton tai
35
- 3. Neu helper khong ton tai tao stub va ghi "TODO: implement helper"
36
- 4. Import map: FT ID → file path → function name
37
-
38
- ### Buoc 4: Generate E2E Script
39
-
40
- **File output**: `apps/web/e2e/flows/{scenario-slug}.spec.ts`
41
-
42
- **Structure**:
43
- ```typescript
44
- /**
45
- * E2E Flow: {Scenario Name}
46
- * Scenario: {Scenario_ID}
47
- * Epic(s): {Epic_ID(s)}
48
- * Type: {single-epic | cross-epic}
49
- *
50
- * Generated by /tas-e2e-web
51
- * Spec: {path to E2E-Scenario-*.md}
52
- */
53
-
54
- import { test, expect, Page } from '@playwright/test';
55
- import { loadTestData, getCredentials } from '../helpers/data-loader';
56
-
57
- // Layer 2 helpers (reuse from functional tests)
58
- import { fillLoginForm, verifyLoginSuccess } from '../features/{epic}/{feature}/helpers';
59
- import { viewAllergenList } from '../features/{epic2}/{feature2}/helpers';
60
-
61
- const testData = loadTestData();
62
-
63
- test.describe('E2E Flow: {Scenario Name}', () => {
64
- test.beforeEach(async ({ page }) => {
65
- await page.goto(testData.baseUrl);
66
- });
67
-
68
- // Main Flow
69
- test.describe('{PROJECT}_E{EPIC}_E2E_001_H: {Flow Title}', () => {
70
- test('Complete flow', async ({ page }) => {
71
- // Step 1: Login (reuses AL_E002_F002_S001_FT_001_H)
72
- const creds = getCredentials();
73
- await fillLoginForm(page, creds.email, creds.password);
74
- await verifyLoginSuccess(page);
75
-
76
- // Step 2: View allergen list (reuses AL_E003_F001_S001_FT_001_H)
77
- await viewAllergenList(page);
78
-
79
- // Step 3: New logic (no FT reference)
80
- await page.getByTestId('scan-button').click();
81
- await expect(page.getByTestId('scan-result')).toBeVisible();
82
- });
83
- });
84
-
85
- // Cross-browser validation
86
- test.describe('{PROJECT}_E{EPIC}_E2E_001_H - Cross-browser', () => {
87
- test('should complete flow on all browsers', async ({ page, browserName }) => {
88
- test.info().annotations.push({ type: 'browser', description: browserName });
89
- // Same flow, validated across browsers via Playwright projects config
90
- });
91
- });
92
-
93
- // Alternate/Error flows
94
- test.describe('{PROJECT}_E{EPIC}_E2E_002_N: {Error Flow}', () => {
95
- test('should handle {error condition}', async ({ page }) => {
96
- // ...
97
- });
98
- });
99
- });
100
- ```
101
-
102
- ### Buoc 5: Update package.json Script
103
- Them hoac update script trong `apps/web/package.json`:
104
- ```json
105
- "e2e:flow:{scenario-slug}": "npx playwright test e2e/flows/{scenario-slug}"
106
- ```
107
-
108
- ### Buoc 6: Generate Execution Report (Optional)
109
- Tu `.tas/templates/E2E-Execution-Report.md`:
110
- - Bao gom browser-specific results
111
- - Viewport testing results
112
- - Performance metrics (LCP, INP, CLS)
113
-
114
- ## File Structure Output
115
- ```
116
- apps/web/e2e/flows/
117
- ├── {scenario-1-slug}.spec.ts
118
- ├── {scenario-2-slug}.spec.ts
119
- └── ...
120
- ```
121
-
122
- ## Reuse Strategy
123
- ```
124
- Layer 2 (features/) Layer 3 (flows/)
125
- ┌───────────────────┐ ┌──────────────────────────┐
126
- │ helpers.ts │──────>│ {scenario}.spec.ts │
127
- │ - fillLogin(page)│ │ import { fillLogin } │
128
- │ - verify(page) │ │ import { viewList } │
129
- └───────────────────┘ │ │
130
- ┌───────────────────┐ │ Step 1: fillLogin(page) │
131
- │ helpers.ts │──────>│ Step 2: viewList(page) │
132
- │ - viewList(page) │ │ Step 3: new logic │
133
- └───────────────────┘ └──────────────────────────┘
134
- ```
135
-
136
- Note: Web helpers nhan `page: Page` parameter (khac voi mobile dung global Detox API).
137
-
138
- ## Chay Tests
139
- ```bash
140
- # Chay E2E flow cu the
141
- yarn e2e:flow:{scenario-slug}
142
-
143
- # Chay tat ca E2E flows
144
- npx playwright test e2e/flows/
145
-
146
- # Chay chi tren Firefox
147
- npx playwright test --project=firefox e2e/flows/{scenario}
148
-
149
- # Chay voi debug UI
150
- npx playwright test --ui e2e/flows/{scenario}
151
-
152
- # Chay va generate HTML report
153
- npx playwright test e2e/flows/{scenario} --reporter=html
154
- ```
155
-
156
- ## Nguyen tac
157
- - PHAI reuse helpers tu Layer 2 khi co the
158
- - Web helpers PHAI nhan `page: Page` parameter (dependency injection)
159
- - Scripts PHAI chay duoc tu CLI
160
- - Neu apps/web/ khong ton tai bao loi graceful, KHONG tao
161
- - Cross-browser: Chromium, Firefox, WebKit (tu playwright.config.ts)
162
- - describe block dung full E2E ID
163
- - import paths: relative tu flows/ len features/
1
+ # /tas-e2e-web $ARGUMENTS
2
+
3
+ Role: SE / QA
4
+ Generate Playwright E2E test scripts from an E2E Scenario markdown file.
5
+
6
+ ## IMPORTANT - Layer 3: Web E2E Scripts
7
+ - Create Playwright test scripts from E2E-Scenario (markdown)
8
+ - Scripts located in `apps/web/e2e/flows/`
9
+ - REUSE helpers from Layer 2 functional tests (features/)
10
+ - Cross-browser testing (Chromium, Firefox, WebKit)
11
+ - Chain functional test steps into end-to-end flows
12
+
13
+ ## Actions
14
+
15
+ ### Step 1: Identify Scenario
16
+ 1. $ARGUMENTS is path to E2E-Scenario-*.md file
17
+ 2. If not provided: scan `docs/epics/**/E2E-Scenario-*.md` and `docs/e2e-scenarios/E2E-Scenario-*.md`
18
+ 3. List scenarios and ask user to choose
19
+
20
+ ### Step 2: Check Prerequisites
21
+ 1. Check `apps/web/` exists. If notreport:
22
+ > "Web app doesn't exist in this project. If project only has mobile, use /tas-e2e-mobile."
23
+ > STOP, DO NOT create file.
24
+ 2. Read scenario file to get:
25
+ - Scenario steps and flow
26
+ - FT ID references
27
+ - FT Reuse Map
28
+ - Test data per environment
29
+ 3. Read `apps/web/playwright.config.ts` (if exists)
30
+
31
+ ### Step 3: Find Functional Test Helpers
32
+ From FT Reuse Map in scenario:
33
+ 1. Find source files in `apps/web/e2e/features/`
34
+ 2. Verify helper functions and page objects exist
35
+ 3. If helper doesn't existcreate stub and note "TODO: implement helper"
36
+ 4. Import map: FT ID → file path → function name
37
+
38
+ ### Step 4: Generate E2E Script
39
+
40
+ **File output**: `apps/web/e2e/flows/{scenario-slug}.spec.ts`
41
+
42
+ **Structure**:
43
+ ```typescript
44
+ /**
45
+ * E2E Flow: {Scenario Name}
46
+ * Scenario: {Scenario_ID}
47
+ * Epic(s): {Epic_ID(s)}
48
+ * Type: {single-epic | cross-epic}
49
+ *
50
+ * Generated by /tas-e2e-web
51
+ * Spec: {path to E2E-Scenario-*.md}
52
+ */
53
+
54
+ import { test, expect, Page } from '@playwright/test';
55
+ import { loadTestData, getCredentials } from '../helpers/data-loader';
56
+
57
+ // Layer 2 helpers (reuse from functional tests)
58
+ import { fillLoginForm, verifyLoginSuccess } from '../features/{epic}/{feature}/helpers';
59
+ import { viewAllergenList } from '../features/{epic2}/{feature2}/helpers';
60
+
61
+ const testData = loadTestData();
62
+
63
+ test.describe('E2E Flow: {Scenario Name}', () => {
64
+ test.beforeEach(async ({ page }) => {
65
+ await page.goto(testData.baseUrl);
66
+ });
67
+
68
+ // Main Flow
69
+ test.describe('{PROJECT}_E{EPIC}_E2E_001_H: {Flow Title}', () => {
70
+ test('Complete flow', async ({ page }) => {
71
+ // Step 1: Login (reuses AL_E002_F002_S001_FT_001_H)
72
+ const creds = getCredentials();
73
+ await fillLoginForm(page, creds.email, creds.password);
74
+ await verifyLoginSuccess(page);
75
+
76
+ // Step 2: View allergen list (reuses AL_E003_F001_S001_FT_001_H)
77
+ await viewAllergenList(page);
78
+
79
+ // Step 3: New logic (no FT reference)
80
+ await page.getByTestId('scan-button').click();
81
+ await expect(page.getByTestId('scan-result')).toBeVisible();
82
+ });
83
+ });
84
+
85
+ // Cross-browser validation
86
+ test.describe('{PROJECT}_E{EPIC}_E2E_001_H - Cross-browser', () => {
87
+ test('should complete flow on all browsers', async ({ page, browserName }) => {
88
+ test.info().annotations.push({ type: 'browser', description: browserName });
89
+ // Same flow, validated across browsers via Playwright projects config
90
+ });
91
+ });
92
+
93
+ // Alternate/Error flows
94
+ test.describe('{PROJECT}_E{EPIC}_E2E_002_N: {Error Flow}', () => {
95
+ test('should handle {error condition}', async ({ page }) => {
96
+ // ...
97
+ });
98
+ });
99
+ });
100
+ ```
101
+
102
+ ### Step 5: Update package.json Script
103
+ Add or update script in `apps/web/package.json`:
104
+ ```json
105
+ "e2e:flow:{scenario-slug}": "npx playwright test e2e/flows/{scenario-slug}"
106
+ ```
107
+
108
+ ### Step 6: Generate Execution Report (Optional)
109
+ From `.tas/templates/E2E-Execution-Report.md`:
110
+ - Include browser-specific results
111
+ - Viewport testing results
112
+ - Performance metrics (LCP, INP, CLS)
113
+
114
+ ## File Structure Output
115
+ ```
116
+ apps/web/e2e/flows/
117
+ ├── {scenario-1-slug}.spec.ts
118
+ ├── {scenario-2-slug}.spec.ts
119
+ └── ...
120
+ ```
121
+
122
+ ## Reuse Strategy
123
+ ```
124
+ Layer 2 (features/) Layer 3 (flows/)
125
+ ┌───────────────────┐ ┌──────────────────────────┐
126
+ │ helpers.ts │──────>│ {scenario}.spec.ts │
127
+ │ - fillLogin(page)│ │ import { fillLogin } │
128
+ │ - verify(page) │ │ import { viewList } │
129
+ └───────────────────┘ │ │
130
+ ┌───────────────────┐ │ Step 1: fillLogin(page) │
131
+ │ helpers.ts │──────>│ Step 2: viewList(page) │
132
+ │ - viewList(page) │ │ Step 3: new logic │
133
+ └───────────────────┘ └──────────────────────────┘
134
+ ```
135
+
136
+ Note: Web helpers receive `page: Page` parameter (unlike mobile using global Detox API).
137
+
138
+ ## Run Tests
139
+ ```bash
140
+ # Run specific E2E flow
141
+ yarn e2e:flow:{scenario-slug}
142
+
143
+ # Run all E2E flows
144
+ npx playwright test e2e/flows/
145
+
146
+ # Run only on Firefox
147
+ npx playwright test --project=firefox e2e/flows/{scenario}
148
+
149
+ # Run with debug UI
150
+ npx playwright test --ui e2e/flows/{scenario}
151
+
152
+ # Run and generate HTML report
153
+ npx playwright test e2e/flows/{scenario} --reporter=html
154
+ ```
155
+
156
+ ## Principles
157
+ - MUST reuse helpers from Layer 2 when possible
158
+ - Web helpers MUST receive `page: Page` parameter (dependency injection)
159
+ - Scripts MUST be runnable from CLI
160
+ - If apps/web/ doesn't existgraceful error, DO NOT create
161
+ - Cross-browser: Chromium, Firefox, WebKit (from playwright.config.ts)
162
+ - describe block uses full E2E ID
163
+ - import paths: relative from flows/ up to features/
@@ -1,102 +1,102 @@
1
- # /tas-e2e $ARGUMENTS
2
-
3
- Vai tro: QA / PE
4
- Generate E2E test scenario documents tu mot Epic hoac user flow description.
5
-
6
- ## QUAN TRONG - Layer 3: E2E Testing
7
- - E2E tests kiem tra TOAN BO flow lien ket giua nhieu features/stories
8
- - E2E scenario PHAI reference FT IDs tu Layer 2 (Functional Tests)
9
- - E2E scripts (tao boi /tas-e2e-mobile hoac /tas-e2e-web) se REUSE helpers tu Layer 2
10
- - Output la markdown scenario file, KHONG phai test code
11
-
12
- ## Hanh dong
13
-
14
- ### Buoc 1: Xac dinh Input
15
- $ARGUMENTS co the la:
16
- - **Epic ID** (vd: "Epic-002", "AL-Epic-002-authentication") → generate scenarios tu tat ca features/stories trong epic
17
- - **Flow description** (vd: "user registration to first scan") → generate cross-epic scenario
18
-
19
- Neu khong co $ARGUMENTS: list cac Epics hien co va hoi user chon.
20
-
21
- ### Buoc 2: Thu thap Context
22
-
23
- #### Neu la Epic ID:
24
- 1. Doc Epic file va tat ca Feature files ben trong
25
- 2. Doc tat ca Story files cua cac Features
26
- 3. Tim tat ca `Func-Test-*.md` files de lay FT IDs
27
-
28
- #### Neu la Flow Description:
29
- 1. Search across `docs/epics/` de tim Features/Stories lien quan
30
- 2. Xac dinh cac Epics lien quan (cross-epic scenario)
31
- 3. Thu thap FT IDs tu Func-Test-*.md files
32
-
33
- ### Buoc 3: Doc template
34
- Doc `.tas/templates/E2E-Scenario.md`
35
- Doc `root/tas.yaml` de lay project code
36
-
37
- ### Buoc 4: Generate Scenario
38
-
39
- #### Naming Convention:
40
- - **Single-epic**: `{PROJECT}_E{EPIC}_E2E_{NNN}_{MODIFIER}`
41
- - Example: `AL_E002_E2E_001_H`
42
- - **Cross-epic**: `{PROJECT}_XEPIC_E2E_{NNN}_{MODIFIER}`
43
- - Example: `AL_XEPIC_E2E_001_H`
44
-
45
- #### Scenario Steps Table:
46
- Moi step PHAI co cot "Builds on FT IDs" de reference Layer 2:
47
-
48
- ```markdown
49
- | Step | Screen/Page | Action | Expected Result | Builds on FT IDs |
50
- |------|-------------|--------|-----------------|-------------------|
51
- | 1 | Login Screen | User logs in | Home screen shown | AL_E002_F002_S001_FT_001_H |
52
- | 2 | Home Screen | View allergen list | List displayed | AL_E003_F001_S001_FT_001_H |
53
- ```
54
-
55
- Neu step KHONG co FT reference → ghi "-" (new logic, chua co func test)
56
-
57
- #### Noi dung generate:
58
- 1. Flow Overview (narrative description)
59
- 2. Scenario Steps table
60
- 3. Step Details (chi tiet tung buoc)
61
- 4. Alternate Flows (neu co)
62
- 5. Error Flows (neu co)
63
- 6. Test Data per environment
64
- 7. Prerequisites checklist
65
- 8. Success Criteria
66
- 9. FT Reuse Map (map step → FT ID → helper function)
67
-
68
- ### Buoc 5: Output File
69
- - **Single-epic**: `docs/epics/{epic-dir}/E2E-Scenario-{NNN}-{slug}.md`
70
- - **Cross-epic**: `docs/e2e-scenarios/E2E-Scenario-{NNN}-{slug}.md`
71
-
72
- Auto-create `docs/e2e-scenarios/` directory neu chua ton tai.
73
-
74
- ### Buoc 6: Prompting
75
- Sau khi generate, hoi user:
76
- - "Co flow phu nao can cover khong?"
77
- - "Co error scenario nao can them khong?"
78
- - "Test data cho cac environment da day du chua?"
79
- - "Co can test tren ca mobile va web khong?"
80
-
81
- ## FT Reuse Map
82
- Moi scenario file co section "FT Reuse Map" de:
83
- - Map scenario step → FT ID → source file → helper function
84
- - /tas-e2e-mobile va /tas-e2e-web doc section nay de import helpers tu Layer 2
85
-
86
- ```markdown
87
- ## FT Reuse Map
88
- | Step | FT ID | Source File | Helper Function |
89
- |------|-------|-------------|-----------------|
90
- | 1 | AL_E002_F002_S001_FT_001_H | features/auth/login/helpers.ts | fillLoginForm() |
91
- | 2 | AL_E003_F001_S001_FT_001_H | features/home/allergens/helpers.ts | viewAllergenList() |
92
- ```
93
-
94
- ## Status Flow
95
- Draft → Ready → Implemented → Verified
96
-
97
- ## Nguyen tac
98
- - Output la MARKDOWN scenario, KHONG phai test code
99
- - Test code duoc tao boi /tas-e2e-mobile hoac /tas-e2e-web
100
- - Moi step NEN reference FT IDs khi co the (de reuse, khong viet lai)
101
- - Scenario phai testable: co preconditions, test data, success criteria ro rang
102
- - Cross-epic scenarios dung prefix XEPIC thay vi Epic number
1
+ # /tas-e2e $ARGUMENTS
2
+
3
+ Role: QA / PE
4
+ Generate E2E test scenario documents from an Epic or user flow description.
5
+
6
+ ## IMPORTANT - Layer 3: E2E Testing
7
+ - E2E tests verify ENTIRE flow linking multiple features/stories
8
+ - E2E scenario MUST reference FT IDs from Layer 2 (Functional Tests)
9
+ - E2E scripts (created by /tas-e2e-mobile or /tas-e2e-web) will REUSE helpers from Layer 2
10
+ - Output is markdown scenario file, NOT test code
11
+
12
+ ## Actions
13
+
14
+ ### Step 1: Determine Input
15
+ $ARGUMENTS can be:
16
+ - **Epic ID** (e.g., "Epic-002", "AL-Epic-002-authentication") → generate scenarios from all features/stories in epic
17
+ - **Flow description** (e.g., "user registration to first scan") → generate cross-epic scenario
18
+
19
+ If no $ARGUMENTS: list existing Epics and ask user to choose.
20
+
21
+ ### Step 2: Gather Context
22
+
23
+ #### If Epic ID:
24
+ 1. Read Epic file and all Feature files within
25
+ 2. Read all Story files of those Features
26
+ 3. Find all `Func-Test-*.md` files to get FT IDs
27
+
28
+ #### If Flow Description:
29
+ 1. Search across `docs/epics/` to find related Features/Stories
30
+ 2. Identify related Epics (cross-epic scenario)
31
+ 3. Collect FT IDs from Func-Test-*.md files
32
+
33
+ ### Step 3: Read template
34
+ Read `.tas/templates/E2E-Scenario.md`
35
+ Read `root/tas.yaml` to get project code
36
+
37
+ ### Step 4: Generate Scenario
38
+
39
+ #### Naming Convention:
40
+ - **Single-epic**: `{PROJECT}_E{EPIC}_E2E_{NNN}_{MODIFIER}`
41
+ - Example: `AL_E002_E2E_001_H`
42
+ - **Cross-epic**: `{PROJECT}_XEPIC_E2E_{NNN}_{MODIFIER}`
43
+ - Example: `AL_XEPIC_E2E_001_H`
44
+
45
+ #### Scenario Steps Table:
46
+ Each step MUST have "Builds on FT IDs" column to reference Layer 2:
47
+
48
+ ```markdown
49
+ | Step | Screen/Page | Action | Expected Result | Builds on FT IDs |
50
+ |------|-------------|--------|-----------------|-------------------|
51
+ | 1 | Login Screen | User logs in | Home screen shown | AL_E002_F002_S001_FT_001_H |
52
+ | 2 | Home Screen | View allergen list | List displayed | AL_E003_F001_S001_FT_001_H |
53
+ ```
54
+
55
+ If step has NO FT reference → write "-" (new logic, no func test yet)
56
+
57
+ #### Generated content:
58
+ 1. Flow Overview (narrative description)
59
+ 2. Scenario Steps table
60
+ 3. Step Details (detail each step)
61
+ 4. Alternate Flows (if any)
62
+ 5. Error Flows (if any)
63
+ 6. Test Data per environment
64
+ 7. Prerequisites checklist
65
+ 8. Success Criteria
66
+ 9. FT Reuse Map (map step → FT ID → helper function)
67
+
68
+ ### Step 5: Output File
69
+ - **Single-epic**: `docs/epics/{epic-dir}/E2E-Scenario-{NNN}-{slug}.md`
70
+ - **Cross-epic**: `docs/e2e-scenarios/E2E-Scenario-{NNN}-{slug}.md`
71
+
72
+ Auto-create `docs/e2e-scenarios/` directory if not exists.
73
+
74
+ ### Step 6: Prompting
75
+ After generating, ask user:
76
+ - "Any alternate flows to cover?"
77
+ - "Any error scenarios to add?"
78
+ - "Test data for all environments sufficient?"
79
+ - "Need to test on both mobile and web?"
80
+
81
+ ## FT Reuse Map
82
+ Each scenario file has "FT Reuse Map" section to:
83
+ - Map scenario step → FT ID → source file → helper function
84
+ - /tas-e2e-mobile and /tas-e2e-web read this section to import helpers from Layer 2
85
+
86
+ ```markdown
87
+ ## FT Reuse Map
88
+ | Step | FT ID | Source File | Helper Function |
89
+ |------|-------|-------------|-----------------|
90
+ | 1 | AL_E002_F002_S001_FT_001_H | features/auth/login/helpers.ts | fillLoginForm() |
91
+ | 2 | AL_E003_F001_S001_FT_001_H | features/home/allergens/helpers.ts | viewAllergenList() |
92
+ ```
93
+
94
+ ## Status Flow
95
+ Draft → Ready → Implemented → Verified
96
+
97
+ ## Principles
98
+ - Output is MARKDOWN scenario, NOT test code
99
+ - Test code created by /tas-e2e-mobile or /tas-e2e-web
100
+ - Each step SHOULD reference FT IDs when possible (to reuse, not rewrite)
101
+ - Scenario must be testable: has preconditions, test data, clear success criteria
102
+ - Cross-epic scenarios use XEPIC prefix instead of Epic number
@@ -1,35 +1,35 @@
1
- # /tas-epic $ARGUMENTS
2
-
3
- Vai trò: PE - Product Engineer
4
- Tạo mới hoặc cập nhật Epic document.
5
-
6
- ## Prerequisite
7
- - docs/prd.md phải tồn tại
8
-
9
- ## Hành động
10
- 1. Cần context từ root/tas.yaml docs/prd.md
11
- 2. Cần context từ .tas/templates/Epic.md
12
- 3. Xác định chế độ dựa vào $ARGUMENTS:
13
-
14
- ### Chế độ CREATE ($ARGUMENTS tả Epic mới, hoặc không $ARGUMENTS):
15
- 4. Nếu không $ARGUMENTS, hỏi user tả Epic.
16
- 5. Đọc project.code từ root/tas.yaml. Quét docs/epics/ để xác định số thứ tự.
17
- 6. Tạo thư mục docs/epics/{code}-Epic-{NNN}-{slug}/
18
- 7. Tạo file docs/epics/{code}-Epic-{NNN}-{slug}/{code}-Epic-{NNN}-{slug}.md
19
- 8. Cập nhật `project-status.yaml` theo `.claude/rules/common/project-status.md` — thêm entry vào `epics`.
20
-
21
- ### Chế độ UPDATE ($ARGUMENTS Epic ID, dụ: "Epic-001"):
22
- 4. Tìm thư mục docs/epics/{code}-Epic-001-*/
23
- 5. Cần context từ file Epic hiện tại
24
- 6. Hỏi user cần thay đổi (cập nhật scope, thêm feature, đổi status...)
25
- 7. Cập nhật file, thêm changelog
26
- 8. Cập nhật `project-status.yaml` theo `.claude/rules/common/project-status.md` — cập nhật `epics.{EPIC_ID}.status`.
27
-
28
- ## Nguyên tắc
29
- - Mỗi Epic map với một business capability trong PRD
30
- - Epic KHÔNG chứa chi tiết kỹ thuật, chỉ chứa business value
31
- - Ước lượng effort ở mức T-shirt size: S/M/L/XL
32
-
33
- ## Bước cuối — Token Log
34
-
35
- Invoke skill `token-logger`: ghi AI Usage Log vào file Epic đang làm việc.
1
+ # /tas-epic $ARGUMENTS
2
+
3
+ Role: PE - Product Engineer
4
+ Create or update Epic document.
5
+
6
+ ## Prerequisite
7
+ - docs/prd.md must exist
8
+
9
+ ## Actions
10
+ 1. Need context from root/tas.yaml and docs/prd.md
11
+ 2. Need context from .tas/templates/Epic.md
12
+ 3. Determine mode based on $ARGUMENTS:
13
+
14
+ ### CREATE mode ($ARGUMENTS is new Epic description, or no $ARGUMENTS):
15
+ 4. If no $ARGUMENTS, ask user for Epic description.
16
+ 5. Read project.code from root/tas.yaml. Scan docs/epics/ to determine sequence number.
17
+ 6. Create directory docs/epics/{code}-Epic-{NNN}-{slug}/
18
+ 7. Create file docs/epics/{code}-Epic-{NNN}-{slug}/{code}-Epic-{NNN}-{slug}.md
19
+ 8. Update `project-status.yaml` per `.claude/rules/common/project-status.md` — add entry to `epics`.
20
+
21
+ ### UPDATE mode ($ARGUMENTS is Epic ID, e.g., "Epic-001"):
22
+ 4. Find directory docs/epics/{code}-Epic-001-*/
23
+ 5. Need context from current Epic file
24
+ 6. Ask user what needs changing (update scope, add feature, change status...)
25
+ 7. Update file, add changelog
26
+ 8. Update `project-status.yaml` per `.claude/rules/common/project-status.md` — update `epics.{EPIC_ID}.status`.
27
+
28
+ ## Principles
29
+ - Each Epic maps to one business capability in PRD
30
+ - Epic does NOT contain technical details, only business value
31
+ - Effort estimation at T-shirt size level: S/M/L/XL
32
+
33
+ ## Final Step — Token Log
34
+
35
+ Invoke skill `token-logger`: write AI Usage Log to working Epic file.