
Test
- 77 installs
- 416 repo stars
- Updated August 5, 2026
- boshu2/agentops
test is a Claude Code skill that generates tests, analyzes coverage, fills gaps, and runs TDD loops across Go, Python, JS/TS, and Rust projects.
About
test generates tests, analyzes coverage, fills gaps, and runs TDD loops, then produces passing tests plus a coverage report. It detects the project language from marker files (go.mod, pyproject.toml, package.json, Cargo.toml), loads that language's standards, and authors tests forward from Gherkin acceptance scenarios when they exist. A developer uses it to raise coverage and prove behavior.
- Four modes: generate, coverage, strategy, and TDD red-green-refactor
- Auto-detects Go, Python, JS/TS, or Rust and runs the right coverage command
- Scenarios-first: maps each Gherkin scenario to one covering test
Test by the numbers
- 77 all-time installs (skills.sh)
- Ranked #1,072 of 2,153 Testing & QA skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
test capabilities & compatibility
- Capabilities
- test generation · coverage analysis · tdd loop
- Use cases
- testing
- Pricing
- Free
What test says it does
Generate tests, analyze coverage, fill gaps, run TDD loops.
Generate real tests, run them, verify they pass, and produce coverage artifacts. Do not output a plan and stop.
the unit of test authoring is one scenario, one covering test.
npx skills add https://github.com/boshu2/agentops --skill testAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 77 |
|---|---|
| repo stars | ★ 416 |
| Last updated | August 5, 2026 |
| Repository | boshu2/agentops ↗ |
What it does
Generate real tests, analyze coverage, fill gaps, and run TDD loops, producing passing tests plus a coverage report.
Who is it for?
Adding tests and raising coverage on an existing Go, Python, JS/TS, or Rust codebase.
When should I use this skill?
When you ask to generate tests, analyze coverage gaps, plan a test strategy, or run a red-green-refactor TDD loop.
What you get
Passing tests plus a coverage report in .agents/test/, with each Gherkin scenario mapped to a covering test.
- Passing test files
- Coverage report and gap list in .agents/test/
By the numbers
- Four modes: generate, coverage, strategy, tdd
- Detects 4 languages via marker files with per-language coverage commands
Files
Test Skill
Quick Ref: Generate tests, analyze coverage, fill gaps, run TDD loops. Output: passing tests + coverage report in .agents/test/.YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it.
Generate real tests, run them, verify they pass, and produce coverage artifacts. Do not output a plan and stop.
Modes
| Mode | Trigger | What It Does |
|---|---|---|
generate | "generate tests", "write tests", "add tests" | Create tests for existing code |
coverage | "test coverage", "coverage gaps", "missing tests" | Analyze coverage and fill gaps |
strategy | "test strategy", "test architecture" | Recommend test structure and patterns |
tdd | "tdd", "red green refactor" | Red-green-refactor loop for new features |
Default mode is generate when unspecified. Detect from user intent.
Step 0a: Scenarios-First (when the work has acceptance scenarios)
When the task is tied to a bead or .feature file, author tests FORWARD from the Gherkin scenarios — not backward from a coverage gap. This is the C2 contract (ag-9jle.4): the unit of test authoring is one scenario, one covering test.
1. Read the scenarios: the bead's ## Scenarios block (BEADS_DIR="$(ao beads dir)" br show <bead-id>) or a .feature under skills/<skill>/references/. 2. For each Scenario:, locate or write the test that exercises its Given/When/Then. Name it after the behavior. 3. Declare the linkage by adding @covered-by:<test-path> (optionally ::<TestName>) directly above the scenario in its source — so the leaf coverage gate can prove the mapping. 4. Run the leaf coverage gate and require it to pass before considering the slice tested:
bash scripts/check-bead-scenario-coverage.sh --bead <bead-id> --run # every scenario -> a PASSING test
# (--bead fetches the body via `br show`; BEADS_DIR defaults to <repo>/_beads — bd is retired)
bash scripts/check-bead-scenario-coverage.sh skills/<skill>/references/<name>.feature --runA scenario with no covering test is a FAIL — "tests exist" or a coverage percentage is not sufficient. Then continue with coverage gap-fill (Steps 1–5) for everything the scenarios don't reach. When there are no scenarios, skip this step and use the coverage-driven flow below.
Step 0: Detect Language and Load Standards
Scan the project root for language markers. Stop at the first match:
| Marker File | Language | Test Framework | Coverage Command |
|---|---|---|---|
go.mod | Go | go test | go test -coverprofile=coverage.out ./... |
pyproject.toml or setup.py | Python | pytest | pytest --cov --cov-report=term-missing |
package.json | JS/TS | jest or vitest | npx jest --coverage or npx vitest run --coverage |
Cargo.toml | Rust | cargo test | cargo tarpaulin --out Lcov |
Load /standards for the detected language. Apply all testing conventions from the standards skill (naming, assertion style, structural rules).
Go-specific rules (from project CLAUDE.md):
- Test file naming:
<source>_test.go. NEVERcov*_test.goor*_extra_test.go. - Test function naming:
Test<Uppercase>(e.g.,TestParseConfig_EmptyInput). - Prefer table-driven tests for multi-case functions.
- Use
captureStdoutfor output functions and assert content.
Python-specific rules:
- Use
pytestwithconftest.pyfor shared fixtures. - Use
@pytest.mark.parametrizefor multi-case functions. - Type hints on test helpers.
JS/TS-specific rules:
- Use
describe/itblocks with clear names. - Group by function or module under test.
- Mock external services, not internal code.
Step 1: Analyze Existing Test Coverage
Run the coverage command for the detected language:
# Go
go test -coverprofile=coverage.out ./... 2>&1 | tee .agents/test/coverage-raw.txt
go tool cover -func=coverage.out > .agents/test/coverage-func.txt
# Python
pytest --cov --cov-report=term-missing --cov-report=json:.agents/test/coverage.json 2>&1 | tee .agents/test/coverage-raw.txt
# JS/TS
npx jest --coverage --coverageReporters=text 2>&1 | tee .agents/test/coverage-raw.txt
# Rust
cargo tarpaulin --out Lcov 2>&1 | tee .agents/test/coverage-raw.txtParse the output. Build a ranked list of files by coverage percentage (lowest first).
If /refactor is available, cross-reference: high-complexity + low-coverage = highest priority targets.
Step 2: Identify Gaps
From the coverage data, identify:
1. Untested files -- source files with no corresponding test file. 2. Uncovered functions -- exported/public functions with 0% coverage. 3. Uncovered branches -- functions with partial coverage (conditionals, error paths). 4. Missing edge cases -- functions that only test the happy path.
Produce a gap list sorted by risk (high complexity + low coverage first):
File | Coverage | Functions Missing Tests | Risk
----------------------------|----------|------------------------|------
internal/parser/parse.go | 23% | ParseConfig, Validate | HIGH
internal/goals/measure.go | 45% | MeasureFitness | MEDIUM
lib/utils.go | 89% | (edge cases only) | LOWWrite gap list to .agents/test/gaps.md.
Step 3: Generate Tests
For each gap (highest risk first), generate tests following language-specific patterns.
If the target needs a specialized test pattern, load the matching reference before writing tests:
- Contract/API/CLI compatibility: references/conformance-harnesses.md
- Parsers, serializers, and untrusted inputs: references/fuzzing.md
- Generated files, snapshots, and rendered output: references/golden-artifacts.md
- Metamorphic/invariant-heavy behavior: references/metamorphic-testing.md
- Golden artifact update review: references/golden-artifact-strategy.md
- Real databases, services, queues, or APIs where mocks would hide failures: references/real-service-e2e.md
Go: Table-Driven Tests
func TestParseConfig_Variants(t *testing.T) {
tests := []struct {
name string
input string
want *Config
wantErr bool
}{
{name: "valid minimal", input: `name: foo`, want: &Config{Name: "foo"}},
{name: "empty input", input: "", want: nil, wantErr: true},
{name: "invalid yaml", input: `: bad`, want: nil, wantErr: true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := ParseConfig(tt.input)
if (err != nil) != tt.wantErr {
t.Errorf("ParseConfig() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("ParseConfig() = %v, want %v", got, tt.want)
}
})
}
}Python: Parametrized Tests
@pytest.mark.parametrize("input_val,expected", [
("valid", Config(name="valid")),
("", None),
(None, None),
])
def test_parse_config(input_val: str, expected: Config | None) -> None:
result = parse_config(input_val)
assert result == expectedJS/TS: Describe Blocks
describe("parseConfig", () => {
it("parses valid input", () => {
expect(parseConfig("valid")).toEqual({ name: "valid" });
});
it("returns null for empty input", () => {
expect(parseConfig("")).toBeNull();
});
it("throws on malformed input", () => {
expect(() => parseConfig(": bad")).toThrow();
});
});Generation Rules
1. Read the source function first. Understand inputs, outputs, error conditions, and branches. 2. Cover every branch. Each if, switch, error return, and edge case gets at least one test case. 3. Assert exact expected values. Use == expected, not != nil or != "". 4. Name tests descriptively. The test name should describe the scenario: "empty input returns error", not "test1". 5. Test error paths explicitly. Verify error messages or error types, not just that an error occurred. 6. One assertion focus per test case. Each table row or parametrized case tests one specific behavior.
Step 4: Run Generated Tests
After writing each test file, immediately run it:
# Go
go test -v -run TestParseConfig ./internal/parser/
# Python
pytest -xvs tests/test_parser.py
# JS/TS
npx jest --verbose tests/parser.test.ts
# Rust
cargo test test_parse_config -- --nocaptureIf tests fail: 1. Read the failure output. 2. Determine if the test is wrong or the code has a bug. 3. If the test is wrong: fix the test assertion or setup. 4. If the code has a bug: report it but fix the test to match current behavior, noting the bug in the output. 5. Re-run until green.
Never commit failing tests (unless in TDD mode, Step red).
Step 5: Output Coverage Report
Re-run coverage after adding tests:
# Same commands as Step 1Compare before/after. Write summary to .agents/test/summary.md:
# Test Generation Summary
**Language:** Go
**Date:** 2026-03-27
**Mode:** generate
## Coverage Delta
| Metric | Before | After | Delta |
|--------|--------|-------|-------|
| Overall | 52.3% | 71.8% | +19.5% |
| internal/parser | 23.0% | 85.2% | +62.2% |
| internal/goals | 45.0% | 67.3% | +22.3% |
## Tests Added
- `internal/parser/parse_test.go` -- 12 test cases (3 existing + 9 new)
- `internal/goals/measure_test.go` -- 8 test cases (new file)
## Remaining Gaps
- `internal/render/` -- 34% coverage, complex template logic
- `cmd/root.go` -- integration test needed
## Bugs Found
- `ParseConfig` does not validate empty name field (passes silently)Create .agents/test/ directory if it does not exist. All artifacts go there.
TDD Mode
When mode is tdd, follow the red-green-refactor cycle:
Red: Write a Failing Test
1. Understand the feature requirement from the user. 2. Write a test that describes the desired behavior. 3. Run the test -- it MUST fail. If it passes, the test is not testing new behavior.
# Verify the test fails
go test -v -run TestNewFeature ./...
# Expected: FAILGreen: Minimal Implementation
4. Write the minimum code to make the test pass. No extra logic, no optimization. 5. Run the test -- it MUST pass now.
go test -v -run TestNewFeature ./...
# Expected: PASSRefactor
6. Clean up the implementation. Remove duplication, improve naming, simplify logic. 7. Run ALL tests -- everything must still pass.
go test ./...
# Expected: all PASSRepeat
8. Pick the next behavior. Write the next failing test. Continue the cycle.
Log each cycle to .agents/test/tdd-log.md:
## Cycle 1: Parse empty config returns error
- RED: TestParseConfig_EmptyInput -- FAIL (function not implemented)
- GREEN: Added nil check in ParseConfig -- PASS
- REFACTOR: Extracted validation to validateConfig() -- PASS
## Cycle 2: Parse config validates name field
- RED: TestParseConfig_MissingName -- FAIL (no name validation)
- GREEN: Added name check -- PASS
- REFACTOR: None needed -- PASSStrategy Mode
When mode is strategy, analyze and recommend (no code generation):
1. Inventory existing tests. Count test files, test functions, assertion density. 2. Classify test types. Unit, integration, end-to-end, benchmark. 3. Identify structural gaps. Missing test directories, no CI integration, no fixtures. 4. Recommend architecture:
- Test directory structure matching source layout.
- Shared fixtures and helpers.
- Integration test separation (build tags in Go, markers in pytest).
- CI pipeline integration.
5. Output to `.agents/test/strategy.md`.
What Makes Good Tests vs Bad Tests
Good Tests
- Assert behavioral correctness. Test what the function does, not that it exists.
- Use exact expected values.
assert result == Config(name="foo", count=3)-- verifies the full output. - Cover error paths. Error conditions are where bugs hide. Test them explicitly.
- Descriptive names.
TestParseConfig_InvalidYAML_ReturnsErrortells you what broke when it fails. - Independent. Each test runs in isolation. No shared mutable state between tests.
- Fast. Unit tests should run in milliseconds. Slow tests get skipped.
Bad Tests (Banned)
- Coverage-padding. Tests that assert
!= nilor!= ""solely to inflate coverage metrics. Every test must assert a specific expected value. - Zero-assertion smoke tests.
func TestFoo(t *testing.T) { Foo() }-- proves nothing except "doesn't panic." - Tautological assertions.
assert foo(x) == foo(x)-- tests the test framework, not the code. - Implementation-coupled tests. Tests that break when you refactor internals without changing behavior. Test the interface, not the implementation.
- Flaky tests. Tests that depend on timing, network, or ordering. Mock external dependencies. Use deterministic inputs.
If you find existing tests that match the "bad" patterns, flag them in the summary but do not delete them without user confirmation.
Specialized Test References
- references/conformance-harnesses.md -- Contract, compatibility, schema, and process conformance patterns
- references/fuzzing.md -- Fuzz targets, seed corpora, invariants, and crash triage
- references/golden-artifacts.md -- Golden file modes, update discipline, and artifact diff review
- references/real-service-e2e.md -- Real-service integration tests with non-production safety gates
Integration with Other Skills
| Skill | Integration |
|---|---|
/standards | Loaded in Step 0 for language-specific test conventions |
/refactor | Cross-referenced in Step 2 to prioritize high-risk untested code |
/validate | After test generation, run /validate to validate overall code quality |
/implement | During implementation, invoke /test --mode=tdd for test-first workflow |
/review | Tests generated here help /review verify fixes |
Flags
| Flag | Default | Description |
|---|---|---|
--mode | generate | Execution mode: generate, coverage, strategy, tdd |
--scope | . | Directory or file to target (e.g., ./internal/parser/) |
--min-coverage | none | Target coverage percentage; keep generating until met |
--dry-run | off | Show what tests would be generated without writing files |
Output Artifacts
All artifacts are written to .agents/test/:
| File | Contents |
|---|---|
coverage-raw.txt | Raw coverage tool output |
coverage-func.txt | Per-function coverage breakdown (Go) |
coverage.json | Machine-readable coverage (Python) |
gaps.md | Ranked list of coverage gaps |
summary.md | Before/after coverage delta and test inventory |
tdd-log.md | TDD cycle log (tdd mode only) |
strategy.md | Test architecture recommendations (strategy mode only) |
Reference Documents
- references/test.feature — Executable spec: load standards + detect language, generate real passing tests (not a plan), coverage gap-fill, artifacts in .agents/test/ (soc-qk4b)
Conformance Harnesses
Use this reference when /test needs to prove an implementation follows an external contract, compatibility surface, schema, protocol, CLI behavior, or generated artifact shape.
Trigger
Choose conformance testing when the target has a contract that can be exercised repeatedly:
- JSON schema, OpenAPI, protobuf, or CLI output schema.
- Golden behavior from an existing implementation.
- Round-trip parse/render/serialize behavior.
- Cross-runtime compatibility claims.
- Generated artifacts that must remain in sync with source files.
Harness Patterns
| Pattern | Use When | Check |
|---|---|---|
| Reference implementation | A known-good implementation exists | Candidate output matches reference output for the same inputs. |
| Golden contract | Output is deterministic or can be canonicalized | Compare scrubbed output to checked-in golden fixtures. |
| Round trip | Parser and renderer both exist | decode(encode(x)) == x or equivalent invariant. |
| Spec matrix | Behavior is enumerated in a contract table | Each row has one test case and one assertion target. |
| Process harness | The target is a CLI/script/daemon | Run the process with fixture inputs and assert exit code, stdout/stderr, and artifacts. |
Required Loop
1. Identify the contract source of truth. 2. Build fixtures from the contract, not from the implementation under test. 3. Run the current implementation and capture output. 4. Canonicalize dynamic fields before comparing. 5. Fail loudly on unknown fields, missing fields, wrong exit codes, or silently skipped cases. 6. Write a coverage matrix showing contract rows covered and uncovered.
Output
Add a short conformance section to .agents/test/summary.md:
## Conformance Coverage
| Contract | Cases | Covered | Gaps |
|---|---:|---:|---|
| <schema or spec> | <n> | <n> | <missing cases> |Stop Criteria
Stop when every must-support contract row has a mechanical test or a documented exclusion with owner and rationale.
---
Source: Adapted from an external skill corpus / testing-conformance-harnesses. Pattern-only, no verbatim text.
Fuzzing
Use this reference when /test targets parsers, serializers, file readers, protocol decoders, untrusted input handlers, state machines, or security-sensitive validation logic.
Trigger
Prioritize fuzzing for code that accepts:
- Raw bytes, strings, JSON, YAML, XML, CSV, or custom formats.
- Network request bodies, CLI arguments, file contents, or environment input.
- Deserialized objects from untrusted boundaries.
- State transition sequences where operation order matters.
Rules
- Keep fuzz targets deterministic.
- Minimize external I/O inside fuzz functions.
- Add seed corpus entries for known edge cases before relying on random discovery.
- Assert invariants, not implementation details.
- Save every crash or regression input as a stable fixture.
Target Template
Every fuzz target needs:
1. A small wrapper around the real public function. 2. A seed corpus with valid, invalid, empty, boundary, and previously broken inputs. 3. At least one invariant:
- no panic
- valid input round-trips
- invalid input returns an error
- output remains canonical
- resource use stays bounded
Triage
When fuzzing finds a failure:
1. Minimize the input. 2. Add it as a named regression fixture. 3. Write a normal unit test for the minimized case. 4. Fix the bug. 5. Re-run fuzzing and the regression test.
Output
Record fuzz coverage in .agents/test/summary.md:
## Fuzz Targets
| Target | Corpus Seeds | Duration | Findings |
|---|---:|---:|---|
| <target> | <n> | <time> | <none or issue> |---
Source: Adapted from an external skill corpus / testing-fuzzing. Pattern-only, no verbatim text.
Golden Artifact Strategy
Use this reference before accepting changes to snapshots, generated reports, rendered docs, CLI output fixtures, or other checked-in artifacts that define a behavior contract.
Strategy
Golden artifacts are useful when the artifact itself is the interface. They are weak when the output is volatile, host-specific, or easier to assert through a structured parser.
Choose one comparison mode up front:
| Mode | Use When | Required Guard |
|---|---|---|
| Exact | Bytes are intentionally stable | Deterministic generator and stable inputs. |
| Scrubbed | Output has timestamps, paths, or IDs | Scrubber covers every volatile field. |
| Structured | JSON/YAML/CSV can be parsed | Canonical ordering before comparison. |
| Shape | Values are intentionally variable | Required keys and types are asserted. |
| Diff review | Human-readable artifact changed | Diff is attached to the validation note. |
Update Rules
Do not refresh a golden artifact just to make a test pass.
1. Run the current test and inspect the diff. 2. Identify the source change that produced the diff. 3. Decide whether the diff is intended behavior, fixture drift, or a bug. 4. Update the artifact only for intended behavior or fixture drift. 5. Add a short note explaining why the new artifact is accepted.
Review Checklist
- Dynamic fields are scrubbed or parsed away.
- The fixture input is checked in near the artifact or named in the test.
- The test fails on missing fields, extra unknown fields, and wrong exit codes
when those are part of the contract.
- The update command is documented in the test or nearby fixture comment.
Output
Add an acceptance table to .agents/test/summary.md when golden files change:
## Golden Artifact Review
| Artifact | Decision | Evidence |
|---|---|---|
| <path> | accepted/rejected | <diff or command> |---
Source: Adapted from an external skill corpus / testing-golden-artifacts. Pattern-only, no verbatim text.
Golden Artifacts
Use this reference when /test must protect generated files, rendered output, snapshots, reports, command output, or serialized data.
When Golden Tests Fit
Golden tests are useful when humans care about the exact artifact or when downstream tooling depends on stable shape.
Good targets:
- Generated markdown, JSON, YAML, CLI help, reports, and manifests.
- Rendered templates after dynamic fields are scrubbed.
- Cross-platform output after path and newline normalization.
- Structured output that can be canonicalized before comparison.
Avoid golden tests for volatile output that has no stable contract.
Golden Modes
| Mode | Description |
|---|---|
| Exact | Byte-for-byte comparison after deterministic generation. |
| Scrubbed | Replace timestamps, temp paths, UUIDs, hashes, and host-specific values before comparing. |
| Semantic | Parse into structured data and compare canonical JSON or sorted fields. |
| Fuzzy numeric | Allow explicit tolerance for floats, timing, or benchmark-like values. |
| Shape-only | Assert required keys and types when full values are intentionally variable. |
Update Discipline
Never update golden files as the first move.
1. Run the test and inspect the diff. 2. Decide if the diff is intended. 3. If intended, update the golden file and mention why in the summary. 4. If unintended, fix the generator or source data.
Output
Add this to .agents/test/summary.md when golden files change:
## Golden Changes
| Artifact | Verdict | Reason |
|---|---|---|
| <path> | accepted/rejected | <why> |---
Source: Adapted from an external skill corpus / testing-golden-artifacts. Pattern-only, no verbatim text.
Metamorphic Testing
Use this reference when /test needs stronger evidence than example-based assertions can provide, especially for ranking, transforms, parsers, planners, and other behavior where one exact expected answer is too narrow.
When To Use It
Metamorphic tests fit when the target should preserve or transform properties across related inputs.
Good targets:
- Parsers and serializers with round-trip or normalization behavior.
- Search, ranking, scoring, or filtering code with monotonicity rules.
- Refactors where old and new paths should agree on observable output.
- Data transforms where field order, whitespace, or batching should not matter.
- CLI wrappers where equivalent flags or input forms should converge.
Avoid metamorphic tests when the contract is a single fixed artifact. Use a golden artifact strategy for that case.
Relation Patterns
| Relation | Example Check |
|---|---|
| Round trip | decode(encode(x)) preserves the normalized value. |
| Idempotence | Applying the operation twice equals applying it once. |
| Commutativity | Reordering independent inputs keeps the same result. |
| Monotonicity | Adding a stronger signal cannot lower the ranked result. |
| Equivalence | Two public entry points produce the same observable output. |
| Partitioning | Batched input equals the merged output of smaller batches. |
Test Loop
1. Name the invariant before writing cases. 2. Generate or hand-pick related inputs that differ in one controlled way. 3. Run the real public API, CLI, or script on every related input. 4. Compare the property that must hold, not private implementation details. 5. Add any failure input as a stable regression fixture.
Output
Record the invariant and generated cases in .agents/test/summary.md:
## Metamorphic Coverage
| Target | Relation | Cases | Findings |
|---|---|---:|---|
| <target> | <relation> | <n> | <none or issue> |---
Source: Adapted from an external skill corpus / testing-metamorphic. Pattern-only, no verbatim text.
Real-Service E2E
Use this reference when mocks would hide the failure mode: auth flows, payment/webhook flows, queues, databases, storage, third-party APIs in sandbox mode, or multiple services with serialization boundaries.
Safety Gate
Before running real-service tests, prove the target is non-production:
- Test or sandbox credentials only.
- Dedicated test database, bucket, queue, project, or tenant.
- Destructive operations isolated by namespace or transaction rollback.
- Clear cleanup path.
- No live customer data.
If any safety check is unknown, stop and ask for an explicit test environment.
Pattern
1. Create test-owned resources with unique names. 2. Exercise the full boundary through the public interface. 3. Assert durable state, emitted events, logs, and API responses. 4. Clean up in defer, fixture teardown, or transaction rollback. 5. Capture enough evidence to debug failures without rerunning blindly.
What To Avoid
- Mocking the component whose integration is under test.
- Sharing mutable fixtures across tests.
- Sleeping for fixed durations when polling with timeouts would work.
- Running against production by default.
- Skipping cleanup on failure.
Output
Record real-service test safety in .agents/test/summary.md:
## Real-Service Safety
| Check | Result |
|---|---|
| Non-production credentials | PASS/FAIL |
| Isolated namespace | PASS/FAIL |
| Cleanup verified | PASS/FAIL |---
Source: Adapted from an external skill corpus / testing-real-service-e2e-no-mocks. Pattern-only, no verbatim text.
# Executable spec for the /test skill — test generation + coverage (supporting role).
# /test loads the language's test standards, generates REAL tests for existing code, runs them to
# verify they pass (it does not stop at a plan), and fills coverage gaps — writing artifacts to
# .agents/test/. Hexagon: supporting; consumes standards (test conventions) + repo-context (the
# code under test); produces result.json. (soc-qk4b)
Feature: Test generates real, passing tests and coverage
As the test-generation step
I want tests generated to the project's standards and verified by running them
So that coverage improves with real passing tests, not a plan
Scenario: standards and language are loaded before generating
When /test runs
Then it detects the language and loads the test standards (AI-native test shape) for it
Scenario: generate produces real tests that are run and verified
When /test generate runs on existing code
Then it writes real tests, runs them, and verifies they pass
And it does not output a plan and stop
Scenario: coverage analyzes and fills gaps
When /test coverage runs
Then it analyzes coverage gaps and fills them, writing a coverage report to .agents/test/
#!/usr/bin/env bash
set -euo pipefail
SKILL_DIR="$(cd "$(dirname "$0")/.." && pwd)"
PASS=0; FAIL=0
check() { if bash -c "$2"; then echo "PASS: $1"; PASS=$((PASS + 1)); else echo "FAIL: $1"; FAIL=$((FAIL + 1)); fi; }
check "SKILL.md exists" "[ -f '$SKILL_DIR/SKILL.md' ]"
check "SKILL.md has YAML frontmatter" "head -1 '$SKILL_DIR/SKILL.md' | grep -q '^---$'"
check "SKILL.md has name: test" "grep -q '^name: test' '$SKILL_DIR/SKILL.md'"
check "SKILL.md mentions TDD workflow" "grep -qi 'tdd' '$SKILL_DIR/SKILL.md'"
check "SKILL.md mentions coverage analysis" "grep -qi 'coverage' '$SKILL_DIR/SKILL.md'"
echo ""; echo "Results: $PASS passed, $FAIL failed"
[ $FAIL -eq 0 ] && exit 0 || exit 1
Related skills
FAQ
Which languages does it support?
It detects Go (go.mod), Python (pyproject.toml or setup.py), JS/TS (package.json), and Rust (Cargo.toml), each with its own test framework and coverage command.
Does it just output a plan?
No. It generates real tests, runs them, verifies they pass, and produces coverage artifacts; outputting a plan and stopping is explicitly disallowed.