Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器clawhub未标认证来源可访问clear审计通过

bug-fixing错误修复

Agent Skill

bug-fixing 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

15,312

周安装

651

GitHub Stars

公开资料未说明

下载量

5,364
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:bug-fixing(错误修复)
来源仓库:https://github.com/tinkcarlos/bug-fixing
安装命令:
openclaw skills install bug-fixing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install bug-fixing

简介

结构化零回归错误修复工作流程助手。bug-fixing 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 从分类到知识沉淀提供七步闭环处理方案。
  • 适用于复杂问题排查和系统性缺陷修复场景。
  • 需配合具体代码上下文才能执行修复操作。
  • 修复前应备份原始代码防止意外覆盖。适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。

SKILL.md

name
bug-fixing-openclaw
description
|
Output
Bug summary + verification report + code review + self-reflection score.
allowed-tools
[read, write, execute, grep, glob]
metadata
language
en
version
4.0.0
last_updated
2026-03-06
platform
openclaw
enhancement

Bug Fix v4.0 — OpenClaw Edition (Zero-Regression + Portable)

Core Promise: Fix completely. Fix everywhere. Break nothing. Learn from every fix.


Iron Rules (12 — NEVER Violate)

┌──────────────────────────────────────────────────────────────────────────┐
│  Rule 1:  Root cause MUST pass 4 gates before fixing                     │
│           (reproducible + causal + reversible + mechanistic)              │
│                                                                          │
│  Rule 2:  Scope MUST pass 5 gates before fixing                          │
│           (consumers + contracts + invariants + call sites + dup scan)    │
│                                                                          │
│  Rule 3:  MUST trace IMPACT CHAIN (code → data → time → event)          │
│           + scan ALL files for same pattern before writing fix            │
│                                                                          │
│  Rule 4:  MUST predict side effects + check blind spots before coding    │
│           (references/blind-spots.md is single source of truth)           │
│                                                                          │
│  Rule 5:  After fix, MUST run regression verification                    │
│           (functional + performance + concurrency + all impact levels)    │
│                                                                          │
│  Rule 6:  MUST verify fix is LOADED at runtime                           │
│           (clear __pycache__ + restart + exercise code path)              │
│                                                                          │
│  Rule 7:  Framework behavior → read source code first, never trust       │
│           docs/comments/assumptions alone                                │
│                                                                          │
│  Rule 8:  UI bugs MUST gather RUNTIME EVIDENCE before proposing fixes    │
│           (screenshot + DevTools DOM/console + user repro steps)          │
│           Do NOT fix UI bugs based on code reading alone.                │
│                                                                          │
│  Rule 9:  Fix is NOT done until: Bug Summary output + code-review        │
│           passes + knowledge files updated + self-reflection complete     │
│                                                                          │
│  Rule 10: Before fixing, CLASSIFY the problem layer:                     │
│           code bug? missing config? wrong architecture? AI capability?   │
│           Fix at the root layer, not at the symptom layer.               │
│                                                                          │
│  Rule 11: Pattern matching (regex, string match, name lookup) MUST       │
│           check boundary conditions (word boundaries / anchors / exact)   │
│                                                                          │
│  Rule 12: Before fix, MUST search bug pattern library + bug records      │
│           for known fixes and historical context                         │
└──────────────────────────────────────────────────────────────────────────┘

Workflow Overview

Phase 0: Triage → Severity (P0-P3) + Tier (Trivial/Standard/Complex)
  │
  ├─ Trivial → Quick Fix → test → done
  │
  ├─ Standard ─┐
  └─ Complex ──┘
      │
Phase 1: Reproduce (evidence required)
      │
Phase 2: Root Cause Analysis
    2A: Hypothesis ladder → 5 Whys → evidence
    2B: Search knowledge files (bug-patterns + bug-records)
    2C: Impact chain (code + data + time + event)
    2D: Similar issue scan across codebase
      │
Phase 3: Scope + Prediction
    3A: Consumer list → contracts → invariants → dup scan (5 gates)
    3B: Side effect prediction + blind spot check
    3C: Fix strategy comparison (when >10 LOC, Complex only)
      │
Phase 4: Fix (minimal change, prefer ≤50 LOC)
      │
Phase 5: Verify + Review
    5A: Regression verification (functional + perf + concurrency)
    5B: Runtime deployment verification
    5C: Bug Summary + code-review skill
      │
Phase 6: Knowledge Deposit + Self-Reflection

Phase 0: Triage + Severity

Classify severity AND tier FIRST to control workflow depth.

Severity Classification (controls workflow depth)

SeverityCriteriaWorkflowTime-box
P0 CriticalProduction down / data loss / securityFULL (all phases)4h escalation
P1 HighCore feature broken / data corruptionFULL (all phases)8h escalation
P2 MediumNon-core feature / UI issueSTANDARD (skip 3C)16h
P3 LowCosmetic / minor edge caseQUICK (skip 2C, 2D, 3A-3C)No limit

Tier Classification (controls fix path)

TierCriteriaPath
TrivialTypo, config value, 1-line obvious fix, no behavioral changeQuick Fix (below)
StandardLogic bug, 1-3 files, clear symptom, no cross-module riskStandard Path (skip phases marked "Complex only")
ComplexCross-module, >3 files, shared utility, schema change, multi-processFull Path (all phases mandatory)

Quick Fix Path (Trivial only)

## Quick Fix
- Bug: [one-line description]
- Fix: [one-line change]
- File: [path:line]
- Test: [how verified — lint/test/manual]
- Risk: None (isolated, no behavioral change)

After quick fix: update references/bug-records.md, done. No RCA, no impact chain, no self-reflection needed.

If "trivial" fix touches >1 file or changes behavior → upgrade to Standard.

Auto-Initialize Knowledge Files

Check: references/bug-patterns.md exists?
  YES → search it in Phase 2B
  NO  → skip pattern search; create after first fix

Check: references/bug-records.md exists?
  YES → search it in Phase 2B
  NO  → skip records search; create after first fix

Check: references/blind-spots.md exists?
  YES → use it in Phase 3B
  NO  → skip blind spot check; create after first fix

Phase 1: Reproduce

MUST have evidence before continuing. No evidence = no fix.
Bug TypeEvidence Required
Backend errorStack trace + request/response
Frontend UIScreenshot + browser console + user repro steps (Rule 8)
PerformanceBefore/after metrics + profiler output
IntermittentTiming conditions + frequency estimate

UI Bug Protocol (Rule 8):

  1. Get user screenshot or screen recording
  2. Open browser DevTools → check Console for errors/warnings
  3. Inspect DOM structure (check for overflow clipping, z-index, Portal needs)
  4. Reproduce the exact user steps
  5. ONLY THEN form hypotheses

Evidence Bundle Template

### Trigger Conditions
- Input/params: [...]
- Environment: [OS/browser/runtime version]
- Timing: [action sequence or time interval]

### Observable Output
- Error message: [full error text]
- Logs: [key log lines]
- Screenshot/recording: [if available]

### Correlation IDs
- requestId/traceId: [...]
- sessionId: [...]

Phase 2: Root Cause Analysis

2A: Hypothesis Ladder

#HypothesisLikelihoodConfirmation TestRejection TestStatus
1[description]High/Med/Low[prove it IS this][prove it is NOT this][ ]

Rules: Sort by likelihood → each must be falsifiable → run rejection tests first → test ONE at a time → use 5 Whys to reach root cause.

Root Cause Confirmation Gate (Rule 1)

Root cause is confirmed only when ALL 4 conditions are met:

GateMeaning
ReproducibleCan trigger symptom in controlled scenario
CausalMinimal change makes bug disappear
ReversibleReverting the change makes bug reappear
MechanisticCan point to exact code path / state transition

Framework Assumption Audit (Rule 7)

When fix involves framework/library behavior: list assumptions → read source code to verify → document in comments with source references.

2B: Search Knowledge Files (Rule 12)

Search bug-patterns.md and bug-records.md for matching patterns. Skip if files don't exist (see Phase 0 auto-init).
Match LevelAction
High (symptom + root cause match)Apply known fix, can skip remaining RCA
Medium (similar symptom)Reference strategy, verify
No matchFull investigation, must deposit after fix

2C: Impact Chain (Rule 3)

DimensionWhat to Check
CodeBug file → direct callers → indirect callers → deep callers
DataCorrupted records in DB/file/cache? Repair script needed?
TimeWhen introduced? Duration of exposure? Users affected?
EventMessage queues, WebSocket, background workers affected?

2D: Similar Issue Scan (Rule 3)

Scan ALL files for the same bug pattern, not just the reported file.
rg -n "function_name\|similar_pattern" --glob "*.{ts,tsx,py,js}"

Phase 3: Scope + Prediction

Scope Accuracy Gate (Rule 2)

#GateMeaning
1Consumer ListAll consumers (callers/dependents) enumerated
2Contract ListModified contracts/interfaces/behaviors listed
3Invariant CheckMust-hold invariants listed
4Call Site EnumAll call sites enumerated and classified
5Duplicate ScanNo parallel implementation left unfixed

3A: Side Effect Prediction (Rule 4)

  1. Change Blueprint — What exactly will change
  2. Impact Ripple — L0 (code) → L1 (module) → L2 (feature) → L3 (system) → L4 (user)
  3. Blind Spot Check — Read references/blind-spots.md and execute every active check
  4. Go/No-Go Decision

Quick version (for Standard-tier, ≤5 LOC, 1 file):

## Quick Impact Check
- Change: [one-line description]
- Direct callers: [list or "none - local function"]
- Duplicates: [checked — none / found and planned]
- Could break: [prediction or "low risk - isolated"]
- Decision: GO

3B: Fix Strategy Comparison (>10 LOC, Complex only)

DimensionStrategy AStrategy B
LOC change
Impact scope
Regression risk
Rollback-able

Phase 4: Fix

  • Minimal change, prefer ≤50 LOC; justify if more
  • ONE change at a time, never batch unrelated fixes
  • Layer Rule (Rule 10): Before writing fix code, verify you're fixing the right layer:
Problem in…Fix…Do NOT fix…
Params/configConfig or param passingBusiness logic
Single componentThat componentFramework
Multiple components same issueFramework/base classEach component one by one
Docs vs code mismatchBoth sides in syncOnly one side
  • Pattern matching safety (Rule 11): regex, string match, name lookup → always consider boundary conditions
  • DB schema change? Generate Alembic migration:
  cd backend && alembic revision --autogenerate -m "describe change"

Phase 5: Verify + Review

5A: Regression Verification (Rule 5)

CategoryChecks
FunctionalUnit tests + integration + API + E2E + manual
PerformanceNo N+1 queries, no resource leaks, no response time increase
ConcurrencyThread-safe shared state, atomic operations, no race conditions

Test the entire impact chain (L0-L3), not just the original bug.

5B: Runtime Deployment Verification (Rule 6)

StepActionEvidence
1Clear Python bytecode cache__pycache__ removed
2Restart backend servicePID changed from X to Y
3Health check passes/docs returns 200
4Exercise the fixed code pathRequest triggers fixed logic

If NOT deployed → restart and re-verify before proceeding.

5C: Bug Summary + Code Review (Rule 9)

## Bug Summary [BUG-XXX]
- **Symptom**: [one-sentence user-visible problem]
- **Root Cause**: [one-sentence actual cause]
- **Fix**: [one-sentence fix description]
- **Files Modified**: [file1.py, file2.ts]
- **Severity**: P0/P1/P2

Output Bug Summary → run code-review skill → if review finds issues → fix → re-verify

Stop condition: Code review clean + regression passed + deployment verified + original bug fixed.

Special Checks

Bug TypeKey Checks
API BugFrontend → API → Schema → Service → DB chain; field completeness
DB MigrationModel changed → alembic revision --autogenerate; no migration = schema drift
System-levelDraw E2E chain; define handshake evidence per edge; insert probes first
Cross-SurfaceShared artifact → identify contract → consumer list → regression matrix

Phase 6: Knowledge Deposit + Self-Reflection

6.1 Update Knowledge Files (Rule 9)

FileWhen to Update
references/bug-records.mdEvery fix (project history)
references/bug-patterns.mdNew pattern / new fix strategy (universal)
references/blind-spots.mdNew blind spot discovered

6.2 Self-Reflection (Rule 9)

DimensionScore (1-5)Evidence
First-time correctness[1-5]Did the fix work on first attempt?
Scope accuracy[1-5]Did I find all affected areas?
Minimal change[1-5]Was the change as small as possible?
Side effect prediction[1-5]Did I predict all side effects?
Root cause depth[1-5]Did I fix root cause, not symptom?
Total[/25]
IssueWhat HappenedWhy I Missed ItPrevention

Regression Autopsy (when fix introduced a regression)

- **Original Bug**: [what was being fixed]
- **New Bug Introduced**: [what broke]
- **Why I didn't predict it**: [blind spot]
- **Classification**: [missed consumer / contract violation / edge case / ...]

Domain-Specific Checks

Bug TypeKey Checks
Backend/APISchema drift, timeout/retry, transactions, N+1, connection pool, ORM lazy loading
Frontend/UIState (useEffect deps, unmount), race conditions, CORS, hydration, overflow/Portal
System-levelCross-layer chain, async/streaming, IPC, routing
FrameworkRead source code first (Rule 7), verify assumptions with tests
AI/LLMTool binding modes, simulated vs native, streaming, token limits

Skill Delegation

TriggerDelegate To
Need new API endpointfullstack-developer
UI fix neededfrontend-design
Schema change neededdatabase-migrations
After fix (mandatory)code-review

Anti-Patterns (FORBIDDEN)

ForbiddenCorrect
Fix without RCAHypothesis ladder first
Single hypothesis then fixList 3-5 hypotheses, verify each
Fix UI bug by code reading aloneGet runtime evidence first (Rule 8)
Skip consumer list for shared codeFill consumer list first
Tests pass but server runs old codeClear cache + restart + verify fix is live (Rule 6)
Fix code but ignore corrupted dataAssess data impact + repair if needed
Trust framework docs blindlyRead source code or run tests (Rule 7)
Fix one copy, miss the duplicateGrep function name; check both Path A and Path B
Pattern match without boundary checkAdd word boundaries / anchors / exact match (Rule 11)
Model changed but no migrationRun alembic revision --autogenerate
Use full workflow for a typoUse Quick Fix path (Phase 0 Trivial tier)
Skip self-reflectionMust score, analyze, and learn

Final Checklist

Core (Standard + Complex tiers)

#CheckPhase
1Severity (P0-P3) + Tier (Trivial/Standard/Complex) classified0
2Root cause passes 4 gates2A
3Bug pattern library + records searched2B
4Impact chain traced (code+data+time+event)2C
5Similar issue scan completed2D
6Scope passes 5 gates (incl. duplicate scan)3A
7Side effect prediction + blind spot check3A
8Regression verification ALL passed (L0-L3)5A
9Runtime deployment verified5B
10Bug Summary output + code-review passed5C
11Knowledge files updated6.1
12Self-reflection completed6.2
13If DB model changed: Alembic migration generated5
14User confirmed fix + no new bugsFinal

Trivial Tier Checklist (Quick Fix path only)

#CheckStatus
1Fix applied and tested (lint/test/manual)[ ]
2Bug record entry added[ ]
3No behavioral change introduced[ ]

OpenClaw Project Context

Architecture Map

backend/app/
├── api/v1/              # FastAPI routes (agents, auth, chat, skills, tools, profile)
├── core/
│   ├── graph/           # LangGraph StateGraph (agent_graph, nodes/llm_node, tool_node, prepare_node)
│   ├── langchain/       # LangChain tools (tools.py, shell_tool.py, e2b_tools.py)
│   ├── mcp/             # MCP server integration (pool.py)
│   ├── database.py      # SQLAlchemy async engine
│   └── security.py      # JWT auth
├── models/              # SQLAlchemy ORM models (agent, tool, user, skill)
├── schemas/             # Pydantic request/response schemas
├── services/            # Business logic (agent_executor, chat_service, tool_call_parser, ...)
├── middleware/           # Request logging, audit, error handling
└── main.py              # FastAPI app entry

frontend/src/
├── features/            # Feature modules (chat, settings, admin, knowledge, skills, agents)
│   ├── chat/            # ChatPageV2, MessageRenderer, ToolCallCard, SkillExecutionInline
│   └── ...
├── components/ui/       # shadcn/ui style components (dialog, switch, checkbox)
├── hooks/               # React hooks (useChatStream — SSE event handling)
├── store/               # Zustand state management
└── lib/                 # API client (api-client.ts), markdown utils

Tech Stack

LayerTechnology
BackendFastAPI + Python 3.11+
ORMSQLAlchemy 2.0 (async)
DBPostgreSQL (asyncpg) or MySQL (aiomysql)
MigrationsAlembic (backend/alembic/)
CacheRedis
AILangChain 0.3.x + LangGraph 0.4.x
Vector DBChromaDB
FrontendReact 18 + Vite + TypeScript
UIRadix UI + Tailwind CSS
StateZustand + TanStack Query
Testspytest (backend), Vitest (frontend)
DeployDocker Compose, supports PyInstaller desktop build

High-Risk Bug Zones

Backend Hot Zones

ZoneFilesWhy It's High-Risk
Simulated Tool Call Parsingservices/tool_call_parser.py, core/graph/nodes/llm_node.pyRegex-based; dual implementations; multi-arg edge cases
Agent Executorservices/agent_executor.py3000+ LOC; native + simulated modes; complex streaming
Tool Argument Remappingcore/graph/nodes/tool_node.pyLLM wrong param names → alphabetical guess
LLM Streaming (httpx)services/llm_manager.pyReasoning model fallback; SSE; reasoning_content
MCP Tool Integrationcore/mcp/pool.py, services/tool_service.pyMCP lifecycle; command vs HTTP; timeout
Skill Runtimeservices/skill_executor.py, services/skill_service.pyScript exec; env var injection; enhanced vs local
Chat Streamingservices/chat_service.pySSE events; client disconnect; async save
Memory Systemservices/unified_memory_manager.pyL1/L2; embedding scoring; slow queries

Frontend Hot Zones

ZoneFilesWhy It's High-Risk
SSE Chat Streamhooks/useChatStream.tsEvent parsing; reconnection; reasoning_content
Tool Call Renderingfeatures/chat/components/ToolCallCard.tsxDynamic display; error states; loading
Skill Execution UIfeatures/chat/components/SkillExecutionInline.tsxInline status; progress; error display
Markdown Rendererfeatures/chat/components/MarkdownRenderer.tsxNested code fences; special chars; XSS
Agent Editorfeatures/agents/AgentEditorPage.tsxComplex form state; tool/skill/KB associations
Zustand Storestore/State updates not re-rendering if reference unchanged

Two Code Paths for Agent Execution

Path A: Direct Executor (most common)
  chat API → chat_service → agent_executor.py → tool_call_parser.py → tool execution

Path B: StateGraph (LangGraph)
  chat API → chat_service → agent_graph.py → llm_node.py → tool_node.py → tool execution

When fixing anything in Path A, always check Path B for the same issue (and vice versa).

Known Duplicate Implementations

Function / FeaturePrimary LocationKnown Alternate Location
parse_simulated_tool_callsservices/tool_call_parser.pycore/graph/nodes/llm_node.py
Tool loading / bindingservices/agent_executor.pycore/graph/agent_graph.py
Token countingservices/token_counter.pyMay have inline counting in agent_executor.py
Memory managementservices/unified_memory_manager.pycore/graph/nodes/prepare_node.py

OpenClaw Common Framework Pitfalls (Rule 7)

AreaAssumptionReality
Config load orderFirst file has priorityOften last file wins (dict.update)
ORM lazy loadingRelations auto-loadDefault lazy, causes N+1
Async on WindowsSame as LinuxWindows uses ProactorEventLoop; run_dev.py forces SelectorEventLoop
Pydantic serializationmodel_dump() includes allexclude_unset=True changes behavior
LangChain tool bindingAll models support toolsReasoning models need simulated mode
__pycache__Python uses latest sourceStale .pyc can persist across restarts

Windows Development Environment Gotchas

IssueSymptomWorkaround
Path separators\ vs /Use pathlib.Path or os.path.join
asyncio event loopProactorEventLoop defaultrun_dev.py forces loop="asyncio"
__pycache__ file locksCan't delete while runningKill process FIRST, then clean
Console encodingGBK/CP936 defaultsys.stdout.reconfigure(encoding='utf-8')
Playwright on WindowsBrowser launch may failRuns in separate thread with own loop

Verification Commands (OpenClaw)

Backend

cd backend
ruff check app/                                    # Lint
python -m pytest tests/ -v --tb=short              # Unit tests
python -m pytest tests/test_specific.py -v         # Specific test
alembic revision --autogenerate -m "check"         # DB migration check

Frontend

cd frontend
npm run lint
npm run typecheck
npm test
npm run build

Backend Server Restart

Get-WmiObject Win32_Process -Filter "Name='python.exe'" | Where { $_.CommandLine -like "*run_dev*" }
Stop-Process -Id [PID] -Force
Get-ChildItem -Path "backend" -Recurse -Filter "__pycache__" -Directory | Remove-Item -Recurse -Force
Start-Process -FilePath "backend\venv\Scripts\python.exe" -ArgumentList "run_dev.py" -WorkingDirectory "backend"
Invoke-WebRequest -Uri "http://127.0.0.1:8000/docs" -UseBasicParsing -TimeoutSec 5

Reference Files

Living Data Files (update after every fix)

FilePurpose
references/bug-records.mdProject-specific bug history
references/blind-spots.mdSingle source of truth for AI blind spot registry

Pattern Libraries (domain knowledge)

FilePurpose
references/bug-patterns.mdUniversal bug pattern library (11 categories)
references/backend-patterns.mdBackend issues (API, ORM, LLM integration, OpenClaw-specific)
references/frontend-patterns.mdFrontend issues (React hooks, race conditions, CORS)

Detailed Guides

FilePurpose
references/system-rca.mdSystem-level RCA (cross-layer, multi-process bugs)
references/regression-matrix.mdComplete zero-regression verification matrix

Skill Evolution

Update this skill when:

  • Code review finds a bug that the workflow should have prevented
  • A recurring bug class repeats across fixes

Prefer updating specific sections over adding new rules. After updates, validate that the workflow is still coherent and not overly bureaucratic.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

85.09%
按下载量换算4,564

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills