code-write-tests

Detect a test harness and write behavioral tests with real DB usage.

22|3|Updated Jul 28, 2024
One-click install
npx skills add https://github.com/webdevcody/go-mailing-list --skill code-write-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-write-tests
Source: https://github.com/webdevcody/go-mailing-list/tree/main/.claude/skills/code-write-tests
Command: npx skills add https://github.com/webdevcody/go-mailing-list --skill code-write-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you expand or add an automated test suite to a chosen module so regressions get caught quickly and reliably instead of being discovered late.

Core Features & Use Cases

  • Detects or installs a suitable test harness by checking existing config files, lockfiles, and test-related scripts, then proposes the smallest standard runner when none exists.
  • Ensures a correct test loop with a hard smoke-test gate that must pass before generating the rest of the suite.
  • Writes behavioral, stack-appropriate tests that use real test DBs by default and only mock third-party boundaries that require real auth.

Quick Start

Ask the AI to write tests for the module or file you care about (for example, “add tests for subscriber creation in src/db/...”), and confirm any proposed runner install when prompted.

Frequently Asked Questions about code-write-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add automated tests to an existing code module?

The test suite uses real test databases by default and only mocks third-party boundaries that require real auth, ensuring behavioral tests validate actual module logic rather than over-mocked interactions.

What's the best way to write behavioral tests with vitest or jest?

Yes, Go test is supported as a runner. The Skill maps your existing configuration to an appropriate runner, applying stack-appropriate behavioral tests and running the full suite with real DB usage and boundary-only mocks.

How do I run a smoke test before generating a full test suite?

No, mocks are restricted to third-party boundaries requiring real auth. The Skill mandates running the full suite with real DB usage to catch regressions reliably without isolating core logic behind unnecessary mocks.

Can I use Go test for adding behavioral assertions to my code?

The test suite uses real test databases by default and only mocks third-party boundaries that require real auth, ensuring behavioral tests validate actual module logic rather than over-mocked interactions.

Why should I only mock third-party boundaries instead of the test database?

Writing behavioral tests with vitest or jest involves inheriting your existing naming, fixture, and mocking conventions, then generating happy-path, edge, and error coverage after passing a one-test smoke gate.