merlon-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMerlon Docs
Merlon Docs
Host-agnostic documentation system Agent Skill for Merlon Docs. Prefer this over
IDE extensions when you want durable, sharded docs that agents and humans can
maintain as ideas keep coming.
This is the only skill a project installs. It chooses a workflow for the task in
front of it (see Pick the workflow) and loads just that
workflow's file. It works alongside other skills and tools, and a project can
extend it with its own guide tiers, presets or local skills.
Install help: references/install.md.
What compile / check / refs mean and CLI commands:
references/cli-and-scripts.md.
与宿主无关的 文档系统 Agent Skill,适用于 Merlon Docs。如果希望维护持久、可分片的文档,让 Agent 和人在想法不断涌现时也能持续维护,应优先使用它,而不是 IDE 扩展。
这是项目唯一需要安装的 Skill。它会针对当前任务选择工作流(参见选择工作流),并且只加载该工作流对应的文件。它可与其他 Skill 和工具协同使用,项目还可以通过自己的指南层级、预设或本地 Skill 对其进行扩展。
安装帮助:references/install.md。
编译、检查和 refs 的含义以及 CLI 命令:
references/cli-and-scripts.md。
Hard rules
硬性规则
- NEVER invent Merlon Docs workflow when this skill already defines it — follow the skill first.
- NEVER hand-edit files in a vendor-managed install under your agent’s skills
directory (for example in Cursor/Amp) for repo-specific guidance — use complementary skills,
.agents/skills/, or normative shards.docs/extensions/ - NEVER edit generated compile output (, compiled publish targets) — fix shards and recompile.
docs/_build/ - NEVER dump whole compiled output (a compiled guide or the monolith) into
context. Discover with host search (, IDE search), then read one shard at a time.
rg - NEVER write functional product code for a docs/feature change without docs-first shards when the repo follows that convention.
- ALWAYS run (or
merlon check) before trusting compiled output.docs:check
- 当本 Skill 已定义 Merlon Docs 工作流时,绝不要自行杜撰工作流——应优先遵循本 Skill。
- 绝不要手工编辑 Agent 的 skills 目录下由供应商管理的安装文件(例如 Cursor/Amp 中的 )来存放仓库特定指导——应使用配套 Skill、
.agents/skills/或规范分片。docs/extensions/ - 绝不要编辑生成的编译输出(、已编译的发布目标)——应修复分片并重新编译。
docs/_build/ - 绝不要将整个编译输出(编译后的指南或单体文档)倾倒到上下文中。应先使用宿主搜索(、IDE 搜索)进行发现,然后每次只读取一个分片。
rg - 对于遵循文档优先约定的仓库,未先编写文档优先分片时,绝不要为文档或功能变更编写功能性产品代码。
- 在信任编译输出之前,始终运行 (或
merlon check)。docs:check
When nobody can answer
当无人能够回答时
The workflows below ask intake questions and show a plan before editing. The
user may not be watching and may not be able to answer mid-task (a headless
or scheduled run, or a request that already says what to do). Asking and then
stopping there leaves the work undone, so:
- Take every value you can from the request and the repo. is the request itself;
WORK_ITEMdefaults toWORK_ITEM_LOOKUPor the nearest equivalent.docs/developer/agent-work-item-tracking.md - For anything still missing, pick the reasonable default and state it in one line.
- Put the plan, with its commit groups, in your reply, then carry on with the edits. Edits on a branch are reversible.
- Stop and wait only when the user asked for a plan first, or before a destructive or irreversible step, a real change of scope, or input only the user can give.
下面的工作流会在编辑前提出需求确认问题并展示计划。用户可能不在旁观,也可能无法在任务中途回答,例如无头或定时运行的请求,或者请求本身已经说明要做什么。提出问题后就此停止会让工作无法完成,因此:
- 从请求和仓库中获取所有可获得的信息。即请求本身;
WORK_ITEM默认使用WORK_ITEM_LOOKUP或最接近的等效文件。docs/developer/agent-work-item-tracking.md - 对于仍缺失的任何内容,选择合理默认值,并用一行说明。
- 在回复中给出计划及其提交分组,然后继续编辑。分支上的编辑可以撤销。
- 只有在用户明确要求先提供计划,或即将执行破坏性或不可逆步骤、实际改变范围,或只有用户才能提供输入时,才停止并等待。
Requested layouts that break the rules
违反规则的指定布局
Requests often come with a document layout attached, such as one file for
everything, a legacy doc extended in place, old notes kept for history, code
added to make a design concrete, or every copy of a rule patched by hand. That
layout usually comes from time pressure rather than a decision about the docs,
and following it literally recreates the drift Merlon Docs exists to prevent. Serve
the goal behind the request and keep the structure:
| Request | Do this, and say so in your reply |
|---|---|
| One file, so there is one thing to read | Focused shards and an ADR per decision; the guide index or a short overview is the one entry point |
| Growing a legacy document in place | Move its content into shards and ADRs; leave the old document as a stub that links to them |
| Keeping backlogs or old notes | Drop them from durable docs; an ADR records a current rule's history; backlogs go to the tracker and git keeps superseded text |
| Code to make a design concrete | Contracts in prose and tables; how it is built stays in code |
| Changing every copy of a rule | Change it in the one shard that states it and link to that shard from the others |
| Work outside this workflow's scope | Leave it, and say which workflow covers it |
Finish the work in this structure instead of stopping to argue for it. In your
reply, list each request you did not follow literally, with a one-line reason.
请求通常附带某种文档布局,例如所有内容放在一个文件里、原地扩展旧文档、为保留历史而保留旧笔记、添加代码以具体化设计,或手工修补规则的每个副本。这种布局通常源于时间压力,而非基于文档设计作出的决策;照字面执行往往会重新造成 Merlon Docs 旨在防止的漂移。应服务于请求背后的目标并保持以下结构:
| 请求 | 应采取的做法,并在回复中说明 |
|---|---|
| 所有内容放在一个文件,以便只有一个阅读入口 | 使用聚焦的分片,并为每项决策提供一个 ADR;指南索引或简短概览作为唯一入口 |
| 原地扩展旧文档 | 将其内容迁移到分片和 ADR 中;将旧文档保留为指向它们的存根 |
| 保留待办事项或旧笔记 | 从持久文档中移除;ADR 记录当前规则的历史;待办事项放入跟踪工具,过时文本由 git 保留 |
| 用代码具体化设计 | 用文字和表格描述契约;实现方式保留在代码中 |
| 修改规则的所有副本 | 在陈述该规则的唯一分片中修改,并从其他分片链接到它 |
| 处理超出本工作流范围的工作 | 不予处理,并说明应由哪个工作流负责 |
应按此结构完成工作,而不是停下来争论。在回复中列出每一项未完全按字面执行的请求,并用一行说明原因。
Quality Assurance (QA) Principles
质量保证(QA)原则
When applying Merlon Docs, act as a complementary partner to other skills and systems.
These habits keep product documentation accurate and current while the product keeps changing (the gate keeps structure and links sound; it does not replace this review):
merlon check- Always reference doc shards: Insert yourself into the process so the current task points at the correct documentation shards before work spreads.
- Update as you go: Continuously update documentation as work progresses so shards and code do not drift apart mid-change.
- Small batches / one focused feature: Prefer one shippable slice per branch or session. Oversized requests produce tangled diffs and half-updated docs; split the request (and the shards) before coding so each change stays reviewable and documentation can stay current with it. Pair with Atomic commit groups below when the plan has more than one logical change.
- Atomic commit groups: Before waiting for human review / “go”, coding and
multi-concern plans MUST include numbered commit groups. Each group:
id/name, one concern, exact files, and the intended conventional commit
subject. After approval: implement and one group at a time; do not squash unrelated concerns into one commit. Why: reviewable diffs, one concern per commit, and it matches small batches.
git commit - Current docs only: Shards must describe the product as it works now,
in the present tense. When behavior or guidance changes, delete the
superseded text from durable docs, and git history keeps the old wording.
Consumer notice of a breaking or removed behavior goes in the changeset,
which is folded into package CHANGELOGs at release. The history behind a
rule or constraint that still holds, such as an erratum or how things worked
before the rule, moves instead to an ADR, or the repo's equivalent decision
record, that the shard or standalone guide links. In the ADR, write each
date on its own, because the Vale rule flags a date after
MerlonDocs.DatedClaimoras of. The shard or standalone guide states today's reason in one present-tense sentence and does not link the incident log or ticket behind the change, which stays in the tracker (see No temp info or backlogs below). Never link durable shards or ADRs to pendinguntilfiles, because those notes are temporary. When a repo-local convention such as "explain the constraint" conflicts with this rule, follow this rule..changeset/*.md - Capture ambiguity: Identify ambiguous terms or language and write the clarified details into specific shards.
- Shard single responsibility: Each durable shard has one primary concern, for one audience, serving one job (explain or instruct how-to or define/look up — not several). If you cannot state that responsibility in one sentence, split or narrow the shard before shipping it. Depth: references/shard-responsibility.md.
- Idea mitosis: When a shard grows a second audience, job, or concern — or reading it alone misleads — split it, update the guide index, and cross-link. Do not split only because a file is long. Unsettled discovery and time-bound notes do not share a file with durable current truth.
- Break it down: Organize information into the smallest useful pieces (shards) so agents can load one shard at a time instead of whole compiled output. Prefer mitosis over oversized shards.
- Two-level review: Review each changed idea or shard in isolation for local correctness and single responsibility. Then review it comprehensively against related shards and guides — flag duplication, better splits/merges/relocations, and drift between what guides promise and what the change does. When a change touches a guide (a shard, a skill, or code whose behavior a guide documents), the review is complete only when the change and its guides agree.
- No code in docs: Put intent, contracts, and acceptance criteria in shards — not implementation. Code samples and internals drift; the codebase is the source of truth for how something is built. This matches What belongs where below.
- No temp info or backlogs: Do not record temporary project information,
tickets, incident logs, or migration backlogs and planning in the durable
documentation. That information belongs in issue tracking and project
planning tools. Pending files are temporary release notes — write them for the release pipeline; do not link them from ADRs or other durable docs.
.changeset/*.md - Record planning locations: Record where planning documents and architectural decisions live so agents can find them without stuffing plans into durable product shards.
应用 Merlon Docs 时,应作为其他 Skill 和系统的补充协作方。下列习惯可在产品持续变化时保持产品文档准确且最新( 门禁可确保结构和链接有效,但不能替代这项审查):
merlon check- 始终引用文档分片: 让自己参与整个过程,确保当前任务在工作中扩散之前指向正确的文档分片。
- 持续更新: 在工作推进过程中不断更新文档,避免分片与代码在变更中途发生漂移。
- 小批量/聚焦单个功能: 每个分支或会话优先处理一个可交付切片。过大请求会产生纠缠的 diff 和只更新一半的文档;应在编码前拆分请求(以及分片),使每项变更都便于审查,并让文档能随之保持最新。计划包含多个逻辑变更时,请结合下文的原子提交分组。
- 原子提交分组: 在等待人工审查或“继续”之前,涉及编码和多个关注点的计划必须包含带编号的提交分组。每组应包含:id/名称、单一关注点、准确文件列表,以及拟用的约定式提交主题。获得批准后:逐组实现并执行 ;不要把无关关注点压缩为一次提交。原因是:diff 易于审查、每次提交只处理一个关注点,并符合小批量原则。
git commit - 仅保留当前文档: 分片必须以现在时描述产品当前的工作方式。行为或指导发生变化时,应从持久文档中删除被取代的文本,旧措辞由 git 历史保留。面向使用者的破坏性变更或移除变更通知应写入 changeset,发布时再汇总到包的 CHANGELOG 中。仍然成立的规则或约束背后的历史,例如更正说明,或规则制定前的工作方式,应移至 ADR 或仓库等效的决策记录中,并由分片或独立指南链接。在 ADR 中,每个日期应单独成行,因为 Vale 规则会标记
MerlonDocs.DatedClaim或as of之后的日期。分片或独立指南应使用一句现在时说明今天的理由,并且不链接变更背后的事故日志或 ticket;后者保留在跟踪工具中(见下文不含临时信息或待办事项)。永不要让持久分片或 ADR 链接到待处理的until文件,因为这些说明是临时的。如果仓库本地约定,如“解释该约束”,与本规则冲突,应遵循本规则。.changeset/*.md - 记录歧义: 识别含义或措辞不明确的术语,并将澄清后的细节写入具体分片。
- 分片单一职责: 每个持久分片只承担一个主要关注点,面向一类受众,完成一项工作(解释或指导操作或定义/查阅——不可兼有)。如果无法用一句话概括该职责,应在交付前拆分或收窄分片。深入说明: references/shard-responsibility.md。
- 想法分裂: 当分片开始面向第二类受众、承担第二项工作或关注点,或者单独阅读会造成误解时,应拆分它,更新指南索引,并建立交叉链接。不要仅因文件过长就拆分。尚未定论的探索结果和有时效性的说明不得与描述持久当前事实的内容放在同一文件中。
- 拆分内容: 将信息组织成最小可用片段,即分片,使 Agent 每次只加载一个分片,而非整个编译输出。优先采用想法分裂,避免超大分片。
- 两级审查: 先单独审查每个变更后的想法或分片,检查局部正确性及单一职责。然后全面对照相关分片和指南进行审查——标出重复内容、更合理的拆分、合并或迁移,以及指南承诺与变更实际行为之间的漂移。当变更触及指南(分片、Skill,或指南有记录的代码行为)时,只有变更与相关指南保持一致,审查才算完成。
- 文档中不写代码: 将意图、契约和验收标准放入分片,而不是放入实现细节。代码示例和内部实现容易漂移;代码库才是实现方式的事实来源。这与下文的内容应放在哪里一致。
- 不含临时信息或待办事项: 不要在持久文档中记录临时项目信息、ticket、事故日志、迁移待办事项和计划。这些信息应保存在问题跟踪和项目规划工具中。待处理的 文件是临时发布说明——应编写它们以供发布流水线使用;不要从 ADR 或其他持久文档链接它们。
.changeset/*.md - 记录规划位置: 记录规划文档和架构决策的存放位置,使 Agent 无需将计划塞入持久产品分片也能找到它们。
What belongs where
内容应放在哪里
Documentation is a first-class artifact alongside code. We use a spec-driven workflow: shards hold context, intent, and the high-level meta plan; implementation details stay in code.
The default Merlon Docs structure acts as the "batteries-included" Code Repository Archetype. This fundamental four-tier taxonomy enforces strict boundaries to prevent the docs system from falling apart as it scales:
| Guide | Holds | Does not hold |
|---|---|---|
| Product capabilities, design/ADRs, contracts, acceptance criteria | Maintainer runbooks, live eval suites, contributor setup, code walkthroughs |
| Consumer value and usage of the product, including install and configuration | Internal contributor process, skill authoring and live evals |
| Repo setup, layout, validation, workflow, tracker integration, releases, skill development, live evals | Product capability specs or end-user tutorials |
| Shared terms and disambiguation | General code snippets |
Placement test: If only contributors to this repo need the shard, put it in . If consumers of the product need it, use or . The same topic may span tiers (for example Agent Skill product delivery vs maintainer live evals). Placement is one axis of shard single responsibility; if consumer and contributor needs collide in one file, use idea mitosis.
docs/developer/docs/features/docs/client/(Note: The Merlon Docs engine itself is domain-agnostic. Non-code projects can define entirely different guide tiers/archetypes while still using the same compile and validation checks. Lineage for external frameworks: references/acknowledgments.md.)
文档是与代码并列的一等产物。我们采用规范驱动工作流:分片承载上下文、意图和高层元计划;实现细节保留在代码中。
默认的 Merlon Docs 结构充当“开箱即用”的 代码仓库原型。这一基础的四层分类体系划定了严格边界,防止文档系统在扩展过程中瓦解:
| 指南 | 包含 | 不包含 |
|---|---|---|
| 产品能力、设计/ADR、契约、验收标准 | 维护者运行手册、实时评估套件、贡献者设置、代码讲解 |
| 面向消费者的产品价值和使用方式,包括安装与配置 | 内部贡献流程、Skill 编写和实时评估 |
| 仓库设置、布局、验证、工作流、跟踪工具集成、发布、Skill 开发、实时评估 | 产品能力规范或最终用户教程 |
| 共享术语和消歧 | 常规代码片段 |
放置测试: 如果只有本仓库的贡献者需要该分片,将其放入 。如果产品消费者需要它,则使用 或 。同一主题可能跨越多个层级,例如 Agent Skill 产品交付与维护者实时评估。放置是分片单一职责的一个维度;如果消费者和贡献者的需求在同一个文件中发生冲突,应采用想法分裂。
docs/developer/docs/features/docs/client/(注意:Merlon Docs 引擎本身与领域无关。非代码项目可以定义完全不同的指南层级或原型,同时仍使用相同的编译和验证检查。外部框架的渊源:references/acknowledgments.md。)
Authoring rules
编写规则
- Shards under are the source of truth.
docs/**/ - Use headings in shards; Merlon Docs demotes them during compile.
# - After changing a guide's link order (e.g., in ), run
index.md— there is no separate manifest sync step.merlon compile - After inserting cross-links, run
[text](#slug)so fragments match compiled slugs (usemerlon checkif you need to inspect the registry).merlon refs list
- 下的分片是事实来源。
docs/**/ - 在分片中使用 标题;Merlon Docs 会在编译期间降低其标题级别。
# - 更改指南的链接顺序后,例如在 中更改,运行
index.md——没有单独的清单同步步骤。merlon compile - 插入 交叉链接后,运行
[text](#slug),使片段与编译后的 slug 匹配;如果需要检查注册表,可使用merlon check。merlon refs list
Removing or renaming a concept
移除或重命名概念
A removed component, flag, command or term is easy to miss in a guide nobody
searched, most often a standalone guide outside the docs root. Run these steps
before you commit when a change removes or renames a component, flag or command
in the product or a term in the docs. Run them too when a change, such as an
ADR written after the removal, finds docs that still describe a component, flag
or command that the product no longer has. Docs describe a concept for as long
as the product has it, so a design that only plans a removal leaves them as
they are, and the change that makes the removal runs the steps.
-
From the repository root, search every Markdown file for the old name, with onefor each spelling. A spelling also finds a plural that only adds letters, such as
-eforworkers. A plural that changes the ending, such asworkerforproxies, needs its ownproxy. For a name of two or more words, add an-efor its most distinctive word too, and one for that word's plural when the plural changes the ending:-ebashgit grep --untracked -n -i -F -e '<old name>' -e '<other spelling>' -e '<changed plural>' -e '<distinctive word>' -- '*.md'Keepin quotes and leave'*.md'out of this command. Add the path of any-wentry that is not astandaloneGuidesfile, and a pathspec such as.mdfor agent instruction files in another extension. Search for a removed concept in the consolidation playbook explains what each option matches. It also covers a short word that appears inside unrelated words, which moves out of this command into a second one with'*.mdc'.-w -
Run the repo's docs check, itsscript or
docs:check. Ifmerlon checkis unset orlint.paths.severity(the default), set it toofffor this run only, read thewarnreports for the removed paths, and leave that config change out of the commit.path-warn: -
In the same change, fix every hit in a durable doc that refers to the old concept, standalone guides outside the docs root included. These fixes belong to the change in every workflow, whatever its declared scope, so make them without stopping to ask. Fix a hit in compiled output in its shard, then recompile. Historical records such as ADRs, CHANGELOGs and research records keep their mentions, and so do the pending release notes under. Leave a hit in a vendor-managed skill install or a test fixture as it is, because neither is a durable doc of this repo.
.changeset/ -
In the commit message, give each search command and list the files it hit. Break a command longer than the repo's commit line limit across lines with a trailing backslash.
移除组件、开关、命令或术语时,很容易遗漏某个无人搜索过的指南中的引用,最常见的是 docs 根目录之外的独立指南。当变更移除或重命名产品中的组件、开关或命令,或者移除或重命名文档中的术语时,请在提交前执行以下步骤。当某项变更,例如移除完成后才写的 ADR,发现文档仍在描述产品已不再具有的组件、开关或命令时,也应执行这些步骤。文档会在产品仍具有某个概念时持续描述它,因此,只计划移除某项内容的设计不会改变文档,真正实施移除的变更才需要执行这些步骤。
-
从仓库根目录搜索每个 Markdown 文件中的旧名称,每个拼写使用一个。某个拼写也能匹配仅增加字母的复数形式,例如
-e对workers。如果复数形式改变词尾,例如worker对proxies,则需要单独添加一个proxy。对于由两个或更多单词组成的名称,还要为最有辨识度的单词添加一个-e,并在该单词的复数形式改变词尾时再添加一个:-ebashgit grep --untracked -n -i -F -e '<old name>' -e '<other spelling>' -e '<changed plural>' -e '<distinctive word>' -- '*.md'保留的引号,并且不要在此命令中使用'*.md'。添加任何不是-w文件的.md条目的路径,以及其他扩展名的 Agent 指令文件(例如standaloneGuides)的路径规格。搜索已移除概念时,整合手册解释了每个选项匹配的内容。它还涵盖出现在无关单词内部的短词;对于这种情况,应从本命令中移出,改用另一个带'*.mdc'的命令。-w -
运行仓库的文档检查、脚本或
docs:check。如果merlon check未设置或为lint.paths.severity(默认值),仅为本次运行将其设为off,阅读被移除路径对应的warn报告,并且不要将这项配置更改提交。path-warn: -
在同一变更中,修复持久文档中每一处指向旧概念的命中结果,包括 docs 根目录之外的独立指南。这些修复属于每个工作流中的变更,无论其声明范围如何,因此应直接完成,不要停下来询问。如果在编译输出中发现命中结果,应在其分片中修复,然后重新编译。历史记录,如 ADR、CHANGELOG 和研究记录,保留其中的提及,待处理的下的发布说明也应保留。对于供应商管理的 Skill 安装或测试夹具中的命中结果,保持不变,因为两者都不是本仓库的持久文档。
.changeset/ -
在提交消息中,给出每条搜索命令并列出其命中的文件。超过仓库提交信息行长度限制的命令,应使用行尾反斜杠换行。
When to use
何时使用
- PROACTIVELY on ANY feature, bugfix, or architectural task: Merlon Docs must be involved in the entire process. Before writing code, trace the requirement back to documentation. Consider the end-user problems and ensure helpful docs exist or are created.
- Authoring or refactoring sharded markdown under a docs root
- Bootstrapping Merlon Docs in a repository, or reviewing and reorganizing an existing docs set
- Cross-links / refs while writing docs
- Extending guidance via complementary skills or local when needed
docs/extensions/
- 在任何功能、bug 修复或架构任务中主动使用: Merlon Docs 必须参与整个过程。在编写代码前,将需求追溯到文档。考虑最终用户面临的问题,并确保存在有帮助的文档或已创建相应文档。
- 在 docs 根目录下编写或重构分片 Markdown
- 在仓库中初始化 Merlon Docs,或审查和重组现有文档集
- 编写文档时处理交叉链接或 refs
- 需要时通过配套 Skill 或本地 扩展指导
docs/extensions/
Execution steps
执行步骤
1. Install or rediscover
1. 安装或重新发现
bash
npx skills add Merlon-Docs/merlon --skill merlon-docsbash
npx skills add Merlon-Docs/merlon --skill merlon-docs2. Prefer smallest context
2. 优先使用最小上下文
Discover the relevant shard with host search (, IDE search) or the guide
, then open one shard. Broader reads of compiled output are
last resort.
rgindex.md.md使用宿主搜索(、IDE 搜索)或指南的 发现相关分片,然后只打开一个 分片。读取更广泛的编译输出是最后手段。
rgindex.md.md3. Edit shards, then validate
3. 编辑分片,然后验证
- Edit shards under guides in .
compileOrder - Update /
index.mdwhen adding files.shards.md - Build compiled docs from shards, then validate the docs tree (see references/cli-and-scripts.md for what these mean):
bash
merlon compile
merlon check- 编辑 中各指南下的分片。
compileOrder - 添加文件时,更新 或
index.md。shards.md - 构建由分片生成的编译文档,然后验证文档树;这些操作的含义见 references/cli-and-scripts.md:
bash
merlon compile
merlon check4. Code Formatting and Linting
4. 代码格式化和 Lint
If the user asks to set up formatting or linting, they should install , , and via their package manager. (Note: Merlon Docs is flexible; if the user prefers other formatting or linting tools, you can integrate those instead.)
prettiermarkdownlint-cli2@merlon-docs/merlon-docs-presetsTo automatically format documents using the default tools:
bash
merlon fixTo run prose linting (requires Vale):
bash
merlon prose如果用户要求设置格式化或 lint,应让他们通过各自的包管理器安装 、 和 。(注意:Merlon Docs 具有灵活性;如果用户更偏好其他格式化或 lint 工具,也可以集成这些工具。)
prettiermarkdownlint-cli2@merlon-docs/merlon-docs-presets要使用默认工具自动格式化文档:
bash
merlon fix要运行 prose lint,需要 Vale:
bash
merlon prose5. Pick the workflow
5. 选择工作流
Each kind of work has its own workflow file. Pick one for the current
(one focused batch per branch), read that file, and follow its
Process. Do not load the others.
WORK_ITEM| The task | Workflow |
|---|---|
No | getting-started |
| Documentation only, no product code | doc-only |
| Architecture, RFC, or ADR, before or after the code change | design-architecture |
| A feature or bugfix that changes product code | feature-level |
| End-user journeys, client guides, UI that serves them | ux |
| Review, tidy, or reorganize docs; or a sprawl trigger below matches | doc-review |
When a request spans several rows (for example "design it, build it, and write
the user guide"), take the first row that applies as this , say which
parts you are deferring, and name the workflow each one needs.
WORK_ITEMmermaid
flowchart TB
Q{What kind of work?}
Q -->|Bootstrap Merlon Docs in a repo| GS[getting-started]
Q -->|Docs / technical writing only| DO[doc-only]
Q -->|ADR / RFC / high-level design| DA[design-architecture]
Q -->|Feature: docs-first then TDD| FL[feature-level]
Q -->|UX / end-user experience| UX[ux]
Q -->|Review or tidy the docs set| DR[doc-review]
GS --> GSa["docs/features/, docs/client/, docs/developer/, docs/glossary/<br/>+ merlon.config.json"]
DO --> DOa["docs/features/, docs/client/, docs/developer/,<br/>standalone guides (no product code)"]
DA --> DAa["docs/features/, docs/features/adr/<br/>design shards only"]
FL --> FLa["docs/features/, docs/client/<br/>then source + tests"]
UX --> UXa["docs/client/<br/>then UI as needed"]
DR --> DRa["any guide: merge, split, move, reword, link<br/>+ guide indexes"]Hosts that can fork work (Task tool, , and similar) may run the
chosen workflow in an isolated agent; otherwise follow it in the main session.
context: fork每项工作都有自己对应的工作流文件。为当前 (每个分支一个聚焦批次)选择一个,读取该文件并遵循其中的流程。不要加载其他文件。
WORK_ITEM| 任务 | 工作流 |
|---|---|
尚无 | getting-started |
| 仅处理文档,不涉及产品代码 | doc-only |
| 代码变更之前或之后的架构、RFC 或 ADR | design-architecture |
| 会更改产品代码的功能或 bug 修复 | feature-level |
| 最终用户旅程、客户指南、服务于用户的 UI | ux |
| 审查、整理或重组文档,或命中下方的文档膨胀条件 | doc-review |
当请求跨越多行,例如“设计、实现并编写用户指南”,选择适用于当前 的第一行,说明哪些部分将推迟处理,并指出每一部分需要哪个工作流。
WORK_ITEMmermaid
flowchart TB
Q{工作类型?}
Q -->|在仓库中初始化 Merlon Docs| GS[getting-started]
Q -->|仅文档/技术写作| DO[doc-only]
Q -->|ADR/RFC/高层设计| DA[design-architecture]
Q -->|功能:文档优先,然后 TDD| FL[feature-level]
Q -->|UX/最终用户体验| UX[ux]
Q -->|审查或整理文档集| DR[doc-review]
GS --> GSa["docs/features/, docs/client/, docs/developer/, docs/glossary/<br/>+ merlon.config.json"]
DO --> DOa["docs/features/, docs/client/, docs/developer/,<br/>standalone guides (no product code)"]
DA --> DAa["docs/features/, docs/features/adr/<br/>design shards only"]
FL --> FLa["docs/features/, docs/client/<br/>then source + tests"]
UX --> UXa["docs/client/<br/>then UI as needed"]
DR --> DRa["any guide: merge, split, move, reword, link<br/>+ guide indexes"]可分叉工作的宿主(Task tool、 等)可以在隔离的 Agent 中运行所选工作流;否则在主会话中遵循它。
context: fork6. Sprawl triggers
6. 文档膨胀触发条件
Docs sprawl gradually, and nobody notices until a reader gets lost. Do not wait
for the user to spot it. When any of these is true at the end of a workflow,
run and, if it reports findings, offer the
doc-review workflow as the next
:
merlon reviewWORK_ITEM- The session added three or more shards, or added a shard to a guide index that already had about a dozen entries.
- You wrote a rule or definition and found the same idea already stated in another shard.
- A shard you edited now serves a second audience or job.
- The change renamed, moved, or deleted a shard.
- The change removed or renamed a concept in the sense of Removing or renaming a concept. Those steps run before its commit, and this trigger adds the review after it.
文档膨胀会逐渐发生,而读者迷失之前通常无人察觉。不要等用户发现。当工作流结束时满足以下任一条件,运行 ;如果它报告发现问题,将 doc-review 工作流作为下一个 提供:
merlon reviewWORK_ITEM- 本次会话新增了三个或更多分片,或向已有约十二个条目的指南索引新增了分片。
- 编写了一条规则或定义,并发现同一想法已在另一个分片中陈述。
- 编辑的分片现在服务于第二类受众或第二项工作。
- 变更重命名、移动或删除了一个分片。
- 变更以移除或重命名概念中所述的方式移除或重命名了概念。这些步骤需在提交前执行,此触发条件则会在其后增加一次审查。
7. Weekly review routine (actively changing projects only)
7. 每周审查例程(仅适用于持续活跃变更的项目)
Sprawl triggers catch what one session adds. In a project whose docs change
every week, small additions from many sessions still pile up between them. For
those projects, recommend a weekly routine. The user sets it up in whatever
scheduler their agent host or CI offers. Each run reviews every guide in
separately:
compileOrder- for the mechanical signals. Duplicates shared with other guides are included.
merlon review --guide <name> - The doc-review workflow with SCOPE set to that guide. Decide where each duplicated rule belongs, keep it there, and link to it from the other shards.
Recommend it only when docs changed in most weeks of the last month. Most
weeks means commits in at least three different weeks of
. For a one-off project or one that
changes now and then, say the routine is not needed. The sprawl triggers above
cover it.
git log --since="4 weeks ago" -- docs/A routine with nothing to start it never runs. When you recommend one, the
repo's contributor docs must state two things about it:
- Trigger: what starts each run. That is a CI cron workflow, a scheduled task in the agent host, or a named role that the contributor docs assign the run to as a duty. A schedule alone, such as "every Monday", is no trigger, and neither is a team or role that the docs name without assigning it the run.
- Evidence: what each run leaves behind that outlasts CI log retention, such as a comment on a standing tracker item. A run that doesn't find anything leaves it too, and a run that changes docs also leaves its commit.
Write into the docs only a trigger the repo has. When it has none yet, say in
your reply what the user must set up and leave the routine out of the docs
until they do, or label the routine advisory. An advisory routine says which
role may run it and what a run leaves behind, and it doesn't need a record of a
run that finds nothing.
In any project, a cadence the repo already documents needs a trigger and
evidence too. Without a trigger, remove the cadence or label it advisory in the
same way. With a trigger but no stated evidence, state the record each run
leaves, as Evidence above describes. When runs leave none, say in your
reply what the user must add.
文档膨胀触发条件能发现单次会话新增的内容。在每周文档都会变化的项目中,许多次会话带来的小规模新增仍会在两次审查之间不断累积。对于这类项目,应建议建立每周例行机制。用户可通过 Agent 宿主或 CI 提供的任意调度器进行设置。每次运行分别审查 中的每份指南:
compileOrder- 运行 获取机械性检查信号。与其他指南共享的重复项也会包含在内。
merlon review --guide <name> - 运行 doc-review 工作流,并将 SCOPE 设置为该指南。决定每条重复规则应归属何处,将其保留在该处,并从其他分片链接到它。
仅当过去一个月大多数周都有文档变更时,才建议此例行机制。“大多数周”指 中至少三个不同周存在提交。对于一次性项目或偶尔变化的项目,应说明不需要该例行机制。上文的文档膨胀触发条件已足以覆盖这些情况。
git log --since="4 weeks ago" -- docs/没有启动条件的例行机制永远不会运行。建议建立例行机制时,仓库的贡献者文档必须说明以下两点:
- 触发条件: 每次运行的启动方式。可以是 CI cron 工作流、Agent 宿主中的定时任务,或贡献者文档指定负责运行该任务的角色。仅有时段,如“每周一”,不算触发条件;同样,仅仅在文档中提到团队或角色,却未将运行职责分配给它,也不算触发条件。
- 证据: 每次运行会留下哪些超出 CI 日志保留期的记录,例如在常设跟踪事项中发表评论。即使运行未发现问题,也必须留下记录;如果运行修改了文档,也应留下相应提交。
只应把仓库确实具备的触发条件写入文档。如果尚无触发条件,应在回复中说明用户必须设置什么,并在其完成之前不要把例行机制写入文档,或将其标记为建议性机制。建议性机制需要说明哪个角色可以运行以及每次运行会留下什么记录,不要求记录未发现任何问题的运行。
任何项目都适用同样要求:仓库已有记录的任何执行频率都需要触发条件和证据。没有触发条件时,应按上述方式移除该频率或将其标记为建议性机制。有触发条件但未说明证据时,应按照上文证据部分的要求说明每次运行留下的记录。如果运行不留下任何记录,应在回复中说明用户必须补充什么。
Zero-install
零安装
Copy the skill folder into the skills directory your agent discovers
(see skills CLI Supported Agents).
For example for Cursor/Amp project installs — not a
universal portable path.
merlon-docs.agents/skills/merlon-docs/将 skill 文件夹复制到你的 Agent 能够发现的 skills 目录,参见 skills CLI Supported Agents。例如 Cursor/Amp 项目安装所使用的 ——它并非通用可移植路径。
merlon-docs.agents/skills/merlon-docs/