gen-tests

Generate project-convention-compliant tests for OhMyCode modules and files.

131|4|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/AlphaLab-USTC/OhMyCode --skill gen-tests-alphalab-ustc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gen-tests
Source: https://github.com/AlphaLab-USTC/OhMyCode/tree/main/.claude/skills/gen-tests
Command: npx skills add https://github.com/AlphaLab-USTC/OhMyCode --skill gen-tests-alphalab-ustc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create high-quality, project-convention-compliant tests for OhMyCode modules and files without guessing the repository’s testing patterns.

Core Features & Use Cases

  • Target Resolution: Maps a module or path argument to the correct source file so tests are written against the right code.
  • Test Pattern Matching: Reads existing fixtures and nearby tests to match the repository’s conventions and coverage style.
  • Coverage Planning: Designs happy-path, failure, and edge-case scenarios for tools, core modules, and providers.
  • Verification Workflow: Instructs you to run the generated tests immediately so failures can be fixed before handoff.
  • Use Case: Add tests for a provider, tool, or core loop file and keep them aligned with the project’s fixtures, async patterns, and file layout.

Quick Start

Ask the Skill to generate tests for a specific OhMyCode module or file, then run the resulting tests to verify they pass.

Frequently Asked Questions about gen-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate pytest tests that match my repository's existing conventions?

To generate pytest tests that match your conventions, this Skill reads existing fixtures and nearby tests to align coverage style, then produces happy-path, failure, and edge-case scenarios for your modules.

How do I write async-safe tests with isolated file I/O for my core modules?

Writing async-safe tests with isolated file I/O requires fixture-aware design; this Skill automatically applies these execution constraints when planning coverage for core modules and tools.

What is the best way to add test coverage for OhMyCode providers and tools?

The best way to add coverage for OhMyCode providers and tools is resolving the target module path, matching nearby test patterns, and generating convention-compliant scenarios for immediate verification.

Can I automatically verify generated tests against my repository workflow before handoff?

Yes, you can verify generated tests automatically; this Skill instructs you to run the resulting tests through the repository workflow immediately so failures can be fixed before handoff.

Does this test generation approach handle edge cases and failure paths for async fixtures?

Yes, this approach handles edge cases and failure paths for async fixtures by designing comprehensive coverage scenarios that target tools, core modules, and providers within the project.

Why do my generated tests fail to find the correct source files in my project layout?

Generated tests fail to find source files due to incorrect target resolution; this Skill maps module arguments to the correct source files so tests execute against the right code.