CI playbook
Contract Test Generator
Generates a passing contract test for every new endpoint added in a PR and opens a follow-up PR with the tests.
When a pull request adds a new endpoint, generates a contract test for it covering request shape, success response shape and status, documented error responses, authentication requirement, and the validation boundaries implied by the DTO, then opens a follow-up PR with the test. Runs the generated test first and only proposes it if it passes.
- Identifier
contract-test-generator- Version
- 1.0.0
- Steps
- 4
- Triggers
- 1
- contract
- tests
- api
- openapi
- quality
- automated
When it runs
pull_request.opened- Settle delay
- 20s after the event
Only when all hold
- pullRequest.isDraft not equals true
- actor.username not in dependabot, dependabot[bot], renovate, renovate[bot], github-actions, github-actions[bot]
- actor.username not contains [bot]
The pipeline
The graph below is the one the workflow opens with in the builder, same steps, same layout, drawn on the same canvas. The run playing through it is a simulation; the branches and conditions are real.
- 01PR Opened
triggerThe event that starts the run.
- 02Clone Repository
git.cloneShallow-clones the repository at the right ref.
- 03Generate Contract Tests
agent.runOne agent works the task with its toolkit.
- 04Publish Contract Test Report
report.publishPosts or updates a deduplicated report comment.
The agent
Contract Test Generator
- Base type
- Senior Developer
- Temperature
- 0.2
- Max iterations
- 50
- Tools
- 9
Git provider · 4
get_pull_request_diffGet Pull Request Diff · readcreate_branchCreate Branch · writecreate_or_update_fileCreate or Update File · writecreate_pull_requestCreate Pull Request · write
Filesystem · 2
read_fileRead File · readwrite_fileWrite File · write
Code search · 1
code_searchCode Search · read
Terminal · 1
run_terminal_cmdRun Terminal Command · write
Status · 1
update_statusUpdate Status · write