@tanlinfeng/project-docs-workflow 0.0.0-stage → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +52 -0
  3. package/README.md +97 -2
  4. package/bin/install.js +227 -0
  5. package/package.json +20 -4
  6. package/skills/deepwork/SKILL.md +15 -0
  7. package/skills/doc-opt/EXAMPLES.md +77 -0
  8. package/skills/doc-opt/SKILL.md +83 -0
  9. package/skills/doc-opt/agents/openai.yaml +5 -0
  10. package/skills/domain-modeling/SKILL.md +83 -0
  11. package/skills/domain-modeling/agents/openai.yaml +3 -0
  12. package/skills/grill-me/SKILL.md +13 -0
  13. package/skills/grill-with-docs/SKILL.md +18 -0
  14. package/skills/grilling/SKILL.md +46 -0
  15. package/skills/grilling/agents/openai.yaml +3 -0
  16. package/skills/improve-codebase-architecture/SKILL.md +15 -0
  17. package/skills/project-docs-workflow/SKILL.md +108 -0
  18. package/skills/project-docs-workflow/agents/openai.yaml +5 -0
  19. package/skills/project-docs-workflow/assets/templates/entries/adr-entry.md +27 -0
  20. package/skills/project-docs-workflow/assets/templates/entries/issue-entry.md +28 -0
  21. package/skills/project-docs-workflow/assets/templates/entries/pdr-current.md +19 -0
  22. package/skills/project-docs-workflow/assets/templates/entries/pdr-interfaces.md +28 -0
  23. package/skills/project-docs-workflow/assets/templates/entries/pdr-module-readme.md +34 -0
  24. package/skills/project-docs-workflow/assets/templates/entries/pdr-nfr.md +22 -0
  25. package/skills/project-docs-workflow/assets/templates/entries/pdr-spec.md +20 -0
  26. package/skills/project-docs-workflow/assets/templates/entries/term-entry.md +22 -0
  27. package/skills/project-docs-workflow/assets/templates/project/adr-readme.md +31 -0
  28. package/skills/project-docs-workflow/assets/templates/project/agents-block.md +15 -0
  29. package/skills/project-docs-workflow/assets/templates/project/agents-domain.md +44 -0
  30. package/skills/project-docs-workflow/assets/templates/project/agents-issues.md +65 -0
  31. package/skills/project-docs-workflow/assets/templates/project/agents-workflow.md +61 -0
  32. package/skills/project-docs-workflow/assets/templates/project/context.md +21 -0
  33. package/skills/project-docs-workflow/assets/templates/project/pdr-00-readme.md +36 -0
  34. package/skills/project-docs-workflow/references/adr.md +53 -0
  35. package/skills/project-docs-workflow/references/coexistence.md +49 -0
  36. package/skills/project-docs-workflow/references/deps/boundaries.md +29 -0
  37. package/skills/project-docs-workflow/references/deps/doc-opt.md +17 -0
  38. package/skills/project-docs-workflow/references/deps/domain-modeling.md +51 -0
  39. package/skills/project-docs-workflow/references/deps/grilling.md +31 -0
  40. package/skills/project-docs-workflow/references/deps/tdd.md +35 -0
  41. package/skills/project-docs-workflow/references/issues.md +51 -0
  42. package/skills/project-docs-workflow/references/pdr.md +33 -0
  43. package/skills/project-docs-workflow/references/terminology.md +21 -0
  44. package/skills/project-docs-workflow/references/workflow.md +45 -0
  45. package/skills/retro/SKILL.md +19 -0
  46. package/skills/tdd/SKILL.md +50 -0
  47. package/skills/tdd/agents/openai.yaml +3 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 project-docs-workflow contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,52 @@
1
+ NOTICE
2
+ ======
3
+
4
+ project-docs-workflow
5
+ Copyright (c) 2026 project-docs-workflow contributors
6
+ Licensed under the MIT License (see LICENSE).
7
+
8
+ Third-party attribution
9
+ -----------------------
10
+
11
+ Portions of the bundled skills in this package are trimmed / adapted from:
12
+
13
+ https://github.com/mattpocock/skills
14
+ MIT License
15
+ Copyright (c) 2026 Matt Pocock
16
+
17
+ The following bundled skills contain material derived from the project above:
18
+
19
+ - skills/grilling
20
+ - skills/grill-me
21
+ - skills/grill-with-docs
22
+ - skills/domain-modeling
23
+ - skills/tdd
24
+ - skills/deepwork
25
+ - skills/retro
26
+ - skills/improve-codebase-architecture
27
+
28
+ The MIT permission notice for the upstream material is reproduced below.
29
+
30
+ ------------------------------------------------------------------------
31
+
32
+ MIT License
33
+
34
+ Copyright (c) 2026 Matt Pocock
35
+
36
+ Permission is hereby granted, free of charge, to any person obtaining a copy
37
+ of this software and associated documentation files (the "Software"), to deal
38
+ in the Software without restriction, including without limitation the rights
39
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
40
+ copies of the Software, and to permit persons to whom the Software is
41
+ furnished to do so, subject to the following conditions:
42
+
43
+ The above copyright notice and this permission notice shall be included in all
44
+ copies or substantial portions of the Software.
45
+
46
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
47
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
49
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
50
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
51
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
52
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,98 @@
1
- # Temporary Holding Version
1
+ # @tanlinfeng/project-docs-workflow
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > 项目文档工作流 skill 包:提供 issue tracker、ADR、PDR、术语表与协作工作流约定,自带轻量依赖 skill 与 ref 兜底,可独立分发。
4
+
5
+ ## 这是什么
6
+
7
+ `project-docs-workflow` 是一套面向 AI agent 的「项目文档工作流」skill。它把项目中的几类关键文档沉淀为可复用的模板与约定:
8
+
9
+ - **issue tracker**:任务 / 缺陷的登记与追踪约定
10
+ - **ADR**(Architecture Decision Record):架构决策记录
11
+ - **PDR**(Product/Project Design Record):设计与需求记录
12
+ - **terminology**:领域术语表,统一团队与 agent 的词汇
13
+ - **workflow**:上述文档之间的协作与更新流程
14
+
15
+ skill 本身是自包含的:主 skill 内部带 `references/deps/*.md` 兜底材料,因此即使没有安装任何依赖 skill,也能独立工作。包内同时附带了若干**轻量依赖 skill**(来自 `mattpocock/skills` 的精简版本)以及一个**附赠的 `doc-opt` skill**。
16
+
17
+ ## 安装
18
+
19
+ 通过 npx 直接安装到默认的 skills 根目录(`~/.agents/skills`):
20
+
21
+ ```bash
22
+ npx @tanlinfeng/project-docs-workflow
23
+ ```
24
+
25
+ 常用选项:
26
+
27
+ | 命令 | 说明 |
28
+ | --- | --- |
29
+ | `npx @tanlinfeng/project-docs-workflow` | 默认动作 `install`:安装主 skill 及所有依赖 skill |
30
+ | `npx @tanlinfeng/project-docs-workflow --dir <path>` | 指定 skills 根目录(默认 `~/.agents/skills`) |
31
+ | `npx @tanlinfeng/project-docs-workflow --force` | 覆盖已存在的 `project-docs-workflow`(**仅主 skill**;依赖 skill 仍不覆盖) |
32
+ | `npx @tanlinfeng/project-docs-workflow --dry-run` | 只打印将执行的操作,不写入任何文件 |
33
+ | `npx @tanlinfeng/project-docs-workflow check` | 检查依赖 skill 的解析状态,全部可解析时退出码为 0,否则为 1 |
34
+
35
+ ### 覆盖策略(安全优先)
36
+
37
+ 安装器**永不覆盖用户已存在的同名 skill**。若目标目录中已存在同名目录,会打印 `同名 skill 已存在,保留用户版本:<name>` 并跳过。只有对主 skill `project-docs-workflow` 使用 `--force` 时才会覆盖它;依赖 skill 即使加了 `--force` 也仍会跳过。
38
+
39
+ ## 直接复制(不使用 npm 安装器)
40
+
41
+ 也可以完全跳过安装器,手动把 `skills/` 下需要的内容复制进你的 skills 根目录:
42
+
43
+ - 逐个复制 `skills/*` 中的目录;**遇到同名目录就跳过,绝不覆盖用户版本**。
44
+ - 也可以**只复制 `skills/project-docs-workflow` 这一个目录**:它会通过内部的 ref 兜底(`references/deps/*.md`)独立工作,无需其他依赖 skill。
45
+
46
+ ## 两级解析协议
47
+
48
+ skill 在引用依赖能力时,遵循两级解析:
49
+
50
+ 1. **按名解析**:如果 skills 根目录下存在同名 skill(`<target>/<name>/SKILL.md`),直接使用该已安装的 skill。
51
+ 2. **ref 兜底**:否则,回退到主 skill 内部自带的 `references/deps/<fallback>.md`。
52
+
53
+ | 引用名 | 兜底文件 |
54
+ | --- | --- |
55
+ | `grilling` | `grilling.md` |
56
+ | `grill-me` | `grilling.md` |
57
+ | `grill-with-docs` | `grilling.md`、`domain-modeling.md` |
58
+ | `domain-modeling` | `domain-modeling.md` |
59
+ | `tdd` | `tdd.md` |
60
+ | `deepwork` | `boundaries.md` |
61
+ | `retro` | `boundaries.md` |
62
+ | `doc-opt` | `doc-opt.md` |
63
+ | `improve-codebase-architecture` | `boundaries.md` |
64
+
65
+ `check` 子命令会对照上表逐个报告「按名可解析(skill 已安装)」或「ref 兜底可用」,只要每个名字能通过任一级解析即视为通过。
66
+
67
+ ## 内置 skill 与来源
68
+
69
+ | skill | 说明 | 来源 |
70
+ | --- | --- | --- |
71
+ | `project-docs-workflow` | 主 skill:issue / ADR / PDR / 术语 / 工作流 | 本包 |
72
+ | `grilling`、`grill-me`、`grill-with-docs` | 需求拷问相关 | `mattpocock/skills` 精简版(MIT,Matt Pocock) |
73
+ | `domain-modeling` | 领域建模 | 同上 |
74
+ | `tdd` | 测试驱动开发 | 同上 |
75
+ | `deepwork`、`retro`、`improve-codebase-architecture` | 精简/占位版本 | 同上 |
76
+ | `doc-opt` | 文档优化(附赠完整版) | 本包附赠 |
77
+
78
+ 部分内置 skill 内容摘自 <https://github.com/mattpocock/skills>(MIT License,Copyright (c) 2026 Matt Pocock),详见 [`NOTICE`](./NOTICE)。
79
+
80
+ ## 版本说明
81
+
82
+ 本包版本 `2.x` 与「模板生成 v2」对齐:模板结构与生成约定以 v2 为准。
83
+
84
+ ## License
85
+
86
+ MIT,见 [`LICENSE`](./LICENSE)。
87
+
88
+ ---
89
+
90
+ ## English summary
91
+
92
+ `project-docs-workflow` is an npm-packaged agent **skill bundle** for project documentation workflows: issue tracking, ADRs, PDRs, a terminology glossary, and the workflow that ties them together. The main skill is self-contained via internal `references/deps/*.md` fallbacks, and ships with lightweight dependency skills (trimmed from [mattpocock/skills](https://github.com/mattpocock/skills), MIT, Matt Pocock) plus a bundled `doc-opt` bonus skill.
93
+
94
+ Install with `npx @tanlinfeng/project-docs-workflow` (defaults to `~/.agents/skills`; options: `--dir <path>`, `--force`, `--dry-run`, and the `check` subcommand). The installer **never overwrites** an existing skill of the same name — it skips it, preserving your version. `--force` overwrites only the main `project-docs-workflow` skill.
95
+
96
+ You can also copy `skills/*` directly into your skills root (skip any existing directory name, never overwrite); copying just `skills/project-docs-workflow` works standalone thanks to the internal ref fallbacks.
97
+
98
+ Resolution is two-level: use an installed skill by name if present, otherwise follow `references/deps/*.md` inside the skill. Version `2.x` aligns with template generation v2. Licensed MIT (see `LICENSE` and `NOTICE`).
package/bin/install.js ADDED
@@ -0,0 +1,227 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const fs = require("fs");
5
+ const os = require("os");
6
+ const path = require("path");
7
+
8
+ const PKG_ROOT = path.join(__dirname, "..");
9
+ const SKILLS_DIR = path.join(PKG_ROOT, "skills");
10
+ const MAIN_SKILL = "project-docs-workflow";
11
+ const DEFAULT_TARGET = path.join(os.homedir(), ".agents", "skills");
12
+
13
+ // 依赖 skill 的按名解析与 ref 兜底映射。
14
+ // 顺序:先按名解析 <target>/<name>/SKILL.md,其次尝试 ref 兜底文件。
15
+ // grill-with-docs 的兜底包含 grilling.md 与 domain-modeling.md 两个文件。
16
+ const REF_FALLBACKS = {
17
+ grilling: ["grilling.md"],
18
+ "grill-me": ["grilling.md"],
19
+ "grill-with-docs": ["grilling.md", "domain-modeling.md"],
20
+ "domain-modeling": ["domain-modeling.md"],
21
+ tdd: ["tdd.md"],
22
+ deepwork: ["boundaries.md"],
23
+ retro: ["boundaries.md"],
24
+ "doc-opt": ["doc-opt.md"],
25
+ "improve-codebase-architecture": ["boundaries.md"],
26
+ };
27
+
28
+ const REF_NAMES = Object.keys(REF_FALLBACKS);
29
+ const DEPS_DIR = path.join(SKILLS_DIR, MAIN_SKILL, "references", "deps");
30
+
31
+ function usage() {
32
+ console.log(
33
+ [
34
+ "project-docs-workflow 安装器",
35
+ "",
36
+ "用法:",
37
+ " project-docs-workflow [install] [选项] 安装 skill 到目标目录(默认动作)",
38
+ " project-docs-workflow check [选项] 检查依赖 skill 的解析状态",
39
+ "",
40
+ "选项:",
41
+ " --dir <path> 指定目标 skills 根目录(默认 ~/.agents/skills)",
42
+ " --force 覆盖已存在的 project-docs-workflow(仅主 skill;依赖仍不覆盖)",
43
+ " --dry-run 仅打印将执行的操作,不实际写入",
44
+ " -h, --help 显示本帮助",
45
+ ].join("\n")
46
+ );
47
+ }
48
+
49
+ function parseArgs(argv) {
50
+ const opts = { command: "install", target: DEFAULT_TARGET, force: false, dryRun: false };
51
+ const positional = [];
52
+ for (let i = 0; i < argv.length; i++) {
53
+ const arg = argv[i];
54
+ if (arg === "install" || arg === "check") {
55
+ opts.command = arg;
56
+ } else if (arg === "--force") {
57
+ opts.force = true;
58
+ } else if (arg === "--dry-run") {
59
+ opts.dryRun = true;
60
+ } else if (arg === "--dir") {
61
+ const value = argv[++i];
62
+ if (!value) {
63
+ fail("--dir 需要一个路径参数");
64
+ }
65
+ opts.target = path.resolve(value);
66
+ } else if (arg.startsWith("--dir=")) {
67
+ opts.target = path.resolve(arg.slice("--dir=".length));
68
+ } else if (arg === "-h" || arg === "--help") {
69
+ usage();
70
+ process.exit(0);
71
+ } else if (arg.startsWith("-")) {
72
+ fail("未知选项:" + arg);
73
+ } else {
74
+ positional.push(arg);
75
+ }
76
+ }
77
+ if (positional.length > 0) {
78
+ fail("未知参数:" + positional.join(" "));
79
+ }
80
+ return opts;
81
+ }
82
+
83
+ function fail(message) {
84
+ console.error("错误:" + message);
85
+ process.exit(1);
86
+ }
87
+
88
+ function isDir(p) {
89
+ try {
90
+ return fs.statSync(p).isDirectory();
91
+ } catch (e) {
92
+ return false;
93
+ }
94
+ }
95
+
96
+ function isFile(p) {
97
+ try {
98
+ return fs.statSync(p).isFile();
99
+ } catch (e) {
100
+ return false;
101
+ }
102
+ }
103
+
104
+ // 列出 skills/ 下的所有子目录名;缺失时返回空数组(由调用方给出提示)。
105
+ function listSkillDirs() {
106
+ if (!isDir(SKILLS_DIR)) {
107
+ return null;
108
+ }
109
+ return fs
110
+ .readdirSync(SKILLS_DIR, { withFileTypes: true })
111
+ .filter((entry) => entry.isDirectory())
112
+ .map((entry) => entry.name)
113
+ .sort();
114
+ }
115
+
116
+ function copySkill(name, dest, dryRun) {
117
+ const src = path.join(SKILLS_DIR, name);
118
+ if (dryRun) {
119
+ console.log(" [dry-run] 将复制 " + name + " → " + dest);
120
+ return;
121
+ }
122
+ fs.cpSync(src, dest, { recursive: true });
123
+ console.log(" ✓ 已安装 " + name + " → " + dest);
124
+ }
125
+
126
+ function runInstall(opts) {
127
+ const dirs = listSkillDirs();
128
+ if (dirs === null || dirs.length === 0) {
129
+ fail(
130
+ "找不到 skills 目录(" +
131
+ SKILLS_DIR +
132
+ ")。请确认已在完整的 npm 包内运行(不要单独复制 bin/)。"
133
+ );
134
+ }
135
+ if (dirs.indexOf(MAIN_SKILL) === -1) {
136
+ fail("缺少主 skill 目录:skills/" + MAIN_SKILL);
137
+ }
138
+
139
+ const target = opts.target;
140
+ console.log("目标目录:" + target + (opts.dryRun ? "(dry-run,不会写入)" : ""));
141
+ if (!opts.dryRun) {
142
+ fs.mkdirSync(target, { recursive: true });
143
+ }
144
+
145
+ // 主 skill:仅在 --force 时覆盖已存在的版本,否则同样保护用户版本。
146
+ const mainDest = path.join(target, MAIN_SKILL);
147
+ const mainExists = isDir(mainDest) || isFile(mainDest);
148
+ console.log("主 skill:" + MAIN_SKILL);
149
+ if (mainExists && !opts.force) {
150
+ console.log(" 同名 skill 已存在,保留用户版本:" + MAIN_SKILL + "(如需覆盖请加 --force)");
151
+ } else if (mainExists && opts.force) {
152
+ if (opts.dryRun) {
153
+ console.log(" [dry-run] 将覆盖 " + MAIN_SKILL + " → " + mainDest);
154
+ } else {
155
+ fs.rmSync(mainDest, { recursive: true, force: true });
156
+ copySkill(MAIN_SKILL, mainDest, false);
157
+ }
158
+ } else {
159
+ copySkill(MAIN_SKILL, mainDest, opts.dryRun);
160
+ }
161
+
162
+ // 其他依赖 skill:永不覆盖。
163
+ console.log("依赖 skill:");
164
+ const others = dirs.filter((name) => name !== MAIN_SKILL);
165
+ if (others.length === 0) {
166
+ console.log(" (未发现其他目录)");
167
+ }
168
+ for (const name of others) {
169
+ const dest = path.join(target, name);
170
+ if (isDir(dest) || isFile(dest)) {
171
+ console.log(" 同名 skill 已存在,保留用户版本:" + name);
172
+ continue;
173
+ }
174
+ copySkill(name, dest, opts.dryRun);
175
+ }
176
+
177
+ if (opts.dryRun) {
178
+ console.log("dry-run 完成,未写入任何文件。");
179
+ } else {
180
+ console.log("安装完成。");
181
+ }
182
+ }
183
+
184
+ function runCheck(opts) {
185
+ const target = opts.target;
186
+ console.log("检查依赖 skill 解析状态(目标目录:" + target + "):");
187
+
188
+ let ok = true;
189
+ for (const name of REF_NAMES) {
190
+ const installed = isFile(path.join(target, name, "SKILL.md"));
191
+ if (installed) {
192
+ console.log(" " + name + ":按名可解析(skill 已安装)");
193
+ continue;
194
+ }
195
+ const fallbacks = REF_FALLBACKS[name] || [];
196
+ const hit = fallbacks.find((file) => isFile(path.join(DEPS_DIR, file)));
197
+ if (hit) {
198
+ console.log(" " + name + ":ref 兜底可用(references/deps/" + hit + ")");
199
+ continue;
200
+ }
201
+ ok = false;
202
+ console.log(
203
+ " " + name + ":无法解析(未安装,且缺少 ref 兜底:" +
204
+ fallbacks.map((f) => "references/deps/" + f).join("、") +
205
+ ")"
206
+ );
207
+ }
208
+
209
+ if (ok) {
210
+ console.log("全部依赖 skill 均已解析。");
211
+ process.exit(0);
212
+ } else {
213
+ console.log("存在无法解析的依赖 skill。");
214
+ process.exit(1);
215
+ }
216
+ }
217
+
218
+ function main() {
219
+ const opts = parseArgs(process.argv.slice(2));
220
+ if (opts.command === "check") {
221
+ runCheck(opts);
222
+ } else {
223
+ runInstall(opts);
224
+ }
225
+ }
226
+
227
+ main();
package/package.json CHANGED
@@ -1,6 +1,22 @@
1
1
  {
2
2
  "name": "@tanlinfeng/project-docs-workflow",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.0.0",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "项目文档工作流 skill 包:提供 issue tracker / ADR / PDR / 术语表与工作流约定,自带轻量依赖 skill 与 ref 兜底,可独立分发。",
8
+ "license": "MIT",
9
+ "bin": {
10
+ "project-docs-workflow": "bin/install.js"
11
+ },
12
+ "files": [
13
+ "bin",
14
+ "skills",
15
+ "LICENSE",
16
+ "NOTICE",
17
+ "README.md"
18
+ ],
19
+ "engines": {
20
+ "node": ">=18"
21
+ }
22
+ }
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: deepwork
3
+ description: 高成本、多阶段、高风险深度工作会议的边界占位;与五步流程互斥,需要完整工作流时请另行安装。
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Deepwork(边界占位)
8
+
9
+ 本 skill 只界定边界,不含完整流程;需要完整的 deepwork 工作流时请单独安装。
10
+
11
+ - **适用**:成本高、风险大、需跨多个阶段推进的整块工作。
12
+ - **互斥**:与 `project-docs-workflow` 的五步流程(规划 / 骨架 / 细节 / 异常 / 回顾)互斥——同一个 effort 只能选一个,绝不叠加。
13
+ - **无完整 deepwork 时**:退回一个最小的分阶段计划,每个阶段设评审闸门:计划 → 实现 → 评审,逐阶段推进。
14
+
15
+ 术语或 ADR 需求交给 `domain-modeling`。
@@ -0,0 +1,77 @@
1
+ # Doc Opt — Examples
2
+
3
+ Behavioral anchors for the rules in `SKILL.md`. Each pair shows one rule applied.
4
+
5
+ ## Style — 中文
6
+
7
+ **Before**
8
+
9
+ > 其实呢,这个模块的性能问题,说白了主要就是每次请求都重新创建连接。值得注意的是,换成连接池之后,其实功能不会有太大影响,但是速度会快很多。
10
+
11
+ **After**
12
+
13
+ > 性能瓶颈来自每次请求重建连接。改用连接池,功能不变,延迟显著下降。
14
+
15
+ Removed: 其实呢 / 说白了 / 主要就是 / 值得注意的是 / 其实 / "不会有太大影响"(模糊)→ 功能不变 / "会快很多"(模糊)→ 延迟显著下降。
16
+
17
+ ## Style — English
18
+
19
+ **Before**
20
+
21
+ > Basically, it's worth noting that the retry logic just retries forever, which is, of course, a problem. Simply add a cap and you're good to go.
22
+
23
+ **After**
24
+
25
+ > The retry logic loops forever. Cap the retry count.
26
+
27
+ Removed: Basically / it's worth noting / just / of course / Simply / you're good to go.
28
+
29
+ ## Diagram — ASCII to mermaid
30
+
31
+ **Before**
32
+
33
+ ```text
34
+ +--------+ +---------+ +---------+
35
+ | Client | --> | Gateway | --> | Service |
36
+ +--------+ +---------+ +---------+
37
+ ```
38
+
39
+ **After**
40
+
41
+ ```mermaid
42
+ flowchart LR
43
+ client[Client] --> gateway[Gateway] --> service[Service]
44
+ ```
45
+
46
+ The mapping is lossless: same nodes, same order, same direction. When an annotation has no mermaid equivalent, ask before converting.
47
+
48
+ ## Citations — rejected and accepted forms
49
+
50
+ **Rejected (bare numbers)**
51
+
52
+ > Batched requests cut per-call overhead in half [2]. The gateway supports HTTP/2 [1].
53
+
54
+ **Accepted (jumpable)**
55
+
56
+ > Batched requests cut per-call overhead in half ([MCP spec — Batching](https://modelcontextprotocol.io/specification/2025-06-18#batching)). The gateway supports HTTP/2 ([RFC 9113](https://www.rfc-editor.org/rfc/rfc9113)).
57
+
58
+ **Accepted (self-contained, no stable target)**
59
+
60
+ > Per the MCP specification, batching cuts per-call overhead.
61
+
62
+ **Unknown source — move to the end**
63
+
64
+ ```markdown
65
+ ## 待补充来源
66
+
67
+ - 吞吐提升数据(原文 [3]):来源不明,待补。
68
+ ```
69
+
70
+ ## mermaid vs SVG
71
+
72
+ | Situation | Use |
73
+ | --- | --- |
74
+ | Flow, sequence, state, class, ER, gantt, pie | mermaid |
75
+ | Annotated architecture, custom positioning, layout mermaid misrepresents | svg |
76
+ | Diagram too large or reused across documents | sibling `.svg` file, linked |
77
+ | ASCII art or image explicitly requested by the user | keep as asked |
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: doc-opt
3
+ description: "Tersely professionalize documents: strip filler, use mermaid/SVG diagrams, make citations jumpable."
4
+ disable-model-invocation: true
5
+ argument-hint: "Files or paths to optimize"
6
+ ---
7
+
8
+ # Doc Opt
9
+
10
+ Optimize named markdown documents in place. Default targets: `.md` / `.mdx`. Other formats only when named.
11
+
12
+ ## Contract
13
+
14
+ - Touch the named files; never sweep the repo.
15
+ - Compression removes redundancy, never facts.
16
+ - Code fences, frontmatter, commands, and quoted output stay byte-identical.
17
+ - Structural moves (delete a section, reorder, merge diagrams) get a plan first, edits second.
18
+ - End with a change report: files, change categories, `待补充来源`, self-check evidence.
19
+
20
+ ## Style (L2 by default)
21
+
22
+ L1 strips filler only; L3 goes telegraphic. Move up or down only when the user names the level.
23
+
24
+ - Delete words that carry no information: filler, hedging, throat-clearing.
25
+ - Short declarative sentences. Active voice. Verbs over nominalizations.
26
+ - Lists and tables when the content enumerates.
27
+ - Keep technical terms exact; keep headings unless the heading is the problem.
28
+
29
+ Filler to cut on sight:
30
+
31
+ | ZH | EN |
32
+ | --- | --- |
33
+ | 其实、值得注意的是、让我们来看看、不得不说、说白了、众所周知 | basically, actually, of course, it's worth noting, let's dive in |
34
+
35
+ `just` and `其实` get judged per sentence: they stay only when literal ("only") or when they mark a real contrast.
36
+
37
+ ## Diagrams
38
+
39
+ Default: mermaid. Match the type to the relation: flowchart, sequence, state, class, ER, gantt, pie.
40
+
41
+ SVG covers what mermaid cannot express or where layout needs control — annotated architecture, custom positioning. Inline SVG for small diagrams; a sibling `.svg` file plus a link for large or reused ones.
42
+
43
+ ASCII art and image diagrams appear only when the user explicitly asks. Existing ASCII diagrams convert to mermaid/SVG when the mapping is lossless; ambiguous semantics get a question first. Screenshots stay: add a caption and a jumpable citation.
44
+
45
+ ## Citations
46
+
47
+ A bare number (`[1]`) is not a citation. Every reference is jumpable or self-contained:
48
+
49
+ | Target | Form |
50
+ | --- | --- |
51
+ | Section of the same document | `[label](#anchor)` |
52
+ | File elsewhere in the repo | `[label](relative/path.md#anchor)` |
53
+ | External source | `[label](https://full-url)` |
54
+
55
+ Without a stable target, carry the source inside the sentence ("per the MCP spec, ..."). A source that cannot be identified goes into a `待补充来源` list at the document end and into the change report.
56
+
57
+ ## Workflow
58
+
59
+ 1. Read the targets whole. Mark frontmatter and code that must not move.
60
+ 2. Plan structural changes; wait for confirmation.
61
+ 3. Rewrite: style, then diagrams, then citations.
62
+ 4. Run the self-check.
63
+ 5. Report files, change categories, `待补充来源`, self-check evidence.
64
+
65
+ ## Self-check
66
+
67
+ Run before reporting; put evidence in the report. Substitute the target paths for `<files>`; ignore hits inside code fences.
68
+
69
+ ```bash
70
+ # filler survivors — expect no hits
71
+ rg -n "其实|值得注意的是|让我们来看看|说白了|basically|actually|of course|worth noting" <files>
72
+
73
+ # bare numeric citations — expect no hits
74
+ rg -n '\[\d+\]' <files>
75
+
76
+ # ASCII diagrams — expect no hits unless the user asked for them
77
+ rg -n '[┌┐└┘├┤│─]|\+--' <files>
78
+
79
+ # mermaid fences — count them; each needs a declaration line and a closing fence
80
+ rg -n '^```mermaid' <files>
81
+ ```
82
+
83
+ `EXAMPLES.md` holds before/after pairs: style (ZH/EN), ASCII→mermaid, citation forms, mermaid vs SVG selection.
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "Doc Opt"
3
+ short_description: "Terse professional docs with real diagrams"
4
+ policy:
5
+ allow_implicit_invocation: false