Skip to content

Generate a CLAUDE.md File for a QA Project with AI

Updated 2026-06-08·intermediate·AI Agent Workflows

Reads a description of your QA project (framework, language, conventions, CI setup) and returns a ready-to-commit `CLAUDE.md` covering project structure, allowed bash commands, test execution workflow, code conventions, and 'do/do not' rules tailored to QA work — making Claude Code dramatically more useful in your repo.

When to use it

  • Onboarding Claude Code into an existing QA codebase.
  • Standardizing AI-assistant context across QA repos in an org.
  • Documenting conventions for engineers (CLAUDE.md is also a human-readable contributor guide).
  • Migrating from .cursorrules or similar to CLAUDE.md.

The prompt

XML-tagged — best for Claude 4.x

<role>
You are a Claude Code power user with months of experience configuring CLAUDE.md for QA projects. You know what works (specific test commands, framework conventions, explicit Don'ts) and what fails (vague aspirations, generic platitudes).
</role>

<context>
A good CLAUDE.md for a QA project includes:
1. **Project orientation** — what this repo is, primary language, framework
2. **Workspace structure** — where tests live, where source lives, monorepo layout
3. **Test commands** — exact commands to run tests at every level (unit / integration / E2E)
4. **Conventions** — naming, file layout, locator strategy, assertion style
5. **Allowed bash commands** — commands the agent can run autonomously
6. **Don'ts** — explicit anti-patterns to avoid (no `it.only`, no `waitForTimeout`, no committed test artifacts)
7. **Test data** — where fixtures live, factory pattern, secret handling
8. **Debugging** — how to view traces, screenshots, logs
9. **Linting and pre-commit** — how lint/typecheck is run; lint-fix commands

The file becomes part of every Claude Code invocation; verbose pays off, vague doesn't.
</context>

<task>
For the QA project described below, generate a CLAUDE.md with these sections:
1. Project orientation (2-3 sentences)
2. Workspace structure
3. Test commands (per type)
4. Conventions
5. Allowed bash commands (whitelist)
6. Don'ts (explicit anti-patterns)
7. Test data + secrets handling
8. Debugging + tracing
9. Linting + pre-commit
</task>

<input>
Project framework: {framework}
Language and stack: {stack}
Monorepo / single-repo: {repo_type}
Test conventions (naming, locator priority, assertion style): {conventions}
CI / commands (test, lint, build): {ci}
Team-specific Don'ts (e.g., no inline secrets): {donts}
</input>

<constraints>
- Test commands are EXACT shell strings, not "run the tests".
- Allowed bash commands are an explicit whitelist (the agent uses these autonomously).
- Don'ts are SPECIFIC anti-patterns ("no `page.waitForTimeout`", not "no flaky tests").
- File should be 80-150 lines; verbose enough to be useful, not so long it dilutes.
- Use Markdown headings (H2 sections, H3 subsections).
</constraints>

<output_format>
A complete CLAUDE.md as a Markdown code block, followed by a brief "Customization notes" paragraph on what to tweak per repo (e.g., test runner version, branch naming).
</output_format>

Before writing, identify which Don'ts will save the agent (and you) the most pain.

Example

Common pitfalls

  • Generic CLAUDE.md ('write clean code') — adds no signal. Force specific commands and Don'ts.
  • Allowed bash list missing or too broad — agent can't act autonomously, OR it can do too much.
  • Don'ts get listed as wishes ('avoid technical debt') instead of testable rules ('no \`waitForTimeout\`'). Demand specificity.
  • File grows past 200 lines; verbosity dilutes the most important rules. Stay 80-150 lines.

Tips

  • Test the CLAUDE.md by running Claude Code on a small task; if the agent makes a common mistake, add a Don't.
  • Re-tune monthly; conventions drift, new anti-patterns emerge.
  • Keep CLAUDE.md and your CONTRIBUTING.md in sync — most rules apply to humans too.
  • Pair with `cursorrules-qa` if your team uses Cursor IDE alongside Claude Code.

FAQ

CLAUDE.md is for Claude Code (Anthropic's CLI/IDE agent). .cursorrules is for Cursor IDE. Format is similar; the file loaded depends on the tool. Most teams maintain both with similar content.

Related prompts