← ClaudeAtlas

agentplane-testkit-migrationlisted

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.
basilisk-labs/agentplane · ★ 54 · AI & Automation · score 83
Install: claude install-skill basilisk-labs/agentplane
# Agentplane Testkit Migration ## Use This Skill When - A task mentions `@agentplane/testkit`, `run-cli.test-helpers`, shared fixtures, Vitest wrappers, or test helper duplication. - CI/build fails because `packages/agentplane/src/testing/*` cannot import `../../../testkit/dist/*`. - A large test file is being split into scenario-focused suites. - Tests use local helper clones that should move behind the canonical testkit surface. ## Source Of Truth Prefer exported testkit surfaces over deep imports or local helper copies. Before adding a helper, search for an existing one: ```bash 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: - repository setup: `tempRepo`, git helpers, config writers - backend setup: mock task backend helpers - GitHub PR setup: mock PR API helpers - suite gating: `describeWhenEnvPresent`, `describeWhenNotHook`, `describeCritical` 3. Keep compatibility exports in `packages/agentplane/src/testing/index.ts` only as a bridge. The canonical implementation belongs in `packages/testkit`. 4. If `agentplane build` imports from `../../../testkit/dist/*`, ensure `@agentplane/testkit` is built before `agentplane`. 5. Remove obsolete shims only after