skills/write-test/SKILL.md
manual trigger by user, do not auto invoke
npx skillsauth add Hoang604/get-thing-done write-testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Do not just test "Inputs -> Outputs" via Example-Based Unit Tests. Test State Consistency:
Assume the implementation will be naive. Design tests that punish laziness and test for physical friction limits:
Null, Empty, Max Int, Unicode, Injection.PLAN.md to identify the Scope of Work (Tasks 2, 3, etc.).SPEC.md to map Requirements to Assertions.Construct a TDD plan that enforces the architecture:
Using the replace_file_content tool, locate the <task> block containing <!-- TDD_STRATEGY_SLOT --> and overwrite the ENTIRE task block with your specific strategy.
Drafting the Task Content: The new Task 1 must be concrete. Use this structure:
<task id="1" type="auto" complexity="Low/Medium/High">
<name>TDD Strategy: {Phase Name}</name>
<risk>Prevents architectural drift and regression.</risk>
<files>
{List specific test files to be created}
</files>
<action>
Implement the following test suites. Ensure tests FAIL (Red) before implementation begins.
### 1. Unit: The Logic Firewall ({Component Name})
*Focus: Pure Logic, Invariants & State Transitions. Mock all I/O.*
- [ ] **Test: {Feature} - Happy Path**
- *Context:* {State setup}
- *Input:* {Valid input}
- *Assertion:* Returns {Result} AND State is {New State}.
- [ ] **Test: {Feature} - Boundary Attack**
- *Input:* {Null/Empty/Max/Invalid}
- *Assertion:* Handles gracefully (throws {Specific Error} or returns Default).
- [ ] **Test: {Feature} - Invariant Protection (Property-Based)**
- *Input:* {Adversarial Randomized State Space}
- *Assertion:* System refuses transition, remains in {Safe State}.
### 2. Integration: The Boundary Guard ({Boundary Name})
*Focus: I/O Wiring & Component Contracts.*
- [ ] **Test: {Scenario}**
- *Scope:* Real DB, Mocked External API.
- *Flow:* {Component A} calls {Component B}.
- *Assertion:* Data is persisted correctly to DB.
### 3. Resilience & Errors (Friction limits)
- [ ] **Test: Failure Recovery & Circuit Breaking**
- *Condition:* Dependency throws Critical Error (Timeout/500).
- *Assertion:* System degrades gracefully (does not crash).
- [ ] **Test: Backpressure / Capacity Limits**
- *Condition:* Flood with requests beyond capacity limit.
- *Assertion:* System returns 429 Too Many Requests (or similar), memory does not exhaust.
</action>
<done>
- Test files created with imports/scaffolding.
- `npm test` runs and reports specific failures (Red State).
</done>
</task>
</process>
<prohibitions>
replace.tools
manual trigger by user, do not auto invoke
development
Trace execution paths and document how code actually behaves. Use when you need to understand how features work, walk through code flows, explain component behavior, trace where data comes from, understand relationships between components, or audit for orphaned events and dead code.
testing
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.
development
Verify that "Must Have" requirements from SPEC.md are implemented in the codebase. User manually trigger, do not auto invoke this.