test-generate

test-generate is a command for Claude Code from smicolon/ai-kit. It costs 17 tokens per session (2,068 once invoked), scanned A, original, MIT.

A command for generating tests for Django code, with a stated target of at least 90% code coverage. Code coverage measures how much of the code runs during tests.

In plain words
What is it for?
Use it to generate tests for Django projects and aim for comprehensive coverage of their code.
Why use it?
It helps create a broad test suite for Django code and makes the intended coverage target explicit.

Command for Claude Code

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

Good fit Use it to generate tests for Django projects and aim for comprehensive coverage of their code.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/smicolon/ai-kit/test-generate
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/smicolon/ai-kit

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/smicolon/ai-kit/test-generate/github.svg)](https://agentmods.dev/commands/smicolon/ai-kit/test-generate)
Your own site
<a href="https://agentmods.dev/commands/smicolon/ai-kit/test-generate"><img src="https://agentmods.dev/badge/commands/smicolon/ai-kit/test-generate/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-generate

Your own site · 80×15
<a href="https://agentmods.dev/commands/smicolon/ai-kit/test-generate"><img src="https://agentmods.dev/badge/commands/smicolon/ai-kit/test-generate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 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,068 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.00017 $0.02068
Opus 5.5 $0.00007 $0.00827
Sonnet 5.5 $0.00003 $0.00414
Haiku 4.5 $0.00002 $0.00207

Measured 1mo ago against content hash a36237884a99, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-generate 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 1mo 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.

packs/django/commands/test-generate.md · 326 lines

How it starts

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

Django Test Generation

You are a Django testing specialist. Your task is to generate comprehensive tests that achieve 90%+ code coverage following best-practice testing standards.

Core Requirements

Import Pattern (CRITICAL)

# ✅ CORRECT
import users.models as _users_models
import users.services as _users_services
import users.serializers as _users_serializers
from django.test import TestCase
from rest_framework.test import APITestCase, APIClient

Test Categories

  1. Model Tests - Test model methods, constraints, relationships
  2. Service Tests - Test business logic, transactions
  3. API Tests - Test endpoints, permissions, validation
  4. Integration Tests - Test complete workflows

Test Structure

Model Tests

# app/tests/test_models.py
import users.models as _users_models
from django.test import TestCase
from django.db import IntegrityError

class ProductModelTest(TestCase):
    def setUp(self):
        self.product = _models.Product.objects.create(
            name='Test Product',
            slug='test-product',
            description='Test description',
            price=99.99,
            stock=10
        )

    def test_product_creation(self):
        """Test product is created with required fields"""
        self.assertIsNotNone(self.product.id)
        self.assertIsNotNone(self.product.created_at)
        self.assertFalse(self.product.is_deleted)

    def test_product_str(self):
        """Test string representation"""
        self.assertEqual(str(self.product), 'Test Product')

    def test_slug_unique_constraint(self):
        """Test slug must be unique"""
        with self.assertRaises(IntegrityError):
            _models.Product.objects.create(
                name='Another Product',
                slug='test-product',  # Duplicate slug
                price=49.99
            )

    def test_price_non_negative(self):
        """Test price cannot be negative"""
        with self.assertRaises(IntegrityError):
            _models.Product.objects.create(
                name='Invalid Product',
                slug='invalid',
                price=-10.00
            )

    def test_soft_delete(self):
        """Test soft delete functionality"""
        product_id = self.product.id
        self.product.is_deleted = True
        self.product.save()

        # Product still exists in database
        product = _models.Product.objects.get(id=product_id)
        self.assertTrue(product.is_deleted)

Read the full file on GitHub · 326 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. 1mo ago Changed a36237884a99
  2. 1mo ago First seen · 326 lines · 17 tokens per session scan A d63dd33ae68a

Subscribe to this mod's changes

test-generate is a command published in the GitHub repository smicolon/ai-kit (6 stars, last pushed 1mo ago), licensed MIT. It adds 17 tokens to every session and 2,068 once invoked, about $0.0001 per session on Opus 5.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.