重复纠正根因修复
steer-once
将你反复重复的纠正转化为持久性修复:挖掘你的各类纠正并分类,选择能够预防这些纠正的最低成本层级(指令、技能、lint/CI 检查、测试、自动化或产品 bug 报告),提交一个带证据块的 PR,然后在 K 天后重新度量,并决定保留、升级或回滚。由于会创建 PR,因此仅在 `/lever steer` 或明确要求(“挖掘我的纠正”“为什么我总跟你说 X”“我不是给过你一个技能来做这个吗”),或当 prompt-mirror 在 3 个及以上会话中报告同一类纠正且你表示同意时才运行。
- License 许可
- MIT
- 所属仓库
- github/lever
- 最近更新
- 2026-11-06
- Stars
- ★ 292
- Forks
- 15
01 前言 Front Matter
- name
- steer-once
- description
- Turn a correction you keep repeating into a durable fix: mine your corrections, classify them, choose the cheapest layer that would have prevented them (instruction, skill, lint/CI check, test, automation, or product bug report), open a PR with an evidence block, then re-measure after K days and keep, escalate or revert. Opens PRs, so it runs only on `/lever steer` or an explicit ask ("mine my corrections", "why do I keep telling you X", "didn't I give you a skill for this"), or when prompt-mirror reports the same correction class in 3+ sessions and you say go.
- user-invocable
- false
02 资源文件 3
- 脚本scripts/import_allowlist.py9.4 KB
- 脚本scripts/token_ledger.py22.8 KB
- 脚本tests/test_gates.py9.4 KB
03 SKILL.md 正文
steer-once
Correct an agent once; the repo remembers. An apology from the agent changes nothing next session. A merged rule does. This skill takes corrections you have typed more than once, finds the layer that would have prevented them, lands the smallest durable change there with evidence, and checks a week later whether the correction actually stopped. If it didn't, it climbs one layer; if the rule made things worse, it proposes a revert.
When to use
- Fast path (live): the user just repeated a correction mid-session ("again", "I told you", "why did you stop", "didn't I give you a skill"). Handle that one correction now.
- Batch: "mine my corrections", a weekly retro, or a
prompt-mirrorreport listing a class with ≥N hits across ≥3 sessions. - Team variant: recurring reviewer feedback on agent PRs in a repo (see Sources).
Not for one-off preferences, a single bad turn, or anything already handled by an open steer-once PR.
Sources
- Your typed messages via
prompt-mirror's extractor (local, redacted, source-filtered):python3 <skills-dir>/prompt-mirror/scripts/mine_sessions.py --since 21d [--repo owner/name]. Usecorrection_classes,repeated_correction_phrases, and each message'sclasses/flags. Readmessages.jsonlfor the instances. - The agent message before each correction (the cause) and after (the response). Count concession openers ("You're right", "Agreed", "Good catch") on the same class; a concession followed by a repeat is the strongest signal that a rule is missing or not loaded.
- Team variant:
changes_requestedreviews and review comments on agent-authored PRs (for examplegh pr list --author app/copilot-swe-agent --state all, thengh api repos/{owner}/{repo}/pulls/{n}/reviews). Same pipeline, no local history needed.
Steps
-
Read the dials (table below) and
docs/autonomy.md. State the scope and autonomy level in one line. -
Collect corrections for the window. Exclude agent, autopilot, system and template traffic (the extractor does this). Keep delivery mode: a mid-turn steer is a stronger correction than an idle follow-up.
-
Classify each correction. Start from the extractor's classes, then confirm by reading:
Class The agent… Typical correction gate invented approvals, locks, preflights, "exact GO" phrases "you don't need authorization" over_ask asked for what it already had "don't ask, just do it" premature_stop treated a milestone as done "why did you stop?" polling waited or slept instead of doing parallel work "why are you waiting?" status_gap made the human poll for state "status? ETA?" verification_theatre let checking replace shipping "what did you spend 3 hours on?" stale_claim reasoned from a proxy (stale clone, cache) "that's not true, check the live source" shallow_fix suppressed the symptom "actually fix it instead of disabling lint" letter_of_law shrank an ambitious ask "I asked for the orchestrator pattern" scope_creep did unrequested side quests "why did you open a PR there?" process_default lacked a team default procedure "breaking changes are always two-phase" runtime_gap hit something no prompt can fix "rekick the stalled sessions", quota, leaked processes -
Find recurrences: same class and same underlying expectation, ≥N hits across ≥2 sessions in the window (default N=3). Merge near-duplicates; one rule per expectation.
-
Check for an existing rule. Search
.github/copilot-instructions.md,.github/instructions/*.instructions.md(applyToscope),AGENTS.md,.github/skills/*/SKILL.md,.github/lever.yml, and personal~/.copilot/copilot-instructions.md. If a rule exists and the class still recurs, the finding is "rule exists but is weak, misplaced or not loaded". Fix placement or wording, or escalate a layer, before adding more prose. -
Pick the cheapest durable layer that would have prevented these specific instances:
The expectation is… Layer Example A personal posture (tone, verbosity, how you like updates) Personal instructions "Report as x → y (Δz%); no preamble"A repo-wide default posture .github/copilot-instructions.md(one line, with the why)"Pre-launch service: ship and monitor; don't add approval gates" Authority or autonomy A dial in .github/lever.yml, not proseautonomy: L3with the grant recordedA task-specific procedure Scoped instruction or skill rule expand → migrate → contract for breaking changes Mechanically detectable Lint or CI check no new eslint-disablewithout a linked issueBehavioural A test that fails today the service recovers from a stuck lease by itself Timing or liveness Hook or automation (see automate-it)resume idle child sessions on wake Outside the agent's control Product or infra bug report sessions don't auto-resume after sleep Corrections that cluster on one dial (merge authority, stop policy, status cadence, validation depth) become a dial change, not a new rule.
-
Write the rule. Positive, concrete, with the why and the scope, at most 3 lines. Name the dial it sets. No ALL CAPS, no "NEVER" walls, and never add a gate to prevent gates. Example: "Autopilot runs never idle: when the current item lands, take the next ready item. Why: 'why did you stop' recurred in 4 sessions."
-
Open the PR (or file the issue, for bugs) with the evidence block below. For personal instructions there is no PR: show the diff and apply only when the user says so, or under a recorded grant. Show the user the exact evidence text before it is published to any shared repo.
-
Land per the autonomy dial. Default L2: a ready PR the human lands. Instruction-only PRs are a common L3 grant class ("docs and instructions PRs may self-merge when green"). Record which level applied.
-
Record in the ledger: class, rule, layer, PR, baseline rate, re-measure date.
-
Re-measure after K days (and at least M typed messages in scope). Re-run the extractor for the same scope. Compare the class rate per 100 typed messages with the baseline, and with the week-to-week spread of that class over the previous 4 weeks.
- Fell beyond noise → keep; comment the result on the PR.
- Didn't fall → escalate one layer (instruction → skill rule → check/test → automation → bug report) and link the new PR to the old one.
- A neighbour class rose (for example over_ask fell but premature_stop rose) → propose a revert or rewording, with numbers.
Evidence block (PR body)
### steer-once evidence
- **Class:** premature_stop: agent treated a milestone as done while ready work remained
- **Window / scope:** 2026-10-01 → 2026-10-21, this repo, typed messages only
- **Count:** 9 corrections in 4 sessions = 1.6 per 100 typed messages (baseline)
- **Agent concessions on this class:** 5 ("You're right…"), followed by repeats
- **Existing rule:** none | `path:line` exists but recurred (placement/wording issue)
- **Quotes** (redacted, dated, ≤20 words each, 3–5):
- 2026-10-04 "why did you stop? there is more in the queue"
- 2026-10-09 "if you're idle, take the next ready item"
- **Layer:** repo instruction. Cheaper layer insufficient because: … Costlier layer unnecessary because: …
- **Keep bar:** rate ≤ 50% of baseline and outside 4-week noise, re-measured on 2026-10-28 (K=7) or after 150 typed msgs
- **If not met:** escalate to <next layer>
Dials
| Dial | Default | Options |
|---|---|---|
| Detection threshold | N=3 hits across ≥2 sessions in 21 days | any N / window |
| Mode | open PR (L2, human lands) | propose in chat; draft PR (L1); self-merge per docs/autonomy.md grant |
| Destination | repo for shared expectations, personal for posture | repo only; personal only |
| Evidence | redacted quotes + counts, shown to user before publishing | counts only; paraphrase |
| Re-measure | K=7 days and ≥150 typed messages in scope | any K / M |
| Keep bar | ≤50% of baseline and outside noise | any threshold |
| Max open steer-once PRs | 3 | any |
| Severity weighting | off | weight mid-turn steers and heated messages higher (never quote heated ones) |
Outputs
- One small PR or issue per recurring expectation, labelled
steer-once, with the evidence block. The label is the team ledger. - A personal ledger entry (default
~/.copilot/lever/steer-once.ledger.md, format pertemplates/ledger.md): keep, escalate or revert, with before/after rates. - A re-measure comment on the original PR.
This skill's own feedback loop
Per rule: class rate per 100 typed messages, before and after. Across rules: share kept versus escalated versus reverted; concession openers per 100 agent replies (should fall); time from first occurrence to merged fix (should shrink). If most rules escalate, the skill is choosing layers too cheaply. If any rule raises a neighbour class, the skill is writing over-broad rules.
Failure modes it prevents
- Accepting "You're right" as a fix.
- Prose rules for things a check, test, dial or bug report should own.
- Rule sprawl: duplicate, contradictory or ALL-CAPS instructions nobody re-measures.
- One person's posture hard-coded into a shared repo; posture goes to personal instructions or a dial.
- Private text published as "evidence" without the user seeing it first.
Why this exists
- Across one heavy user's sessions, agents opened 75 replies with "You're right" or an equivalent, and the same corrections recurred for days. They stopped recurring only once they became a merged instruction or skill change.
- The fastest path, from a frustrated message to a merged operating-model PR, took 16 minutes. One correction that stayed verbal took about 18 days to become a default.
- After the user had an agent mine his last ~200 typed messages into a skill rewrite: "why did you stop" nudges 27 → 0, gate language in agent messages 31% → 3%, status asks ~24% → 7%, while his message volume rose from about 50 to 87 per day. "The delivery skill is ~200 of my own corrections, compressed."
- Some corrections are bug reports. "Restart the stalled sessions" recurred 8 times after the instruction existed, because interrupted sessions were a runtime gap no prompt could fix.
04 同仓库更多 Skills
自动化运行健康审查
run-health-review
停滞监视器与自动化健康审查。拉取近期运行、合并、无操作率、失败、速率限制命中以及卡住的 PR;对每种停滞进行分类;只提出一项变更或“不变更”;并接管被遗弃的工作。当无人值守交付停滞(“为什么一夜之间就卡住了”“N 小时没有合并”“前几天还很快,现在变慢了”)、某个自动化失败或其产出下降、遭遇速率限制或配额用尽,或在 agent 无人值守运行期间按计划执行时使用。
大规模代码重构流水线
refactor-pipeline
以三个独立通道——生产者(producer)、打包者(packager)和牧羊人(shepherd)——运行大规模的机械式重构(crate 或 package 拆分、模块提取、API 迁移、死代码删除),这些通道仅通过 git 和 PR 栈进行协调。它会推送分支并创建 PR,因此仅在 `/lever refactor` 或明确要求(“拆分此 crate”“拆分这个单体”“这个模块太大了,把它精简一下”“迁移所有调用方”)时运行。
Copilot 提示词习惯分析
prompt-mirror
挖掘本地 Copilot 会话历史,返回一份关于你如何指导智能体的评分卡,并附上三条建议,用你自己的前后对比消息加以说明。由于它读取你的私有历史,因此仅在 `/lever mirror` 或明确请求(“我的提示词水平如何?”、“指导我改进”、“挖掘我的会话”、“我总是在重复什么?”、每周自我复盘)时运行。
长时任务进度契约跟踪
progress-contract
推动长时间运行或委派的任务进展,让人类无需轮询。它会发布带有 ETA 及各自所需证据的里程碑,仅在发生重大变化时发送报告,为每项声明标注证据等级,记录 ETA 准确性,监控距上次合并的时间,并在宣布“完成”之前依据证据对“完成”状态进行审计。适用于任何委派的、耗时数小时或通宵运行的任务,当任务简报设定了报告契约时,或当用户询问“状态如何?”、“预计何时完成?”、“我们进行到哪了?”、“昨晚发生了什么?”、“逐小时汇报”或“你完成了吗?”时。
PR 落地合并驱动
pr-shepherd
通过事件驱动循环推动开放的拉取请求直至落地。每次唤醒时执行一次批量读取,修复红色必填检查的根本原因,处理每一条审查讨论线程,并按照自主性拨盘设定的级别执行落地。由于它会推送代码并可能执行合并,因此仅在 `/lever shepherd`、来自 lever 协调器的移交、被标记为 shepherding 的 PR,或明确请求(“监控 CI 直至通过”、“推送修复直到通过”、“解决审查讨论线程”、“通过即合并”、“照看这个 PR”、“shepherd”)时运行。
Lever 技能统一入口
lever
统一的 lever 命令。`/lever <verb> [args]` 直接运行某个 lever 技能(loop、arms、review、brief、deliver、refactor、backlog、shepherd、land、status、automate、health、mirror、steer、autonomy、spend、setup、help)。`/lever <plain words>` 会为你挑选合适的动词,用一行说明所选动词,然后执行。该技能还会读取和写入 `~/.copilot/lever.yml` 中用户的个人拨盘设置。当用户键入 /lever、询问“我应该使用哪个 lever 技能?”,或想查看或更改其自主性(autonomy)或支出(spend)拨盘时使用。