neo-skill 0.1.11

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 (45) hide show
  1. package/.shared/skill-creator/data/domains.json +56 -0
  2. package/.shared/skill-creator/data/output-patterns.csv +8 -0
  3. package/.shared/skill-creator/data/resource-patterns.csv +8 -0
  4. package/.shared/skill-creator/data/skill-reasoning.csv +11 -0
  5. package/.shared/skill-creator/data/trigger-patterns.csv +8 -0
  6. package/.shared/skill-creator/data/validation-rules.csv +11 -0
  7. package/.shared/skill-creator/data/workflow-patterns.csv +6 -0
  8. package/.shared/skill-creator/scripts/generate.py +300 -0
  9. package/.shared/skill-creator/scripts/package.py +140 -0
  10. package/.shared/skill-creator/scripts/search.py +231 -0
  11. package/.shared/skill-creator/scripts/validate.py +213 -0
  12. package/LICENSE +21 -0
  13. package/README.md +117 -0
  14. package/bin/omni-skill.js +55 -0
  15. package/bin/skill-creator.js +55 -0
  16. package/package.json +25 -0
  17. package/skills/review-gate/references/review-gate.md +228 -0
  18. package/skills/review-gate/skillspec.json +131 -0
  19. package/skills/skill-creator/references/output-patterns.md +82 -0
  20. package/skills/skill-creator/references/pre-delivery-checklist.md +70 -0
  21. package/skills/skill-creator/references/requirement-collection.md +80 -0
  22. package/skills/skill-creator/references/skill-system-design.md +112 -0
  23. package/skills/skill-creator/references/sources.md +5 -0
  24. package/skills/skill-creator/references/workflow-step-editing.md +103 -0
  25. package/skills/skill-creator/references/workflows.md +28 -0
  26. package/skills/skill-creator/scripts/init_skill.py +34 -0
  27. package/skills/skill-creator/scripts/package_skill.py +34 -0
  28. package/skills/skill-creator/scripts/validate_skill.py +35 -0
  29. package/skills/skill-creator/skillspec.json +117 -0
  30. package/src/omni_skill/__init__.py +1 -0
  31. package/src/omni_skill/cli.py +270 -0
  32. package/src/skill_creator/__init__.py +1 -0
  33. package/src/skill_creator/cli.py +278 -0
  34. package/src/skill_creator/packaging/package.py +30 -0
  35. package/src/skill_creator/packaging/ziputil.py +26 -0
  36. package/src/skill_creator/spec/model.py +111 -0
  37. package/src/skill_creator/spec/render.py +108 -0
  38. package/src/skill_creator/spec/validate.py +18 -0
  39. package/src/skill_creator/targets/claude.py +53 -0
  40. package/src/skill_creator/targets/common.py +46 -0
  41. package/src/skill_creator/targets/cursor.py +34 -0
  42. package/src/skill_creator/targets/github_skills.py +40 -0
  43. package/src/skill_creator/targets/windsurf.py +123 -0
  44. package/src/skill_creator/util/frontmatter.py +24 -0
  45. package/src/skill_creator/util/fs.py +32 -0
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require("child_process");
4
+ const path = require("path");
5
+
6
+ function main() {
7
+ const pkgRoot = path.resolve(__dirname, "..");
8
+ const pySrc = path.join(pkgRoot, "src");
9
+
10
+ const env = { ...process.env };
11
+ env.PYTHONPATH = env.PYTHONPATH ? `${pySrc}${path.delimiter}${env.PYTHONPATH}` : pySrc;
12
+
13
+ const baseArgs = ["-m", "skill_creator.cli", ...process.argv.slice(2)];
14
+
15
+ const candidates = [];
16
+ if (env.OMNI_SKILL_PYTHON) {
17
+ candidates.push({ cmd: env.OMNI_SKILL_PYTHON, extraArgs: [] });
18
+ }
19
+ if (process.platform === "win32") {
20
+ candidates.push({ cmd: "python", extraArgs: [] });
21
+ candidates.push({ cmd: "python3", extraArgs: [] });
22
+ candidates.push({ cmd: "py", extraArgs: ["-3"] });
23
+ } else {
24
+ candidates.push({ cmd: "python3", extraArgs: [] });
25
+ candidates.push({ cmd: "python", extraArgs: [] });
26
+ }
27
+
28
+ let lastError = null;
29
+ for (const c of candidates) {
30
+ const r = spawnSync(c.cmd, [...c.extraArgs, ...baseArgs], { stdio: "inherit", env });
31
+ if (r.error) {
32
+ lastError = r.error;
33
+ const msg = String(r.error.message || "").toLowerCase();
34
+ if (msg.includes("enoent")) {
35
+ continue;
36
+ }
37
+ console.error(r.error);
38
+ process.exit(1);
39
+ }
40
+ if (typeof r.status === "number" && r.status === 9009) {
41
+ continue;
42
+ }
43
+ process.exit(r.status == null ? 1 : r.status);
44
+ }
45
+
46
+ console.error(
47
+ "Python not found. Please install Python 3 and ensure 'python' works, or set OMNI_SKILL_PYTHON to your interpreter path.",
48
+ );
49
+ if (lastError) {
50
+ console.error(lastError);
51
+ }
52
+ process.exit(127);
53
+ }
54
+
55
+ main();
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "neo-skill",
3
+ "version": "0.1.11",
4
+ "description": "A multi-assistant skill generator (Claude/Windsurf/Cursor/GitHub Skills) driven by a canonical SkillSpec.",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "omni-skill": "bin/omni-skill.js",
8
+ "skill-creator": "bin/skill-creator.js"
9
+ },
10
+ "files": [
11
+ "bin/**",
12
+ "src/**",
13
+ "skills/**",
14
+ ".shared/**",
15
+ ".claude/**",
16
+ ".windsurf/**",
17
+ ".cursor/**",
18
+ ".github/skills/**",
19
+ "README.md"
20
+ ],
21
+ "scripts": {},
22
+ "engines": {
23
+ "node": ">=16"
24
+ }
25
+ }
@@ -0,0 +1,228 @@
1
+ # Review Gate 架构与工程规范
2
+
3
+ ## 目标
4
+ - 建立架构/工程化规范,明确哪些可以自动化(转为 Hard Gate),哪些需要人工 Review
5
+ - 在 PR review 中显式检查架构与设计决策
6
+ - 防止架构在长期演进中"慢慢写歪"
7
+
8
+ ## Non-negotiable
9
+ - Review Gate 不能替代 Hard Gate:能自动化的规则必须先自动化
10
+ - Review 检查点必须具体、可执行,避免模糊的"代码质量"描述
11
+ - 对于重复出现的 Review 问题,应考虑将其转化为 Hard Gate 规则
12
+
13
+ ## 架构/工程化规范(Review Gate 为主)
14
+
15
+ ### 目录组织范式
16
+ - 采用 `type-first` 分层模型
17
+ - 默认层级:
18
+ - `presentation/`:UI 组件、页面、交互逻辑
19
+ - `application/`:用例、编排、应用服务
20
+ - `domain/`:业务逻辑、领域模型、业务规则
21
+ - `infra/`:基础设施、外部依赖适配器
22
+ - `shared/`:跨层共享工具、常量
23
+ - `types/`:公共类型定义
24
+ - `tests/`:测试相关
25
+
26
+ **Review 检查点**:
27
+ - 新增目录是否符合现有分层模型?
28
+ - 是否存在职责不清的"杂项"目录?
29
+
30
+ ### 层内职责边界
31
+ 两条原则同时成立:
32
+ 1. **目录即职责**:一个目录应该只有一个清晰的职责
33
+ 2. **依赖反推职责**:通过依赖关系可以反推出职责边界,禁止"为了复用"而跨职责/跨层耦合
34
+
35
+ **Review 检查点**:
36
+ - 新增的模块/文件是否放在了正确的层级?
37
+ - 是否存在为了复用而跨层导入的情况(应该向下抽取到 shared/domain)?
38
+ - domain/application 是否回依赖了 infra/presentation?
39
+
40
+ ### 命名与一致性
41
+ 基本约定:
42
+ - React components:`PascalCase.tsx`
43
+ - hooks:`useXxx.ts`
44
+ - utils/functions:`camelCase.ts` 或 `kebab-case.ts`(保持仓库一致)
45
+ - 常量:`UPPER_SNAKE_CASE` 或 `camelCase`(保持仓库一致)
46
+ - 类型/接口:`PascalCase`
47
+
48
+ 文件名与导出符号一致性:
49
+ - 不强制,但建议文件名与主要导出符号一致
50
+ - 在 Review 中统一建议,避免命名混乱
51
+
52
+ **Review 检查点**:
53
+ - 新增文件的命名是否符合仓库约定?
54
+ - 文件名与导出符号是否一致(或有合理理由不一致)?
55
+ - 是否存在缩写/拼写不一致的情况?
56
+
57
+ ### 模块 API 设计
58
+ 原则:
59
+ - 公共 API 以包级 entrypoints(`package.json#exports`)为准
60
+ - 允许在包根 `index.ts` 聚合导出
61
+ - **禁止**在深层目录层层 `index.ts` 造成循环依赖与耦合扩散
62
+ - 默认倾向 **named exports**;default export 仅在框架强约束处使用(如 Next.js 页面组件)
63
+
64
+ **Review 检查点**:
65
+ - 新增的 public API 是否通过 `exports` 字段暴露?
66
+ - 是否在深层目录新增了 `index.ts`(可能导致循环依赖)?
67
+ - 是否滥用 default export(应该用 named export)?
68
+ - 导出的 API 是否有清晰的边界和文档?
69
+
70
+ ### 副作用隔离(可测试性)
71
+ 核心原则:
72
+ - **domain/application 尽量保持纯**:不直接依赖 network/fs/db/time/random
73
+ - I/O 操作集中在 **infra/adapter**,通过抽象或依赖注入传入
74
+ - 副作用边界清晰,便于测试和替换实现
75
+
76
+ **Review 检查点**:
77
+ - domain/application 层是否直接调用了 `fetch`/`axios`/`fs`/`Date.now()`/`Math.random()` 等副作用?
78
+ - 是否通过接口/依赖注入的方式隔离了副作用?
79
+ - 关键业务逻辑是否可以在不依赖外部资源的情况下测试?
80
+
81
+ ### 依赖方向与抽象层次
82
+ 依赖方向(从上到下):
83
+ ```
84
+ presentation -> application -> domain <- infra
85
+ ^
86
+ |
87
+ shared/types
88
+ ```
89
+
90
+ 原则:
91
+ - **依赖向下/向内**:presentation 可以依赖 application,application 可以依赖 domain,但反向不行
92
+ - **infra 依赖 domain 的抽象**:infra 实现 domain 定义的接口/抽象
93
+ - **禁止跨层耦合**:不允许为了"方便"而打破依赖方向
94
+
95
+ **Review 检查点**:
96
+ - 新增依赖是否符合依赖方向?
97
+ - 是否存在跨层的强耦合(应该抽象接口)?
98
+ - 是否存在循环依赖的风险?
99
+
100
+ ### 复杂度与可读性
101
+ 虽然有 Hard Gate 限制(单函数 60 行、圈复杂度 15),但 Review 还需关注:
102
+ - **认知复杂度**:代码是否易于理解?
103
+ - **嵌套层级**:是否过度嵌套(建议早返回)?
104
+ - **函数职责**:是否一个函数做了太多事情?
105
+ - **抽象层次一致性**:同一个函数内是否混合了高层业务逻辑和底层实现细节?
106
+
107
+ **Review 检查点**:
108
+ - 复杂的业务逻辑是否拆分成了多个小函数?
109
+ - 是否存在"上帝函数"(做了太多事情)?
110
+ - 变量/函数命名是否清晰表达了意图?
111
+
112
+ ### 错误处理策略
113
+ Hard Gate 已限制:
114
+ - 统一错误类型(如 `AppError`/`DomainError`)
115
+ - 禁止在非边界层随意 `throw new Error`
116
+
117
+ Review 需额外关注:
118
+ - **错误边界**:错误是否在合适的边界被捕获和处理?
119
+ - **错误信息质量**:错误信息是否足够帮助定位问题?
120
+ - **优雅降级**:关键路径是否有合理的错误处理和降级策略?
121
+ - **错误传播**:错误是否以合理的方式向上传播(而不是被吞掉)?
122
+
123
+ **Review 检查点**:
124
+ - 新增的错误处理是否遵循了统一的错误类型?
125
+ - 是否存在空 catch 块(吞掉错误)?
126
+ - 错误信息是否包含足够的上下文?
127
+
128
+ ### 日志与可观测性
129
+ Hard Gate 已限制:
130
+ - 禁止在非边界层直接 `console.*`(仅允许 entry/infra)
131
+
132
+ Review 需额外关注:
133
+ - **日志级别**:是否使用了合适的日志级别(debug/info/warn/error)?
134
+ - **关键路径日志**:关键业务流程是否有足够的日志便于追踪?
135
+ - **敏感信息**:日志中是否包含了敏感信息(token/密码/个人信息)?
136
+ - **结构化日志**:是否使用结构化日志便于查询和分析?
137
+
138
+ **Review 检查点**:
139
+ - 新增日志是否在合适的层级(entry/infra)?
140
+ - 日志是否包含足够的上下文信息?
141
+ - 是否泄露了敏感信息?
142
+
143
+ ### 注释与文档
144
+ Hard Gate 已限制:
145
+ - 禁止"解释代码做什么"的注释
146
+ - public API 需要 TSDoc/JSDoc
147
+
148
+ Review 需额外关注:
149
+ - **关键算法/复杂业务**:是否有块注释或链接到设计文档/issue?
150
+ - **非显而易见的决策**:是否解释了"为什么这样做"而不是"做了什么"?
151
+ - **坑/约束/假设**:是否记录了重要的假设、约束或已知问题?
152
+ - **API 文档完整性**:public API 的文档是否包含了参数说明、返回值、示例、错误情况?
153
+
154
+ **Review 检查点**:
155
+ - 复杂业务逻辑是否有注释说明"为什么"?
156
+ - public API 的文档是否完整?
157
+ - 是否存在需要删除的过时注释?
158
+
159
+ ### 测试策略
160
+ 虽然 Hard Gate 会跑测试,但 Review 需关注:
161
+ - **测试覆盖率**:关键业务逻辑是否有单元测试?
162
+ - **测试质量**:测试是否真正验证了业务逻辑,还是只是为了覆盖率?
163
+ - **测试可维护性**:测试是否易于理解和维护?
164
+ - **集成测试边界**:集成测试是否覆盖了关键路径?
165
+
166
+ **Review 检查点**:
167
+ - 新增的业务逻辑是否有对应的测试?
168
+ - 测试是否覆盖了边界情况和错误路径?
169
+ - 测试是否依赖了不必要的外部资源(应该 mock)?
170
+
171
+ ### 性能考虑
172
+ Review 需关注明显的性能问题:
173
+ - **明显的性能反模式**:循环中的重复计算、不必要的深拷贝、大数据结构的同步遍历
174
+ - **资源泄漏**:未清理的定时器、未关闭的连接、未取消的订阅
175
+ - **不必要的重渲染**:React 组件是否有不必要的重渲染(缺少 memo/useMemo/useCallback)
176
+ - **阻塞操作**:是否在主线程执行了耗时的同步操作
177
+
178
+ **Review 检查点**:
179
+ - 是否存在明显的性能问题?
180
+ - 是否有资源泄漏的风险?
181
+ - 大数据处理是否考虑了性能优化?
182
+
183
+ ### 安全考虑
184
+ 虽然 Hard Gate 已覆盖部分安全检查,Review 需额外关注:
185
+ - **XSS 风险**:用户输入是否被正确转义?是否使用了 `dangerouslySetInnerHTML`?
186
+ - **SQL/NoSQL 注入**:数据库查询是否使用了参数化查询?
187
+ - **权限检查**:关键操作是否有权限校验?
188
+ - **数据验证**:外部输入是否经过验证?
189
+
190
+ **Review 检查点**:
191
+ - 用户输入是否经过验证和转义?
192
+ - 是否存在明显的安全风险?
193
+ - 敏感操作是否有权限校验?
194
+
195
+ ## Review Checklist 模板
196
+
197
+ ### 架构层面
198
+ - [ ] 新增代码是否放在了正确的分层?
199
+ - [ ] 是否遵循了依赖方向(向下/向内)?
200
+ - [ ] 是否存在跨层耦合或循环依赖?
201
+ - [ ] 职责划分是否清晰?
202
+
203
+ ### 设计层面
204
+ - [ ] 模块 API 设计是否合理(边界清晰、易用)?
205
+ - [ ] 是否有合理的抽象(不过度设计,也不欠设计)?
206
+ - [ ] 副作用是否被正确隔离?
207
+ - [ ] 关键业务逻辑是否可测试?
208
+
209
+ ### 代码质量
210
+ - [ ] 命名是否清晰表达意图?
211
+ - [ ] 复杂度是否合理(认知复杂度、嵌套层级)?
212
+ - [ ] 错误处理是否完善?
213
+ - [ ] 日志是否合理(层级、内容、敏感信息)?
214
+
215
+ ### 文档与可维护性
216
+ - [ ] 复杂业务逻辑是否有注释说明"为什么"?
217
+ - [ ] public API 是否有完整文档?
218
+ - [ ] 是否有足够的测试覆盖关键路径?
219
+
220
+ ### 性能与安全
221
+ - [ ] 是否存在明显的性能问题或资源泄漏?
222
+ - [ ] 用户输入是否经过验证?
223
+ - [ ] 是否存在明显的安全风险?
224
+
225
+ ## 与 Hard Gate 的协同
226
+ - **优先自动化**:如果某个 Review 检查点可以自动化,应该转化为 Hard Gate 规则
227
+ - **持续演进**:定期回顾 Review 中重复出现的问题,考虑将其自动化
228
+ - **互为补充**:Hard Gate 保证基线,Review Gate 关注设计和架构决策
@@ -0,0 +1,131 @@
1
+ {
2
+ "version": 1,
3
+ "name": "review-gate",
4
+ "description": "为 TypeScript/JavaScript(React/Vue/Node)项目建立架构与工程化 Review 规范:明确分层职责边界、模块 API 设计、副作用隔离、复杂度与可读性、错误处理策略等,提供可执行的 PR Review Checklist,防止架构在长期演进中"慢慢写歪"。",
5
+ "assistants": ["claude", "windsurf", "cursor", "github-skills"],
6
+ "questions": [
7
+ "你的仓库采用什么分层模型(type-first / feature-first / 其他),现有层级命名是什么?",
8
+ "是否已有明确的架构/工程规范文档,或仅依靠口头约定?",
9
+ "PR Review 流程是什么(必须至少 1 人 approve / 需要架构师 review / 其他)?",
10
+ "哪些架构检查点是团队反复强调但容易被忽略的(跨层依赖/副作用隔离/命名一致性/其他)?",
11
+ "是否需要生成 PR Review Checklist 模板,以及是否要集成到 PR 模板中?",
12
+ "团队是否有特定的代码风格偏好(例如:early return / 禁止 default export / 统一错误类型)?"
13
+ ],
14
+ "triggers": [
15
+ "我想建立 PR Review 架构规范检查点",
16
+ "帮我生成 PR Review Checklist 模板",
17
+ "如何在 Review 中检查分层职责边界",
18
+ "如何防止架构在演进中写歪",
19
+ "设置工程化规范和代码审查标准",
20
+ "软评审代码"
21
+ ],
22
+ "freedom_level": "medium",
23
+ "workflow": {
24
+ "type": "sequential",
25
+ "steps": [
26
+ {
27
+ "id": "understand",
28
+ "title": "理解现有架构与分层模型",
29
+ "kind": "action",
30
+ "commands": [],
31
+ "notes": "识别仓库的分层模型(type-first / feature-first / 其他),梳理现有层级命名(presentation/application/domain/infra/shared/types/tests 或其他)。输出当前架构概览。"
32
+ },
33
+ {
34
+ "id": "review-points",
35
+ "title": "识别关键 Review 检查点(基于团队痛点)",
36
+ "kind": "action",
37
+ "commands": [],
38
+ "notes": "基于团队反馈和常见问题,识别最重要的 Review 检查点。参考 `references/review-gate.md` 中的完整检查点清单,优先级排序。"
39
+ },
40
+ {
41
+ "id": "checklist",
42
+ "title": "生成 PR Review Checklist 模板",
43
+ "kind": "action",
44
+ "commands": [],
45
+ "notes": "基于识别的检查点,生成具体的、可执行的 PR Review Checklist。包括架构层面、设计层面、代码质量、文档与可维护性、性能与安全等维度。模板见 `references/review-gate.md`。"
46
+ },
47
+ {
48
+ "id": "layer-boundary",
49
+ "title": "审查分层边界与依赖方向",
50
+ "kind": "action",
51
+ "commands": [],
52
+ "notes": "检查当前 PR 的变更是否符合分层模型,是否存在跨层耦合或违反依赖方向的情况。重点关注 domain/application 是否回依赖了 infra/presentation。详见 `references/review-gate.md`。"
53
+ },
54
+ {
55
+ "id": "api-design",
56
+ "title": "审查模块 API 设计与边界",
57
+ "kind": "action",
58
+ "commands": [],
59
+ "notes": "检查新增或修改的 public API 是否设计合理:是否通过 exports 暴露、是否有清晰边界、是否滥用 default export、是否在深层目录新增 index.ts 导致循环依赖风险。详见 `references/review-gate.md`。"
60
+ },
61
+ {
62
+ "id": "side-effects",
63
+ "title": "审查副作用隔离与可测试性",
64
+ "kind": "action",
65
+ "commands": [],
66
+ "notes": "检查 domain/application 层是否保持纯净(不直接依赖 network/fs/db/time/random),I/O 操作是否集中在 infra/adapter 并通过抽象注入。详见 `references/review-gate.md`。"
67
+ },
68
+ {
69
+ "id": "complexity-readability",
70
+ "title": "审查复杂度与可读性",
71
+ "kind": "action",
72
+ "commands": [],
73
+ "notes": "除了 Hard Gate 限制的指标(单函数 60 行、圈复杂度 15),还需关注认知复杂度、嵌套层级、函数职责、抽象层次一致性。详见 `references/review-gate.md`。"
74
+ },
75
+ {
76
+ "id": "error-handling",
77
+ "title": "审查错误处理策略",
78
+ "kind": "action",
79
+ "commands": [],
80
+ "notes": "检查错误处理是否遵循统一的错误类型、错误边界是否合理、错误信息是否足够、是否存在空 catch 块(吞掉错误)。详见 `references/review-gate.md`。"
81
+ },
82
+ {
83
+ "id": "logging",
84
+ "title": "审查日志与可观测性",
85
+ "kind": "action",
86
+ "commands": [],
87
+ "notes": "检查日志是否在合适的层级(entry/infra)、日志级别是否合适、是否包含足够上下文、是否泄露敏感信息。详见 `references/review-gate.md`。"
88
+ },
89
+ {
90
+ "id": "documentation",
91
+ "title": "审查注释与文档质量",
92
+ "kind": "action",
93
+ "commands": [],
94
+ "notes": "检查复杂业务逻辑是否有注释说明"为什么"、public API 文档是否完整、是否存在需要删除的过时注释。详见 `references/review-gate.md`。"
95
+ },
96
+ {
97
+ "id": "tests",
98
+ "title": "审查测试策略与覆盖",
99
+ "kind": "action",
100
+ "commands": [],
101
+ "notes": "检查关键业务逻辑是否有对应测试、测试是否覆盖边界情况和错误路径、测试是否依赖了不必要的外部资源。详见 `references/review-gate.md`。"
102
+ },
103
+ {
104
+ "id": "performance-security",
105
+ "title": "审查性能与安全考虑",
106
+ "kind": "action",
107
+ "commands": [],
108
+ "notes": "检查是否存在明显的性能问题(循环中重复计算、资源泄漏、不必要的重渲染)和安全风险(XSS、注入、权限检查、数据验证)。详见 `references/review-gate.md`。"
109
+ },
110
+ {
111
+ "id": "output",
112
+ "title": "输出 Review 结果与改进建议",
113
+ "kind": "action",
114
+ "commands": [],
115
+ "notes": "汇总 Review 结果,明确列出:符合规范的部分、需要改进的部分(按优先级)、可以转化为 Hard Gate 的重复问题。提供具体的改进建议和参考文档链接。"
116
+ },
117
+ {
118
+ "id": "integrate",
119
+ "title": "(可选)集成到 PR 模板",
120
+ "kind": "action",
121
+ "commands": [],
122
+ "notes": "如果团队需要,可以将生成的 Review Checklist 集成到 `.github/pull_request_template.md` 或其他 PR 模板中,确保每次 PR 都经过规范检查。"
123
+ }
124
+ ]
125
+ },
126
+ "references": [
127
+ "references/review-gate.md"
128
+ ],
129
+ "scripts": [],
130
+ "assets": []
131
+ }
@@ -0,0 +1,82 @@
1
+ # Output Patterns
2
+
3
+ Use these patterns when skills need to produce consistent, high-quality output.
4
+
5
+ ## Template Pattern
6
+
7
+ Provide templates for output format. Match the level of strictness to your needs.
8
+
9
+ **For strict requirements (like API responses or data formats):**
10
+
11
+ ```markdown
12
+ ## Report structure
13
+
14
+ ALWAYS use this exact template structure:
15
+
16
+ # [Analysis Title]
17
+
18
+ ## Executive summary
19
+ [One-paragraph overview of key findings]
20
+
21
+ ## Key findings
22
+ - Finding 1 with supporting data
23
+ - Finding 2 with supporting data
24
+ - Finding 3 with supporting data
25
+
26
+ ## Recommendations
27
+ 1. Specific actionable recommendation
28
+ 2. Specific actionable recommendation
29
+ ```
30
+
31
+ **For flexible guidance (when adaptation is useful):**
32
+
33
+ ```markdown
34
+ ## Report structure
35
+
36
+ Here is a sensible default format, but use your best judgment:
37
+
38
+ # [Analysis Title]
39
+
40
+ ## Executive summary
41
+ [Overview]
42
+
43
+ ## Key findings
44
+ [Adapt sections based on what you discover]
45
+
46
+ ## Recommendations
47
+ [Tailor to the specific context]
48
+
49
+ Adjust sections as needed for the specific analysis type.
50
+ ```
51
+
52
+ ## Examples Pattern
53
+
54
+ For skills where output quality depends on seeing examples, provide input/output pairs:
55
+
56
+ ```markdown
57
+ ## Commit message format
58
+
59
+ Generate commit messages following these examples:
60
+
61
+ **Example 1:**
62
+ Input: Added user authentication with JWT tokens
63
+ Output:
64
+ ```
65
+ feat(auth): implement JWT-based authentication
66
+
67
+ Add login endpoint and token validation middleware
68
+ ```
69
+
70
+ **Example 2:**
71
+ Input: Fixed bug where dates displayed incorrectly in reports
72
+ Output:
73
+ ```
74
+ fix(reports): correct date formatting in timezone conversion
75
+
76
+ Use UTC timestamps consistently across report generation
77
+ ```
78
+
79
+ Follow this style: type(scope): brief description, then detailed explanation.
80
+ ```
81
+
82
+ Examples help Claude understand the desired style and level of detail more clearly than descriptions alone.
@@ -0,0 +1,70 @@
1
+ # Pre-Delivery Checklist
2
+
3
+ Verify these items before delivering a skill.
4
+
5
+ ## Spec Quality
6
+
7
+ - [ ] **name** is kebab-case (lowercase, hyphens only)
8
+ - [ ] **description** clearly states when to use (>20 chars)
9
+ - [ ] **questions** are ≤10 and prioritized
10
+ - [ ] **triggers** include ≥5 example phrases
11
+ - [ ] **freedom_level** matches task type (low=deterministic, high=heuristic)
12
+
13
+ ## Workflow Quality
14
+
15
+ - [ ] All steps have unique `id` (kebab-case)
16
+ - [ ] All steps have descriptive `title`
17
+ - [ ] Gate steps (`kind: gate`) have clear pass/fail criteria
18
+ - [ ] Step `notes` are concise (<200 chars) and use index-style references
19
+ - [ ] Commands are copy-pastable and use `<placeholders>` consistently
20
+
21
+ ## Resource Organization
22
+
23
+ - [ ] `references/` contains only static rules/guidelines
24
+ - [ ] `scripts/` contains only deterministic, executable code
25
+ - [ ] `assets/` contains only structured data (CSV/JSON)
26
+ - [ ] No duplicate content across resources
27
+ - [ ] `.shared/` used for cross-skill reusable content
28
+
29
+ ## Generated Outputs
30
+
31
+ Run validation:
32
+ ```bash
33
+ python3 .shared/skill-creator/scripts/validate.py skills/<skill>/skillspec.json
34
+ ```
35
+
36
+ - [ ] Windsurf workflow generated at `.windsurf/workflows/<name>.md`
37
+ - [ ] Claude SKILL.md has strict frontmatter (name + description only)
38
+ - [ ] No banned files in skill bundles (README.md, CHANGELOG.md, etc.)
39
+ - [ ] Resources copied correctly for Claude/GitHub targets
40
+
41
+ ## Trigger Coverage
42
+
43
+ - [ ] Covers main action verb ("create", "review", "fix", etc.)
44
+ - [ ] Covers Chinese equivalents if applicable
45
+ - [ ] Covers common variations/synonyms
46
+ - [ ] Covers context keywords (technology, domain)
47
+ - [ ] Test: would a new user's phrasing match at least one trigger?
48
+
49
+ ## Common Issues to Avoid
50
+
51
+ | Issue | Check |
52
+ |-------|-------|
53
+ | Notes too long | Move details to `references/` |
54
+ | Hardcoded paths | Use `<placeholders>` |
55
+ | Missing gates | Add validation after risky steps |
56
+ | Unclear output | Specify exact format in step notes |
57
+ | Duplicate triggers | Consolidate similar phrases |
58
+
59
+ ## Final Sign-off
60
+
61
+ ```markdown
62
+ ## Delivery Confirmation
63
+
64
+ - Skill: <name>
65
+ - Version: 1
66
+ - Primary target: windsurf
67
+ - Backward compat: claude, cursor, github
68
+ - Validation: ✓ passed
69
+ - Package: dist/<name>.skill (if Claude target)
70
+ ```
@@ -0,0 +1,80 @@
1
+ # Requirement Collection Protocol
2
+
3
+ Guide for collecting skill requirements through conversational Q&A (max 10 questions).
4
+
5
+ ## Priority Order
6
+
7
+ Ask questions in this priority order (skip if already known):
8
+
9
+ 1. **Goal** - What is the one-sentence objective? (verb-based, repeatable task)
10
+ 2. **Triggers** - What phrases/keywords will users say? (at least 5)
11
+ 3. **Output** - What form should the output take? (code/report/checklist/patch)
12
+ 4. **Constraints** - What are the hard limits? (no network/must test/read-only)
13
+ 5. **Tools** - What tools are allowed? (shell/git/python/file ops)
14
+ 6. **Inputs** - What inputs are needed? (repo/config/logs/diff)
15
+ 7. **Workflow** - What are the key steps? Where are the gates?
16
+ 8. **Edge Cases** - What failures are expected? How to handle?
17
+ 9. **Resources** - What goes to references/scripts/assets/.shared?
18
+
19
+ ## Question Templates
20
+
21
+ ### Goal Question
22
+ ```
23
+ 这个 skill 的一句话目标是什么(动词开头,面向可重复任务)?
24
+ What is the one-sentence goal of this skill (verb-based, for repeatable tasks)?
25
+ ```
26
+
27
+ ### Trigger Question
28
+ ```
29
+ 用户会用哪些触发语句/关键词来表述这个需求(至少 5 条)?
30
+ What trigger phrases/keywords will users say? (at least 5 examples)
31
+ ```
32
+
33
+ ### Output Question
34
+ ```
35
+ 期望输出是什么形态?
36
+ - 报告 (report/analysis)
37
+ - 代码 (code generation)
38
+ - 补丁 (patch/diff)
39
+ - 命令 (shell commands)
40
+ - 文件树 (directory structure)
41
+ - 清单 (checklist)
42
+ - 其他
43
+ ```
44
+
45
+ ## Inference Rules
46
+
47
+ Before asking, try to infer from context:
48
+
49
+ | If user says... | Infer... |
50
+ |-----------------|----------|
51
+ | "review", "audit", "check" | Output = checklist, Workflow = gated |
52
+ | "generate", "create", "build" | Output = code/files, Freedom = low-medium |
53
+ | "fix", "debug", "repair" | Output = patch, Tools = git/diff |
54
+ | "explain", "document" | Output = report, Freedom = high |
55
+ | "convert", "migrate" | Output = transformed code, Tools = file ops |
56
+
57
+ ## Stop Conditions
58
+
59
+ Stop collecting when:
60
+ - All 9 priority items are known
61
+ - 10 questions reached
62
+ - User explicitly says "够了" / "that's enough"
63
+
64
+ ## Output Format
65
+
66
+ After collection, summarize in this format:
67
+
68
+ ```markdown
69
+ ## Skill Requirements Summary
70
+
71
+ - **Goal**: [one sentence]
72
+ - **Triggers**: [list of 5+]
73
+ - **Output**: [form]
74
+ - **Constraints**: [hard limits]
75
+ - **Tools**: [allowed tools]
76
+ - **Inputs**: [required inputs]
77
+ - **Workflow**: [key steps]
78
+ - **Edge Cases**: [failure handling]
79
+ - **Resources**: [distribution plan]
80
+ ```