What is bug-analyzer?
Also for proactive bug hunting and code audits for hidden bugs.
event4u-app/agent-config
Use when the user shares a Sentry error, Jira bug ticket, or error description and wants root cause analysis. Also for proactive bug hunting and code audits for hidden bugs.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/bug-analyzer"Quick start
Install it or open the source, trigger it with a clear task, then follow the source workflow.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/bug-analyzer"Use bug-analyzer to help me with: [describe your task]. Before you begin, tell me what input you need, the steps you will follow, and the expected output.
No structured workflow was detected; follow the original SKILL.md below.
Continue to the workflowDirect answers
Also for proactive bug hunting and code audits for hidden bugs.
It is relevant to workflows involving Testing, Engineering, Research.
SkillSignal detected this source-specific command: npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/bug-analyzer". Inspect the repository and command before running it.
The upstream source does not declare a dedicated Agent platform.
Static analysis detected exec-script, network, read-files signals. Review the cited source lines before installing; these signals are not a security audit.
This page combines upstream documentation with deterministic repository, quality, and static-risk signals. It is not described as a manual test or security review.
SkillSignal brief
Also for proactive bug hunting and code audits for hidden bugs.
Useful in these contexts
Core capabilities
Distilled from the source
About 9 min · 16 sections
Feature development — route to feature-planning
Code style or refactoring — route to code-refactoring
Performance issues — route to performance-analysis
Security vulnerabilities — route to security-audit
Root cause analysis with evidence trail
Fix implementation or fix plan with specific files and changes
Regression test covering the failure scenario
Quality breakdown
Based on traceable docs and repository signals; stars are not treated as quality.
Compare before choosing
These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
Use BEFORE editing shared code — enumerates every call site, event consumer, queue worker, API client, migration, and test that a planned change will touch, with a file:line citation per dependency.
Build, inspect, test, and analyze bounded process-based discrete-event simulations with SimPy, including events, resources, interrupts, monitoring, replications, warm-up, and reproducible output analysis.
Use when PHPStan, Rector, or ECS output appears — "phpstan says mixed", type errors, "fix code style", "run rector" — even when Eloquent/Laravel/model code is also mentioned.
Reactive mode: User reports a bug, shares a Sentry issue, or asks to investigate an error. Proactive mode: User asks to audit code for hidden bugs, edge cases, or risky patterns.
Do NOT use when:
feature-planningcode-refactoringperformance-analysissecurity-auditdata-flow-mapperblast-radius-analyzerBugs can come from multiple sources — gather as many as available:
| Source | What it provides |
|---|---|
| Branch name | Auto-detected ticket ID (e.g., fix/DEV-1234/...) |
| Jira ticket | Description, acceptance criteria, comments, priority |
| Sentry issue URL | Stacktrace, affected users/environments, frequency, tags |
| Sentry event ID | Specific occurrence with full context |
| Error message | String to search in codebase |
| User description | Reproduction steps, expected vs. actual behavior |
Always check the current branch for ticket IDs:
git branch --show-current
Pattern matching:
fix/DEV-1234/description → extract DEV-1234fix/PROJ-567-some-bug → extract PROJ-567hotfix/DEV-999 → extract DEV-999[A-Z]+-[0-9]+If found, auto-fetch the ticket and confirm with the user.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you haven't completed Phase 1, you cannot propose fixes. Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Gather all available evidence before forming any hypothesis:
get_issue_details to fetch stacktrace, tags, environments, frequency.get_issue_tag_values for browser, URL, environment distribution.codebase-retrieval to find the relevant code.agents/settings/contexts/) for the affected area.memory-access call
retrieve(types=["historical-patterns", "incident-learnings"], keys=[<error class>, <affected file paths>], limit=3). A prior
matching pattern or incident is the single most reliable accelerator
for root-cause analysis. Cite id and path verbatim so the user
can verify the precedent.When the system has multiple layers (Controller → Service → Repository → DB, or multi-tenant DB switching), add diagnostic instrumentation before proposing fixes:
For EACH component boundary:
- Log what data enters the component
- Log what data exits the component
- Verify environment/config propagation (e.g. DB connection, tenant context)
- Check state at each layer
Run once → gather evidence → identify WHICH layer breaks → investigate that layer.
This is especially important for:
Once the root cause is confirmed, sweep for variants before closing:
first()").codebase-retrieval for the shape, not the symptom:
the same API misuse, the same copy-pasted block, the same missing guard.minimal-safe-diff's remediation carve-out) or land as a noted follow-up.Worked example: root cause $order->customer->email crashes when the
customer was soft-deleted. Signature: ->customer-> after an unguarded
relation. Sweep finds 3 more sites; 2 are variants (same nullable relation),
1 is rejected (eager-loaded with whereHas, cannot be null there).
MonitoringHelper::captureException()) for data quality issues.When asked to audit code for hidden bugs, use this workflow instead of the 4 phases above:
Trace the actual code path step by step:
For each code path, test these scenarios mentally:
| Category | What to check |
|---|---|
| Null/empty | Null inputs, empty arrays, empty strings, missing keys |
| Boundaries | Zero, negative, max int, first/last element |
| Type coercion | String "0" vs int 0, loose comparison bugs |
| Timing | Race conditions, stale cache, concurrent writes |
| State | Uninitialized state, partial updates, rollback failures |
| External | Network timeout, API errors, malformed responses |
→ PHP/Laravel bug-pattern catalogue: see php-debugging.
Before a candidate enters the report, restate it as one falsifiable sentence: the concrete input or state that triggers it, and the observable wrong behavior that follows. A candidate whose trigger you cannot name is not a finding — trace further or drop it with a one-line reason.
Route verification by severity: a Low/Medium finding with a traced trigger reports normally (Standard); a High/Critical finding gets a devil's-advocate pass first (Deep) — actively try to refute it (guard clause upstream? framework default? unreachable input?) and report only what survives. List killed candidates one-line under Rejected candidates so the triage is auditable.
For each bug found: Bug → Location → Severity → Root Cause → Trigger → Fix → Confidence
Close with Rejected candidates — one line per looks-broken-but-benign pattern the gate killed, with the traced reason.
| Command | Purpose |
|---|---|
bug-investigate | Gather context from all sources, analyze, identify root cause |
bug-fix | Plan the fix, implement, verify with tests and quality tools |
Read AGENTS.md and ./agents/ for project-specific architecture, business rules, and domain docs.
Detect the project from the repo name (see rules/architecture.md).
Check for existing contexts in agents/settings/contexts/ or module agents/settings/contexts/.
Before implementing a fix, run the adversarial-review skill.
Focus on the "Bug fixes" attack questions: Is this the root cause or a symptom? Will the fix break something else?
| Excuse | Reality |
|---|---|
| "Should work now" | RUN the verification — confidence ≠ evidence |
| "It's probably X, let me fix that" | "Probably" = guessing. Complete Phase 1 first |
| "Quick fix for now" | Quick fixes mask root causes and create technical debt |
| "I'll investigate later" | Later never comes. Investigate now |
| "One more fix attempt" (after 2+) | 3+ failures = architectural problem. Stop and discuss |
| "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs |
| "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing |
| "It looks broken" | Pattern-recognition is not analysis — name the concrete trigger or drop it |
| "This is clearly critical" | Complete a devil's-advocate pass — models overrate severity |
| "Report it just in case" | Over-reporting erodes trust; an unverifiable finding is noise |
curl against the failing route (or an actingAs() HTTP test) before and after the fix; assert the new response shape with assertJsonPath.xdebug breakpoint at the suspect frame, step through, and inspect the stack trace; for log-only repros, dump the failing variable with dd( once, then remove.