Be-Detective

    1

    A forensic debugging protocol that hunts empirical evidence before proposing surgical code fixes.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Be-Detective

    Example session with this skill installed

    The API is returning a 500 error on the /users/profile endpoint. Here is the stack trace: TypeError: Cannot read properties of undefined (reading 'email') at UserService.js:42.

    • Read your context and instructions
    • Compiled the be-detective

    I have completed the forensic investigation into the reported TypeError.

    🕵️‍♂️ Detective Case File (Forensic Investigation)

    • Case Status: Evidence Confirmed
    • Crime Scene: services/UserService.js:42
    🔍 Hypotheses Tested
    1. ❌ Hypothesis A: The database query is returning an empty array for the user lookup. -> Status: Refuted. The query returns a single record, but the mapping logic is faulty.
    2. ✅ Hypothesis B: The user object is correctly fetched but the contact_info relation is not being eagerly loaded, leading to an undefined nested property. -> Status:

    Forensically Verified.

    📌 Evidence Locker
    • Faulty Code:
      // services/UserService.js:42
      const profile = {
        username: user.name,
        email: user.contact_info.email // Throws: Cannot read properties of undefined
      };
      

    Observed Error Data: TypeError: Cannot read properties of undefined (reading 'email'). Runtime inspection shows user.contact_info is undefined because the repository call findById(id) lacks the .populate('contact_info') chain.

    Flow Reconstruction: GET /users/profile -> UserController.getProfile -> UserService.js -> UserRepository.findById (Missing Relation) -> Property Access Failure

    🎯 Minimal Fix Recommendation (Anti-Overengineering)

    Update the repository call in UserRepository.js to include the missing relation or add an optional chaining operator in the UserService mapping to handle missing contact data gracefully.

    Next steps

    1. Apply the missing relation to the database query in UserRepository.js.
    2. Add a unit test covering users with missing contact info to prevent regression.

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

    About this skill

    Forensic crime-scene investigator for bugs, crashes, failing tests, and logic anomalies. Strictly forbids guessing: formulates falsifiable hypotheses, hunts empirical evidence (logs, stack traces, exact line numbers, variable state), reconstructs source-to-sink flow, and compiles structured case files before touching code. Includes a worked example. Part of Detective-Zii-Skills—upgrade to Forensic PR Reviewer ($12) for automated multi-file PR diff audits and OWASP/race-condition checklists.

    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.

    Does not scaffold new features. Not intended for broad PR reviews. Requires provided logs, stack traces, or source access to gather evidence.

    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

    Permissions

    Read Files
    Terminal / Shell

    Read-only forensic inspection of logs and source code before making fixes.

    Listed1 day ago

    What's inside

    Frequently Asked Questions

    Unlike standard AI debugging that often guesses solutions, this skill enforces a strict forensic protocol that prohibits code changes until empirical evidence—like specific line numbers or log anomalies—is identified. This eliminates the trial-and-error cycle and prevents 'hallucinated' fixes that don't actually address the root cause.

    The skill is language-agnostic and works with any stack where you can provide logs, stack traces, or source code, including Python, JavaScript/TypeScript, Go, Ruby, and Java. It focuses on the logic of investigation rather than the specific syntax of a single framework.

    The 'be detective' skill is a logic-based protocol compatible with most major AI agent platforms and IDE extensions (such as Cursor, Windsurf, or custom LLM agents) that support system-level instructions and file access. Check your specific agent's documentation on how to import new skill definitions.

    You receive the full 'be detective' forensic protocol, including the evidence-based auditing logic, hypothesis testing framework, and the standardized 'Case File' reporting template. You also get any version updates released by the creator to refine the debugging logic.

    No, this skill is strictly a diagnostic tool designed to find and fix existing bugs. It does not handle feature requests, new project scaffolding, or general code refactoring that isn't directly related to a verified failure.

    New in Testing & Debugging

    Free