城里有个老行会,专管把各路手艺登记造册、刻成展板挂在长廊上,供后人观摩。新手艺要入册,行会有一本祖传的章程,谁也不能跳步。
章程摊开,头一页是一张总账:哪些手艺还没入册、哪些正在办、哪些已成——每一行都有个记号,办事的人只认这张总账,绝不凭记性挑活。
认领一桩手艺,流程是死的。先派一位「通读人」,把这门手艺的原始卷宗从头到尾读一遍,边读边把每一句论断都标上「出处在第几卷第几行」——没有出处的话,一个字也不许写。通读人读完,还要掂量这门手艺够不够分量单独占一块展板,还是该并到别块去。
接着,凭通读人那份札记,两个人同时动笔:一个画「能上手拨弄的图样」,一个写「正经的说明文」——两人各做各的,互不等候,因为底本是同一份。
两份都齐了,交给「合稿人」誊到展板上:一面刻图样,一面刻说明,落款处一并刻上那一长串出处。
最后,章程派出一位最讨人嫌的角色——「挑刺人」。他不写一个字,只干一件事:照着出处一条条翻回原卷,看刻在板上的话和原卷对不对得上;但凡有一句对不上、或出处指错了地方,整块展板打回重刻。挑刺人点头,这门手艺才算入册,总账上那一行才改成「成」。
有意思的是:这套流程本身,也是一门手艺。于是行会做了一件套娃的事——用这同一本章程,给「这套流程」自己也立了一块展板。你正看着的,就是那块板。
这门「用自己的流程把自己讲清楚」的手艺,放进 Claude 的世界里,就是这一页要讲的:驱动本站的 Loop 与 Workflow。
先猜揭晓前,先押一个猜测 · 你觉得这讲的是?
谜底 · The Concept
The Loop + Workflow that built this site (a harness explaining itself)
Meta — This Site Itself · 元 · 本站本身
中文速览 · Quick read
This page is the site explaining the machine that built it. Every other page in this knowledge base was produced by a two-layer harness: an outer Loop that walks a work-queue, and, for each item, an inner Workflow — a deterministic multi-agent pipeline. The whole apparatus is a working specimen of the very subject the site teaches (the agent loop, sub-agents, workflows, tool use, structured output), turned on itself.
The work-queue is plan.md — the single source of truth listing every harness mechanism as a row with a status lock (pending / in_progress / done) (harness_knowledge_base/plan.md:1-30). The Loop is the /build-harness-docs command: claim the next pending row, run the Workflow for it, write the result back (harness_knowledge_base/.claude/commands/build-harness-docs.md:1-46). The Workflow is wf-harness-mechanism.js, whose meta block declares its four phases — Analyze, Design+Explain, Build, Verify (harness_knowledge_base/.claude/wf-harness-mechanism.js:1-9).
How it works
The orchestrator reads plan.md, picks the next mechanism by the recommended reading path, flips its status to in_progress, runs the Workflow, then sets done (or review on failure) and commits (harness_knowledge_base/.claude/commands/build-harness-docs.md:1-46). The state field is a concurrency lock — only the orchestrator writes it, so sub-agents can never corrupt the queue. This is exactly the "one ledger, one record per row" discipline the agent-workflows page describes, applied to the build itself.
Each mechanism flows through an independent pipeline (harness_knowledge_base/.claude/wf-harness-mechanism.js:77-94). The mechanisms to build are listed in MECHS (harness_knowledge_base/.claude/wf-harness-mechanism.js:19-31). The pipeline has no barrier between stages: one mechanism can be in Build while another is still in Analyze, so wall-clock is the slowest single chain, not the sum.
- Analyze (stage 0+1) dispatches an
Explore-typed sub-agent — the source analyst — to deep-read the realclaude-codefiles, rate complexity, and return a structured brief plusfile:linecitations, validated against a JSON schema (harness_knowledge_base/.claude/wf-harness-mechanism.js:77-94, harness_knowledge_base/.claude/agents/source-analyst.md:1-12). Forcing structured output is how the brief hands cleanly to the next stage. - Design ‖ Explain (stage 2+3) runs two sub-agents in
paralleloff the same brief — one designs the interactive demo + diagram, one writes the bilingual body — because neither depends on the other (harness_knowledge_base/.claude/wf-harness-mechanism.js:103-145). - Build (stage 4) has a
general-purposesub-agent write the two output files and self-check them. - Verify (stage 5) dispatches a skeptical verifier whose only job is to reject: confirm every citation resolves to real code and the prose matches the source (harness_knowledge_base/.claude/wf-harness-mechanism.js:195-216, harness_knowledge_base/.claude/agents/verifier.md:1-12).
The plan is reproducible — same plan.md, same stages, same agent roles — but each sub-agent calls a non-deterministic model, so the prose and demos vary run to run. The ledger is fixed; the writing is alive. (The build of this very site proved the point: a session limit interrupted the batch mid-run, two mechanisms were salvaged by hand, four demos were hand-authored when the agents ran out of budget, and a literal {reason} in one generated demo had to be escaped — the harness sets the structure, humans close the last mile.)
Why it matters
The interesting claim of harness engineering is Model + Harness = Agent: the same model, wrapped differently, produces different results. This site is a small proof. The model wrote none of the orchestration; the harness — the queue, the loop, the staged pipeline, the structured hand-offs, the adversarial verify gate — is what turned "summarize how Claude Code works" into 11 grounded, cited, interactive pages. Every pattern the site teaches is load-bearing in how the site was made: the work-queue lock (agent-workflows), sub-agent isolation (agent-subagents), structured tool output (tool-anatomy), and a verify-before-commit gate that is the build-time cousin of the runtime permission system (tool-permission). The harness explaining itself is not a gimmick — it is the most honest possible demonstration that the harness is the thing doing the work.
Read the source
- The work-queue and its status lock: harness_knowledge_base/plan.md:1-30.
- The Loop orchestrator: harness_knowledge_base/.claude/commands/build-harness-docs.md:1-46.
- The Workflow's phase declaration and
MECHSlist: harness_knowledge_base/.claude/wf-harness-mechanism.js:1-9, harness_knowledge_base/.claude/wf-harness-mechanism.js:19-31. - The pipeline and its stages — analyze (Explore), design‖explain (parallel), build, verify: harness_knowledge_base/.claude/wf-harness-mechanism.js:77-94, harness_knowledge_base/.claude/wf-harness-mechanism.js:103-145, harness_knowledge_base/.claude/wf-harness-mechanism.js:195-216.
- The agent role contracts: harness_knowledge_base/.claude/agents/source-analyst.md:1-12, harness_knowledge_base/.claude/agents/verifier.md:1-12.
This page is the site explaining the machine that built it. Every other page in this knowledge base was produced by a two-layer harness: an outer Loop that walks a work-queue, and, for each item, an inner Workflow — a deterministic multi-agent pipeline. The whole apparatus is a working specimen of the very subject the site teaches (the agent loop, sub-agents, workflows, tool use, structured output), turned on itself.
The work-queue is plan.md — the single source of truth listing every harness mechanism as a row with a status lock (pending / in_progress / done) (harness_knowledge_base/plan.md:1-30). The Loop is the /build-harness-docs command: claim the next pending row, run the Workflow for it, write the result back (harness_knowledge_base/.claude/commands/build-harness-docs.md:1-46). The Workflow is wf-harness-mechanism.js, whose meta block declares its four phases — Analyze, Design+Explain, Build, Verify (harness_knowledge_base/.claude/wf-harness-mechanism.js:1-9).
How it works
The outer Loop. The orchestrator reads plan.md, picks the next mechanism by the recommended reading path, flips its status to in_progress, runs the Workflow, then sets done (or review on failure) and commits (harness_knowledge_base/.claude/commands/build-harness-docs.md:1-46). The state field is a concurrency lock — only the orchestrator writes it, so sub-agents can never corrupt the queue. This is exactly the "one ledger, one record per row" discipline the agent-workflows page describes, applied to the build itself.
The inner Workflow. Each mechanism flows through an independent pipeline (harness_knowledge_base/.claude/wf-harness-mechanism.js:77-94). The mechanisms to build are listed in MECHS (harness_knowledge_base/.claude/wf-harness-mechanism.js:19-31). The pipeline has no barrier between stages: one mechanism can be in Build while another is still in Analyze, so wall-clock is the slowest single chain, not the sum.
- Analyze (stage 0+1) dispatches an
Explore-typed sub-agent — the source analyst — to deep-read the realclaude-codefiles, rate complexity, and return a structured brief plusfile:linecitations, validated against a JSON schema (harness_knowledge_base/.claude/wf-harness-mechanism.js:77-94, harness_knowledge_base/.claude/agents/source-analyst.md:1-12). Forcing structured output is how the brief hands cleanly to the next stage. - Design ‖ Explain (stage 2+3) runs two sub-agents in
paralleloff the same brief — one designs the interactive demo + diagram, one writes the bilingual body — because neither depends on the other (harness_knowledge_base/.claude/wf-harness-mechanism.js:103-145). - Build (stage 4) has a
general-purposesub-agent write the two output files and self-check them. - Verify (stage 5) dispatches a skeptical verifier whose only job is to reject: confirm every citation resolves to real code and the prose matches the source (harness_knowledge_base/.claude/wf-harness-mechanism.js:195-216, harness_knowledge_base/.claude/agents/verifier.md:1-12).
Determinism, honestly. The plan is reproducible — same plan.md, same stages, same agent roles — but each sub-agent calls a non-deterministic model, so the prose and demos vary run to run. The ledger is fixed; the writing is alive. (The build of this very site proved the point: a session limit interrupted the batch mid-run, two mechanisms were salvaged by hand, four demos were hand-authored when the agents ran out of budget, and a literal {reason} in one generated demo had to be escaped — the harness sets the structure, humans close the last mile.)
Why it matters
The interesting claim of harness engineering is Model + Harness = Agent: the same model, wrapped differently, produces different results. This site is a small proof. The model wrote none of the orchestration; the harness — the queue, the loop, the staged pipeline, the structured hand-offs, the adversarial verify gate — is what turned "summarize how Claude Code works" into 11 grounded, cited, interactive pages. Every pattern the site teaches is load-bearing in how the site was made: the work-queue lock (agent-workflows), sub-agent isolation (agent-subagents), structured tool output (tool-anatomy), and a verify-before-commit gate that is the build-time cousin of the runtime permission system (tool-permission). The harness explaining itself is not a gimmick — it is the most honest possible demonstration that the harness is the thing doing the work.
Read the source
- The work-queue and its status lock: harness_knowledge_base/plan.md:1-30.
- The Loop orchestrator: harness_knowledge_base/.claude/commands/build-harness-docs.md:1-46.
- The Workflow's phase declaration and
MECHSlist: harness_knowledge_base/.claude/wf-harness-mechanism.js:1-9, harness_knowledge_base/.claude/wf-harness-mechanism.js:19-31. - The pipeline and its stages — analyze (Explore), design‖explain (parallel), build, verify: harness_knowledge_base/.claude/wf-harness-mechanism.js:77-94, harness_knowledge_base/.claude/wf-harness-mechanism.js:103-145, harness_knowledge_base/.claude/wf-harness-mechanism.js:195-216.
- The agent role contracts: harness_knowledge_base/.claude/agents/source-analyst.md:1-12, harness_knowledge_base/.claude/agents/verifier.md:1-12.
来源 · Source citations
- [1]
harness_knowledge_base/plan.md:1-30 - [2]
harness_knowledge_base/.claude/commands/build-harness-docs.md:1-46 - [3]
harness_knowledge_base/.claude/wf-harness-mechanism.js:1-9 - [4]
harness_knowledge_base/.claude/wf-harness-mechanism.js:19-31 - [5]
harness_knowledge_base/.claude/wf-harness-mechanism.js:77-94 - [6]
harness_knowledge_base/.claude/wf-harness-mechanism.js:103-145 - [7]
harness_knowledge_base/.claude/wf-harness-mechanism.js:195-216 - [8]
harness_knowledge_base/.claude/agents/source-analyst.md:1-12 - [9]
harness_knowledge_base/.claude/agents/verifier.md:1-12