ai bug fixer

    1

    Analyze stack traces and source files to generate root-cause explanations, unified diffs, and regression tests.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    ai bug fixer

    Example session with this skill installed

    python scripts/fixer.py --file auth.py --error "TypeError: Cannot read properties of undefined (reading 'user_id') at auth.py:42"

    • Read your context and instructions
    • Compiled the ai bug fixer

    I have analyzed the stack trace and the source file provided. The error is caused by accessing a property on a null object during the authentication handshake.

    Bug Fix Report

    FieldDetails
    Root CauseAttempting to access user_id on an undefined session object.
    Confidence🟢 HIGH
    ExplanationThe getUserSession function returns undefined when a token is expired, but the subsequent logic assumes the object exists before accessing its properties.
    PreventionUse optional chaining or an explicit null check before accessing session properties.

    Proposed Fix (Unified Diff)

    --- auth.py
    +++ auth.py
    @@ -39,7 +39,7 @@
     def get_auth_context(token):
         session = get_user_session(token)
    -    return session.user_id
    +    return session.user_id if session else None
    

    Regression Test

    def test_expired_token_returns_none():
        # Setup: mock an expired session
        token = "expired_token"
        # Action: call the buggy function
        result = get_auth_context(token)
        # Assert: should handle null gracefully
        assert result is None
    

    Next steps

    1. Review the diff and apply it to auth.py.
    2. Run the provided regression test to verify the fix.
    3. Check if other areas of the codebase lack null checks on get_user_session.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Debugging eats hours of development time when stack traces are cryptic or logs are buried. This skill bridges the gap between a crash and a resolution by analyzing errors against your source code to provide a verified fix.

    What it does

    • Root-cause analysis identifies the exact problem in one sentence based on your logs or stack traces.
    • Unified diffs generate the precise code replacement needed to resolve the issue.
    • Regression testing provides a minimal unit test to ensure the bug does not return.
    • Prevention tips offer specific advice on how to avoid similar coding patterns in the future.
    • Multi-language support handles Python, JavaScript, TypeScript, Go, Rust, and several other major languages.

    How it works

    1. Input error data by pasting a stack trace, pointing to a file, or piping program output directly into the tool.
    2. Review the report to understand the explanation and the logic behind the crash.
    3. Verify the fix by reviewing the generated unified diff.
    4. Export results to a text file or JSON for further processing by your CI/CD or agent workflows.

    Frameworks & tools

    Built for Python 3.8+ environments. It supports a wide array of languages including Python, JS/TS, Go, Java, Ruby, Rust, C/C++, PHP, Swift, and SQL.

    Why this beats prompting it yourself

    Generic prompts often lack the context to generate a working diff or a relevant unit test. This skill follows a structured debugging protocol that combines source files with error context to hit a higher confidence level than raw chat prompts.

    Use cases

    • Fixing failing tests by piping pytest or vitest output directly to the fixer.
    • Debugging production crashes by feeding in raw logs or stack traces from monitoring tools.
    • Refactoring legacy code that throws frequent runtime errors.

    Known limitations

    Source files are capped at 8,000 characters and error messages at 4,000 characters. It is designed for single-file context and may struggle with complex architectural bugs spanning many files.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.

    Source files capped at 8,000 chars. Error messages capped at 4,000 chars. Requires Python 3.8+. Optimized for single-file context.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 1 day ago

    • Free with an Agensi account

    Accounts
    Anthropic
    Software
    Python

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access

    Allowed Hosts

    api.anthropic.com
    Listed1 day ago

    What's inside

    Frequently Asked Questions

    The skill accepts raw stack traces, log files, or piped program output, which it then correlates with your source code to identify the exact line and logic causing the crash.

    Yes, the skill generates a standard unified diff that you can review and apply directly to your source code, along with a minimal unit test to prevent regressions.

    The skill is optimized for Python 3.8+ environments and supports a wide range of languages including JavaScript, TypeScript, Go, Rust, Java, and C++, making it highly versatile for polyglot teams.

    To maintain high accuracy, source files are capped at 8,000 characters and error messages at 4,000; the skill is designed for single-file context rather than complex multi-file architectural issues.

    By using a structured debugging protocol, this skill significantly reduces 'hallucinations' and provides more reliable code diffs and unit tests compared to using a general-purpose chat model.

    Your purchase includes the full AI agent skill, future compatibility updates, and the ability to export results in text or JSON formats for integration into your CI/CD pipelines.

    New in Testing & Debugging

    Free