@bovinphang/craft-common 0.0.0-stage → 1.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 (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/dist/content/catalog.d.ts +4 -0
  4. package/dist/content/resources.d.ts +2 -0
  5. package/dist/content/types.d.ts +21 -0
  6. package/dist/index.d.ts +7 -0
  7. package/dist/index.js +668 -0
  8. package/dist/install/identity.d.ts +5 -0
  9. package/dist/install/planner.d.ts +6 -0
  10. package/dist/install/transaction.d.ts +7 -0
  11. package/dist/install/types.d.ts +44 -0
  12. package/docs/consuming-common.md +33 -0
  13. package/localized/zh-CN/methods/debug.md +13 -0
  14. package/localized/zh-CN/methods/doc-sync.md +12 -0
  15. package/localized/zh-CN/methods/refactoring.md +16 -0
  16. package/localized/zh-CN/methods/source-driven-development.md +19 -0
  17. package/localized/zh-CN/methods/tdd.md +13 -0
  18. package/localized/zh-CN/skills/cc-debug-methodology/SKILL.md +8 -0
  19. package/localized/zh-CN/skills/cc-debug-methodology/references/method.md +13 -0
  20. package/localized/zh-CN/skills/cc-doc-sync-core/SKILL.md +8 -0
  21. package/localized/zh-CN/skills/cc-doc-sync-core/references/method.md +12 -0
  22. package/localized/zh-CN/skills/cc-drawio-studio/SKILL.md +73 -0
  23. package/localized/zh-CN/skills/cc-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
  24. package/localized/zh-CN/skills/cc-drawio-studio/data/brand-icons.json +878 -0
  25. package/localized/zh-CN/skills/cc-drawio-studio/data/shape-index.json +83570 -0
  26. package/localized/zh-CN/skills/cc-drawio-studio/references/data-residency.md +27 -0
  27. package/localized/zh-CN/skills/cc-drawio-studio/references/diagram-patterns.md +60 -0
  28. package/localized/zh-CN/skills/cc-drawio-studio/references/flowchart-quality.md +49 -0
  29. package/localized/zh-CN/skills/cc-drawio-studio/references/layout-and-export.md +72 -0
  30. package/localized/zh-CN/skills/cc-drawio-studio/references/troubleshooting.md +29 -0
  31. package/localized/zh-CN/skills/cc-drawio-studio/references/xml-and-mermaid.md +58 -0
  32. package/localized/zh-CN/skills/cc-drawio-studio/scripts/brand-symbols.mjs +99 -0
  33. package/localized/zh-CN/skills/cc-drawio-studio/scripts/diagram-lint.mjs +205 -0
  34. package/localized/zh-CN/skills/cc-drawio-studio/scripts/diagram-url.mjs +102 -0
  35. package/localized/zh-CN/skills/cc-drawio-studio/scripts/drawio-export.mjs +134 -0
  36. package/localized/zh-CN/skills/cc-drawio-studio/scripts/layout-graph.mjs +107 -0
  37. package/localized/zh-CN/skills/cc-drawio-studio/scripts/png-embed-fix.mjs +26 -0
  38. package/localized/zh-CN/skills/cc-drawio-studio/scripts/scan-go-packages.mjs +36 -0
  39. package/localized/zh-CN/skills/cc-drawio-studio/scripts/scan-js-modules.mjs +52 -0
  40. package/localized/zh-CN/skills/cc-drawio-studio/scripts/scan-python-classes.mjs +30 -0
  41. package/localized/zh-CN/skills/cc-drawio-studio/scripts/scan-python-modules.mjs +55 -0
  42. package/localized/zh-CN/skills/cc-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
  43. package/localized/zh-CN/skills/cc-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
  44. package/localized/zh-CN/skills/cc-drawio-studio/scripts/shape-query.mjs +121 -0
  45. package/localized/zh-CN/skills/cc-drawio-studio/scripts/studio-core.mjs +139 -0
  46. package/localized/zh-CN/skills/cc-drawio-studio/styles/built-in/corporate.json +49 -0
  47. package/localized/zh-CN/skills/cc-drawio-studio/styles/built-in/default.json +49 -0
  48. package/localized/zh-CN/skills/cc-drawio-studio/styles/built-in/handdrawn.json +49 -0
  49. package/localized/zh-CN/skills/cc-drawio-studio/styles/schema.json +112 -0
  50. package/localized/zh-CN/skills/cc-refactoring-core/SKILL.md +8 -0
  51. package/localized/zh-CN/skills/cc-refactoring-core/references/method.md +16 -0
  52. package/localized/zh-CN/skills/cc-source-driven-development/SKILL.md +8 -0
  53. package/localized/zh-CN/skills/cc-source-driven-development/references/method.md +19 -0
  54. package/localized/zh-CN/skills/cc-tdd-methodology/SKILL.md +8 -0
  55. package/localized/zh-CN/skills/cc-tdd-methodology/references/method.md +13 -0
  56. package/localized/zh-CN/skills/cc-technical-diagrams/SKILL.md +34 -0
  57. package/localized/zh-CN/skills/cc-technical-diagrams/assets/interactive-diagram.html +371 -0
  58. package/localized/zh-CN/skills/cc-technical-diagrams/assets/quality-examples/README.md +14 -0
  59. package/localized/zh-CN/skills/cc-technical-diagrams/assets/quality-examples/architecture.json +121 -0
  60. package/localized/zh-CN/skills/cc-technical-diagrams/assets/quality-examples/invalid-explicit.json +41 -0
  61. package/localized/zh-CN/skills/cc-technical-diagrams/assets/quality-examples/sequence.json +53 -0
  62. package/localized/zh-CN/skills/cc-technical-diagrams/assets/quality-examples/sequence.mmd +21 -0
  63. package/localized/zh-CN/skills/cc-technical-diagrams/assets/quality-examples/workflow.json +98 -0
  64. package/localized/zh-CN/skills/cc-technical-diagrams/assets/quality-examples/workflow.mmd +7 -0
  65. package/localized/zh-CN/skills/cc-technical-diagrams/references/diagram-workflows.md +81 -0
  66. package/localized/zh-CN/skills/cc-technical-diagrams/references/html-technical-diagrams.md +243 -0
  67. package/localized/zh-CN/skills/cc-technical-diagrams/references/png-qa-autofix.md +37 -0
  68. package/localized/zh-CN/skills/cc-technical-diagrams/scripts/diagram-browser.mjs +153 -0
  69. package/localized/zh-CN/skills/cc-technical-diagrams/scripts/diagram-layout.mjs +176 -0
  70. package/localized/zh-CN/skills/cc-technical-diagrams/scripts/export-diagram.mjs +332 -0
  71. package/localized/zh-CN/skills/cc-technical-diagrams/scripts/interactive-diagram-server.mjs +654 -0
  72. package/localized/zh-CN/skills/cc-technical-diagrams/scripts/mermaid-render.mjs +64 -0
  73. package/localized/zh-CN/skills/cc-technical-diagrams/scripts/png-qa.mjs +462 -0
  74. package/localized/zh-CN/skills/cc-technical-diagrams/scripts/tech-diagram-render.mjs +1537 -0
  75. package/localized/zh-CN/skills/eval_queries.json +160 -0
  76. package/localized/zh-CN/skills/metadata.json +223 -0
  77. package/localized/zh-CN/skills/relations.json +53 -0
  78. package/methods/debug.md +13 -0
  79. package/methods/doc-sync.md +12 -0
  80. package/methods/refactoring.md +16 -0
  81. package/methods/source-driven-development.md +19 -0
  82. package/methods/tdd.md +13 -0
  83. package/package.json +51 -4
  84. package/skills/cc-debug-methodology/SKILL.md +8 -0
  85. package/skills/cc-debug-methodology/references/method.md +13 -0
  86. package/skills/cc-doc-sync-core/SKILL.md +8 -0
  87. package/skills/cc-doc-sync-core/references/method.md +12 -0
  88. package/skills/cc-drawio-studio/SKILL.md +73 -0
  89. package/skills/cc-drawio-studio/data/THIRD_PARTY_NOTICES.md +10 -0
  90. package/skills/cc-drawio-studio/data/brand-icons.json +878 -0
  91. package/skills/cc-drawio-studio/data/shape-index.json +83570 -0
  92. package/skills/cc-drawio-studio/references/data-residency.md +27 -0
  93. package/skills/cc-drawio-studio/references/diagram-patterns.md +60 -0
  94. package/skills/cc-drawio-studio/references/flowchart-quality.md +49 -0
  95. package/skills/cc-drawio-studio/references/layout-and-export.md +72 -0
  96. package/skills/cc-drawio-studio/references/troubleshooting.md +29 -0
  97. package/skills/cc-drawio-studio/references/xml-and-mermaid.md +58 -0
  98. package/skills/cc-drawio-studio/scripts/brand-symbols.mjs +99 -0
  99. package/skills/cc-drawio-studio/scripts/diagram-lint.mjs +205 -0
  100. package/skills/cc-drawio-studio/scripts/diagram-url.mjs +102 -0
  101. package/skills/cc-drawio-studio/scripts/drawio-export.mjs +134 -0
  102. package/skills/cc-drawio-studio/scripts/layout-graph.mjs +107 -0
  103. package/skills/cc-drawio-studio/scripts/png-embed-fix.mjs +26 -0
  104. package/skills/cc-drawio-studio/scripts/scan-go-packages.mjs +36 -0
  105. package/skills/cc-drawio-studio/scripts/scan-js-modules.mjs +52 -0
  106. package/skills/cc-drawio-studio/scripts/scan-python-classes.mjs +30 -0
  107. package/skills/cc-drawio-studio/scripts/scan-python-modules.mjs +55 -0
  108. package/skills/cc-drawio-studio/scripts/scan-rust-modules.mjs +35 -0
  109. package/skills/cc-drawio-studio/scripts/scan-ts-modules.mjs +7 -0
  110. package/skills/cc-drawio-studio/scripts/shape-query.mjs +121 -0
  111. package/skills/cc-drawio-studio/scripts/studio-core.mjs +139 -0
  112. package/skills/cc-drawio-studio/styles/built-in/corporate.json +49 -0
  113. package/skills/cc-drawio-studio/styles/built-in/default.json +49 -0
  114. package/skills/cc-drawio-studio/styles/built-in/handdrawn.json +49 -0
  115. package/skills/cc-drawio-studio/styles/schema.json +112 -0
  116. package/skills/cc-refactoring-core/SKILL.md +8 -0
  117. package/skills/cc-refactoring-core/references/method.md +16 -0
  118. package/skills/cc-source-driven-development/SKILL.md +8 -0
  119. package/skills/cc-source-driven-development/references/method.md +19 -0
  120. package/skills/cc-tdd-methodology/SKILL.md +8 -0
  121. package/skills/cc-tdd-methodology/references/method.md +13 -0
  122. package/skills/cc-technical-diagrams/SKILL.md +34 -0
  123. package/skills/cc-technical-diagrams/assets/interactive-diagram.html +371 -0
  124. package/skills/cc-technical-diagrams/assets/quality-examples/README.md +14 -0
  125. package/skills/cc-technical-diagrams/assets/quality-examples/architecture.json +121 -0
  126. package/skills/cc-technical-diagrams/assets/quality-examples/invalid-explicit.json +41 -0
  127. package/skills/cc-technical-diagrams/assets/quality-examples/sequence.json +53 -0
  128. package/skills/cc-technical-diagrams/assets/quality-examples/sequence.mmd +21 -0
  129. package/skills/cc-technical-diagrams/assets/quality-examples/workflow.json +98 -0
  130. package/skills/cc-technical-diagrams/assets/quality-examples/workflow.mmd +7 -0
  131. package/skills/cc-technical-diagrams/references/diagram-workflows.md +81 -0
  132. package/skills/cc-technical-diagrams/references/html-technical-diagrams.md +243 -0
  133. package/skills/cc-technical-diagrams/references/png-qa-autofix.md +37 -0
  134. package/skills/cc-technical-diagrams/scripts/diagram-browser.mjs +153 -0
  135. package/skills/cc-technical-diagrams/scripts/diagram-layout.mjs +176 -0
  136. package/skills/cc-technical-diagrams/scripts/export-diagram.mjs +332 -0
  137. package/skills/cc-technical-diagrams/scripts/interactive-diagram-server.mjs +654 -0
  138. package/skills/cc-technical-diagrams/scripts/mermaid-render.mjs +64 -0
  139. package/skills/cc-technical-diagrams/scripts/png-qa.mjs +462 -0
  140. package/skills/cc-technical-diagrams/scripts/tech-diagram-render.mjs +1537 -0
  141. package/skills/eval_queries.json +160 -0
  142. package/skills/metadata.json +223 -0
  143. package/skills/relations.json +53 -0
@@ -0,0 +1,160 @@
1
+ {
2
+ "cc-debug-methodology": {
3
+ "should_trigger": [
4
+ "Vite 构建报错 Module not found,帮我排查",
5
+ "页面白屏了,控制台有 TypeError",
6
+ "这个组件渲染结果和预期不一致,帮我 debug",
7
+ "接口返回 500 但前端没展示错误信息",
8
+ "打包后样式丢失,开发环境正常",
9
+ "React 组件 hydration mismatch 怎么定位",
10
+ "HMR 更新后页面状态丢失",
11
+ "排查生产环境偶发性 JS 异常"
12
+ ],
13
+ "should_not_trigger": [
14
+ "给这个模块写单元测试",
15
+ "设计一个新的 React 组件",
16
+ "优化首屏加载性能",
17
+ "做前端安全审查",
18
+ "升级 TypeScript 到最新版本",
19
+ "重构这个 hooks 的逻辑",
20
+ "写一个 Playwright E2E 测试",
21
+ "给这个 API 设计类型定义"
22
+ ]
23
+ },
24
+ "cc-doc-sync-core": {
25
+ "should_trigger": [
26
+ "同步 README 中的 skill 和 agent 数量",
27
+ "新增命令后更新多语言文档",
28
+ "根据 package.json 生成命令清单",
29
+ "同步 runtime 文档",
30
+ "更新 marketplace 描述里的能力数量",
31
+ "检查 README 和 skills metadata 是否一致",
32
+ "把报告输出表同步到文档",
33
+ "更新项目结构文档中的 commands 列表"
34
+ ],
35
+ "should_not_trigger": [
36
+ "给组件写 Storybook stories",
37
+ "修复 TypeScript 构建失败",
38
+ "写登录 E2E 测试",
39
+ "审查 XSS 风险",
40
+ "规划 React 组件边界",
41
+ "清理未使用导出",
42
+ "实现 PWA manifest",
43
+ "优化虚拟列表滚动"
44
+ ]
45
+ },
46
+ "cc-drawio-studio": {
47
+ "should_trigger": [
48
+ "生成一个可编辑的 draw.io 架构图并导出 PNG",
49
+ "把这个微服务系统画成 .drawio 文件",
50
+ "用 diagrams.net 做 ER 图,要求后续能编辑",
51
+ "查一下 AWS Lambda 在 draw.io 里的官方 shape style",
52
+ "给这个 TypeScript 项目生成模块依赖图并自动布局",
53
+ "生成 UML 类图并用 draw.io CLI 导出 SVG",
54
+ "draw.io 自动布局一个超过 20 个节点的服务拓扑",
55
+ "用 Graphviz 布局后生成 diagrams.net 编辑链接",
56
+ "制作可编辑序列图并检查 .drawio 是否有断边",
57
+ "用官方云形状创建可编辑 draw.io 架构图"
58
+ ],
59
+ "should_not_trigger": [
60
+ "生成一张产品宣传海报图片",
61
+ "编辑这张照片并替换背景",
62
+ "实现 Three.js 交互式 3D 拓扑图",
63
+ "给 SVG logo 加路径描边动画",
64
+ "只写 Mermaid 到 README 中",
65
+ "按 Figma 设计稿实现页面",
66
+ "检查 dashboard 的按钮 hover 状态",
67
+ "用 Playwright 截图做视觉回归",
68
+ "优化 Canvas 粒子动画性能",
69
+ "生成漫画头像和品牌板"
70
+ ]
71
+ },
72
+ "cc-refactoring-core": {
73
+ "should_trigger": [
74
+ "保持行为不变,重构这个前端模块。",
75
+ "这个函数只做结构调整,每一步都验证,不改输出和副作用。",
76
+ "给这个 React 功能做保持行为重构,并设置差异预算。",
77
+ "这个 Vue composable 只优化结构,不增加新功能。",
78
+ "按 SAFE/CAUTION/DANGER 给这次重构分级并小步执行。",
79
+ "先建立绿色基线,再重构这个 TypeScript service,最后回到绿色。",
80
+ "为这次保持行为重构设置回滚边界。",
81
+ "按一次一个重构手法执行并给出最终证明。"
82
+ ],
83
+ "should_not_trigger": [
84
+ "删除没用的 React 组件和 npm 依赖。",
85
+ "修复这个会发两次请求的 bug。",
86
+ "把 Redux 迁移到 Zustand。",
87
+ "审查这个 PR 是否可以合并。",
88
+ "排查为什么这个页面白屏。",
89
+ "用 TDD 新增支付功能。",
90
+ "把 Vite 升级并处理 breaking changes。",
91
+ "按 Figma 新增一个响应式页面。"
92
+ ]
93
+ },
94
+ "cc-source-driven-development": {
95
+ "should_trigger": [
96
+ "这个 Next.js 新版本 API 先查官方文档再决定",
97
+ "帮我确认 Vite 配置项当前版本是否还推荐",
98
+ "这个浏览器 API 兼容性要以规范和 MDN 为准",
99
+ "为前端库迁移做事实源驱动决策",
100
+ "React Router 版本差异需要查文档",
101
+ "这个包的 ESM/CJS 行为不要凭记忆判断",
102
+ "按项目源码和官方 docs 设计公共接口",
103
+ "验证 Nuxt useFetch 最新推荐用法"
104
+ ],
105
+ "should_not_trigger": [
106
+ "给表单写 Zod 校验",
107
+ "优化大列表虚拟滚动",
108
+ "运行 npm test 并修复失败",
109
+ "检查按钮 aria-label",
110
+ "写 Playwright 登录流程",
111
+ "清理未使用依赖",
112
+ "设计 UI 视觉方向",
113
+ "审查 token 存储安全"
114
+ ]
115
+ },
116
+ "cc-tdd-methodology": {
117
+ "should_trigger": [
118
+ "用 TDD 实现这个 hook",
119
+ "先写失败测试再修这个 bug",
120
+ "为新组件走红绿重构流程",
121
+ "补一个回归测试再改逻辑",
122
+ "用测试驱动开发这个前端功能",
123
+ "这个工具函数先写单测再实现",
124
+ "修复表单校验 bug 前先复现测试",
125
+ "用测试驱动方式重构状态逻辑"
126
+ ],
127
+ "should_not_trigger": [
128
+ "只运行现有测试并修复失败",
129
+ "制定测试分层策略",
130
+ "写完整 Playwright E2E 流程",
131
+ "同步文档能力表",
132
+ "清理未使用依赖",
133
+ "做 XSS 安全审查",
134
+ "设计 Vue 项目结构",
135
+ "配置 PWA 离线缓存"
136
+ ]
137
+ },
138
+ "cc-technical-diagrams": {
139
+ "should_trigger": [
140
+ "绘制后台任务生命周期并保留可编辑源",
141
+ "把架构 JSON 渲染为自包含 HTML",
142
+ "绘制 API 和数据库事务序列图",
143
+ "展示 Agent 记忆检索流程并标注箭头语义",
144
+ "检查技术图 PNG 中的文本裁切",
145
+ "渲染含决策和回退边的工作流",
146
+ "创建服务依赖的本地交互预览",
147
+ "导出 SVG 时保留所有数据流标签"
148
+ ],
149
+ "should_not_trigger": [
150
+ "生成产品摄影图",
151
+ "编辑头像背景",
152
+ "构建 React 组件",
153
+ "优化数据库查询",
154
+ "修复 Rust 编译错误",
155
+ "审查权限逻辑",
156
+ "编写 CLI 单元测试",
157
+ "润色营销文案"
158
+ ]
159
+ }
160
+ }
@@ -0,0 +1,223 @@
1
+ [
2
+ {
3
+ "id": "cc-debug-methodology",
4
+ "name": "证据驱动诊断",
5
+ "category": "review-quality",
6
+ "tags": [
7
+ "debug",
8
+ "evidence",
9
+ "root-cause"
10
+ ],
11
+ "summary": "证据驱动诊断",
12
+ "version": "1.0.0",
13
+ "license": "MIT",
14
+ "homepage": "https://github.com/bovinphang/craft-common",
15
+ "repository": "https://github.com/bovinphang/craft-common",
16
+ "keywords": [
17
+ "review-quality",
18
+ "debug",
19
+ "evidence",
20
+ "root-cause"
21
+ ],
22
+ "platforms": [
23
+ "skills-cli",
24
+ "skillreg",
25
+ "claude-code",
26
+ "codex",
27
+ "cursor",
28
+ "opencode",
29
+ "openclaw",
30
+ "generic-skill-runtime"
31
+ ]
32
+ },
33
+ {
34
+ "id": "cc-doc-sync-core",
35
+ "name": "文档事实同步",
36
+ "category": "maintenance-docs",
37
+ "tags": [
38
+ "documentation",
39
+ "source-of-truth",
40
+ "i18n"
41
+ ],
42
+ "summary": "文档事实同步",
43
+ "version": "1.0.0",
44
+ "license": "MIT",
45
+ "homepage": "https://github.com/bovinphang/craft-common",
46
+ "repository": "https://github.com/bovinphang/craft-common",
47
+ "keywords": [
48
+ "maintenance-docs",
49
+ "documentation",
50
+ "source-of-truth",
51
+ "i18n"
52
+ ],
53
+ "platforms": [
54
+ "skills-cli",
55
+ "skillreg",
56
+ "claude-code",
57
+ "codex",
58
+ "cursor",
59
+ "opencode",
60
+ "openclaw",
61
+ "generic-skill-runtime"
62
+ ]
63
+ },
64
+ {
65
+ "id": "cc-drawio-studio",
66
+ "name": "可编辑技术图",
67
+ "category": "implementation-capability",
68
+ "tags": [
69
+ "drawio",
70
+ "uml",
71
+ "erd",
72
+ "architecture"
73
+ ],
74
+ "summary": "可编辑技术图",
75
+ "version": "1.0.0",
76
+ "license": "MIT",
77
+ "homepage": "https://github.com/bovinphang/craft-common",
78
+ "repository": "https://github.com/bovinphang/craft-common",
79
+ "keywords": [
80
+ "implementation-capability",
81
+ "drawio",
82
+ "uml",
83
+ "erd",
84
+ "architecture"
85
+ ],
86
+ "platforms": [
87
+ "skills-cli",
88
+ "skillreg",
89
+ "claude-code",
90
+ "codex",
91
+ "cursor",
92
+ "opencode",
93
+ "openclaw",
94
+ "generic-skill-runtime"
95
+ ]
96
+ },
97
+ {
98
+ "id": "cc-refactoring-core",
99
+ "name": "保持行为的重构",
100
+ "category": "project-evolution",
101
+ "tags": [
102
+ "refactoring",
103
+ "behavior-preservation",
104
+ "baseline"
105
+ ],
106
+ "summary": "保持行为的重构",
107
+ "version": "1.0.0",
108
+ "license": "MIT",
109
+ "homepage": "https://github.com/bovinphang/craft-common",
110
+ "repository": "https://github.com/bovinphang/craft-common",
111
+ "keywords": [
112
+ "project-evolution",
113
+ "refactoring",
114
+ "behavior-preservation",
115
+ "baseline"
116
+ ],
117
+ "platforms": [
118
+ "skills-cli",
119
+ "skillreg",
120
+ "claude-code",
121
+ "codex",
122
+ "cursor",
123
+ "opencode",
124
+ "openclaw",
125
+ "generic-skill-runtime"
126
+ ]
127
+ },
128
+ {
129
+ "id": "cc-source-driven-development",
130
+ "name": "以事实来源驱动开发",
131
+ "category": "project-standard",
132
+ "tags": [
133
+ "official-docs",
134
+ "versioning",
135
+ "local-knowledge"
136
+ ],
137
+ "summary": "以事实来源驱动开发",
138
+ "version": "1.0.0",
139
+ "license": "MIT",
140
+ "homepage": "https://github.com/bovinphang/craft-common",
141
+ "repository": "https://github.com/bovinphang/craft-common",
142
+ "keywords": [
143
+ "project-standard",
144
+ "official-docs",
145
+ "versioning",
146
+ "local-knowledge"
147
+ ],
148
+ "platforms": [
149
+ "skills-cli",
150
+ "skillreg",
151
+ "claude-code",
152
+ "codex",
153
+ "cursor",
154
+ "opencode",
155
+ "openclaw",
156
+ "generic-skill-runtime"
157
+ ]
158
+ },
159
+ {
160
+ "id": "cc-tdd-methodology",
161
+ "name": "测试驱动开发",
162
+ "category": "testing",
163
+ "tags": [
164
+ "tdd",
165
+ "regression",
166
+ "red-green-refactor"
167
+ ],
168
+ "summary": "测试驱动开发",
169
+ "version": "1.0.0",
170
+ "license": "MIT",
171
+ "homepage": "https://github.com/bovinphang/craft-common",
172
+ "repository": "https://github.com/bovinphang/craft-common",
173
+ "keywords": [
174
+ "testing",
175
+ "tdd",
176
+ "regression",
177
+ "red-green-refactor"
178
+ ],
179
+ "platforms": [
180
+ "skills-cli",
181
+ "skillreg",
182
+ "claude-code",
183
+ "codex",
184
+ "cursor",
185
+ "opencode",
186
+ "openclaw",
187
+ "generic-skill-runtime"
188
+ ]
189
+ },
190
+ {
191
+ "id": "cc-technical-diagrams",
192
+ "name": "结构化技术图表",
193
+ "category": "implementation-capability",
194
+ "tags": [
195
+ "architecture",
196
+ "sequence",
197
+ "workflow",
198
+ "png-qa"
199
+ ],
200
+ "summary": "结构化技术图表",
201
+ "version": "1.0.0",
202
+ "license": "MIT",
203
+ "homepage": "https://github.com/bovinphang/craft-common",
204
+ "repository": "https://github.com/bovinphang/craft-common",
205
+ "keywords": [
206
+ "implementation-capability",
207
+ "architecture",
208
+ "sequence",
209
+ "workflow",
210
+ "png-qa"
211
+ ],
212
+ "platforms": [
213
+ "skills-cli",
214
+ "skillreg",
215
+ "claude-code",
216
+ "codex",
217
+ "cursor",
218
+ "opencode",
219
+ "openclaw",
220
+ "generic-skill-runtime"
221
+ ]
222
+ }
223
+ ]
@@ -0,0 +1,53 @@
1
+ {
2
+ "cc-debug-methodology": {
3
+ "capabilityTags": [
4
+ "debug",
5
+ "evidence",
6
+ "root-cause"
7
+ ]
8
+ },
9
+ "cc-doc-sync-core": {
10
+ "capabilityTags": [
11
+ "documentation",
12
+ "source-of-truth",
13
+ "i18n"
14
+ ]
15
+ },
16
+ "cc-drawio-studio": {
17
+ "capabilityTags": [
18
+ "drawio",
19
+ "uml",
20
+ "erd",
21
+ "architecture"
22
+ ]
23
+ },
24
+ "cc-refactoring-core": {
25
+ "capabilityTags": [
26
+ "refactoring",
27
+ "behavior-preservation",
28
+ "baseline"
29
+ ]
30
+ },
31
+ "cc-source-driven-development": {
32
+ "capabilityTags": [
33
+ "official-docs",
34
+ "versioning",
35
+ "local-knowledge"
36
+ ]
37
+ },
38
+ "cc-tdd-methodology": {
39
+ "capabilityTags": [
40
+ "tdd",
41
+ "regression",
42
+ "red-green-refactor"
43
+ ]
44
+ },
45
+ "cc-technical-diagrams": {
46
+ "capabilityTags": [
47
+ "architecture",
48
+ "sequence",
49
+ "workflow",
50
+ "png-qa"
51
+ ]
52
+ }
53
+ }
@@ -0,0 +1,13 @@
1
+ # Evidence-driven diagnosis
2
+
3
+ Use five steps to establish a root cause before applying a fix.
4
+
5
+ 1. **Classify:** describe the observable failure, impact, version, environment and minimal reproduction. Identify the relevant subsystem using project evidence. Cross-layer failures start from the visible symptom and trace across boundaries.
6
+ 2. **Collect:** reproduce with the smallest failing command or operation; collect necessary logs, traces, state, configuration and recent changes. Redact credentials and sensitive payloads. A domain adapter supplies stack-specific probes.
7
+ 3. **Hypothesize:** keep at most three hypotheses ranked by evidence. Each states "X causes Y; Z can confirm or falsify it." Do not substitute a symptom or speculative repair for a cause.
8
+ 4. **Verify:** vary one factor at a time, start with the strongest hypothesis and record confirmed/falsified/pending. If all are falsified, collect more evidence. Three consecutive failed verifications of the same hypothesis require reporting the block rather than repeating it.
9
+ 5. **Fix and validate:** apply the smallest confirmed repair, preserve a regression reproduction and run affected then broader existing checks. Report baseline failures separately; do not disable tests or weaken validation to claim success.
10
+
11
+ For dependency or environment failures, compare exact toolchain/dependency versions, lockfile and CI/local differences before upgrading packages. Keep migrations separate from ordinary defect repairs. Avoid adding retries, changing timeouts or suppressing errors without proving the cause and the intended semantics.
12
+
13
+ Deliver `reports/debug-YYYY-MM-DD-HHmmss.md` with symptom and reproduction, evidence, hypothesis/result table, root cause, modified files/behavior, executed verification, residual risk and the next useful action. Do not claim a fix or a green suite without observed results.
@@ -0,0 +1,12 @@
1
+ # Documentation synchronization
2
+
3
+ Synchronize public documentation from implementation facts, not from the desired design.
4
+
5
+ 1. Identify the repository stack, document entry points and requested scope. Include root READMEs, nested package/application/runtime READMEs and deployment guides; exclude dependencies, generated outputs and third-party directories.
6
+ 2. Collect authoritative project sources: manifests/lockfiles, configuration, env examples, commands, schemas, public APIs, tests, CI, build and deployment files. Use sources for the actual stack rather than require a particular language's manifest.
7
+ 3. Compare commands, environment variable names, paths, versions, API behavior, capabilities, setup and deployment instructions. Keep only stable public facts; do not present proposals or experimental designs as supported behavior.
8
+ 4. Check every existing language entry. Public identifiers, commands, version constraints, support matrices, report paths and examples must agree. Translate prose according to the existing convention; explicitly report translations requiring human review.
9
+ 5. Update affected README/docs/ADR/changelog and user-facing metadata together. An ADR records context, decision, alternatives, impact, verification and rollback clues; it is not a full review report.
10
+ 6. Run the project's existing consistency checks, relevant type/tests/build or packaging checks and legacy-reference search. Record each checked document, source of truth, updated language, unchanged entry and unresolved uncertainty.
11
+
12
+ Do not invent commands or environment variables, overwrite private documents outside the requested scope, or replace a README with internal implementation details. A successful prose edit alone does not prove factual consistency.
@@ -0,0 +1,16 @@
1
+ # Behavior-preserving refactoring
2
+
3
+ Refactoring changes internal organization while preserving the observable contract. Use GREEN → REFACTOR → GREEN; do not manufacture a failing behavioral requirement for a structural change.
4
+
5
+ 1. Classify whether this is structural work, a new behavior, a defect fix, or a dependency migration. Keep behavior changes in a separate workflow.
6
+ 2. Read affected implementation, callers, exports, registration, persistence and tests. Define observable results, errors, side effects and ordering, state transitions, public names and protocols before editing.
7
+ 3. Establish the green baseline or record existing failures. If a relevant behavior lacks coverage, add characterization tests that describe current behavior; these may start green.
8
+ 4. Diagnose structural evidence and check false positives. Line count and complexity metrics alone do not justify a rewrite. Prefer the smallest safe, reversible transformation.
9
+ 5. Plan prerequisite steps. Each records target, structural intent, technique, risk, expected files/functions, expected public API/behavior changes (zero for pure refactoring), verification and rollback boundary.
10
+ 6. Change one primary structural concern, then run the nearest meaningful check and inspect the diff. Stop and reassess if the actual scope exceeds the planned diff budget.
11
+ 7. A new regression invalidates the current step: restore only that step, verify the previous baseline and shrink or reorder the transformation before retrying. Do not revert unrelated user edits or spread repairs across unrelated modules.
12
+ 8. Broaden verification as the changed contract requires: local/static checks, unit/integration, full lint/types/tests, build and relevant specialty checks. Use existing project tools rather than impose a framework.
13
+
14
+ Risk is contextual: SAFE for local/private changes with strong evidence; CAUTION for cross-module/shared-state/lifecycle changes; DANGER for public APIs, schemas, persistence, authentication, permission, protocols or architecture-wide changes. A technique name alone never makes a change safe.
15
+
16
+ Deliver a proof verdict: PASS when the relevant behavior is adequately covered and checks pass; PARTIAL when checks pass but coverage has important gaps; NOT PROVEN when evidence or environment prevents a credible preservation claim. Include executed commands, rollback decisions and remaining risks.
@@ -0,0 +1,19 @@
1
+ # Source-driven development
2
+
3
+ Use project facts, authoritative sources and version-specific evidence to make engineering decisions.
4
+
5
+ 1. Establish the question, affected version and local contract. Read the project's manifests, configuration, implementation, callers and tests before proposing changes. Stable local transformations can rely on those facts; changing runtime, package or public API assumptions need authoritative verification.
6
+ 2. Collect official documentation, source, type definitions, release notes, specifications and migration guides for the actual version. Third-party discussions provide clues, not the final basis. Record source paths/URLs, versions, dates and relevant conclusions.
7
+ 3. Compare recommendations with the running project. State compatibility, maintenance cost, migration scope and rollback. Isolate unstable external assumptions behind a small boundary; do not overturn stable conventions just to use a newer pattern.
8
+ 4. Prove key assumptions using the project's existing checks or a minimal reproduction. Select checks for the actual stack. Record commands and observed outcomes; if verification is unavailable, report the uncertainty rather than claim support.
9
+ 5. Update a lightweight ADR, migration record or factual documentation when public interfaces, dependencies or team conventions change. Do not copy long external documents.
10
+
11
+ ## Local knowledge requests
12
+
13
+ When a user restricts evidence to a local repository or knowledge directory, search that source first and do not fill gaps with online guesses. Use the explicit path, otherwise check whether `knowledge/` exists. If absent, identify the missing source instead of inventing one.
14
+
15
+ Read `data_structure.md` navigation where available, choose relevant branches, and search progressively instead of loading the entire corpus. Default to at most five keyword refinement rounds. Record file paths, sections/pages/sheets, version range and evidence gaps. For PDF or spreadsheets choose an appropriate extraction tool before reading large content. Use external sources only when the user's scope permits them.
16
+
17
+ ## Evidence priority and delivery
18
+
19
+ Project implementation/configuration/tests establish the local contract; official versioned documentation/source establishes external behavior; specifications establish platform constraints; issues and articles only supplement these. Deliver the decision, sources, implementation impact, verification results and remaining uncertainty. "Checked the docs" without traceable evidence is insufficient.
package/methods/tdd.md ADDED
@@ -0,0 +1,13 @@
1
+ # Test-driven development
2
+
3
+ For new behavior and behavior-changing defect fixes use RED → GREEN → REFACTOR. The test describes an observable contract, not private implementation structure.
4
+
5
+ 1. Identify one behavior: inputs, output/error, state transition or externally observable side effect. Choose the closest meaningful test level using existing project tooling.
6
+ 2. Write the smallest test that distinguishes the missing or wrong behavior. Run it first and observe failure for the expected behavior, not a syntax, import or environment problem. For a defect, the test must fail against the original defect.
7
+ 3. Implement only enough to pass that test. Do not refactor during the red phase or add unrelated features.
8
+ 4. Run the test and relevant surrounding tests, then improve naming and structure while preserving green. New requirements enter the next cycle.
9
+ 5. Report the observed red/green commands, covered behavior and untested boundaries. Do not infer success from a diff or unexecuted tests.
10
+
11
+ Pure structural refactoring has a different contract: establish current behavior through existing or characterization coverage and keep GREEN → REFACTOR → GREEN. Do not invent a failure merely to satisfy a ritual.
12
+
13
+ Test logic close to the risk; use integration tests for real boundaries and end-to-end tests for journeys that need them. Do not make E2E the default or assert fragile private state. Do not introduce a new testing framework merely for TDD. If infrastructure is absent, explain the minimum test setup and obtain a decision before introducing it; use the actual stack rather than require frontend tools.
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "@bovinphang/craft-common",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Craft AI Coding 的公共技能、研发方法与共享安装协议",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/bovinphang/craft-common"
10
+ },
11
+ "homepage": "https://github.com/bovinphang/craft-common",
12
+ "engines": {
13
+ "node": ">=22.0.0"
14
+ },
15
+ "packageManager": "pnpm@12.4.1",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "docs/consuming-common.md",
24
+ "dist",
25
+ "skills",
26
+ "localized",
27
+ "methods",
28
+ "LICENSE",
29
+ "README.md"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "scripts": {
35
+ "sync:methods": "tsx scripts/sync-methods.ts",
36
+ "pack:skills": "tsx scripts/pack-skills.ts",
37
+ "lint": "eslint src scripts tests eslint.config.mjs --max-warnings=0",
38
+ "typecheck": "tsc --noEmit -p tsconfig.json",
39
+ "test": "tsx scripts/run-tests.ts",
40
+ "build": "pnpm typecheck && tsx scripts/build.ts && tsc -p tsconfig.build.json",
41
+ "prepack": "pnpm build"
42
+ },
43
+ "devDependencies": {
44
+ "@eslint/js": "9.39.5",
45
+ "@types/node": "^22.19.15",
46
+ "esbuild": "^0.28.0",
47
+ "eslint": "9.39.4",
48
+ "globals": "17.12.0",
49
+ "tsx": "^4.22.3",
50
+ "typescript": "^5.7.3",
51
+ "typescript-eslint": "8.70.1"
52
+ }
53
+ }
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: cc-debug-methodology
3
+ description: Use when diagnosing unexplained engineering failures, build errors, service exceptions, inconsistent data, or cross-layer faults before selecting a repair.
4
+ ---
5
+
6
+ # Evidence-driven diagnosis
7
+
8
+ Read and follow the [shared method](references/method.md). Select project-specific tools and domain checks from the actual repository; this workflow does not require a frontend stack.
@@ -0,0 +1,13 @@
1
+ # Evidence-driven diagnosis
2
+
3
+ Use five steps to establish a root cause before applying a fix.
4
+
5
+ 1. **Classify:** describe the observable failure, impact, version, environment and minimal reproduction. Identify the relevant subsystem using project evidence. Cross-layer failures start from the visible symptom and trace across boundaries.
6
+ 2. **Collect:** reproduce with the smallest failing command or operation; collect necessary logs, traces, state, configuration and recent changes. Redact credentials and sensitive payloads. A domain adapter supplies stack-specific probes.
7
+ 3. **Hypothesize:** keep at most three hypotheses ranked by evidence. Each states "X causes Y; Z can confirm or falsify it." Do not substitute a symptom or speculative repair for a cause.
8
+ 4. **Verify:** vary one factor at a time, start with the strongest hypothesis and record confirmed/falsified/pending. If all are falsified, collect more evidence. Three consecutive failed verifications of the same hypothesis require reporting the block rather than repeating it.
9
+ 5. **Fix and validate:** apply the smallest confirmed repair, preserve a regression reproduction and run affected then broader existing checks. Report baseline failures separately; do not disable tests or weaken validation to claim success.
10
+
11
+ For dependency or environment failures, compare exact toolchain/dependency versions, lockfile and CI/local differences before upgrading packages. Keep migrations separate from ordinary defect repairs. Avoid adding retries, changing timeouts or suppressing errors without proving the cause and the intended semantics.
12
+
13
+ Deliver `reports/debug-YYYY-MM-DD-HHmmss.md` with symptom and reproduction, evidence, hypothesis/result table, root cause, modified files/behavior, executed verification, residual risk and the next useful action. Do not claim a fix or a green suite without observed results.
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: cc-doc-sync-core
3
+ description: Use when project documentation, multilingual READMEs, setup instructions, CLI usage, or public capability descriptions drift from implementation, configuration, tests, or release metadata.
4
+ ---
5
+
6
+ # Documentation synchronization
7
+
8
+ Read and follow the [shared method](references/method.md). Select project-specific tools and domain checks from the actual repository; this workflow does not require a frontend stack.
@@ -0,0 +1,12 @@
1
+ # Documentation synchronization
2
+
3
+ Synchronize public documentation from implementation facts, not from the desired design.
4
+
5
+ 1. Identify the repository stack, document entry points and requested scope. Include root READMEs, nested package/application/runtime READMEs and deployment guides; exclude dependencies, generated outputs and third-party directories.
6
+ 2. Collect authoritative project sources: manifests/lockfiles, configuration, env examples, commands, schemas, public APIs, tests, CI, build and deployment files. Use sources for the actual stack rather than require a particular language's manifest.
7
+ 3. Compare commands, environment variable names, paths, versions, API behavior, capabilities, setup and deployment instructions. Keep only stable public facts; do not present proposals or experimental designs as supported behavior.
8
+ 4. Check every existing language entry. Public identifiers, commands, version constraints, support matrices, report paths and examples must agree. Translate prose according to the existing convention; explicitly report translations requiring human review.
9
+ 5. Update affected README/docs/ADR/changelog and user-facing metadata together. An ADR records context, decision, alternatives, impact, verification and rollback clues; it is not a full review report.
10
+ 6. Run the project's existing consistency checks, relevant type/tests/build or packaging checks and legacy-reference search. Record each checked document, source of truth, updated language, unchanged entry and unresolved uncertainty.
11
+
12
+ Do not invent commands or environment variables, overwrite private documents outside the requested scope, or replace a README with internal implementation details. A successful prose edit alone does not prove factual consistency.