chore: add contract test#425
Merged
Merged
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
benmatselby
reviewed
Apr 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new contract test suite to validate the CLI’s generated HTTP requests against the published Prolific OpenAPI spec, and introduces supporting documentation for a command-audit workflow.
Changes:
- Add
contract_test/suite that (1) checks operationId coverage and (2) validates outbound requests against the OpenAPI schema viakin-openapi. - Add a Claude slash-command skill doc and a generated command audit report markdown.
- Update Go dependencies and linter configuration to support the new tests.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
contract_test/contract_test.go |
New contract tests: spec coverage + request-schema validation via a stub server. |
go.mod |
Adds direct deps for OpenAPI parsing/validation and YAML parsing. |
go.sum |
Locks new dependency versions and transitive additions. |
.golangci.yml |
Excludes errcheck warnings for contract_test/ (intentional ignored returns). |
.gitignore |
Attempts to ignore downloaded spec artifacts. |
.claude/skills/audit-command/SKILL.md |
Adds documentation for a /review-command skill to audit commands against conventions. |
command-audit.md |
Adds a command-audit report documenting convention deviations across commands. |
mock_client/mock_client.go |
Regenerated/mock recorder ordering adjustment around CreateSurveyResponse. |
script-this
reviewed
Apr 15, 2026
script-this
reviewed
Apr 15, 2026
script-this
reviewed
Apr 15, 2026
script-this
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's in this commit
Lightweight contract test (contract_test/)
Adds a test suite that validates the CLI client against the Prolific OpenAPI spec openapi.yaml. It has two test cases:
This makes gaps visible: any new spec endpoint with no entry will fail the test, and SPECMISMATCH entries are a living list of known mismatches to fix.
path, query params, body shape/types).
Claude Review Command
/audit-commandskill (.claude/skills/audit-command/SKILL.md)A Claude Code slash command (/audit-command [resource] [command]) that reviews an existing CLI command against project conventions. It checks: output flags, dependency injection, rendering strategy, help text, error formatting, and web flag usage, then reports findings grouped by severity (must fix / should fix / ok) and offers to fix flagged issues
See the review output on ./command-audit.md