Agentplane testkit migration

From basilisk-labs/agentplane · View interactive version

Agentplane testkit migration is an AI agent skill from the GitHub repository basilisk-labs/agentplane. Use when migrating Agentplane tests to @agentplane/testkit, replacing local test helpers, fixing testkit export/build failures, splitting large CLI/backend suites, or diagnosing missing testkit dist exports in package builds.

How to use this skill

Skill file

Agentplane Testkit Migration

Use This Skill When

Source Of Truth

Prefer exported testkit surfaces over deep imports or local helper copies. Before adding a helper, search for an existing one:

rg -n "tempRepo|mockTaskBackend|mockPrApi|mockConfig|describeWhen|runCliSilent|installRunCliIntegrationHarness" packages/testkit packages/agentplane/src

Migration Steps

  1. Identify the test family: CLI PR flow, task lifecycle, release/upgrade, runner, recipes, Redmine/backend, or scripts.
  2. Replace local setup with canonical testkit helpers:
  1. Keep compatibility exports in packages/agentplane/src/testing/index.ts only as a bridge. The canonical implementation belongs in packages/testkit.
  2. If agentplane build imports from ../../../testkit/dist/*, ensure @agentplane/testkit is built before agentplane.
  3. Remove obsolete shims only after rg proves no imports remain.

Build-Safe Export Checklist

When adding or moving a helper:

  1. Export it from the package-local module where it is implemented.
  2. Export it from the public testkit barrel.
  3. Export compatibility aliases only where existing agentplane tests still depend on them.
  4. Run both focused tests and package builds.

Common failure:

Module "../testing/index.js" has no exported member ...
Cannot find module "../../../testkit/dist/index.js"

Interpretation: the helper was migrated without a complete export chain, or build order skipped testkit.

Verification

Use focused checks first, then the smallest relevant package build:

bun run --filter=@agentplane/testkit build
bun run --filter=agentplane build
bunx vitest run <focused-test-files>

For known slow PR-flow suites, prefer the recorded single-worker route instead of broad retries.

Boundaries

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.