用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Tzeusy/butlers --skill self-healing命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Guide for discovering, analyzing, and pruning the Butlers test suite. Use when working on test condensation beads (Phase 1 epic bu-rhztl and Phase 2 epic bu-hg8rl both CLOSED; Phase 3 maintenance cycle underway 2026-06-21), assessing test bloat, identifying pruning targets, or rewriting tests to be contract-driven. Triggers on test reduction, test pruning, test consolidation, or condensation tasks for this project. Also use when a fresh session needs to assess test health, create new condensation beads, or resume in-progress condensation work.
Generate a weekly home energy digest with trends, top consumers, and recommendations.
Orchestrate a UX redesign of a Butlers dashboard page (or sub-page set) using /project-direction as the spec+beads engine, with redesign-specific upfront phases for vision capture, asset ingestion, impact analysis, backend-contract derivation, LLM-cost feasibility, manifesto/identity preservation, and a th-design design-bar audit. The binding design language is the Dispatch spec (openspec/specs/dashboard-design-language/spec.md); bundles live under pr/overview/ and resolve via references/bundle-registry.md. Use when asked to redesign a dashboard page, with or without a Claude Design bundle. Triggers on "redesign the X page", "plan the Y redesign", "integrate the redesign bundle", "what would it take to ship the SLUG redesign", "design language integration for AREA".
正在显示 SKILL.md
基于 SOC 职业分类
| name | self-healing |
| description | How to report unexpected errors for automated investigation via the report_error and get_healing_status MCP tools. |
When you encounter an unexpected error that appears to be a code bug, report it using the report_error tool. This triggers automated investigation and a proposed fix via PR — no human intervention needed to start the loop.
DO report when:
DO NOT report when:
asyncio.CancelledError or KeyboardInterrupt (these are intentional)Call report_error with as much structured context as possible:
report_error(
error_type="asyncpg.exceptions.UndefinedTableError", # required: fully qualified class name
error_message="relation \"butler_name.missing_table\" does not exist", # required: exact message
traceback="Traceback (most recent call last):...", # recommended: full traceback
call_site="src/butlers/modules/memory/tools/facts.py:memory_store_fact", # your best guess
context="I was storing a new fact for the memory module. The table appears to be missing "
"from the schema — likely a migration that was not applied.",
tool_name="memory_store_fact", # which MCP tool raised the error
severity_hint="high", # critical/high/medium/low
)
| Parameter | What to include |
|---|---|
error_type | Fully qualified exception class name. Check type(exc).__name__ and type(exc).__module__. |
error_message | The exact exception message, unmodified. |
traceback | The full traceback string. Paste it verbatim — the system sanitises dynamic values. |
call_site | <relative-file-path>:<function-name> of where the error occurred. Omit line number. |
context | Your analysis (see below). |
tool_name | The MCP tool name if the error came from a specific tool call. |
severity_hint | critical = data loss/security; high = broken functionality; medium = degraded behaviour; low = cosmetic/non-blocking. |
The context field is the most valuable input for the healing agent. Include:
Keep it under 500 words. Focus on what a developer would need to know to reproduce and fix the bug.
CRITICAL: Never include user data in error reports.
The healing agent creates a public GitHub PR. Any data you include may become public.
Never include:
Instead, describe patterns and types:
The system automatically sanitises error messages and tracebacks, but your context field is free-form — you are responsible for keeping it clean.
{"accepted": true, "fingerprint": "abc123...", "attempt_id": "...", "message": "Healing agent dispatched"}
A healing agent has been dispatched to investigate. Continue your session — attempt a workaround if possible, or inform the user the issue has been flagged for investigation. You do not need to wait for the healing agent to finish.
{"accepted": false, "reason": "already_investigating", "attempt_id": "...", "message": "This error is already under investigation"}
This exact error is already being worked on. Continue your session — a fix may arrive via PR soon.
{"accepted": false, "reason": "cooldown", "message": "Cooldown period active..."}
The system has decided not to investigate at this time (cooldown, concurrency cap, circuit breaker, or no model available). This is fine — continue your session normally and do not retry report_error for the same error.
If you encounter an error you previously reported (same exception type and call site pattern), you can optionally check its status:
# Check by fingerprint (from a previous report_error response)
get_healing_status(fingerprint="abc123...")
# List recent attempts for this butler
get_healing_status()
| Status | Meaning |
|---|---|
investigating | Healing agent is actively working on a fix |
pr_open | A fix PR has been created; awaiting human review |
pr_merged | Fix was merged — the error should resolve after the next deployment |
failed | Healing agent encountered an error or could not produce a fix |
unfixable | Agent determined this is not a code bug (external service, data issue) |
timeout | Agent exceeded the time limit |
anonymization_failed | Fix was produced but PR was blocked by PII detection |
If status is pr_merged, note that a fix was deployed and the error may resolve after a restart.
This section is for healing agents — Claude instances spawned inside a healing worktree to investigate a reported error.
After investigating the root cause, you have two outcomes:
Write the fix, add tests, and commit as normal. The dispatcher detects commits on the branch and opens a PR automatically. Do NOT push yourself.
If you determine the error is not a code bug — for example:
Then signal this by:
Create a file named UNFIXABLE in the worktree root with a plain-text explanation (≤500 words). Include:
Commit the file:
git add UNFIXABLE
git commit -m "chore: unfixable — <brief reason>"
Exit normally. The dispatcher detects the UNFIXABLE file after your session ends and transitions the attempt to unfixable status instead of opening a PR.
UNFIXABLE file content rules:
Example UNFIXABLE file:
Root cause: The external payment processor API is returning HTTP 503 errors.
This is a transient upstream outage, not a bug in this butler's code.
The API endpoint https://api.payments.example.com/v1/charge returns
HTTP 503 with body {"error": "service_unavailable"} for all requests.
Recommendation:
1. Check the payment processor's status page for an active incident.
2. If the outage persists > 1 hour, consider switching to the backup payment
provider configured in butler.toml under [modules.payments.fallback].
3. No code changes are required — retry once the upstream service recovers.
report_error(
error_type="asyncpg.exceptions.ForeignKeyViolationError",
error_message="insert or update on table \"events\" violates foreign key constraint",
traceback="Traceback (most recent call last):\n File \"src/butlers/modules/calendar/tools.py\", line 42, in create_event\n ...",
call_site="src/butlers/modules/calendar/tools.py:create_event",
context=(
"I was trying to create a calendar event for the butler's schedule. "
"The foreign key violation suggests the referenced contact_id does not exist "
"in the contacts table. This may be a race condition where the contact record "
"is created after the event is inserted, or a missing ON CONFLICT clause. "
"The error is consistent across multiple attempts with valid-looking contact IDs."
),
tool_name="calendar_create_event",
severity_hint="high",
)
# DO NOT DO THIS
report_error(
error_type="ValueError",
error_message="Invalid email address",
context="User john@example.com tried to schedule a meeting with alice@company.com at 2pm on March 15.", # NEVER include actual user data
)
# DO NOT DO THIS for rate limits or transient network errors
report_error(
error_type="httpx.TimeoutException",
error_message="Request timed out",
context="The API timed out.", # Retry first; only report if it's a systemic bug
)