agentsclimarketplace

Debugging

Skill furkangonel/cowrangler/bundled_skills/debugging

Autonomous terminal AI agent for workflows and feasible project procedures. Co-Worker Co-Wrangler πŸ™

Install
npx -y skills add furkangonel/cowrangler --skill debugging

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Systematic bug investigation process β€” reproduce, isolate, root cause, fix, verify

SKILL.md

3.2 KB, as published. Nobody here has run it

Debugging SOP

The Scientific Method for Bugs

Step 1 β€” Understand the Symptom

  • Read the error message / stack trace carefully (every line)
  • Identify: What was expected? What actually happened?
  • Note: When does it occur? Always, or only sometimes?
  • Check: Is this a regression? When did it last work?

Step 2 β€” Reproduce the Bug

# Can you reproduce it reliably?
# If not, it may be:
# - Race condition (timing-dependent)
# - Environment-specific (env vars, OS, versions)
# - Data-dependent (specific inputs trigger it)
  • Reduce to the minimal reproduction case
  • Confirm the reproduction before investigating
  • Check if it reproduces in a fresh environment

Step 3 β€” Read the Code

  • Locate the exact file and function from the stack trace
  • Trace the execution path from input β†’ failure point
  • Look at what changed recently: git log --since="3 days ago" -- <file>

Step 4 β€” Form a Hypothesis

State your hypothesis explicitly:

"I think the bug is caused by X because Y"

Then check what evidence would confirm or disprove it.

Step 5 β€” Verify the Hypothesis

Add targeted logging to confirm:

console.log("[DEBUG]", { variableName, type: typeof variableName });

Or use the debugger:

node --inspect-brk dist/main.js  # Attach Chrome DevTools

Step 6 β€” Fix

  • Make the minimal change that fixes the root cause
  • Do NOT fix symptoms β€” fix root causes
  • Do NOT refactor while fixing (separate concerns)

Step 7 β€” Verify the Fix

# Run existing tests
npm test

# Confirm the original reproduction no longer fails
# Add a regression test to prevent recurrence

Common Bug Patterns

Async/Await Issues

// WRONG β€” Promise not awaited
const data = fetchData();  // returns Promise, not data
console.log(data.name);    // undefined!

// CORRECT
const data = await fetchData();

Off-by-One

  • Array indices: arr[arr.length] is undefined, arr[arr.length - 1] is last
  • Loop boundaries: < length vs <= length

Mutation vs Copy

// WRONG β€” mutates original
const sorted = arr.sort();

// CORRECT β€” copy first
const sorted = [...arr].sort();

Environment Variables

// Always validate env vars at startup
if (!process.env.DATABASE_URL) {
  throw new Error("DATABASE_URL is required");
}

Agent Instructions

  1. Always read the error message before looking at code
  2. Use git_log to find recent changes that might be related
  3. Use search_in_files to find all usages of the problematic function
  4. Use execute_bash to run tests and confirm reproduction
  5. Explain your reasoning at each step β€” debugging is a communication exercise
  6. After fixing, always run the test suite and check for regressions

Why/Failure Modes

[TODO: Explain the reasoning behind this skill's approach and common failure modes to avoid.]

Standalone vs Supercharged

[TODO: Describe how this skill works on its own vs when combined with other tools/context.]

Cross-References

[TODO: Link to other relevant skills or documentation.]

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.