AGENT SKILL

oma-debug

Bug diagnosis and fixing specialist - analyzes errors, identifies root causes, provides fixes, and writes regression tests. Use for bug, debug, error, crash, traceback, exception, and regression work.

适用职业开发工程师
License 许可
MIT
最近更新
2026-11-10
Stars
★ 1
Forks
0

01 前言 Front Matter

name
oma-debug
description
Bug diagnosis and fixing specialist - analyzes errors, identifies root causes, provides fixes, and writes regression tests. Use for bug, debug, error, crash, traceback, exception, and regression work.

02 资源文件 6

03 SKILL.md 正文

Debug Agent - Bug Fixing Specialist

Scheduling

Goal

Reproduce, diagnose, minimally fix, and regression-test bugs while preserving scope discipline and documenting root cause.

Intent signature

  • User reports a bug, crash, traceback, exception, error message, performance issue, intermittent failure, or regression.
  • User needs root cause analysis plus a minimal code fix and regression test.

When to use

  • User reports a bug with error messages
  • Something is broken and needs fixing
  • Performance issues or slowdowns
  • Intermittent failures or race conditions
  • Regression bugs

When NOT to use

  • Building new features -> use Frontend/Backend/Mobile agents
  • General code review -> use QA Agent

Expected inputs

  • Error message, failing behavior, reproduction steps, logs, test failure, or affected code path
  • Existing tests, stack traces, environment notes, and suspected regression boundary

Expected outputs

  • Root cause explanation
  • Minimal fix scoped to the failing behavior
  • Regression test or explicit reason it cannot be added
  • Bug documentation under .agents/results/bugs/ when appropriate

Dependencies

  • resources/execution-protocol.md, examples, checklist, common patterns, and debugging checklist
  • Local codebase search and symbol/reference tools
  • Project test, lint, typecheck, and runtime commands

Control-flow features

  • Branches by reproduction success, error class, suspected layer, and verification outcome
  • Reads logs/code/tests and writes code/tests/docs
  • Must search for similar patterns after fixing

Structural Flow

Entry

  1. Capture the reported symptom and suspected scope.
  2. Reproduce or establish the closest reliable failing signal.
  3. Identify affected files, tests, and related patterns.

Scenes

  1. PREPARE: Gather symptoms, logs, reproduction path, and verification command.
  2. ACQUIRE: Read failing code, tests, references, and similar patterns.
  3. REASON: Isolate root cause and reject unsupported hypotheses.
  4. ACT: Apply minimal fix and regression test.
  5. VERIFY: Re-run failing and related checks.
  6. FINALIZE: Document root cause, fix, test, and residual risk.

Transitions

  • If reproduction fails, use logs/tests to establish a weaker but explicit diagnostic signal.
  • If the first fix fails verification, return to root-cause analysis.
  • If similar patterns exist, inspect and patch only affected cases.
  • If the request is actually feature work, route to the relevant implementation skill.

Failure and recovery

  • If environment is missing, document the blocker and provide the closest static diagnosis.
  • If no regression test is feasible, explain why and include manual verification.
  • If fix scope grows, stop and call out the broader design issue.

Exit

  • Success: bug is fixed, regression coverage exists, and checks pass.
  • Partial success: root cause or verification blocker is explicit.

Logical Operations

Actions

Action SSL primitive Evidence
Reproduce failure CALL_TOOL Test/runtime/log command
Search affected code READ Code, tests, symbols, references
Compare similar patterns COMPARE Pattern search
Infer root cause INFER Diagnostic reasoning
Write minimal fix WRITE Code patch
Write regression test WRITE Test patch
Verify behavior VALIDATE Tests/checks
Report result NOTIFY Root-cause summary

Tools and instruments

  • Project test, lint, typecheck, runtime, and logging commands
  • Configured code-intelligence symbol/reference/pattern search with native fallback
  • Debugging checklist and bug report template

Canonical workflow path

rg "<error-message-or-symbol>"
rg --files

Then run the smallest reproduction command first, add a regression test, and re-run the failing check plus related tests.

Resource scope

Scope Resource target
CODEBASE Failing source, tests, and related patterns
LOCAL_FS Bug reports and result artifacts
PROCESS Reproduction and verification commands
MEMORY Hypotheses, root-cause notes, verification evidence

Preconditions

  • A bug signal, symptom, or failing behavior is available.
  • Relevant code and verification path can be inspected or the blocker is stated.

Effects and side effects

  • Mutates source/tests only as needed for the fix.
  • May create bug documentation under .agents/results/bugs/.

Guardrails

  1. Reproduce first, then diagnose - never guess at fixes
  2. Identify root cause, not just symptoms
  3. Minimal fix: change only what's necessary
  4. Every fix gets a regression test
  5. Search for similar patterns elsewhere after fixing
  6. Document in .agents/results/bugs/

Code intelligence

Use the configured provider to locate the failing function, find callers, and search similar error patterns. Native search and scoped reads are supported fallbacks; see the shared capability contract.

References

  • Local code tools: ../_shared/core/code-intelligence.md (code search/navigation)

  • Execution steps (follow for the selected task): resources/execution-protocol.md

  • Checklist (pre-submit self-verification): resources/checklist.md

  • Error recovery: resources/error-playbook.md

  • Bug report template: resources/bug-report-template.md

  • Common patterns: resources/common-patterns.md

  • Debugging checklist (investigation guide, used during Steps 1-2): resources/debugging-checklist.md

  • Context loading: ../_shared/core/context-loading.md

  • Context budget: ../_shared/core/context-budget.md

  • Lessons learned: ../_shared/core/lessons-learned.md

  • Observability handoff: ../oma-observability/SKILL.md §Integrations — traces/logs by trace_id, 6-dim forensics

04 同仓库更多 Skills

vasceannie
vasceannie/slopgate

type-strictness

Enforce strict type compliance by eliminating `Any` types and `# type: ignore` comments. Use when: (1) Editing code that contains `Any` as a type annotation (2) Code has `# type: ignore` or `# pyright: ignore` comments (3) User requests type fixes or type strictness enforcement (4) Importing from untyped third-party libraries (5) User asks to "fix types", "remove Any", or "add proper typing" (6) Pyrefly or mypy reports type errors that need resolution (7) Code review reveals weak typing patterns Follows hierarchical resolution: codebase inference → type stubs → library inspection → type guards → casting (last resort).

代码审查
★ 1
vasceannie
vasceannie/slopgate

slopgate-test-extender

Extend Python test suites with parametrization, fixture reuse, and quality enforcement. Use when asked to add tests, extend existing tests, improve test coverage, consolidate duplicate tests, fix test quality issues, or when Slopgate reports untested-production-code, missing test references, or coverage gaps. Triggers on requests like "add tests for X", "extend these tests", "parametrize tests", "consolidate tests", "fix test quality", "improve test coverage", "write tests for this function", "test this module", "behavior tests", "integration tests", "missing tests", "coverage holes", "untested code", or when a hook denies with test-related findings.

代码审查测试与质量
★ 1
vasceannie
vasceannie/slopgate

slopgate-intelligent-coding-patterns

Pattern-selection playbook for agents editing code with complex branching, stateful parsers/workflows, duplicated skeletons, policy checks, or ordered transforms. Load before refactoring if/elif dispatch chains, boolean-flag state machines, repeated validation predicates, parallel provider/language implementations, or regex/content transformation pipelines. Also load when asked to "apply a design pattern", "which pattern should I use here", "refactor this switch statement", "replace if-elif chain", "state machine pattern", "strategy pattern", "template method", "pipeline pattern", "specification pattern", "dispatch table", "guard clause refactor", "reduce cyclomatic complexity", or when Slopgate fires PY-CODE-014, PY-CODE-017, PY-CODE-018, QUALITY-LINT-001, or PY-QUALITY-010. Use with behavior-locking tests and avoid pattern theater for simple one-off code.

开发工程师设计师代码审查视觉设计
★ 1
vasceannie
vasceannie/slopgate

slopgate-hygiene-orchestrator

Orchestrate systematic elimination of linter warnings and errors across Python, TypeScript, and Rust codebases. Use when asked to "clean up lints", "fix all warnings", "run hygiene", "eliminate type errors", "orchestrate code quality fixes", "fix lint errors", "resolve quality gate failures", "pass CI checks", "reduce tech debt", "refactor to pass hooks", or when a Slopgate hook denies with QUALITY-LINT-001, PY-CODE-017, PY-CODE-018, or any collector finding. This skill coordinates multiple code-hygiene-enforcer agents working in parallel on non-conflicting file groupings, tracks progress persistently via JSON exports, and loops until all issues are resolved. CRITICAL: Never run linters directly—always use `slopgate lint check` as the primary gate, discover project-specific tools from config files, and export findings to JSON for tracking.

代码审查Skill与智能体开发
★ 1
vasceannie
vasceannie/slopgate

slopgate-code-smell-utility-locator

Autoactivate when code-smell hooks or reviews mention feature envy, thin wrappers, duplicate helpers, duplicate code, scattered helpers, builders/factories/config/constants/dataclass reuse, PY-CODE-012, PY-CODE-013, QUALITY-LINT-001, or repeated slopgate code-quality denials. Also load when asked to "find existing helpers", "consolidate utilities", "search for duplicate code", "where is this already implemented", "reuse existing logic", "don't duplicate this", "find similar functions", "utility inventory", "code smell radar", or before adding new helpers/wrappers so agents can find existing shared utilities and consolidate instead of duplicating.

开发工程师代码审查
★ 1
vasceannie
vasceannie/slopgate

slopgate-code-hygiene-refactor

Recovery playbook for Slopgate and project quality failures. Load after hook/lint denials such as PY-CODE-017 flat sibling modules, PY-CODE-018 oversized modules, QUALITY-LINT-001 post-edit quality backstops, PY-QUALITY-010 magic numbers / repeated literals, PY-CODE-012/PY-CODE-013 smell findings, type-suppression bans, duplicate helpers, or repeated hygiene retry loops. Also load when asked to "refactor this module", "split this file", "extract a class", "reduce complexity", "fix god class", "flatten module hierarchy", "move code to a package", "extract helpers", "consolidate duplicates", "replace magic numbers with constants", or when a hook blocks an edit with structural complaints. Focuses on preserving public APIs while refactoring toward packages, cohesive modules, typed seams, and focused tests.

开发工程师代码审查
★ 1