test

test is a command for Claude Code from PraveenJayaprakash-JP/repomemory. It costs 0 tokens per session (834 once invoked), scanned A, original, MIT.

A command that detects a project's test framework, runs all, selected, or changed tests, and explains failures. Test frameworks are tools such as pytest, Jest, Cargo test, or RSpec that run automated checks.

In plain words
What is it for?
Use it to run a whole suite, a file or directory, or tests related to changed files, with optional watch mode, coverage reporting, or attempted fixes.
Why use it?
It avoids manually figuring out which test runner and scope to use, while collecting results in one workflow. It also handles projects with no discovered tests.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it to run a whole suite, a file or directory, or tests related to changed files, with optional watch mode, coverage reporting, or attempted fixes.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/praveenjayaprakash-jp/repomemory/test
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.

Clone the repo
git clone --depth 1 https://github.com/PraveenJayaprakash-JP/repomemory

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 test

README.md
[![agentmods](https://agentmods.dev/badge/commands/praveenjayaprakash-jp/repomemory/test.svg)](https://agentmods.dev/commands/praveenjayaprakash-jp/repomemory/test)
Your own site
<a href="https://agentmods.dev/commands/praveenjayaprakash-jp/repomemory/test"><img src="https://agentmods.dev/badge/commands/praveenjayaprakash-jp/repomemory/test.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 834 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.00000 $0.00834
Opus 5 $0.00000 $0.00417
Sonnet 5 $0.00000 $0.00167
Haiku 4.5 $0.00000 $0.00083

Measured 8d ago against content hash ad2af5bf5579, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d 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.

commands/test.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.

---
name: test
description: Run tests with intelligent failure analysis and auto-fixes
trigger: /test [scope] [flags]
scope:
  - all          # Run entire test suite (default)
  - <path>       # Specific file or directory
  - changed      # Tests related to changed files
flags:
  --watch        # Watch mode: re-run tests on file changes
  --coverage     # Generate and report code coverage
  --fix          # Attempt auto-fix for known failure patterns
---

# Test Command

Run tests intelligently — detect framework, scope execution, parse failures, and summarise results.

## Steps

1. **Detect test framework**
   - Inspect project configuration in order:
     - `package.json` → jest, vitest, mocha, etc.
     - `pyproject.toml` → pytest, unittest
     - `Cargo.toml` → cargo test
     - `go.mod` → go test
     - `Gemfile` → rspec, minitest
     - `build.gradle` / `pom.xml` → gradle/maven test
   - Fallback: probe for common patterns (e.g. `__init__.py` in tests, `test_*.py`, `*.test.js`).
   - If nothing found → zero‑test‑found handler (see below).

2. **Run tests based on scope**
   - `all` → whole suite.
   - `<path>` → pass as argument to the runner.
   - `changed` → diff against main branch (`git diff --name-only main`) and map to test files.

3. **Parse output for failures**
   - Capture stdout/stderr.
   - Extract for each failure:
     - file, line number, error message.
   - Use framework‑specific parsers (e.g. JUnit XML, pytest JSON, cargo test JSON).

4. **Analyse failures and suggest causes**
   - For each failure:
     - Display `file:line: message`.
     - Suggest likely causes based on error pattern:
       - `AssertionError` → check values/logic
       - `TypeError` / `ImportError` → check dependencies/types
       - `Timeout` → async handling, external resources
       - `Segmentation fault` / `panic` → memory/unsafe code
     - If `--fix` is set and a known pattern is matched, apply automatic fix (e.g. pin version, add mock, fix import path).

5. **Summarise results**
   - Pass / Fail / Skip counts.
   - Coverage estimate if `--coverage` enabled (overall %, per‑file %).
   - Flaky test warnings: tests that passed after re‑run (if detected via retry or watch mode).

## Flags

| Flag         | Description                                                      |
|--------------|------------------------------------------------------------------|
| `--watch`    | Watch files for changes and re‑run relevant tests automatically. |
| `--coverage` | Generate coverage report and include summary in output.          |
| `--fix`      | Attempt auto‑fix for known failure patterns (safe, reversible).  |

## Zero Test Found

If no tests are detected, the command will:

- Print a clear message explaining why (no config, no test files, etc.).
- Suggest next steps:
  - For Node: `npm install jest` and create `__tests__/`.
  - For Python: `pip install pytest` and create `tests/`.
  - For Rust: `cargo init --lib` includes tests by default.
  - For Go: `go test` works out of the box.
- Optionally scaffold a sample test file in the detected framework.

## Examples

Run all tests

/test

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. 8d ago First seen · 97 lines · 0 tokens per session scan A ad2af5bf5579

Subscribe to this mod's changes

test is a command published in the GitHub repository PraveenJayaprakash-JP/repomemory (1 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 834 tokens. 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.