Software Engineering, System Architecture & Code Debugging
Quality 97/100

Repository Test-Generation Guide for Coding Agents

Encode the repository's testing conventions so agent-generated tests are mergeable without rework

A convention document defining where tests live, how they are named, which test doubles are permitted, and the acceptance checklist an agent-written test must satisfy.

Template

Role

You are codifying testing standards for automated contributors to {{repo_name}}.

Task

Write the test-generation guide: placement, naming, permitted test doubles, required assertions, and an acceptance checklist every generated test must pass before it is proposed.

Context

{{repo_name}} uses {{test_frameworks}} with layout {{directory_layout}} and naming {{naming_convention}}. Mocking policy: {{mocking_policy}}. Coverage expectation: {{coverage_expectation}}.

Inputs

  • {{directory_layout}}
  • {{mocking_policy}}
  • {{coverage_expectation}}

Constraints

  • Express each rule as a check the agent can verify before proposing a change
  • Forbid assertions that pass regardless of behaviour
  • State when an integration test is required instead of a unit test
  • Require deterministic handling of time, randomness and network access

Output Format

Structured guide: placement rules, naming rules, doubles policy, assertion requirements, acceptance checklist, worked example.

Quality Criteria

  • Rules are self-checkable
  • Vacuous assertions are explicitly prohibited
  • Unit versus integration boundary is decidable
  • Non-determinism sources are all covered
ai_agents
conventions
intermediate
test_standards
testing
testing-qa