feat(ship-pr): add test evidence gate to Screenshot Check#10
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR extends the The feature fits naturally into the existing Screenshot Check block and the overall "no unverified changes" philosophy of the skill. However, there are two logic gaps worth addressing before relying on this gate in production:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Step 3: PR Creation] --> B[Screenshot Check]
B --> C{Diff includes UI/frontend files?}
C -- Yes --> D{evidence/screenshots/ empty or missing?}
D -- Yes --> E[STOP: warn user, recommend /validate]
D -- No --> F{Diff adds new test files?\n*.test.* / *.spec.*}
C -- No --> F
F -- Yes --> G{PR body includes test runner output?}
G -- No --> H[STOP: run tests now and capture output]
G -- Yes --> I{Tests are Playwright/E2E?\n⚠️ no detection heuristic defined}
I -- Yes --> J{Screenshots of tested behavior embedded?}
J -- No --> H
J -- Yes --> K{Screenshots exist in evidence/?}
I -- No --> K
F -- No --> K
K -- Yes --> L[Embed screenshots in PR body\nusing absolute GitHub blob URLs]
K -- No --> M[Continue without screenshots]
L --> N[Commit + Push + Create/Update PR]
M --> N
style E fill:#f66,color:#fff
style H fill:#f66,color:#fff
style I fill:#fa0,color:#000
Reviews (1): Last reviewed commit: "chore: bump to v0.8.1" | Re-trigger Greptile |
| - If the diff adds new test files (*.test.*, *.spec.*): the PR body MUST include | ||
| proof that the new tests pass. At minimum, embed the verbose test runner output. | ||
| If the tests are Playwright/E2E tests, also capture and embed screenshots of the | ||
| tested behavior. STOP if no evidence exists — run the tests now and capture output. |
There was a problem hiding this comment.
Test file patterns are JS/TS-only
The patterns *.test.* and *.spec.* only cover JavaScript/TypeScript naming conventions. Common test file patterns in other ecosystems would be silently skipped:
- Python:
test_*.py/*_test.py - Go:
*_test.go - Ruby:
*_spec.rb/test_*.rb - Rust: inline test modules won't match file-level patterns at all
If this project's skills are ever used on polyglot repos, the gate would never fire for non-JS test additions. Consider broadening the detection heuristic or noting the limitation explicitly.
| - If the diff adds new test files (*.test.*, *.spec.*): the PR body MUST include | |
| proof that the new tests pass. At minimum, embed the verbose test runner output. | |
| If the tests are Playwright/E2E tests, also capture and embed screenshots of the | |
| tested behavior. STOP if no evidence exists — run the tests now and capture output. | |
| - If the diff adds new test files (`*.test.*`, `*.spec.*`, `test_*.py`, `*_test.py`, | |
| `*_test.go`, `*_spec.rb`, `test_*.rb`): the PR body MUST include | |
| proof that the new tests pass. At minimum, embed the verbose test runner output. | |
| If the tests are Playwright/E2E tests, also capture and embed screenshots of the | |
| tested behavior. STOP if no evidence exists — run the tests now and capture output. |
| If the tests are Playwright/E2E tests, also capture and embed screenshots of the | ||
| tested behavior. STOP if no evidence exists — run the tests now and capture output. |
There was a problem hiding this comment.
No guidance on how to identify Playwright/E2E tests
The instruction branches on "If the tests are Playwright/E2E tests" but gives no criteria for making that determination. A *.spec.ts file could be a Playwright test, a Vitest unit test, or a Jest integration test — they all use the same naming convention.
Without disambiguation rules, the AI agent has to guess, which could either:
- Over-require screenshots (blocking the flow unnecessarily for unit tests)
- Under-require them (missing screenshots for real E2E tests)
Consider adding detection heuristics, for example: check for playwright imports, look for a playwright.config.* at the repo root, or check the directory (e.g. e2e/, tests/e2e/).
| - If the diff adds new test files (*.test.*, *.spec.*): the PR body MUST include | ||
| proof that the new tests pass. At minimum, embed the verbose test runner output. | ||
| If the tests are Playwright/E2E tests, also capture and embed screenshots of the | ||
| tested behavior. STOP if no evidence exists — run the tests now and capture output. |
There was a problem hiding this comment.
The gate says "STOP if no evidence exists — run the tests now and capture output," which addresses missing evidence but not the case where tests are run and fail. If the developer runs the tests and they fail, the current instruction still asks them to "capture output" — which would embed failure output into the PR body.
Consider adding an explicit instruction: if the tests fail, the ship flow should stop and the developer must fix the failures before proceeding, rather than just capturing the output of a failing run.
…d failure handling Addresses review feedback: - Broaden test file patterns beyond JS/TS to cover Python, Go, and Ruby - Add concrete Playwright/E2E detection criteria (imports, config, e2e/ dir) - Explicitly block ship flow on test failures, not just missing evidence Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
/ship-pr's Screenshot Check section that gates on new test files (*.test.*,*.spec.*)Closes / Addresses
Test plan
/ship-pron a branch that adds new test files — verify it stops and requests test output evidence/ship-pron a branch with no new test files — verify no change in behavior🤖 Generated with Claude Code