بنقرة واحدة
bug-fixer
Diagnose a bug, identify root cause, implement a targeted fix, and verify it
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Diagnose a bug, identify root cause, implement a targeted fix, and verify it
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Evaluate workflow run quality by analyzing artifacts and scratch outputs, identify gaps and root causes, and write a structured assessment with actionable recommendations.
Write an Architecture Decision Record (ADR) for a technical decision
Analyze requirements and produce a detailed implementation plan before writing code
Create a GitHub branch, commit changes to it, and open a pull request
Explore a newly-loaded workspace, map its structure, and write project notes to memory
Restructure code without changing external behavior — extract, rename, split, move
| name | bug-fixer |
| description | Diagnose a bug, identify root cause, implement a targeted fix, and verify it |
Systematically diagnose and fix a reported bug without introducing regressions.
context.emit({ type: 'progress', message: 'Step 1: Understanding the bug...' });
// Read the relevant source files
const buggyFile = context.vfs.read('/src/path/to/file.js');
if (!buggyFile) {
context.emit({ type: 'done', message: 'Error: file not found in VFS' });
return;
}
context.emit({ type: 'file_read', path: '/src/path/to/file.js' });
Do NOT fix symptoms. Find the root cause:
// Common root cause categories:
// - Off-by-one: index, boundary, fence post
// - Null/undefined not handled: add null checks
// - Async race: await missing, promise not returned
// - State mutation: object shared when it should be copied
// - Type mismatch: string vs number, array vs object
// - Wrong algorithm: logic error in core computation
context.emit({ type: 'progress', message: 'Root cause: <describe what you found>' });
Fix ONLY what is broken. Do not refactor surrounding code:
// Read current content
const original = context.vfs.read('/src/path/to/file.js');
// Apply targeted fix
const fixed = original.replace(
/buggy pattern/,
'correct replacement'
);
// Or for structural changes, reconstruct the relevant section
context.vfs.write('/src/path/to/file.js', fixed);
context.emit({ type: 'file_write', path: '/src/path/to/file.js' });
Check the fix is logically correct:
context.emit({ type: 'progress', message: 'Verifying fix...' });
// Re-read the fixed file and confirm:
// 1. The bug condition is gone
// 2. The surrounding logic is unchanged
// 3. Edge cases are handled (null, empty, boundary)
const verified = context.vfs.read('/src/path/to/file.js');
// Spot-check that fix is present and correct
if (!verified.includes('expected fixed pattern')) {
context.emit({ type: 'progress', message: 'Warning: fix may not have applied correctly' });
}
context.emit({ type: 'result', value: {
file: '/src/path/to/file.js',
root_cause: '<description>',
fix: '<description of change>',
verification: 'logic check passed',
}});
context.emit({ type: 'done', message: 'Bug fixed: <one-liner>' });
try/catch to suppress an error without fixing it// Null guard
const value = obj?.field ?? defaultValue;
// Array boundary
const idx = Math.min(index, array.length - 1);
// Async fix — ensure await
const result = await asyncFn();
// Defensive copy
const copy = { ...shared };
copy.field = newValue;