@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.
- package/.tas/_platform/claude-code/settings.json +58 -46
- package/.tas/_platform/hooks/code-quality.js +127 -127
- package/.tas/_platform/hooks/session-end.js +111 -111
- package/.tas/agents/architect.md +53 -53
- package/.tas/agents/aws-reviewer.md +71 -71
- package/.tas/agents/build-resolver.md +89 -59
- package/.tas/agents/code-explorer.md +63 -63
- package/.tas/agents/csharp-reviewer.md +62 -62
- package/.tas/agents/database-reviewer.md +73 -73
- package/.tas/agents/doc-updater.md +68 -66
- package/.tas/agents/python-reviewer.md +67 -67
- package/.tas/agents/security-reviewer.md +79 -79
- package/.tas/agents/software-engineer.md +53 -0
- package/.tas/agents/typescript-reviewer.md +65 -65
- package/.tas/commands/ado-create.md +33 -28
- package/.tas/commands/ado-delete.md +26 -22
- package/.tas/commands/ado-get.md +24 -20
- package/.tas/commands/ado-status.md +22 -18
- package/.tas/commands/ado-update.md +31 -27
- package/.tas/commands/tas-adr.md +37 -33
- package/.tas/commands/tas-apitest-plan.md +177 -173
- package/.tas/commands/tas-apitest.md +147 -143
- package/.tas/commands/tas-brainstorm.md +23 -19
- package/.tas/commands/tas-brd.md +50 -0
- package/.tas/commands/tas-bug.md +127 -113
- package/.tas/commands/tas-checklist.md +180 -0
- package/.tas/commands/tas-debug.md +103 -0
- package/.tas/commands/tas-design.md +41 -37
- package/.tas/commands/tas-dev.md +225 -125
- package/.tas/commands/tas-e2e-mobile.md +146 -155
- package/.tas/commands/tas-e2e-web.md +150 -163
- package/.tas/commands/tas-e2e.md +289 -102
- package/.tas/commands/tas-feature.md +181 -47
- package/.tas/commands/tas-fix.md +72 -51
- package/.tas/commands/tas-functest-mobile.md +138 -144
- package/.tas/commands/tas-functest-web.md +176 -192
- package/.tas/commands/tas-functest.md +225 -76
- package/.tas/commands/tas-init.md +22 -17
- package/.tas/commands/tas-master-plan.md +300 -0
- package/.tas/commands/tas-orchestrate.md +159 -0
- package/.tas/commands/tas-plan.md +152 -117
- package/.tas/commands/tas-prd.md +57 -37
- package/.tas/commands/tas-review-pr.md +174 -0
- package/.tas/commands/tas-review.md +115 -113
- package/.tas/commands/tas-sad.md +47 -43
- package/.tas/commands/tas-security.md +91 -87
- package/.tas/commands/tas-spec.md +54 -50
- package/.tas/commands/tas-status.md +25 -16
- package/.tas/project-status-example.yaml +3 -1
- package/.tas/rules/ado-integration.md +67 -65
- package/.tas/rules/common/api-design.md +517 -517
- package/.tas/rules/common/build-debug-loop.md +233 -0
- package/.tas/rules/common/code-review.md +4 -0
- package/.tas/rules/common/feature-done.md +42 -0
- package/.tas/rules/common/post-implementation-review.md +4 -0
- package/.tas/rules/common/project-status.md +33 -16
- package/.tas/rules/common/sad-impact.md +81 -0
- package/.tas/rules/common/tdd.md +104 -89
- package/.tas/rules/csharp/api-testing.md +2 -2
- package/.tas/rules/csharp/torus-core-framework.md +128 -0
- package/.tas/tas-example.yaml +9 -32
- package/.tas/templates/AGENTS.md +13 -0
- package/.tas/templates/API-Test-Spec.md +5 -4
- package/.tas/templates/BRD.md +133 -0
- package/.tas/templates/Bug.md +15 -0
- package/.tas/templates/E2E-Execution-Report.md +8 -8
- package/.tas/templates/E2E-Mobile-Spec.md +6 -8
- package/.tas/templates/E2E-Report.md +2 -2
- package/.tas/templates/E2E-Scenario.md +22 -22
- package/.tas/templates/E2E-Test-Spec.md +274 -0
- package/.tas/templates/E2E-Web-Spec.md +4 -4
- package/.tas/templates/Feature-Technical-Part.md +69 -0
- package/.tas/templates/Feature-Technical-Stack.md +74 -0
- package/.tas/templates/Feature-Technical.md +329 -0
- package/.tas/templates/Feature.md +50 -26
- package/.tas/templates/Func-Test-Script.md +29 -56
- package/.tas/templates/Func-Test-Spec.md +144 -142
- package/.tas/templates/PRD.md +173 -142
- package/.tas/templates/TestChecklist.md +96 -0
- package/.tas/templates/torus-dotnet-bootstrap.md +223 -0
- package/.tas/tools/tas-ado-readme.md +24 -27
- package/.tas/tools/tas-ado.py +328 -25
- package/.tas/tools/tas-github.py +339 -0
- package/README.md +142 -57
- package/bin/cli.js +90 -90
- package/lib/adapters/antigravity.js +131 -131
- package/lib/adapters/claude-code.js +71 -35
- package/lib/adapters/codex.js +157 -157
- package/lib/adapters/cursor.js +80 -80
- package/lib/adapters/index.js +20 -20
- package/lib/adapters/utils.js +81 -81
- package/lib/deleted-files.json +7 -0
- package/lib/install.js +546 -543
- package/package.json +2 -2
- package/.tas/README.md +0 -334
- package/.tas/commands/tas-epic.md +0 -35
- package/.tas/commands/tas-story.md +0 -91
- package/.tas/rules/common/story-done.md +0 -30
- package/.tas/templates/Epic.md +0 -46
- package/.tas/templates/Story.md +0 -90
|
@@ -1,143 +1,147 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
|
13
|
-
|
|
14
|
-
| **Always** |
|
|
15
|
-
| **
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
18
|
-
| **
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
###
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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.
|
package/.tas/commands/tas-bug.md
CHANGED
|
@@ -1,113 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
|
13
|
-
|
|
14
|
-
| **
|
|
15
|
-
| **
|
|
16
|
-
| **
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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 Yes → auto-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.
|