@rune-kit/rune 2.1.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/LICENSE +21 -0
- package/README.md +357 -0
- package/agents/.gitkeep +0 -0
- package/agents/architect.md +29 -0
- package/agents/asset-creator.md +11 -0
- package/agents/audit.md +11 -0
- package/agents/autopsy.md +11 -0
- package/agents/brainstorm.md +11 -0
- package/agents/browser-pilot.md +11 -0
- package/agents/coder.md +29 -0
- package/agents/completion-gate.md +11 -0
- package/agents/constraint-check.md +11 -0
- package/agents/context-engine.md +11 -0
- package/agents/cook.md +11 -0
- package/agents/db.md +11 -0
- package/agents/debug.md +11 -0
- package/agents/dependency-doctor.md +11 -0
- package/agents/deploy.md +11 -0
- package/agents/design.md +11 -0
- package/agents/docs-seeker.md +11 -0
- package/agents/fix.md +11 -0
- package/agents/hallucination-guard.md +11 -0
- package/agents/incident.md +11 -0
- package/agents/integrity-check.md +11 -0
- package/agents/journal.md +11 -0
- package/agents/launch.md +11 -0
- package/agents/logic-guardian.md +11 -0
- package/agents/marketing.md +11 -0
- package/agents/onboard.md +11 -0
- package/agents/perf.md +11 -0
- package/agents/plan.md +11 -0
- package/agents/preflight.md +11 -0
- package/agents/problem-solver.md +11 -0
- package/agents/rescue.md +11 -0
- package/agents/research.md +11 -0
- package/agents/researcher.md +29 -0
- package/agents/review-intake.md +11 -0
- package/agents/review.md +11 -0
- package/agents/reviewer.md +28 -0
- package/agents/safeguard.md +11 -0
- package/agents/sast.md +11 -0
- package/agents/scanner.md +28 -0
- package/agents/scope-guard.md +11 -0
- package/agents/scout.md +11 -0
- package/agents/sentinel.md +11 -0
- package/agents/sequential-thinking.md +11 -0
- package/agents/session-bridge.md +11 -0
- package/agents/skill-forge.md +11 -0
- package/agents/skill-router.md +11 -0
- package/agents/surgeon.md +11 -0
- package/agents/team.md +11 -0
- package/agents/test.md +11 -0
- package/agents/trend-scout.md +11 -0
- package/agents/verification.md +11 -0
- package/agents/video-creator.md +11 -0
- package/agents/watchdog.md +11 -0
- package/agents/worktree.md +11 -0
- package/commands/.gitkeep +0 -0
- package/commands/rune.md +168 -0
- package/compiler/__tests__/openclaw-adapter.test.js +140 -0
- package/compiler/__tests__/parser.test.js +55 -0
- package/compiler/adapters/antigravity.js +59 -0
- package/compiler/adapters/claude.js +37 -0
- package/compiler/adapters/cursor.js +67 -0
- package/compiler/adapters/generic.js +60 -0
- package/compiler/adapters/index.js +45 -0
- package/compiler/adapters/openclaw.js +150 -0
- package/compiler/adapters/windsurf.js +60 -0
- package/compiler/bin/rune.js +288 -0
- package/compiler/doctor.js +153 -0
- package/compiler/emitter.js +240 -0
- package/compiler/parser.js +208 -0
- package/compiler/transformer.js +69 -0
- package/compiler/transforms/branding.js +27 -0
- package/compiler/transforms/cross-references.js +29 -0
- package/compiler/transforms/frontmatter.js +38 -0
- package/compiler/transforms/hooks.js +68 -0
- package/compiler/transforms/subagents.js +36 -0
- package/compiler/transforms/tool-names.js +60 -0
- package/contexts/dev.md +34 -0
- package/contexts/research.md +43 -0
- package/contexts/review.md +55 -0
- package/extensions/ai-ml/PACK.md +517 -0
- package/extensions/analytics/PACK.md +557 -0
- package/extensions/backend/PACK.md +678 -0
- package/extensions/chrome-ext/PACK.md +995 -0
- package/extensions/content/PACK.md +381 -0
- package/extensions/devops/PACK.md +520 -0
- package/extensions/ecommerce/PACK.md +280 -0
- package/extensions/gamedev/PACK.md +393 -0
- package/extensions/mobile/PACK.md +273 -0
- package/extensions/saas/PACK.md +805 -0
- package/extensions/security/PACK.md +536 -0
- package/extensions/trading/PACK.md +597 -0
- package/extensions/ui/PACK.md +947 -0
- package/package.json +47 -0
- package/skills/.gitkeep +0 -0
- package/skills/adversary/SKILL.md +271 -0
- package/skills/asset-creator/SKILL.md +157 -0
- package/skills/audit/SKILL.md +466 -0
- package/skills/autopsy/SKILL.md +200 -0
- package/skills/ba/SKILL.md +279 -0
- package/skills/brainstorm/SKILL.md +266 -0
- package/skills/browser-pilot/SKILL.md +168 -0
- package/skills/completion-gate/SKILL.md +151 -0
- package/skills/constraint-check/SKILL.md +165 -0
- package/skills/context-engine/SKILL.md +176 -0
- package/skills/cook/SKILL.md +636 -0
- package/skills/db/SKILL.md +256 -0
- package/skills/debug/SKILL.md +240 -0
- package/skills/dependency-doctor/SKILL.md +235 -0
- package/skills/deploy/SKILL.md +174 -0
- package/skills/design/DESIGN-REFERENCE.md +365 -0
- package/skills/design/SKILL.md +462 -0
- package/skills/doc-processor/SKILL.md +254 -0
- package/skills/docs/SKILL.md +336 -0
- package/skills/docs-seeker/SKILL.md +166 -0
- package/skills/fix/SKILL.md +192 -0
- package/skills/git/SKILL.md +285 -0
- package/skills/hallucination-guard/SKILL.md +204 -0
- package/skills/incident/SKILL.md +241 -0
- package/skills/integrity-check/SKILL.md +169 -0
- package/skills/journal/SKILL.md +190 -0
- package/skills/launch/SKILL.md +330 -0
- package/skills/logic-guardian/SKILL.md +240 -0
- package/skills/marketing/SKILL.md +229 -0
- package/skills/mcp-builder/SKILL.md +311 -0
- package/skills/onboard/SKILL.md +298 -0
- package/skills/perf/SKILL.md +297 -0
- package/skills/plan/SKILL.md +520 -0
- package/skills/preflight/SKILL.md +231 -0
- package/skills/problem-solver/SKILL.md +284 -0
- package/skills/rescue/SKILL.md +434 -0
- package/skills/research/SKILL.md +122 -0
- package/skills/review/SKILL.md +354 -0
- package/skills/review-intake/SKILL.md +222 -0
- package/skills/safeguard/SKILL.md +188 -0
- package/skills/sast/SKILL.md +190 -0
- package/skills/scaffold/SKILL.md +276 -0
- package/skills/scope-guard/SKILL.md +150 -0
- package/skills/scout/SKILL.md +232 -0
- package/skills/sentinel/SKILL.md +320 -0
- package/skills/sentinel-env/SKILL.md +226 -0
- package/skills/sequential-thinking/SKILL.md +234 -0
- package/skills/session-bridge/SKILL.md +287 -0
- package/skills/skill-forge/SKILL.md +317 -0
- package/skills/skill-router/SKILL.md +267 -0
- package/skills/surgeon/SKILL.md +203 -0
- package/skills/team/SKILL.md +397 -0
- package/skills/test/SKILL.md +271 -0
- package/skills/trend-scout/SKILL.md +145 -0
- package/skills/verification/SKILL.md +201 -0
- package/skills/video-creator/SKILL.md +201 -0
- package/skills/watchdog/SKILL.md +166 -0
- package/skills/worktree/SKILL.md +140 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test
|
|
3
|
+
description: "TDD test writer. Writes failing tests FIRST (red), then verifies they pass after implementation (green). Covers unit, integration, and e2e tests."
|
|
4
|
+
metadata:
|
|
5
|
+
author: runedev
|
|
6
|
+
version: "0.2.0"
|
|
7
|
+
layer: L2
|
|
8
|
+
model: sonnet
|
|
9
|
+
group: development
|
|
10
|
+
tools: "Read, Write, Edit, Bash, Glob, Grep"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# test
|
|
14
|
+
|
|
15
|
+
<HARD-GATE>
|
|
16
|
+
Tests define the EXPECTED BEHAVIOR. They MUST be written BEFORE implementation code.
|
|
17
|
+
If tests pass without implementation → the tests are wrong. Rewrite them.
|
|
18
|
+
The only exception: when retrofitting tests for existing untested code.
|
|
19
|
+
|
|
20
|
+
THE IRON LAW: Write code before test? DELETE IT. Start over.
|
|
21
|
+
- Do NOT keep it as "reference"
|
|
22
|
+
- Do NOT "adapt" it while writing tests
|
|
23
|
+
- Do NOT look at it to "inform" test design
|
|
24
|
+
- Delete means delete. `git checkout -- <file>` or remove the changes entirely.
|
|
25
|
+
This is not negotiable. This is not optional. "But I already wrote it" is a sunk cost fallacy.
|
|
26
|
+
</HARD-GATE>
|
|
27
|
+
|
|
28
|
+
## Instructions
|
|
29
|
+
|
|
30
|
+
### Phase 1: Understand What to Test
|
|
31
|
+
|
|
32
|
+
1. Read the implementation plan or task description carefully
|
|
33
|
+
2. Use `Glob` to find existing test files: `**/*.test.*`, `**/*.spec.*`, `**/test_*`
|
|
34
|
+
3. Use `Read` on 2-3 existing test files to understand:
|
|
35
|
+
- Test framework in use
|
|
36
|
+
- File naming convention (e.g., `foo.test.ts` mirrors `foo.ts`)
|
|
37
|
+
- Test directory structure (co-located vs `__tests__/` vs `tests/`)
|
|
38
|
+
- Assertion style and patterns
|
|
39
|
+
4. Use `Glob` to find the source file(s) being tested
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
TodoWrite: [
|
|
43
|
+
{ content: "Understand scope and find existing test patterns", status: "in_progress" },
|
|
44
|
+
{ content: "Detect test framework and conventions", status: "pending" },
|
|
45
|
+
{ content: "Write failing tests (RED phase)", status: "pending" },
|
|
46
|
+
{ content: "Run tests — verify they FAIL", status: "pending" },
|
|
47
|
+
{ content: "After implementation: verify tests PASS (GREEN phase)", status: "pending" }
|
|
48
|
+
]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Phase 2: Detect Test Framework
|
|
52
|
+
|
|
53
|
+
Use `Glob` to find config files and identify the framework:
|
|
54
|
+
|
|
55
|
+
- `jest.config.*` or `"jest"` key in `package.json` → Jest
|
|
56
|
+
- `vitest.config.*` or `"vitest"` key in `package.json` → Vitest
|
|
57
|
+
- `pytest.ini`, `[tool.pytest.ini_options]` in `pyproject.toml` → pytest
|
|
58
|
+
- **Async check**: If pytest detected AND source files contain `async def`:
|
|
59
|
+
- Check if `pytest-asyncio` is in dependencies (`pyproject.toml [project.dependencies]` or `[project.optional-dependencies]`)
|
|
60
|
+
- Check if `asyncio_mode` is set in `[tool.pytest.ini_options]` (values: `auto`, `strict`, or absent)
|
|
61
|
+
- If async code exists but no `asyncio_mode` configured → **WARN**: "pytest-asyncio not configured. Async tests may silently pass without executing async code. Recommend adding `asyncio_mode = \"auto\"` to `[tool.pytest.ini_options]` in pyproject.toml."
|
|
62
|
+
- `Cargo.toml` with `#[cfg(test)]` pattern → built-in `cargo test`
|
|
63
|
+
- `*_test.go` files present → built-in `go test`
|
|
64
|
+
- `cypress.config.*` → Cypress (E2E)
|
|
65
|
+
- `playwright.config.*` → Playwright (E2E)
|
|
66
|
+
|
|
67
|
+
**Verification gate**: Framework identified before writing any test code.
|
|
68
|
+
|
|
69
|
+
### Phase 3: Write Failing Tests
|
|
70
|
+
|
|
71
|
+
Use `Write` to create test files following the detected conventions:
|
|
72
|
+
|
|
73
|
+
1. Mirror source file location: if source is `src/auth/login.ts`, test is `src/auth/login.test.ts`
|
|
74
|
+
2. Structure tests with clear `describe` / `it` blocks (or language equivalent):
|
|
75
|
+
- `describe('Feature name')`
|
|
76
|
+
- `it('should [expected behavior] when [condition]')`
|
|
77
|
+
3. Cover all three categories:
|
|
78
|
+
- **Happy path**: valid inputs, expected success output
|
|
79
|
+
- **Edge cases**: empty input, boundary values, large input
|
|
80
|
+
- **Error cases**: invalid input, missing data, network failure simulation
|
|
81
|
+
|
|
82
|
+
4. Use proper assertions. Do NOT use implementation details — test behavior:
|
|
83
|
+
- Jest/Vitest: `expect(result).toBe(expected)`
|
|
84
|
+
- pytest: `assert result == expected`
|
|
85
|
+
- Rust: `assert_eq!(result, expected)`
|
|
86
|
+
- Go: `if result != expected { t.Errorf(...) }`
|
|
87
|
+
|
|
88
|
+
5. For async code: use `async/await` or pytest `@pytest.mark.asyncio`
|
|
89
|
+
|
|
90
|
+
#### Python Async Tests (pytest-asyncio)
|
|
91
|
+
|
|
92
|
+
When writing tests for async Python code:
|
|
93
|
+
|
|
94
|
+
1. **Verify setup before writing tests**:
|
|
95
|
+
- Confirm `pytest-asyncio` is in project dependencies
|
|
96
|
+
- Confirm `asyncio_mode` is set in `pyproject.toml` `[tool.pytest.ini_options]` (recommend `"auto"`)
|
|
97
|
+
- If neither is configured, warn the caller and suggest setup before proceeding
|
|
98
|
+
|
|
99
|
+
2. **Writing async test functions**:
|
|
100
|
+
- With `asyncio_mode = "auto"`: just write `async def test_something():` — no decorator needed
|
|
101
|
+
- With `asyncio_mode = "strict"`: every async test needs `@pytest.mark.asyncio`
|
|
102
|
+
- Without asyncio_mode set: always use `@pytest.mark.asyncio` decorator explicitly
|
|
103
|
+
|
|
104
|
+
3. **Async fixtures**:
|
|
105
|
+
- Use `@pytest_asyncio.fixture` (NOT `@pytest.fixture`) for async setup/teardown
|
|
106
|
+
- Scope rules: async fixtures default to `function` scope — use `scope="session"` carefully with async
|
|
107
|
+
|
|
108
|
+
4. **Common pitfalls**:
|
|
109
|
+
- Tests that `pass` without `await` — they run but don't execute the async path
|
|
110
|
+
- Missing `pytest-asyncio` makes `async def test_*` silently pass as empty coroutines
|
|
111
|
+
- Mixing sync and async fixtures can cause event loop errors
|
|
112
|
+
|
|
113
|
+
### Phase 4: Run Tests — Verify They FAIL (RED)
|
|
114
|
+
|
|
115
|
+
Use `Bash` to run ONLY the newly created test files (not full suite):
|
|
116
|
+
|
|
117
|
+
- **Jest**: `npx jest path/to/test.ts --no-coverage`
|
|
118
|
+
- **Vitest**: `npx vitest run path/to/test.ts`
|
|
119
|
+
- **pytest**: `pytest path/to/test_file.py -v` (if async tests and no `asyncio_mode` in config: add `--asyncio-mode=auto`)
|
|
120
|
+
- **Rust**: `cargo test test_module_name`
|
|
121
|
+
- **Go**: `go test ./path/to/package/... -run TestFunctionName`
|
|
122
|
+
|
|
123
|
+
**Hard gate**: ALL new tests MUST fail at this point.
|
|
124
|
+
|
|
125
|
+
- If ANY test passes before implementation exists → that test is not testing real behavior. Rewrite it to be stricter.
|
|
126
|
+
- If tests fail with import/syntax errors (not assertion errors) → fix the test code, re-run
|
|
127
|
+
|
|
128
|
+
### Phase 5: After Implementation — Verify Tests PASS (GREEN)
|
|
129
|
+
|
|
130
|
+
After `rune:fix` writes implementation code, run the same test command again:
|
|
131
|
+
|
|
132
|
+
1. ALL tests in the new test files MUST pass
|
|
133
|
+
2. Run the full test suite with `Bash` to check for regressions:
|
|
134
|
+
- `npm test`, `pytest`, `cargo test`, `go test ./...`
|
|
135
|
+
3. If any test fails: report clearly which test, what was expected, what was received
|
|
136
|
+
4. If an existing test now fails (regression): escalate to `rune:debug`
|
|
137
|
+
|
|
138
|
+
**Verification gate**: 100% of new tests pass AND 0 regressions in existing tests.
|
|
139
|
+
|
|
140
|
+
### Phase 6: Coverage Check
|
|
141
|
+
|
|
142
|
+
After GREEN phase, call `verification` to check coverage threshold (80% minimum):
|
|
143
|
+
|
|
144
|
+
- If coverage drops below 80%: identify uncovered lines, write additional tests
|
|
145
|
+
- Report coverage gaps with file:line references
|
|
146
|
+
|
|
147
|
+
## Test Types
|
|
148
|
+
|
|
149
|
+
| Type | When | Framework | Speed |
|
|
150
|
+
|------|------|-----------|-------|
|
|
151
|
+
| Unit | Individual functions, pure logic | jest/vitest/pytest/cargo test | Fast |
|
|
152
|
+
| Integration | API endpoints, DB operations | supertest/httpx/reqwest | Medium |
|
|
153
|
+
| E2E | Critical user flows | Playwright/Cypress via browser-pilot | Slow |
|
|
154
|
+
| Regression | After bug fixes | Same as unit | Fast |
|
|
155
|
+
|
|
156
|
+
## Error Recovery
|
|
157
|
+
|
|
158
|
+
- If test framework not found: ask calling skill to specify, or check `package.json` `devDependencies`
|
|
159
|
+
- If `Write` to test file fails: check if directory exists, create it first with `Bash mkdir -p`
|
|
160
|
+
- If tests error on import (module not found): check that source file path is correct, adjust imports
|
|
161
|
+
- If `Bash` test runner hangs beyond 120 seconds: kill and report as TIMEOUT
|
|
162
|
+
|
|
163
|
+
## Called By (inbound)
|
|
164
|
+
|
|
165
|
+
- `cook` (L1): Phase 3 TEST — write tests first
|
|
166
|
+
- `fix` (L2): verify fix passes tests
|
|
167
|
+
- `review` (L2): untested edge case found → write test for it
|
|
168
|
+
- `deploy` (L2): pre-deployment full test suite
|
|
169
|
+
- `preflight` (L2): run targeted regression tests on affected code
|
|
170
|
+
- `surgeon` (L2): verify refactored code
|
|
171
|
+
- `launch` (L1): pre-deployment test suite
|
|
172
|
+
- `safeguard` (L2): writing characterization tests for legacy code
|
|
173
|
+
- `review-intake` (L2): write tests for issues identified during review intake
|
|
174
|
+
|
|
175
|
+
## Calls (outbound)
|
|
176
|
+
|
|
177
|
+
- `verification` (L3): Phase 6 — coverage check (80% minimum threshold)
|
|
178
|
+
- `browser-pilot` (L3): Phase 4 — e2e and visual testing for UI flows
|
|
179
|
+
- `debug` (L2): Phase 5 — when existing test regresses unexpectedly
|
|
180
|
+
|
|
181
|
+
## Anti-Rationalization Table
|
|
182
|
+
|
|
183
|
+
| Excuse | Reality |
|
|
184
|
+
|---|---|
|
|
185
|
+
| "Too simple to need tests first" | Simple code breaks. Test takes 30 seconds. Write it first. |
|
|
186
|
+
| "I'll write tests after — same result" | Tests-after = "what does this do?" Tests-first = "what SHOULD this do?" Completely different. |
|
|
187
|
+
| "I already wrote the code, let me just add tests" | Iron Law: delete the code. Start over with tests. Sunk cost is not an argument. |
|
|
188
|
+
| "Tests after achieve the same goals" | They don't. Tests-after are biased by the implementation you just wrote. |
|
|
189
|
+
| "It's about spirit not ritual" | Violating the letter IS violating the spirit. Write the test first. |
|
|
190
|
+
| "I mentally tested it" | Mental testing is not testing. Run the command, show the output. |
|
|
191
|
+
| "This is different because..." | It's not. Write the test first. |
|
|
192
|
+
|
|
193
|
+
## Red Flags — STOP and Start Over
|
|
194
|
+
|
|
195
|
+
If you catch yourself with ANY of these, delete implementation code and restart with tests:
|
|
196
|
+
|
|
197
|
+
- Code exists before test file
|
|
198
|
+
- "I already manually tested it"
|
|
199
|
+
- "Tests after achieve the same purpose"
|
|
200
|
+
- "It's about spirit not ritual"
|
|
201
|
+
- "This is different because..."
|
|
202
|
+
- "Let me just finish this, then add tests"
|
|
203
|
+
|
|
204
|
+
**All of these mean: Delete code. Start over with TDD.**
|
|
205
|
+
|
|
206
|
+
## Constraints
|
|
207
|
+
|
|
208
|
+
1. MUST write tests BEFORE implementation code — if tests pass without implementation, they are wrong
|
|
209
|
+
2. MUST cover happy path + edge cases + error cases — not just happy path
|
|
210
|
+
3. MUST run tests to verify they FAIL before implementation exists (RED phase is mandatory)
|
|
211
|
+
4. MUST NOT write tests that test mock behavior instead of real code behavior
|
|
212
|
+
5. MUST achieve 80% coverage minimum — identify and fill gaps
|
|
213
|
+
6. MUST use the project's existing test framework and conventions — don't introduce a new one
|
|
214
|
+
7. MUST NOT say "tests pass" without showing actual test runner output
|
|
215
|
+
8. MUST delete implementation code written before tests — Iron Law, no exceptions
|
|
216
|
+
9. MUST show RED phase output (actual failure) — "I confirmed they fail" without output is REJECTED
|
|
217
|
+
|
|
218
|
+
## Mesh Gates
|
|
219
|
+
|
|
220
|
+
| Gate | Requires | If Missing |
|
|
221
|
+
|------|----------|------------|
|
|
222
|
+
| RED Gate | All new tests FAIL before implementation | If any pass, rewrite stricter tests |
|
|
223
|
+
| GREEN Gate | All tests PASS after implementation | Fix code, not tests |
|
|
224
|
+
| Coverage Gate | 80%+ coverage verified via verification | Write additional tests for gaps |
|
|
225
|
+
|
|
226
|
+
## Output Format
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
## Test Report
|
|
230
|
+
- **Framework**: [detected]
|
|
231
|
+
- **Files Created**: [list of new test file paths]
|
|
232
|
+
- **Tests Written**: [count]
|
|
233
|
+
- **Status**: RED (failing as expected) | GREEN (all passing)
|
|
234
|
+
|
|
235
|
+
### Test Cases
|
|
236
|
+
| Test | Status | Description |
|
|
237
|
+
|------|--------|-------------|
|
|
238
|
+
| `test_name` | FAIL/PASS | [what it tests] |
|
|
239
|
+
|
|
240
|
+
### Coverage
|
|
241
|
+
- Lines: [X]% | Branches: [Y]%
|
|
242
|
+
- Gaps: `path/to/file.ts:42-58` — uncovered branch (error handling)
|
|
243
|
+
|
|
244
|
+
### Regressions (if any)
|
|
245
|
+
- [existing test that broke, with error details]
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Sharp Edges
|
|
249
|
+
|
|
250
|
+
Known failure modes for this skill. Check these before declaring done.
|
|
251
|
+
|
|
252
|
+
| Failure Mode | Severity | Mitigation |
|
|
253
|
+
|---|---|---|
|
|
254
|
+
| Tests passing before implementation exists | CRITICAL | RED Gate: rewrite stricter tests — passing without code = not testing real behavior |
|
|
255
|
+
| Skipping the RED phase (not confirming FAIL) | HIGH | Run tests, confirm FAIL output before calling cook/fix to implement |
|
|
256
|
+
| Testing mock behavior instead of real code | HIGH | Constraint 4: test what the real code does, not what the mock returns |
|
|
257
|
+
| Coverage below 80% without filling gaps | MEDIUM | Coverage Gate: identify uncovered lines and write additional tests |
|
|
258
|
+
| Introducing a new test framework instead of using existing one | MEDIUM | Constraint 6: detect framework first, use project's existing one always |
|
|
259
|
+
|
|
260
|
+
## Done When
|
|
261
|
+
|
|
262
|
+
- Test framework detected from project config files
|
|
263
|
+
- Tests cover happy path + at least 2 edge cases + error case
|
|
264
|
+
- All new tests FAIL (RED phase — actual failure output shown)
|
|
265
|
+
- After implementation: all tests PASS (GREEN phase — actual pass output shown)
|
|
266
|
+
- Coverage ≥80% verified via verification
|
|
267
|
+
- Test Report emitted with framework, test count, RED/GREEN status, and coverage
|
|
268
|
+
|
|
269
|
+
## Cost Profile
|
|
270
|
+
|
|
271
|
+
~$0.03-0.08 per invocation. Sonnet for writing tests, Bash for running them. Frequent invocation in TDD workflow.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trend-scout
|
|
3
|
+
description: Scan market trends, competitor activity, and emerging patterns. Monitors Product Hunt, GitHub Trending, HackerNews, and social platforms.
|
|
4
|
+
metadata:
|
|
5
|
+
author: runedev
|
|
6
|
+
version: "0.2.0"
|
|
7
|
+
layer: L3
|
|
8
|
+
model: haiku
|
|
9
|
+
group: knowledge
|
|
10
|
+
tools: "Read, Glob, Grep, WebFetch, WebSearch"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# trend-scout
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Market intelligence and technology trend analysis utility. Receives a topic or market segment, executes targeted searches across trend sources, analyzes competitor activity and community sentiment, and returns structured market intelligence. Stateless — no memory between calls.
|
|
18
|
+
|
|
19
|
+
## Calls (outbound)
|
|
20
|
+
|
|
21
|
+
None — pure L3 utility using `WebSearch` tools directly.
|
|
22
|
+
|
|
23
|
+
## Called By (inbound)
|
|
24
|
+
|
|
25
|
+
- `brainstorm` (L2): market context for product ideation
|
|
26
|
+
- `marketing` (L2): trend data for positioning and content
|
|
27
|
+
- `autopsy` (L2): identify if tech stack is outdated
|
|
28
|
+
- `autopsy` (L2): check if legacy tech is still maintained
|
|
29
|
+
|
|
30
|
+
## Execution
|
|
31
|
+
|
|
32
|
+
### Input
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
topic: string — market segment or technology to analyze (e.g., "AI coding assistants", "SvelteKit")
|
|
36
|
+
timeframe: string — (optional) period of interest, defaults to "2026"
|
|
37
|
+
focus: string — (optional) narrow the lens: "competitors" | "technology" | "community" | "all"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Step 1 — Define Scope
|
|
41
|
+
|
|
42
|
+
Parse the input topic and determine the analysis angle:
|
|
43
|
+
- Product/market: focus on competitors, pricing, user adoption
|
|
44
|
+
- Technology: focus on GitHub activity, npm/pypi downloads, framework adoption
|
|
45
|
+
- Community: focus on Reddit, HN, X/Twitter sentiment
|
|
46
|
+
|
|
47
|
+
### Step 2 — Search Trends
|
|
48
|
+
|
|
49
|
+
Execute `WebSearch` with these query patterns:
|
|
50
|
+
- `"[topic] 2026 trends"`
|
|
51
|
+
- `"[topic] vs alternatives 2026"`
|
|
52
|
+
- `"[topic] market share growth"`
|
|
53
|
+
- `"[topic] GitHub trending"` or `"[topic] npm downloads stats"`
|
|
54
|
+
|
|
55
|
+
Collect results. Identify the most evidence-rich URLs per query.
|
|
56
|
+
|
|
57
|
+
### Step 3 — Competitor Analysis
|
|
58
|
+
|
|
59
|
+
Execute `WebSearch` with:
|
|
60
|
+
- `"[topic] competitors comparison"`
|
|
61
|
+
- `"best [topic] tools 2026"`
|
|
62
|
+
- `"[topic] alternative"`
|
|
63
|
+
|
|
64
|
+
From results, extract:
|
|
65
|
+
- Top 3-5 competitors or alternative solutions
|
|
66
|
+
- Key differentiating features
|
|
67
|
+
- Pricing model if visible
|
|
68
|
+
- User sentiment signals (e.g., "users are switching from X to Y because...")
|
|
69
|
+
|
|
70
|
+
### Step 4 — Community Sentiment
|
|
71
|
+
|
|
72
|
+
Execute `WebSearch` with:
|
|
73
|
+
- `"site:reddit.com [topic]"` or `"[topic] reddit discussion"`
|
|
74
|
+
- `"[topic] site:news.ycombinator.com"`
|
|
75
|
+
- `"[topic] GitHub stars"` or `"[topic] downloads per week"`
|
|
76
|
+
|
|
77
|
+
Extract:
|
|
78
|
+
- Community perception (positive/negative/mixed)
|
|
79
|
+
- Frequently cited pain points
|
|
80
|
+
- Frequently praised features
|
|
81
|
+
- Adoption velocity indicators (star growth, download counts)
|
|
82
|
+
|
|
83
|
+
### Step 5 — Report
|
|
84
|
+
|
|
85
|
+
Synthesize all gathered data into the output format below. Note where data is sparse or conflicting.
|
|
86
|
+
|
|
87
|
+
## Constraints
|
|
88
|
+
|
|
89
|
+
- Use `WebSearch` only — do not call `WebFetch` unless a specific page has critical data not in snippets
|
|
90
|
+
- Label all data points with their source
|
|
91
|
+
- Do not infer trends from a single data point — note confidence level
|
|
92
|
+
- If the topic is too broad, report what was analyzed and suggest narrowing
|
|
93
|
+
|
|
94
|
+
## Output Format
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
## Trend Report: [Topic]
|
|
98
|
+
- **Period**: [timeframe]
|
|
99
|
+
- **Confidence**: high | medium | low
|
|
100
|
+
|
|
101
|
+
### Trending Now
|
|
102
|
+
- [trend] — evidence: [source/stat]
|
|
103
|
+
- [trend] — evidence: [source/stat]
|
|
104
|
+
|
|
105
|
+
### Competitors
|
|
106
|
+
| Name | Key Differentiator | Sentiment |
|
|
107
|
+
|------|--------------------|-----------|
|
|
108
|
+
| [A] | [feature] | positive / mixed / negative |
|
|
109
|
+
| [B] | [feature] | positive / mixed / negative |
|
|
110
|
+
|
|
111
|
+
### Community Sentiment
|
|
112
|
+
- **Reddit/HN**: [summary]
|
|
113
|
+
- **GitHub activity**: [stars/downloads/issues signal]
|
|
114
|
+
- **Pain points**: [what users complain about]
|
|
115
|
+
|
|
116
|
+
### Emerging Patterns
|
|
117
|
+
- [pattern] — implication: [what this means for callers]
|
|
118
|
+
|
|
119
|
+
### Recommendations
|
|
120
|
+
- [actionable insight for the calling skill]
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Sharp Edges
|
|
124
|
+
|
|
125
|
+
Known failure modes for this skill. Check these before declaring done.
|
|
126
|
+
|
|
127
|
+
| Failure Mode | Severity | Mitigation |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| Inferring trend from a single data point | HIGH | Constraint: note confidence level — single source = low confidence, not a trend |
|
|
130
|
+
| Topic too broad → generic results with no actionable signal | MEDIUM | Report what was analyzed and suggest narrowing; don't fabricate specificity |
|
|
131
|
+
| Skipping competitor analysis (Steps 3 mandatory) | MEDIUM | Competitor analysis is required — callers need positioning context |
|
|
132
|
+
| Calling WebFetch on every search result (excessive cost) | MEDIUM | Constraint: WebSearch only unless a specific page has critical data not in snippets |
|
|
133
|
+
|
|
134
|
+
## Done When
|
|
135
|
+
|
|
136
|
+
- Topic scope defined (product/technology/community angle)
|
|
137
|
+
- Trend searches executed with 2026 timeframe
|
|
138
|
+
- Competitor analysis completed (top 3-5 players with differentiators)
|
|
139
|
+
- Community sentiment captured (Reddit/HN/GitHub signals)
|
|
140
|
+
- Confidence level assigned based on evidence quality
|
|
141
|
+
- Trend Report emitted with source citations for every data point
|
|
142
|
+
|
|
143
|
+
## Cost Profile
|
|
144
|
+
|
|
145
|
+
~300-600 tokens input, ~200-400 tokens output. Haiku.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification
|
|
3
|
+
description: "Universal verification runner. Runs lint, type-check, tests, and build. Use after any code change to verify nothing is broken."
|
|
4
|
+
metadata:
|
|
5
|
+
author: runedev
|
|
6
|
+
version: "0.2.0"
|
|
7
|
+
layer: L3
|
|
8
|
+
model: haiku
|
|
9
|
+
group: validation
|
|
10
|
+
tools: "Read, Bash, Glob, Grep"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# verification
|
|
14
|
+
|
|
15
|
+
Runs all automated checks to verify code health. Stateless — runs checks and reports results.
|
|
16
|
+
|
|
17
|
+
## Instructions
|
|
18
|
+
|
|
19
|
+
### Phase 1: Detect Project Type
|
|
20
|
+
|
|
21
|
+
Use `Glob` to find project config files:
|
|
22
|
+
|
|
23
|
+
1. Check for `package.json` → Node.js/TypeScript project
|
|
24
|
+
2. Check for `pyproject.toml` or `setup.py` → Python project
|
|
25
|
+
3. Check for `Cargo.toml` → Rust project
|
|
26
|
+
4. Check for `go.mod` → Go project
|
|
27
|
+
5. Check for `pom.xml` or `build.gradle` → Java project
|
|
28
|
+
|
|
29
|
+
Use `Read` on the detected config file to find scripts or tool config (e.g., `package.json` scripts block for custom lint/test commands).
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
TodoWrite: [
|
|
33
|
+
{ content: "Detect project type", status: "in_progress" },
|
|
34
|
+
{ content: "Run lint check", status: "pending" },
|
|
35
|
+
{ content: "Run type check", status: "pending" },
|
|
36
|
+
{ content: "Run test suite", status: "pending" },
|
|
37
|
+
{ content: "Run build", status: "pending" },
|
|
38
|
+
{ content: "Generate verification report", status: "pending" }
|
|
39
|
+
]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Phase 2: Run Lint
|
|
43
|
+
|
|
44
|
+
Use `Bash` to run the appropriate linter. If `package.json` has a `lint` script, prefer that:
|
|
45
|
+
|
|
46
|
+
- **Node.js (npm lint script)**: `npm run lint`
|
|
47
|
+
- **Node.js (no script)**: `npx eslint . --max-warnings 0`
|
|
48
|
+
- **Python**: `ruff check .` (fallback: `flake8 .`)
|
|
49
|
+
- **Rust**: `cargo clippy -- -D warnings`
|
|
50
|
+
- **Go**: `golangci-lint run` (fallback: `go vet ./...`)
|
|
51
|
+
|
|
52
|
+
If lint fails: record the failure output, mark lint as FAIL, continue to next step. Do NOT stop.
|
|
53
|
+
|
|
54
|
+
**Verification gate**: Command exits without crashing (even if it reports lint errors — those are FAIL, not errors).
|
|
55
|
+
|
|
56
|
+
### Phase 3: Run Type Check
|
|
57
|
+
|
|
58
|
+
Use `Bash`:
|
|
59
|
+
|
|
60
|
+
- **TypeScript**: `npx tsc --noEmit`
|
|
61
|
+
- **Python**: `mypy .` (fallback: `pyright .`)
|
|
62
|
+
- **Rust**: `cargo check`
|
|
63
|
+
- **Go**: `go vet ./...`
|
|
64
|
+
|
|
65
|
+
If type check fails: record error count and first 10 error lines, mark as FAIL, continue.
|
|
66
|
+
|
|
67
|
+
### Phase 4: Run Tests
|
|
68
|
+
|
|
69
|
+
Use `Bash` to run the test suite. Prefer the project script if available:
|
|
70
|
+
|
|
71
|
+
- **Node.js (npm test script)**: `npm test`
|
|
72
|
+
- **Vitest**: `npx vitest run`
|
|
73
|
+
- **Jest**: `npx jest --passWithNoTests`
|
|
74
|
+
- **Python**: `pytest -v` (fallback: `python -m unittest discover`)
|
|
75
|
+
- **Rust**: `cargo test`
|
|
76
|
+
- **Go**: `go test ./...`
|
|
77
|
+
|
|
78
|
+
Record: total tests, passed count, failed count, coverage percentage if output includes it.
|
|
79
|
+
|
|
80
|
+
If tests fail: record which tests failed (first 20), mark as FAIL, continue to build.
|
|
81
|
+
|
|
82
|
+
### Phase 5: Run Build
|
|
83
|
+
|
|
84
|
+
Use `Bash`:
|
|
85
|
+
|
|
86
|
+
- **Node.js**: check `package.json` for `build` script → `npm run build` (fallback: `npx tsc`)
|
|
87
|
+
- **Python**: check `pyproject.toml` for `[build-system]` section:
|
|
88
|
+
- If build backend found (setuptools, poetry-core, hatchling, flit-core): `python -m build --no-isolation 2>&1 | head -20` to verify packaging
|
|
89
|
+
- If `setup.py` exists (legacy): `python setup.py check --strict`
|
|
90
|
+
- Then always: `pip install -e . --dry-run` to catch broken entry points, missing `__init__.py`, or import path issues
|
|
91
|
+
- If no `pyproject.toml` and no `setup.py` (scripts-only project): SKIP
|
|
92
|
+
- **Rust**: `cargo build`
|
|
93
|
+
- **Go**: `go build ./...`
|
|
94
|
+
|
|
95
|
+
If build fails: record first 20 lines of build output, mark as FAIL.
|
|
96
|
+
|
|
97
|
+
### Phase 6: Generate Report
|
|
98
|
+
|
|
99
|
+
Compile all results into the structured report. Update all TodoWrite items to completed.
|
|
100
|
+
|
|
101
|
+
## Error Recovery
|
|
102
|
+
|
|
103
|
+
- If project type cannot be detected: report "Unknown project type" and skip all checks
|
|
104
|
+
- If a command is not found (e.g., `ruff` not installed): note "tool not installed", mark check as SKIP
|
|
105
|
+
- If a command hangs for more than 60 seconds: kill it, mark check as TIMEOUT, continue
|
|
106
|
+
|
|
107
|
+
## Calls (outbound)
|
|
108
|
+
|
|
109
|
+
None — pure runner using Bash for all checks. Does not invoke other skills.
|
|
110
|
+
|
|
111
|
+
## Called By (inbound)
|
|
112
|
+
|
|
113
|
+
- `cook` (L1): Phase 6 VERIFY — final check before commit
|
|
114
|
+
- `fix` (L2): validate fix doesn't break existing functionality
|
|
115
|
+
- `test` (L2): validate test coverage meets threshold
|
|
116
|
+
- `deploy` (L2): post-deploy health checks
|
|
117
|
+
- `sentinel` (L2): run security audit tools (npm audit, etc.)
|
|
118
|
+
- `safeguard` (L2): verify safety net is solid before refactoring
|
|
119
|
+
- `db` (L2): run migration in test environment
|
|
120
|
+
- `perf` (L2): run benchmark scripts if configured
|
|
121
|
+
- `skill-forge` (L2): verify newly created skill passes lint/type/build checks
|
|
122
|
+
|
|
123
|
+
## Output Format
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
VERIFICATION REPORT
|
|
127
|
+
===================
|
|
128
|
+
Lint: [PASS/FAIL/SKIP] ([details])
|
|
129
|
+
Types: [PASS/FAIL/SKIP] ([X errors])
|
|
130
|
+
Tests: [PASS/FAIL/SKIP] ([passed]/[total], [coverage]%)
|
|
131
|
+
Build: [PASS/FAIL/SKIP]
|
|
132
|
+
|
|
133
|
+
Overall: [PASS/FAIL]
|
|
134
|
+
|
|
135
|
+
### Failures (if any)
|
|
136
|
+
- Lint: [error details with file:line]
|
|
137
|
+
- Types: [first 5 type errors]
|
|
138
|
+
- Tests: [first 5 failing test names]
|
|
139
|
+
- Build: [first 5 build errors]
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Evidence-Before-Claims Gate
|
|
143
|
+
|
|
144
|
+
<HARD-GATE>
|
|
145
|
+
An agent MUST NOT claim "done", "fixed", "passing", or "verified" without showing the actual command output that proves it.
|
|
146
|
+
"I ran the tests and they pass" WITHOUT stdout/stderr = UNVERIFIED CLAIM = REJECTED.
|
|
147
|
+
The verification report IS the evidence. No report = no verification happened.
|
|
148
|
+
</HARD-GATE>
|
|
149
|
+
|
|
150
|
+
### Claim Validation Protocol
|
|
151
|
+
|
|
152
|
+
When any skill calls verification and then reports results upstream:
|
|
153
|
+
|
|
154
|
+
1. **Output capture is mandatory** — every Bash command's stdout/stderr must appear in the report
|
|
155
|
+
2. **Pass requires proof** — PASS means "tool ran AND output shows zero errors" (not "tool ran without crashing")
|
|
156
|
+
3. **Silence is not success** — if a command produces no output, note it explicitly ("0 errors, 0 warnings")
|
|
157
|
+
4. **Partial runs are labeled** — if only 2 of 4 checks ran, Overall = INCOMPLETE (not PASS)
|
|
158
|
+
|
|
159
|
+
### Red Flags — Agent is Lying
|
|
160
|
+
|
|
161
|
+
| Claim | Without | Verdict |
|
|
162
|
+
|---|---|---|
|
|
163
|
+
| "All tests pass" | Test runner stdout showing pass count | REJECTED — re-run and show output |
|
|
164
|
+
| "No lint errors" | Linter stdout | REJECTED — re-run and show output |
|
|
165
|
+
| "Build succeeds" | Build command stdout | REJECTED — re-run and show output |
|
|
166
|
+
| "I verified it" | Verification Report | REJECTED — run verification skill properly |
|
|
167
|
+
| "Fixed and working" | Before/after test output | REJECTED — show the diff in results |
|
|
168
|
+
|
|
169
|
+
## Constraints
|
|
170
|
+
|
|
171
|
+
1. MUST run ALL four checks: lint, type-check, tests, build — not just tests
|
|
172
|
+
2. MUST show actual command output — never claim "all passed" without evidence
|
|
173
|
+
3. MUST report specific failures with file:line references
|
|
174
|
+
4. MUST NOT skip checks because "changes are small"
|
|
175
|
+
5. MUST include stdout/stderr capture in every check result — empty output noted explicitly
|
|
176
|
+
6. MUST mark Overall as INCOMPLETE if any check was skipped without valid reason (tool not installed = valid, "changes are small" = invalid)
|
|
177
|
+
|
|
178
|
+
## Sharp Edges
|
|
179
|
+
|
|
180
|
+
Known failure modes for this skill. Check these before declaring done.
|
|
181
|
+
|
|
182
|
+
| Failure Mode | Severity | Mitigation |
|
|
183
|
+
|---|---|---|
|
|
184
|
+
| Claiming "all passed" without showing actual command output | CRITICAL | Evidence-Before-Claims HARD-GATE blocks this — stdout/stderr is mandatory |
|
|
185
|
+
| Agent says "verified" without producing Verification Report | CRITICAL | No report = no verification. Re-run the skill properly. |
|
|
186
|
+
| Skipping build because "changes are small" | HIGH | Constraint 4: all four checks mandatory — size of changes doesn't matter |
|
|
187
|
+
| Marking check as PASS when the tool isn't installed | MEDIUM | Mark as SKIP (not PASS) — PASS means the tool ran and reported clean |
|
|
188
|
+
| Stopping after first failure instead of running remaining checks | MEDIUM | Run all checks; aggregate all failures so developer can fix everything at once |
|
|
189
|
+
| Reporting PASS when output has warnings but zero errors | LOW | PASS is correct but note warning count — caller decides if warnings matter |
|
|
190
|
+
|
|
191
|
+
## Done When
|
|
192
|
+
|
|
193
|
+
- Project type detected from config files
|
|
194
|
+
- lint, type-check, tests, and build all executed (or SKIP with reason if tool missing)
|
|
195
|
+
- Each check shows actual command output
|
|
196
|
+
- Failures include specific file:line references (not just counts)
|
|
197
|
+
- Verification Report emitted with Overall PASS/FAIL verdict
|
|
198
|
+
|
|
199
|
+
## Cost Profile
|
|
200
|
+
|
|
201
|
+
~$0.01-0.03 per run. Haiku + Bash commands. Fast and cheap.
|