Skip to content
aposd-verifying-correctness logo

Skill: aposd-verifying-correctness

aposd-verifying-correctness

Verify code correctness before claiming done or committing. Run 6-dimension checklist: requirements coverage, concurrency safety, error handling, resource management, boundary conditions, and security. Output PASS/FAIL per dimension with final DONE/NOT DONE verdict. Use after implementation as pr...

SKILL.md

Full skill instructions

Skill: aposd-verifying-correctness

STOP - Before "Done"

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.


Dimension Detection & Checks

For each dimension: detect if it applies, then verify.


1. Requirements Coverage

Detect: Were requirements stated? (explicit list, user request, spec)

If YES, verify:

  • List each requirement explicitly
  • For each: point to code that implements it
  • Any requirement without code? → Not done
  • Any code without requirement? → Scope creep or missing requirement

Red flag: "I think I covered everything" without explicit mapping


2. Concurrency Safety

Detect: Any of these present?

  • Multiple threads/​processes accessing same data
  • Async/​await patterns
  • Shared mutable state (class attributes, globals)
  • "Thread-safe" in requirements or docstring
  • Web handlers, queue workers, background tasks

If YES, verify:

  • All shared mutable state identified
  • Each access point protected (lock, atomic, queue, immutable)
  • No time-of-check to time-of-use (TOCTOU) gaps
  • Lock ordering consistent (if multiple locks)

Red flag: "It's probably fine" or "Python GIL handles it"


3. Error Handling

Detect: Can any operation fail?

  • I/​O (file, network, database)
  • External calls (APIs, subprocesses)
  • Resource acquisition (memory, connections)
  • User input processing
  • Parsing/​deserialization

If YES, verify:

  • Each failure point has explicit handling OR propagates
  • No bare except: or except Exception: pass
  • Error messages actionable (what failed, why, how to fix)
  • Partial failures handled (rollback, cleanup, consistent state)

Red flag: "Errors are rare" or "caller handles it" without checking caller


4. Resource Management

Detect: Does code acquire resources?

  • File handles, sockets, connections
  • Locks, semaphores
  • Memory allocations (large buffers, caches)
  • External service handles
  • Background threads/​processes

If YES, verify:

  • Every acquire has corresponding release
  • Release happens in finally/​context manager/​destructor
  • Release happens on error paths too
  • No resource leaks on repeated calls
  • Bounded growth (caches have limits, queues have limits)

Red flag: "It cleans up eventually" or daemon threads without shutdown


5. Boundary Conditions

Detect: Does code handle variable-size input?

  • Collections (lists, dicts, sets)
  • Strings, byte arrays
  • Numeric ranges
  • Optional/​nullable values

If YES, verify:

  • Empty input: What happens with [], "", None, 0?
  • Single item: Edge case often different from N items
  • Maximum size: What if input is huge? Memory? Time?
  • Invalid values: Negative numbers, NaN, special characters?
  • Type boundaries: int overflow, float precision?

Red flag: "Nobody would pass that" or "that's an edge case"


6. Security (if applicable)

Detect: Does code handle untrusted input?

  • User-provided data (forms, API requests)
  • File contents from external sources
  • URLs, paths, identifiers from users
  • Data that becomes SQL, shell, HTML, or code

If YES, verify:

  • Input validated before use
  • No string concatenation for SQL/​shell/​HTML (use parameterized)
  • Path traversal prevented (no ../ exploitation)
  • Secrets not logged or exposed in errors
  • Auth/​authz checked before action, not after

Red flag: "It's internal only" (internals get exposed)


Quick Checklist (Minimum)

Before "done", answer YES to all that apply:

DimensionDetection TriggerVerified?
RequirementsRequirements were stated[ ] Each mapped to code
ConcurrencyShared state exists[ ] All access protected
ErrorsOperations can fail[ ] All failures handled
ResourcesResources acquired[ ] All released (incl. errors)
BoundariesVariable-size input[ ] Edge cases handled
SecurityUntrusted input[ ] Input validated

Anti-Rationalization Table

ThoughtReality
"Design is good, so it works"Design ≠ correctness. Check anyway.
"It's simple code"Simple code has bugs too. Check anyway.
"I'll add error handling later"Later = never. Check now.
"Edge cases are rare"Edge cases cause production incidents.
"It's not user-facing"Internal code gets exposed. Check anyway.
"Tests will catch it"Tests check what you wrote, not what you missed.

Output Format

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]

Relationship to Other Skills

SkillFocusWhen
aposd-designing-deep-modulesDesign qualityFIRST—during design
aposd-maintaining-design-qualityDesign philosophyDuring modification
aposd-verifying-correctnessActual correctnessBEFORE "done"
cc-quality-practicesTesting/​debuggingThroughout

Order: Design → Implement → Verify (this skill) → Done


Chain

AfterNext
All dimensions passDone (pre-commit gate)

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View