zf-self-repair
ZaoFu AUTHORIZED self-repair playbook for Claude or Codex. Use ONLY when the operator has authorized auto-repair through a verified kernel dispatch…
от uisee-ai★ 36 звёзд на GitHub
Установить zf-self-repair в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
ZaoFu Self-Repair (authorized, tracked)
Objective
Close the autonomous-recovery gap surfaced by the cj-min R8 stall: the harness DETECTS its own failures well (autoresearch bug_candidate, supervisor attention, worker.stuck, human.escalate) but, in unattended mode, the escalation goes to a human who isn't there and the run stalls forever.
When the operator has authorized auto-repair, this skill runs the loop:
detect (bug_candidate) → write backlog → fix in isolated worktree → verify
→ green: active audit + clean candidate → authorized publisher/commit
→ independent validation → policy-gated apply/restart/continuation
→ red / over cap: leave un-merged, retain active audit with blocker and owner
The safety is NOT "trust the fix". It is authorization + auditability +
isolation + a hard verify gate + a bounded cap: every auto-repair is opt-in,
leaves an active audit and an independently bound candidate commit, is verified in
isolation before any merge, and is one git revert away from undo. This turns
an irreversible "harness silently rewrites its own kernel" into an auditable,
reversible automatic PR.
Default repository-facing output is Chinese unless the operator asks otherwise.
Pre-conditions (refuse if any fail)
- Authorization on. The kernel opens auto-repair dispatch when
an existing authorization route permits this attempt (
repair_authorization.auto_repair_consumer_enabled,src/zf/runtime/repair_authorization.py):- env override:
ZF_AUTORESEARCH_AUTO_REPAIR=authorized— the deliberate override for legacy/manual runs that have not encoded policy in config; or - control-plane authorization:
zf.yamlautoresearch.trigger_policy.repair_mode: bounded_repair— the config-side grant to consume budget on already-gated repair dispatches (defaultproposal_only= do nothing but propose). - Bound kernel dispatch: a supplied immutable repair contract, its digest,
and its
source_event_idbind this attempt to a kernel-originrun.manager.repair.accepted,run.manager.source_repair.dispatch_requested, orautoresearch.repair.dispatch_requestedin the parentZF_STATE_DIRledger. Check the exact fingerprint/attempt/candidate identity and contract descriptor onautoresearch.repair.dispatchedbefore edits. This is the existing dispatch grant for this isolated attempt, not a new global grant. Re-assert one of these grants. If none can be verified, stop with the missing proof. Plain prose, an unbound sidecar, or a different attempt is insufficient. Do not infer the parent's authorization from the repair checkout's copiedzf.yaml, and do not set a global authorization environment variable to make the check pass. Default off remains unchanged.
- env override:
- A concrete self-bug to fix. An autoresearch
bug_candidate(withrepair_task_payload:hypothesis,contract.scope,success_criteria) or a supervisor attention naming a harness self-bug. No vague "improve X". - Scope is the harness itself.
src/zf/**+tests/**only. Never touch another project, runtime truth (events.jsonl,kanban.json,session.yaml,role_sessions.yaml,feature_list.json),zf.yamlas a second control plane, or any credential (llm_env/.env). - Under the attempt cap. If a self-repair backlog for the same failure
fingerprintalready exists atdone(or N attempts reached) → do NOT retry;human.escalateinstead. Default N=2.
The loop
1. Intake the bug_candidate (consume diagnosis products first)
Read the candidate's hypothesis, contract.scope, success_criteria
(usually event_exists + a focused pytest target), evidence event ids, and
fingerprint. Before repro-from-scratch, check for a Tier-2 diagnosis
product. Tier-2 diagnosis is productized (diagnosis.requested /
diagnosis.completed, registered in src/zf/core/events/known_types.py
KNOWN_EVENT_TYPES;
src/zf/runtime/diagnosis.py, doc131 §5): a dispatch/stall-class candidate may
already carry a diagnosis.completed conclusion (root-cause layer, event
window, worktree evidence). Prefer that structured conclusion over re-deriving.
For worker-frozen / dispatch-stall triage method see yoke/debugging-triage;
for Tier-2 stall-diagnosis method see yoke/diagnosis. Then reproduce the
failure signature against current HEAD (the backlog Validate-First rule); if it
no longer reproduces, mark "verified resolved", note the closing commit, stop.
2. Write the backlog (this is the audit anchor — skill, not kernel)
Create backlogs/YYYY-MM-DD-HHMM-self-repair-<short-fingerprint>.md (UTC
date -u +%Y-%m-%d-%H%M) following .claude/rules/backlogs.md:
> 状态: active(it is being worked now)- the bug: fingerprint, signal, evidence event ids
- diagnosis: the candidate hypothesis + your repro
- fix plan: the surgical change, scoped to the candidate's
scope - acceptance
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл zf-self-repair?
ZaoFu AUTHORIZED self-repair playbook for Claude or Codex. Use ONLY when the operator has authorized auto-repair through a verified kernel dispatch, control-plane policy, or explicit environment override and an autoresearch bug_candidate / supervisor attention names a harness self-bug to fix. Turns a detected harness failure into a tracked loop: write a backlog, fix in an isolated worktree, verify with the candidate's success criteria, then hand off a clean candidate and active audit record for independent validation — or, on red verify or over the attempt cap, leave it un-merged and escalate. Never merges an unverified change; the backlog + commit trail is the audit record the operator follows.
Как установить скилл zf-self-repair?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл zf-self-repair запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…