com um clique
aposd-verifying-correctness
// Use after implementing code. Triggers on: is it done, ready to commit, verify correctness, did I miss anything, pre-commit check.
// Use after implementing code. Triggers on: is it done, ready to commit, verify correctness, did I miss anything, pre-commit check.
| name | aposd-verifying-correctness |
| description | Use after implementing code. Triggers on: is it done, ready to commit, verify correctness, did I miss anything, pre-commit check. |
Design quality ≠ correctness. Well-designed code can still have bugs, missing requirements, or safety issues.
Run ALL dimension checks before claiming done. "I think I covered everything" without explicit mapping is a red flag.
For each dimension: detect if it applies, then verify.
Detect: Were requirements stated? (explicit list, user request, spec)
If YES, verify:
Red flag: "I think I covered everything" without explicit mapping
Detect: Any of these present?
If YES, verify:
Red flag: "It's probably fine" or "Python GIL handles it"
Detect: Can any operation fail?
If YES, verify:
except: or except Exception: passRed flag: "Errors are rare" or "caller handles it" without checking caller
Detect: Does code acquire resources?
If YES, verify:
Red flag: "It cleans up eventually" or daemon threads without shutdown
Detect: Does code handle variable-size input?
If YES, verify:
[], "", None, 0?Red flag: "Nobody would pass that" or "that's an edge case"
Detect: Does code handle untrusted input?
If YES, verify:
../ exploitation)Red flag: "It's internal only" (internals get exposed)
Before "done", answer YES to all that apply:
| Dimension | Detection Trigger | Verified? |
|---|---|---|
| Requirements | Requirements were stated | [ ] Each mapped to code |
| Concurrency | Shared state exists | [ ] All access protected |
| Errors | Operations can fail | [ ] All failures handled |
| Resources | Resources acquired | [ ] All released (incl. errors) |
| Boundaries | Variable-size input | [ ] Edge cases handled |
| Security | Untrusted input | [ ] Input validated |
When verifying, output:
## Correctness Verification
### Requirements: [PASS/FAIL/N/A]
- Requirement 1 → implemented in X
- Requirement 2 → implemented in Y
### Concurrency: [PASS/FAIL/N/A]
- Shared state: [list]
- Protection: [how]
### Errors: [PASS/FAIL/N/A]
- Failure points: [list]
- Handling: [approach]
### Resources: [PASS/FAIL/N/A]
- Acquired: [list]
- Released: [how]
### Boundaries: [PASS/FAIL/N/A]
- Edge cases: [list]
- Handling: [approach]
### Security: [PASS/FAIL/N/A]
- Untrusted input: [list]
- Validation: [approach]
**Verdict:** [DONE / NOT DONE - list blockers]
| Skill | Focus | When |
|---|---|---|
| aposd-designing-deep-modules | Design quality | FIRST—during design |
| aposd-verifying-correctness | Actual correctness | BEFORE "done" |
| cc-quality-practices | Testing/debugging | Throughout |
Order: Design → Implement → Verify (this skill) → Done
| After | Next |
|---|---|
| All dimensions pass | Done (pre-commit gate) |
Use when designing modules, APIs, or classes before implementation.
Use when reviewing code, assessing interfaces, during PR review, or evaluating 'is this too complex?' Triggers on: code review, design review, module complexity, interface assessment, PR review, structural analysis.
Use when code is too complex, has scattered error handling, configuration explosion, or callers doing module work. Triggers on: too complex, simplify, scattered errors, configuration proliferation, verbose error handling
Use when code has deep nesting (3+ levels), complex conditionals, loop design questions, high cyclomatic complexity (McCabe >10), or callback hell. Symptoms: arrow-shaped code, repeated conditions, confusing loop exits, lengthy if-else chains
Use when auditing defensive code, designing barricades, choosing assertion vs error handling, or deciding correctness vs robustness strategy. Triggers on: empty catch blocks, missing input validation, assertions with side effects, wrong exception abstraction level, garbage in garbage out mentality, deadline pressure to skip validation, trusted source rationalization.
Use when designing routines, stuck on where to start coding, caught in compile-debug loops, or code works but you don't understand why. Triggers on: starting a new coding task