From forge
Use when Forge needs deep bug diagnosis instead of a quick patch. Trigger on intermittent bugs, unclear root cause, multi-module breakage, repeated failed fixes, or requests like "analyze this", "root cause", "why is this failing?", and "investigate this regression". This skill must be used before broad changes on complex failures.
npx claudepluginhub cjy5507/forge --plugin forgeThis skill uses the workspace's default tool permissions.
<Purpose>
Implements structured self-debugging workflow for AI agent failures: capture errors, diagnose patterns like loops or context overflow, apply contained recoveries, and generate introspection reports.
Monitors deployed URLs for regressions in HTTP status, console errors, performance metrics, content, network, and APIs after deploys, merges, or upgrades.
Provides React and Next.js patterns for component composition, compound components, state management, data fetching, performance optimization, forms, routing, and accessible UIs.
<Use_When>
<Progressive_Disclosure>
references/rca-checklist.md for the compact RCA checklist and must-have outputs.
</Progressive_Disclosure>Dispatch troubleshooter agent with context:
REPRODUCE — Confirm the bug exists: a. Follow the reproduction steps from the issue report b. If steps are incomplete, determine minimal reproduction path c. Document exact reproduction: inputs, state, sequence, output d. If cannot reproduce → document conditions tried, flag as intermittent
HYPOTHESIZE — Generate competing hypotheses: a. Formulate at least 2 competing hypotheses for root cause b. For each hypothesis:
EVIDENCE — Gather evidence for each hypothesis: a. For cross-module issues, dispatch Analyst first for dependency mapping — Analyst pre-computes call paths, dependency chains, and module boundaries so Troubleshooter can focus on runtime behavior rather than static structure b. Trace the execution path through affected code c. Check interface contract boundaries (is data crossing correctly?) d. Check state transitions (is state mutating unexpectedly?) e. Check timing/ordering (race conditions, async issues?) f. Check error handling paths (are errors swallowed silently?) g. Integrate Analyst's structural context with runtime evidence h. Record evidence for and against each hypothesis
VERIFY — Test the leading hypothesis: a. Design a test that isolates the suspected root cause b. Run the test to confirm or refute c. If refuted → move to next hypothesis, repeat from step 4 d. If confirmed → proceed to root cause documentation
ROOT CAUSE — Document the confirmed root cause: a. What: the specific code/logic/state that causes the bug b. Why: why this code exists and why it's wrong c. Where: exact file(s) and line(s) affected d. When: under what conditions the bug manifests e. Impact: what other parts of the system are affected
MINIMAL FIX — Propose the smallest correct fix: a. Define the minimal code change that addresses root cause b. Explain why this fix is correct (not just suppressing symptoms) c. Identify what should NOT be changed (scope boundaries) d. Specify tests that must pass after the fix
IMPACT ANALYSIS — Assess ripple effects: a. Which modules does the fix touch? b. Which interface contracts are affected? c. Which existing tests need updating? d. What new tests are needed? e. Risk assessment: low/medium/high for regression potential
Write RCA report to .forge/evidence/rca-{issue-id}.md:
Return control to forge:fix skill with RCA report
<State_Changes>
<Failure_Modes_To_Avoid>
<Auto_Chain> When troubleshooting completes (root cause identified, RCA report written):