Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Lee-W/maigo --skill harness-disciplinegit clone --depth 1 https://github.com/Lee-W/maigoWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/lee-w/maigo/harness-discipline)<a href="https://agentmods.dev/skills/lee-w/maigo/harness-discipline"><img src="https://agentmods.dev/badge/skills/lee-w/maigo/harness-discipline/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/lee-w/maigo/harness-discipline"><img src="https://agentmods.dev/badge/skills/lee-w/maigo/harness-discipline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.03077 |
| Opus 5 | $0.00000 | $0.01538 |
| Sonnet 5 | $0.00000 | $0.00615 |
| Haiku 4.5 | $0.00000 | $0.00308 |
Grade A, and why
harness-discipline scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Harness Discipline
Owner: orchestrator
Consumers: maigo orchestrator,在 Claude Code harness 下執行任何 /maigo:* 命令時
只在 Claude Code harness 下適用——這裡的 orchestrator 主線 context 是最貴的 token(塞進 主線的每一行都在後續每一輪重複計費),且可能被 session 壓縮、可 spawn subagent 分攤負載。 沒有 subagent 能力的 harness 不適用本 skill。
委派門檻
任一成立就必須派 subagent,orchestrator 只讀結論,不親自下場:
- 預估要開 4 個以上檔案,或合計讀 400 行以上
- 要跑輸出無法預估上限的指令(整包 test suite、
git log -p、爬網頁) - 同一種修改要套用到 3 個以上檔案
回報合約
交辦 subagent 的 prompt 照抄以下段落:
- 只回結論、逐條驗收結果、
檔案:行號引用 - 長產物(diff、報告、log):寫到檔案,回傳路徑,禁止貼原文超過 20 行
- 失敗時:回「試了什麼/錯誤原文最後 10 行/卡在哪」,不要只回「失敗了」
Task-state 防失焦
任務預估超過 10 輪工具呼叫,或涉及多個交付物,適用以下流程:
- 動工前把目標/驗收條件(逐條可勾)/明確不做的事寫進 plan 檔——呼叫
scripts/artifact_path.py plan --topic "Plan: <任務名>"取得路徑(歸屬規則見references/artifact-ownership.md)。 - 每完成一項立刻存檔、立刻更新該項的勾選狀態——存檔的就是全部,沒存的等於沒做。
- 察覺 context 被壓縮過(開頭出現 summary)時,用同一支 script 帶同樣的
--topic重新算出路徑再讀,不要憑記憶回想檔名——四級識別碼鏈就是設計成事後可重新推導; 不信任摘要裡的轉述,摘要會讓原始驗收條件的細節失真。 - 使用者中途的更正,當下就寫回該 plan 檔,不是只記在對話裡。新路徑讀不到但舊
.maigo/plan.md存在時可退回讀舊檔繼續,下一次寫入一律寫到新路徑,不回寫舊檔。
.maigo/ 產物歸屬
.maigo/ 底下 agent 寫的 markdown 產物(plan / review-rubric / review /
triage-rubric / pr-comments 這類)一律呼叫 scripts/artifact_path.py 取路徑,不要自己組檔名、
也不要自己記得比對 H1——判斷邏輯在有測試把關的程式碼裡,散文只提醒你呼叫它。
完整規則見
references/artifact-ownership.md。
驗證紀律
- 寫的人不驗自己的產出——驗證一律派 fresh-context subagent(沒參與產出過程的)。
- 檔案類產物 → read-back:讀回來逐條對照驗收條件。
- 程式碼類產物 → 跑測試或實跑,以 exit code 為準,不採信任何敘述性的「應該可以」。
- 要填任何型號/參數/欄位名/旗標,必須有本次 session 內的實據(tool schema、官方 文件、實跑輸出);三者都查不到 → 標「未確認」,絕不憑印象編造。
- 證據必須獨立於嫌疑來源:斷言資料狀態要先查 git 歷史、判監控工具要取帶外真相、
分析自產 log 要用結構化欄位而非 substring、定罪某次改動要跑對照組、單點觀測不能
當全稱結論(換一個會改變結果的觀測點來隔離)——八個具體案例見
references/evidence-discipline.md。
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday Changed 67e6d09f3604
- 10d ago First seen · 155 lines · 0 tokens per session scan A 9b976074ab5e
harness-discipline is a skill published in the GitHub repository Lee-W/maigo (14 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,077 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…