huhaa-myskills 0.1.5

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 (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +384 -0
  3. package/docs/GUIDE.md +190 -0
  4. package/docs/PLAN.md +359 -0
  5. package/docs/RULES.md +329 -0
  6. package/docs/RUNBOOK-myskills.md +258 -0
  7. package/docs/SYNC-SKILLS.md +259 -0
  8. package/docs/releases/README.md +47 -0
  9. package/docs/releases/v0.1.0.md +256 -0
  10. package/docs/releases/v0.1.1.md +297 -0
  11. package/docs/releases/v0.1.2.md +207 -0
  12. package/docs/releases/v0.1.3.md +269 -0
  13. package/docs/todo/v0.1.2.md +98 -0
  14. package/docs/todo/v0.1.3.md +40 -0
  15. package/docs/todo/v0.1.4.md +36 -0
  16. package/docs/todo/v0.1.5.md +41 -0
  17. package/docs/todo/v0.1.6.md +43 -0
  18. package/docs/todo/v0.1.7.md +38 -0
  19. package/docs/todo/v0.1.8.md +36 -0
  20. package/docs/todo/v0.1.9.md +54 -0
  21. package/install-and-sync.sh +209 -0
  22. package/package.json +68 -0
  23. package/service/bin/huhaa-myskills.mjs +314 -0
  24. package/service/bin/lib/paths.mjs +57 -0
  25. package/service/bin/lib/port.mjs +23 -0
  26. package/service/config/sources.example.yaml +121 -0
  27. package/service/packages/scanner/src/adapters/file-docs.mjs +158 -0
  28. package/service/packages/scanner/src/adapters/hermes-plugin.mjs +149 -0
  29. package/service/packages/scanner/src/adapters/markdown-skill.mjs +219 -0
  30. package/service/packages/scanner/src/adapters/mcp-config.mjs +171 -0
  31. package/service/packages/scanner/src/index.mjs +234 -0
  32. package/service/packages/scanner/src/types.d.ts +88 -0
  33. package/service/packages/scanner/src/utils.mjs +186 -0
  34. package/service/packages/server/src/index.mjs +549 -0
  35. package/service/packages/web/README.md +5 -0
  36. package/service/packages/web/dist/assets/index-CTh5OdBd.js +36 -0
  37. package/service/packages/web/dist/assets/index-CtoiGnQ7.css +1 -0
  38. package/service/packages/web/dist/index.html +13 -0
  39. package/service/scripts/build-web.mjs +29 -0
  40. package/service/scripts/prepare-publish.mjs +44 -0
  41. package/service/scripts/restore-publish.mjs +17 -0
  42. package/service/scripts/sync-skills.sh +427 -0
  43. package/service/scripts/verify.mjs +132 -0
@@ -0,0 +1,258 @@
1
+ # RUNBOOK: HuHaa-MySkills
2
+
3
+ This runbook is the production/operator note for the local HuHaa-MySkills service.
4
+
5
+ ## Service identity
6
+
7
+ - Name: HuHaa-MySkills
8
+ - Purpose: local browser catalog for AI-agent skills, plugins, MCP configs, and runbooks
9
+ - Default URL: `http://127.0.0.1:11520`
10
+ - Default data dir: `~/.config/huhaa-myskills/`
11
+ - Override data dir: `HUHAA_HOME=/path/to/dir`
12
+ - Default preferred port: `11520`
13
+ - Override port: `PORT=11530`
14
+ - Bind address: `127.0.0.1` only
15
+
16
+ ## Main commands
17
+
18
+ ```bash
19
+ npm install
20
+ npm run init
21
+ npm start
22
+ npm test
23
+ npm run verify
24
+ npm run purge
25
+ ```
26
+
27
+ ## Files and directories
28
+
29
+ Runtime/user data:
30
+
31
+ ```text
32
+ ~/.config/huhaa-myskills/sources.yaml
33
+ ~/.config/huhaa-myskills/cache.json
34
+ ~/.config/huhaa-myskills/state.json
35
+ ```
36
+
37
+ Repository layout:
38
+
39
+ ```text
40
+ service/bin/huhaa-myskills.mjs
41
+ service/config/sources.example.yaml
42
+ service/packages/scanner/src/index.mjs
43
+ service/packages/server/src/index.mjs
44
+ service/packages/web/src/App.vue
45
+ service/scripts/verify.mjs
46
+ ```
47
+
48
+ ## Healthy state
49
+
50
+ ```bash
51
+ curl -s http://127.0.0.1:11520/api/health
52
+ ```
53
+
54
+ Expected shape:
55
+
56
+ ```json
57
+ {"ok":true,"port":11520,"items":188,"version":"0.1.0","phase":"P6"}
58
+ ```
59
+
60
+ The exact `items` count depends on local sources.
61
+
62
+ ## Full verification
63
+
64
+ ```bash
65
+ npm run verify
66
+ ```
67
+
68
+ Expected final line:
69
+
70
+ ```text
71
+ [verify] PASS build + tests + HTTP/API/static smoke checks
72
+ ```
73
+
74
+ The verify script proves:
75
+
76
+ 1. Vue SPA builds.
77
+ 2. Scanner/server tests pass.
78
+ 3. A real Fastify server starts on loopback.
79
+ 4. `/api/health`, `/api/skills`, `/api/skills/:id`, `/api/stats`, and `/api/reload` work.
80
+ 5. Built JS/CSS assets are served with correct content types.
81
+ 6. Temporary runtime data is removed.
82
+
83
+ ## Troubleshooting
84
+
85
+ ### Page does not open
86
+
87
+ Check service:
88
+
89
+ ```bash
90
+ curl -s http://127.0.0.1:11520/api/health
91
+ ```
92
+
93
+ If it fails, start manually:
94
+
95
+ ```bash
96
+ npm start
97
+ ```
98
+
99
+ If port is busy:
100
+
101
+ ```bash
102
+ PORT=11530 npm start
103
+ ```
104
+
105
+ The CLI will also try fallback ports when the preferred port is unavailable.
106
+
107
+ ### Page opens but is blank
108
+
109
+ Build assets:
110
+
111
+ ```bash
112
+ npm run build:web
113
+ npm start
114
+ ```
115
+
116
+ Check static assets from `index.html`:
117
+
118
+ ```bash
119
+ curl -I http://127.0.0.1:11520/
120
+ curl -I http://127.0.0.1:11520/assets/<asset>.js
121
+ curl -I http://127.0.0.1:11520/assets/<asset>.css
122
+ ```
123
+
124
+ Expected content types:
125
+
126
+ ```text
127
+ text/html; charset=utf-8
128
+ text/javascript; charset=utf-8
129
+ text/css; charset=utf-8
130
+ ```
131
+
132
+ ### No skills or too few skills
133
+
134
+ Check config:
135
+
136
+ ```bash
137
+ sed -n '1,220p' ~/.config/huhaa-myskills/sources.yaml
138
+ ```
139
+
140
+ Run scan debug:
141
+
142
+ ```bash
143
+ HUHAA_DEBUG=1 npm run scan >/tmp/huhaa-skills.json
144
+ ```
145
+
146
+ Common causes:
147
+
148
+ - source root path does not exist
149
+ - source is disabled
150
+ - file is larger than `limits.maxFileBytes`
151
+ - glob does not match the target file
152
+ - project runbooks are outside configured roots
153
+
154
+ ### MCP secrets appear in UI
155
+
156
+ They should not. Verify using tests:
157
+
158
+ ```bash
159
+ npm test
160
+ ```
161
+
162
+ Specific redaction behavior lives in:
163
+
164
+ ```text
165
+ service/packages/scanner/src/adapters/mcp-config.mjs
166
+ ```
167
+
168
+ The adapter redacts keys matching token/key/secret/password/auth/cookie-style names and common inline secret patterns before writing `raw` or `preview`.
169
+
170
+ ### Reload does not update page
171
+
172
+ Manual reload:
173
+
174
+ ```bash
175
+ curl -s -X POST http://127.0.0.1:11520/api/reload
176
+ curl -s http://127.0.0.1:11520/api/reload-state
177
+ ```
178
+
179
+ Watch events endpoint:
180
+
181
+ ```bash
182
+ curl -N http://127.0.0.1:11520/api/events
183
+ ```
184
+
185
+ If watcher is unreliable on a synced/cloud directory, use manual reload. The server never clears the old snapshot on reload failure; it keeps the last good data.
186
+
187
+ ### Copy buttons do not work
188
+
189
+ On macOS, copy uses `pbcopy` on the server side.
190
+
191
+ Check:
192
+
193
+ ```bash
194
+ command -v pbcopy
195
+ ```
196
+
197
+ The tests use a fake temporary `pbcopy` and do not touch the real clipboard.
198
+
199
+ ### Open in Cursor does not work
200
+
201
+ Check Cursor CLI:
202
+
203
+ ```bash
204
+ command -v cursor
205
+ ```
206
+
207
+ If missing, install Cursor shell command from Cursor itself, or use the path copy/reveal buttons instead.
208
+
209
+ ### Finder reveal does not work
210
+
211
+ Finder reveal uses:
212
+
213
+ ```bash
214
+ open -R <path>
215
+ ```
216
+
217
+ This is macOS-only.
218
+
219
+ ## Public release checklist
220
+
221
+ Before pushing a public repository:
222
+
223
+ ```bash
224
+ npm run verify
225
+ ```
226
+
227
+ Then check ignored/generated files:
228
+
229
+ ```bash
230
+ git status --short
231
+ git check-ignore -v node_modules service/packages/web/dist 2>/dev/null || true
232
+ ```
233
+
234
+ Check for obvious secrets outside ignored directories:
235
+
236
+ ```bash
237
+ git grep -n -E '(ghp_|sk-[A-Za-z0-9_-]{12,}|Bearer [A-Za-z0-9._~+/=-]{12,}|API[_-]?KEY|SECRET|PASSWORD|TOKEN)' -- . ':!service/packages/scanner/test/scanner.test.mjs'
238
+ ```
239
+
240
+ Expected matches should be code patterns/documentation only, not real credential values.
241
+
242
+ ## Recovery
243
+
244
+ Reset runtime config:
245
+
246
+ ```bash
247
+ npm run purge
248
+ npm run init
249
+ npm start
250
+ ```
251
+
252
+ Remove code checkout:
253
+
254
+ ```bash
255
+ rm -rf /path/to/HuHaa-MySkills
256
+ ```
257
+
258
+ `purge` intentionally touches only the runtime data dir, never the repository.
@@ -0,0 +1,259 @@
1
+ # HuHaa-MySkills 编辑器技能同步 (v0.1.2)
2
+
3
+ 本文档说明如何使用编辑器技能自动同步功能。
4
+
5
+ ## 快速开始
6
+
7
+ ### 方式 1:本地安装后同步
8
+
9
+ ```bash
10
+ # 克隆项目
11
+ git clone https://github.com/aquarkgn/HuHaa-MySkills.git
12
+ cd HuHaa-MySkills
13
+
14
+ # 执行同步脚本(交互模式)
15
+ npm run sync
16
+ # 或直接运行
17
+ bash service/scripts/sync-skills.sh
18
+ ```
19
+
20
+ ### 方式 2:远程一键安装 + 同步
21
+
22
+ ```bash
23
+ # 通过 curl 直接执行(推荐)
24
+ curl -fsSL https://raw.githubusercontent.com/aquarkgn/HuHaa-MySkills/main/install-and-sync.sh | bash
25
+ ```
26
+
27
+ ### 方式 3:仅同步(已安装项目后)
28
+
29
+ ```bash
30
+ npm run sync
31
+ # 或
32
+ npm run sync:remote
33
+ ```
34
+
35
+ ---
36
+
37
+ ## 功能说明
38
+
39
+ ### 自动编辑器检测
40
+
41
+ 脚本会自动扫描以下编辑器,并列出已安装的编辑器:
42
+
43
+ | 编辑器 | macOS 配置位置 | Linux 配置位置 |
44
+ |------------|----------------------------------------------------|-----------------------------|
45
+ | **Cursor** | `~/Library/Application Support/Cursor` | `~/.config/Cursor` |
46
+ | **VS Code** | `~/Library/Application Support/Code` | `~/.config/Code` |
47
+ | **Helix** | `~/Library/Application Support/helix` | `~/.config/helix` |
48
+ | **Neovim** | `~/.config/nvim` | `~/.config/nvim` |
49
+ | **Sublime** | `~/Library/Application Support/Sublime Text` | `~/.config/sublime-text-3` |
50
+ | **Windsurf** | `~/Library/Application Support/Windsurf` | `~/.config/Windsurf` |
51
+
52
+ ### 交互式选择
53
+
54
+ ```
55
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
56
+ 请选择要同步技能的编辑器(多选)
57
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
58
+
59
+ [1] cursor
60
+ Path: /Users/mac/Library/Application Support/Cursor
61
+
62
+ [2] vscode
63
+ Path: /Users/mac/Library/Application Support/Code
64
+
65
+ [3] helix
66
+ Path: /Users/mac/Library/Application Support/helix
67
+
68
+ 0 - 全选
69
+ q - 退出
70
+
71
+ 请输入选择 (使用逗号分隔多个): 1,2
72
+ ```
73
+
74
+ **支持的输入方式:**
75
+ - `1` - 选择第一个编辑器
76
+ - `1,2,3` - 选择多个编辑器
77
+ - `0` - 全选所有编辑器
78
+ - `q` - 取消操作
79
+
80
+ ### 同步功能
81
+
82
+ 脚本会将项目的技能和配置同步到选中的编辑器:
83
+
84
+ #### Cursor
85
+ - 同步 `.cursorrules` 文件到编辑器配置目录
86
+ - 自动备份原有的 `.cursorrules`
87
+
88
+ #### VS Code
89
+ - 复制代码片段和脚本到编辑器的 snippets 目录
90
+ - 支持自定义代码补全
91
+
92
+ #### Helix
93
+ - 同步 `config.toml` 配置文件
94
+ - 集成 HuHaa 自定义命令
95
+
96
+ #### Neovim
97
+ - 生成 `init.lua` 基础配置
98
+ - 加载 HuHaa 自定义配置
99
+
100
+ #### Sublime Text
101
+ - 同步用户设置和代码片段
102
+
103
+ #### Windsurf
104
+ - 同步编辑器配置
105
+
106
+ ---
107
+
108
+ ## 使用示例
109
+
110
+ ### 示例 1:在本地项目中同步所有编辑器
111
+
112
+ ```bash
113
+ cd /path/to/HuHaa-MySkills
114
+ npm run sync
115
+
116
+ # 选择: 0(全选)
117
+ ```
118
+
119
+ ### 示例 2:只同步 Cursor
120
+
121
+ ```bash
122
+ npm run sync
123
+
124
+ # 选择: 1(假设 Cursor 是第一个)
125
+ ```
126
+
127
+ ### 示例 3:从远程直接运行(新机器)
128
+
129
+ ```bash
130
+ # 自动安装 + 同步一体化
131
+ curl -fsSL https://raw.githubusercontent.com/aquarkgn/HuHaa-MySkills/main/install-and-sync.sh | bash
132
+
133
+ # 或者只执行同步
134
+ curl -fsSL https://raw.githubusercontent.com/aquarkgn/HuHaa-MySkills/main/install-and-sync.sh | bash -s -- --sync-only
135
+ ```
136
+
137
+ ### 示例 4:本地项目路径
138
+
139
+ ```bash
140
+ # 如果脚本在其他位置,指定本地项目路径
141
+ bash /path/to/sync-skills.sh --local /path/to/HuHaa-MySkills
142
+ ```
143
+
144
+ ---
145
+
146
+ ## 环境变量
147
+
148
+ 脚本支持以下环境变量来自定义行为:
149
+
150
+ ```bash
151
+ # 指定本地项目路径
152
+ export HUHAA_LOCAL_PATH="/path/to/HuHaa-MySkills"
153
+
154
+ # 指定远程仓库 URL(默认:https://github.com/aquarkgn/HuHaa-MySkills.git)
155
+ export HUHAA_REPO_URL="https://github.com/your-fork/HuHaa-MySkills.git"
156
+
157
+ # 指定原始内容 URL(默认:https://raw.githubusercontent.com/aquarkgn/HuHaa-MySkills)
158
+ export HUHAA_REPO_RAW="https://raw.githubusercontent.com/your-fork/HuHaa-MySkills"
159
+
160
+ # 执行脚本
161
+ bash service/scripts/sync-skills.sh
162
+ ```
163
+
164
+ ---
165
+
166
+ ## 常见问题
167
+
168
+ ### Q: 脚本找不到我的编辑器配置?
169
+
170
+ **A:** 某些编辑器在非标准位置安装。你可以:
171
+ 1. 检查编辑器是否在支持列表中
172
+ 2. 确认编辑器配置目录是否存在
173
+ 3. 手动指定项目路径:`HUHAA_LOCAL_PATH=/path/to/project bash service/scripts/sync-skills.sh`
174
+
175
+ ### Q: 同步会覆盖我的现有配置吗?
176
+
177
+ **A:** 脚本会:
178
+ - 为 Cursor 的 `.cursorrules` 创建备份(`.cursorrules.backup`)
179
+ - 对于其他编辑器,如果配置文件已存在,会跳过覆盖并显示警告
180
+ - 不会无故删除任何文件
181
+
182
+ ### Q: 可以部分同步吗?
183
+
184
+ **A:** 可以!选择需要同步的编辑器即可:
185
+ ```bash
186
+ npm run sync
187
+ # 选择: 1,3(只同步第 1 和第 3 个编辑器)
188
+ ```
189
+
190
+ ### Q: 如何撤销同步?
191
+
192
+ **A:** 如果有备份,恢复备份文件:
193
+ ```bash
194
+ # 恢复 Cursor 备份
195
+ cp ~/.cursor/.cursorrules.backup ~/.cursor/.cursorrules
196
+ ```
197
+
198
+ ### Q: 脚本支持 Windows 吗?
199
+
200
+ **A:** 支持 Windows WSL(Windows Subsystem for Linux)。在 PowerShell 中:
201
+ ```powershell
202
+ wsl bash -c "curl -fsSL https://raw.githubusercontent.com/aquarkgn/HuHaa-MySkills/main/install-and-sync.sh | bash"
203
+ ```
204
+
205
+ ---
206
+
207
+ ## 故障排查
208
+
209
+ ### 脚本执行权限错误
210
+
211
+ ```bash
212
+ # 添加执行权限
213
+ chmod +x service/scripts/sync-skills.sh
214
+ bash service/scripts/sync-skills.sh
215
+ ```
216
+
217
+ ### 网络连接问题
218
+
219
+ 如果 curl 下载失败,可尝试:
220
+ 1. 检查网络连接
221
+ 2. 使用代理:`curl -x [proxy-url] ...`
222
+ 3. 使用本地项目:`npm run sync`
223
+
224
+ ### 编辑器不被识别
225
+
226
+ 检查编辑器配置目录是否存在:
227
+ ```bash
228
+ # macOS
229
+ ls ~/Library/Application\ Support/Cursor
230
+ ls ~/Library/Application\ Support/Code
231
+ ls ~/.config/nvim # Linux
232
+
233
+ # Linux
234
+ ls ~/.config/Cursor
235
+ ls ~/.config/Code
236
+ ls ~/.config/helix
237
+ ```
238
+
239
+ ---
240
+
241
+ ## 后续更新
242
+
243
+ 脚本会在新版本中增加:
244
+ - [ ] 更多编辑器支持(Emacs, Vim, etc)
245
+ - [ ] 配置文件版本管理
246
+ - [ ] 回滚功能
247
+ - [ ] 增量同步(只同步改变的部分)
248
+
249
+ ---
250
+
251
+ ## 相关文档
252
+
253
+ - [快速启动指南](./GUIDE.md)
254
+ - [项目规划](./PLAN.md)
255
+ - [发布规范](./RULES.md)
256
+
257
+ ---
258
+
259
+ **v0.1.2 首发功能** | [GitHub](https://github.com/aquarkgn/HuHaa-MySkills)
@@ -0,0 +1,47 @@
1
+ # 版本发布历史
2
+
3
+ 本目录包含每个版本的详细发布说明。
4
+
5
+ ## 🚀 已发布版本
6
+
7
+ | 版本 | 日期 | 主题 | 文档 |
8
+ |------|------|------|------|
9
+ | **v0.1.1** | 2026-06-18 | npm 全局安装支持 | [详情](./v0.1.1.md) |
10
+ | **v0.1.0** | 2026-06-17 | 首个可用版本 | [详情](./v0.1.0.md) |
11
+
12
+ ## 📋 计划中的版本
13
+
14
+ | 版本 | 预期日期 | 主题 | 计划文档 |
15
+ |------|---------|------|---------|
16
+ | **v0.1.2** | 2026-06-30 | Hermes 技能集成 + 搜索优化 | [v0.1.2 计划](../todo/v0.1.2.md) / [发布说明](./v0.1.2.md) |
17
+ | **v0.1.3** | 2026-07-07 | Obsidian + Claude.md 支持 | [v0.1.3 计划](../todo/v0.1.3.md) |
18
+ | **v0.1.4** | 2026-07-21 | 分组与筛选增强 | [v0.1.4 计划](../todo/v0.1.4.md) |
19
+ | **v0.1.5** | 2026-07-28 | 导出与分享 | [v0.1.5 计划](../todo/v0.1.5.md) |
20
+ | **v0.1.6** | 2026-08-11 | 增量扫描与缓存 | [v0.1.6 计划](../todo/v0.1.6.md) |
21
+ | **v0.1.7** | 2026-08-25 | 跨平台完整支持 | [v0.1.7 计划](../todo/v0.1.7.md) |
22
+ | **v0.1.8** | 2026-09-01 | 开发者工具 | [v0.1.8 计划](../todo/v0.1.8.md) |
23
+ | **v0.1.9** | 2026-09-15 | 完成度冲刺 | [v0.1.9 计划](../todo/v0.1.9.md) |
24
+
25
+ ## 📖 如何阅读版本说明
26
+
27
+ 每个发布版本的详细说明包含:
28
+
29
+ - **🎯 版本目标** - 这个版本要达成什么
30
+ - **✨ 新增功能** - 具体增加了哪些功能
31
+ - **🐛 Bug 修复** - 修复了哪些问题
32
+ - **📊 性能对比** - 性能改进数据
33
+ - **🧪 测试覆盖** - 测试情况
34
+ - **📦 发行物** - 如何获取这个版本
35
+ - **🚀 安装指南** - 如何安装和升级
36
+ - **📝 Breaking Changes** - 是否有不兼容改动
37
+ - **🔄 迁移指南** - 如何从旧版本升级
38
+
39
+ ## 🔗 相关资源
40
+
41
+ - [CHANGELOG.md](../../CHANGELOG.md) - 简明版本历史
42
+ - [版本计划](../todo/) - 未来版本计划
43
+ - [发布规范](../RULES.md) - 如何发布版本
44
+
45
+ ---
46
+
47
+ **最后更新**: 2026-06-18