Test authoring

From c9r-io/orchestrator · View interactive version

Test authoring is an AI agent skill from the GitHub repository c9r-io/orchestrator. Create or improve unit tests and Playwright E2E tests for newly implemented features, and close coverage gaps based on project requirements. Use when the user asks to write/add/complete unit tests, add E2E tests, increase test coverage, or improve existing tests.

How to use this skill

Skill file

Test Authoring

Write tests for newly implemented functionality, or improve an existing project's test suite by using coverage data to identify gaps.

In this repository, the Rust workspace spans core/ and crates/, while the React/Vite frontend and Playwright suite live under gui/. For other targets, discover their test layout before selecting commands.

Decide Scope

Confirm which of these the user wants:

If the user says "new feature implemented", treat the changed code as the test target (optimize for verifying behavior, not lines).

Discover Project Test Tooling

From repo root, identify:

Prefer scripts in gui/package.json and commands declared by the root Cargo workspace over inventing new ones.

Unit Tests (Backend)

Rust (core/)

Principles:

Placement:

Workflow:

  1. Identify behavior added/changed (inputs, outputs, error cases).
  2. Add tests for:
  1. Run backend tests (project-specific):

Coverage (if requested):

Unit Tests (Frontend)

If gui/ exists, prefer:

Run commands (project-specific examples):

E2E Tests (Playwright)

Goals:

Recommended split (if applicable):

Workflow:

  1. Determine target base URL(s) from the project (often http://localhost:<portal_port>).
  2. Identify the minimal scenario that proves the feature works.
  3. Implement Playwright tests using stable selectors:
  1. For full-stack E2E, always reset first:
cd gui
npx playwright test

If the project already has scripts like test:e2e:full:reset, use them instead.

Coverage-Driven Improvement (Completing Unit/E2E Tests)

When asked to "complete tests" or "increase coverage":

  1. Run the project's existing coverage command(s).
  2. Identify the highest-value uncovered behavior:
  1. Add tests that assert behavior (not implementation details).
  2. Re-run:

If the project has explicit coverage targets, follow them. Otherwise, treat coverage as a signal, not a goal.

Output Artifacts and Iteration Loop

If a change is tied to an approved plan:

Guardrails

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.