- Home
- Skills
- Testing & Debugging
- Be-Detective
Be-Detective
A forensic debugging protocol that hunts empirical evidence before proposing surgical code fixes.
Free
Works with the AI Agents you already use
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
- ❌ 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.
- ✅ Hypothesis B: The
userobject is correctly fetched but thecontact_inforelation 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
- Apply the missing relation to the database query in
UserRepository.js. - 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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-only forensic inspection of logs and source code before making fixes.