Skip to main content
prompt GP ChatGPT

16-testing — Claude Code prompt: Vitest setup for the claude-code rebuild

The 16-testing prompt wires up Vitest in the claude-code project and writes tests for shims, tools, commands and context. It fires when the leaked-and-rebuilt source has no test suite at all.

no license ★ 3,444 updated 2026-10-14

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/16-testing.md
Open on GitHub

What 16-testing does

The prompt walks through installing vitest and @types/node with bun add -d, writing a vitest.config.ts that aliases bun:bundle to src/shims/bun-bundle.ts, and a tests/setup.ts that loads src/shims/preload.js. It then lists the files to create: unit tests for bun-bundle.test.ts and macro.test.ts, smoke tests for tools.test.ts, commands.test.ts, context.test.ts and prompt.test.ts, integration tests for the API and MCP, and a build check on dist/cli.mjs.

The integration tests in tests/integration/api.test.ts and mcp.test.ts are meant to skip automatically when ANTHROPIC_API_KEY is absent and run the real checks once the key is set. An optional pre-commit hook chains bun run typecheck && bun run test, but only if the project already uses git hooks.

The whole plan assumes the claude-code sources already sit at /workspaces/claude-code and that functions like getTools(), getCommands(), getSystemContext() and getSystemPrompt() exist under those exact names, so it's tied to that specific reconstructed codebase rather than a generic project.

What it helps with

  • bootstrap Vitest in a project that ships with zero tests
  • check that feature() in bun-bundle returns correct flag values
  • write smoke tests that confirm tools, commands and the system prompt load
  • skip API integration tests when ANTHROPIC_API_KEY is missing
  • verify the built dist/cli.mjs runs and answers --version

Example prompts for the agent

  • Run the 16-testing prompt and set up Vitest in /workspaces/claude-code
  • Write the tools.test.ts and commands.test.ts smoke tests from the 16-testing plan
  • Add the MCP integration tests from part D of the 16-testing prompt

How to install 16-testing

Manually: put the files in place

.claude/commands/16-testing.md

Questions about 16-testing

How do I install 16-testing in Claude Code?

Save the file as .claude/commands/16-testing.md inside the project; it then shows up as a command in Claude Code.

What does 16-testing do?

It sets up a Vitest-based test suite and lays out unit, smoke, integration and build tests for the shims, tools, commands, context and system prompt in claude-code.

Does 16-testing need an API key for every test?

No. The API and MCP integration tests from part D skip automatically without ANTHROPIC_API_KEY and only run when the key is present.

Similar prompts

All prompts for Testing and QA →

From the same set17

The whole set →
00-overview The 00-overview prompt lays out a 16-step workflow for building a CLI, from Bun setup through production packaging and tests. Use it to split the work into separate chat sessions. GP ChatGPT ★ 3,444repo stars 04-fix-mcp-server 04-fix-mcp-server — a Claude prompt that runs the TypeScript build in mcp-server/, repairs compiler errors in server.ts and index.ts, then checks the server starts. GP ChatGPT ★ 3,444repo stars 08-command-system 08-command-system is a Claude Code prompt that audits and restores slash commands in a codebase. It addresses command registry repairs and broken imports. GP ChatGPT ★ 3,444repo stars 13-bridge-ide 13-bridge-ide is a Claude Code prompt for examining the Bridge connection to IDEs and checking CLI behavior with the feature disabled. It also covers activation notes and Chrome modes. GP ChatGPT ★ 3,444repo stars 15-production-bundle 15-production-bundle is a Claude Code prompt for configuring production bundling and packaging of CLI tools for Node.js 20+ and Bun 1.1+. GP ChatGPT ★ 3,444repo stars 11-mcp-integration The 11-mcp-integration prompt guides an investigation of Claude Code’s MCP client and server mode. Use it to inspect configuration and outline a client-to-server test. GP ChatGPT ★ 3,444repo stars 10-context-and-prompts 10-context-and-prompts takes the agent through the CLI prompt layer: reads the builder, repairs context collection on Linux, connects memory from CLAUDE.md. The last step is a script that prints the finished prompt. GP ChatGPT ★ 3,444repo stars 05-env-and-auth 05-env-and-auth sets up environment variables and tests API connectivity in claude-code workspaces. Creates a documented .env.example and builds a test script for Bun. GP ChatGPT ★ 3,444repo stars

Project sponsors

Companies that keep this analytics open