@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.
Files changed (162) hide show
  1. package/.tas/README.md +70 -70
  2. package/{.claude → .tas/_platform/claude-code}/settings.json +0 -12
  3. package/{.claude → .tas/_platform}/hooks/code-quality.js +1 -1
  4. package/{.claude → .tas/_platform}/hooks/session-end.js +20 -25
  5. package/.tas/commands/ado-create.md +28 -0
  6. package/.tas/commands/ado-delete.md +22 -0
  7. package/.tas/commands/ado-get.md +20 -0
  8. package/.tas/commands/ado-status.md +18 -0
  9. package/.tas/commands/ado-update.md +27 -0
  10. package/.tas/commands/tas-adr.md +33 -0
  11. package/.tas/commands/tas-apitest-plan.md +173 -0
  12. package/.tas/commands/tas-apitest.md +143 -0
  13. package/.tas/commands/tas-brainstorm.md +19 -0
  14. package/.tas/commands/tas-bug.md +113 -0
  15. package/.tas/commands/tas-design.md +37 -0
  16. package/.tas/commands/tas-dev.md +125 -0
  17. package/{.claude → .tas}/commands/tas-e2e-mobile.md +155 -155
  18. package/{.claude → .tas}/commands/tas-e2e-web.md +163 -163
  19. package/.tas/commands/tas-e2e.md +102 -0
  20. package/.tas/commands/tas-epic.md +35 -0
  21. package/.tas/commands/tas-feature.md +47 -0
  22. package/.tas/commands/tas-fix.md +51 -0
  23. package/.tas/commands/tas-functest-mobile.md +144 -0
  24. package/{.claude → .tas}/commands/tas-functest-web.md +192 -192
  25. package/.tas/commands/tas-functest.md +76 -0
  26. package/.tas/commands/tas-init.md +17 -0
  27. package/.tas/commands/tas-plan.md +198 -0
  28. package/.tas/commands/tas-prd.md +37 -0
  29. package/.tas/commands/tas-review.md +113 -0
  30. package/.tas/commands/tas-sad.md +43 -0
  31. package/.tas/commands/tas-security.md +87 -0
  32. package/.tas/commands/tas-spec.md +50 -0
  33. package/.tas/commands/tas-status.md +16 -0
  34. package/.tas/commands/tas-story.md +91 -0
  35. package/.tas/platforms.json +5 -0
  36. package/.tas/project-status-example.yaml +17 -17
  37. package/.tas/rules/ado-integration.md +65 -0
  38. package/{.claude/skills/api-design/SKILL.md → .tas/rules/common/api-design.md} +517 -530
  39. package/{.claude → .tas}/rules/common/code-review.md +30 -6
  40. package/.tas/rules/common/post-implementation-review.md +51 -0
  41. package/{.claude → .tas}/rules/common/project-status.md +80 -80
  42. package/.tas/rules/common/stack-detection.md +29 -0
  43. package/.tas/rules/common/story-done.md +30 -0
  44. package/.tas/rules/common/tdd.md +89 -0
  45. package/{.claude → .tas}/rules/common/testing.md +3 -8
  46. package/.tas/rules/common/token-logging.md +36 -0
  47. package/{.claude → .tas}/rules/csharp/api-testing.md +20 -20
  48. package/{.claude → .tas}/rules/csharp/coding-style.md +0 -2
  49. package/{.claude → .tas}/rules/csharp/security.md +10 -0
  50. package/{.claude → .tas}/rules/python/coding-style.md +0 -2
  51. package/{.claude → .tas}/rules/typescript/coding-style.md +0 -2
  52. package/.tas/rules/typescript/patterns.md +142 -0
  53. package/.tas/rules/typescript/security.md +88 -0
  54. package/{.claude → .tas}/rules/typescript/testing.md +0 -4
  55. package/{.claude → .tas}/rules/web/coding-style.md +0 -2
  56. package/.tas/tas-example.yaml +10 -11
  57. package/.tas/templates/ADR.md +47 -47
  58. package/.tas/templates/AGENTS.md +37 -0
  59. package/.tas/templates/API-Test-Spec.md +3 -3
  60. package/.tas/templates/Bug.md +67 -67
  61. package/.tas/templates/Design-Spec.md +36 -36
  62. package/.tas/templates/E2E-Execution-Report.md +1 -1
  63. package/.tas/templates/Epic.md +46 -46
  64. package/.tas/templates/Feature.md +10 -10
  65. package/.tas/templates/Func-Test-Spec.md +3 -3
  66. package/.tas/templates/SAD.md +106 -106
  67. package/.tas/templates/Security-Report.md +27 -27
  68. package/.tas/templates/Story.md +9 -9
  69. package/.tas/tools/tas-ado-readme.md +68 -68
  70. package/.tas/tools/tas-ado.py +621 -621
  71. package/README.md +78 -78
  72. package/bin/cli.js +91 -73
  73. package/lib/adapters/antigravity.js +137 -0
  74. package/lib/adapters/claude-code.js +35 -0
  75. package/lib/adapters/codex.js +163 -0
  76. package/lib/adapters/cursor.js +80 -0
  77. package/lib/adapters/index.js +20 -0
  78. package/lib/adapters/utils.js +81 -0
  79. package/lib/deleted-files.json +99 -0
  80. package/lib/install.js +403 -327
  81. package/package.json +4 -3
  82. package/.claude/agents/code-reviewer.md +0 -41
  83. package/.claude/agents/e2e-runner.md +0 -61
  84. package/.claude/agents/planner.md +0 -82
  85. package/.claude/agents/tdd-guide.md +0 -84
  86. package/.claude/commands/ado-create.md +0 -27
  87. package/.claude/commands/ado-delete.md +0 -21
  88. package/.claude/commands/ado-get.md +0 -20
  89. package/.claude/commands/ado-status.md +0 -18
  90. package/.claude/commands/ado-update.md +0 -26
  91. package/.claude/commands/tas-adr.md +0 -33
  92. package/.claude/commands/tas-apitest-plan.md +0 -173
  93. package/.claude/commands/tas-apitest.md +0 -143
  94. package/.claude/commands/tas-brainstorm.md +0 -19
  95. package/.claude/commands/tas-bug.md +0 -113
  96. package/.claude/commands/tas-design.md +0 -37
  97. package/.claude/commands/tas-dev.md +0 -128
  98. package/.claude/commands/tas-e2e.md +0 -102
  99. package/.claude/commands/tas-epic.md +0 -35
  100. package/.claude/commands/tas-feature.md +0 -47
  101. package/.claude/commands/tas-fix.md +0 -51
  102. package/.claude/commands/tas-functest-mobile.md +0 -144
  103. package/.claude/commands/tas-functest.md +0 -76
  104. package/.claude/commands/tas-init.md +0 -17
  105. package/.claude/commands/tas-plan.md +0 -200
  106. package/.claude/commands/tas-prd.md +0 -37
  107. package/.claude/commands/tas-review.md +0 -111
  108. package/.claude/commands/tas-sad.md +0 -43
  109. package/.claude/commands/tas-security.md +0 -87
  110. package/.claude/commands/tas-spec.md +0 -50
  111. package/.claude/commands/tas-status.md +0 -16
  112. package/.claude/commands/tas-story.md +0 -91
  113. package/.claude/commands/tas-verify.md +0 -51
  114. package/.claude/rules/common/post-review-agent.md +0 -49
  115. package/.claude/rules/common/stack-detection.md +0 -29
  116. package/.claude/rules/common/token-logging.md +0 -27
  117. package/.claude/rules/typescript/patterns.md +0 -62
  118. package/.claude/rules/typescript/security.md +0 -28
  119. package/.claude/settings.local.json +0 -38
  120. package/.claude/skills/ado-integration/SKILL.md +0 -75
  121. package/.claude/skills/ai-regression-testing/SKILL.md +0 -364
  122. package/.claude/skills/architecture-decision-records/SKILL.md +0 -184
  123. package/.claude/skills/benchmark/SKILL.md +0 -98
  124. package/.claude/skills/browser-qa/SKILL.md +0 -92
  125. package/.claude/skills/canary-watch/SKILL.md +0 -104
  126. package/.claude/skills/js-backend-patterns/SKILL.md +0 -603
  127. package/.claude/skills/tas-conventions/SKILL.md +0 -65
  128. package/.claude/skills/tas-implementation-complete/SKILL.md +0 -99
  129. package/.claude/skills/tas-tdd/SKILL.md +0 -123
  130. package/.claude/skills/token-logger/SKILL.md +0 -19
  131. package/.tas/checklists/code-review.md +0 -29
  132. package/.tas/checklists/security.md +0 -21
  133. package/.tas/checklists/story-done.md +0 -23
  134. package/CLAUDE-Example.md +0 -61
  135. /package/{.claude → .tas}/agents/architect.md +0 -0
  136. /package/{.claude → .tas}/agents/aws-reviewer.md +0 -0
  137. /package/{.claude → .tas}/agents/build-resolver.md +0 -0
  138. /package/{.claude → .tas}/agents/code-explorer.md +0 -0
  139. /package/{.claude → .tas}/agents/csharp-reviewer.md +0 -0
  140. /package/{.claude → .tas}/agents/database-reviewer.md +0 -0
  141. /package/{.claude → .tas}/agents/doc-updater.md +0 -0
  142. /package/{.claude → .tas}/agents/python-reviewer.md +0 -0
  143. /package/{.claude → .tas}/agents/security-reviewer.md +0 -0
  144. /package/{.claude → .tas}/agents/typescript-reviewer.md +0 -0
  145. /package/{.claude → .tas}/rules/.gitkeep +0 -0
  146. /package/{.claude → .tas}/rules/common/hooks.md +0 -0
  147. /package/{.claude → .tas}/rules/common/patterns.md +0 -0
  148. /package/{.claude → .tas}/rules/common/security.md +0 -0
  149. /package/{.claude → .tas}/rules/csharp/hooks.md +0 -0
  150. /package/{.claude → .tas}/rules/csharp/patterns.md +0 -0
  151. /package/{.claude → .tas}/rules/csharp/testing.md +0 -0
  152. /package/{.claude → .tas}/rules/python/hooks.md +0 -0
  153. /package/{.claude → .tas}/rules/python/patterns.md +0 -0
  154. /package/{.claude → .tas}/rules/python/security.md +0 -0
  155. /package/{.claude → .tas}/rules/python/testing.md +0 -0
  156. /package/{.claude → .tas}/rules/typescript/hooks.md +0 -0
  157. /package/{.claude → .tas}/rules/web/design-quality.md +0 -0
  158. /package/{.claude → .tas}/rules/web/hooks.md +0 -0
  159. /package/{.claude → .tas}/rules/web/patterns.md +0 -0
  160. /package/{.claude → .tas}/rules/web/performance.md +0 -0
  161. /package/{.claude → .tas}/rules/web/security.md +0 -0
  162. /package/{.claude → .tas}/rules/web/testing.md +0 -0
@@ -0,0 +1,143 @@
1
+ # /tas-apitest $ARGUMENTS
2
+
3
+ Role: SE - Software Engineer
4
+ Generate .NET xUnit automation test project for REST API from API Test Spec file (Markdown).
5
+
6
+ ## Always / Ask / Never
7
+
8
+ | | Action |
9
+ |---|---|
10
+ | **Always** | Read entire API Test Spec file before generating any test |
11
+ | **Always** | Organize tests by API version — each version separate folder |
12
+ | **Always** | Append-only: don't modify files in existing old version folder |
13
+ | **Always** | URL and credentials in `appsettings.json` — not hardcoded in code |
14
+ | **Always** | XML doc comment on each test method |
15
+ | **Ask** | When test spec unclear about expected response schema |
16
+ | **Never** | Modify or delete old version test files |
17
+ | **Never** | Hardcode base URL, API key, credentials in test code |
18
+ | **Never** | Skip error path — each endpoint needs ≥1 happy path + ≥1 error path |
19
+
20
+ ## Actions
21
+
22
+ ### Step 1 — Locate Input
23
+
24
+ `$ARGUMENTS` is path to API Test Spec file: `docs/tests/API-Test-Spec-{slug}.md`.
25
+
26
+ If not provided → ask user:
27
+ ```
28
+ Enter path to API Test Spec file (e.g., docs/tests/API-Test-Spec-users.md)
29
+ ```
30
+
31
+ ### Step 2 — Parse API Test Spec
32
+
33
+ Read `.tas/rules/csharp/api-testing.md` for conventions before generating.
34
+
35
+ From API Test Spec file, collect:
36
+ - API version
37
+ - Endpoints with method, path, params
38
+ - Test cases per endpoint (TC-XXX)
39
+ - Request/response schemas
40
+ - Auth requirements
41
+ - Test data requirements
42
+ - Setup/teardown notes
43
+
44
+ ### Step 3 — Detect Existing Test Project
45
+
46
+ Glob find `**/ApiTests/*.csproj`, `**/Api.Tests/*.csproj`, `**/IntegrationTests/*.csproj`.
47
+
48
+ - **Found**: Read current framework (xUnit/NUnit/MSTest), glob `v*/` folders to know existing versions.
49
+ - **Not found**: Create new at `tests/ApiTests/` with xUnit + FluentAssertions (per `csharp/testing.md`).
50
+
51
+ ### Step 4 — Get API Version from Spec
52
+
53
+ Read version from API Test Spec file (find frontmatter `api_version` or section headers `## v{N}`).
54
+
55
+ Version folder: lowercase, no dot — `v1`, `v2` (not `v1.0`).
56
+
57
+ ### Step 5 — Generate Infrastructure (only when creating new project)
58
+
59
+ Read `.tas/rules/csharp/api-testing.md` section **Project Structure** and **Config Pattern** to generate:
60
+ - `ApiTests.csproj` with standard packages
61
+ - `appsettings.json` (base) + `appsettings.Test.json` + `appsettings.Staging.json` with values from spec
62
+ - `Shared/TestBase.cs` — load config, HttpClient, helper methods
63
+ - `Shared/ApiTestSettings.cs` — strongly typed settings
64
+ - `.gitignore` for `appsettings.*.local.json`
65
+
66
+ ### Step 6 — Generate Test Classes from Spec
67
+
68
+ Group endpoints by resource. Each group → `tests/ApiTests/{version}/{Resource}ApiTests.cs`.
69
+
70
+ For each test case (TC-XXX) in spec:
71
+ 1. Read test case details
72
+ 2. Map to test method with naming: `{HttpMethod}_{Resource}_Returns{Status}_When{Condition}`
73
+ 3. Generate XML doc from test case title
74
+ 4. Generate assertions from expected response
75
+ 5. Add AC reference comment if any
76
+
77
+ Test class header comment:
78
+ ```csharp
79
+ // ============================================================
80
+ // {Resource} API Tests — v{N}
81
+ // Spec: docs/tests/API-Test-Spec-{slug}.md
82
+ // Generated: {YYYY-MM-DD}
83
+ // Story: {ID} (if applicable)
84
+ // APPEND-ONLY: don't modify existing methods.
85
+ // ============================================================
86
+ ```
87
+
88
+ ### Step 7 — Append-Only Guard
89
+
90
+ Before writing file: check if file already exists.
91
+ - **File doesn't exist** → create normally.
92
+ - **File exists** in version folder → check each test method:
93
+ - Method exists (same name) → **SKIP**, don't overwrite
94
+ - Method doesn't exist → append to end of class
95
+
96
+ ### Step 8 — Generate Test Data Files (if spec requires)
97
+
98
+ If spec has `test-data.{env}.json` references:
99
+ - Create `tests/ApiTests/data/test-data.Test.json` with sample data from spec
100
+ - Guide user to create `test-data.Staging.json` and `test-data.local.json`
101
+
102
+ ### Step 9 — Post-Generate Review
103
+
104
+ Launch `csharp-reviewer` agent:
105
+ > Review `tests/ApiTests/{version}/`. Read `.tas/rules/csharp/testing.md` + `.tas/rules/csharp/api-testing.md`.
106
+ > Focus: async/await, HttpClient disposal, assertion completeness, XML doc coverage.
107
+ > Format: Critical / High / Medium / Low with file:line.
108
+
109
+ Gate: Critical/High → fix immediately. Medium/Low → list suggestions.
110
+
111
+ ### Step 10 — Summary
112
+
113
+ Display:
114
+ 1. Test project path
115
+ 2. Number of test classes generated
116
+ 3. Number of test methods generated
117
+ 4. Coverage matrix (vs spec)
118
+ 5. Next steps to run tests
119
+
120
+ ```
121
+ ## API Tests Generated
122
+
123
+ **Project**: `tests/ApiTests/`
124
+ **Version**: v{N}
125
+ **Test Classes**: {N}
126
+ **Test Methods**: {N}
127
+
128
+ ### Generated Files
129
+ - tests/ApiTests/{version}/{Resource}ApiTests.cs
130
+ - tests/ApiTests/Shared/TestBase.cs (if new project)
131
+
132
+ ### Coverage (vs Spec)
133
+ [Print coverage table: spec test cases vs generated methods]
134
+
135
+ ### Next Steps
136
+ 1. Configure test environment: edit tests/ApiTests/appsettings.Test.json
137
+ 2. Add test data: tests/ApiTests/data/test-data.Test.json
138
+ 3. Run tests: `dotnet test tests/ApiTests/`
139
+ ```
140
+
141
+ ## Final Step — Token Log
142
+
143
+ Follow `.tas/rules/common/token-logging.md`: write AI Usage Log to API Test Spec file.
@@ -0,0 +1,19 @@
1
+ # /tas-brainstorm $ARGUMENTS
2
+
3
+ Role: Any
4
+ Structured brainstorming before coding or designing.
5
+
6
+ ## Actions
7
+ 1. $ARGUMENTS is the brainstorming topic
8
+ 2. Guide through 4 steps:
9
+ a. **Clarify**: Ask 3-5 questions to clarify the problem
10
+ b. **Explore**: Propose 3+ solution directions, each with pros/cons
11
+ c. **Evaluate**: Compare directions by criteria: complexity, maintainability, cost, time
12
+ d. **Decide**: Recommend best direction and reasoning
13
+
14
+ 3. If brainstorming result leads to architecture decision, suggest user run /tas-adr
15
+
16
+ ## Principles
17
+ - DO NOT jump straight to solution
18
+ - Ask first, suggest later
19
+ - Always consider at least 2 alternatives
@@ -0,0 +1,113 @@
1
+ # /tas-bug $ARGUMENTS
2
+
3
+ Manage entire bug lifecycle: create, analyze, fix, verify.
4
+ Bug status determines next step — no role declaration needed.
5
+
6
+ ## Always / Ask / Never
7
+
8
+ | | Action |
9
+ |---|---|
10
+ | **Always** | Display current status and next action before doing anything |
11
+ | **Always** | Write regression test BEFORE fixing |
12
+ | **Always** | Launch independent review agent after fix — no review in same session |
13
+ | **Ask** | When needing to read files outside Bug file (Status = Committed) |
14
+ | **Never** | Patch symptom — must fix root cause |
15
+ | **Never** | Skip review step after fix |
16
+ | **Never** | Auto-commit or push — wait for user manual testing first |
17
+
18
+ ## Stack Detection
19
+ Read `.tas/rules/common/stack-detection.md`.
20
+
21
+ ## Actions
22
+
23
+ ### Step 1 — Determine mode
24
+
25
+ `$ARGUMENTS` is new bug description → **CREATE mode**
26
+ `$ARGUMENTS` is Bug ID (e.g., `Bug-001`) → **UPDATE mode**
27
+
28
+ ---
29
+
30
+ ### CREATE mode
31
+
32
+ Role: PE or SE (whoever discovered the bug)
33
+
34
+ 1. Read `project.code` from root/`tas.yaml`
35
+ 2. Ask user:
36
+ - Which Feature does this bug belong to?
37
+ - Severity: `Critical` | `High` | `Medium` | `Low`
38
+ - Steps to reproduce
39
+ - Expected vs Actual behavior
40
+ - Environment where discovered: Test | Staging | Production
41
+ 3. Create `docs/bugs/{code}-Bug-{NNN}-{slug}.md` from template `.tas/templates/Bug.md`
42
+ 4. Initial bug status: `New`
43
+
44
+ ---
45
+
46
+ ### UPDATE mode
47
+
48
+ Find Bug file via glob `docs/bugs/*-Bug-{ID}-*.md`, read current status.
49
+
50
+ **Display before acting:**
51
+ > "Bug-{NNN} is currently at status: **{status}** — next step is {action}. Continue?"
52
+
53
+ ---
54
+
55
+ #### Status = `New` — Analyze (SE)
56
+
57
+ 1. Read error logs/stack trace from Bug file
58
+ 2. Trace code flow, identify file and line causing error
59
+ 3. Write Root Cause Analysis into Bug file
60
+ 4. Write Regression Test Cases (test that reproduces bug)
61
+ 5. Update status: `New` → `Committed`
62
+
63
+ ---
64
+
65
+ #### Status = `Committed` — Fix (SE)
66
+
67
+ **File reading rule:** ONLY read Bug file. DO NOT read PRD, SAD, ADR, Design-Spec, DO NOT scan directories.
68
+ If additional files needed → ask user confirmation first.
69
+
70
+ Before fixing, read:
71
+ - `.tas/rules/common/security.md` — fix must not create new security risks
72
+ - `.tas/rules/common/testing.md` — regression test writing patterns
73
+ - `.tas/rules/[lang_agent stack]/coding-style.md` — follow conventions
74
+
75
+ **Fix workflow:**
76
+ a. Run regression test case → confirm **FAIL** (reproduces bug)
77
+ b. Fix code at root cause
78
+ c. Run regression test → confirm **PASS**
79
+ d. Run full test suite → no new regressions
80
+ → If build fails or test compile errors: launch `build-resolver` agent with error output before continuing.
81
+
82
+ **After fix — Post-Fix Review (Isolated Agent):**
83
+
84
+ Follow `.tas/rules/common/post-implementation-review.md`.
85
+ Pass in: Bug file path, changed files list, stack (from CLAUDE.md), lang_agent.
86
+
87
+ After review passes:
88
+ - Update status: `Committed` → `Deploy Test`
89
+ - Output suggested commit message: `fix: {short description} - resolves Bug-{NNN}`
90
+ - Ask: "Have you tested manually? Want to commit and deploy to Test?"
91
+
92
+ ---
93
+
94
+ #### Status = `Verify Test` / `Verify Stag` — Verify (PE)
95
+
96
+ 1. PE verifies on corresponding environment:
97
+ - Run Steps to Reproduce again → confirm bug no longer exists
98
+ - Check regression test case has passed
99
+ 2. **Pass** → update to next status (`Deploy Stag` or `Done`)
100
+ 3. **Fail** → document reason, update status back to `Committed`, SE fixes again
101
+
102
+ ---
103
+
104
+ ## Principles
105
+ - DO NOT patch symptom — must fix root cause
106
+ - MUST have regression test case BEFORE fixing
107
+ - Review must run through independent Agent — not inline in current session
108
+ - `Critical`/`High` bugs must be fixed before Feature is Verified
109
+ - Flow: `New` → `Committed` → `Deploy Test` → `Verify Test` → `Deploy Stag` → `Verify Stag` → `Deploy Prod` → `Verify Prod` → `Done`
110
+
111
+ ## Final Step — Token Log
112
+
113
+ Follow `.tas/rules/common/token-logging.md`: write AI Usage Log to working Bug file.
@@ -0,0 +1,37 @@
1
+ # /tas-design $ARGUMENTS
2
+
3
+ Role: PE - Product Engineer
4
+ Create or update Design Specification document (UI/UX flows, wireframe descriptions).
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. Check if docs/design-spec.md already exists:
12
+
13
+ ### CREATE mode (file doesn't exist):
14
+ 3. Need context from .tas/templates/Design-Spec.md
15
+ 4. $ARGUMENTS is design scope description. If not provided, base on PRD.
16
+ 5. Create file docs/design-spec.md containing:
17
+ - User flows (Mermaid flowchart)
18
+ - Screen descriptions
19
+ - Navigation structure
20
+ - Interaction patterns
21
+ - Responsive behavior notes
22
+ 6. Update `project-status.yaml` per `.tas/rules/common/project-status.md` — add `artifacts.design_spec`.
23
+
24
+ ### UPDATE mode (file exists):
25
+ 3. Need context from current docs/design-spec.md
26
+ 4. $ARGUMENTS is change description. If not provided, ask user which section to update.
27
+ 5. Update file, add changelog
28
+ 6. Update `project-status.yaml` per `.tas/rules/common/project-status.md` — update `artifacts.design_spec`.
29
+
30
+ ## Principles
31
+ - Focus on flows and behavior, not pixel-perfect design
32
+ - Each screen needs: purpose, key elements, actions available
33
+ - Mermaid compliance: :::mermaid wrapper, no () in node labels
34
+
35
+ ## Final Step — Token Log
36
+
37
+ Follow `.tas/rules/common/token-logging.md`: write AI Usage Log to `docs/design-spec.md`.
@@ -0,0 +1,125 @@
1
+ # /tas-dev $ARGUMENTS
2
+
3
+ Role: SE - Software Engineer
4
+ Implement a User Story per approved Technical Plan.
5
+
6
+ ## Always / Ask / Never
7
+
8
+ | | Action |
9
+ |---|---|
10
+ | **Always** | Check `plan_status` before implementing |
11
+ | **Always** | Follow tasks in Story's `## Technical Plan` |
12
+ | **Always** | Launch independent review agent after implement — no review in same session |
13
+ | **Ask** | When discover plan needs significant changes during coding |
14
+ | **Ask** | When need to read files outside plan scope |
15
+ | **Never** | Implement outside Story scope |
16
+ | **Never** | Skip review step after implement |
17
+
18
+ ## IMPORTANT - File Reading Rules
19
+ - ONLY read Story file — Technical Plan has enough technical context.
20
+ - Don't auto-read PRD, SAD, ADR, Design-Spec unless user confirms.
21
+ - Don't list directories, don't scan project structure.
22
+ - Don't read `.tas/rules/common/story-done.md` at first step (only at final step).
23
+
24
+ ## Stack Detection
25
+ Read `.tas/rules/common/stack-detection.md`.
26
+
27
+ ## Actions
28
+
29
+ ### Step 1 — Identify Story
30
+
31
+ `$ARGUMENTS` is Story ID or file path.
32
+ If none: read `project-status.yaml`, find stories with `status: Committed` or `status: In Progress`. If more than one, list for user to choose.
33
+ Read Story file.
34
+
35
+ ### Step 1.5 — Gate: Check plan_status
36
+
37
+ Read `plan_status` from Story frontmatter.
38
+
39
+ **If `plan_status: pending`:**
40
+ Read `require_plan` from root/`tas.yaml`:
41
+ - `require_plan: true` (or field doesn't exist) → **STOP**:
42
+ > "This Story has no Technical Plan. Run `/tas-plan {Story-ID}` before implementing."
43
+ - `require_plan: false` → continue, show warning and wait for confirmation:
44
+ > "⚠️ Quick mode: Story has no Technical Plan. Continue implementing?"
45
+
46
+ **If `plan_status: completed`:** continue normally.
47
+
48
+ ### Step 2 — Read Technical Plan
49
+
50
+ From Story file, read `## Technical Plan` section:
51
+ - Chosen approach
52
+ - Files to Change / Files to Create
53
+ - Database Changes, Config Changes
54
+ - Tasks list (checklist to follow in order)
55
+
56
+ If no Technical Plan (quick mode) → analyze AC and implement directly per AC.
57
+
58
+ ### Step 3 — Implement
59
+
60
+ **If stack is Node.js/Express/Next.js** → Read `.tas/rules/typescript/patterns.md` and `.tas/rules/typescript/security.md` for repository pattern, N+1 prevention, error handler, caching, JWT/RBAC before coding.
61
+
62
+ #### If `use_tdd = true` in `tas.yaml`:
63
+
64
+ Read `.tas/rules/common/tdd.md` for Red-Green-Refactor discipline + Test Naming Convention.
65
+
66
+ Platform-specific test stacks (from stack detection):
67
+ - **Mobile (React Native)**: Jest + React Testing Library — Components (`render`, `fireEvent`, `screen`), Hooks (`renderHook`), Services/API (Jest mocks + MSW), Utils, Zustand stores. File: `src/**/*.test.ts(x)`
68
+ - **Web (React + Node)**: Vitest/Jest + React Testing Library — Components, Hooks, Services (MSW/Nock), Backend services (Jest). File: `src/**/*.test.ts(x)`
69
+ - **Backend (.NET)**: xUnit — Unit (services, repositories), Integration (TestServer), API (WebApplicationFactory). File: `tests/Unit/`, `tests/Integration/`, `tests/Api/`
70
+
71
+ #### If `use_tdd = false`:
72
+ a. Implement code per AC + Tasks in Technical Plan
73
+ b. Write unit tests covering cases in `## Unit Test Cases`
74
+ c. Run tests, fix if fail
75
+ → If tests still fail after 1 self-fix: launch `build-resolver` agent with error output to diagnose.
76
+
77
+ During implementation, tick each completed task in Story file: `- [x] Task 1: ...`
78
+
79
+ If discover plan needs significant changes → notify user before changing direction.
80
+
81
+ ### Step 4 — Post-Implementation Review (Isolated Agent)
82
+
83
+ Follow `.tas/rules/common/post-implementation-review.md`.
84
+ Pass in: Story file path, changed files list, stack (from CLAUDE.md), lang_agent.
85
+
86
+ ### Step 5 — Definition of Done
87
+
88
+ Read `.tas/rules/common/story-done.md`, verify each item, tick in Story:
89
+ - `- [x] Technical plan completed` — if plan_status: completed (or quick mode confirmed)
90
+ - `- [x] Code implemented` — if implementation done
91
+ - `- [x] Unit tests pass` — if tests passed
92
+ - `- [x] No regression` — if full test suite passed
93
+ - `- [x] Documentation updated (if needed)` — if updated
94
+ - `- [x] Code review passed` — if review gate passed (no Critical/High)
95
+ - `- [ ] Acceptance criteria verified` — DO NOT tick, let PE verify
96
+
97
+ **Optional — if Story changes public API, database schema, or setup:**
98
+ Launch `doc-updater` agent: update related docs (README, SAD section, API docs).
99
+ > Scope: [changed files list]. Story: [Story ID + title].
100
+ > Only update outdated docs — don't rewrite from scratch.
101
+
102
+ ### Step 6 — Wrap up
103
+
104
+ Update Story status → `In Progress` (if not already).
105
+ Create commit message per conventions in `CLAUDE.md`.
106
+ Ask: "Tests OK and review passed — have you tested manually? Want to move to Deploy Test?"
107
+
108
+ If Yes:
109
+ - Update Story status → `Deploy Test`
110
+ - Add Changelog entry
111
+ - Update `project-status.yaml`
112
+ - Suggest: `/ado-update story {ado-id} --status "Deploy Test"` if using ADO
113
+
114
+ ## Principles
115
+ - DO NOT implement outside Story scope
116
+ - Each public method MUST have XML doc comment (C#) or JSDoc (TypeScript) or docstring (Python)
117
+ - Review must run through independent Agent — not inline in current session
118
+ - **When to create ADR** (if Technical Plan didn't mention):
119
+ - Architecture changes affecting multiple components
120
+ - New design pattern or framework
121
+ - Important technical trade-off decisions
122
+
123
+ ## Final Step — Token Log
124
+
125
+ Follow `.tas/rules/common/token-logging.md`: write AI Usage Log to working Story file.