setup-demon-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Setup Demon Skills

搭建Demon技能

Scaffold the per-repository conventions the maintenance flow assumes:
  • Agent Note tree — the
    .agents/notes/{proposed,implemented,rejected,archived}/{class}/
    layout and the note format.
  • Bilingual pairing — the
    foo.md
    +
    foo.zh.md
    +
    foo.i18n.yaml
    triplet convention and both switcher lines.
  • Documentation standard — the
    docs/AGENTS.md
    structure, tier, budget, and slop rules that
    doc-standards
    applies.
  • Session discipline — the four standing-order lines that gate execution, verification, and destructive actions.
  • Documentation budget gate — the self-contained
    verify-doc-budgets
    script plus its manifest that enforce the standard's ceilings.
  • Change-scope tool — the
    change-scope
    script that reports a change's committed and worktree scope;
    pre-push-checks
    and
    code-review
    read it.
  • Git hooks — the
    lefthook.yml
    jobs that verify translation pairing, archived notes, and whitespace before commit.
  • Where they live — a line in the repository's root
    AGENTS.md
    pointing at the four doc locations; the tools land in
    scripts/
    and
    lefthook.yml
    , which need no pointer.
This is a prompt-driven skill, not a deterministic script. Explore, present what you found, confirm with the user, then write.
为维护流程预设的每个仓库约定搭建基础架构:
  • Agent Note树
    .agents/notes/{proposed,implemented,rejected,archived}/{class}/
    的目录结构及笔记格式。
  • 双语配对
    foo.md
    +
    foo.zh.md
    +
    foo.i18n.yaml
    的三联约定及两种切换器代码行。
  • 文档标准
    docs/AGENTS.md
    的结构、层级、预算及容错规则,由
    doc-standards
    工具执行。
  • 会话规范 — 管控执行、验证及破坏性操作的四条常规准则。
  • 文档预算管控机制 — 独立的
    verify-doc-budgets
    脚本及其清单,用于强制执行标准中的上限要求。
  • 变更范围工具
    change-scope
    脚本,用于报告变更的已提交及工作区范围;
    pre-push-checks
    code-review
    会调用该工具。
  • Git钩子
    lefthook.yml
    任务,在提交前验证翻译配对、归档笔记及空白字符。
  • 存放位置记录 — 在仓库根目录的
    AGENTS.md
    中添加一行内容,指向四个文档的位置;工具将存放在
    scripts/
    目录及
    lefthook.yml
    中,无需额外指向。
这是一个由提示词驱动的技能,而非确定性脚本。先探索现有内容,展示发现的信息,与用户确认后再进行编写。

Process

流程

1. Explore

1. 探索

Read what exists; do not assume:
  • AGENTS.md
    at the repository root — is there already a documentation/decisions section?
  • .agents/notes/
    — does the note tree already exist?
  • docs/i18n/
    — does a bilingual pairing convention already exist?
  • docs/AGENTS.md
    — does a documentation standard already exist?
  • The root
    AGENTS.md
    — does a session-discipline block already exist?
  • scripts/
    — does a documentation budget gate already exist?
  • scripts/change-scope.mjs
    — does a change-scope helper already exist?
  • lefthook.yml
    — do git hooks already exist?
读取现有内容,不要主观假设:
  • 仓库根目录的
    AGENTS.md
    — 是否已有文档/决策章节?
  • .agents/notes/
    — 笔记树是否已存在?
  • docs/i18n/
    — 是否已存在双语配对约定?
  • docs/AGENTS.md
    — 是否已存在文档标准?
  • 根目录的
    AGENTS.md
    — 是否已存在会话规范模块?
  • scripts/
    — 是否已存在文档预算管控机制?
  • scripts/change-scope.mjs
    — 是否已存在变更范围辅助工具?
  • lefthook.yml
    — 是否已存在Git钩子?

2. Scaffold what is missing

2. 搭建缺失的内容

  • Agent Note tree: if
    .agents/notes/
    is absent, create the lifecycle and class directories and a short
    README.md
    stating the note format —
    # Agent Note: <title>
    /
    Status: <status>
    , a first
    ## Problem
    section, then
    ## Decision
    /
    ## Alternatives considered
    /
    ## Consequences
    .
  • Bilingual pairing: if no pairing convention exists, record the triplet rule and both switcher lines in a short
    docs/i18n/README.md
    .
  • Documentation standard: if absent, create a short
    docs/AGENTS.md
    stating the tutorial/reference forms, the one-home-per-fact taxonomy, word budgets, and the slop checklist;
    doc-standards
    owns the workflow that applies it.
  • Session discipline: append the four standing-order lines to the root
    AGENTS.md
    :
Act only on an explicit execution signal and confirmed scope; otherwise ask one clarifying question.
A red check blocks the commit: fix it or explain it in the same turn, and name every failed check in the final report.
Inspect a file before editing or describing it; never present content as read or work as done that you have not verified.
Destructive or irreversible actions (deletions, history rewrites, force-push) require an explicit, named confirmation.
  • Documentation budget gate: copy this skill's
    scripts/verify-doc-budgets.mjs
    into the host's
    scripts/
    and
    scripts/doc-budgets.manifest.template.json
    to
    scripts/doc-budgets.manifest.json
    ; then adjust the ceilings to the host's always-loaded docs. The gate runs as
    node scripts/verify-doc-budgets.mjs
    , and
    --list
    prints the table.
  • Change-scope tool: copy this skill's
    scripts/change-scope.mjs
    into the host's
    scripts/
    ;
    pre-push-checks
    and
    code-review
    run
    node scripts/change-scope.mjs --base <ref>
    (optionally with
    --head <ref>
    ) to report the committed and worktree scope of a change.
  • Git hooks: copy this skill's
    scripts/lefthook.template.yml
    to the host's
    lefthook.yml
    and
    scripts/install-lefthook.mjs
    beside it; it verifies translation pairing on staged consistency records, verifies archived notes, and checks staged whitespace. The pairing and archive jobs need the host's pairing and archive gates copied into its
    scripts/
    first; the whitespace job runs everywhere. Activate with
    npm run install-lefthook
    .
  • Record the pointers: add a line to the root
    AGENTS.md
    pointing at the note rules, the pairing contract, the documentation standard, and the session discipline.
  • Agent Note树:如果
    .agents/notes/
    不存在,创建生命周期和分类目录,并编写简短的
    README.md
    说明笔记格式 —
    # Agent Note: <标题>
    /
    Status: <状态>
    ,第一个章节为
    ## 问题
    ,随后是
    ## 决策
    /
    ## 考虑过的替代方案
    /
    ## 影响
  • 双语配对:如果不存在配对约定,在简短的
    docs/i18n/README.md
    中记录三联规则及两种切换器代码行。
  • 文档标准:如果不存在,创建简短的
    docs/AGENTS.md
    ,说明教程/参考格式、一事实一来源的分类规则、字数预算及容错检查清单;
    doc-standards
    负责执行应用该标准的工作流。
  • 会话规范:将四条常规准则追加到根目录的
    AGENTS.md
    中:
仅根据明确的执行信号和确认的范围采取行动;否则提出一个澄清问题。
红色检查标记会阻止提交:修复问题或在同一轮次中解释问题,并在最终报告中列出所有未通过的检查项。
编辑或描述文件前先检查文件内容;绝不要将未验证过的内容展示为已读取,或未完成的工作展示为已完成。
破坏性或不可逆操作(删除、历史重写、强制推送)需要明确的、指定名称的确认。
  • 文档预算管控机制:将本技能的
    scripts/verify-doc-budgets.mjs
    复制到宿主的
    scripts/
    目录,并将
    scripts/doc-budgets.manifest.template.json
    复制为
    scripts/doc-budgets.manifest.json
    ;然后根据宿主的常驻文档调整上限值。该管控机制通过
    node scripts/verify-doc-budgets.mjs
    运行,
    --list
    参数可打印表格。
  • 变更范围工具:将本技能的
    scripts/change-scope.mjs
    复制到宿主的
    scripts/
    目录;
    pre-push-checks
    code-review
    会运行
    node scripts/change-scope.mjs --base <ref>
    (可选添加
    --head <ref>
    )来报告变更的已提交及工作区范围。
  • Git钩子:将本技能的
    scripts/lefthook.template.yml
    复制到宿主的
    lefthook.yml
    ,并将
    scripts/install-lefthook.mjs
    复制到其旁边;该钩子会验证暂存的一致性记录中的翻译配对、验证归档笔记,并检查暂存的空白字符。配对和归档任务需要先将宿主的配对和归档管控机制复制到其
    scripts/
    目录中;空白字符任务适用于所有场景。通过
    npm run install-lefthook
    激活钩子。
  • 记录指向信息:在根目录的
    AGENTS.md
    中添加一行内容,指向笔记规则、配对约定、文档标准及会话规范。

3. Confirm before writing

3. 编写前确认

Present each scaffolded piece and its destination; write only after the user confirms.
展示每个搭建的内容及其目标位置;仅在用户确认后再进行编写。

4. Hand off

4. 交接

Once scaffolded, the governance run (ask
ask-demon
to govern the docs) audits and enforces the standard going forward.
搭建完成后,治理运行(调用
ask-demon
来管控文档)会审核并持续执行该标准。