@torus-engineering/tas-kit 1.14.0 → 2.1.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 (99) hide show
  1. package/.tas/_platform/claude-code/settings.json +58 -46
  2. package/.tas/_platform/hooks/code-quality.js +127 -127
  3. package/.tas/_platform/hooks/session-end.js +111 -111
  4. package/.tas/agents/architect.md +53 -53
  5. package/.tas/agents/aws-reviewer.md +71 -71
  6. package/.tas/agents/build-resolver.md +89 -59
  7. package/.tas/agents/code-explorer.md +63 -63
  8. package/.tas/agents/csharp-reviewer.md +62 -62
  9. package/.tas/agents/database-reviewer.md +73 -73
  10. package/.tas/agents/doc-updater.md +68 -66
  11. package/.tas/agents/python-reviewer.md +67 -67
  12. package/.tas/agents/security-reviewer.md +79 -79
  13. package/.tas/agents/software-engineer.md +53 -0
  14. package/.tas/agents/typescript-reviewer.md +65 -65
  15. package/.tas/commands/ado-create.md +33 -28
  16. package/.tas/commands/ado-delete.md +26 -22
  17. package/.tas/commands/ado-get.md +24 -20
  18. package/.tas/commands/ado-status.md +22 -18
  19. package/.tas/commands/ado-update.md +31 -27
  20. package/.tas/commands/tas-adr.md +37 -33
  21. package/.tas/commands/tas-apitest-plan.md +177 -173
  22. package/.tas/commands/tas-apitest.md +147 -143
  23. package/.tas/commands/tas-brainstorm.md +23 -19
  24. package/.tas/commands/tas-brd.md +50 -0
  25. package/.tas/commands/tas-bug.md +127 -113
  26. package/.tas/commands/tas-checklist.md +180 -0
  27. package/.tas/commands/tas-debug.md +103 -0
  28. package/.tas/commands/tas-design.md +41 -37
  29. package/.tas/commands/tas-dev.md +225 -125
  30. package/.tas/commands/tas-e2e-mobile.md +146 -155
  31. package/.tas/commands/tas-e2e-web.md +150 -163
  32. package/.tas/commands/tas-e2e.md +289 -102
  33. package/.tas/commands/tas-feature.md +181 -47
  34. package/.tas/commands/tas-fix.md +72 -51
  35. package/.tas/commands/tas-functest-mobile.md +138 -144
  36. package/.tas/commands/tas-functest-web.md +176 -192
  37. package/.tas/commands/tas-functest.md +225 -76
  38. package/.tas/commands/tas-init.md +22 -17
  39. package/.tas/commands/tas-master-plan.md +300 -0
  40. package/.tas/commands/tas-orchestrate.md +159 -0
  41. package/.tas/commands/tas-plan.md +152 -117
  42. package/.tas/commands/tas-prd.md +57 -37
  43. package/.tas/commands/tas-review-pr.md +174 -0
  44. package/.tas/commands/tas-review.md +115 -113
  45. package/.tas/commands/tas-sad.md +47 -43
  46. package/.tas/commands/tas-security.md +91 -87
  47. package/.tas/commands/tas-spec.md +54 -50
  48. package/.tas/commands/tas-status.md +25 -16
  49. package/.tas/project-status-example.yaml +3 -1
  50. package/.tas/rules/ado-integration.md +67 -65
  51. package/.tas/rules/common/api-design.md +517 -517
  52. package/.tas/rules/common/build-debug-loop.md +233 -0
  53. package/.tas/rules/common/code-review.md +4 -0
  54. package/.tas/rules/common/feature-done.md +42 -0
  55. package/.tas/rules/common/post-implementation-review.md +4 -0
  56. package/.tas/rules/common/project-status.md +33 -16
  57. package/.tas/rules/common/sad-impact.md +81 -0
  58. package/.tas/rules/common/tdd.md +104 -89
  59. package/.tas/rules/csharp/api-testing.md +2 -2
  60. package/.tas/rules/csharp/torus-core-framework.md +128 -0
  61. package/.tas/tas-example.yaml +9 -32
  62. package/.tas/templates/AGENTS.md +13 -0
  63. package/.tas/templates/API-Test-Spec.md +5 -4
  64. package/.tas/templates/BRD.md +133 -0
  65. package/.tas/templates/Bug.md +15 -0
  66. package/.tas/templates/E2E-Execution-Report.md +8 -8
  67. package/.tas/templates/E2E-Mobile-Spec.md +6 -8
  68. package/.tas/templates/E2E-Report.md +2 -2
  69. package/.tas/templates/E2E-Scenario.md +22 -22
  70. package/.tas/templates/E2E-Test-Spec.md +274 -0
  71. package/.tas/templates/E2E-Web-Spec.md +4 -4
  72. package/.tas/templates/Feature-Technical-Part.md +69 -0
  73. package/.tas/templates/Feature-Technical-Stack.md +74 -0
  74. package/.tas/templates/Feature-Technical.md +329 -0
  75. package/.tas/templates/Feature.md +50 -26
  76. package/.tas/templates/Func-Test-Script.md +29 -56
  77. package/.tas/templates/Func-Test-Spec.md +144 -142
  78. package/.tas/templates/PRD.md +173 -142
  79. package/.tas/templates/TestChecklist.md +96 -0
  80. package/.tas/templates/torus-dotnet-bootstrap.md +223 -0
  81. package/.tas/tools/tas-ado-readme.md +24 -27
  82. package/.tas/tools/tas-ado.py +328 -25
  83. package/.tas/tools/tas-github.py +339 -0
  84. package/README.md +131 -54
  85. package/bin/cli.js +90 -90
  86. package/lib/adapters/antigravity.js +131 -131
  87. package/lib/adapters/claude-code.js +71 -35
  88. package/lib/adapters/codex.js +157 -157
  89. package/lib/adapters/cursor.js +80 -80
  90. package/lib/adapters/index.js +20 -20
  91. package/lib/adapters/utils.js +81 -81
  92. package/lib/deleted-files.json +7 -0
  93. package/lib/install.js +546 -546
  94. package/package.json +1 -1
  95. package/.tas/commands/tas-epic.md +0 -35
  96. package/.tas/commands/tas-story.md +0 -91
  97. package/.tas/rules/common/story-done.md +0 -30
  98. package/.tas/templates/Epic.md +0 -46
  99. package/.tas/templates/Story.md +0 -90
@@ -1,102 +1,289 @@
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
+ # /tas-e2e $FEATURE_IDS $FLOW_DESCRIPTION
2
+
3
+ You are a Senior QA Engineer creating End-to-End (E2E) Test Specifications by combining multiple Functional Test Specifications into complete user journey workflows.
4
+
5
+ ## Purpose
6
+
7
+ Generate E2E test scenarios that validate complete user journeys across multiple features, simulating real-world workflows and validating integration points between systems.
8
+
9
+ ## When to Use
10
+
11
+ - Run after Functional Test Specifications are complete
12
+ - Run when you need to validate cross-feature workflows
13
+ - Run before implementing E2E automation
14
+ - Run when critical user journeys need validation
15
+
16
+ ## Prerequisites
17
+
18
+ 1. One or more Functional Test Specifications exist (`*-FuncTest-Spec.md`)
19
+ 2. Feature documents exist for context
20
+ 3. Template exists at `.tas/templates/E2E-Test-Spec.md`
21
+ 4. `tas.yaml` exists at project root
22
+
23
+ ## Step-by-Step Actions
24
+
25
+ ### Step 1: Determine Input Scope
26
+
27
+ **Input options:**
28
+ 1. **$FEATURE_IDS** (comma-separated): E.g., "Feature-001,Feature-005,Feature-012"
29
+ - Generate E2E scenarios chaining these specific features
30
+
31
+ 2. **$FLOW_DESCRIPTION** (text): E.g., "complete purchase journey from browse to payment"
32
+ - Search features that match this flow
33
+ - Generate scenarios based on the described workflow
34
+
35
+ 3. **No arguments:**
36
+ - Scan directory for `*-FuncTest-Spec.md` files
37
+ - Group features by business domain
38
+ - Ask user to select features for the E2E flow
39
+
40
+ ### Step 2: Gather Context Documents
41
+
42
+ For each feature in the flow:
43
+
44
+ 1. **Read Feature Document:**
45
+ - File: `*-Feature-*.md`
46
+ - Extract: Feature ID, Feature Name, Epic ID, Acceptance Criteria
47
+
48
+ 2. **Read Functional Test Spec:**
49
+ - File: `*-FuncTest-Spec.md`
50
+ - Extract: All test cases, TC IDs, test types, priorities
51
+ - Note which test cases are automatable (Autoable=Yes)
52
+
53
+ 3. **Identify User Journey:**
54
+ - Determine the logical flow between features
55
+ - Identify entry point (where user starts)
56
+ - Identify exit point (where user ends)
57
+ - Map touchpoints between features
58
+
59
+ ### Step 3: Read Template
60
+
61
+ Read `.tas/templates/E2E-Test-Spec.md` to understand structure.
62
+
63
+ ### Step 4: Design E2E Scenarios
64
+
65
+ #### A. Identify User Personas
66
+ Determine who performs this journey:
67
+ - Customer/User
68
+ - Admin/Staff
69
+ - Partner/External
70
+ - Multiple personas (complex flows)
71
+
72
+ #### B. Map Functional TCs to E2E Steps
73
+
74
+ For each logical step in the user journey:
75
+ 1. Find corresponding Functional Test Cases
76
+ 2. Group related TCs into E2E steps
77
+ 3. Identify integration points between steps
78
+ 4. Note data flow dependencies
79
+
80
+ **Mapping example:**
81
+ ```
82
+ E2E Step 1: Browse Products
83
+ └─ Uses: Feature-001 → FT-001_H, FT-002_H
84
+
85
+ E2E Step 2: Add to Cart
86
+ └─ Uses: Feature-001 → FT-005_H, FT-006_N
87
+
88
+ E2E Step 3: Checkout
89
+ └─ Uses: Feature-002 → FT-010_H, FT-012_H
90
+
91
+ E2E Step 4: Payment
92
+ └─ Uses: Feature-003 → FT-020_H, FT-025_NEG
93
+ ```
94
+
95
+ #### C. Generate E2E Test Scenarios
96
+
97
+ Create 4 types of E2E scenarios:
98
+
99
+ **1. Happy Path (HP):**
100
+ - Main user journey from start to finish
101
+ - All steps succeed
102
+ - Primary business value achieved
103
+ - At least 1 per flow (P0)
104
+
105
+ **2. Negative Flows (NEG):**
106
+ - Error scenarios at integration points
107
+ - System failures (payment gateway, email service)
108
+ - Invalid data handling
109
+ - User errors and recovery
110
+
111
+ **3. Edge Cases (EDGE):**
112
+ - Boundary conditions
113
+ - Concurrent operations
114
+ - Large data volumes
115
+ - Unusual but valid scenarios
116
+
117
+ **4. Performance Flows (PERF):**
118
+ - Load testing scenarios
119
+ - Response time validation
120
+ - Concurrent user simulation
121
+
122
+ ### Step 5: Fill Template Sections
123
+
124
+ #### Frontmatter:
125
+ ```yaml
126
+ created_date: {YYYY-MM-DD}
127
+ updated_date: {YYYY-MM-DD}
128
+ executor: {User or placeholder}
129
+ reviewer: {Placeholder}
130
+ status: Draft
131
+ epic_id: {From features}
132
+ feature_ids: [Feature-001, Feature-002, ...]
133
+ scenario_id: {E2E_001, E2E_002, ...}
134
+ platform: {web | mobile | backend | cross-stack}
135
+ tags: [e2e, {flow_name}]
136
+ ver: 1.0
137
+ ```
138
+
139
+ #### Section 1: Scenario Overview
140
+ - Scenario Name: {Business Flow Name}
141
+ - Business Value: Why this flow matters
142
+ - User Persona: Who performs it
143
+ - Entry/Exit Points
144
+ - Success Criteria
145
+
146
+ #### Section 2: Integrated Systems
147
+ - List all systems involved
148
+ - Integration types
149
+ - Failure impacts
150
+ - Prerequisites
151
+
152
+ #### Section 3: Functional TC Mapping
153
+ - Map E2E steps to Functional TCs
154
+ - Show traceability
155
+
156
+ #### Section 4: E2E Test Scenarios
157
+ Generate detailed tables for:
158
+ - 4.1 Happy Path E2E Scenarios
159
+ - 4.2 Negative Flow E2E Scenarios
160
+ - 4.3 Edge Case E2E Scenarios
161
+ - 4.4 Performance E2E Scenarios
162
+
163
+ **Each E2E scenario includes:**
164
+ - E2E Case ID: `{PROJECT}_E2E_{SCENARIO_ID}_{TYPE}_{NUMBER}`
165
+ - User Persona
166
+ - Business Flow
167
+ - Pre-Conditions
168
+ - Cross-Functional Steps (with system/module labels)
169
+ - Expected Final State
170
+ - Priority (P0/P1/P2)
171
+ - Autoable (Yes/None)
172
+ - Traceability to Functional TCs
173
+
174
+ #### Section 5: Data Flow Validation
175
+ - Critical data points to verify
176
+ - Source systems
177
+ - Expected values
178
+ - Verification methods (SQL queries, API calls)
179
+
180
+ #### Section 6: Integration Points
181
+ - Critical checkpoints between systems
182
+ - Test methods
183
+ - Success criteria
184
+ - Failure handling
185
+
186
+ #### Section 7: Platform Matrix
187
+ - Browsers, devices, versions
188
+ - Required vs optional
189
+
190
+ #### Section 8: Success Criteria
191
+ - Must Have (P0)
192
+ - Should Have (P1)
193
+ - Nice to Have (P2)
194
+
195
+ #### Section 9: Risk Matrix
196
+ - Integration risks
197
+ - Mitigation strategies
198
+ - Owners
199
+
200
+ #### Section 10: Automation Strategy
201
+ - Framework recommendations
202
+ - Execution commands
203
+ - CI/CD integration
204
+
205
+ #### Section 11: Coverage Summary
206
+ - Feature coverage
207
+ - Scenario breakdown
208
+ - Automatable vs manual
209
+
210
+ ### Step 6: Write Output File
211
+
212
+ Create file: `{Scenario_ID}-E2E-Test-Spec.md`
213
+
214
+ **Location options:**
215
+ 1. In `docs/e2e-scenarios/` (create if missing)
216
+ 2. In feature directory if single-feature E2E
217
+ 3. In project root if cross-project
218
+
219
+ ### Step 7: Output Summary
220
+
221
+ Report to user:
222
+ ```
223
+ ✓ E2E Test Spec created: {filename}
224
+
225
+ Scope:
226
+ ├─ Features Linked: {count}
227
+ │ └─ {Feature-001}, {Feature-002}, ...
228
+ ├─ Epic: {Epic_ID}
229
+ └─ Scenario: {Scenario_ID}
230
+
231
+ Scenarios Generated:
232
+ ├─ Total E2E Scenarios: {count}
233
+ │ ├─ Happy Path: {count}
234
+ │ ├─ Negative Flows: {count}
235
+ │ ├─ Edge Cases: {count}
236
+ │ └─ Performance: {count}
237
+
238
+ Integration Points:
239
+ ├─ Systems Involved: {count}
240
+ ├─ External APIs: {count}
241
+ └─ Data Validations: {count}
242
+
243
+ Automation Readiness:
244
+ ├─ Automatable: {count} ({percent}%)
245
+ └─ Manual Only: {count} ({percent}%)
246
+
247
+ Next Steps:
248
+ 1. Review E2E scenarios with stakeholders
249
+ 2. Verify integration test data setup
250
+ 3. Implement E2E automation using {framework}
251
+ 4. Schedule E2E runs in CI/CD pipeline
252
+ ```
253
+
254
+ ## Important Notes
255
+
256
+ 1. **E2E ≠ Functional:** E2E tests complete workflows, not single features
257
+ 2. **Traceability:** Each E2E step should reference Functional TCs
258
+ 3. **Integration Focus:** Emphasize system boundaries and data flow
259
+ 4. **Real User Journeys:** Simulate actual user behavior, not artificial flows
260
+ 5. **Automation First:** Most E2E scenarios should be automatable
261
+ 6. **Environment Matters:** E2E requires production-like staging environment
262
+
263
+ ## Best Practices
264
+
265
+ 1. **Start with Happy Path:** Ensure main flow works before testing edge cases
266
+ 2. **Think Like a User:** What would a real user actually do?
267
+ 3. **Validate Data:** Don't just check UI - verify database state
268
+ 4. **Test Integrations:** Pay special attention to third-party systems
269
+ 5. **Handle Failures:** Test what happens when systems fail
270
+ 6. **Performance Matters:** E2E flows should meet SLA requirements
271
+
272
+ ## Error Handling
273
+
274
+ - No Functional Specs found: "No FuncTest-Spec.md files found. Run /tas-functest first."
275
+ - Features don't form logical flow: "Warning: Features may not form a coherent workflow. Continue anyway?"
276
+ - Template missing: "Error: E2E-Test-Spec.md template not found in .tas/templates/"
277
+ - No integration points identified: "Warning: No integration points found. This may be a single-feature E2E."
278
+
279
+ ## Difference from Functional Tests
280
+
281
+ | Aspect | Functional Tests | E2E Tests |
282
+ |--------|-----------------|-----------|
283
+ | Scope | Single feature | Multiple features |
284
+ | Focus | Feature logic | User journey |
285
+ | Data | Isolated | Shared across steps |
286
+ | Systems | One module | Multiple systems |
287
+ | Duration | Fast | Slower |
288
+ | Maintenance | Lower | Higher |
289
+ | Priority | P0-P2 | P0 (critical flows) |
@@ -1,47 +1,181 @@
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.
1
+ ---
2
+ model: sonnet
3
+ ---
4
+
5
+ # /tas-feature $ARGUMENTS
6
+
7
+ Role: PE - Product Engineer
8
+ Create or update a Feature document. Feature is the **only** unit of business work in TAS — Epic and Story are removed.
9
+
10
+ **Scope:** Business logic, AC, NFR.
11
+ **Out of scope:** Technical implementation, file changes, ERD, ADR — that's `/tas-plan`'s job (writes `Feature-{NNN}-Technical.md`).
12
+
13
+ ## Always / Ask / Never
14
+
15
+ | | Action |
16
+ |---|---|
17
+ | **Always** | Write AC in Given/When/Then format |
18
+ | **Always** | Set `plan_status: pending` for new Feature |
19
+ | **Always** | Read PRD + SAD before proposing Features |
20
+ | **Always** | Infer stacks from SAD architecture — do NOT ask user to specify stacks |
21
+ | **Always** | In ad-hoc mode: write Feature first (Gate 1), then PRD delta (Gate 2) — never show both drafts simultaneously |
22
+ | **Always** | In ad-hoc mode: check ADRs for conflicts before drafting |
23
+ | **Never** | Write Technical Plan content here |
24
+ | **Never** | Suggest or create ADRs — `/tas-plan` documents decisions, human approves ADRs |
25
+ | **Never** | Use SAD for technical analysis — read SAD only for system layers and dependency order |
26
+ | **Never** | Write PRD before Feature is approved in ad-hoc mode |
27
+
28
+ ## Prerequisites
29
+ - `tas.yaml` exists at project root
30
+ - (Optional but preferred) `docs/prd.md` — for FR list and business context
31
+ - (Optional but preferred) `docs/sad.md` (or linked SAD file) — for system architecture layers and component dependency order
32
+
33
+ ## Actions
34
+
35
+ ### CREATE mode (`$ARGUMENTS` is new Feature description, or no `$ARGUMENTS`)
36
+
37
+ **Step 1Read context**
38
+ - Read `project.code` from root `tas.yaml`
39
+ - Read `docs/prd.md` if exists — extract FR list and business context per FR
40
+ - Read SAD if exists extract:
41
+ - Which layers/stacks exist in this system (`app`, `web`, `service`, `integration` — only layers actually present)
42
+ - Component or layer dependencies (which components must exist before others)
43
+
44
+ **Step 1.5 — Match $ARGUMENTS against PRD (only when $ARGUMENTS is a description)**
45
+
46
+ If `$ARGUMENTS` is a description (not a Feature ID, not empty):
47
+ - Compare against existing FRs in PRD
48
+ - If **clear match found** → continue to Step 2 (normal flow for that FR)
49
+ - If **no match** → enter **Ad-hoc Mode** below
50
+
51
+ #### Ad-hoc Mode — New Requirement Not in PRD
52
+
53
+ Used when customer brings a requirement not covered by existing PRD FRs.
54
+
55
+ **a. Announce:**
56
+ > "Requirement not found in PRD. Entering ad-hoc mode — will survey, create Feature, then update PRD."
57
+
58
+ **b. Q&A — use `AskUserQuestion` tool (popup UI), split into 2 calls:**
59
+
60
+ **Popup call 1** (up to 4 questions):
61
+ - "What business value does this deliver? Who benefits?" — header: `Business`
62
+ - "Who are the actors / triggers? Any external systems?" — header: `Actors`
63
+ - "Key business rules or constraints?" — header: `Rules`
64
+ - "NFR priorities?" — header: `NFR`, `multiSelect: true`, options: Performance / Security / Compliance / Scalability / Accessibility
65
+
66
+ **Popup call 2** (after call 1 answers received):
67
+ - "Which stacks does this touch?" — header: `Stacks`, `multiSelect: true`, options: list only stacks found in SAD (web / service / integration / app — only those present)
68
+
69
+ Wait for all answers before proceeding to step c.
70
+
71
+ **c. ADR conflict check:**
72
+ Read `docs/adr/*.md` if exists. Flag any conflict:
73
+ > "⚠️ Conflict with ADR-XXX: [decision]. This requirement may require revisiting [constraint]."
74
+
75
+ **d. Draft Feature (in-conversation):**
76
+ Using PE answers + ADR check, draft full Feature content following `.tas/templates/Feature.md` structure (Description, User Story, Actor, Business Flow, Business Rules, UI/UX, NFR, AC in Given/When/Then).
77
+
78
+ **e. Gate 1 — Feature approval:**
79
+ > "Feature draft above OK? Approve to write file."
80
+ - Approved → assign next Feature ID (scan `docs/features/`), create directory + write file → **skip Steps 2–6, go to step f**
81
+ - Feedback → update draft, ask again
82
+
83
+ **f. Draft PRD delta (in-conversation):**
84
+ After Feature file written, draft PRD addition for the new FR. Default: FR title + one-line description + reference to Feature file. Show draft and note:
85
+ > "Default: minimal FR entry. Expand if more business context needed."
86
+
87
+ **g. Gate 2 — PRD approval:**
88
+ > "PRD update above OK? Approve to write."
89
+ - Approved → append new FR to `docs/prd.md` (in appropriate section)
90
+ - Feedback → update draft, ask again
91
+
92
+ **h. Proceed to Step 7** (update `project-status.yaml`)
93
+
94
+ **i. Update master plan (if exists):**
95
+ - Check if `docs/master-plan.md` exists
96
+ - If exists → invoke `/tas-master-plan AMEND` inline (follow that command's AMEND mode steps); do not end turn, wait for result before continuing
97
+ - If not → skip
98
+
99
+ **Proceed to Step 8** (notify).
100
+
101
+ ---
102
+
103
+ **Step 2 — Infer stacks per FR + determine order**
104
+ - For each FR in PRD:
105
+ - Read FR description and understand what parts of the system it touches
106
+ - Cross-reference SAD architecture to confirm which layers are involved
107
+ - Example: "User Login FR" touching web UI + auth API + external IdP → inferred stacks: `web`, `service`, `integration`
108
+ - Order FRs by SAD dependency (foundation layers first — e.g., `service` before `web`, `web` before `integration` adapters)
109
+ - Result: one Feature per FR, with inferred stacks noted as context for PE
110
+
111
+ **Step 3 — Present proposed Feature list + confirm**
112
+
113
+ Show ordered list with inferred stacks as context. Example:
114
+
115
+ ```
116
+ Proposed Features (ordered by dependency):
117
+
118
+ [ ] Feature-NNN-auth FR-001: Authentication (touches: service, integration, web)
119
+ [ ] Feature-NNN-checkout FR-002: Checkout (touches: service, web)
120
+
121
+ Select which to create now (all, or specific numbers):
122
+ ```
123
+
124
+ User can select all or a subset. Proceed only for selected items.
125
+
126
+ **Step 4 — Assign Feature IDs**
127
+ - Scan `docs/features/` for existing `{CODE}-Feature-NNN-*` directories
128
+ - Assign next sequential ID (max existing NNN + 1, +1 per new Feature in this batch)
129
+ - IDs assigned in the order shown in Step 3
130
+
131
+ **Step 5 — Create directory + file for each selected Feature**
132
+ - Directory: `docs/features/{CODE}-Feature-{NNN}-{slug}/`
133
+ - File: `docs/features/{CODE}-Feature-{NNN}-{slug}/{CODE}-Feature-{NNN}-{slug}.md`
134
+ - Use template `.tas/templates/Feature.md`
135
+ - Frontmatter: `plan_status: pending`, `plan_date:` empty
136
+
137
+ **Step 6 — Walk PE through filling each Feature (one at a time)**
138
+
139
+ For each created Feature file, ask PE to provide:
140
+
141
+ a. **Description**: short summary + business value
142
+ b. **User Story**: "As a [role], I want [goal], so that [benefit]"
143
+ c. **Actor**: "Who interacts with this Feature? Roles, personas, external systems?"
144
+ d. **Business Flow**: "Step-by-step business flow / user journey?"
145
+ e. **Business Rules**: "BR-1, BR-2... validations, constraints, calculations?"
146
+ f. **UI/UX Rules**: "Any UI/UX rules or design-spec.md ref? (skip if backend-only)"
147
+ g. **Non-Functional Requirements**: "Performance, security, scalability, accessibility — measurable?"
148
+ h. **Acceptance Criteria** (Given/When/Then): "AC-1, AC-2... each testable?"
149
+
150
+ After completing one Feature, move to next selected Feature.
151
+
152
+ **Step 7 — Update `project-status.yaml`**
153
+ - Per `.tas/rules/common/project-status.md` — add one entry per created Feature to flat `features.{FEATURE_ID}` map.
154
+
155
+ **Step 8 — Notify next step**
156
+ > "Features created. For each Feature, run `/tas-plan {Feature-ID}` to generate `Feature-{NNN}-Technical.md` before SE codes."
157
+
158
+ ---
159
+
160
+ ### UPDATE mode (`$ARGUMENTS` is Feature ID, e.g., `Feature-003`)
161
+
162
+ 1. Find file via glob `docs/features/{CODE}-Feature-{ID}-*/**.md` (excluding `*-Technical.md`)
163
+ 2. Read current Feature file
164
+ 3. Ask user what to change (description, actor, business flow, business rules, UI/UX, NFR, AC, status...)
165
+ 4. Update file, add Changelog entry: date + changes + author
166
+ 5. Update `project-status.yaml` per `.tas/rules/common/project-status.md` — update `features.{FEATURE_ID}.status`
167
+ 6. If AC changed: warn user that downstream artifacts may be stale — `Feature-{NNN}-Technical.md`, `Func-Test-*.md`
168
+
169
+ ## Principles
170
+ - Feature is a **complete business flow** that can be released to production after coding
171
+ - One Feature = one business requirement. A Feature may span multiple stacks (`app`, `web`, `service`, `integration`) — per-stack technical breakdown lives in `Feature-{NNN}-Technical.md`
172
+ - Each Feature lives in its own directory under `docs/features/`
173
+ - Feature MUST have clear, testable Acceptance Criteria in Given/When/Then format
174
+ - Business Rules MUST be unambiguous and verifiable
175
+ - Non-Functional Requirements MUST be measurable when applicable
176
+ - Test cases (Functional / E2E) live in separate files in same directory — NOT in Feature doc
177
+ - Technical content (ERD, files, config, ADR, per-stack breakdown) lives in `Feature-{NNN}-Technical.md` — generated by `/tas-plan`
178
+
179
+ ## Final Step — Token Log
180
+
181
+ Follow `.tas/rules/common/token-logging.md`: write AI Usage Log to working Feature file.