@tinkcarlos/skillora 0.2.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 (234) hide show
  1. package/.claude/skills/.temp-skill-index.md +245 -0
  2. package/.claude/skills/SKILL.md +264 -0
  3. package/.claude/skills/api-scaffolding/SKILL.md +431 -0
  4. package/.claude/skills/api-scaffolding/agents/backend-architect.md +282 -0
  5. package/.claude/skills/api-scaffolding/agents/django-pro.md +144 -0
  6. package/.claude/skills/api-scaffolding/agents/fastapi-pro.md +156 -0
  7. package/.claude/skills/api-scaffolding/agents/graphql-architect.md +146 -0
  8. package/.claude/skills/api-scaffolding/skills/fastapi-templates/SKILL.md +171 -0
  9. package/.claude/skills/api-testing-observability/SKILL.md +583 -0
  10. package/.claude/skills/api-testing-observability/agents/api-documenter.md +146 -0
  11. package/.claude/skills/api-testing-observability/commands/api-mock.md +1320 -0
  12. package/.claude/skills/brainstorming/SKILL.md +283 -0
  13. package/.claude/skills/bug-fixing/SKILL.md +382 -0
  14. package/.claude/skills/bug-fixing/references/backend-guide.md +132 -0
  15. package/.claude/skills/bug-fixing/references/bug-guide.md +354 -0
  16. package/.claude/skills/bug-fixing/references/bug-record-template.md +134 -0
  17. package/.claude/skills/bug-fixing/references/bug-records.md +88 -0
  18. package/.claude/skills/bug-fixing/references/code-review-gate.md +81 -0
  19. package/.claude/skills/bug-fixing/references/common-bugs.md +140 -0
  20. package/.claude/skills/bug-fixing/references/complete-workflow.md +361 -0
  21. package/.claude/skills/bug-fixing/references/config-driven-fixes.md +136 -0
  22. package/.claude/skills/bug-fixing/references/context-isolation-protocol.md +268 -0
  23. package/.claude/skills/bug-fixing/references/cross-surface-regression.md +120 -0
  24. package/.claude/skills/bug-fixing/references/database-investigation.md +129 -0
  25. package/.claude/skills/bug-fixing/references/dependency-and-integrity-protocol.md +369 -0
  26. package/.claude/skills/bug-fixing/references/fix-completeness-checklist.md +239 -0
  27. package/.claude/skills/bug-fixing/references/frontend-guide.md +219 -0
  28. package/.claude/skills/bug-fixing/references/fullstack-joint-guide.md +123 -0
  29. package/.claude/skills/bug-fixing/references/functional-breakage.md +117 -0
  30. package/.claude/skills/bug-fixing/references/ide-lint-errors-guide.md +176 -0
  31. package/.claude/skills/bug-fixing/references/impact-analysis.md +511 -0
  32. package/.claude/skills/bug-fixing/references/investigation-checklist.md +263 -0
  33. package/.claude/skills/bug-fixing/references/knowledge-extraction-guide.md +531 -0
  34. package/.claude/skills/bug-fixing/references/knowledge-workflow.md +212 -0
  35. package/.claude/skills/bug-fixing/references/post-edit-quality-gate.md +30 -0
  36. package/.claude/skills/bug-fixing/references/python-env-and-testing.md +126 -0
  37. package/.claude/skills/bug-fixing/references/rca-guide.md +428 -0
  38. package/.claude/skills/bug-fixing/references/similar-bug-patterns.md +113 -0
  39. package/.claude/skills/bug-fixing/references/skill-delegation-guide.md +350 -0
  40. package/.claude/skills/bug-fixing/references/skill-orchestration.md +155 -0
  41. package/.claude/skills/bug-fixing/references/testing-strategy.md +350 -0
  42. package/.claude/skills/bug-fixing/references/tooling-build-scripts.md +162 -0
  43. package/.claude/skills/bug-fixing/references/user-input-validation.md +77 -0
  44. package/.claude/skills/bug-fixing/references/ux-patterns.md +158 -0
  45. package/.claude/skills/bug-fixing/references/windows-terminal-hygiene.md +106 -0
  46. package/.claude/skills/bug-fixing/references/zero-regression-matrix.md +239 -0
  47. package/.claude/skills/bug-fixing/references/zero-risk-protocol.md +102 -0
  48. package/.claude/skills/bug-fixing/scripts/format_code.py +611 -0
  49. package/.claude/skills/bug-fixing/scripts/generate_report_template.py +74 -0
  50. package/.claude/skills/bug-fixing/scripts/lint_check.py +816 -0
  51. package/.claude/skills/bug-fixing/scripts/requirements.txt +36 -0
  52. package/.claude/skills/cicd-pipeline/SKILL.md +300 -0
  53. package/.claude/skills/code-review/SKILL.md +535 -0
  54. package/.claude/skills/code-review/references/anti-pattern-scan.md +102 -0
  55. package/.claude/skills/code-review/references/automated-analysis.md +456 -0
  56. package/.claude/skills/code-review/references/backend-common-issues.md +589 -0
  57. package/.claude/skills/code-review/references/backend-expert-guide.md +415 -0
  58. package/.claude/skills/code-review/references/backend-review.md +868 -0
  59. package/.claude/skills/code-review/references/batch-processing-strategy.md +198 -0
  60. package/.claude/skills/code-review/references/call-chain-analysis-protocol.md +166 -0
  61. package/.claude/skills/code-review/references/common-patterns.md +321 -0
  62. package/.claude/skills/code-review/references/configuration-review.md +425 -0
  63. package/.claude/skills/code-review/references/control-flow-completeness.md +114 -0
  64. package/.claude/skills/code-review/references/database-review.md +298 -0
  65. package/.claude/skills/code-review/references/dependency-and-integrity-protocol.md +313 -0
  66. package/.claude/skills/code-review/references/external-standards.md +51 -0
  67. package/.claude/skills/code-review/references/feature-review.md +329 -0
  68. package/.claude/skills/code-review/references/file-review-template.md +326 -0
  69. package/.claude/skills/code-review/references/frontend-advanced.md +654 -0
  70. package/.claude/skills/code-review/references/frontend-common-issues.md +482 -0
  71. package/.claude/skills/code-review/references/frontend-expert-guide.md +342 -0
  72. package/.claude/skills/code-review/references/frontend-review.md +783 -0
  73. package/.claude/skills/code-review/references/fullstack-consistency.md +418 -0
  74. package/.claude/skills/code-review/references/fullstack-review.md +477 -0
  75. package/.claude/skills/code-review/references/functional-completeness.md +386 -0
  76. package/.claude/skills/code-review/references/hidden-bugs-detection.md +473 -0
  77. package/.claude/skills/code-review/references/ide-lint-errors-guide.md +173 -0
  78. package/.claude/skills/code-review/references/infrastructure-review.md +453 -0
  79. package/.claude/skills/code-review/references/iteration-review.md +264 -0
  80. package/.claude/skills/code-review/references/job-review.md +335 -0
  81. package/.claude/skills/code-review/references/layered-checklist-protocol.md +157 -0
  82. package/.claude/skills/code-review/references/logic-completeness.md +535 -0
  83. package/.claude/skills/code-review/references/mandatory-checklist.md +288 -0
  84. package/.claude/skills/code-review/references/multi-language-guide.md +800 -0
  85. package/.claude/skills/code-review/references/new-project-review.md +226 -0
  86. package/.claude/skills/code-review/references/non-code-files-review.md +451 -0
  87. package/.claude/skills/code-review/references/overlooked-issues.md +657 -0
  88. package/.claude/skills/code-review/references/platform-specific-review.md +195 -0
  89. package/.claude/skills/code-review/references/precision-analysis-protocol.md +260 -0
  90. package/.claude/skills/code-review/references/python-patterns.md +494 -0
  91. package/.claude/skills/code-review/references/rca-techniques.md +362 -0
  92. package/.claude/skills/code-review/references/report-template.md +430 -0
  93. package/.claude/skills/code-review/references/resource-limits-and-degradation.md +137 -0
  94. package/.claude/skills/code-review/references/review-dimensions.md +311 -0
  95. package/.claude/skills/code-review/references/review-guide.md +202 -0
  96. package/.claude/skills/code-review/references/review-knowledge-workflow.md +257 -0
  97. package/.claude/skills/code-review/references/review-progress-tracker-protocol.md +172 -0
  98. package/.claude/skills/code-review/references/review-record-template.md +195 -0
  99. package/.claude/skills/code-review/references/skill-orchestration.md +143 -0
  100. package/.claude/skills/code-review/references/ui-ux-review.md +470 -0
  101. package/.claude/skills/containerization/SKILL.md +313 -0
  102. package/.claude/skills/database-migrations/agents/database-admin.md +142 -0
  103. package/.claude/skills/database-migrations/agents/database-optimizer.md +144 -0
  104. package/.claude/skills/database-migrations/commands/migration-observability.md +408 -0
  105. package/.claude/skills/database-migrations/commands/sql-migrations.md +492 -0
  106. package/.claude/skills/finishing-a-development-branch/SKILL.md +319 -0
  107. package/.claude/skills/frontend-design/LICENSE.txt +177 -0
  108. package/.claude/skills/frontend-design/SKILL.md +587 -0
  109. package/.claude/skills/frontend-design/references/color-consistency.md +487 -0
  110. package/.claude/skills/frontend-design/references/color-palettes-full.md +657 -0
  111. package/.claude/skills/frontend-design/references/design-system-generator.md +285 -0
  112. package/.claude/skills/frontend-design/references/font-pairings-full.md +705 -0
  113. package/.claude/skills/frontend-design/references/industry-anti-patterns.md +281 -0
  114. package/.claude/skills/frontend-design/references/layout-anti-patterns.md +582 -0
  115. package/.claude/skills/frontend-design/references/motion-patterns.md +659 -0
  116. package/.claude/skills/frontend-design/references/pre-delivery-checklist.md +153 -0
  117. package/.claude/skills/frontend-design/references/responsive-design.md +555 -0
  118. package/.claude/skills/frontend-design/references/style-modification-rules.md +335 -0
  119. package/.claude/skills/frontend-design/references/ui-styles-full.md +383 -0
  120. package/.claude/skills/frontend-design/references/ui-styles-rating.md +191 -0
  121. package/.claude/skills/frontend-design/references/ux-guidelines.md +640 -0
  122. package/.claude/skills/fullstack-developer/SKILL.md +512 -0
  123. package/.claude/skills/fullstack-developer/references/api-contract-guide.md +312 -0
  124. package/.claude/skills/fullstack-developer/references/api-response-patterns.md +223 -0
  125. package/.claude/skills/fullstack-developer/references/async-patterns.md +220 -0
  126. package/.claude/skills/fullstack-developer/references/bug-prevention.md +914 -0
  127. package/.claude/skills/fullstack-developer/references/code-quality-checklist.md +271 -0
  128. package/.claude/skills/fullstack-developer/references/complete-development-workflow.md +278 -0
  129. package/.claude/skills/fullstack-developer/references/context-isolation-protocol.md +256 -0
  130. package/.claude/skills/fullstack-developer/references/database-migration.md +331 -0
  131. package/.claude/skills/fullstack-developer/references/dependency-and-integrity-protocol.md +390 -0
  132. package/.claude/skills/fullstack-developer/references/development-phases.md +333 -0
  133. package/.claude/skills/fullstack-developer/references/expert-guide.md +214 -0
  134. package/.claude/skills/fullstack-developer/references/file-import-patterns.md +114 -0
  135. package/.claude/skills/fullstack-developer/references/graceful-degradation-patterns.md +78 -0
  136. package/.claude/skills/fullstack-developer/references/ide-lint-errors-guide.md +183 -0
  137. package/.claude/skills/fullstack-developer/references/integration-testing.md +301 -0
  138. package/.claude/skills/fullstack-developer/references/mock-api-patterns.md +307 -0
  139. package/.claude/skills/fullstack-developer/references/phase-gate-template.md +249 -0
  140. package/.claude/skills/fullstack-developer/references/post-edit-quality-gate.md +30 -0
  141. package/.claude/skills/fullstack-developer/references/python-engineering.md +79 -0
  142. package/.claude/skills/fullstack-developer/references/skill-orchestration.md +214 -0
  143. package/.claude/skills/fullstack-developer/references/skill-router-table.md +304 -0
  144. package/.claude/skills/fullstack-developer/references/state-sync.md +217 -0
  145. package/.claude/skills/fullstack-developer/references/ui-testing-checklist.md +292 -0
  146. package/.claude/skills/fullstack-developer/scripts/format_code.py +611 -0
  147. package/.claude/skills/fullstack-developer/scripts/lint_check.py +816 -0
  148. package/.claude/skills/fullstack-developer/scripts/requirements.txt +36 -0
  149. package/.claude/skills/performance-optimization/SKILL.md +250 -0
  150. package/.claude/skills/product-requirements/SKILL.md +357 -0
  151. package/.claude/skills/product-requirements/references/acceptance-criteria.md +335 -0
  152. package/.claude/skills/product-requirements/references/answer-first-questioning-protocol.md +299 -0
  153. package/.claude/skills/product-requirements/references/competitive-analysis-guide.md +183 -0
  154. package/.claude/skills/product-requirements/references/document-accuracy-protocol.md +253 -0
  155. package/.claude/skills/product-requirements/references/document-management-protocol.md +278 -0
  156. package/.claude/skills/product-requirements/references/external-standards.md +62 -0
  157. package/.claude/skills/product-requirements/references/feature-spec-template.md +359 -0
  158. package/.claude/skills/product-requirements/references/knowledge-acquisition-protocol.md +251 -0
  159. package/.claude/skills/product-requirements/references/plan-execution-protocol.md +334 -0
  160. package/.claude/skills/product-requirements/references/plan-generation-protocol.md +264 -0
  161. package/.claude/skills/product-requirements/references/prioritization-frameworks.md +80 -0
  162. package/.claude/skills/product-requirements/references/requirement-decomposition-protocol.md +291 -0
  163. package/.claude/skills/product-requirements/references/user-story-examples.md +297 -0
  164. package/.claude/skills/product-requirements/references/workflow-templates.md +266 -0
  165. package/.claude/skills/react-best-practices/SKILL.md +198 -0
  166. package/.claude/skills/react-best-practices/references/advanced-patterns.md +94 -0
  167. package/.claude/skills/react-best-practices/references/bundle-optimization.md +182 -0
  168. package/.claude/skills/react-best-practices/references/client-data-fetching.md +112 -0
  169. package/.claude/skills/react-best-practices/references/complete-guide.md +2249 -0
  170. package/.claude/skills/react-best-practices/references/eliminating-waterfalls.md +169 -0
  171. package/.claude/skills/react-best-practices/references/javascript-performance.md +256 -0
  172. package/.claude/skills/react-best-practices/references/rendering-performance.md +230 -0
  173. package/.claude/skills/react-best-practices/references/rerender-optimization.md +214 -0
  174. package/.claude/skills/react-best-practices/references/server-performance.md +182 -0
  175. package/.claude/skills/security-audit/SKILL.md +226 -0
  176. package/.claude/skills/shared-references/advanced-debugging-techniques.md +186 -0
  177. package/.claude/skills/shared-references/code-quality-checklist.md +218 -0
  178. package/.claude/skills/shared-references/code-review-efficiency-guide.md +125 -0
  179. package/.claude/skills/shared-references/mcp-dependency-compatibility-protocol.md +276 -0
  180. package/.claude/skills/shared-references/skill-call-graph.md +230 -0
  181. package/.claude/skills/shared-references/skill-orchestration-protocol.md +281 -0
  182. package/.claude/skills/shared-references/subagent-dispatch-templates.md +199 -0
  183. package/.claude/skills/skill-expert-skills/LICENSE.txt +204 -0
  184. package/.claude/skills/skill-expert-skills/QUICK_NAVIGATION.md +374 -0
  185. package/.claude/skills/skill-expert-skills/SKILL.md +247 -0
  186. package/.claude/skills/skill-expert-skills/docs/_index.md +91 -0
  187. package/.claude/skills/skill-expert-skills/references/deep-research-methodology.md +389 -0
  188. package/.claude/skills/skill-expert-skills/references/docs-generation-workflow.md +398 -0
  189. package/.claude/skills/skill-expert-skills/references/domain-expertise-protocol.md +343 -0
  190. package/.claude/skills/skill-expert-skills/references/domain-knowledge/_index.md +54 -0
  191. package/.claude/skills/skill-expert-skills/references/domain-knowledge/backend-expertise.md +517 -0
  192. package/.claude/skills/skill-expert-skills/references/domain-knowledge/bug-fixing-expertise.md +363 -0
  193. package/.claude/skills/skill-expert-skills/references/domain-knowledge/code-review-expertise.md +392 -0
  194. package/.claude/skills/skill-expert-skills/references/domain-knowledge/frontend-expertise.md +410 -0
  195. package/.claude/skills/skill-expert-skills/references/domain-knowledge-template.md +503 -0
  196. package/.claude/skills/skill-expert-skills/references/examples.md +782 -0
  197. package/.claude/skills/skill-expert-skills/references/integration-examples.md +655 -0
  198. package/.claude/skills/skill-expert-skills/references/knowledge-validation-checklist.md +246 -0
  199. package/.claude/skills/skill-expert-skills/references/latest-knowledge-acquisition.md +461 -0
  200. package/.claude/skills/skill-expert-skills/references/mcp-tools-guide.md +439 -0
  201. package/.claude/skills/skill-expert-skills/references/official-best-practices.md +616 -0
  202. package/.claude/skills/skill-expert-skills/references/patterns.md +218 -0
  203. package/.claude/skills/skill-expert-skills/references/plugin-skills-guide.md +432 -0
  204. package/.claude/skills/skill-expert-skills/references/requirement-elicitation-protocol.md +290 -0
  205. package/.claude/skills/skill-expert-skills/references/skill-creator-SKILL.md +353 -0
  206. package/.claude/skills/skill-expert-skills/references/skill-templates.md +583 -0
  207. package/.claude/skills/skill-expert-skills/references/skills-knowledge-base.md +561 -0
  208. package/.claude/skills/skill-expert-skills/references/tools-guide.md +379 -0
  209. package/.claude/skills/skill-expert-skills/references/troubleshooting.md +378 -0
  210. package/.claude/skills/skill-expert-skills/references/universality-guide.md +205 -0
  211. package/.claude/skills/skill-expert-skills/references/writing-style-guide.md +466 -0
  212. package/.claude/skills/skill-expert-skills/scripts/__pycache__/quick_validate.cpython-313.pyc +0 -0
  213. package/.claude/skills/skill-expert-skills/scripts/__pycache__/universal_validate.cpython-313.pyc +0 -0
  214. package/.claude/skills/skill-expert-skills/scripts/analyze_trigger.py +425 -0
  215. package/.claude/skills/skill-expert-skills/scripts/diff_with_official.py +188 -0
  216. package/.claude/skills/skill-expert-skills/scripts/init_skill.py +349 -0
  217. package/.claude/skills/skill-expert-skills/scripts/package_skill.py +156 -0
  218. package/.claude/skills/skill-expert-skills/scripts/quick_validate.py +493 -0
  219. package/.claude/skills/skill-expert-skills/scripts/requirements.txt +2 -0
  220. package/.claude/skills/skill-expert-skills/scripts/universal_validate.py +182 -0
  221. package/.claude/skills/skill-expert-skills/scripts/upgrade_skill.py +431 -0
  222. package/.claude/skills/subagent-driven-development/SKILL.md +268 -0
  223. package/.claude/skills/test-driven-development/SKILL.md +246 -0
  224. package/.claude/skills/test-driven-development/references/testing-anti-patterns.md +192 -0
  225. package/.claude/skills/using-git-worktrees/SKILL.md +266 -0
  226. package/.claude/skills/using-skillstack/SKILL.md +127 -0
  227. package/.claude/skills/vercel-deploy/SKILL.md +166 -0
  228. package/.claude/skills/vercel-deploy/scripts/deploy.sh +249 -0
  229. package/.claude/skills/verification-before-completion/SKILL.md +305 -0
  230. package/.claude/skills/writing-plans/SKILL.md +259 -0
  231. package/README.md +69 -0
  232. package/bin/cli.js +468 -0
  233. package/lib/init.js +333 -0
  234. package/package.json +29 -0
@@ -0,0 +1,281 @@
1
+ # Skill Orchestration Protocol v1.0
2
+
3
+ 统一的技能编排协议,确保 skill 之间调用时不会造成上下文污染。
4
+
5
+ ## The Iron Law
6
+
7
+ ```
8
+ NO SKILL CALL WITHOUT ISOLATION. NO DELEGATION WITHOUT ANCHOR. NO RETURN WITHOUT VERIFICATION.
9
+ ```
10
+
11
+ ---
12
+
13
+ ## 一、编排器 Skills 列表
14
+
15
+ | Skill | 角色 | 可调用的 Skills |
16
+ |-------|------|----------------|
17
+ | **fullstack-developer** | 主编排器 | 几乎所有 skills |
18
+ | **bug-fixing** | Bug 修复器 | frontend-design, database-migration, test-driven-development, code-review |
19
+ | **code-review** | 代码审查器 | bug-fixing, test-driven-development, verification-before-completion |
20
+ | **product-requirements** | 需求分析器 | frontend-design, bug-fixing, code-review, fullstack-developer |
21
+ | **frontend-design** | 前端设计器 | react-best-practices, code-review |
22
+
23
+ ---
24
+
25
+ ## 二、三层保护机制
26
+
27
+ ### 1. 锚点层 (Anchor Layer)
28
+
29
+ **不可变的任务信息,始终记住原始目标**
30
+
31
+ ```markdown
32
+ ### 主上下文锚点
33
+ - **原始任务**: [用户的原始请求]
34
+ - **任务 ID**: [Bug ID / 需求文档路径]
35
+ - **成功标准**: [明确的完成条件]
36
+ - **当前计划任务**: T[X] - [任务描述]
37
+ ```
38
+
39
+ ### 2. 约束层 (Constraint Layer)
40
+
41
+ **委托范围限制,防止范围膨胀**
42
+
43
+ | 调用场景 | 范围约束 |
44
+ |----------|----------|
45
+ | bug-fixing → fullstack-developer | **最小 API only** |
46
+ | bug-fixing → frontend-design | **Fix-related only** |
47
+ | bug-fixing → database-migration | **Required changes only** |
48
+ | code-review → bug-fixing | **P0/P1 issues only** |
49
+
50
+ ### 3. 检查层 (Verification Layer)
51
+
52
+ **进入/退出验证,确保正确切换上下文**
53
+
54
+ - 委托前:输出锚点确认
55
+ - 委托后:验证是否偏离
56
+ - 偏离时:立即停止并询问
57
+
58
+ ---
59
+
60
+ ## 三、委托模板
61
+
62
+ ### 委托进入模板
63
+
64
+ ```markdown
65
+ ## 🔄 技能委托通知
66
+
67
+ ### 主上下文锚点确认
68
+ - **原始任务**: [用户的原始请求]
69
+ - **任务 ID**: [Bug ID / 需求文档路径]
70
+ - **当前计划任务**: T[X] - [任务描述]
71
+ - **成功标准**: [明确的完成条件]
72
+
73
+ ### 委托详情
74
+ - **目标 Skill**: `[skill-name]`
75
+ - **委托目的**: [为什么需要这个 Skill]
76
+ - **范围限定**:
77
+ - ✅ 允许: [具体允许的操作]
78
+ - ❌ 禁止: [明确禁止的操作]
79
+ - **退出条件**: [什么标志完成]
80
+ - **预计步骤**: [X] 步
81
+
82
+ ---
83
+ ⏱️ 开始委托任务...
84
+ ```
85
+
86
+ ### 委托退出模板
87
+
88
+ ```markdown
89
+ ## ✅ 委托任务完成
90
+
91
+ ### 完成情况
92
+ - **目标达成**: ✅ / ❌
93
+ - **范围遵守**: ✅ / ❌
94
+ - **产出物**: [创建/修改的文件列表]
95
+
96
+ ### 偏离检查
97
+ - **是否偏离原始目标**: ✅ 未偏离 / ❌ 已偏离
98
+ - **偏离说明**: [如有偏离,说明原因]
99
+
100
+ ### 返回主上下文
101
+ - **继续任务**: T[X+1]
102
+ - **计划状态更新**: [更新内容]
103
+
104
+ ---
105
+ 🔄 返回主上下文
106
+ ```
107
+
108
+ ---
109
+
110
+ ## 四、调用方式
111
+
112
+ ### 方式 1: Task 工具 (Subagent 隔离) - 推荐
113
+
114
+ ```python
115
+ Task(
116
+ subagent_type="superpowers:code-reviewer",
117
+ prompt="""
118
+ ## 主上下文锚点
119
+ - 原始任务: [任务描述]
120
+ - 成功标准: [完成条件]
121
+
122
+ ## 委托任务
123
+ 审查以下变更: [变更列表]
124
+
125
+ ## 范围约束
126
+ - ✅ 允许: 审查代码质量
127
+ - ❌ 禁止: 修改代码
128
+ """,
129
+ description="代码审查"
130
+ )
131
+ ```
132
+
133
+ **优点**: 天然隔离,subagent 有独立上下文
134
+
135
+ ### 方式 2: Skill 工具
136
+
137
+ ```python
138
+ Skill(skill="code-review")
139
+ ```
140
+
141
+ **注意**: 需要手动管理上下文,使用委托模板
142
+
143
+ ---
144
+
145
+ ## 五、强制调用链
146
+
147
+ ### 闭环 1: 代码审查闭环
148
+
149
+ ```
150
+ code-review → bug-fixing → code-review (循环直到通过)
151
+ ```
152
+
153
+ ### 闭环 2: 开发完成闭环
154
+
155
+ ```
156
+ development → verification-before-completion → code-review → (bug-fixing →)* → merge
157
+ ```
158
+
159
+ ### 闭环 3: Bug 修复闭环
160
+
161
+ ```
162
+ bug-fixing → code-review → verification-before-completion
163
+ ```
164
+
165
+ ---
166
+
167
+ ## 六、触发条件表
168
+
169
+ | 主 Skill | 触发条件 | 调用 Skill | 范围约束 | 强制? |
170
+ |----------|----------|------------|----------|-------|
171
+ | fullstack-developer | 任何 UI 工作 | frontend-design | - | ✅ |
172
+ | fullstack-developer | ORM 模型变更 | database-migration | - | ✅ |
173
+ | fullstack-developer | 开发完成 | code-review | - | ✅ |
174
+ | fullstack-developer | 审查发现问题 | bug-fixing | P0/P1 only | - |
175
+ | bug-fixing | 修复需要新 API | fullstack-developer | 最小 API only | - |
176
+ | bug-fixing | 修复涉及 UI | frontend-design | Fix-related only | - |
177
+ | bug-fixing | 修复完成 | code-review | - | ✅ |
178
+ | code-review | 发现 P0/P1 Bug | bug-fixing | - | ✅ |
179
+ | frontend-design | React/Next.js | react-best-practices | - | ✅ |
180
+
181
+ ---
182
+
183
+ ## 七、上下文污染的表现
184
+
185
+ | 问题 | 表现 | 后果 | 预防 |
186
+ |------|------|------|------|
187
+ | **目标漂移** | 忘记原始任务目标 | 偏离用户需求 | 锚点层 |
188
+ | **范围膨胀** | 小修复变成大工程 | 引入更多风险 | 约束层 |
189
+ | **上下文丢失** | 忘记已完成的任务 | 重复执行 | 检查层 |
190
+ | **循环调用** | A→B→A 无限循环 | 死循环 | 退出条件 |
191
+
192
+ ---
193
+
194
+ ## 八、偏离处理
195
+
196
+ ### 检测偏离
197
+
198
+ ```markdown
199
+ ## ⚠️ 偏离检测
200
+
201
+ 当前操作: [正在做的事情]
202
+ 原始目标: [应该做的事情]
203
+
204
+ **偏离类型**:
205
+ - [ ] 目标漂移
206
+ - [ ] 范围膨胀
207
+ - [ ] 上下文丢失
208
+
209
+ **处理方式**:
210
+ 1. 立即停止当前操作
211
+ 2. 询问用户是否继续
212
+ 3. 如继续,更新锚点
213
+ 4. 如不继续,回滚到锚点
214
+ ```
215
+
216
+ ---
217
+
218
+ ## 九、最佳实践
219
+
220
+ ### DO ✅
221
+
222
+ 1. 每次委托前输出锚点确认
223
+ 2. 明确范围约束 (允许/禁止)
224
+ 3. 委托完成后验证是否偏离
225
+ 4. 使用 Task 工具实现 subagent 隔离
226
+ 5. 保持委托链简短 (≤3 层)
227
+
228
+ ### DON'T ❌
229
+
230
+ 1. 不要在委托中修改原始目标
231
+ 2. 不要跳过强制调用链
232
+ 3. 不要忽略范围约束
233
+ 4. 不要在委托中创建新的委托链
234
+ 5. 不要在偏离时继续执行
235
+
236
+ ---
237
+
238
+ ## 十、Hooks 集成
239
+
240
+ ### 自动触发的 Hooks
241
+
242
+ | Hook 类型 | Matcher | 触发时机 | 作用 |
243
+ |-----------|---------|----------|------|
244
+ | PreToolUse | Skill | Skill 调用前 | 记录调用、提醒锚点 |
245
+ | PostToolUse | Skill | Skill 调用后 | 验证完成、检查偏离 |
246
+ | PreToolUse | Task | Subagent 派发前 | 检查锚点完整性 |
247
+ | PostToolUse | Task | Subagent 返回后 | 验证偏离、更新进度 |
248
+ | SubagentStop | * | Subagent 停止时 | 恢复上下文、输出检查清单 |
249
+
250
+ ### Hook 输出解读
251
+
252
+ | 输出 | 含义 | 处理 |
253
+ |------|------|------|
254
+ | `⚠️ WARNING: missing context anchor` | Subagent 缺少锚点 | 重新派发,添加锚点 |
255
+ | `🔄 Subagent completed` | Subagent 正常完成 | 验证范围,继续任务 |
256
+ | `📋 Checklist` | 检查清单 | 逐项验证 |
257
+
258
+ ### 日志文件
259
+
260
+ | 文件 | 内容 |
261
+ |------|------|
262
+ | `~/.claude/skill-invocation-log.jsonl` | Skill 调用记录 |
263
+ | `~/.claude/subagent-dispatch-log.jsonl` | Subagent 派发记录 |
264
+
265
+ ---
266
+
267
+ ## 十一、Subagent 调用模板
268
+
269
+ 详见 `shared-references/subagent-dispatch-templates.md`
270
+
271
+ ---
272
+
273
+ ## 十二、引用此协议
274
+
275
+ 在 SKILL.md 中添加:
276
+
277
+ ```markdown
278
+ ## 技能编排
279
+
280
+ 遵循 `shared-references/skill-orchestration-protocol.md` 协议。
281
+ ```
@@ -0,0 +1,199 @@
1
+ # Subagent Dispatch Templates
2
+
3
+ 标准化的 Subagent 调用模板,确保上下文隔离和防止目标漂移。
4
+
5
+ ---
6
+
7
+ ## 核心原则
8
+
9
+ ```
10
+ NO SUBAGENT WITHOUT ANCHOR. NO DELEGATION WITHOUT SCOPE. NO RETURN WITHOUT VERIFICATION.
11
+ ```
12
+
13
+ ---
14
+
15
+ ## 模板 1: 通用 Skill 委托
16
+
17
+ 适用于大多数 skill 调用场景。
18
+
19
+ ```python
20
+ Task(
21
+ subagent_type="general-purpose",
22
+ prompt="""
23
+ ## 🔒 主上下文锚点 (IMMUTABLE)
24
+ - **原始任务**: {original_task}
25
+ - **任务 ID**: {task_id}
26
+ - **成功标准**: {success_criteria}
27
+ - **当前阶段**: {current_phase}
28
+
29
+ ## 📋 委托任务
30
+ 执行 `{skill_name}` 技能完成以下工作:
31
+ {task_description}
32
+
33
+ ## ⚠️ 范围约束
34
+ - ✅ 允许: {allowed_actions}
35
+ - ❌ 禁止: {forbidden_actions}
36
+ - ⏱️ 预计步骤: {estimated_steps}
37
+
38
+ ## 🚪 退出条件
39
+ {exit_condition}
40
+
41
+ ## 📤 输出要求
42
+ 完成后输出:
43
+ 1. 目标达成: ✅/❌
44
+ 2. 范围遵守: ✅/❌
45
+ 3. 产出物列表
46
+ 4. 偏离说明 (如有)
47
+ """,
48
+ description="{short_description}"
49
+ )
50
+ ```
51
+
52
+ ---
53
+
54
+ ## 模板 2: 代码审查委托
55
+
56
+ 专用于 code-review skill。
57
+
58
+ ```python
59
+ Task(
60
+ subagent_type="superpowers:code-reviewer",
61
+ prompt="""
62
+ ## 🔒 主上下文锚点
63
+ - **原始任务**: {original_task}
64
+ - **变更范围**: {changed_files}
65
+
66
+ ## 📋 审查任务
67
+ 按照 `code-review` 技能标准审查以下变更:
68
+ {file_list}
69
+
70
+ ## ⚠️ 范围约束
71
+ - ✅ 允许: 审查代码质量、发现 Bug、提出改进建议
72
+ - ❌ 禁止: 修改代码、添加功能、重构
73
+
74
+ ## 🚪 退出条件
75
+ 输出审查报告,包含 P0-P3 问题列表
76
+ """,
77
+ description="代码审查"
78
+ )
79
+ ```
80
+
81
+ ---
82
+
83
+ ## 模板 3: Bug 修复委托
84
+
85
+ 专用于 bug-fixing skill。
86
+
87
+ ```python
88
+ Task(
89
+ subagent_type="general-purpose",
90
+ prompt="""
91
+ ## 🔒 主上下文锚点
92
+ - **Bug ID**: {bug_id}
93
+ - **原始症状**: {symptom}
94
+ - **根因**: {root_cause}
95
+
96
+ ## 📋 修复任务
97
+ 执行 `bug-fixing` 技能修复:
98
+ {fix_description}
99
+
100
+ ## ⚠️ 范围约束
101
+ - ✅ 允许: 修复 Bug 相关代码
102
+ - ❌ 禁止: 重构、优化、添加功能
103
+
104
+ ## 🚪 退出条件
105
+ Bug 修复完成,测试通过
106
+ """,
107
+ description="Bug 修复"
108
+ )
109
+ ```
110
+
111
+ ---
112
+
113
+ ## 模板 4: 前端开发委托
114
+
115
+ 专用于 frontend-design skill。
116
+
117
+ ```python
118
+ Task(
119
+ subagent_type="general-purpose",
120
+ prompt="""
121
+ ## 🔒 主上下文锚点
122
+ - **原始任务**: {original_task}
123
+ - **UI 需求**: {ui_requirements}
124
+
125
+ ## 📋 前端任务
126
+ 执行 `frontend-design` 技能完成:
127
+ {task_description}
128
+
129
+ ## ⚠️ 范围约束
130
+ - ✅ 允许: 创建/修改 UI 组件、样式
131
+ - ❌ 禁止: 修改后端逻辑、数据库
132
+
133
+ ## 🚪 退出条件
134
+ UI 组件完成,符合设计规范
135
+ """,
136
+ description="前端开发"
137
+ )
138
+ ```
139
+
140
+ ---
141
+
142
+ ## 模板 5: 数据库迁移委托
143
+
144
+ 专用于 database-migration skill。
145
+
146
+ ```python
147
+ Task(
148
+ subagent_type="general-purpose",
149
+ prompt="""
150
+ ## 🔒 主上下文锚点
151
+ - **原始任务**: {original_task}
152
+ - **数据模型变更**: {model_changes}
153
+
154
+ ## 📋 迁移任务
155
+ 执行 `database-migration` 技能完成:
156
+ {migration_description}
157
+
158
+ ## ⚠️ 范围约束
159
+ - ✅ 允许: 创建迁移文件、修改模型
160
+ - ❌ 禁止: 修改业务逻辑、删除数据
161
+
162
+ ## 🚪 退出条件
163
+ 迁移文件创建完成,可正常执行
164
+ """,
165
+ description="数据库迁移"
166
+ )
167
+ ```
168
+
169
+ ---
170
+
171
+ ## 使用指南
172
+
173
+ ### 何时使用 Subagent
174
+
175
+ | 场景 | 是否使用 Subagent | 原因 |
176
+ |------|-------------------|------|
177
+ | 简单单步任务 | ❌ | 直接执行更高效 |
178
+ | 复杂多步任务 | ✅ | 需要上下文隔离 |
179
+ | 跨 Skill 委托 | ✅ | 防止目标漂移 |
180
+ | 代码审查 | ✅ | 使用专用 reviewer |
181
+
182
+ ### 锚点信息必填项
183
+
184
+ | 字段 | 必填 | 说明 |
185
+ |------|------|------|
186
+ | 原始任务 | ✅ | 用户的原始请求 |
187
+ | 任务 ID | ✅ | 唯一标识符 |
188
+ | 成功标准 | ✅ | 如何判断完成 |
189
+ | 范围约束 | ✅ | 允许/禁止操作 |
190
+ | 退出条件 | ✅ | 何时返回 |
191
+
192
+ ### 偏离检测
193
+
194
+ Subagent 返回后,检查以下项目:
195
+
196
+ - [ ] 产出物是否符合原始任务
197
+ - [ ] 是否有超出范围的修改
198
+ - [ ] 是否引入了新的依赖
199
+ - [ ] 是否偏离了成功标准
@@ -0,0 +1,204 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf of
172
+ any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
204
+