setup-demon-skills
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSetup Demon Skills
搭建Demon技能
Scaffold the per-repository conventions the maintenance flow assumes:
- Agent Note tree — the layout and the note format.
.agents/notes/{proposed,implemented,rejected,archived}/{class}/ - Bilingual pairing — the +
foo.md+foo.zh.mdtriplet convention and both switcher lines.foo.i18n.yaml - Documentation standard — the structure, tier, budget, and slop rules that
docs/AGENTS.mdapplies.doc-standards - Session discipline — the four standing-order lines that gate execution, verification, and destructive actions.
- Documentation budget gate — the self-contained script plus its manifest that enforce the standard's ceilings.
verify-doc-budgets - Change-scope tool — the script that reports a change's committed and worktree scope;
change-scopeandpre-push-checksread it.code-review - Git hooks — the jobs that verify translation pairing, archived notes, and whitespace before commit.
lefthook.yml - Where they live — a line in the repository's root pointing at the four doc locations; the tools land in
AGENTS.mdandscripts/, which need no pointer.lefthook.yml
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:
- at the repository root — is there already a documentation/decisions section?
AGENTS.md - — does the note tree already exist?
.agents/notes/ - — does a bilingual pairing convention already exist?
docs/i18n/ - — does a documentation standard already exist?
docs/AGENTS.md - The root — does a session-discipline block already exist?
AGENTS.md - — does a documentation budget gate already exist?
scripts/ - — does a change-scope helper already exist?
scripts/change-scope.mjs - — do git hooks already exist?
lefthook.yml
读取现有内容,不要主观假设:
- 仓库根目录的— 是否已有文档/决策章节?
AGENTS.md - — 笔记树是否已存在?
.agents/notes/ - — 是否已存在双语配对约定?
docs/i18n/ - — 是否已存在文档标准?
docs/AGENTS.md - 根目录的— 是否已存在会话规范模块?
AGENTS.md - — 是否已存在文档预算管控机制?
scripts/ - — 是否已存在变更范围辅助工具?
scripts/change-scope.mjs - — 是否已存在Git钩子?
lefthook.yml
2. Scaffold what is missing
2. 搭建缺失的内容
- Agent Note tree: if is absent, create the lifecycle and class directories and a short
.agents/notes/stating the note format —README.md/# Agent Note: <title>, a firstStatus: <status>section, then## Problem/## 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 stating the tutorial/reference forms, the one-home-per-fact taxonomy, word budgets, and the slop checklist;
docs/AGENTS.mdowns the workflow that applies it.doc-standards - 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 into the host's
scripts/verify-doc-budgets.mjsandscripts/toscripts/doc-budgets.manifest.template.json; then adjust the ceilings to the host's always-loaded docs. The gate runs asscripts/doc-budgets.manifest.json, andnode scripts/verify-doc-budgets.mjsprints the table.--list - Change-scope tool: copy this skill's into the host's
scripts/change-scope.mjs;scripts/andpre-push-checksruncode-review(optionally withnode scripts/change-scope.mjs --base <ref>) to report the committed and worktree scope of a change.--head <ref> - Git hooks: copy this skill's to the host's
scripts/lefthook.template.ymlandlefthook.ymlbeside 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 itsscripts/install-lefthook.mjsfirst; the whitespace job runs everywhere. Activate withscripts/.npm run install-lefthook - Record the pointers: add a line to the root pointing at the note rules, the pairing contract, the documentation standard, and the session discipline.
AGENTS.md
- 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 to govern the docs) audits and enforces the standard going forward.
ask-demon搭建完成后,治理运行(调用来管控文档)会审核并持续执行该标准。
ask-demon