Codex

generate-tests

Generate comprehensive test suite for $ARGUMENTS following project testing conventions and best practices.

104 stars

Best use case

generate-tests is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

It is a strong fit for teams already working in Codex.

Generate comprehensive test suite for $ARGUMENTS following project testing conventions and best practices.

Teams using generate-tests should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/generate-tests/SKILL.md --create-dirs "https://raw.githubusercontent.com/jmagly/aiwg/main/.agents/skills/generate-tests/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/generate-tests/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How generate-tests Compares

Feature / Agentgenerate-testsStandard Approach
Platform SupportCodexLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generate comprehensive test suite for $ARGUMENTS following project testing conventions and best practices.

Which AI agents support this skill?

This skill is designed for Codex.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Test Generator

Generate comprehensive test suite for $ARGUMENTS following project testing conventions and best practices.

## Task

I'll analyze the target code and create complete test coverage including:

1. Unit tests for individual functions and methods
2. Integration tests for component interactions  
3. Edge case and error handling tests
4. Mock implementations for external dependencies
5. Test utilities and helpers as needed
6. Performance and snapshot tests where appropriate

## Process

I'll follow these steps:

1. Analyze the target file/component structure
2. Identify all testable functions, methods, and behaviors
3. Examine existing test patterns in the project
4. Create test files following project naming conventions
5. Implement comprehensive test cases with proper setup/teardown
6. Add necessary mocks and test utilities
7. Verify test coverage and add missing test cases

## Test Types

### Unit Tests
- Individual function testing with various inputs
- Component rendering and prop handling
- State management and lifecycle methods
- Utility function edge cases and error conditions

### Integration Tests
- Component interaction testing
- API integration with mocked responses
- Service layer integration
- End-to-end user workflows

### Framework-Specific Tests
- **React**: Component testing with React Testing Library
- **Vue**: Component testing with Vue Test Utils
- **Angular**: Component and service testing with TestBed
- **Node.js**: API endpoint and middleware testing

## Testing Best Practices

### Test Structure
- Use descriptive test names that explain the behavior
- Follow AAA pattern (Arrange, Act, Assert)
- Group related tests with describe blocks
- Use proper setup and teardown for test isolation

### Mock Strategy
- Mock external dependencies and API calls
- Use factories for test data generation
- Implement proper cleanup for async operations
- Mock timers and dates for deterministic tests

### Coverage Goals
- Aim for 80%+ code coverage
- Focus on critical business logic paths
- Test both happy path and error scenarios
- Include boundary value testing

I'll adapt to your project's testing framework (Jest, Vitest, Cypress, etc.) and follow established patterns.

## References

- @$AIWG_ROOT/agentic/code/addons/aiwg-utils/rules/research-before-decision.md — Examine existing test patterns before generating new tests; match project conventions
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/rules/anti-laziness.md — Never skip test cases or weaken assertions to make coverage targets easier to hit
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/rules/executable-feedback.md — Execute generated tests before returning; retry on failure with root cause analysis
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/skills/security-gate/SKILL.md — Security gate may require test evidence before approving a release

Related Skills

uat-generate

104
from jmagly/aiwg

Discover MCP tools and generate a phased UAT plan with agent-executable test specifications

Codex

setup-generate

104
from jmagly/aiwg

Generate a `setup.manifest.yaml` file for a project using the `setup.aiwg.io/v1`

Codex

hook-regenerate

104
from jmagly/aiwg

Rebuild AIWG hook files from currently installed framework manifests

Codex

generate-realization

104
from jmagly/aiwg

Generate behavioral specifications (Layer 3) from use cases and architecture documents using multi-agent orchestration

Codex

generate-factory

104
from jmagly/aiwg

Auto-generate test data factories from schemas, types, or models. Use when creating test data infrastructure, setting up fixtures, or reducing test setup boilerplate.

Codex

aiwg-regenerate

104
from jmagly/aiwg

Regenerate platform context file with preserved team directives

Codex

aiwg-regenerate-windsurfrules

104
from jmagly/aiwg

Regenerate .windsurfrules for Windsurf with preserved team directives

Codex

aiwg-regenerate-warp

104
from jmagly/aiwg

Regenerate WARP.md for Warp Terminal with preserved team directives

Codex

aiwg-regenerate-opencode

104
from jmagly/aiwg

Regenerate OpenCode context file (.opencode/context.md) with AIWG framework content

Codex

aiwg-regenerate-factory

104
from jmagly/aiwg

Regenerate AGENTS.md for Factory AI with hook file architecture

Codex

aiwg-regenerate-cursorrules

104
from jmagly/aiwg

Regenerate .cursorrules for Cursor with preserved team directives

Codex

aiwg-regenerate-copilot

104
from jmagly/aiwg

Regenerate copilot-instructions.md for GitHub Copilot with vendor-specific content only

Codex