@torus-engineering/tas-kit 1.13.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 (100) 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 +142 -57
  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 -543
  94. package/package.json +2 -2
  95. package/.tas/README.md +0 -334
  96. package/.tas/commands/tas-epic.md +0 -35
  97. package/.tas/commands/tas-story.md +0 -91
  98. package/.tas/rules/common/story-done.md +0 -30
  99. package/.tas/templates/Epic.md +0 -46
  100. package/.tas/templates/Story.md +0 -90
@@ -1,143 +1,147 @@
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 1Locate 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.
1
+ ---
2
+ model: sonnet
3
+ ---
4
+
5
+ # /tas-apitest $ARGUMENTS
6
+
7
+ Role: SE - Software Engineer
8
+ Generate .NET xUnit automation test project for REST API from API Test Spec file (Markdown).
9
+
10
+ ## Always / Ask / Never
11
+
12
+ | | Action |
13
+ |---|---|
14
+ | **Always** | Read entire API Test Spec file before generating any test |
15
+ | **Always** | Organize tests by API version each version separate folder |
16
+ | **Always** | Append-only: don't modify files in existing old version folder |
17
+ | **Always** | URL and credentials in `appsettings.json` not hardcoded in code |
18
+ | **Always** | XML doc comment on each test method |
19
+ | **Ask** | When test spec unclear about expected response schema |
20
+ | **Never** | Modify or delete old version test files |
21
+ | **Never** | Hardcode base URL, API key, credentials in test code |
22
+ | **Never** | Skip error path each endpoint needs ≥1 happy path + ≥1 error path |
23
+
24
+ ## Actions
25
+
26
+ ### Step 1 Locate Input
27
+
28
+ `$ARGUMENTS` is path to API Test Spec file: `docs/tests/API-Test-Spec-{slug}.md`.
29
+
30
+ If not provided → ask user:
31
+ ```
32
+ Enter path to API Test Spec file (e.g., docs/tests/API-Test-Spec-users.md)
33
+ ```
34
+
35
+ ### Step 2 — Parse API Test Spec
36
+
37
+ Read `.tas/rules/csharp/api-testing.md` for conventions before generating.
38
+
39
+ From API Test Spec file, collect:
40
+ - API version
41
+ - Endpoints with method, path, params
42
+ - Test cases per endpoint (TC-XXX)
43
+ - Request/response schemas
44
+ - Auth requirements
45
+ - Test data requirements
46
+ - Setup/teardown notes
47
+
48
+ ### Step 3 Detect Existing Test Project
49
+
50
+ Glob find `**/ApiTests/*.csproj`, `**/Api.Tests/*.csproj`, `**/IntegrationTests/*.csproj`.
51
+
52
+ - **Found**: Read current framework (xUnit/NUnit/MSTest), glob `v*/` folders to know existing versions.
53
+ - **Not found**: Create new at `tests/ApiTests/` with xUnit + FluentAssertions (per `csharp/testing.md`).
54
+
55
+ ### Step 4 Get API Version from Spec
56
+
57
+ Read version from API Test Spec file (find frontmatter `api_version` or section headers `## v{N}`).
58
+
59
+ Version folder: lowercase, no dot `v1`, `v2` (not `v1.0`).
60
+
61
+ ### Step 5 Generate Infrastructure (only when creating new project)
62
+
63
+ Read `.tas/rules/csharp/api-testing.md` section **Project Structure** and **Config Pattern** to generate:
64
+ - `ApiTests.csproj` with standard packages
65
+ - `appsettings.json` (base) + `appsettings.Test.json` + `appsettings.Staging.json` with values from spec
66
+ - `Shared/TestBase.cs`load config, HttpClient, helper methods
67
+ - `Shared/ApiTestSettings.cs` — strongly typed settings
68
+ - `.gitignore` for `appsettings.*.local.json`
69
+
70
+ ### Step 6 Generate Test Classes from Spec
71
+
72
+ Group endpoints by resource. Each group `tests/ApiTests/{version}/{Resource}ApiTests.cs`.
73
+
74
+ For each test case (TC-XXX) in spec:
75
+ 1. Read test case details
76
+ 2. Map to test method with naming: `{HttpMethod}_{Resource}_Returns{Status}_When{Condition}`
77
+ 3. Generate XML doc from test case title
78
+ 4. Generate assertions from expected response
79
+ 5. Add AC reference comment if any
80
+
81
+ Test class header comment:
82
+ ```csharp
83
+ // ============================================================
84
+ // {Resource} API Tests v{N}
85
+ // Spec: docs/tests/API-Test-Spec-{slug}.md
86
+ // Generated: {YYYY-MM-DD}
87
+ // Feature: {ID} (if applicable)
88
+ // APPEND-ONLY: don't modify existing methods.
89
+ // ============================================================
90
+ ```
91
+
92
+ ### Step 7 Append-Only Guard
93
+
94
+ Before writing file: check if file already exists.
95
+ - **File doesn't exist** → create normally.
96
+ - **File exists** in version folder check each test method:
97
+ - Method exists (same name) → **SKIP**, don't overwrite
98
+ - Method doesn't exist → append to end of class
99
+
100
+ ### Step 8 Generate Test Data Files (if spec requires)
101
+
102
+ If spec has `test-data.{env}.json` references:
103
+ - Create `tests/ApiTests/data/test-data.Test.json` with sample data from spec
104
+ - Guide user to create `test-data.Staging.json` and `test-data.local.json`
105
+
106
+ ### Step 9 Post-Generate Review
107
+
108
+ Launch `csharp-reviewer` agent:
109
+ > Review `tests/ApiTests/{version}/`. Read `.tas/rules/csharp/testing.md` + `.tas/rules/csharp/api-testing.md`.
110
+ > Focus: async/await, HttpClient disposal, assertion completeness, XML doc coverage.
111
+ > Format: Critical / High / Medium / Low with file:line.
112
+
113
+ Gate: Critical/High → fix immediately. Medium/Low → list suggestions.
114
+
115
+ ### Step 10 Summary
116
+
117
+ Display:
118
+ 1. Test project path
119
+ 2. Number of test classes generated
120
+ 3. Number of test methods generated
121
+ 4. Coverage matrix (vs spec)
122
+ 5. Next steps to run tests
123
+
124
+ ```
125
+ ## API Tests Generated
126
+
127
+ **Project**: `tests/ApiTests/`
128
+ **Version**: v{N}
129
+ **Test Classes**: {N}
130
+ **Test Methods**: {N}
131
+
132
+ ### Generated Files
133
+ - tests/ApiTests/{version}/{Resource}ApiTests.cs
134
+ - tests/ApiTests/Shared/TestBase.cs (if new project)
135
+
136
+ ### Coverage (vs Spec)
137
+ [Print coverage table: spec test cases vs generated methods]
138
+
139
+ ### Next Steps
140
+ 1. Configure test environment: edit tests/ApiTests/appsettings.Test.json
141
+ 2. Add test data: tests/ApiTests/data/test-data.Test.json
142
+ 3. Run tests: `dotnet test tests/ApiTests/`
143
+ ```
144
+
145
+ ## Final Step — Token Log
146
+
147
+ Follow `.tas/rules/common/token-logging.md`: write AI Usage Log to API Test Spec file.
@@ -1,19 +1,23 @@
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
1
+ ---
2
+ model: opus
3
+ ---
4
+
5
+ # /tas-brainstorm $ARGUMENTS
6
+
7
+ Role: Any
8
+ Structured brainstorming before coding or designing.
9
+
10
+ ## Actions
11
+ 1. $ARGUMENTS is the brainstorming topic
12
+ 2. Guide through 4 steps:
13
+ a. **Clarify**: Ask 3-5 questions to clarify the problem
14
+ b. **Explore**: Propose 3+ solution directions, each with pros/cons
15
+ c. **Evaluate**: Compare directions by criteria: complexity, maintainability, cost, time
16
+ d. **Decide**: Recommend best direction and reasoning
17
+
18
+ 3. If brainstorming result leads to architecture decision, suggest user run /tas-adr
19
+
20
+ ## Principles
21
+ - DO NOT jump straight to solution
22
+ - Ask first, suggest later
23
+ - Always consider at least 2 alternatives
@@ -0,0 +1,50 @@
1
+ ---
2
+ model: opus
3
+ ---
4
+
5
+ # /tas-brd $ARGUMENTS
6
+
7
+ Role: PE - Product Engineer
8
+ Create or update Business Requirements Document.
9
+
10
+ ## Actions
11
+ 1. Read root/tas.yaml for project context
12
+ 2. Check if docs/brd.md already exists:
13
+
14
+ ### CREATE mode (file doesn't exist):
15
+ 3. Read .tas/templates/BRD.md
16
+ 4. If $ARGUMENTS has content, use as initiative/problem description input
17
+ 5. If no $ARGUMENTS, ask user:
18
+ - What business problem or opportunity does this initiative address?
19
+ - What are the primary business objectives and KPIs?
20
+ - Who are the key stakeholders?
21
+ - What is in scope vs out of scope?
22
+ - Are there budget, timeline, or regulatory constraints?
23
+ 6. Create file docs/brd.md per template — fill all 9 sections
24
+ 7. Update `project-status.yaml` per `.tas/rules/common/project-status.md` — add `artifacts.brd`
25
+
26
+ ### UPDATE mode (file exists):
27
+ 3. Read current docs/brd.md
28
+ 4. $ARGUMENTS is change description. If not provided, ask user which section to update.
29
+ 5. Update file, keep unchanged sections as-is
30
+ 6. Add line to Changelog section at end: date, change description
31
+ 7. Update `project-status.yaml` per `.tas/rules/common/project-status.md` — update `artifacts.brd`
32
+
33
+ ## Principles
34
+ - **BRD is business-level only** — no technical implementation detail, no architecture decisions
35
+ - Business Requirements (BR-xxx) describe WHAT the business needs, not HOW to build it
36
+ - Stakeholder table must include decision makers, contributors, and informed parties
37
+ - Constraints section must include budget, timeline, legal/regulatory, and technical limits
38
+ - Always include Out of Scope items — explicit exclusions prevent scope creep
39
+ - KPIs must be measurable with targets (e.g. "reduce by 30%" not "improve")
40
+ - Mermaid diagrams must use :::mermaid wrapper, NO () characters
41
+
42
+ ## Relationship to PRD
43
+ - BRD answers: **Why?** (business need, goals, constraints)
44
+ - PRD answers: **What?** (product behavior, features, acceptance criteria)
45
+ - 1 BRD → 1 PRD in this kit (Option A cardinality)
46
+ - PRD command (`/tas-prd`) reads BRD for context and generates summary link-back
47
+
48
+ ## Final Step — Token Log
49
+
50
+ Apply `.tas/rules/common/token-logging.md` to `docs/brd.md` NOW (do not defer, do not leave placeholder text). Estimate input/output tokens from this session per the rule, then fill the `## AI Usage Log` table row and Total. The BRD template already includes the skeleton — replace `~{N}k` with actual estimates.
@@ -1,113 +1,127 @@
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 pushwait 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 Agentnot 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.
1
+ ---
2
+ model: sonnet
3
+ ---
4
+
5
+ # /tas-bug $ARGUMENTS
6
+
7
+ Manage entire bug lifecycle: create, analyze, fix, verify.
8
+ Bug status determines next step — no role declaration needed.
9
+
10
+ ## Always / Ask / Never
11
+
12
+ | | Action |
13
+ |---|---|
14
+ | **Always** | Display current status and next action before doing anything |
15
+ | **Always** | Write regression test BEFORE fixing |
16
+ | **Always** | Launch independent review agent after fix no review in same session |
17
+ | **Ask** | When needing to read files outside Bug file (Status = Committed) |
18
+ | **Never** | Patch symptom — must fix root cause |
19
+ | **Never** | Skip review step after fix |
20
+ | **Never** | Auto-commit or push — wait for user manual testing first |
21
+
22
+ ## Stack Detection
23
+ Read `.tas/rules/common/stack-detection.md`.
24
+
25
+ ## Actions
26
+
27
+ ### Step 1 — Determine mode
28
+
29
+ `$ARGUMENTS` is new bug description → **CREATE mode**
30
+ `$ARGUMENTS` is Bug ID (e.g., `Bug-001`) → **UPDATE mode**
31
+
32
+ ---
33
+
34
+ ### CREATE mode
35
+
36
+ Role: PE or SE (whoever discovered the bug)
37
+
38
+ 1. Read `project.code` from root/`tas.yaml`
39
+ 2. Ask user:
40
+ - Which Feature does this bug belong to?
41
+ - Severity: `Critical` | `High` | `Medium` | `Low`
42
+ - Steps to reproduce
43
+ - Expected vs Actual behavior
44
+ - Environment where discovered: Test | Staging | Production
45
+ 3. Create `docs/bugs/{code}-Bug-{NNN}-{slug}.md` from template `.tas/templates/Bug.md`
46
+ 4. Initial bug status: `New`
47
+
48
+ ---
49
+
50
+ ### UPDATE mode
51
+
52
+ Find Bug file via glob `docs/bugs/*-Bug-{ID}-*.md`, read current status.
53
+
54
+ **Display before acting:**
55
+ > "Bug-{NNN} is currently at status: **{status}** next step is {action}. Continue?"
56
+
57
+ ---
58
+
59
+ #### Status = `New` Analyze (SE)
60
+
61
+ 1. Read error logs/stack trace from Bug file
62
+ 2. Trace code flow, identify file and line causing error
63
+ 3. Write Root Cause Analysis into Bug file
64
+ 4. Write Regression Test Cases (test that reproduces bug)
65
+ 5. **Fill SAD Impact Matrix** — read `.tas/rules/common/sad-impact.md`. Anticipate fix scope (will it add lib / cache / queue / column / ENV / port / auth change / etc.). Mark `Detected: Yes` rows + SAD section + summary. If any Yes → set frontmatter `sad_impact: true`. Reading `docs/sad.md` allowed in this step (limited to sections referenced by matrix).
66
+ 6. Update status: `New` → `Committed`
67
+
68
+ ---
69
+
70
+ #### Status = `Committed` — Fix (SE)
71
+
72
+ **File reading rule:** ONLY read Bug file. DO NOT read PRD, ADR, Design-Spec, DO NOT scan directories.
73
+ SAD read **allowed** if Bug frontmatter `sad_impact: true` (limited to sections in matrix).
74
+ If other files needed → ask user confirmation first.
75
+
76
+ Before fixing, read:
77
+ - `.tas/rules/common/security.md` fix must not create new security risks
78
+ - `.tas/rules/common/testing.md` regression test writing patterns
79
+ - `.tas/rules/[lang_agent stack]/coding-style.md` follow conventions
80
+
81
+ **Fix workflow:**
82
+ a. Run regression test case → confirm **FAIL** (reproduces bug)
83
+ b. Fix code at root cause
84
+ c. Run regression test → confirm **PASS**
85
+ d. Run full test suite no new regressions
86
+ → If build fails or test compile errors: launch `build-resolver` agent with error output before continuing.
87
+
88
+ **After fix Post-Fix Review (Isolated Agent):**
89
+
90
+ Follow `.tas/rules/common/post-implementation-review.md`.
91
+ Pass in: Bug file path, changed files list, stack (from CLAUDE.md), lang_agent.
92
+
93
+ After review passes:
94
+
95
+ **SAD update (if flagged):** If Bug frontmatter `sad_impact: true`:
96
+ - Re-evaluate matrix vs actual fix (fix scope may have shifted from analyze-time estimate). Update matrix Yes/No if changed.
97
+ - If still any Yesauto-invoke `/tas-sad "Bug-{NNN}: {one-line summary from matrix Yes rows}"` inline. Verify `docs/sad.md` Changelog contains `Bug-{NNN}` ref before status transition.
98
+ - If matrix is now all No → set frontmatter `sad_impact: false`, skip invoke.
99
+
100
+ **Status transition:**
101
+ - Update status: `Committed` → `Deploy Test`
102
+ - Output suggested commit message: `fix: {short description} - resolves Bug-{NNN}`
103
+ - Ask: "Have you tested manually? Want to commit and deploy to Test?"
104
+
105
+ ---
106
+
107
+ #### Status = `Verify Test` / `Verify Stag` Verify (PE)
108
+
109
+ 1. PE verifies on corresponding environment:
110
+ - Run Steps to Reproduce again → confirm bug no longer exists
111
+ - Check regression test case has passed
112
+ 2. **Pass** → update to next status (`Deploy Stag` or `Done`)
113
+ - **SAD Done Gate** (when transitioning to `Done`): if Bug frontmatter `sad_impact: true` → grep `docs/sad.md` Changelog for `Bug-{NNN}` ref. No match → BLOCK `Done`, surface: "SAD impact flagged but `docs/sad.md` Changelog missing Bug-{NNN} ref. Re-run `/tas-sad` before closing."
114
+ 3. **Fail** → document reason, update status back to `Committed`, SE fixes again
115
+
116
+ ---
117
+
118
+ ## Principles
119
+ - DO NOT patch symptom — must fix root cause
120
+ - MUST have regression test case BEFORE fixing
121
+ - Review must run through independent Agent — not inline in current session
122
+ - `Critical`/`High` bugs must be fixed before Feature is Verified
123
+ - Flow: `New` → `Committed` → `Deploy Test` → `Verify Test` → `Deploy Stag` → `Verify Stag` → `Deploy Prod` → `Verify Prod` → `Done`
124
+
125
+ ## Final Step — Token Log
126
+
127
+ Follow `.tas/rules/common/token-logging.md`: write AI Usage Log to working Bug file.