codex-debug
Skill1 starsChanged 4 months agoMITView on GitHub
Performs systematic root-cause investigation, crash dump analysis, race condition debugging, memory leak tracing, and post-mortem failure analysis. Produces timestamped debugging reports and fix walkthroughs in codex-drive/walkthroughs/.
In this repository24 other files it gives its agents.
- codex-architectureSkill
- codex-brainSkill
- ai-codex-c-cppSkill
- ai-codex-csharp-dotnetSkill
- codex-deepSkill
- codex-elixirSkill
- codex-flutter-dartSkill
- codex-goalSkill
- ai-codex-goSkill
- ai-codex-java-kotlinSkill
- ai-codex-phpSkill
- codex-plansSkill
- ai-codex-pythonSkill
- codex-reviewSkill
- ai-codex-rustSkill
- codex-skillsSkill
- codex-solidity-web3Skill
- codex-sql-databaseSkill
- codex-startSkill
- ai-codex-swiftSkill
- codex-testSkill
- ai-codex-typescript-reactSkill
- ai-codex-ui-ux-designSkill
- codex-zigSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 66
All debugging reports generated by codex-debug MUST be Markdown (.md) files with exact date-time metadata.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codex Debug — Root-Cause Diagnostic & Troubleshooting Skill
The forensic investigation and debugging engine of AI Codex. Isolates root causes, eliminates speculative fixes, and writes verifiable post-mortem walkthroughs.
Overview
codex-debug replaces random guessing with a rigorous scientific debugging method. It establishes a deterministic reproduction, formulates falsifiable hypotheses, traces runtime execution or memory states, identifies the exact line and invariant failure, and provides a verified fix with regression tests.
When to Trigger
- User runs
/codex-debug(e.g.,/codex-debug investigate 500 error in checkout,/codex-debug memory leak in background worker,/codex-debug data race on WebSocket connection) - Diagnosing failing unit/integration tests, segfaults, unhandled exceptions, or performance regressions
- Post-incident post-mortem analysis
Execution Workflow
┌────────────────────────────────────────────────────────┐
│ 1. CAPTURE SYMPTOMS & BUILD MINIMAL REPRODUCTION │
│ Stack traces, logs, failing assertions, inputs. │
└──────────────────────────┬─────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ 2. FORMULATE FALSIFIABLE HYPOTHESES │
│ List probable causes based on domain knowledge. │
└──────────────────────────┬─────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ 3. ISOLATE ROOT CAUSE VIA PROFILING & TRACING │
│ Memory inspection, race auditing, line-level proof. │
└──────────────────────────┬─────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ 4. IMPLEMENT FIX & REGRESSION TEST │
│ Ensure root defect is eliminated and cannot recur. │
└──────────────────────────┬─────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ 5. WRITE POST-MORTEM IN CODEX-DRIVE │
│ Write codex-drive/walkthroughs/YYYY-MM-DD-*.debug.md│
└────────────────────────────────────────────────────────┘Debug Walkthrough Specification (codex-drive/walkthroughs/)
All debugging reports generated by codex-debug MUST be Markdown (.md) files with exact date-time metadata.
Filename Format:
codex-drive/walkthroughs/YYYY-MM-DD-<slug>.debug.md
Standard Debug Post-Mortem Template:
# [Issue / Bug Title] Diagnostic & Fix Walkthrough
> **Created At**: YYYY-MM-DD HH:MM:SS (Local Time)
> **Active Codex Edition**: [`skills/codex/<edition>/`](file:///...)
> **Severity**: CRITICAL | HIGH | MEDIUM | LOW
> **Resolution Status**: REPRODUCED | ROOT_CAUSE_CONFIRMED | RESOLVED
---
## 1. Incident Summary & Symptoms
- **Reported Defect**: [Exact error message or unexpected behavior]
- **Environment**: [OS, Runtime version, Hardware/Cloud context]
- **Stack Trace / Error Output**:[Paste relevant logs / stack trace here]
## 2. Minimal Reproduction Harness
Step-by-step procedure or unit test that reliably triggers the defect:
```typescript
test("reproduce connection timeout under concurrent load", async () => {
// Exact test case that failed
});3. Scientific Hypothesis & Isolation Matrix
| # | Hypothesis | Test / Verification Method | Result |
| 1 | Database connection pool exhaustion | Check active pool metrics during burst | Disproven (Pool had 80% free) |
| 2 | Missing await on token refresh causing race | Inspect async call graph with static analysis | [OK] CONFIRMED ROOT CAUSE |
4. Root Cause Deep Dive
- Mechanism: The background token refresh task spawned an unawaited promise, creating a data race where subsequent HTTP requests executed with expired credentials before the new token was committed to memory.
- Affected Files:
src/auth/token-manager.ts:L45-L62
5. Applied Solution & Code Diff
- void refreshToken(); // [WARNING] Fire and forget race condition
+ await this.refreshTokenMutex.runExclusive(async () => {
+ await this.refreshToken();
+ });6. Regression Testing & Prevention
- Added automated regression test:
tests/auth/token-race.test.ts. - Added linter rule to disallow floating/unawaited promises (
@typescript-eslint/no-floating-promises).
---
## Response Protocol
When `codex-debug` finishes:
1. Provide a direct link to `[View Diagnostic Walkthrough](file:///.../codex-drive/walkthroughs/YYYY-MM-DD-<slug>.debug.md)`.
2. Clearly explain the root cause and the specific invariant that failed.
3. Show the exact code fix and verification command (`npm test`, `pytest`, etc.).Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

