# Codex Grade Coding

> Codex-Grade Coding

- Skill: `comcclelland/codex-grade-coding` (Agent Skill)
- Install (CLI): `npx skillmds@latest add comcclelland/codex-grade-coding`
- Raw SKILL.md: https://api.skillmd.com/api/skills/comcclelland/codex-grade-coding/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: comcclelland (https://skillmd.com/u/comcclelland)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/comcclelland/codex-grade-coding

---

# Codex-Grade Coding

Enforces verification-driven coding with strict protocols to reduce errors and ensure correctness.

## When to Use

- When writing new functionality that must be correct (financial calculations, auth, data integrity)
- When the user asks for "careful", "production-grade", or "bulletproof" code
- For any code that handles sensitive data or has no room for error

## Process

### Before Writing Code
1. **State the contract**: What are the inputs, outputs, and invariants?
2. **Identify edge cases**: Empty, null, boundary, concurrent, malformed
3. **Choose the verification strategy**: Types, tests, assertions, or formal checks

### While Writing Code
4. **Write in small, verifiable units**: Each function does one thing
5. **Assert preconditions**: Validate inputs at boundaries
6. **Handle all branches**: No unhandled cases, no silent failures
7. **Make state changes explicit**: Avoid hidden mutations or side effects

### After Writing Code
8. **Verify correctness**:
   - Run the code mentally with edge case inputs
   - Write or update tests covering the contract
   - Check that error paths are tested too
9. **Review for common traps**:
   - Off-by-one errors
   - Null/undefined propagation
   - Resource leaks (unclosed handles, uncleared timers)
   - Race conditions in async code
   - Integer overflow / floating point issues

### Rules
- Prefer compile-time/type-level safety over runtime checks where possible
- Every public function should have at least one test
- Never swallow errors silently — log, throw, or return explicitly
- If you're not sure the code is correct, don't ship it — verify first
- Favor readability over cleverness

