已开启
[共创大赛][Feature] 新增「班次协议」内置 skill:open / relay / night-mode —— 跨会话状态落盘与无缝交接 #1101
MIZONGClass创建于 17 天前
[共创大赛][Feature] 新增「班次协议」内置 skill:open / relay / night-mode —— 跨会话状态落盘与无缝交接 #1101
已开启
共 3 个文件变更+111-0
| @@ -0,0 +1,39 @@ | |||
| 1 | +--- | ||
| 2 | +name: night-mode | ||
| 3 | +description: Autonomous overnight work protocol. Use when the user says "night mode": bounded self-directed work driven by RSI (recursive self-improvement) across a whole compute window — explore unfinished threads, cross-pollinate existing information into new possibilities, and self-audit (prune, fix, optimize) — then hand a morning report. This is NOT a dark colour theme for a website. | ||
| 4 | +user-invocable: true | ||
| 5 | +--- | ||
| 6 | + | ||
| 7 | +# night-mode — Autonomous Overnight Work Protocol | ||
| 8 | + | ||
| 9 | +> 夜班 / 夜间自主工作:以 RSI(自进化)为内核,在一个算力窗口内自主干活 —— 探索未完之事 / 信息碰撞长出新的可能性 / 自我审计(去冗余、修复、优化)—— 次日交晨报。注意:不是给网站加暗色主题。 | ||
| 10 | + | ||
| 11 | +## ⚠️ Disambiguation (read first) | ||
| 12 | +"night mode" here is an **autonomous working protocol for the agent** — bounded self-directed work while the human is away. It is **NOT a dark color theme** for a website or app. Real incident: an agent misread this trigger as "add dark mode to the site" and deployed UI changes. Never touch site styling in response to this trigger. | ||
| 13 | + | ||
| 14 | +## Why it exists | ||
| 15 | +Agent platforms usually meter compute in **windows** (e.g. a quota that refreshes every 5 hours). A window left unused is capacity thrown away. night-mode exists to **use the whole window** in a self-directed state — free exploration and refinement — instead of the task-driven mode of daytime work. | ||
| 16 | + | ||
| 17 | +## Core method: RSI (recursive self-improvement) | ||
| 18 | +RSI is the **backbone, not an option**: the agent thinks, acts, inspects its own output, and iterates on itself. | ||
| 19 | +Scope: the **shell + skeleton** — processes, documents, tools, pipelines. Never the **model layer** (weights, core model behaviour). | ||
| 20 | + | ||
| 21 | +## The three jobs (where RSI lands) | ||
| 22 | +1. **Explore** — unfinished threads from earlier lines of work, and directions nobody has had time for. | ||
| 23 | +2. **Cross-pollinate** — let existing information interact and grow into new possibilities. Purpose: keep output from being limited to one person's experience. | ||
| 24 | +3. **Self-audit** — review what exists: prune redundancy, fix what is broken, optimize what is clumsy. | ||
| 25 | + | ||
| 26 | +## Boundaries | ||
| 27 | +- **Allowed**: recording facts; low-risk fixes; research written to disk; state-file maintenance; preparing tomorrow's materials. | ||
| 28 | +- **Forbidden**: irreversible operations; publishing/deploying to production; touching production config; large refactors; anything needing human consent. | ||
| 29 | +- Uncertain matters go to "pending human" — never auto-decided. | ||
| 30 | + | ||
| 31 | +## Output | ||
| 32 | +- **Strategic thinking**, written to the knowledge base — judgments and trade-offs, not an execution checklist. This is the natural form of jobs 1 and 2. | ||
| 33 | +- **Morning report** (≤15 lines): what was done (paths) · what was discovered · first task today · pending decisions (what / details / the decision / recommendation). | ||
| 34 | + | ||
| 35 | +## Discipline | ||
| 36 | +Standing project rules apply: absolute paths when reporting to the human, append-only facts, single source of truth for numbers. | ||
| 37 | + | ||
| 38 | +## Project override | ||
| 39 | +If the project has its own protocol file (`NightMode-prompt-*.md` or similar) in its docs/knowledge dir, read it and follow it — it overrides these defaults. | ||
| @@ -0,0 +1,36 @@ | |||
| 1 | +--- | ||
| 2 | +name: open | ||
| 3 | +description: Start or resume a work shift. Use when the user says "open": load the project state file (STATUS.md) and the tail of the fact log, run the project health probe, report in a few lines, then start on the top-priority item. If the project has no state file yet, bootstrap one from the template. | ||
| 4 | +user-invocable: true | ||
| 5 | +--- | ||
| 6 | + | ||
| 7 | +# open — Start / Resume a Shift | ||
| 8 | + | ||
| 9 | +> 开班 / 续班:读取项目状态文件与事实日志尾部 → 跑探针自检 → 几行内汇报 → 直接开工;若项目还没有状态文件,则从模板 bootstrap 一份。 | ||
| 10 | + | ||
| 11 | +## What this does | ||
| 12 | +When the human says **open** (with no other context), start or resume work: rebuild full state from disk, verify it, report briefly, and begin the top-priority item. The state file *is* the direction — no questions about where to go. | ||
| 13 | + | ||
| 14 | +The human owns the trigger. The agent never self-triggers open. | ||
| 15 | + | ||
| 16 | +## What a project needs | ||
| 17 | +One **state file** that answers "where are we / what's next", plus (recommended) an append-only **fact log**: | ||
| 18 | +- `STATUS.md` — six-section snapshot (see `templates/`) | ||
| 19 | +- `FACTS.yaml` — append-only atomic facts: id, at, fact, provenance, consequences | ||
| 20 | + | ||
| 21 | +Any equivalent works: a single markdown file, a task board, an issue tracker. The protocol needs *a durable state artifact*, not these exact filenames. | ||
| 22 | + | ||
| 23 | +## Procedure | ||
| 24 | +1. **Load state** — search order: `STATUS.md` at repo root → `STATUS.md` in a docs/knowledge dir → the project's `AGENTS.md` pointer → ask the human once which file it is. | ||
| 25 | +2. **Load facts** — read the tail of the fact log (~200 lines) so recent decisions are in context. | ||
| 26 | +3. **Health probe** — if the project has a self-check (`check_facts.mjs`, `probe.py`, `make check`…), run it. Green → continue. Red → investigate before proceeding: probes can false-alarm, so verify before concluding. | ||
| 27 | +4. **Report** (≤5 lines) — one-line status + the first thing you will do now. | ||
| 28 | +5. **Start** — the top item of "next steps". Pending human decisions are *listed*, not re-asked. | ||
| 29 | + | ||
| 30 | +### Bootstrap branch (no state file yet) | ||
| 31 | +If the project has no state file, don't stall: propose creating one from `templates/STATUS.md` (+ `FACTS.yaml`), fill in what you can infer from the repo, and confirm in one line. `open` then doubles as the init command for a new project. | ||
| 32 | + | ||
| 33 | +## Rules | ||
| 34 | +- **Paths**: report absolute paths to the human; use repo-relative paths inside repo documents (absolute paths break on other machines). | ||
| 35 | +- **Numbers**: dynamic values (counts, costs) come from the project's designated source-of-truth file, never hand-copied into prose. | ||
| 36 | +- **Facts are append-only**: to correct an old entry, add a new one. | ||
| @@ -0,0 +1,36 @@ | |||
| 1 | +--- | ||
| 2 | +name: relay | ||
| 3 | +description: Close and hand off a work shift. Use when the user says "relay" — typically when the session can no longer carry the project (context near its limit, input/output quality degrading). Append new facts, run the regression probe, rewrite the state file as a six-section snapshot, and give a closing summary. The agent never self-triggers this. | ||
| 4 | +user-invocable: true | ||
| 5 | +--- | ||
| 6 | + | ||
| 7 | +# relay — Close & Hand Off a Shift | ||
| 8 | + | ||
| 9 | +> 交班 / 收班交接:追加事实(只增不改)→ 跑探针回归 → 整体重写状态文件为六节快照 → 给出收班摘要。由人触发,AI 不自触发。 | ||
| 10 | + | ||
| 11 | +## Trigger | ||
| 12 | +The **human** says **relay**. The agent never decides to close a session on its own. | ||
| 13 | + | ||
| 14 | +Timing judgment — this is guidance for the human, not agent logic: relay when the session can no longer carry the project forward. Signals: context is near its capacity, and both the human's input and the agent's output quality are visibly degrading. Closing early is cheaper than working in a degraded state. | ||
| 15 | + | ||
| 16 | +## Goal | ||
| 17 | +Hand the project over **completely**. Acceptance test: a fresh session — or a different agent entirely — can take over by reading only what was written to disk, with zero information loss. | ||
| 18 | + | ||
| 19 | +## Procedure | ||
| 20 | +1. **Record facts** — append this session's durable facts to the fact log (append-only; to fix an old entry, add a new one). Each: `id`, `at`, `fact`, `provenance` (method / source / verified_at), `consequences`. | ||
| 21 | +2. **Regression probe** — run the project self-check; it must pass before closing. Red → fix first, then close. | ||
| 22 | +3. **Rewrite the state file** — a full rewrite, not a diff. Six sections: | ||
| 23 | + 1. What was completed this shift | ||
| 24 | + 2. New facts recorded | ||
| 25 | + 3. Pending human decisions — by deadline, each with: what / details / the exact decision needed / recommendation | ||
| 26 | + 4. Next steps for the agent | ||
| 27 | + 5. Environment gotchas — reproducible pitfalls, copy-paste avoidable | ||
| 28 | + 6. File index | ||
| 29 | +4. **Closing summary** (≤10 lines) — the 1–3 heaviest outcomes · next milestone · nearest hard deadline · what the human owes back. | ||
| 30 | + | ||
| 31 | +## Red line | ||
| 32 | +**Anything not written to disk is lost.** The snapshot is the single handoff entry point — a stranger must be able to take over from it alone. | ||
| 33 | + | ||
| 34 | +## Rules | ||
| 35 | +- Report faithfully — including failures and unverified items. Don't soften or inflate. | ||
| 36 | +- Paths: absolute when reporting to the human, repo-relative inside documents. | ||