@torus-engineering/tas-kit 1.10.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 (63) 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 -87
  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 +334 -334
  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/project-status-example.yaml +3 -3
  47. package/.tas/tas-example.yaml +126 -126
  48. package/.tas/templates/ADR.md +16 -16
  49. package/.tas/templates/API-Test-Spec.md +3 -3
  50. package/.tas/templates/Bug.md +12 -12
  51. package/.tas/templates/Design-Spec.md +8 -8
  52. package/.tas/templates/E2E-Execution-Report.md +1 -1
  53. package/.tas/templates/Epic.md +1 -1
  54. package/.tas/templates/Feature.md +10 -10
  55. package/.tas/templates/Func-Test-Spec.md +3 -3
  56. package/.tas/templates/SAD.md +106 -106
  57. package/.tas/templates/Security-Report.md +3 -3
  58. package/.tas/templates/Story.md +9 -9
  59. package/.tas/tools/tas-ado-readme.md +169 -169
  60. package/.tas/tools/tas-ado.py +1 -1
  61. package/CLAUDE-Example.md +29 -53
  62. package/README.md +334 -334
  63. package/package.json +1 -1
@@ -1,47 +1,47 @@
1
- # /tas-feature $ARGUMENTS
2
-
3
- Vai trò: PE - Product Engineer
4
- Tạo mới hoặc cập nhật Feature document, bao gồm thiết kế Integration Test E2E/Acceptance Test.
5
-
6
- ## Prerequisite
7
- - Ít nhất một Epic phải tồn tại trong docs/epics/
8
-
9
- ## Hành động
10
- 1. Cần context từ root/tas.yaml
11
- 2. Cần context từ .tas/templates/Feature.md
12
- 3. Xác định chế độ dựa vào $ARGUMENTS:
13
-
14
- ### Chế độ CREATE ($ARGUMENTS tả Feature mới, hoặc không $ARGUMENTS):
15
- 4. Đọc project.code từ root/tas.yaml. Liệt các Epic hiện có, hỏi user Feature này thuộc Epic nào.
16
- 5. Quét thư mục Epic đã chọn để xác định số thứ tự Feature.
17
- 6. Tạo thư mục docs/epics/{code}-Epic-{NNN}-{slug}/{code}-Feature-{NNN}-{slug}/
18
- 7. Tạo file {code}-Feature-{NNN}-{slug}.md trong thư mục đó
19
- 8. Sau khi PE điền tả acceptance criteria, TỰ ĐỘNG chuyển sang thiết kế test:
20
- a. **Integration Test Cases**: Hỏi PE:
21
- - "Feature này tương tác với service/module nào khác?"
22
- - "Các flow liên kết giữa stories cần test những gì?"
23
- - " data flow nào cần verify end-to-end trong feature này?"
24
- Ghi vào section Integration Test Cases.
25
- b. **E2E / Acceptance Test Cases**: Hỏi PE:
26
- - "User scenario chính để verify feature này trên Staging là gì?"
27
- - " scenario nào cần test với data thật hoặc gần thật?"
28
- - "Acceptance criteria nào cần PE verify thủ công?"
29
- Ghi vào section E2E Test Cases. Đây checklist PE dùng Phase 2 khi chạy /tas-verify.
30
- 9. Cập nhật `project-status.yaml` theo `.claude/rules/common/project-status.md` — thêm entry vào `epics.{EPIC_ID}.features`.
31
-
32
- ### Chế độ UPDATE ($ARGUMENTS Feature ID, dụ: "Feature-003"):
33
- 4. Tìm file Feature trong cây docs/epics/ (dùng glob)
34
- 5. Cần context từ file Feature hiện tại
35
- 6. Hỏi user cần thay đổi (thêm story, cập nhật AC, thêm test cases, đổi status...)
36
- 7. Cập nhật file, thêm changelog
37
- 8. Cập nhật `project-status.yaml` theo `.claude/rules/common/project-status.md` — cập nhật `epics.{EPIC_ID}.features.{FEATURE_ID}.status`.
38
-
39
- ## Nguyên tắc
40
- - Feature một chức năng cụ thể, thể demo được
41
- - Feature PHẢI acceptance criteria rõ ràng, testable
42
- - Integration Test Cases PHẢI cover các flow liên kết giữa stories
43
- - E2E Test Cases PHẢI đủ để PE verify feature trên Staging Phase 2
44
-
45
- ## Bước cuối — Token Log
46
-
47
- Invoke skill `token-logger`: ghi AI Usage Log vào file Feature đang làm việc.
1
+ # /tas-feature $ARGUMENTS
2
+
3
+ Role: PE - Product Engineer
4
+ Create or update Feature document, including Integration Test and E2E/Acceptance Test design.
5
+
6
+ ## Prerequisite
7
+ - At least one Epic must exist in docs/epics/
8
+
9
+ ## Actions
10
+ 1. Need context from root/tas.yaml
11
+ 2. Need context from .tas/templates/Feature.md
12
+ 3. Determine mode based on $ARGUMENTS:
13
+
14
+ ### CREATE mode ($ARGUMENTS is new Feature description, or no $ARGUMENTS):
15
+ 4. Read project.code from root/tas.yaml. List existing Epics, ask user which Epic this Feature belongs to.
16
+ 5. Scan selected Epic directory to determine Feature sequence number.
17
+ 6. Create directory docs/epics/{code}-Epic-{NNN}-{slug}/{code}-Feature-{NNN}-{slug}/
18
+ 7. Create file {code}-Feature-{NNN}-{slug}.md in that directory
19
+ 8. After PE fills description and acceptance criteria, AUTOMATICALLY switch to test design:
20
+ a. **Integration Test Cases**: Ask PE:
21
+ - "Which services/modules does this Feature interact with?"
22
+ - "What linked flows between stories need testing?"
23
+ - "Any data flows needing end-to-end verification within this feature?"
24
+ Write to Integration Test Cases section.
25
+ b. **E2E / Acceptance Test Cases**: Ask PE:
26
+ - "What's the main user scenario to verify this feature on Staging?"
27
+ - "Any scenarios needing real or near-real data testing?"
28
+ - "Which acceptance criteria need manual PE verification?"
29
+ Write to E2E Test Cases section. This is the checklist PE uses in Phase 2 when running /tas-verify.
30
+ 9. Update `project-status.yaml` per `.claude/rules/common/project-status.md` — add entry to `epics.{EPIC_ID}.features`.
31
+
32
+ ### UPDATE mode ($ARGUMENTS is Feature ID, e.g., "Feature-003"):
33
+ 4. Find Feature file in docs/epics/ tree (using glob)
34
+ 5. Need context from current Feature file
35
+ 6. Ask user what needs changing (add story, update AC, add test cases, change status...)
36
+ 7. Update file, add changelog
37
+ 8. Update `project-status.yaml` per `.claude/rules/common/project-status.md` — update `epics.{EPIC_ID}.features.{FEATURE_ID}.status`.
38
+
39
+ ## Principles
40
+ - Feature is a specific function that can be demoed
41
+ - Feature MUST have clear, testable acceptance criteria
42
+ - Integration Test Cases MUST cover linked flows between stories
43
+ - E2E Test Cases MUST be sufficient for PE to verify feature on Staging in Phase 2
44
+
45
+ ## Final Step — Token Log
46
+
47
+ Invoke skill `token-logger`: write AI Usage Log to working Feature file.
@@ -1,51 +1,51 @@
1
- # /tas-fix $ARGUMENTS
2
-
3
- Vai trò: SE - Software Engineer
4
- Quick fix cho bug nhỏ hoặc lỗi ràng không cần tạo ticket, không cần full lifecycle.
5
- Dùng khi: solo dev, hotfix nhanh, bug tìm thấy trong lúc dev.
6
- Khác với /tas-bug: không tạo Bug file, không track status, không deploy flow.
7
-
8
- ## Stack Detection
9
- Đọc `.claude/rules/common/stack-detection.md`.
10
-
11
- ## Hành động
12
-
13
- ### 1. Hiểu bug
14
- $ARGUMENTS tả lỗi, error message, hoặc file:line_number.
15
- - Nếu error message/stack trace: parse ngay, xác định file dòng lỗi
16
- - Nếu chỉ tả: hỏi 1 câu duy nhất để làm rõ (reproduce steps hoặc expected vs actual)
17
- - KHÔNG hỏi nhiều hơn 1 câu
18
-
19
- ### 2. Diagnose (tối đa 3 file đọc)
20
- - Đọc file lỗi và các file liên quan trực tiếp
21
- - Xác định root cause trong 1-2 câu ngắn
22
- - KHÔNG đọc toàn bộ project, KHÔNG quét cấu trúc folder
23
- - Nếu cần đọc thêm file ngoài 3 file đầu tiên: hỏi user xác nhận
24
-
25
- ### 3. Fix với regression test
26
-
27
- Trước khi fix, đọc các rules liên quan:
28
- - `.claude/rules/common/security.md` — kiểm tra fix tạo ra security risk không
29
- - `.claude/rules/common/testing.md` — pattern viết regression test
30
- - `.claude/rules/[lang_rules]/coding-style.md` — conventions của stack hiện tại (nếu xác định được)
31
-
32
- Sau đó:
33
- a. Viết 1 test case tối thiểu reproduce bug (nếu project test framework)
34
- b. Xác nhận test FAIL
35
- c. Fix code đúng root cause
36
- d. Xác nhận test PASS
37
- e. Chạy nhanh test suite nếu (để check regression)
38
-
39
- ### 4. Wrap up
40
- - Output commit message: `fix: < tả ngắn gọn>`
41
- - Nhắc: "Nếu bug này khả năng tái phát hoặc ảnh hưởng production, cân nhắc dùng /tas-bug để track đầy đủ."
42
-
43
- ## Nguyên tắc
44
- - Tổng số file đọc ≤ 3 trừ khi được cho phép
45
- - Fix đúng root cause, KHÔNG patch symptom
46
- - Nếu fix kéo theo thay đổi architecture dừng, gợi ý dùng /tas-bug + /tas-adr
47
- - Nếu bug thuộc production severity cao dừng, gợi ý dùng /tas-bug với severity Critical/High
48
-
49
- ## Bước cuối — Token Log
50
-
51
- Invoke skill `token-logger`: ghi AI Usage Log vào file Story hoặc Bug liên quan (nếu ).
1
+ # /tas-fix $ARGUMENTS
2
+
3
+ Role: SE - Software Engineer
4
+ Quick fix for small bugs or obvious errorsno ticket needed, no full lifecycle.
5
+ Use when: solo dev, quick hotfix, bug found during development.
6
+ Differs from /tas-bug: no Bug file created, no status tracking, no deploy flow.
7
+
8
+ ## Stack Detection
9
+ Read `.claude/rules/common/stack-detection.md`.
10
+
11
+ ## Actions
12
+
13
+ ### 1. Understand bug
14
+ $ARGUMENTS is error description, error message, or file:line_number.
15
+ - If error message/stack trace provided: parse immediately, identify error file and line
16
+ - If only description: ask exactly 1 clarifying question (reproduce steps or expected vs actual)
17
+ - DO NOT ask more than 1 question
18
+
19
+ ### 2. Diagnose (max 3 files read)
20
+ - Read error file and directly related files
21
+ - Identify root cause in 1-2 short sentences
22
+ - DO NOT read entire project, DO NOT scan folder structure
23
+ - If need to read more files beyond first 3: ask user confirmation
24
+
25
+ ### 3. Fix with regression test
26
+
27
+ Before fixing, read relevant rules:
28
+ - `.claude/rules/common/security.md` — check if fix creates security risks
29
+ - `.claude/rules/common/testing.md` — regression test writing patterns
30
+ - `.claude/rules/[lang_rules]/coding-style.md` — current stack conventions (if identifiable)
31
+
32
+ Then:
33
+ a. Write 1 minimal test case reproducing bug (if project has test framework)
34
+ b. Confirm test FAILS
35
+ c. Fix code at root cause
36
+ d. Confirm test PASSES
37
+ e. Quick run of test suite if available (to check regression)
38
+
39
+ ### 4. Wrap up
40
+ - Output commit message: `fix: <short description>`
41
+ - Remind: "If this bug may recur or affects production, consider using /tas-bug for full tracking."
42
+
43
+ ## Principles
44
+ - Total files read ≤ 3 unless permitted
45
+ - Fix at root cause, DO NOT patch symptom
46
+ - If fix leads to architecture changestop, suggest using /tas-bug + /tas-adr
47
+ - If bug is in production with high severity → stop, suggest using /tas-bug with severity Critical/High
48
+
49
+ ## Final Step — Token Log
50
+
51
+ Invoke skill `token-logger`: write AI Usage Log to related Story or Bug file (if any).
@@ -1,144 +1,144 @@
1
- # /tas-functest-mobile $ARGUMENTS
2
-
3
- Vai tro: SE / QA
4
- Generate tat ca Detox automation test scripts cho mot mobile Feature.
5
-
6
- ## QUAN TRONG - Layer 2: Mobile Functional Test Scripts
7
- - Tao Detox test scripts tu Func-Test-Spec (markdown)
8
- - Scripts nam trong `apps/mobile/e2e/features/`
9
- - Reusable helpers duoc export de Layer 3 (E2E) tai su dung
10
- - Data hardcoded trong test, credentials tu .env
11
-
12
- ## Hanh dong
13
-
14
- ### Buoc 1: Xac dinh Feature
15
- 1. $ARGUMENTS la Feature ID hoac file path
16
- 2. Neu khong co: scan `docs/epics/**/Feature-*.md` tim features co status In Progress
17
- 3. Doc Feature file de lay Epic/Feature numbers va danh sach Stories
18
-
19
- ### Buoc 2: Kiem tra Prerequisites
20
- 1. Kiem tra `apps/mobile/` ton tai. Neu khongbao loi:
21
- > "Mobile app chua ton tai trong project nay. Vui long tao apps/mobile/ truoc."
22
- 2. Tim tat ca `Func-Test-*.md` files trong Feature directory:
23
- ```
24
- docs/epics/{epic-dir}/{feature-dir}/Func-Test-*.md
25
- ```
26
- 3. Neu khong co Func-Test-Spec naobao loi:
27
- > "Chua co Func-Test-Spec nao cho Feature nay. Chay /tas-functest {story-ID} truoc."
28
- 4. Doc `apps/mobile/e2e/test-ids.ts` de biet testID hien co
29
- 5. Doc `apps/mobile/e2e/helpers/data-loader.ts` va `test-utils.ts` de hieu patterns
30
-
31
- ### Buoc 3: Aggregate FT Test Cases
32
- - Tu tat ca Func-Test-Spec files, tong hop danh sach FT test cases
33
- - Nhom theo Story
34
- - Lay test data requirements tu moi spec
35
-
36
- ### Buoc 4: Generate Test Scripts
37
- Voi MOI Story co Func-Test-Spec:
38
-
39
- **File output**: `apps/mobile/e2e/features/{epic-slug}/{feature-slug}/{story-slug}.func.e2e.ts`
40
-
41
- **Structure**:
42
- ```typescript
43
- /**
44
- * Functional Tests: {Story Name}
45
- * Story: {Story_ID}
46
- * Feature: {Feature_ID}
47
- * Epic: {Epic_ID}
48
- *
49
- * Generated by /tas-functest-mobile
50
- * Spec: docs/epics/{epic-dir}/{feature-dir}/Func-Test-{story-slug}.md
51
- */
52
-
53
- import { device, element, expect, by, waitFor } from 'detox';
54
- import { TEST_IDS } from '../../../test-ids';
55
- import { loadTestData, getCredentials } from '../../../helpers/data-loader';
56
- import { login, navigateTo } from '../../../helpers/test-utils';
57
-
58
- const testData = loadTestData();
59
-
60
- describe('{Feature Name} - {Story Name}', () => {
61
- beforeAll(async () => {
62
- await device.launchApp({ newInstance: true });
63
- });
64
-
65
- beforeEach(async () => {
66
- await device.reloadReactNative();
67
- });
68
-
69
- // AC Reference: AC-1
70
- describe('{PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_001_H', () => {
71
- it('should {description from spec}', async () => {
72
- // Given: {precondition}
73
- // When: {action}
74
- // Then: {expected}
75
- });
76
- });
77
- });
78
- ```
79
-
80
- ### Buoc 5: Update test-ids.ts (neu can)
81
- - Neu test cases can testID chua co trong test-ids.ts
82
- - Them testID moi theo naming convention hien tai
83
- - Giu nguyen structure: nested object voi dot notation
84
-
85
- ### Buoc 6: Generate Feature Helpers
86
- Tao file `apps/mobile/e2e/features/{epic-slug}/{feature-slug}/helpers.ts`:
87
- ```typescript
88
- /**
89
- * Reusable helpers cho {Feature Name}
90
- * Duoc tai su dung boi Layer 3 E2E scripts
91
- */
92
-
93
- export async function {featureSpecificHelper}() {
94
- // Helper logic extracted from functional tests
95
- }
96
- ```
97
-
98
- ### Buoc 7: Update package.json Script
99
- Them hoac update script trong `apps/mobile/package.json`:
100
- ```json
101
- "functest:mobile:{feature-slug}": "detox test --configuration ios.sim.debug --testPathPattern='e2e/features/{epic-slug}/{feature-slug}'"
102
- ```
103
-
104
- ### Buoc 8: Generate Index
105
- Tao `apps/mobile/e2e/features/{epic-slug}/{feature-slug}/index.ts`:
106
- ```typescript
107
- export * from './helpers';
108
- ```
109
-
110
- ## File Structure Output
111
- ```
112
- apps/mobile/e2e/features/
113
- └── {epic-slug}/
114
- └── {feature-slug}/
115
- ├── {story-1-slug}.func.e2e.ts
116
- ├── {story-2-slug}.func.e2e.ts
117
- ├── helpers.ts
118
- └── index.ts
119
- ```
120
-
121
- ## Test Data Convention
122
- - **Hardcoded values**: Truc tiep trong test (vd: "invalid@email", "short")
123
- - **Credentials**: `const creds = getCredentials();` → password tu process.env
124
- - **Environment data**: `const testData = loadTestData();` → doc tu test-data.{env}.json
125
- - **KHONG BAO GIO** hardcode passwords/tokens trong test files
126
-
127
- ## Chay Tests
128
- ```bash
129
- # Chay tat ca func tests cho feature
130
- yarn functest:mobile:{feature-slug}
131
-
132
- # Chay chi mot story
133
- npx detox test --configuration ios.sim.debug --testPathPattern='e2e/features/{epic}/{feature}/{story}'
134
-
135
- # Chay voi Android
136
- npx detox test --configuration android.emu.debug --testPathPattern='e2e/features/{epic}/{feature}'
137
- ```
138
-
139
- ## Nguyen tac
140
- - Script PHAI chay duoc ngay tu CLI, KHONG can cua so Claude
141
- - Moi describe block dung full FT ID de grep duoc
142
- - Helpers PHAI export de Layer 3 reuse
143
- - KHONG import tu Layer 3 (flows/), chi export LEN Layer 3
144
- - Neu apps/mobile/ khong ton tai bao loi graceful, KHONG tao
1
+ # /tas-functest-mobile $ARGUMENTS
2
+
3
+ Role: SE / QA
4
+ Generate all Detox automation test scripts for a mobile Feature.
5
+
6
+ ## IMPORTANT - Layer 2: Mobile Functional Test Scripts
7
+ - Create Detox test scripts from Func-Test-Spec (markdown)
8
+ - Scripts located in `apps/mobile/e2e/features/`
9
+ - Reusable helpers exported for Layer 3 (E2E) reuse
10
+ - Hardcoded data in tests, credentials from .env
11
+
12
+ ## Actions
13
+
14
+ ### Step 1: Identify Feature
15
+ 1. $ARGUMENTS is Feature ID or file path
16
+ 2. If not provided: scan `docs/epics/**/Feature-*.md` for features with status In Progress
17
+ 3. Read Feature file to get Epic/Feature numbers and list of Stories
18
+
19
+ ### Step 2: Check Prerequisites
20
+ 1. Check `apps/mobile/` exists. If noterror:
21
+ > "Mobile app doesn't exist in this project. Please create apps/mobile/ first."
22
+ 2. Find all `Func-Test-*.md` files in Feature directory:
23
+ ```
24
+ docs/epics/{epic-dir}/{feature-dir}/Func-Test-*.md
25
+ ```
26
+ 3. If no Func-Test-Spec existserror:
27
+ > "No Func-Test-Spec for this Feature yet. Run /tas-functest {story-ID} first."
28
+ 4. Read `apps/mobile/e2e/test-ids.ts` to know existing testIDs
29
+ 5. Read `apps/mobile/e2e/helpers/data-loader.ts` and `test-utils.ts` to understand patterns
30
+
31
+ ### Step 3: Aggregate FT Test Cases
32
+ - From all Func-Test-Spec files, aggregate list of FT test cases
33
+ - Group by Story
34
+ - Get test data requirements from each spec
35
+
36
+ ### Step 4: Generate Test Scripts
37
+ For EACH Story with Func-Test-Spec:
38
+
39
+ **File output**: `apps/mobile/e2e/features/{epic-slug}/{feature-slug}/{story-slug}.func.e2e.ts`
40
+
41
+ **Structure**:
42
+ ```typescript
43
+ /**
44
+ * Functional Tests: {Story Name}
45
+ * Story: {Story_ID}
46
+ * Feature: {Feature_ID}
47
+ * Epic: {Epic_ID}
48
+ *
49
+ * Generated by /tas-functest-mobile
50
+ * Spec: docs/epics/{epic-dir}/{feature-dir}/Func-Test-{story-slug}.md
51
+ */
52
+
53
+ import { device, element, expect, by, waitFor } from 'detox';
54
+ import { TEST_IDS } from '../../../test-ids';
55
+ import { loadTestData, getCredentials } from '../../../helpers/data-loader';
56
+ import { login, navigateTo } from '../../../helpers/test-utils';
57
+
58
+ const testData = loadTestData();
59
+
60
+ describe('{Feature Name} - {Story Name}', () => {
61
+ beforeAll(async () => {
62
+ await device.launchApp({ newInstance: true });
63
+ });
64
+
65
+ beforeEach(async () => {
66
+ await device.reloadReactNative();
67
+ });
68
+
69
+ // AC Reference: AC-1
70
+ describe('{PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_001_H', () => {
71
+ it('should {description from spec}', async () => {
72
+ // Given: {precondition}
73
+ // When: {action}
74
+ // Then: {expected}
75
+ });
76
+ });
77
+ });
78
+ ```
79
+
80
+ ### Step 5: Update test-ids.ts (if needed)
81
+ - If test cases need testID not in test-ids.ts
82
+ - Add new testID per current naming convention
83
+ - Keep structure: nested object with dot notation
84
+
85
+ ### Step 6: Generate Feature Helpers
86
+ Create file `apps/mobile/e2e/features/{epic-slug}/{feature-slug}/helpers.ts`:
87
+ ```typescript
88
+ /**
89
+ * Reusable helpers for {Feature Name}
90
+ * Exported for Layer 3 E2E scripts reuse
91
+ */
92
+
93
+ export async function {featureSpecificHelper}() {
94
+ // Helper logic extracted from functional tests
95
+ }
96
+ ```
97
+
98
+ ### Step 7: Update package.json Script
99
+ Add or update script in `apps/mobile/package.json`:
100
+ ```json
101
+ "functest:mobile:{feature-slug}": "detox test --configuration ios.sim.debug --testPathPattern='e2e/features/{epic-slug}/{feature-slug}'"
102
+ ```
103
+
104
+ ### Step 8: Generate Index
105
+ Create `apps/mobile/e2e/features/{epic-slug}/{feature-slug}/index.ts`:
106
+ ```typescript
107
+ export * from './helpers';
108
+ ```
109
+
110
+ ## File Structure Output
111
+ ```
112
+ apps/mobile/e2e/features/
113
+ └── {epic-slug}/
114
+ └── {feature-slug}/
115
+ ├── {story-1-slug}.func.e2e.ts
116
+ ├── {story-2-slug}.func.e2e.ts
117
+ ├── helpers.ts
118
+ └── index.ts
119
+ ```
120
+
121
+ ## Test Data Convention
122
+ - **Hardcoded values**: Directly in test (e.g., "invalid@email", "short")
123
+ - **Credentials**: `const creds = getCredentials();` → password from process.env
124
+ - **Environment data**: `const testData = loadTestData();` → read from test-data.{env}.json
125
+ - **NEVER** hardcode passwords/tokens in test files
126
+
127
+ ## Run Tests
128
+ ```bash
129
+ # Run all func tests for feature
130
+ yarn functest:mobile:{feature-slug}
131
+
132
+ # Run only one story
133
+ npx detox test --configuration ios.sim.debug --testPathPattern='e2e/features/{epic}/{feature}/{story}'
134
+
135
+ # Run with Android
136
+ npx detox test --configuration android.emu.debug --testPathPattern='e2e/features/{epic}/{feature}'
137
+ ```
138
+
139
+ ## Principles
140
+ - Script MUST be runnable directly from CLI, WITHOUT Claude window
141
+ - Each describe block uses full FT ID for grep-ability
142
+ - Helpers MUST export for Layer 3 reuse
143
+ - DO NOT import from Layer 3 (flows/), only export UP to Layer 3
144
+ - If apps/mobile/ doesn't existgraceful error, DO NOT create