Agent ops testing

From diegosouzapw/awesome-omni-skill · View interactive version

Agent ops testing is an AI agent skill from the GitHub repository diegosouzapw/awesome-omni-skill. Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.

How to use this skill

Skill file

Testing Workflow

Works with or without aoc CLI installed. Issue tracking can be done via direct file editing.

Purpose

Provide structured guidance for test design, execution, and analysis that goes beyond baseline capture. This skill covers test strategy during planning, incremental testing during implementation, and coverage analysis.

Test Commands (from constitution)

# Python (uv/pytest)
uv run pytest                           # Run all tests
uv run pytest tests/ -v                 # Verbose output
uv run pytest tests/ -m "not slow"      # Skip slow tests
uv run pytest tests/ --tb=short -q      # Quick summary
uv run pytest --cov=src --cov-report=html  # Coverage report

# TypeScript/Node (vitest/jest)
npm run test                            # Run all tests
npm run test -- --coverage              # With coverage

# .NET (dotnet test)
dotnet test                             # Run all tests
dotnet test --collect:"XPlat Code Coverage"  # With coverage

Issue Tracking (File-Based — Default)

| Operation | How to Do It |

|-----------|--------------|

| Create test issue | Append to .agent/issues/medium.md with type TEST |

| Create bug from failure | Append to .agent/issues/high.md with type BUG |

| Log test results | Edit issue's ### Log section in priority file |

Example: Post-Test Issue Creation (File-Based)

  1. Increment .agent/issues/.counter
  2. Append issue to appropriate priority file
  3. Add log entry with test run results

CLI Integration (when aoc is available)

When aoc CLI is detected in .agent/tools.json, these commands provide convenience shortcuts:

| Operation | Command |

|-----------|---------|

| Create test issue | aoc issues create --type TEST --title "Add tests for..." |

| Create bug from failure | aoc issues create --type BUG --priority high --title "Test failure: ..." |

| Log test results | aoc issues update <ID> --log "Tests: 45 pass, 2 fail" |

Test Isolation (MANDATORY)

Tests must NEVER create, modify, or delete files in the project folder.

Unit Tests

Integration Tests

Forbidden Patterns

# ❌ NEVER do this - pollutes project
Path(".agent/test.md").write_text("test")
Path("src/data/fixture.json").write_text("{}")
open("tests/output.log", "w").write("log")

# ✅ Always use tmp_path
def test_example(tmp_path):
    test_file = tmp_path / "test.md"
    test_file.write_text("test")  # Auto-cleaned

Review Checklist (before approving tests)

When to Use

Preconditions

Test Strategy Design

For New Features

  1. Identify test levels needed:
  1. Define test cases from requirements:
  1. Document in task/plan:

```markdown

## Test Strategy

```

For Bug Fixes

  1. Write failing test FIRST (reproduces the bug)
  2. Fix the bug
  3. Verify test passes
  4. Check for related regression tests needed

Test Execution

Incremental Testing (during implementation)

After each implementation step:

  1. Run the smallest reliable test subset covering changed code
  2. If tests fail: stop, diagnose, fix before proceeding
  3. Log test results in focus.md

Full Test Suite (end of implementation)

  1. Run complete test command from constitution
  2. Compare results to baseline
  3. Investigate ANY new failures (even in unrelated areas)

Test Command Patterns

# Run specific test file
<test-runner> path/to/test_file.py

# Run tests matching pattern
<test-runner> -k "test_feature_name"

# Run with coverage
<test-runner> --coverage

# Run failed tests only (re-run)
<test-runner> --failed

Actual commands must come from constitution.

Coverage Analysis

Confidence-Based Coverage Thresholds (MANDATORY)

Coverage requirements scale with confidence level:

| Confidence | Line Coverage | Branch Coverage | Enforcement |

|------------|---------------|-----------------|-------------|

| LOW | ≥90% on changed code | ≥85% on changed code | HARD — blocks completion |

| NORMAL | ≥80% on changed code | ≥70% on changed code | SOFT — warning if missed |

| HIGH | Tests pass | N/A | MINIMAL — existing tests only |

Rationale:

Enforcement:

🎯 COVERAGE CHECK — {CONFIDENCE} Confidence

Required: ≥{line_threshold}% line, ≥{branch_threshold}% branch
Actual:   {actual_line}% line, {actual_branch}% branch

[PASS] Coverage meets threshold
— OR —
[FAIL] Coverage below threshold — must add tests before completion

For LOW confidence failures:

When to Analyze Coverage

Coverage Metrics to Track

| Metric | Target | Notes |

|--------|--------|-------|

| Line coverage | ≥80% for new code | Not a hard rule; quality over quantity |

| Branch coverage | Critical paths covered | Focus on decision points |

| Uncovered lines | Document rationale | Some code legitimately untestable |

Coverage Gaps to Flag

Test Quality Checklist

Good Tests

Anti-Patterns to Avoid

Failure Investigation

When tests fail unexpectedly, invoke agent-ops-debugging:

  1. Apply systematic debugging process:
  1. Categorize the failure:

| Category | Evidence | Action |

|----------|----------|--------|

| Agent's change | Test passed in baseline | Fix the change |

| Pre-existing | Test failed in baseline | Document, create issue |

| Flaky | Intermittent, no code change | Fix test or document |

| Environment | Works elsewhere | Check constitution assumptions |

  1. Handoff decision:

```

🔍 Test failure analysis:

Next steps:

1. Fix and re-run (if agent's change)

2. Create issue and continue (if pre-existing)

3. Deep dive with /agent-debug (if unclear)

```

Output

After test activities, update:

Issue Discovery After Testing

After test analysis, invoke agent-ops-tasks discovery procedure:

1) Collect test-related findings:

2) Present to user:

```

📋 Test analysis found {N} items:

High:

Medium:

Low:

Create issues for these? [A]ll / [S]elect / [N]one

```

3) After creating issues:

```

Created {N} test-related issues. What's next?

1. Start fixing highest priority (BUG-0024@abc123 - flaky test)

2. Continue with current work

3. Review test coverage report

```

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.