← Back to list

self-test-generator
by hohai99
⭐ 0🍴 1📅 Jan 22, 2026
SKILL.md
name: self-test-generator description: Generates tests directly from specifications and tasks. Use immediately after implementing a task. triggers: [task-complete, pre-review] outputs: [test-suite, coverage-report] depends_on: [no-guess-implementation]
Self Test Generator
Purpose
Generates behavior-based tests directly from specifications, not from code intuition. Tests are derived from what the spec says, not what the code does.
When to Use
- After completing an implementation task
- Before any manual review
- When spec changes require test updates
Generation Steps
- Read Spec Sections: Identify all spec clauses relevant to the implemented task.
- Map Spec to Test Cases: Generate happy path, edge case, error case, and constraint tests.
- Write Behavior-Based Tests: Implement tests using relevant frameworks (JEST, PyTest, etc.).
- Reference Spec in Tests: Every test MUST reference its source spec clause (e.g.,
// Spec: AUTH-001).
Decision Tree
flowchart TD
A[Start Test Gen] --> B{Spec ID found?}
B -->|No| C[Stop - Refine Spec first]
B -->|Yes| D{Multiple clauses?}
D -->|Yes| E[Group tests by Spec ID]
D -->|No| F[Create single test suite]
E --> G{Complex logic?}
F --> G
G -->|Yes| H[Add extra edge case coverage]
G -->|No| I[Happy path + basic error cases]
H --> J[Verify Traceability]
I --> J
Review Checklist
- Traceability: Does every test link back to a valid Spec ID?
- Isolation: Do tests avoid depending on implementation internals?
- Completeness: Are edge cases and error states covered as per spec?
- Determinism: Are tests reliable and independent of environment?
How to provide feedback
- Be specific: "The test for 'Login' fails to assert the 24h expiry requirement from AUTH-001."
- Explain why: "Without checking expiry, the test doesn't actually prove the spec is fully implemented."
- Suggest alternatives: "Recommend adding
expect(token.expiry).toBe(86400)to the test."
Tests are spec enforcement, not code validation.
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon