Orchestrate:tests

From kagenti/kagenti · View interactive version

Orchestrate:tests is an AI agent skill from the GitHub repository kagenti/kagenti. Add test infrastructure and initial test coverage to a target repo

How to use this skill

Skill file

flowchart TD
    START(["/orchestrate:tests"]) --> READ["Read plan"]:::orch
    READ --> DETECT["Detect test framework"]:::orch
    DETECT --> CONFIG["Create test config"]:::orch
    CONFIG --> CRITICAL["Identify critical paths"]:::orch
    CRITICAL --> WRITE["Write initial tests"]:::orch
    WRITE --> BRANCH["Create branch"]:::orch
    BRANCH --> SIZE{Under 700 lines?}
    SIZE -->|Yes| PR["Commit + open PR"]:::orch
    SIZE -->|No| SPLIT["Split into sub-PRs"]:::orch
    SPLIT --> PR
    PR --> DONE([Phase complete])

    classDef orch fill:#FF9800,stroke:#333,color:white

Follow this diagram as the workflow.

Orchestrate: Tests

Add test infrastructure and initial test coverage. This is Phase 3 and

produces PR #2. Tests come before CI and security — good test coverage is

a safety net for the code refactoring that security/quality fixes require.

When to Use

Prerequisites

Step 1: Detect Test Framework

| Marker | Language | Framework | Assertion |

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

| pyproject.toml | Python | pytest | built-in assert |

| go.mod | Go | testing (stdlib) | testify |

| package.json | Node | jest or vitest | built-in expect |

| requirements.yml | Ansible | molecule | testinfra |

Check existing tests:

find .repos/<target> -type f \( -name "test_*.py" -o -name "*_test.go" -o -name "*.test.*" \) 2>/dev/null

Step 2: Create Test Configuration

Python

Go

Node

Ansible

Step 3: Identify Critical Paths

From the scan report, find highest-impact areas:

  1. API endpoints — HTTP handlers, REST routes
  2. Core logic — main algorithms, data transformations
  3. Integration points — database, external APIs
  4. Config parsing — loading, validation, defaults
  5. Error handling — paths affecting users or data

Prioritize smoke tests across areas over exhaustive coverage of one area.

Step 4: Write Initial Tests

Strategy

Test naming

| Language | Convention | Example |

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

| Python | test_<what>_<condition> | test_create_user_returns_201 |

| Go | Test<What><Condition> | TestCreateUserReturns201 |

| Node | describe/it blocks | it('returns 201 when creating user') |

Test structure (AAA)

  1. Arrange — set up test data
  2. Act — call function under test
  3. Assert — verify with specific assertions

Step 5: Branch and PR

git -C .repos/<target> checkout -b orchestrate/tests

PR size check

git -C .repos/<target> diff --stat | tail -1

If over 700 lines, split: framework setup in PR #3a, tests in PR #3b.

Skills to push alongside

Commit and push

git -C .repos/<target> add -A
git -C .repos/<target> commit -s -m "feat: add test infrastructure and initial test coverage"
git -C .repos/<target> push -u origin orchestrate/tests

Update Phase Status

Set tests to complete in phase-status.md.

Related Skills

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.