@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,192 +1,176 @@
1
- # /tas-functest-web $ARGUMENTS
2
-
3
- Role: SE / QA
4
- Generate all Playwright automation test scripts for a web Feature.
5
-
6
- ## IMPORTANT - Layer 2: Web Functional Test Scripts
7
- - Create Playwright test scripts from Func-Test-Spec (markdown)
8
- - Scripts located in `apps/web/e2e/features/`
9
- - Reusable helpers exported for Layer 3 (E2E) reuse
10
- - Hardcoded data in tests, credentials from .env
11
- - Cross-viewport testing (mobile, tablet, desktop)
12
-
13
- ## Actions
14
-
15
- ### Step 1: Identify Feature
16
- 1. $ARGUMENTS is Feature ID or file path
17
- 2. If not provided: scan `docs/epics/**/Feature-*.md` for features with status In Progress
18
- 3. Read Feature file to get Epic/Feature numbers and list of Stories
19
-
20
- ### Step 2: Check Prerequisites
21
- 1. Check `apps/web/` exists. If not report:
22
- > "Web app doesn't exist in this project. If project only has mobile, use /tas-functest-mobile."
23
- > STOP, DO NOT create file.
24
- 2. Find all `Func-Test-*.md` files in Feature directory:
25
- ```
26
- docs/epics/{epic-dir}/{feature-dir}/Func-Test-*.md
27
- ```
28
- 3. If no Func-Test-Spec exists report:
29
- > "No Func-Test-Spec for this Feature yet. Run /tas-functest {story-ID} first."
30
- 4. Read `apps/web/playwright.config.ts` (if exists) to understand current config
31
- 5. Read `apps/web/e2e/helpers/` (if exists) to understand patterns
32
-
33
- ### Step 3: Aggregate FT Test Cases
34
- - From all Func-Test-Spec files, aggregate list of FT test cases
35
- - Group by Story
36
- - Get test data requirements from each spec
37
-
38
- ### Step 4: Generate Test Scripts
39
- For EACH Story with Func-Test-Spec:
40
-
41
- **File output**: `apps/web/e2e/features/{epic-slug}/{feature-slug}/{story-slug}.func.spec.ts`
42
-
43
- **Structure**:
44
- ```typescript
45
- /**
46
- * Functional Tests: {Story Name}
47
- * Story: {Story_ID}
48
- * Feature: {Feature_ID}
49
- * Epic: {Epic_ID}
50
- *
51
- * Generated by /tas-functest-web
52
- * Spec: docs/epics/{epic-dir}/{feature-dir}/Func-Test-{story-slug}.md
53
- */
54
-
55
- import { test, expect } from '@playwright/test';
56
- import { loadTestData, getCredentials } from '../../../helpers/data-loader';
57
-
58
- const testData = loadTestData();
59
-
60
- test.describe('{Feature Name} - {Story Name}', () => {
61
- test.beforeEach(async ({ page }) => {
62
- await page.goto('/target-page');
63
- });
64
-
65
- // AC Reference: AC-1
66
- test.describe('{PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_001_H', () => {
67
- test('should {description from spec}', async ({ page }) => {
68
- // Given: {precondition}
69
- // When: {action}
70
- await page.getByTestId('element-id').click();
71
- // Then: {expected}
72
- await expect(page.getByTestId('result')).toBeVisible();
73
- });
74
- });
75
-
76
- // Viewport testing for responsive features
77
- test.describe('{PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_001_H - Viewports', () => {
78
- const viewports = [
79
- { width: 375, height: 812, name: 'mobile' },
80
- { width: 768, height: 1024, name: 'tablet' },
81
- { width: 1280, height: 720, name: 'desktop' },
82
- ];
83
-
84
- for (const vp of viewports) {
85
- test(`should work on ${vp.name} (${vp.width}x${vp.height})`, async ({ page }) => {
86
- await page.setViewportSize({ width: vp.width, height: vp.height });
87
- // Test responsive behavior
88
- });
89
- }
90
- });
91
- });
92
- ```
93
-
94
- ### Step 5: Generate Feature Helpers
95
- Create file `apps/web/e2e/features/{epic-slug}/{feature-slug}/helpers.ts`:
96
- ```typescript
97
- import { Page, expect } from '@playwright/test';
98
-
99
- /**
100
- * Reusable helpers for {Feature Name}
101
- * Exported for Layer 3 E2E scripts reuse
102
- */
103
-
104
- export async function {featureSpecificHelper}(page: Page) {
105
- // Helper logic extracted from functional tests
106
- }
107
- ```
108
-
109
- ### Step 6: Generate/Update Data Loader (if not exists)
110
- If `apps/web/e2e/helpers/data-loader.ts` doesn't exist, create:
111
- ```typescript
112
- type TestEnv = 'dev' | 'staging' | 'prod';
113
-
114
- export function loadTestData(env?: TestEnv) {
115
- const targetEnv = env || (process.env.TEST_ENV as TestEnv) || 'dev';
116
- return require(`../data/test-data.${targetEnv}.json`);
117
- }
118
-
119
- export function getCredentials(userType = 'default') {
120
- const data = loadTestData();
121
- const user = data.users[userType] || data.users.default;
122
- return {
123
- email: user.email,
124
- password: process.env.TEST_USER_PASSWORD || '',
125
- };
126
- }
127
- ```
128
-
129
- ### Step 7: Update package.json Script
130
- Add or update script in `apps/web/package.json`:
131
- ```json
132
- "functest:web:{feature-slug}": "npx playwright test e2e/features/{epic-slug}/{feature-slug}"
133
- ```
134
-
135
- ### Step 8: Generate Index
136
- Create `apps/web/e2e/features/{epic-slug}/{feature-slug}/index.ts`:
137
- ```typescript
138
- export * from './helpers';
139
- ```
140
-
141
- ## File Structure Output
142
- ```
143
- apps/web/e2e/features/
144
- └── {epic-slug}/
145
- └── {feature-slug}/
146
- ├── {story-1-slug}.func.spec.ts
147
- ├── {story-2-slug}.func.spec.ts
148
- ├── helpers.ts
149
- └── index.ts
150
- ```
151
-
152
- ## Selector Strategy (Playwright)
153
- - **Priority**: `data-testid` → `page.getByTestId('login-submit')`
154
- - **Text content**: `page.getByText('Welcome')`
155
- - **Role**: `page.getByRole('button', { name: 'Submit' })`
156
- - **Label**: `page.getByLabel('Email')`
157
- - DO NOT use traditional CSS selectors (`.class`, `#id`) unless required
158
-
159
- ## Cross-Browser Testing
160
- - Chromium (required)
161
- - Firefox (required)
162
- - WebKit (required)
163
- - Config in `playwright.config.ts` projects section
164
-
165
- ## Test Data Convention
166
- - **Hardcoded values**: Directly in test
167
- - **Credentials**: `getCredentials()` password from process.env
168
- - **Environment data**: `loadTestData()` → from test-data.{env}.json
169
- - **NEVER** hardcode passwords/tokens
170
-
171
- ## Run Tests
172
- ```bash
173
- # Run all func tests for feature
174
- yarn functest:web:{feature-slug}
175
-
176
- # Run only one story
177
- npx playwright test e2e/features/{epic}/{feature}/{story}
178
-
179
- # Run with specific browser
180
- npx playwright test --project=firefox e2e/features/{epic}/{feature}
181
-
182
- # Run with debug UI
183
- npx playwright test --ui e2e/features/{epic}/{feature}
184
- ```
185
-
186
- ## Principles
187
- - Script MUST be runnable directly from CLI
188
- - Each describe block uses full FT ID
189
- - Helpers MUST export for Layer 3 reuse
190
- - DO NOT import from Layer 3 (flows/)
191
- - If apps/web/ doesn't exist → graceful error, DO NOT create
192
- - Tests must work on all viewports (mobile, tablet, desktop)
1
+ ---
2
+ model: sonnet
3
+ ---
4
+
5
+ # /tas-functest-web $ARGUMENTS
6
+
7
+ Role: SE / QA
8
+ Generate all Playwright automation test scripts for a web Feature.
9
+
10
+ ## IMPORTANT Layer 2: Web Functional Test Scripts
11
+ - Create Playwright test scripts from Func-Test-Spec (markdown)
12
+ - Scripts located in `apps/web/e2e/features/`
13
+ - Reusable helpers exported for Layer 3 (E2E) reuse
14
+ - Hardcoded data in tests, credentials from `.env`
15
+ - Cross-viewport testing (mobile, tablet, desktop)
16
+
17
+ ## Actions
18
+
19
+ ### Step 1: Identify Feature
20
+ 1. `$ARGUMENTS` is Feature ID or file path
21
+ 2. If not provided: scan `docs/features/{CODE}-Feature-*/{CODE}-Feature-*.md` for Features with status `In Development`
22
+ 3. Read Feature file to get Feature ID + slug
23
+
24
+ ### Step 2: Check Prerequisites
25
+ 1. Check `apps/web/` exists. If not → report:
26
+ > "Web app doesn't exist. If project only has mobile, use `/tas-functest-mobile`."
27
+ > STOP, DO NOT create file.
28
+ 2. Find `Func-Test-Spec.md` in Feature directory:
29
+ ```
30
+ docs/features/{CODE}-Feature-{NNN}-{slug}/Func-Test-Spec.md
31
+ ```
32
+ 3. If missing → report:
33
+ > "No Func-Test-Spec for this Feature. Run `/tas-functest {Feature-ID}` first."
34
+ 4. Read `apps/web/playwright.config.ts` (if exists) for current config
35
+ 5. Read `apps/web/e2e/helpers/` for patterns
36
+
37
+ ### Step 3: Aggregate FT Test Cases
38
+ - From Func-Test-Spec, list all FT test cases grouped by AC
39
+ - Pull test data requirements from spec
40
+
41
+ ### Step 4: Generate Test Scripts
42
+
43
+ **File output**: `apps/web/e2e/features/{feature-slug}/{feature-slug}.func.spec.ts`
44
+
45
+ **Structure**:
46
+ ```typescript
47
+ /**
48
+ * Functional Tests: {Feature Name}
49
+ * Feature: {Feature_ID}
50
+ * Stack: web
51
+ *
52
+ * Generated by /tas-functest-web
53
+ * Spec: docs/features/{feature-dir}/Func-Test-Spec.md
54
+ */
55
+
56
+ import { test, expect } from '@playwright/test';
57
+ import { loadTestData, getCredentials } from '../../helpers/data-loader';
58
+
59
+ const testData = loadTestData();
60
+
61
+ test.describe('{Feature Name}', () => {
62
+ test.beforeEach(async ({ page }) => {
63
+ await page.goto('/target-page');
64
+ });
65
+
66
+ // AC Reference: AC-1
67
+ test.describe('{PROJECT}_F{FEATURE}_AC1_FT_001_H', () => {
68
+ test('should {description from spec}', async ({ page }) => {
69
+ // Given: {precondition}
70
+ // When: {action}
71
+ await page.getByTestId('element-id').click();
72
+ // Then: {expected}
73
+ await expect(page.getByTestId('result')).toBeVisible();
74
+ });
75
+ });
76
+
77
+ // Viewport testing for responsive features
78
+ test.describe('{PROJECT}_F{FEATURE}_AC1_FT_001_H - Viewports', () => {
79
+ const viewports = [
80
+ { width: 375, height: 812, name: 'mobile' },
81
+ { width: 768, height: 1024, name: 'tablet' },
82
+ { width: 1280, height: 720, name: 'desktop' },
83
+ ];
84
+
85
+ for (const vp of viewports) {
86
+ test(`should work on ${vp.name} (${vp.width}x${vp.height})`, async ({ page }) => {
87
+ await page.setViewportSize({ width: vp.width, height: vp.height });
88
+ });
89
+ }
90
+ });
91
+ });
92
+ ```
93
+
94
+ ### Step 5: Generate Feature Helpers
95
+ `apps/web/e2e/features/{feature-slug}/helpers.ts`:
96
+ ```typescript
97
+ import { Page, expect } from '@playwright/test';
98
+
99
+ export async function {featureSpecificHelper}(page: Page) {
100
+ // Helper logic extracted from functional tests
101
+ }
102
+ ```
103
+
104
+ ### Step 6: Generate/Update Data Loader (if missing)
105
+ ```typescript
106
+ type TestEnv = 'dev' | 'staging' | 'prod';
107
+
108
+ export function loadTestData(env?: TestEnv) {
109
+ const targetEnv = env || (process.env.TEST_ENV as TestEnv) || 'dev';
110
+ return require(`../data/test-data.${targetEnv}.json`);
111
+ }
112
+
113
+ export function getCredentials(userType = 'default') {
114
+ const data = loadTestData();
115
+ const user = data.users[userType] || data.users.default;
116
+ return {
117
+ email: user.email,
118
+ password: process.env.TEST_USER_PASSWORD || '',
119
+ };
120
+ }
121
+ ```
122
+
123
+ ### Step 7: Update package.json Script
124
+ ```json
125
+ "functest:web:{feature-slug}": "npx playwright test e2e/features/{feature-slug}"
126
+ ```
127
+
128
+ ### Step 8: Generate Index
129
+ `apps/web/e2e/features/{feature-slug}/index.ts`:
130
+ ```typescript
131
+ export * from './helpers';
132
+ ```
133
+
134
+ ## File Structure Output
135
+ ```
136
+ apps/web/e2e/features/
137
+ └── {feature-slug}/
138
+ ├── {feature-slug}.func.spec.ts
139
+ ├── helpers.ts
140
+ └── index.ts
141
+ ```
142
+
143
+ ## Selector Strategy (Playwright)
144
+ - **Priority**: `data-testid` → `page.getByTestId('login-submit')`
145
+ - **Text**: `page.getByText('Welcome')`
146
+ - **Role**: `page.getByRole('button', { name: 'Submit' })`
147
+ - **Label**: `page.getByLabel('Email')`
148
+ - DO NOT use traditional CSS selectors unless required
149
+
150
+ ## Cross-Browser
151
+ - Chromium (required)
152
+ - Firefox (required)
153
+ - WebKit (required)
154
+ - Config in `playwright.config.ts` projects section
155
+
156
+ ## Test Data Convention
157
+ - **Hardcoded values**: Directly in test
158
+ - **Credentials**: `getCredentials()` → password from process.env
159
+ - **Environment data**: `loadTestData()` → from test-data.{env}.json
160
+ - **NEVER** hardcode passwords/tokens
161
+
162
+ ## Run Tests
163
+ ```bash
164
+ yarn functest:web:{feature-slug}
165
+ npx playwright test e2e/features/{feature-slug}
166
+ npx playwright test --project=firefox e2e/features/{feature-slug}
167
+ npx playwright test --ui e2e/features/{feature-slug}
168
+ ```
169
+
170
+ ## Principles
171
+ - Script MUST be runnable directly from CLI
172
+ - Each describe block uses full FT ID
173
+ - Helpers MUST export for Layer 3 reuse
174
+ - DO NOT import from Layer 3 (`flows/`)
175
+ - If `apps/web/` doesn't exist → graceful error
176
+ - Tests must work on all viewports