@torus-engineering/tas-kit 1.9.0 → 1.11.1
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/.claude/commands/ado-create.md +17 -17
- package/.claude/commands/ado-delete.md +11 -11
- package/.claude/commands/ado-get.md +12 -12
- package/.claude/commands/ado-status.md +12 -12
- package/.claude/commands/ado-update.md +15 -15
- package/.claude/commands/tas-adr.md +33 -33
- package/.claude/commands/tas-apitest-plan.md +173 -173
- package/.claude/commands/tas-apitest.md +143 -143
- package/.claude/commands/tas-brainstorm.md +14 -14
- package/.claude/commands/tas-bug.md +113 -113
- package/.claude/commands/tas-design.md +37 -37
- package/.claude/commands/tas-dev.md +128 -128
- package/.claude/commands/tas-e2e-mobile.md +155 -155
- package/.claude/commands/tas-e2e-web.md +163 -163
- package/.claude/commands/tas-e2e.md +102 -102
- package/.claude/commands/tas-epic.md +35 -35
- package/.claude/commands/tas-feature.md +47 -47
- package/.claude/commands/tas-fix.md +51 -51
- package/.claude/commands/tas-functest-mobile.md +144 -144
- package/.claude/commands/tas-functest-web.md +192 -192
- package/.claude/commands/tas-functest.md +76 -76
- package/.claude/commands/tas-init.md +14 -14
- package/.claude/commands/tas-plan.md +198 -200
- package/.claude/commands/tas-prd.md +37 -37
- package/.claude/commands/tas-review.md +111 -111
- package/.claude/commands/tas-sad.md +43 -43
- package/.claude/commands/tas-security.md +87 -81
- package/.claude/commands/tas-spec.md +20 -20
- package/.claude/commands/tas-status.md +13 -13
- package/.claude/commands/tas-story.md +91 -91
- package/.claude/commands/tas-verify.md +51 -51
- package/.claude/rules/common/post-review-agent.md +49 -49
- package/.claude/rules/common/project-status.md +14 -14
- package/.claude/rules/common/stack-detection.md +6 -6
- package/.claude/rules/common/token-logging.md +27 -27
- package/.claude/rules/csharp/api-testing.md +171 -171
- package/.claude/skills/ado-integration/SKILL.md +36 -36
- package/.claude/skills/tas-conventions/SKILL.md +32 -32
- package/.claude/skills/tas-implementation-complete/SKILL.md +100 -99
- package/.claude/skills/tas-tdd/SKILL.md +123 -123
- package/.claude/skills/token-logger/SKILL.md +19 -19
- package/.tas/README.md +266 -1520
- package/.tas/checklists/code-review.md +13 -13
- package/.tas/checklists/security.md +3 -3
- package/.tas/checklists/story-done.md +11 -11
- package/.tas/hooks/README.md +138 -0
- package/.tas/hooks/pre-commit +26 -0
- package/.tas/hooks/security-scan.js +599 -0
- package/.tas/project-status-example.yaml +3 -3
- package/.tas/tas-example.yaml +25 -8
- package/.tas/templates/ADR.md +16 -16
- package/.tas/templates/API-Test-Spec.md +3 -3
- package/.tas/templates/Bug.md +12 -12
- package/.tas/templates/Design-Spec.md +8 -8
- package/.tas/templates/E2E-Execution-Report.md +1 -1
- package/.tas/templates/Epic.md +1 -1
- package/.tas/templates/Feature.md +10 -10
- package/.tas/templates/Func-Test-Spec.md +3 -3
- package/.tas/templates/SAD.md +106 -106
- package/.tas/templates/Security-Report.md +3 -3
- package/.tas/templates/Story.md +9 -9
- package/.tas/tools/tas-ado-readme.md +169 -169
- package/.tas/tools/tas-ado.py +1 -1
- package/CLAUDE-Example.md +37 -58
- package/README.md +294 -42
- package/bin/cli.js +24 -7
- package/lib/install.js +161 -47
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
# /ado-create $ARGUMENTS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Create new work item on Azure DevOps from local .md file.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Syntax
|
|
6
6
|
/ado-create <type> <temp-id> [--parent-id <id>]
|
|
7
7
|
|
|
8
8
|
- type: epic | feature | story | bug
|
|
9
|
-
- temp-id: ID
|
|
10
|
-
- --parent-id: ADO ID
|
|
9
|
+
- temp-id: Temporary ID in local filename (will be renamed after creating on ADO)
|
|
10
|
+
- --parent-id: ADO ID of parent work item (optional)
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Examples
|
|
13
13
|
/ado-create story 789 --parent-id 456
|
|
14
14
|
/ado-create epic 001
|
|
15
15
|
/ado-create bug 003 --parent-id 123
|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
1.
|
|
19
|
-
2.
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
- Extract title
|
|
23
|
-
-
|
|
24
|
-
- Rename file
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
17
|
+
## Actions
|
|
18
|
+
1. Read `tas.yaml`, check `ado.enabled`. If `false` or missing: report "ADO integration is disabled (`ado.enabled: false` in tas.yaml)." then stop.
|
|
19
|
+
2. Run: python .tas/tools/tas-ado.py create-<type> <temp-id> [--parent-id <id>]
|
|
20
|
+
3. Script will:
|
|
21
|
+
- Find file by pattern {type}-{temp-id}-*.md
|
|
22
|
+
- Extract title and description
|
|
23
|
+
- Create work item on ADO
|
|
24
|
+
- Rename file to {type}-{ado_id}-*.md
|
|
25
|
+
- Add parent relation if --parent-id provided
|
|
26
|
+
- Update frontmatter: ado_id, last_ado_sync
|
|
27
|
+
4. Update root/project-status.yaml
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
# /ado-delete $ARGUMENTS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Delete work item on Azure DevOps. Does NOT delete local file.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Syntax
|
|
6
6
|
/ado-delete <type> <ado-id>
|
|
7
7
|
|
|
8
8
|
- type: epic | feature | story | bug
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Examples
|
|
11
11
|
/ado-delete story 1234
|
|
12
12
|
/ado-delete bug 5678
|
|
13
13
|
|
|
14
|
-
##
|
|
15
|
-
1.
|
|
16
|
-
2.
|
|
17
|
-
3.
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
14
|
+
## Actions
|
|
15
|
+
1. Read `tas.yaml`, check `ado.enabled`. If `false` or missing: report "ADO integration is disabled (`ado.enabled: false` in tas.yaml)." then stop.
|
|
16
|
+
2. MUST ask user confirmation before deleting: "Are you sure you want to delete <type> #<ado-id> on ADO?"
|
|
17
|
+
3. After user confirms, run: python .tas/tools/tas-ado.py delete-<type> <ado-id>
|
|
18
|
+
4. Script will:
|
|
19
|
+
- Delete work item on ADO
|
|
20
|
+
- NOT delete local file (keep for reference)
|
|
21
|
+
- Update frontmatter: ado_state = Removed, last_ado_sync
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
# /ado-get $ARGUMENTS
|
|
2
2
|
|
|
3
|
-
Pull work item
|
|
3
|
+
Pull work item from Azure DevOps to local .md file.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Syntax
|
|
6
6
|
/ado-get <ado-id>
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Examples
|
|
9
9
|
/ado-get 5345
|
|
10
10
|
/ado-get 1234
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
- Convert description HTML
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
12
|
+
## Actions
|
|
13
|
+
1. Read `tas.yaml`, check `ado.enabled`. If `false` or missing: report "ADO integration is disabled (`ado.enabled: false` in tas.yaml)." then stop.
|
|
14
|
+
2. Run: python .tas/tools/tas-ado.py get <ado-id>
|
|
15
|
+
3. Script will:
|
|
16
|
+
- Fetch work item from ADO
|
|
17
|
+
- Convert description HTML to Markdown
|
|
18
|
+
- Create file {type}-{ado_id}-{slug}.md with frontmatter + content
|
|
19
|
+
- Update last_ado_sync
|
|
20
|
+
4. If file already exists, ask user if they want to overwrite
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
# /ado-status $ARGUMENTS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Update only work item status on Azure DevOps (fast, no content push).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Syntax
|
|
6
6
|
/ado-status <ado-id> --status <state> [--assign <name/email>]
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Examples
|
|
9
9
|
/ado-status 1234 --status "In Progress"
|
|
10
|
-
/ado-status 5678 --status "Resolved" --assign "
|
|
10
|
+
/ado-status 5678 --status "Resolved" --assign "user@example.com"
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
12
|
+
## Actions
|
|
13
|
+
1. Read `tas.yaml`, check `ado.enabled`. If `false` or missing: report "ADO integration is disabled (`ado.enabled: false` in tas.yaml)." then stop.
|
|
14
|
+
2. Run: python .tas/tools/tas-ado.py update-status <ado-id> --status <state> [--assign ...]
|
|
15
|
+
3. Script will:
|
|
16
|
+
- Only update state and/or assigned-to on ADO
|
|
17
|
+
- Find local file, update frontmatter: ado_state, last_ado_sync
|
|
18
|
+
- Update root/project-status.yaml
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
# /ado-update $ARGUMENTS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Update work item on Azure DevOps from local .md file.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Syntax
|
|
6
6
|
/ado-update <type> <ado-id> [--assign <name/email>] [--status <state>]
|
|
7
7
|
|
|
8
8
|
- type: epic | feature | story | bug
|
|
9
9
|
- ado-id: ADO work item ID
|
|
10
|
-
- --assign:
|
|
11
|
-
- --status:
|
|
10
|
+
- --assign: assign to person (optional)
|
|
11
|
+
- --status: update status (optional)
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Examples
|
|
14
14
|
/ado-update story 1234 --status "In Progress"
|
|
15
|
-
/ado-update bug 5678 --assign "
|
|
15
|
+
/ado-update bug 5678 --assign "user@example.com" --status "Committed"
|
|
16
16
|
/ado-update feature 456
|
|
17
17
|
|
|
18
|
-
##
|
|
19
|
-
1.
|
|
20
|
-
2.
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
18
|
+
## Actions
|
|
19
|
+
1. Read `tas.yaml`, check `ado.enabled`. If `false` or missing: report "ADO integration is disabled (`ado.enabled: false` in tas.yaml)." then stop.
|
|
20
|
+
2. Run: python .tas/tools/tas-ado.py update-<type> <ado-id> [--assign ...] [--status ...]
|
|
21
|
+
3. Script will:
|
|
22
|
+
- Find local file by pattern *-<ado-id>-*.md
|
|
23
|
+
- Read title and description from file
|
|
24
|
+
- Update work item on ADO
|
|
25
|
+
- Update frontmatter: ado_state, ado_assigned_to, last_ado_sync
|
|
26
|
+
4. If no --assign and --status provided, push entire file content to ADO
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
# /tas-adr $ARGUMENTS
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
##
|
|
7
|
-
1.
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
|
|
11
|
-
###
|
|
12
|
-
4.
|
|
13
|
-
5.
|
|
14
|
-
6.
|
|
15
|
-
7.
|
|
16
|
-
|
|
17
|
-
###
|
|
18
|
-
4.
|
|
19
|
-
5.
|
|
20
|
-
6.
|
|
21
|
-
7.
|
|
22
|
-
8.
|
|
23
|
-
|
|
24
|
-
##
|
|
25
|
-
- ADR
|
|
26
|
-
- Status: Proposed | Accepted | Deprecated | Superseded
|
|
27
|
-
-
|
|
28
|
-
- Link
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
##
|
|
32
|
-
|
|
33
|
-
Invoke skill `token-logger`:
|
|
1
|
+
# /tas-adr $ARGUMENTS
|
|
2
|
+
|
|
3
|
+
Role: SE - Software Engineer
|
|
4
|
+
Create or update Architecture Decision Record.
|
|
5
|
+
|
|
6
|
+
## Actions
|
|
7
|
+
1. Need context from .tas/templates/ADR.md
|
|
8
|
+
2. Scan docs/adr/ to identify existing ADRs
|
|
9
|
+
3. Determine mode based on $ARGUMENTS:
|
|
10
|
+
|
|
11
|
+
### CREATE mode ($ARGUMENTS is new title, e.g., "Use CQRS for Order Service"):
|
|
12
|
+
4. Determine next sequence number (ADR-001, ADR-002...)
|
|
13
|
+
5. If docs/sad.md exists, need context from SAD to ensure ADR consistency
|
|
14
|
+
6. Create file docs/adr/ADR-{NNN}-{slug}.md
|
|
15
|
+
7. Update `project-status.yaml` per `.claude/rules/common/project-status.md` — add entry to `adrs`.
|
|
16
|
+
|
|
17
|
+
### UPDATE mode ($ARGUMENTS is ADR ID, e.g., "ADR-001"):
|
|
18
|
+
4. Need context from current ADR file
|
|
19
|
+
5. Ask user what needs changing (update status, add consequences, supersede...)
|
|
20
|
+
6. Update file, add changelog
|
|
21
|
+
7. If supersede: update old ADR status to "Superseded by ADR-{NNN}"
|
|
22
|
+
8. Update `project-status.yaml` per `.claude/rules/common/project-status.md` — update `adrs.{ADR_ID}.status`.
|
|
23
|
+
|
|
24
|
+
## Principles
|
|
25
|
+
- ADR must have: Context, Decision, Rationale, Consequences, Alternatives Considered
|
|
26
|
+
- Status: Proposed | Accepted | Deprecated | Superseded
|
|
27
|
+
- Each ADR is independent, self-contained with enough context to understand
|
|
28
|
+
- Link to related ADRs if any (Supersedes, Related to)
|
|
29
|
+
- Mermaid diagram rules: :::mermaid wrapper, no () in node labels
|
|
30
|
+
|
|
31
|
+
## Final Step — Token Log
|
|
32
|
+
|
|
33
|
+
Invoke skill `token-logger`: write AI Usage Log to working ADR file.
|
|
@@ -1,173 +1,173 @@
|
|
|
1
|
-
# /tas-apitest-plan $ARGUMENTS
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Generate API Test Specification (Markdown)
|
|
5
|
-
|
|
6
|
-
## Always / Ask / Never
|
|
7
|
-
|
|
8
|
-
| |
|
|
9
|
-
|---|---|
|
|
10
|
-
| **Always** |
|
|
11
|
-
| **Always** |
|
|
12
|
-
| **Always** | Append-only:
|
|
13
|
-
| **Always** | Coverage matrix:
|
|
14
|
-
| **Always** |
|
|
15
|
-
| **Ask** |
|
|
16
|
-
| **Never** |
|
|
17
|
-
| **Never** |
|
|
18
|
-
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
###
|
|
22
|
-
|
|
23
|
-
`$ARGUMENTS`
|
|
24
|
-
- API Spec file (OpenAPI 3.0 JSON/YAML, Markdown)
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
1. Path
|
|
32
|
-
2. Story ID (
|
|
33
|
-
3. Path
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
###
|
|
37
|
-
|
|
38
|
-
Glob
|
|
39
|
-
|
|
40
|
-
- **
|
|
41
|
-
- **
|
|
42
|
-
|
|
43
|
-
###
|
|
44
|
-
|
|
45
|
-
**
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
- HTTP method + path, path/query params, request body schema
|
|
49
|
-
- Response schemas
|
|
50
|
-
- Auth requirement, description/summary
|
|
51
|
-
- Tags
|
|
52
|
-
|
|
53
|
-
**
|
|
54
|
-
-
|
|
55
|
-
- Parse spec
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
**
|
|
59
|
-
- Glob
|
|
60
|
-
-
|
|
61
|
-
- Extract DTO classes
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
###
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
1. `info.version`
|
|
68
|
-
2. Prefix
|
|
69
|
-
3.
|
|
70
|
-
|
|
71
|
-
Version format: `v1`, `v2` (
|
|
72
|
-
|
|
73
|
-
###
|
|
74
|
-
|
|
75
|
-
Output: `docs/tests/API-Test-Spec-{slug}.md`
|
|
76
|
-
|
|
77
|
-
**Slug generation:**
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
###
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- **Append mode** (default):
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
Spec file
|
|
89
|
-
1. Append test cases
|
|
90
|
-
2.
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
###
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
**
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
1. **Happy path** (2xx) —
|
|
101
|
-
2. **Unauthorized** (401) —
|
|
102
|
-
3. **Forbidden** (403) —
|
|
103
|
-
4. **Not found** (404) —
|
|
104
|
-
5. **Validation error** (400/422) —
|
|
105
|
-
6. **Business rules** —
|
|
106
|
-
|
|
107
|
-
**Coverage matrix format:**
|
|
108
|
-
```
|
|
109
|
-
| Endpoint | Happy Path | 401 Unauthorized | 403 Forbidden | 404 Not Found | 400/422 Validation | Business Rule |
|
|
110
|
-
|----------|:---------:|:----------------:|:-------------:|:-------------:|:------------------:|:-------------:|
|
|
111
|
-
| GET /api/users | ✓ | ✓ | | | | |
|
|
112
|
-
| POST /api/users | ✓ | ✓ | | | ✓ | |
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**Test case detail format:**
|
|
116
|
-
```
|
|
117
|
-
#### TC-XXX: {Title} — {Modifier}
|
|
118
|
-
- **Endpoint**: `{METHOD} {path}`
|
|
119
|
-
- **Auth**: Required/Not Required
|
|
120
|
-
- **Preconditions**:
|
|
121
|
-
- {List preconditions}
|
|
122
|
-
- **Request Query/Path/Body**:
|
|
123
|
-
- {Request details}
|
|
124
|
-
- **Expected Response**:
|
|
125
|
-
- Status: {code}
|
|
126
|
-
- Body: {schema}
|
|
127
|
-
- **Assertions**:
|
|
128
|
-
- {List assertions}
|
|
129
|
-
- **AC Reference**: AC-{N} (
|
|
130
|
-
- **Test Method Name**: `{Method}_{Resource}_Returns{Status}_When{Condition}`
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
###
|
|
134
|
-
|
|
135
|
-
**File
|
|
136
|
-
|
|
137
|
-
**File
|
|
138
|
-
-
|
|
139
|
-
- Find section `## v{N}`
|
|
140
|
-
- Append test cases
|
|
141
|
-
- Preserve
|
|
142
|
-
|
|
143
|
-
###
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
1. Output file path
|
|
147
|
-
2. Number of endpoints detected
|
|
148
|
-
3. Number of test cases generated
|
|
149
|
-
4. Coverage matrix
|
|
150
|
-
5. Next steps:
|
|
151
|
-
- Review test spec file
|
|
152
|
-
- Run `/tas-apitest docs/tests/API-Test-Spec-{slug}.md`
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
## API Test Spec Generated
|
|
156
|
-
|
|
157
|
-
**Output**: `docs/tests/API-Test-Spec-{slug}.md`
|
|
158
|
-
**Version**: v{N}
|
|
159
|
-
**Endpoints**: {N}
|
|
160
|
-
**Test Cases**: {N}
|
|
161
|
-
|
|
162
|
-
### Coverage Matrix
|
|
163
|
-
[Print coverage matrix]
|
|
164
|
-
|
|
165
|
-
### Next Steps
|
|
166
|
-
1. Review test spec: `docs/tests/API-Test-Spec-{slug}.md`
|
|
167
|
-
2. Generate test code: `/tas-apitest docs/tests/API-Test-Spec-{slug}.md`
|
|
168
|
-
3. Run tests: `dotnet test tests/ApiTests/`
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
##
|
|
172
|
-
|
|
173
|
-
Invoke skill `token-logger`:
|
|
1
|
+
# /tas-apitest-plan $ARGUMENTS
|
|
2
|
+
|
|
3
|
+
Role: SE - Software Engineer
|
|
4
|
+
Generate API Test Specification (Markdown) from API Spec (OpenAPI 3.0, Markdown, YAML) or analyze API code.
|
|
5
|
+
|
|
6
|
+
## Always / Ask / Never
|
|
7
|
+
|
|
8
|
+
| | Action |
|
|
9
|
+
|---|---|
|
|
10
|
+
| **Always** | Read entire spec or analyze code before creating test spec |
|
|
11
|
+
| **Always** | Organize test cases by API version — each version separate section |
|
|
12
|
+
| **Always** | Append-only: don't modify sections in existing old version |
|
|
13
|
+
| **Always** | Coverage matrix: each endpoint needs ≥1 happy path + ≥1 error path |
|
|
14
|
+
| **Always** | Read `.claude/rules/csharp/api-testing.md` for conventions |
|
|
15
|
+
| **Ask** | When spec unclear about expected response schema or business rule |
|
|
16
|
+
| **Never** | Use version folder/syntax in test spec file (use section headers instead) |
|
|
17
|
+
| **Never** | Skip error path — each endpoint needs cover validation errors |
|
|
18
|
+
|
|
19
|
+
## Actions
|
|
20
|
+
|
|
21
|
+
### Step 1 — Locate Inputs
|
|
22
|
+
|
|
23
|
+
`$ARGUMENTS` is path to:
|
|
24
|
+
- API Spec file (OpenAPI 3.0 JSON/YAML, Markdown)
|
|
25
|
+
- Or Story ID — glob find `docs/epics/**/Story-{ID}*.md`
|
|
26
|
+
- Or path to API code project to analyze
|
|
27
|
+
|
|
28
|
+
If not provided → ask user:
|
|
29
|
+
```
|
|
30
|
+
Enter input for /tas-apitest-plan:
|
|
31
|
+
1. Path to API Spec file (OpenAPI/Markdown/YAML)
|
|
32
|
+
2. Story ID (to find spec link in Story)
|
|
33
|
+
3. Path to API code to auto-analyze
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Step 2 — Detect Existing Test Spec
|
|
37
|
+
|
|
38
|
+
Glob find `docs/tests/API-Test-Spec-*.md`.
|
|
39
|
+
|
|
40
|
+
- **Found**: Read file, detect existing versions (find section headers `## v{N}`)
|
|
41
|
+
- **Not found**: Create new with version v1
|
|
42
|
+
|
|
43
|
+
### Step 3 — Parse Input
|
|
44
|
+
|
|
45
|
+
**If API Spec file:**
|
|
46
|
+
- Read and parse OpenAPI/Markdown/YAML
|
|
47
|
+
- Collect for each endpoint:
|
|
48
|
+
- HTTP method + path, path/query params, request body schema
|
|
49
|
+
- Response schemas per status code
|
|
50
|
+
- Auth requirement, description/summary
|
|
51
|
+
- Tags to group endpoints
|
|
52
|
+
|
|
53
|
+
**If Story:**
|
|
54
|
+
- Read Story to find spec link in `## Technical Plan` or `## Acceptance Criteria`
|
|
55
|
+
- Parse spec as above
|
|
56
|
+
- Add AC mapping to test spec
|
|
57
|
+
|
|
58
|
+
**If code path:**
|
|
59
|
+
- Glob find controller/handler files (`.cs`, `.ts`, `.py` per stack)
|
|
60
|
+
- Analyze attributes/routes to detect endpoints
|
|
61
|
+
- Extract DTO classes to know request/response schema
|
|
62
|
+
- Ask user confirm if detection unclear
|
|
63
|
+
|
|
64
|
+
### Step 4 — Detect API Version
|
|
65
|
+
|
|
66
|
+
Prioritize in order:
|
|
67
|
+
1. `info.version` in OpenAPI
|
|
68
|
+
2. Prefix in URL path (v1/, v2/)
|
|
69
|
+
3. Ask user
|
|
70
|
+
|
|
71
|
+
Version format: `v1`, `v2` (no dot).
|
|
72
|
+
|
|
73
|
+
### Step 5 — Determine Output Path
|
|
74
|
+
|
|
75
|
+
Output: `docs/tests/API-Test-Spec-{slug}.md`
|
|
76
|
+
|
|
77
|
+
**Slug generation:**
|
|
78
|
+
- From `api_name` in spec → lowercase, replace spaces with dashes
|
|
79
|
+
- Or ask user for short slug (e.g., `users`, `orders`, `products`)
|
|
80
|
+
|
|
81
|
+
### Step 6 — Determine Update Mode
|
|
82
|
+
|
|
83
|
+
If spec file exists and version already exists:
|
|
84
|
+
- **Append mode** (default): add new test cases to end of current version section
|
|
85
|
+
- Ask user if want new version (v2, v3...):
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
Spec file already exists with version {current}. You want:
|
|
89
|
+
1. Append test cases to version {current} (default)
|
|
90
|
+
2. Create new version (v{next}) for test cases
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Step 7 — Generate Test Spec
|
|
94
|
+
|
|
95
|
+
Read template `.tas/templates/API-Test-Spec.md` for structure.
|
|
96
|
+
|
|
97
|
+
**Analyze endpoints to create coverage matrix:**
|
|
98
|
+
|
|
99
|
+
For each endpoint, generate test cases for:
|
|
100
|
+
1. **Happy path** (2xx) — always have
|
|
101
|
+
2. **Unauthorized** (401) — if endpoint requires auth
|
|
102
|
+
3. **Forbidden** (403) — if has RBAC/ownership check
|
|
103
|
+
4. **Not found** (404) — if has path param
|
|
104
|
+
5. **Validation error** (400/422) — if has required fields or business rules
|
|
105
|
+
6. **Business rules** — from Story ACs or spec descriptions
|
|
106
|
+
|
|
107
|
+
**Coverage matrix format:**
|
|
108
|
+
```
|
|
109
|
+
| Endpoint | Happy Path | 401 Unauthorized | 403 Forbidden | 404 Not Found | 400/422 Validation | Business Rule |
|
|
110
|
+
|----------|:---------:|:----------------:|:-------------:|:-------------:|:------------------:|:-------------:|
|
|
111
|
+
| GET /api/users | ✓ | ✓ | | | | |
|
|
112
|
+
| POST /api/users | ✓ | ✓ | | | ✓ | |
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Test case detail format:**
|
|
116
|
+
```
|
|
117
|
+
#### TC-XXX: {Title} — {Modifier}
|
|
118
|
+
- **Endpoint**: `{METHOD} {path}`
|
|
119
|
+
- **Auth**: Required/Not Required
|
|
120
|
+
- **Preconditions**:
|
|
121
|
+
- {List preconditions}
|
|
122
|
+
- **Request Query/Path/Body**:
|
|
123
|
+
- {Request details}
|
|
124
|
+
- **Expected Response**:
|
|
125
|
+
- Status: {code}
|
|
126
|
+
- Body: {schema}
|
|
127
|
+
- **Assertions**:
|
|
128
|
+
- {List assertions}
|
|
129
|
+
- **AC Reference**: AC-{N} (if any)
|
|
130
|
+
- **Test Method Name**: `{Method}_{Resource}_Returns{Status}_When{Condition}`
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Step 8 — Write Test Spec File
|
|
134
|
+
|
|
135
|
+
**File doesn't exist:** Create new from template.
|
|
136
|
+
|
|
137
|
+
**File exists (append mode):**
|
|
138
|
+
- Read current file
|
|
139
|
+
- Find section `## v{N}` being worked on
|
|
140
|
+
- Append new test cases to end of section before `## Version History` or `## Changelog`
|
|
141
|
+
- Preserve all old content
|
|
142
|
+
|
|
143
|
+
### Step 9 — Summary
|
|
144
|
+
|
|
145
|
+
Display:
|
|
146
|
+
1. Output file path
|
|
147
|
+
2. Number of endpoints detected
|
|
148
|
+
3. Number of test cases generated
|
|
149
|
+
4. Coverage matrix
|
|
150
|
+
5. Next steps:
|
|
151
|
+
- Review test spec file
|
|
152
|
+
- Run `/tas-apitest docs/tests/API-Test-Spec-{slug}.md` to generate code
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
## API Test Spec Generated
|
|
156
|
+
|
|
157
|
+
**Output**: `docs/tests/API-Test-Spec-{slug}.md`
|
|
158
|
+
**Version**: v{N}
|
|
159
|
+
**Endpoints**: {N}
|
|
160
|
+
**Test Cases**: {N}
|
|
161
|
+
|
|
162
|
+
### Coverage Matrix
|
|
163
|
+
[Print coverage matrix]
|
|
164
|
+
|
|
165
|
+
### Next Steps
|
|
166
|
+
1. Review test spec: `docs/tests/API-Test-Spec-{slug}.md`
|
|
167
|
+
2. Generate test code: `/tas-apitest docs/tests/API-Test-Spec-{slug}.md`
|
|
168
|
+
3. Run tests: `dotnet test tests/ApiTests/`
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Final Step — Token Log
|
|
172
|
+
|
|
173
|
+
Invoke skill `token-logger`: write AI Usage Log to test spec file.
|