Command Palette

Search for a command to run...

Назад к скиллам
скилл № 60568

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от 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)

  1. 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.yaml autoresearch.trigger_policy.repair_mode: bounded_repair — the config-side grant to consume budget on already-gated repair dispatches (default proposal_only = do nothing but propose).
    • Bound kernel dispatch: a supplied immutable repair contract, its digest, and its source_event_id bind this attempt to a kernel-origin run.manager.repair.accepted, run.manager.source_repair.dispatch_requested, or autoresearch.repair.dispatch_requested in the parent ZF_STATE_DIR ledger. Check the exact fingerprint/attempt/candidate identity and contract descriptor on autoresearch.repair.dispatched before 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 copied zf.yaml, and do not set a global authorization environment variable to make the check pass. Default off remains unchanged.
  2. A concrete self-bug to fix. An autoresearch bug_candidate (with repair_task_payload: hypothesis, contract.scope, success_criteria) or a supervisor attention naming a harness self-bug. No vague "improve X".
  3. 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.yaml as a second control plane, or any credential (llm_env/.env).
  4. Under the attempt cap. If a self-repair backlog for the same failure fingerprint already exists at done (or N attempts reached) → do NOT retry; human.escalate instead. 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
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

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), без исполняемых скриптов.

Похожие скиллы

Сравнить zf-self-repair с