cfn-investigate
Structured root-cause debugging with 5-phase protocol, 3-strike escalation, and scope lock. Use when diagnosing bugs, system failures, or unexpected behavior. Enforces investigation before fixes.
Best use case
cfn-investigate is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Structured root-cause debugging with 5-phase protocol, 3-strike escalation, and scope lock. Use when diagnosing bugs, system failures, or unexpected behavior. Enforces investigation before fixes.
Teams using cfn-investigate should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/cfn-investigate/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How cfn-investigate Compares
| Feature / Agent | cfn-investigate | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Structured root-cause debugging with 5-phase protocol, 3-strike escalation, and scope lock. Use when diagnosing bugs, system failures, or unexpected behavior. Enforces investigation before fixes.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# CFN Investigate **Purpose:** Enforce systematic root-cause debugging. No fixes without investigation. ## Protocol ### Phase 1: Symptom Collection - Collect exact error messages, stack traces, logs. - Identify when the bug was introduced (`git log`, `git bisect`). - Reproduce deterministically. If you cannot reproduce, you cannot fix. - Check cfn-knowledge-base for prior similar issues. - Query decision log for prior investigations: `~/.claude/skills/decision-log/query.sh '<error-message-keywords>' 5 <project>` ### Phase 2: Root Cause Hypothesis - Trace the symptom backward through data flow. - Form a specific, testable hypothesis: "Root cause is X at file:line because Y." - Match against known signatures: race conditions, nil propagation, state corruption, integration failure, config drift, stale cache. - Do NOT propose fixes yet. ### Phase 3: Hypothesis Testing - Add targeted debug output at the suspected root cause. - Run reproduction to confirm or reject. - If rejected, gather more evidence. Do not guess. - **3-STRIKE RULE:** If 3 hypotheses fail, STOP and escalate to the user. Options: - (a) New hypothesis with user input - (b) Human review - (c) Add logging and revisit later ### Phase 4: Targeted Fix - Fix the root cause, not the symptom. - Minimal diff. Do not refactor surrounding code. - Write a regression test that fails without the fix and passes with it. - Run full test suite. ### Phase 5: Verification - Reproduce the original bug and confirm it is fixed. - Verify no new failures introduced. - Output structured report: - **Symptom:** what was observed - **Root cause:** what caused it (file:line) - **Fix:** what was changed - **Evidence:** how root cause was confirmed - **Regression test:** location of the test ## Red Flags (stop and reassess) - "Quick fix for now": there is no "for now." Fix it right or escalate. - Proposing a fix before tracing data flow: you are guessing. - Each fix reveals a new problem elsewhere: wrong architectural layer. ## Scope Lock During investigation, edits should be restricted to the affected module. Use cfn-edit-safety to create backups before any changes. Do not fix unrelated issues discovered during investigation. Log them to TODO instead. ## Integration - Query cfn-knowledge-base before starting (check for prior similar bugs). - Log findings to cfn-knowledge-base when complete. - Works with cfn-edit-safety for backup/restore during hypothesis testing.
Related Skills
supabase-schema-sync
Introspects Supabase DB after migrations and updates project db-query skill with current schema. Run after any migration to keep agent context accurate.
commit
Stage, commit, and push changes using a background github-commit-agent. Accepts optional args for message override or push control.
cfn-vote-implement
MUST BE USED after cfn-dry-review or cfn-alpha-launch:manifest produces a manifest. Also the verification phase of /cfn-loop-task. Do not manually implement code review suggestions - always route through this skill. 3-agent specialized voting. Unanimous (3/3) auto-implemented with TDD. 2/3 routed to product-owner agent. 1/3 surfaced to user via AskUserQuestion (batched 4 per call, at end).
cfn-utilities
Reusable bash utility functions for CFN Loop - logging, error handling, retry, file operations. Use when you need structured logging, atomic file operations, retry logic with exponential backoff, or standardized error handling in bash scripts.
CFN Test Runner Skill
**Version:** 1.0.0
cfn-test-framework
Test execution, running, and webapp testing for CFN
cfn-task-planning
Classify tasks, initialize structured configs with scope boundaries, decompose complex tasks
Specialist Injection Skill
## Purpose
!/bin/bash
# cfn-task-intelligence.sh
Task Complexity Estimator
**Version:** 1.0.0
task-classifier
Analyzes task descriptions and classifies them into categories for agent selection
cfn-task-intelligence
Classify tasks (type/domain), estimate complexity/iterations, recommend specialists from feedback themes