discover-test-patterns

discover-test-patterns is a skill for Claude Code, Codex from eveld/claude. It costs 21 tokens per session (603 once invoked), scanned A, original, MIT.

A planning skill that studies how a project writes and organizes tests. It identifies the test files, framework, structure, assertions, mocks, and setup conventions used by the codebase.

In plain words
What is it for?
Use it before planning or implementing tests to document file locations, test syntax, assertion libraries, mocking methods, and representative examples.
Why use it?
It helps new tests match the project's existing style instead of introducing unfamiliar patterns.

Skill for Claude CodeCodex

Part of the workflows plugin — 29 skills, 5 commands, 17 agents shipped together

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 skills/eveld/claude/discover-test-patterns
Any agent
npx skills add eveld/claude --skill discover-test-patterns
Clone the repo
git clone --depth 1 https://github.com/eveld/claude

Made for: Claude Code, Codex.

Or install workflows, the plugin that ships this one along with the rest of its 29 skills, 5 commands, 17 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for discover-test-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/eveld/claude/discover-test-patterns.svg)](https://agentmods.dev/skills/eveld/claude/discover-test-patterns)
Your own site
<a href="https://agentmods.dev/skills/eveld/claude/discover-test-patterns"><img src="https://agentmods.dev/badge/skills/eveld/claude/discover-test-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 603 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.00021 $0.00603
Opus 5 $0.00010 $0.00302
Sonnet 5 $0.00004 $0.00121
Haiku 4.5 $0.00002 $0.00060

Measured 5d ago against content hash b4c0e05d645e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

discover-test-patterns 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 5d ago.

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.

skills/discover-test-patterns/SKILL.md · 97 lines

How it starts

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

Discover Test Patterns

Automatically discover and document test patterns used in the project for reference during planning and implementation.

What to Discover

Test File Organization

  • Location patterns (e.g., *_test.go, *.test.ts, test_*.py)
  • Directory structure (e.g., tests/, __tests__/, alongside source)
  • Framework being used

Common Patterns

Find and document:

  • How tests are structured (describe/it, test functions, etc.)
  • Assertion style (testify, chai, pytest, etc.)
  • Mocking approach (mockery, jest.mock, unittest.mock, etc.)
  • Setup/teardown patterns
  • Table-driven test examples

Framework Detection

Identify testing frameworks:

  • Go: testing, testify, ginkgo
  • TypeScript/JavaScript: Jest, Mocha, Vitest
  • Python: pytest, unittest
  • Rust: built-in test framework

Discovery Process

  1. Find test files: Use glob patterns to locate tests
  2. Read examples: Read 2-3 representative test files
  3. Extract patterns: Identify common structures and styles
  4. Document: Use template to create reference doc

Output Format

Write to: thoughts/notes/testing.md

Use the template from templates/testing-reference.md and populate with discovered patterns.

Example Output Structure

---
last_updated: 2025-12-23T10:00:00Z
last_updated_by: Claude
project: my-project
---

# Test Patterns Reference

Last discovered: 2025-12-23

## Go Test Patterns

### File Organization
- **Location**: `*_test.go` files alongside source
- **Framework**: testify/require
- **Example**: `internal/auth/handler_test.go`

### Common Pattern: Table-Driven Tests
**Found in**: `internal/auth/handler_test.go:45-78`

```go
func TestAuthHandler(t *testing.T) {
    tests := []struct {
        name     string
        input    string
        expected string
    }{
        // test cases
    }
    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            require.Equal(t, tt.expected, result)
        })
    }
}

Assertion Style

  • Use require for assertions that should stop test
  • Use assert for non-critical checks

Mocking Approach

  • Mockery-generated mocks in mocks/ directory
  • Interface-based mocking pattern

Read the full file on GitHub · 97 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. 5d ago First seen · 97 lines · 21 tokens per session scan A b4c0e05d645e

Subscribe to this mod's changes

discover-test-patterns is a skill published in the GitHub repository eveld/claude (10 stars, last pushed 7mo ago), licensed MIT. It adds 21 tokens to every session and 603 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-31.

Related

Other skills, from other repositories

code-indexing-pipeline

How Infigraph turns source into a graph — adding a language (tree-sitter vs ANTLR grammar-plugin), cross-file call resolution, SCIP compiler-grade enrichment, and file-watch/reindex triage. Use when adding language support, debugging unresolved calls or SCIP import, or triaging stale index/watcher issues.

intuit/infigraph · 70 tokens

analysis-subsystems

How Infigraph's multi-repo/group mode and taint analysis work internally — HTTP contract extraction heuristics, cross-service edge linking, combined-graph merge, remote mode, plus taint's line-based tracking and sanitizer heuristic. Use when working on crates/infigraph-core/src/multi/ or src/taint/, or investigating…

intuit/infigraph · 80 tokens

review-pr-against-issue

Review one or more PRs against the GitHub issue(s) they claim to fix, including fetching PR branches directly when gh can't reach github.com (e.g. gh is authenticated to an enterprise host instead). Use whenever asked "does this PR fix issue.

intuit/infigraph · 61 tokens

opencli-sitemap-author

Use when creating or maintaining OpenCLI site sitemaps: agent-facing navigation, page-state, action, workflow, API-reference, pitfall, and fallback knowledge for a website. Use after browser exploration discovers durable site context, when a sitemap is stale, or when promoting local site knowledge into the repo.

jackwener/OpenCLI · 67 tokens

specification-writing

Write the full patent specification from claims and invention disclosure. Use when user says "撰写说明书", "write specification", "写说明书", "patent description", or wants to draft the complete patent specification.

wanshuiyin/Auto-claude-code-research-in-sleep · 49 tokens

training-check

Interactively monitor training metrics from the current Codex session, periodically checking WandB or fallback logs for NaN, divergence, plateaus, and broken runs.

wanshuiyin/Auto-claude-code-research-in-sleep · 35 tokens