@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.
- package/.tas/README.md +70 -70
- package/{.claude → .tas/_platform/claude-code}/settings.json +0 -12
- package/{.claude → .tas/_platform}/hooks/code-quality.js +1 -1
- package/{.claude → .tas/_platform}/hooks/session-end.js +20 -25
- package/.tas/commands/ado-create.md +28 -0
- package/.tas/commands/ado-delete.md +22 -0
- package/.tas/commands/ado-get.md +20 -0
- package/.tas/commands/ado-status.md +18 -0
- package/.tas/commands/ado-update.md +27 -0
- package/.tas/commands/tas-adr.md +33 -0
- package/.tas/commands/tas-apitest-plan.md +173 -0
- package/.tas/commands/tas-apitest.md +143 -0
- package/.tas/commands/tas-brainstorm.md +19 -0
- package/.tas/commands/tas-bug.md +113 -0
- package/.tas/commands/tas-design.md +37 -0
- package/.tas/commands/tas-dev.md +125 -0
- package/{.claude → .tas}/commands/tas-e2e-mobile.md +155 -155
- package/{.claude → .tas}/commands/tas-e2e-web.md +163 -163
- package/.tas/commands/tas-e2e.md +102 -0
- package/.tas/commands/tas-epic.md +35 -0
- package/.tas/commands/tas-feature.md +47 -0
- package/.tas/commands/tas-fix.md +51 -0
- package/.tas/commands/tas-functest-mobile.md +144 -0
- package/{.claude → .tas}/commands/tas-functest-web.md +192 -192
- package/.tas/commands/tas-functest.md +76 -0
- package/.tas/commands/tas-init.md +17 -0
- package/.tas/commands/tas-plan.md +198 -0
- package/.tas/commands/tas-prd.md +37 -0
- package/.tas/commands/tas-review.md +113 -0
- package/.tas/commands/tas-sad.md +43 -0
- package/.tas/commands/tas-security.md +87 -0
- package/.tas/commands/tas-spec.md +50 -0
- package/.tas/commands/tas-status.md +16 -0
- package/.tas/commands/tas-story.md +91 -0
- package/.tas/platforms.json +5 -0
- package/.tas/project-status-example.yaml +17 -17
- package/.tas/rules/ado-integration.md +65 -0
- package/{.claude/skills/api-design/SKILL.md → .tas/rules/common/api-design.md} +517 -530
- package/{.claude → .tas}/rules/common/code-review.md +30 -6
- package/.tas/rules/common/post-implementation-review.md +51 -0
- package/{.claude → .tas}/rules/common/project-status.md +80 -80
- package/.tas/rules/common/stack-detection.md +29 -0
- package/.tas/rules/common/story-done.md +30 -0
- package/.tas/rules/common/tdd.md +89 -0
- package/{.claude → .tas}/rules/common/testing.md +3 -8
- package/.tas/rules/common/token-logging.md +36 -0
- package/{.claude → .tas}/rules/csharp/api-testing.md +20 -20
- package/{.claude → .tas}/rules/csharp/coding-style.md +0 -2
- package/{.claude → .tas}/rules/csharp/security.md +10 -0
- package/{.claude → .tas}/rules/python/coding-style.md +0 -2
- package/{.claude → .tas}/rules/typescript/coding-style.md +0 -2
- package/.tas/rules/typescript/patterns.md +142 -0
- package/.tas/rules/typescript/security.md +88 -0
- package/{.claude → .tas}/rules/typescript/testing.md +0 -4
- package/{.claude → .tas}/rules/web/coding-style.md +0 -2
- package/.tas/tas-example.yaml +10 -11
- package/.tas/templates/ADR.md +47 -47
- package/.tas/templates/AGENTS.md +37 -0
- package/.tas/templates/API-Test-Spec.md +3 -3
- package/.tas/templates/Bug.md +67 -67
- package/.tas/templates/Design-Spec.md +36 -36
- package/.tas/templates/E2E-Execution-Report.md +1 -1
- package/.tas/templates/Epic.md +46 -46
- package/.tas/templates/Feature.md +10 -10
- package/.tas/templates/Func-Test-Spec.md +3 -3
- package/.tas/templates/SAD.md +106 -106
- package/.tas/templates/Security-Report.md +27 -27
- package/.tas/templates/Story.md +9 -9
- package/.tas/tools/tas-ado-readme.md +68 -68
- package/.tas/tools/tas-ado.py +621 -621
- package/README.md +78 -78
- package/bin/cli.js +91 -73
- package/lib/adapters/antigravity.js +137 -0
- package/lib/adapters/claude-code.js +35 -0
- package/lib/adapters/codex.js +163 -0
- package/lib/adapters/cursor.js +80 -0
- package/lib/adapters/index.js +20 -0
- package/lib/adapters/utils.js +81 -0
- package/lib/deleted-files.json +99 -0
- package/lib/install.js +403 -327
- package/package.json +4 -3
- package/.claude/agents/code-reviewer.md +0 -41
- package/.claude/agents/e2e-runner.md +0 -61
- package/.claude/agents/planner.md +0 -82
- package/.claude/agents/tdd-guide.md +0 -84
- package/.claude/commands/ado-create.md +0 -27
- package/.claude/commands/ado-delete.md +0 -21
- package/.claude/commands/ado-get.md +0 -20
- package/.claude/commands/ado-status.md +0 -18
- package/.claude/commands/ado-update.md +0 -26
- package/.claude/commands/tas-adr.md +0 -33
- package/.claude/commands/tas-apitest-plan.md +0 -173
- package/.claude/commands/tas-apitest.md +0 -143
- package/.claude/commands/tas-brainstorm.md +0 -19
- package/.claude/commands/tas-bug.md +0 -113
- package/.claude/commands/tas-design.md +0 -37
- package/.claude/commands/tas-dev.md +0 -128
- package/.claude/commands/tas-e2e.md +0 -102
- package/.claude/commands/tas-epic.md +0 -35
- package/.claude/commands/tas-feature.md +0 -47
- package/.claude/commands/tas-fix.md +0 -51
- package/.claude/commands/tas-functest-mobile.md +0 -144
- package/.claude/commands/tas-functest.md +0 -76
- package/.claude/commands/tas-init.md +0 -17
- package/.claude/commands/tas-plan.md +0 -200
- package/.claude/commands/tas-prd.md +0 -37
- package/.claude/commands/tas-review.md +0 -111
- package/.claude/commands/tas-sad.md +0 -43
- package/.claude/commands/tas-security.md +0 -87
- package/.claude/commands/tas-spec.md +0 -50
- package/.claude/commands/tas-status.md +0 -16
- package/.claude/commands/tas-story.md +0 -91
- package/.claude/commands/tas-verify.md +0 -51
- package/.claude/rules/common/post-review-agent.md +0 -49
- package/.claude/rules/common/stack-detection.md +0 -29
- package/.claude/rules/common/token-logging.md +0 -27
- package/.claude/rules/typescript/patterns.md +0 -62
- package/.claude/rules/typescript/security.md +0 -28
- package/.claude/settings.local.json +0 -38
- package/.claude/skills/ado-integration/SKILL.md +0 -75
- package/.claude/skills/ai-regression-testing/SKILL.md +0 -364
- package/.claude/skills/architecture-decision-records/SKILL.md +0 -184
- package/.claude/skills/benchmark/SKILL.md +0 -98
- package/.claude/skills/browser-qa/SKILL.md +0 -92
- package/.claude/skills/canary-watch/SKILL.md +0 -104
- package/.claude/skills/js-backend-patterns/SKILL.md +0 -603
- package/.claude/skills/tas-conventions/SKILL.md +0 -65
- package/.claude/skills/tas-implementation-complete/SKILL.md +0 -99
- package/.claude/skills/tas-tdd/SKILL.md +0 -123
- package/.claude/skills/token-logger/SKILL.md +0 -19
- package/.tas/checklists/code-review.md +0 -29
- package/.tas/checklists/security.md +0 -21
- package/.tas/checklists/story-done.md +0 -23
- package/CLAUDE-Example.md +0 -61
- /package/{.claude → .tas}/agents/architect.md +0 -0
- /package/{.claude → .tas}/agents/aws-reviewer.md +0 -0
- /package/{.claude → .tas}/agents/build-resolver.md +0 -0
- /package/{.claude → .tas}/agents/code-explorer.md +0 -0
- /package/{.claude → .tas}/agents/csharp-reviewer.md +0 -0
- /package/{.claude → .tas}/agents/database-reviewer.md +0 -0
- /package/{.claude → .tas}/agents/doc-updater.md +0 -0
- /package/{.claude → .tas}/agents/python-reviewer.md +0 -0
- /package/{.claude → .tas}/agents/security-reviewer.md +0 -0
- /package/{.claude → .tas}/agents/typescript-reviewer.md +0 -0
- /package/{.claude → .tas}/rules/.gitkeep +0 -0
- /package/{.claude → .tas}/rules/common/hooks.md +0 -0
- /package/{.claude → .tas}/rules/common/patterns.md +0 -0
- /package/{.claude → .tas}/rules/common/security.md +0 -0
- /package/{.claude → .tas}/rules/csharp/hooks.md +0 -0
- /package/{.claude → .tas}/rules/csharp/patterns.md +0 -0
- /package/{.claude → .tas}/rules/csharp/testing.md +0 -0
- /package/{.claude → .tas}/rules/python/hooks.md +0 -0
- /package/{.claude → .tas}/rules/python/patterns.md +0 -0
- /package/{.claude → .tas}/rules/python/security.md +0 -0
- /package/{.claude → .tas}/rules/python/testing.md +0 -0
- /package/{.claude → .tas}/rules/typescript/hooks.md +0 -0
- /package/{.claude → .tas}/rules/web/design-quality.md +0 -0
- /package/{.claude → .tas}/rules/web/hooks.md +0 -0
- /package/{.claude → .tas}/rules/web/patterns.md +0 -0
- /package/{.claude → .tas}/rules/web/performance.md +0 -0
- /package/{.claude → .tas}/rules/web/security.md +0 -0
- /package/{.claude → .tas}/rules/web/testing.md +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
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
|
|
@@ -0,0 +1,35 @@
|
|
|
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 `.tas/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 `.tas/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
|
+
Follow `.tas/rules/common/token-logging.md`: write AI Usage Log to working Epic file.
|
|
@@ -0,0 +1,47 @@
|
|
|
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-functest + /tas-e2e.
|
|
30
|
+
9. Update `project-status.yaml` per `.tas/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 `.tas/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
|
+
Follow `.tas/rules/common/token-logging.md`: write AI Usage Log to working Feature file.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# /tas-fix $ARGUMENTS
|
|
2
|
+
|
|
3
|
+
Role: SE - Software Engineer
|
|
4
|
+
Quick fix for small bugs or obvious errors — no 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 `.tas/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
|
+
- `.tas/rules/common/security.md` — check if fix creates security risks
|
|
29
|
+
- `.tas/rules/common/testing.md` — regression test writing patterns
|
|
30
|
+
- `.tas/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 change → stop, 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
|
+
Follow `.tas/rules/common/token-logging.md`: write AI Usage Log to related Story or Bug file (if any).
|
|
@@ -0,0 +1,144 @@
|
|
|
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 not → error:
|
|
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 exists → error:
|
|
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 exist → graceful error, DO NOT create
|