test

A command that guides you through writing tests for a feature while you write the test code yourself. It first checks the project's testing tools and existing test files.

In plain words
What is it for?
Use /own:test when adding a feature and planning unit, integration, or end-to-end tests in projects using tools such as Jest, Vitest, Mocha, Playwright, Cypress, or pytest.
Why use it?
It gives structure to deciding what should be tested without generating the complete test implementation for you. This keeps the focus on understanding behavior and choosing useful coverage.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/danielpodolsky/ownyourcode/test
Clone the repo
git clone --depth 1 https://github.com/DanielPodolsky/ownyourcode

Made for: Claude Code.

Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,413 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00011 $0.02413
Opus 5 $0.00005 $0.01207
Sonnet 5 $0.00002 $0.00483
Haiku 4.5 $0.00001 $0.00241

Measured yesterday against content hash 0a07abcf84b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/own/test.md · 389 lines

How it starts

The opening of the file, as written. The whole thing — 389 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/own:test

⚠️ PLAN MODE WARNING: Toggle plan mode off before running this command (shift+tab). OwnYourCode commands don't work correctly with plan mode.

Guide the junior through writing tests for their feature. They write the tests, you guide what to test.

The Testing Philosophy

"If you can't test it, you don't understand it. Tests are proof of understanding."

  • Junior WRITES the tests, AI GUIDES what to test
  • Tests are interview gold
  • Strategic coverage over 100% coverage
  • Testing Pyramid: Unit (70%) → Integration (20%) → E2E (10%)

This command does NOT:

  • Write complete test files
  • Generate test implementations
  • Skip the learning process

Execution Flow

Phase 1: Detect Stack & Framework

First, detect their project's testing setup:

# Check package.json for testing dependencies
grep -E "(jest|vitest|mocha|playwright|cypress|pytest)" package.json 2>/dev/null

Use Glob to find existing tests:

  • **/*.test.ts, **/*.spec.ts
  • **/__tests__/**
  • **/test_*.py, **/*_test.py
Framework Recommendation
Detection Recommendation Why
vite in package.json Vitest 10-20x faster than Jest, native ESM
react-scripts Jest + RTL CRA default, well integrated
next Vitest or Jest Either works, Vitest preferred
Python project pytest Standard, simple, powerful
Go project go test Built-in, no setup needed

If no test framework:

"I don't see a test framework installed. Let me check the docs for what works best with your stack..."

Use Context7 to fetch framework setup guides.


Phase 2: Understand What They're Testing

Question: "What do you want to test?"

Options:
1. A feature I just completed
   Description: Write tests for new code

2. Existing code that's untested
   Description: Add test coverage to old code

3. A bug I just fixed
   Description: Write a regression test

4. I don't know where to start
   Description: Help me identify what to test

Read the full file on GitHub · 389 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 389 lines · 11 tokens per session scan A 0a07abcf84b2

Subscribe to this mod's changes

test is a command published in the GitHub repository DanielPodolsky/ownyourcode (276 stars, last pushed 2mo ago), licensed MIT. It adds 11 tokens to every session and 2,413 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.