agentleFS
Data-WiseData-Wise/craft/skills/testing/test-generator/SKILL.md

test-generator

Skill4 starsChanged 12 days agoMITView on GitHub

This skill should be used when the user asks to "generate tests", "create CLI tests", "add dogfooding tests", "create plugin validation tests", or needs automated and interactive test suites for a project. Generates dogfooding test suites (automated + interactive) for any project type.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use refactor-advisor, log-analyzer and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • aidankaokaoSkill

    refactor-advisor

    分析程式碼的重構機會,給出有優先順序的建議,但不直接改寫程式碼。當使用者說「這段程式碼怎麼改比較好」、「幫我分析重構方向」、「這樣寫有什麼問題」、「refactor」、「技術債」時觸發。

    Also in 3 projects that use this

  • nek1987Skill

    log-analyzer

    Parse and analyze application logs to identify errors, patterns, and insights.

    Also in 3 projects that use this

  • JeffallanSkill

    security-reviewer

    Identifies security vulnerabilities, generates structured audit reports with severity ratings, and provides actionable remediation guidance. Use when conducting security audits, reviewing code for vulnerabilities, or analyzing infrastructure security. Invoke for SAST scans, penetration testing, DevSecOps practices, cloud security reviews, dependency audits, secrets scanning, or compliance checks. Produces vulnerability reports, prioritized recommendations, and compliance checklists.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 12
  2. Distinctive:

    Add project-specific test cases

    line 177

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Test Generator Skill

Generates dogfooding test suites (automated + interactive) for any project type.

When to Use

Use this skill when:

  • Setting up CLI tests for a new project
  • Creating plugin validation tests
  • Generating interactive QA test suites
  • Need both automated and manual test coverage
  • Want consistent test patterns across projects

Capabilities

Project Type Detection

Automatically detects project type and generates appropriate tests:

Project TypeDetectionTest Focus
CLI Toolpyproject.toml + CLI entryCommands, subcommands, exit codes, help
Claude Plugin.claude-plugin/plugin.jsonStructure, commands, skills, agents
Python Librarypyproject.toml (no CLI)Module imports, API surface
Node Packagepackage.json + binCLI commands, npm scripts
R PackageDESCRIPTIONPackage structure, exports
Shell Scripts*.sh filesScript execution, options

Test Suite Generation

Generates two complementary test suites:

1. Automated Tests (automated-tests.sh)

  • Non-interactive, CI-ready
  • Exit code validation
  • Output pattern matching
  • Structure validation
  • Runs in < 60 seconds

2. Interactive Tests (interactive-tests.sh)

  • Human-guided QA
  • Expected vs actual comparison
  • Single-key responses (y/n/q)
  • Logging to tests/cli/logs/
  • Visual output validation

Test Categories by Project Type

CLI Tools:

  • Smoke tests (version, help, aliases)
  • Core commands (each subcommand)
  • Error handling (invalid commands)
  • Exit codes (success/failure)
  • Help accessibility

Claude Plugins:

  • Plugin structure (plugin.json)
  • Directory structure (commands/, skills/, agents/)
  • File counts and validity
  • Markdown syntax validation
  • Cross-reference checks

Libraries:

  • Import validation
  • API surface coverage
  • Module structure
  • Documentation presence

Usage

Basic Generation

Generate CLI tests for this project

With Options

Generate dogfooding tests:
- Project: ~/projects/my-tool
- Include interactive tests
- Add CI integration

Specific Project Types

Create plugin validation tests for craft
Create CLI tests for aiterm
Create package tests for my-r-package

Output Structure

tests/
└── cli/
    ├── README.md              # Test documentation
    ├── automated-tests.sh     # CI-ready automated tests
    ├── interactive-tests.sh   # Human-guided QA tests
    └── logs/                  # Test execution logs
        └── interactive-test-YYYYMMDD-HHMMSS.log

Test Script Features

Automated Tests

# Colors and formatting
✅ PASS: Test description
❌ FAIL: Test description → Error details
⏭️  SKIP: Test description

# Sections
━━━ Section Name ━━━

# Summary
═══════════════════════════
  RESULTS
═══════════════════════════
  Passed:  15
  Failed:  0
  Total:   15

✅ ALL TESTS PASSED

Interactive Tests

TEST 1/15: Version Check
  Command: tool --version

EXPECTED: Version string (e.g., 'tool 1.0.0')

ACTUAL:
tool version 1.0.0

[y=pass, n=fail, q=quit]

Integration

Works with:

  • /craft:test - Execute generated tests
  • /craft:ci:local - Add to CI pipeline
  • test-strategist skill - Test strategy guidance

Example Prompts

"Generate CLI tests for my Python tool"
"Create plugin validation tests"
"Add dogfooding tests like aiterm has"
"Set up automated + interactive tests for this project"
"Generate tests and add to GitHub Actions"

Customization

Tests can be customized after generation:

  • Add project-specific test cases
  • Modify expected outputs
  • Adjust test categories
  • Add environment-specific tests

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.