antigravity-ai-kit 2.1.0 → 3.0.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.
Files changed (114) hide show
  1. package/.agent/README.md +4 -4
  2. package/.agent/agents/README.md +16 -12
  3. package/.agent/agents/architect.md +1 -0
  4. package/.agent/agents/backend-specialist.md +11 -0
  5. package/.agent/agents/code-reviewer.md +1 -0
  6. package/.agent/agents/database-architect.md +11 -0
  7. package/.agent/agents/devops-engineer.md +11 -0
  8. package/.agent/agents/e2e-runner.md +1 -0
  9. package/.agent/agents/explorer-agent.md +11 -0
  10. package/.agent/agents/frontend-specialist.md +11 -0
  11. package/.agent/agents/mobile-developer.md +11 -0
  12. package/.agent/agents/performance-optimizer.md +11 -0
  13. package/.agent/agents/planner.md +1 -0
  14. package/.agent/agents/refactor-cleaner.md +1 -0
  15. package/.agent/agents/reliability-engineer.md +11 -0
  16. package/.agent/agents/security-reviewer.md +1 -0
  17. package/.agent/agents/sprint-orchestrator.md +10 -0
  18. package/.agent/agents/tdd-guide.md +1 -0
  19. package/.agent/commands/code-review.md +1 -0
  20. package/.agent/commands/debug.md +1 -0
  21. package/.agent/commands/deploy.md +1 -0
  22. package/.agent/commands/help.md +252 -31
  23. package/.agent/commands/plan.md +1 -0
  24. package/.agent/commands/status.md +1 -0
  25. package/.agent/commands/tdd.md +1 -0
  26. package/.agent/contexts/brainstorm.md +26 -0
  27. package/.agent/contexts/debug.md +28 -0
  28. package/.agent/contexts/implement.md +29 -0
  29. package/.agent/contexts/review.md +27 -0
  30. package/.agent/contexts/ship.md +28 -0
  31. package/.agent/engine/identity.json +13 -0
  32. package/.agent/engine/loading-rules.json +23 -1
  33. package/.agent/engine/marketplace-index.json +29 -0
  34. package/.agent/engine/reliability-config.json +14 -0
  35. package/.agent/engine/sdlc-map.json +44 -0
  36. package/.agent/engine/workflow-state.json +28 -2
  37. package/.agent/hooks/hooks.json +27 -25
  38. package/.agent/manifest.json +12 -4
  39. package/.agent/rules.md +2 -1
  40. package/.agent/skills/README.md +10 -5
  41. package/.agent/skills/i18n-localization/SKILL.md +191 -0
  42. package/.agent/skills/mcp-integration/SKILL.md +224 -0
  43. package/.agent/skills/parallel-agents/SKILL.md +1 -1
  44. package/.agent/skills/shell-conventions/SKILL.md +92 -0
  45. package/.agent/skills/ui-ux-pro-max/SKILL.md +557 -0
  46. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  47. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  48. package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
  49. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  50. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  51. package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  52. package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  53. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  54. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  55. package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  56. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  57. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  58. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  59. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  60. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  61. package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  62. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  63. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  64. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  65. package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
  66. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  67. package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  68. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  69. package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  70. package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
  71. package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  72. package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
  73. package/.agent/templates/adr-template.md +32 -0
  74. package/.agent/templates/bug-report.md +37 -0
  75. package/.agent/templates/feature-request.md +32 -0
  76. package/.agent/workflows/README.md +92 -78
  77. package/.agent/workflows/brainstorm.md +154 -100
  78. package/.agent/workflows/create.md +142 -75
  79. package/.agent/workflows/debug.md +157 -98
  80. package/.agent/workflows/deploy.md +195 -144
  81. package/.agent/workflows/enhance.md +157 -65
  82. package/.agent/workflows/orchestrate.md +171 -114
  83. package/.agent/workflows/plan.md +147 -72
  84. package/.agent/workflows/preview.md +140 -83
  85. package/.agent/workflows/quality-gate.md +196 -0
  86. package/.agent/workflows/retrospective.md +197 -0
  87. package/.agent/workflows/review.md +188 -0
  88. package/.agent/workflows/status.md +142 -91
  89. package/.agent/workflows/test.md +168 -95
  90. package/.agent/workflows/ui-ux-pro-max.md +181 -127
  91. package/README.md +215 -78
  92. package/bin/ag-kit.js +344 -10
  93. package/lib/agent-registry.js +214 -0
  94. package/lib/agent-reputation.js +351 -0
  95. package/lib/cli-commands.js +235 -0
  96. package/lib/conflict-detector.js +245 -0
  97. package/lib/engineering-manager.js +354 -0
  98. package/lib/error-budget.js +294 -0
  99. package/lib/hook-system.js +252 -0
  100. package/lib/identity.js +245 -0
  101. package/lib/loading-engine.js +208 -0
  102. package/lib/marketplace.js +298 -0
  103. package/lib/plugin-system.js +604 -0
  104. package/lib/security-scanner.js +309 -0
  105. package/lib/self-healing.js +434 -0
  106. package/lib/session-manager.js +261 -0
  107. package/lib/skill-sandbox.js +244 -0
  108. package/lib/task-governance.js +523 -0
  109. package/lib/task-model.js +317 -0
  110. package/lib/updater.js +201 -0
  111. package/lib/verify.js +240 -0
  112. package/lib/workflow-engine.js +353 -0
  113. package/lib/workflow-persistence.js +160 -0
  114. package/package.json +7 -3
@@ -0,0 +1,188 @@
1
+ ---
2
+ description: Code review workflow. Sequential quality gate pipeline — lint, type-check, test, security scan, and build verification.
3
+ version: 2.1.0
4
+ sdlc-phase: verify
5
+ skills: [verification-loop]
6
+ commit-types: [fix, refactor]
7
+ ---
8
+
9
+ # /review — Code Review Quality Gate
10
+
11
+ > **Trigger**: `/review` (full) · `/review lint` · `/review tests` · `/review security` · `/review build`
12
+ > **Lifecycle**: After implementation, before `/retrospective`
13
+
14
+ > [!CAUTION]
15
+ > Sequential gate pipeline — each step must pass before proceeding. Failed gates block merge. No overrides.
16
+
17
+ > [!TIP]
18
+ > This workflow leverages the **verification-loop** skill. Read `.agent/skills/verification-loop/SKILL.md` for extended guidance.
19
+
20
+ ---
21
+
22
+ ## Scope Filter
23
+
24
+ | Commit Type | Review Required? | Rationale |
25
+ | :---------- | :--------------- | :-------- |
26
+ | `feat()` | ✅ Full review | New functionality needs all gates |
27
+ | `fix()` | ✅ Full review | Bug fixes need regression verification |
28
+ | `refactor()` | ✅ Full review | Structural changes need quality validation |
29
+ | `test()` | ⚠️ Gate 3 only | Test-only changes need test verification |
30
+ | `docs()` | ❌ Skip | No testable code changes |
31
+ | `chore()` | ❌ Skip | Config/tooling, no code quality risk |
32
+
33
+ ---
34
+
35
+ ## Critical Rules
36
+
37
+ 1. **SEQUENTIAL** — each gate must pass before the next runs
38
+ 2. **STOP ON FAILURE** — if a gate fails, stop immediately, show error + fix suggestion
39
+ 3. **NO OVERRIDES** — failed gates block merge, no exceptions
40
+ 4. **FULL-STACK** — all relevant stacks are scanned
41
+ 5. **DOCUMENT** — log results for audit trail
42
+
43
+ ---
44
+
45
+ ## Argument Parsing
46
+
47
+ | Command | Gates Run |
48
+ | :----------------- | :------------------------ |
49
+ | `/review` | All gates (1-5) |
50
+ | `/review lint` | Gate 1 (Lint) |
51
+ | `/review types` | Gate 2 (Type Check) |
52
+ | `/review tests` | Gate 3 (Tests) |
53
+ | `/review security` | Gate 4 (Security Scan) |
54
+ | `/review build` | Gate 5 (Build) |
55
+
56
+ ---
57
+
58
+ ## Pipeline Gates
59
+
60
+ Execute gates IN ORDER. Stop at first failure.
61
+
62
+ ### Gate 1: Lint
63
+
64
+ // turbo
65
+
66
+ Run the project's lint tool:
67
+
68
+ ```bash
69
+ # Examples (adapt to your stack):
70
+ npm run lint # JavaScript/TypeScript
71
+ ruff check . # Python
72
+ cargo clippy # Rust
73
+ ```
74
+
75
+ ### Gate 2: Type Check
76
+
77
+ // turbo
78
+
79
+ Run the project's type checker:
80
+
81
+ ```bash
82
+ # Examples:
83
+ npx tsc --noEmit # TypeScript
84
+ mypy . # Python
85
+ ```
86
+
87
+ ### Gate 3: Tests
88
+
89
+ // turbo
90
+
91
+ Run the project's test suite:
92
+
93
+ ```bash
94
+ # Examples:
95
+ npm test # Node.js
96
+ pytest tests/ -q # Python
97
+ cargo test # Rust
98
+ ```
99
+
100
+ ### Gate 4: Security Scan
101
+
102
+ // turbo
103
+
104
+ Run dependency and vulnerability scanning:
105
+
106
+ ```bash
107
+ # Examples:
108
+ npm audit --audit-level=moderate # Node.js
109
+ pip-audit # Python
110
+ cargo audit # Rust
111
+ ```
112
+
113
+ ### Gate 5: Build Verification
114
+
115
+ // turbo
116
+
117
+ Verify the project builds successfully:
118
+
119
+ ```bash
120
+ # Examples:
121
+ npm run build # Node.js
122
+ python -m build # Python
123
+ cargo build --release # Rust
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Output Template
129
+
130
+ ### ✅ All Gates Passed
131
+
132
+ ```markdown
133
+ ## ✅ Review Complete
134
+
135
+ | Gate | Status | Duration |
136
+ | :------------ | :-------------------- | :------- |
137
+ | Lint | ✅ Pass | {time} |
138
+ | Type Check | ✅ Pass | {time} |
139
+ | Tests | ✅ Pass ({n}/{n}) | {time} |
140
+ | Security | ✅ No vulnerabilities | {time} |
141
+ | Build | ✅ Pass | {time} |
142
+
143
+ **Verdict**: Ready for commit.
144
+ ```
145
+
146
+ ### ❌ Gate Failed
147
+
148
+ ```markdown
149
+ ## ❌ Review Failed at Gate {N}
150
+
151
+ | Gate | Status |
152
+ | :----- | :-------- |
153
+ | {gate} | ❌ FAILED |
154
+
155
+ ### Error Output
156
+
157
+ {error details}
158
+
159
+ ### Recommended Fix
160
+
161
+ {fix steps}
162
+
163
+ Re-run: `/review` or `/review {gate}`
164
+ ```
165
+
166
+ ---
167
+
168
+ ## Governance
169
+
170
+ **PROHIBITED:** Skipping gates · overriding failures · merging without all gates passing · ignoring security scan results
171
+
172
+ **REQUIRED:** Run all gates for merge-ready code · document results · fix failures before re-running
173
+
174
+ ---
175
+
176
+ ## Completion Criteria
177
+
178
+ - [ ] All applicable gates executed in sequence
179
+ - [ ] Zero failures across all gates
180
+ - [ ] Results documented with pass/fail + duration
181
+ - [ ] Verdict rendered: "Ready for commit" or "Failed at Gate N"
182
+
183
+ ## Related Resources
184
+
185
+ - **Previous**: `/test` (tests must pass before review)
186
+ - **Next**: `/deploy` (deployment after all gates pass)
187
+ - **Skill**: `.agent/skills/verification-loop/SKILL.md`
188
+ - **Related**: `/quality-gate` (pre-task research) · `/retrospective` (sprint-level audit)
@@ -1,91 +1,142 @@
1
- ---
2
- description: Display project and progress status. Current state overview.
3
- ---
4
-
5
- # /status - Show Status
6
-
7
- $ARGUMENTS
8
-
9
- ---
10
-
11
- ## Task
12
-
13
- Show current project and task status.
14
-
15
- ### What It Shows
16
-
17
- 1. **Project Info**
18
- - Project name and path
19
- - Tech stack detected
20
- - Current features
21
-
22
- 2. **Progress Status**
23
- - Completed tasks
24
- - In-progress tasks
25
- - Pending work
26
-
27
- 3. **File Statistics**
28
- - Files created/modified
29
- - Recent changes
30
-
31
- 4. **Health Check**
32
- - Build status
33
- - Test status
34
- - Server status (if running)
35
-
36
- ---
37
-
38
- ## Output Format
39
-
40
- ```markdown
41
- === Project Status ===
42
-
43
- 📁 Project: my-app
44
- 📂 Path: /projects/my-app
45
- 🏷️ Type: Next.js + NestJS + PostgreSQL
46
-
47
- ---
48
-
49
- 🔧 Tech Stack:
50
- Framework: Next.js
51
- Backend: NestJS
52
- Database: PostgreSQL
53
- Auth: Clerk
54
-
55
- ---
56
-
57
- Completed (5):
58
- Initial setup
59
- Database schema
60
- • Auth integration
61
- API endpoints
62
- Core pages
63
-
64
- 🔄 In Progress (1):
65
- User dashboard (70%)
66
-
67
- Pending (2):
68
- Admin panel
69
- Email notifications
70
-
71
- ---
72
-
73
- 📊 Statistics:
74
- Files created: 47
75
- Files modified: 12
76
- Tests passing: 24/24
77
-
78
- ---
79
-
80
- 💚 Health: All systems OK
81
- ```
82
-
83
- ---
84
-
85
- ## Examples
86
-
87
- ```
88
- /status
89
- /status brief
90
- /status health
91
- ```
1
+ ---
2
+ description: Display project and progress status. Current state overview.
3
+ version: 2.1.0
4
+ sdlc-phase: cross-cutting
5
+ skills: [verification-loop]
6
+ commit-types: [chore]
7
+ ---
8
+
9
+ # /status — Project Status Overview
10
+
11
+ > **Trigger**: `/status [sub-command]`
12
+ > **Lifecycle**: Cross-cutting — any SDLC phase
13
+
14
+ > [!NOTE]
15
+ > This is a read-only, informational workflow. It gathers and displays data without modifying anything.
16
+
17
+ > [!TIP]
18
+ > Skill reference: `.agent/skills/verification-loop/SKILL.md` health checks and continuous quality gates
19
+
20
+ ---
21
+
22
+ ## Critical Rules
23
+
24
+ 1. **Accurate data** — all reported information must reflect the current state, not cached data
25
+ 2. **No stale info** — read live data from git, filesystem, and project config
26
+ 3. **Health checks** — always include build and test health indicators
27
+ 4. **Non-destructive** — this workflow must never modify any files or state
28
+
29
+ ---
30
+
31
+ ## Argument Parsing
32
+
33
+ | Command | Action |
34
+ | :----------------- | :------------------------------------------ |
35
+ | `/status` | Full status report (all sections) |
36
+ | `/status brief` | Condensed one-line summary |
37
+ | `/status health` | Health checks only (build, tests, server) |
38
+ | `/status git` | Git status only (branch, changes, commits) |
39
+
40
+ ---
41
+
42
+ ## Steps
43
+
44
+ // turbo
45
+ 1. **Project Detection**
46
+ - Detect project name, path, and type from config files
47
+ - Identify the tech stack (framework, language, database, etc.)
48
+
49
+ // turbo
50
+ 2. **Git Status**
51
+ - Current branch and last commit
52
+ - Uncommitted changes (staged, unstaged, untracked)
53
+ - Branch ahead/behind status
54
+
55
+ // turbo
56
+ 3. **Progress Tracking**
57
+ - Read ROADMAP or task files for sprint/task status
58
+ - Count completed, in-progress, and pending items
59
+ - Identify blockers if any
60
+
61
+ // turbo
62
+ 4. **Health Check**
63
+ - Build status (can the project compile/build?)
64
+ - Test status (are tests passing?)
65
+ - Server status (is the dev server running?)
66
+
67
+ // turbo
68
+ 5. **File Statistics**
69
+ - Files created and modified (from git)
70
+ - Recent changes summary
71
+
72
+ ---
73
+
74
+ ## Output Template
75
+
76
+ ```markdown
77
+ ## 📊 Project Status
78
+
79
+ ### Project
80
+
81
+ - **Name**: [project name]
82
+ - **Path**: [project path]
83
+ - **Stack**: [language] + [framework] + [database]
84
+
85
+ ### Git
86
+
87
+ - **Branch**: [branch name]
88
+ - **Last Commit**: [hash] — [message]
89
+ - **Changes**: [N] staged · [N] unstaged · [N] untracked
90
+
91
+ ### Progress
92
+
93
+ ✅ Completed ([N]): [list]
94
+ 🔄 In Progress ([N]): [list]
95
+ ⏳ Pending ([N]): [list]
96
+
97
+ ### Health
98
+
99
+ | Check | Status |
100
+ | :---- | :----- |
101
+ | Build | ✅ Passing / ❌ Failing |
102
+ | Tests | ✅ [N]/[N] passing / ❌ [N] failures |
103
+ | Server | 🟢 Running / ⚪ Stopped |
104
+
105
+ ### Statistics
106
+
107
+ - Files created: [N]
108
+ - Files modified: [N]
109
+ - Test coverage: [N]%
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Governance
115
+
116
+ **PROHIBITED:**
117
+ - Modifying files, state, or configuration
118
+ - Reporting stale or cached data
119
+ - Skipping health checks
120
+ - Skipping failed steps · proceeding without resolution
121
+
122
+ **REQUIRED:**
123
+ - Live data from git, filesystem, and project config
124
+ - Health check in every full status report
125
+ - Accurate progress tracking from project files
126
+
127
+ ---
128
+
129
+ ## Completion Criteria
130
+
131
+ - [ ] Project info is detected and displayed
132
+ - [ ] Git status is current and accurate
133
+ - [ ] Progress tracking reflects actual state
134
+ - [ ] Health checks are performed and reported
135
+
136
+ ---
137
+
138
+ ## Related Resources
139
+
140
+ - **Previous**: `/deploy` (post-deployment monitoring)
141
+ - **Cross-cutting**: Available at any SDLC phase
142
+ - **Related**: `/retrospective` (sprint-level status review)
@@ -1,95 +1,168 @@
1
- ---
2
- description: Write and run tests systematically
3
- ---
4
-
5
- # /test Workflow
6
-
7
- > **Purpose**: Systematic test writing and execution
8
-
9
- ---
10
-
11
- ## Workflow Steps
12
-
13
- ### 1. Identify Test Scope
14
-
15
- - What needs to be tested?
16
- - Unit, integration, or E2E?
17
- - What are the critical paths?
18
-
19
- ### 2. Analyze Existing Coverage
20
-
21
- ```bash
22
- npm run test:coverage
23
- ```
24
-
25
- - Check current coverage percentage
26
- - Identify untested code paths
27
- - Prioritize critical functionality
28
-
29
- ### 3. Write Tests (AAA Pattern)
30
-
31
- ```typescript
32
- describe("FeatureName", () => {
33
- it("should [expected behavior] when [condition]", () => {
34
- // Arrange
35
- const input = createTestData();
36
-
37
- // Act
38
- const result = functionUnderTest(input);
39
-
40
- // Assert
41
- expect(result).toEqual(expectedOutput);
42
- });
43
- });
44
- ```
45
-
46
- ### 4. Test Categories
47
-
48
- | Type | Scope | Speed | Isolation |
49
- | :---------- | :------------- | :----- | :-------------- |
50
- | Unit | Function/Class | Fast | Full mocking |
51
- | Integration | Module | Medium | Partial mocking |
52
- | E2E | Full system | Slow | No mocking |
53
-
54
- ### 5. Run Tests
55
-
56
- ```bash
57
- # All tests
58
- npm test
59
-
60
- # Watch mode
61
- npm run test:watch
62
-
63
- # Specific file
64
- npm test -- user.service.spec.ts
65
-
66
- # Coverage report
67
- npm run test:coverage
68
- ```
69
-
70
- ### 6. Review Results
71
-
72
- - All tests passing?
73
- - Coverage targets met (≥80%)?
74
- - Edge cases covered?
75
-
76
- ---
77
-
78
- ## Checklist
79
-
80
- - [ ] Test scope identified
81
- - [ ] Coverage analyzed
82
- - [ ] Tests written
83
- - [ ] All tests passing
84
- - [ ] Coverage ≥80%
85
- - [ ] Edge cases covered
86
-
87
- ---
88
-
89
- ## Examples
90
-
91
- ```
92
- /test UserService
93
- /test authentication flow
94
- /test API endpoints for orders
95
- ```
1
+ ---
2
+ description: Write and run tests systematically.
3
+ version: 2.1.0
4
+ sdlc-phase: verify
5
+ skills: [testing-patterns, webapp-testing]
6
+ commit-types: [test]
7
+ ---
8
+
9
+ # /test — Systematic Test Writing & Execution
10
+
11
+ > **Trigger**: `/test [scope]`
12
+ > **Lifecycle**: Verify — after implementation, before `/review`
13
+
14
+ > [!IMPORTANT]
15
+ > Tests are the primary quality gate. All new code must have test coverage. Never skip failing tests — fix the code or fix the test.
16
+
17
+ > [!TIP]
18
+ > This workflow leverages the **testing-patterns** and **webapp-testing** skills. Read `.agent/skills/testing-patterns/SKILL.md` and `.agent/skills/webapp-testing/SKILL.md` for extended guidance.
19
+
20
+ ---
21
+
22
+ ## Critical Rules
23
+
24
+ 1. **AAA pattern** — all tests must follow Arrange-Act-Assert
25
+ 2. **Coverage ≥80%** — target minimum 80% code coverage on new code
26
+ 3. **No skipping** — `skip`, `xit`, `xdescribe` are prohibited in committed code
27
+ 4. **Descriptive names** — test names must describe expected behavior: "should [behavior] when [condition]"
28
+ 5. **Edge cases** — always test boundary conditions, null/undefined, and error paths
29
+ 6. **Stack-agnostic** detect the project stack and use the appropriate test framework
30
+
31
+ ---
32
+
33
+ ## Scope Filter
34
+
35
+ | Commit Type | Run Tests? | Rationale |
36
+ | :---------- | :--------- | :-------- |
37
+ | `feat()` | ✅ Yes | New functionality needs coverage |
38
+ | `fix()` | ✅ Yes | Bug fixes need regression tests |
39
+ | `refactor()` | ✅ Yes | Refactors must prove no regressions |
40
+ | `test()` | ✅ Yes | Test changes need validation |
41
+ | `docs()` | ❌ Skip | No testable code changes |
42
+ | `chore()` | ❌ Skip | Config/tooling, no testable code |
43
+
44
+ ---
45
+
46
+ ## Steps
47
+
48
+ // turbo
49
+ 1. **Identify Test Scope**
50
+ - What needs to be tested? (specific file, module, or feature)
51
+ - What type of tests? (unit, integration, E2E)
52
+ - What are the critical paths and edge cases?
53
+
54
+ // turbo
55
+ 2. **Detect Test Framework**
56
+ - Scan for test config: `jest.config.*`, `vitest.config.*`, `pytest.ini`, `pyproject.toml`, `Cargo.toml`
57
+ - Determine the test runner and assertion library
58
+ - Identify coverage tool
59
+
60
+ // turbo
61
+ 3. **Analyze Existing Coverage**
62
+ - Run coverage report
63
+ - Identify untested code paths
64
+ - Prioritize critical functionality and edge cases
65
+
66
+ 4. **Write Tests**
67
+ - Follow AAA pattern (Arrange-Act-Assert)
68
+ - Use descriptive test names
69
+ - Cover happy paths, edge cases, and error scenarios
70
+ - Mock external dependencies appropriately
71
+
72
+ // turbo
73
+ 5. **Run Tests**
74
+ - Execute the full test suite
75
+ - Verify all tests pass
76
+ - Check coverage meets ≥80% threshold
77
+
78
+ // turbo
79
+ 6. **Review Results**
80
+ - All tests passing?
81
+ - Coverage targets met?
82
+ - Edge cases covered?
83
+ - Any flaky tests identified?
84
+
85
+ ---
86
+
87
+ ## Multi-Stack Test Commands
88
+
89
+ | Stack | Test Command | Coverage Command |
90
+ | :------------ | :----------------------- | :------------------------------- |
91
+ | Node.js/Jest | `npm test` | `npm run test:coverage` |
92
+ | Node.js/Vitest | `npx vitest` | `npx vitest --coverage` |
93
+ | Python/pytest | `pytest` | `pytest --cov` |
94
+ | Rust/Cargo | `cargo test` | `cargo tarpaulin` |
95
+ | Go | `go test ./...` | `go test -coverprofile=cover.out` |
96
+
97
+ ---
98
+
99
+ ## Output Template
100
+
101
+ ```markdown
102
+ ## 🧪 Test Results: [Scope]
103
+
104
+ ### Framework
105
+
106
+ - **Runner**: [jest | vitest | pytest | cargo test]
107
+ - **Coverage Tool**: [tool]
108
+
109
+ ### Results
110
+
111
+ | Metric | Value |
112
+ | :--------- | :--------- |
113
+ | Total | [N] tests |
114
+ | Passing | ✅ [N] |
115
+ | Failing | ❌ [N] |
116
+ | Skipped | ⚠️ [N] |
117
+ | Coverage | [N]% |
118
+
119
+ ### Tests Written
120
+
121
+ | Test File | Tests | Status |
122
+ | :-------- | :---- | :----- |
123
+ | `path/to/test` | [N] | ✅ All passing |
124
+
125
+ ### Coverage Gaps (if any)
126
+
127
+ - [ ] [Untested function/module]
128
+
129
+ After testing: proceed to `/review` for quality gates.
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Governance
135
+
136
+ **PROHIBITED:**
137
+ - Committing code with `skip`, `xit`, or `xdescribe` annotations
138
+ - Submitting code below 80% coverage without explicit justification
139
+ - Testing only happy paths — edge cases are mandatory
140
+ - Skipping failed steps · proceeding without resolution
141
+
142
+ **REQUIRED:**
143
+ - AAA pattern for all tests
144
+ - Coverage report generation and review
145
+ - Descriptive test names following "should [behavior] when [condition]"
146
+ - Stack-appropriate test framework usage
147
+
148
+ ---
149
+
150
+ ## Completion Criteria
151
+
152
+ - [ ] Test scope is identified
153
+ - [ ] Test framework is detected for the project stack
154
+ - [ ] Tests are written following AAA pattern
155
+ - [ ] All tests are passing
156
+ - [ ] Coverage is ≥80% on new code
157
+ - [ ] Edge cases and error paths are covered
158
+ - [ ] No skipped tests in committed code
159
+ - [ ] After testing: proceed to `/review` for quality gates
160
+ - [ ] Note: if `/test` ran immediately before `/review` with no code changes, `/review` Gate 3 may use cached results
161
+
162
+ ---
163
+
164
+ ## Related Resources
165
+
166
+ - **Previous**: `/create` (test new code) · `/enhance` (test changes) · `/debug` (regression check after fix)
167
+ - **Next**: `/review` (quality gate pipeline)
168
+ - **Skills**: `.agent/skills/testing-patterns/SKILL.md` · `.agent/skills/webapp-testing/SKILL.md`