# Testing conventions

> Testing conventions is an open-source agent skill for developer tools. Guides an agent through pytest, async fixtures and security-regression tests for FastAPI. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ajyadav013/claude-kit/tree/main/providers/codex/claude-kit/skills/testing-conventions
- **Repository:** https://github.com/ajyadav013/claude-kit
- **GitHub stars:** 13
- **License:** MIT
- **Skill name:** testing-conventions
- **Collection:** https://github.com/ajyadav013/claude-kit
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill gives the agent a set of testing conventions drawn from backend and frontend services. For Python and FastAPI projects it covers session-scoped event loops, separate test databases and Redis instances, autouse migration and cleanup fixtures, httpx ASGI clients, factory-based test data, and mocking Kafka, Temporal and HTTP dependencies with AsyncMock. For React it covers Vitest setup with jsdom, coverage thresholds and test discovery patterns.

The skill also describes a CI layer: path-filtered workflows, Postgres and Redis service containers with health checks, job dependencies, coverage gating, artifact uploads, Codecov reporting, and contract and end-to-end test jobs. It adds guidance on consumer-driven contract testing across services and a security-regression section covering negative authorization, cross-tenant isolation, IDOR, login lockout, gateway header trust and input rejection, run as a dedicated pytest marker gate.

The agent is expected to work with Python and pytest for backend code and Vitest for frontend code. It also includes a coverage audit template and a recommended baseline for repositories with thin test coverage. Reference files hold longer examples for fixtures, GitHub Actions and security tests.

## When your agent uses it

> Testing conventions for Python/FastAPI and React — pytest, async fixtures, AsyncMock, Vitest, and security-regression tests (authz, tenant isolation). Do NOT use for the TDD loop (use test-driven-development).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ajyadav013/claude-kit/tree/HEAD/providers/codex/claude-kit/skills/testing-conventions)
- [License: MIT](https://github.com/ajyadav013/claude-kit/tree/HEAD/providers/codex/claude-kit/skills/testing-conventions)

## Features

- **Async pytest fixtures:** Patterns for session event loops, function-scoped DAO fixtures and async HTTP clients in FastAPI projects.
- **Mocking external services:** AsyncMock and patch recipes for Kafka producers, Temporal clients and HTTP publish functions.
- **Test database isolation:** Environment overrides, migration runs and autouse cleanup that flush Redis and truncate tables.
- **Vitest frontend setup:** Vitest configuration with jsdom, setup files, test discovery and coverage thresholds for React code.
- **Security-regression tests:** Negative authorization, cross-tenant isolation, IDOR, lockout and trust-boundary tests run as a dedicated gate.
- **CI test orchestration:** GitHub Actions patterns for service health checks, coverage gating, artifacts and contract test jobs.

## Good for

- Set up pytest conftest with async fixtures for a FastAPI service
- Write DAO and service layer tests with mocked Kafka or Temporal clients
- Add cross-tenant and role-based access tests to a FastAPI API
- Configure Vitest with jsdom and coverage thresholds for a React app
- Build a baseline test suite for a repository with little coverage
- Create a GitHub Actions workflow that runs backend tests against Postgres and Redis

## Install

### Claude Code

This skill ships in the `claude-kit` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ajyadav013/claude-kit
/plugin install claude-kit@claude-kit
```

Or copy only this skill to `~/.claude/skills/testing-conventions`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/testing-conventions &&
cp -R "$tmp/providers/codex/claude-kit/skills/testing-conventions" ~/.claude/skills/testing-conventions &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/testing-conventions` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/testing-conventions` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/testing-conventions &&
cp -R "$tmp/providers/codex/claude-kit/skills/testing-conventions" ~/.agents/skills/testing-conventions &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/testing-conventions` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/testing-conventions` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/testing-conventions &&
cp -R "$tmp/providers/codex/claude-kit/skills/testing-conventions" ~/.cursor/skills/testing-conventions &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/testing-conventions` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ajyadav013/claude-kit.git --path providers/codex/claude-kit/skills/testing-conventions
```

Or copy the folder to `~/.gemini/skills/testing-conventions` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/testing-conventions`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/testing-conventions &&
cp -R "$tmp/providers/codex/claude-kit/skills/testing-conventions" ~/.copilot/skills/testing-conventions &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/testing-conventions` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git
```

Then copy `claude-kit/providers/codex/claude-kit/skills/testing-conventions` into your agent's skills folder as `testing-conventions`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Which languages and frameworks does Testing conventions cover?

It covers Python with pytest and FastAPI for backend code, and React with Vitest for frontend code.

### Should I use Testing conventions for test-driven development?

No. The skill says not to use it for the TDD loop, which is handled by a separate test-driven-development skill.

### Does Testing conventions include scripts or tools the agent runs?

No scripts are included. It consists of SKILL.md instructions and reference documents.

### What does the security section check?

It checks that protected routes return 401 without auth and 403 for the wrong role, that cross-tenant requests return 404, and that forged gateway signatures are rejected.

### How do I install Testing conventions in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/testing-conventions to use it in all your projects, or to .claude/skills/testing-conventions in one project. Or install the claude-kit plugin, which includes it: /plugin marketplace add ajyadav013/claude-kit, then /plugin install claude-kit@claude-kit.

### Does Testing conventions run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Testing conventions?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Testing conventions?

The closest alternatives to Testing conventions are Pytest skill, Python backend, Vitest skill, Async python patterns and React frontend.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Pytest skill](https://ai-powered.com/skills/pytest-skill): Pytest skill is an open-source agent skill for developer tools.
- [Python backend](https://ai-powered.com/skills/python-backend): Python backend is an open-source agent skill for developer tools.
- [Vitest skill](https://ai-powered.com/skills/vitest-skill): Vitest skill is an open-source agent skill for developer tools.
- [Async python patterns](https://ai-powered.com/skills/async-python-patterns): Async python patterns is an open-source agent skill for developer tools.
- [React frontend](https://ai-powered.com/skills/react-frontend): React frontend is an open-source agent skill for developer tools.
- [Backend repo architecture](https://ai-powered.com/skills/backend-repo-architecture): Backend repo architecture is an open-source agent skill for developer tools.
- [API integration](https://ai-powered.com/skills/api-integration-ajyadav013): API integration is an open-source agent skill for developer tools.
- [Unittest skill](https://ai-powered.com/skills/unittest-skill): Unittest skill is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/testing-conventions
