Fix from Logs

Intelligent debugging with /ck:fix — from error logs to working code in one command

How It Works

When logs.txt exists, /ck:fix routes to its log-analysis workflow — a 6-phase pipeline where each phase delegates to a specialized agent.

1
Analyze Logs
debugger agent reads logs.txt
2
Scout Code
Explore agents find error locations
3
Plan Fix
planner agent creates fix strategy
4
Implement
Apply fix to source code
5
Test
tester agent verifies the fix
6
Review
code-reviewer checks quality

Quick Start

1

1. Pipe logs to file

Redirect your app output to logs.txt so the AI can read errors.

npm run dev 2>&1 | tee logs.txt
2

2. Reproduce the error

Run your app and trigger the issue. Ensure errors are captured in logs.txt.

3

3. Run the fix command

Tell the AI to analyze your logs:

/ck:fix Mention logs.txt in the prompt to trigger log-analysis workflow
Template:
/ck:fix "analyze logs.txt and fix errors"

Modes

Choose the right mode for your situation:

--auto
Autonomous — auto-approve if quality high (default)
Simple/moderate issues, let AI handle
--quick
Fast debug → fix → review cycle
Type errors, lint, trivial bugs
--review
Human-in-the-loop — pause at each step
Production/critical code, security
--parallel
Parallel fullstack-developer agents
2+ independent issues in logs

Usage Examples

/ck:fix "analyze logs.txt and fix errors" Full log analysis pipeline
/ck:fix "check logs.txt for auth errors" --auto Focused fix, autonomous mode
/ck:fix "fix errors in logs.txt" --quick Quick fix for simple log errors
/ck:fix "deploy pipeline error" --auto CI/CD fix (replaces /fix:ci)

Log Piping Setup

Different ways to capture logs depending on your stack:

Node.js / npm npm run dev 2>&1 | tee logs.txt
Python python app.py 2>&1 | tee logs.txt
Go go run . 2>&1 | tee logs.txt
Docker docker compose up 2>&1 | tee logs.txt
PowerShell npm run dev *>&1 | Tee-Object logs.txt

tee is built-in on macOS & Linux. On Windows, use Tee-Object in PowerShell.

Pro Tip

Add log piping permanently to your package.json scripts:

"dev:log": "npm run dev 2>&1 | tee logs.txt"

Tips

Focus on recent errors

The debugger reads the last 30 lines first, then expands if needed. Keep logs.txt fresh — clear it before reproducing.

Use tee, not redirect

2>&1 | tee logs.txt lets you see output in terminal AND captures to file. Plain > redirect hides terminal output.

3-strike rule

If 3+ fix attempts fail, the skill stops and asks you to reconsider the architecture. No infinite loops.

Combine with /ck:debug

For deeper investigation without auto-fixing, use /ck:debug first, then /ck:fix to apply.

Related Commands

/ck:fix --quick Quick fix for type/lint errors
/ck:fix --parallel Fix multiple issues simultaneously
/ck:fix --review Human-in-the-loop review mode
/ck:debug Deep investigation without auto-fix