Pre-PR quality review - verify AC coverage, test quality, and test isolation.
Quality enforcement for pre-PR review. Use before creating a PR to catch issues early.
# Start the workflow
kspec workflow start @local-review
kspec workflow next --input spec_ref="@spec-slug"
5-step quality gate with strict checks:
Every acceptance criterion MUST have at least one test that validates it.
How to check:
# Find AC annotations in tests
grep -r "// AC: @spec-ref" tests/
# Compare against spec ACs
kspec item get @spec-ref
Annotation format:
// AC: @spec-ref ac-1
it('should validate input when given invalid data', () => {
// Test implementation
});
Missing AC coverage is a blocking issue, not a suggestion.
All tests must properly validate their intended purpose.
Valid tests:
Fluff tests to reject:
Litmus test: Would this test fail if the feature breaks?
All tests MUST be properly isolated:
Why this matters:
Correct patterns:
let mockStore: ConversationStore;
beforeEach(() => {
mockStore = new InMemoryConversationStore();
// Fresh state for each test
});
afterEach(() => {
// Cleanup if needed
});
Wrong patterns:
// NEVER do this - shared state across tests
const globalStore = new ConversationStore();
it('should work', () => {
globalStore.add(...); // Pollutes other tests!
});
| Issue | Severity | Action |
|---|---|---|
| Missing AC coverage | MUST-FIX | Add tests before PR |
| Fluff test | MUST-FIX | Rewrite or remove |
| Tests not isolated | MUST-FIX | Fix isolation issues |
Generate a summary with:
## Local Review Summary
### AC Coverage
- [x] ac-1: Covered by test X
- [ ] ac-2: MISSING - no test found
- [x] ac-3: Covered by test Y
### Issues Found
1. **MUST-FIX**: Missing coverage for ac-2
2. **MUST-FIX**: Test Z is fluff (always passes)
### Verdict
- [ ] Ready for PR (all checks pass)
- [x] Needs fixes (MUST-FIX issues above)
/pr@pr-review-merge workflow