Skip to content

kznr02/OpenTester-Skills

Repository files navigation

OpenTester Skill

AI-powered test automation for code changes using OpenTester MCP Server.

Supported Platforms

  • Claude Code (CLI) - Via SKILL.md + HTTP MCP
  • Claude Desktop - Via STDIO MCP
  • Cursor (IDE) - Via .cursor/rules/opentester.mdc
  • Windsurf (IDE) - Via .windsurf/config.json
  • Generic MCP (Any MCP-compatible tool)

Features

  • AI-Generated Tests: Agent analyzes code and generates DSL test cases
  • DSL Validation: Real-time validation with helpful error messages
  • Test Execution: Run tests via MCP tools
  • Results Analysis: Automatic failure analysis and suggestions
  • Control Flow: Support for conditional steps in tests
  • Multiple Examples: API, CLI, and TUI test examples

Prerequisites

Install OpenTester via PyPI:

pip install opentester

Or download standalone executable from GitHub Releases.

Installation

Quick Install

npx skills add https://github.com/kznr02/OpenTester-Skills --skill opentester

Manual Installation

Claude Code (HTTP MCP)

  1. Install skill files:

    mkdir -p ~/.claude/skills/opentester
    cp SKILL.md ~/.claude/skills/opentester/
    cp -r examples/ ~/.claude/skills/opentester/
  2. Start OpenTester server:

    opentester start
  3. Configure MCP in .claude/settings.json:

    {
      "mcpServers": {
        "opentester": {
          "url": "http://localhost:8001/mcp"
        }
      }
    }

Claude Desktop (STDIO MCP)

Add to settings.json:

Windows: %APPDATA%\Claude\settings.json macOS: ~/Library/Application Support/Claude/settings.json Linux: ~/.config/Claude/settings.json

{
  "mcpServers": {
    "opentester": {
      "command": "opentester",
      "args": ["mcp"]
    }
  }
}

Cursor

  1. Copy .cursor/rules/opentester.mdc to ~/.cursor/rules/

  2. Configure MCP in Cursor Settings > MCP:

    {
      "mcpServers": {
        "opentester": {
          "url": "http://localhost:8001/mcp"
        }
      }
    }

Windsurf

Merge .windsurf/config.json into ~/.windsurf/config.json:

{
  "mcp": {
    "servers": {
      "opentester": {
        "url": "http://localhost:8001/mcp"
      }
    }
  }
}

Usage

Commands

Command Description
/test or /t Create and run tests for current changes
/test-quick Quick test without PRD
/test-with-prd Comprehensive tests using PRD
run tests Execute existing tests
validate dsl Check test syntax
list projects Show all test projects
delete project <id> Delete a project and all its test cases
delete case <id> Delete a specific test case
list templates Show all DSL templates
use template <id> Create test from a template
save template Save test case as template

Example Workflow

# Make some code changes
git diff

# Start OpenTester (in another terminal)
opentester start

# Ask AI to create tests
/test user authentication

# AI will:
# 1. Call opentester.listProjects
# 2. Analyze code changes
# 3. Generate DSL test cases
# 4. Validate and save them
# 5. Execute the tests
# 6. Report results

# Run tests again later
run tests

File Structure

opentester-skills/
├── SKILL.md                  # Claude Code skill definition
├── setup.json                # Setup configuration
├── EXAMPLES.md               # Usage examples
├── REFERENCE.md              # DSL reference
├── examples/                 # Example test files
│   ├── cli_test.yaml
│   ├── api_test.yaml
│   └── control_flow.yaml
├── .cursor/
│   └── rules/
│       └── opentester.mdc    # Cursor rules
├── .windsurf/
│   └── config.json           # Windsurf MCP config
├── install.ps1               # Windows installer
└── install.sh                # macOS/Linux installer

DSL Quick Reference

version: "1.0"
meta:
  name: "Test Name"
  description: "What this test verifies"

steps:
  - name: "Execute command"
    action: exec
    command: echo "Hello World"

  - name: "Verify output"
    action: assert
    assertion:
      type: stdout_contains
      expected: "Hello World"

See REFERENCE.md for complete DSL documentation.

MCP Tools

  • listProjects - List all test projects
  • getProject - Get project details with test cases
  • createProject - Create a new project
  • deleteProject - Delete a project
  • validateDSL - Validate DSL YAML syntax
  • saveCase - Save a test case
  • deleteCase - Delete a test case
  • runCase - Execute a single test case
  • runProject - Execute all cases in a project
  • stopExecution - Stop a running execution
  • getExecutionStatus - Get execution status
  • getExecutionLog - Get detailed execution log
  • listTemplates - List all templates
  • getTemplate - Get template details
  • createTemplate - Create a new template
  • updateTemplate - Update a template
  • deleteTemplate - Delete a template
  • instantiateTemplate - Create test from template
  • createTemplateFromCase - Convert case to template

Ports

Troubleshooting

Skill not showing up

  1. Check skill is in correct directory
  2. Verify SKILL.md has correct frontmatter
  3. Restart AI coding tool

MCP connection failed

  1. Verify OpenTester is running:
    opentester status
  2. Start OpenTester:
    opentester start
  3. Check MCP configuration
  4. Restart AI coding tool

DSL Validation Errors

Common errors:

  • YAML syntax errors (indentation)
  • Invalid action types
  • Missing required fields

License

MIT

About

Skills for OpenTester

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors