Agent skill
fix-issue
Investigate and fix a bug from a report, traceback, log, or unexpected behavior
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/fix-issue-g-zenr-relay-api
SKILL.md
Investigate and fix: $ARGUMENTS
Step 1 — Gather Evidence
- Read the full error traceback, log output, or bug report
- Identify the exception type, message, file, and line number
- Note any relevant request data, state, or configuration
- Check if a test already covers this case
Step 2 — Reproduce
Write a minimal test that triggers the error:
// Write a test that triggers the error
test_reproduces_issue(client) {
resp = client.<METHOD>("<path>", ...)
// This should reproduce the error — verify it fails
}
Run it to confirm it fails.
Step 3 — Diagnose
Trace the error through the architecture layers (see Layers in project config):
- API layer — Route handler, request parsing, DI
- Dependencies — Auth chain, service injection
- Service layer — Business logic, thread safety
- Core layer — External resource communication, protocol
- Config — Settings, environment variables
For each layer, ask:
- Is the input valid at this point?
- Is the exception caught or propagated correctly?
- Is thread safety maintained?
- Is the state consistent?
Common root causes:
- Resource errors: External resource not open, invalid identifier
- Auth errors: API key misconfigured, missing timing-safe comparison
- State errors: State dict out of sync with actual resource state
- Thread errors: Lock not held during resource access
- Config errors: Env var not set or wrong type
Step 4 — Fix
- Fix in the correct layer (core → service → API)
- Use typed exceptions, not generic
Exception - Maintain thread safety if touching service layer
- Rollback semantics if touching multi-entity operations
Step 5 — Verify
- The reproduction test MUST now pass
- Run the test command and the type-check command (see project config)
Step 6 — Audit
- Are there similar patterns elsewhere that have the same bug?
- Does the fix maintain backwards compatibility?
- If the root cause was non-obvious, add a code comment explaining why
- If the issue could recur, suggest a preventive measure
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?