Skip to main content

/testchimp init — Bootstrap your repo

Init run once after you install the TestChimp skill. It establishes the whole QA infrastructure for the project so later /testchimp test and /testchimp audit runs are predictable: the agent knows where plans and tests live, how CI runs Playwright, how secrets reach the reporter and MCP, and how seed data, world-states, TrueCoverage, and environments fit together.

At a high level, init covers:

  • Environment provisioning strategy for pre–PR-merge E2E authoring (what runs where: staging, previews, ephemeral full stack, and how BASE_URL is set in CI).
  • Seeding / teardown — Prefer idempotent backend endpoints (or jobs) for creating and resetting test data; if they do not exist yet, init plans creating them with clear non-production guards.
  • World-state scripts — Reusable postures (*.world.js) so the same known state can be loaded at author time and execution time, cutting flakiness from drift.
  • Test folder scaffold — Playwright layout (for example setupe2eapi projects) under the mapped tests root.
  • TrueCoverage — When you opt in, wire user-event emits (testchimp-rum-js and related) so Playwright runs and production traffic both feed behaviour-aligned coverage in TestChimp.
  • CI — Reporter, project order, and secrets so playwright-testchimp runs on every meaningful change.

Install the skill

  • Clone testchimp-skills into your agent’s skills directory (for example ~/.cursor/skills/testchimp or .cursor/skills/testchimp in the repo) so SKILL.md is loaded and .git allows git pull updates.
  • Restart the IDE or agent host if the skill does not appear immediately.

The skill expects Node.js and Playwright 1.59+ for SmartTests. For API and analytics, set TESTCHIMP_API_KEY (project key) where the MCP server runs—typically the project-scoped MCP config (not only a local .env), since keys are per TestChimp project.

Connect git and map two folders

TestChimp always thinks in terms of plans and tests on the platform side. In your repository, those can be any two directories (for example docs/plans and qa/ui_tests).

  1. In TestChimp → your project → Project SettingsIntegrationsGit, connect the repo.
  2. Map one folder to plans and one folder to tests.
  3. From TestChimp, sync so the scaffold and marker files land in git:
    • .testchimp-plans at the plans root
    • .testchimp-tests at the SmartTests root

Until both markers exist and both mappings are configured, sync and coverage behaviour may be incomplete. If markers are missing, finish the Git integration in the product first; the agent should not infer roots from folder names alone.

Dependencies and reporter

From the directory that contains .testchimp-tests:

  • Install playwright-testchimp (execution reporting to TestChimp, SmartTest / natural-language step execution, TrueCoverage correlation in runs).
  • Install testchimp-mcp-client as a dev dependency where you keep tooling, and register it in MCP config with TESTCHIMP_API_KEY.

Copy or merge the skill’s template playwright.config.js so the reporter is enabled, traces/screenshots are sensible for failures, and BASE_URL (or your convention) resolves for CI and local runs.

Optional: TrueCoverage (application instrumentation)

TrueCoverage ties real user journeys to test and automation coverage. During init, the agent checks whether testchimp-rum-js is already in the app and may ask whether to enable instrumentation now, defer, or skip—persisting that choice for later /testchimp setup truecoverage flows. When enabled, init wires emit helpers, environment tags, and keeps plan docs under plans/events/ aligned with what you measure.

Test harness: projects, seeding, world-states

Init establishes a three-project Playwright layout under the tests root:

ProjectRole
setupRuns first; global seed / teardown and shared fixtures.
e2ePrimarily UI SmartTests (browser; may call APIs for setup).
apiPrimarily API tests.

Seed endpoints — Prefer idempotent backend endpoints (or jobs) for creating and resetting test data; if they do not exist yet, init plans creating them with clear non-production guards. world-state scripts (*.world.js) describe reusable data posture; ensureWorldState runs before browser steps when a test depends on that posture. See World states on the Test flow page for how that connects to /testchimp test.

Environments: persistent vs ephemeral

Init records an environment strategy in plans/knowledge/ai-test-instructions.md (for example default persistent staging vs ephemeral full stack, Bunnyshell / EaaS vs branch preview URLs, how CI sets BASE_URL). That file is what later /testchimp test and /testchimp audit runs reuse so decisions stay consistent.

CI

Configure CI to run Playwright from the tests root (the path with .testchimp-tests) with TESTCHIMP_API_KEY set. Use a preview or deployed URL as BASE_URL when running against a branch build. Exclude plan-only sync PRs from “must pass automation” rules if your team uses titles such as TestChimp Platform Sync [Plans].

End state

After init, you should have: Git + two mappings, markers, reporter + MCP, Playwright projects wired in order, seed strategy (or explicit follow-ups), documented environment strategy, optional TrueCoverage path, and a skill marker so the agent knows init completed.

Next: when implementation for a PR is ready, use /testchimp test. For ongoing gap closure, use /testchimp audit.