mo-code: Skill for Claude Code

.codex/skills/test-generator/SKILL.md

test-generator is a skill for Claude Code, Codex from mortis-cube/mo-code. It costs 55 tokens per session (1,558 once invoked), scanned A, a copy of test-generator, MIT.

A skill that suggests basic automated tests when new functions or components are written. It uses common patterns for Jest, Vitest, and Pytest, which are tools for testing JavaScript and Python code.

In plain words
What is it for?
Use it to create starter tests for new functions and components, or when a test is missing. It is suited to basic unit tests rather than comprehensive test suites.
Why use it?
It reduces the time needed to create an initial test file and covers simple success, missing-value, and error cases. It does not replace a full integration or end-to-end test plan.

Skill for Claude CodeCodex

Written for Claude Code and Codex: allowed-tools in frontmatter, but also installed under .codex/. Also seen: reads .claude/ paths; mentions subagents.

This is mortis-cube/mo-code's own configuration. It tells Claude Code and Codex how to work on mo-code itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mo-code configures →

Reuse

Borrowing it

Nothing to install: this file belongs to mortis-cube/mo-code. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/mortis-cube/mo-code/main/.codex/skills/test-generator/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/mortis-cube/mo-code

Made for: Claude Code, Codex.

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-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/mortis-cube/mo-code/test-generator/github.svg)](https://agentmods.dev/skills/mortis-cube/mo-code/test-generator)
Your own site
<a href="https://agentmods.dev/skills/mortis-cube/mo-code/test-generator"><img src="https://agentmods.dev/badge/skills/mortis-cube/mo-code/test-generator/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 test-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/mortis-cube/mo-code/test-generator"><img src="https://agentmods.dev/badge/skills/mortis-cube/mo-code/test-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,558 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 100% copy Near-identical to another mod 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.00055 $0.01558
Opus 5.5 $0.00022 $0.00623
Sonnet 5.5 $0.00011 $0.00312
Haiku 4.5 $0.00006 $0.00156

Measured yesterday against content hash 2c749a7179d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-generator 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.

Origin

This is a copy

100% identical to test-generator — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.codex/skills/test-generator/SKILL.md · 255 lines

How it starts

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

Test Generator Skill

Auto-suggest tests when you write new code.

When I Activate

  • ✅ New function created
  • ✅ New component added
  • ✅ User mentions testing or tests
  • ✅ Test file missing for implementation
  • ✅ User asks "can you test this?"

What I Generate

Quick Test Scaffolding

  • Basic happy path tests
  • Null/undefined edge cases
  • Simple error scenarios
  • Framework-appropriate syntax (Jest/Vitest/Pytest)

What I Don't Do

  • Comprehensive test suites → Use @test-engineer sub-agent
  • Integration tests → Use @test-engineer sub-agent
  • E2E test design → Use @test-engineer sub-agent
  • Test strategy planning → Use @test-engineer sub-agent

Relationship with @test-engineer Sub-Agent

Me (Skill): Quick test scaffolding @test-engineer (Sub-Agent): Comprehensive testing strategy

Workflow

  1. You write a function
  2. I auto-generate basic test structure
  3. You want full suite → Invoke @test-engineer sub-agent
  4. Sub-agent creates comprehensive tests

Examples

JavaScript Function

// You write:
function calculateDiscount(price, percentage) {
  if (price <= 0) throw new Error('Invalid price');
  return price * (percentage / 100);
}

// I auto-generate:
describe('calculateDiscount', () => {
  it('calculates discount correctly', () => {
    expect(calculateDiscount(100, 10)).toBe(10);
  });

  it('throws error for invalid price', () => {
    expect(() => calculateDiscount(0, 10)).toThrow('Invalid price');
  });

  it('handles zero percentage', () => {
    expect(calculateDiscount(100, 0)).toBe(0);
  });

  // TODO: Add more edge cases
  // Consider: negative percentages, decimal values, very large numbers
});

React Component

// You write:
function UserCard({ user, onEdit }) {
  return (
    <div className="user-card">
      <h2>{user.name}</h2>
      <button onClick={() => onEdit(user.id)}>Edit</button>
    </div>
  );
}

// I auto-generate:
import { render, screen, fireEvent } from '@testing-library/react';

describe('UserCard', () => {
  const mockUser = { id: 1, name: 'John Doe' };
  const mockOnEdit = jest.fn();

  it('renders user name', () => {
    render(<UserCard user={mockUser} onEdit={mockOnEdit} />);
    expect(screen.getByText('John Doe')).toBeInTheDocument();
  });

  it('calls onEdit with user id when button clicked', () => {
    render(<UserCard user={mockUser} onEdit={mockOnEdit} />);
    fireEvent.click(screen.getByText('Edit'));
    expect(mockOnEdit).toHaveBeenCalledWith(1);
  });

  // TODO: Add tests for edge cases
  // - Missing user data
  // - Undefined onEdit
  // - Long names (UI testing)
});

Read the full file on GitHub · 255 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 255 lines · 55 tokens per session scan A 2c749a7179d0

Subscribe to this mod's changes

test-generator is a skill published in the GitHub repository mortis-cube/mo-code (85 stars, last pushed 12d ago), licensed MIT. It adds 55 tokens to every session and 1,558 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to test-generator, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories