generate-tests

generate-tests is a skill for Claude Code from ArtemioPadilla/agent-triforce. It costs 48 tokens per session (1,677 once invoked), scanned A, original, MIT.

A test-generation workflow that creates tests for a module or function using common test-design methods and the Arrange-Act-Assert structure.

In plain words
What is it for?
Use it to analyze public Python, TypeScript, or JavaScript functions and generate tests suited to the project's existing test framework.
Why use it?
It helps start or expand automated test coverage, including edge cases and error conditions; TDD means writing tests before the implementation.

Skill for Claude Code

Written for Claude Code: context: fork in frontmatter. Also seen: agent in frontmatter.

Good fit Use it to analyze public Python, TypeScript, or JavaScript functions and generate tests suited to the project's existing test framework.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/artemiopadilla/agent-triforce/generate-tests
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.

Any agent
npx skills add ArtemioPadilla/agent-triforce --skill generate-tests
Clone the repo
git clone --depth 1 https://github.com/ArtemioPadilla/agent-triforce

Made for: Claude Code.

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 generate-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/artemiopadilla/agent-triforce/generate-tests/github.svg)](https://agentmods.dev/skills/artemiopadilla/agent-triforce/generate-tests)
Your own site
<a href="https://agentmods.dev/skills/artemiopadilla/agent-triforce/generate-tests"><img src="https://agentmods.dev/badge/skills/artemiopadilla/agent-triforce/generate-tests/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for generate-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/artemiopadilla/agent-triforce/generate-tests"><img src="https://agentmods.dev/badge/skills/artemiopadilla/agent-triforce/generate-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,677 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00048 $0.01677
Opus 5 $0.00024 $0.00839
Sonnet 5 $0.00010 $0.00335
Haiku 4.5 $0.00005 $0.00168

Measured 11d ago against content hash c9a8205fe893, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

generate-tests 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 11d 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.

.claude/skills/generate-tests/SKILL.md · 139 lines

How it starts

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

Generate tests for: $ARGUMENTS

If no specific module or function is provided, ask the user which file or function to generate tests for.

Follow these steps:

SIGN IN:

  • Run the SIGN IN checklist from your agent file
  • Note any existing test conventions in the project (fixtures, helpers, conftest)

ANALYZE:

  1. Read the target module or function file
  2. Identify all public functions, methods, and classes:
    • Python: functions/methods NOT prefixed with _ (single underscore)
    • TypeScript/JavaScript: exported functions, classes, and methods only
    • Do NOT generate tests for private/unexported symbols
  3. For each public function, extract:
    • Function signature (parameters, types, return type)
    • Docstring or JSDoc description (if present)
    • Business rules implied by the function name and signature
    • Edge cases: null/None inputs, empty collections, boundary values, error conditions

SELECT TECHNIQUES: 4. For each public function, select test design technique(s) based on the function's characteristics:

Signal in the code Technique What to generate
Numeric/date parameters, ranges, limits, thresholds Boundary Value Analysis (BVA) Tests at min, min+1, max-1, max, and one invalid boundary
Discrete valid categories (enums, roles, types, status) Equivalence Partitioning (EP) One test per valid partition + one per invalid partition
Multiple boolean conditions, complex if/elif, permission matrices Decision Table One test per unique condition combination
Lifecycle objects (status fields, workflow steps, FSMs) State Transition Each valid transition + key invalid transitions
Known failure patterns, historical bugs, unusual inputs Error Guessing Nulls, empty strings, Unicode, concurrent access, off-by-one
  • If a function shows multiple signals, apply the dominant technique first, then supplement
  • If no clear signal, default to EP + BVA for inputs, Error Guessing for edge cases
  • Document the chosen technique in a comment above each test group:
    # Technique: BVA — testing boundaries of page_size parameter (1, 100, 0, 101)
    

DETECT FRAMEWORK: 5. Determine the test framework from project configuration:

  • Python: Check for pyproject.toml ([tool.pytest]), pytest.ini, setup.cfg -> use pytest
  • TypeScript: Check package.json for vitest -> use Vitest; check for jest -> use Jest
  • JavaScript: Same as TypeScript
  • If no framework detected, ask the user which to use
  1. Detect existing test conventions:
    • Fixture patterns (conftest.py, test helpers, factory functions)
    • Import patterns (absolute vs relative)
    • Naming patterns (test_*, describe/it, should)

GENERATE: 7. Determine the test file location following project conventions:

  • Python: tests/ mirroring src/ structure (e.g., src/auth/token.py -> tests/auth/test_token.py)
  • TypeScript: tests/ mirroring src/ or co-located *.test.ts files (match existing pattern)
  • Create intermediate directories if needed
  1. For each public function, generate tests driven by the selected technique(s):
    • Happy-path test: Representative valid input from the primary equivalence class
    • Technique-specific tests (from step 4):
      • BVA: min, max, min-1, max+1 (at minimum 4 tests per bounded parameter)
      • EP: one test per valid partition, one per invalid partition
      • Decision Table: one test per rule row (condition combination)
      • State Transition: one test per valid transition, plus 1-2 invalid transitions
      • Error Guessing: targeted tests for known failure modes
    • Test case ID: Each test docstring starts with TC-{feature}-{NNN} and links to the AC it verifies:
      def test_page_size_at_maximum():
          """TC-pagination-003: BVA max boundary for page_size.
          Verifies: pagination-AC-001
          GIVEN page_size is 100 (maximum allowed)
          WHEN the list endpoint is called
          THEN exactly 100 results are returned."""
      
  2. Every test MUST follow the Arrange-Act-Assert pattern:
    def test_function_does_something():
        # Arrange
        input_data = create_valid_input()
    
        # Act
        result = function_under_test(input_data)
    
        # Assert
        assert result == expected_outcome
    
  3. Every test MUST follow FIRST principles:
  • Fast: No network calls, no file system dependencies (unless explicitly testing I/O)
  • Isolated: No test depends on another test's state
  • Repeatable: Same result every run, no randomness without seeding
  • Self-validating: Clear pass/fail, no manual inspection needed
  • Timely: Tests written before or alongside implementation
  1. Add a comment header at the top of the generated test file:
    # Generated tests -- require human review before merge
    # Generator: /generate-tests
    # Source: {path to source file}
    # Date: {YYYY-MM-DD}
    
  2. Do NOT hardcode expected values by reading implementation output. Base test expectations on:
    • Function docstrings and type signatures
    • Spec acceptance criteria (if referenced)
    • Logical invariants from the function name and contract
    • Use placeholder comments like # TODO: verify expected value when the correct output cannot be inferred from the spec

Read the full file on GitHub · 139 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. 11d ago First seen · 139 lines · 48 tokens per session scan A c9a8205fe893

Subscribe to this mod's changes

generate-tests is a skill published in the GitHub repository ArtemioPadilla/agent-triforce (3 stars, last pushed 4mo ago), licensed MIT. It adds 48 tokens to every session and 1,677 once invoked, about $0.0002 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

testing-strategy

Test pyramid, coverage targets, and test patterns (unit/integration/E2E). TRIGGER when: planning tests, writing test code, or reviewing coverage. SKIP: quality-gate scoring of plans (use quality-validation); security testing (use security-review-checklists). (Examples use common runners such as pytest and vitest.).

komluk/scaffolding · 71 tokens

worktree-historical-test-replay-missing-dirs

Fix pytest exit 4 ("file or directory not found") when running a test command in a git worktree checked out at an OLD commit. Use when: (1) you're doing historical replay (incident replay, mutation testing, git bisect with tests) and the suite errors out in 1-2 seconds with no test execution, (2) the test command…

wan-huiyan/agent-traffic-control · 239 tokens

test-gen

Generate tests for code — use when asked to write tests, create a test suite, add test coverage, or generate unit/integration tests for a file or module. Triggers the deterministic test-gen workflow (analyze → generate via test-writer agent → run-fix loop → report).

5uck1ess/devkit · 61 tokens

vitest-unit

No artifact. This skill emits prescriptive guidance inline. The implementing agent writes test files in the assigned worktree.

lukasrepublic/agentic-foundry · 0 tokens

sd-test

The disciplined test-recipe gate the generic agent runs for the software-delivery TEST step (/foundry:sd-test, step 8). A PROCEDURE — invoke the MERGED foundry-verify.py executor, read the run record's records whose phase == "testrecipe" (unit / integration / e2e), surface the profile's numeric coveragegate and advise…

lukasrepublic/agentic-foundry · 154 tokens

js-quality

A JavaScript quality-check workflow using ESLint, Prettier, Jest, or Vitest. It checks code for common problems, consistent formatting, and passing automated tests.

morodomi/dev-crew · 48 tokens