ethan-skill 1.5.0 → 1.5.2
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.
- package/README.md +300 -137
- package/dist/cli/index.js +5 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/templates/copilot-md.template.js +82 -33
- package/dist/templates/copilot-md.template.js.map +1 -1
- package/dist/templates/cursor-mdc.template.d.ts.map +1 -1
- package/dist/templates/cursor-mdc.template.js +18 -8
- package/dist/templates/cursor-mdc.template.js.map +1 -1
- package/package.json +1 -1
- package/rules/claude-code/CLAUDE.md +2 -2
- package/rules/cline/.clinerules +9 -2
- package/rules/codebuddy/CODEBUDDY.md +2 -2
- package/rules/continue/.continuerules +9 -2
- package/rules/copilot/copilot-instructions.md +581 -57
- package/rules/cursor/.cursorrules +10 -3
- package/rules/cursor/smart-flow.mdc +12 -9
- package/rules/jetbrains/smart-flow.md +580 -57
- package/rules/lingma/smart-flow.md +2 -2
- package/rules/windsurf/.windsurf/rules/smart-flow.md +586 -57
- package/rules/zed/smart-flow.rules +1 -1
package/README.md
CHANGED
|
@@ -1,74 +1,78 @@
|
|
|
1
|
-
# Ethan
|
|
1
|
+
# Ethan — Your AI Workflow Assistant
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> 将工作流标准化为可分发的 AI Skill,覆盖开发全链路——从需求理解到代码发布,每一步都有据可依。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/ethan-skill)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://nodejs.org)
|
|
6
8
|
|
|
7
9
|
🌐 **官网**:[aokiz-ek.github.io/smart-flow-skill](https://aokiz-ek.github.io/smart-flow-skill/)
|
|
8
10
|
|
|
9
11
|
---
|
|
10
12
|
|
|
11
|
-
##
|
|
13
|
+
## 功能一览
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
| 模块 | 内容 |
|
|
16
|
+
|------|------|
|
|
17
|
+
| **10 个 Skill** | 标准化工作流节点,覆盖需求→设计→实现→跟踪→输出→质量 |
|
|
18
|
+
| **11 个平台** | Cursor / Copilot / Cline / Windsurf / Zed / JetBrains / Continue / Claude Code 等 |
|
|
19
|
+
| **3 个 Pipeline** | 链式工作流(开发 / 汇报 / 质量),有状态持久化推进 |
|
|
20
|
+
| **17 个 MCP 工具** | AI 编辑器原生调用 Skill、Pipeline、Git、记忆库、估算 |
|
|
21
|
+
| **40+ CLI 命令** | Git 集成、开发工具、记忆库、估算、插件 OS 全覆盖 |
|
|
22
|
+
| **浏览器扩展** | Chrome/Edge MV3,GitHub PR 一键 Review + 右键菜单 |
|
|
23
|
+
| **VS Code 扩展** | 侧边栏树、20 个命令、17 个 @ethan 斜杠命令 |
|
|
24
|
+
| **插件 OS** | 发布/搜索/安装社区 Skill 插件,支持私有注册表 |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 10 个 Skill
|
|
14
29
|
|
|
15
30
|
| # | Skill | 分类 | 触发词(示例) | 说明 |
|
|
16
31
|
|---|-------|------|--------------|------|
|
|
17
|
-
| 1 | 需求理解 | 需求侧 |
|
|
18
|
-
| 2 | 任务拆解 | 需求侧 |
|
|
19
|
-
| 3 | 方案设计 | 执行侧 |
|
|
20
|
-
| 4 | 执行实现 | 执行侧 |
|
|
21
|
-
| 5 | 进度跟踪 | 跟踪侧 |
|
|
22
|
-
| 6 | 任务报告 | 输出侧 |
|
|
23
|
-
| 7 | 周报生成 | 输出侧 |
|
|
32
|
+
| 1 | 需求理解 | 需求侧 | `需求理解`、`分析需求` | 深度解析需求,消除歧义,输出结构化需求文档 |
|
|
33
|
+
| 2 | 任务拆解 | 需求侧 | `任务拆解`、`拆解任务` | 将需求拆解为原子任务,建立依赖关系 |
|
|
34
|
+
| 3 | 方案设计 | 执行侧 | `方案设计`、`技术方案` | 输出架构设计、接口设计、数据模型 |
|
|
35
|
+
| 4 | 执行实现 | 执行侧 | `执行实现`、`开始实现` | 按设计方案逐步实现,含代码自检清单 |
|
|
36
|
+
| 5 | 进度跟踪 | 跟踪侧 | `进度跟踪`、`进度更新` | 实时更新任务状态,识别阻塞风险 |
|
|
37
|
+
| 6 | 任务报告 | 输出侧 | `任务报告`、`生成报告` | 生成成果报告含问题复盘和经验教训 |
|
|
38
|
+
| 7 | 周报生成 | 输出侧 | `周报`、`生成周报` | 自动生成结构化周报,突出业务价值 |
|
|
24
39
|
| 8 | 代码审查 | 质量侧 | `代码审查`、`code review`、`CR` | 系统性审查,分级输出 Blocker/Major/Minor |
|
|
25
40
|
| 9 | 故障排查 | 质量侧 | `故障排查`、`debug`、`线上故障` | 假设验证 + 5 Why 根因分析,三层解决方案 |
|
|
26
41
|
| 10 | 技术调研 | 需求侧 | `技术调研`、`技术选型`、`POC` | 加权评分矩阵 + POC 验证,输出有据可查的结论 |
|
|
27
42
|
|
|
28
|
-
|
|
43
|
+
---
|
|
29
44
|
|
|
30
|
-
|
|
31
|
-
|
|
45
|
+
## 3 个 Pipeline(链式工作流)
|
|
46
|
+
|
|
47
|
+
| Pipeline ID | Skills | 适用场景 |
|
|
48
|
+
|-------------|--------|---------|
|
|
32
49
|
| `dev-workflow` | 需求理解 → 任务拆解 → 方案设计 → 执行实现 | 完整功能开发 |
|
|
33
50
|
| `reporting` | 进度跟踪 → 任务报告 → 周报生成 | 项目汇报 |
|
|
34
51
|
| `quality-workflow` | 代码审查 → 故障排查 | 质量保障 |
|
|
35
52
|
|
|
53
|
+
自定义 Pipeline:在 `.ethan/pipelines/` 目录创建 YAML 文件,`ethan pipeline-init` 生成模板。
|
|
54
|
+
|
|
36
55
|
---
|
|
37
56
|
|
|
38
|
-
##
|
|
57
|
+
## 快速开始
|
|
39
58
|
|
|
40
|
-
###
|
|
59
|
+
### 方式一:规则文件(推荐)
|
|
41
60
|
|
|
42
61
|
```bash
|
|
43
|
-
#
|
|
44
|
-
npx ethan-skill install --platform all
|
|
45
|
-
|
|
46
|
-
# 安装到指定平台
|
|
62
|
+
# 安装到当前项目(自动检测平台)
|
|
47
63
|
npx ethan-skill install --platform cursor
|
|
64
|
+
|
|
65
|
+
# 安装到多个平台
|
|
48
66
|
npx ethan-skill install --platform copilot
|
|
49
67
|
npx ethan-skill install --platform windsurf
|
|
50
|
-
# ... 其他平台见下表
|
|
51
|
-
```
|
|
52
68
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|------|------|------------|
|
|
57
|
-
| Cursor(新版) | `cursor` | `.cursor/rules/smart-flow.mdc` |
|
|
58
|
-
| Cursor(旧版) | `cursor` | `.cursorrules` |
|
|
59
|
-
| VS Code Copilot | `copilot` | `.github/copilot-instructions.md` |
|
|
60
|
-
| Cline | `cline` | `.clinerules` |
|
|
61
|
-
| 通义灵码 | `lingma` | `.lingma/rules/smart-flow.md` |
|
|
62
|
-
| 腾讯 CodeBuddy | `codebuddy` | `CODEBUDDY.md` |
|
|
63
|
-
| Windsurf | `windsurf` | `.windsurf/rules/smart-flow.md` |
|
|
64
|
-
| Zed | `zed` | `smart-flow.rules` |
|
|
65
|
-
| JetBrains AI | `jetbrains` | `.github/ai-instructions.md` |
|
|
66
|
-
| Continue | `continue` | `.continuerules` |
|
|
67
|
-
| Claude Code | `claude-code` | `CLAUDE.md` |
|
|
69
|
+
# 生成英文版规则文件
|
|
70
|
+
npx ethan-skill install --platform cursor --lang en
|
|
71
|
+
```
|
|
68
72
|
|
|
69
|
-
### MCP Server
|
|
73
|
+
### 方式二:MCP Server(AI 编辑器原生集成)
|
|
70
74
|
|
|
71
|
-
在 MCP
|
|
75
|
+
在 MCP 配置文件(如 `~/.cursor/mcp.json`)中添加:
|
|
72
76
|
|
|
73
77
|
```json
|
|
74
78
|
{
|
|
@@ -81,110 +85,215 @@ npx ethan-skill install --platform windsurf
|
|
|
81
85
|
}
|
|
82
86
|
```
|
|
83
87
|
|
|
84
|
-
重启 AI
|
|
88
|
+
重启 AI 编辑器后,可使用全部 **17 个 MCP 工具**(详见下方 MCP 工具列表)。
|
|
85
89
|
|
|
86
|
-
###
|
|
90
|
+
### 方式三:全局安装
|
|
87
91
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
```bash
|
|
93
|
+
npm install -g ethan-skill
|
|
94
|
+
ethan install --platform cursor
|
|
95
|
+
```
|
|
91
96
|
|
|
92
97
|
---
|
|
93
98
|
|
|
94
|
-
##
|
|
99
|
+
## 支持的 11 个平台
|
|
100
|
+
|
|
101
|
+
| 平台 | 参数 | 安装目标文件 |
|
|
102
|
+
|------|------|------------|
|
|
103
|
+
| Cursor(新版) | `cursor` | `.cursor/rules/smart-flow.mdc` |
|
|
104
|
+
| Cursor(旧版) | `cursor` | `.cursorrules` |
|
|
105
|
+
| VS Code Copilot | `copilot` | `.github/copilot-instructions.md` |
|
|
106
|
+
| Cline | `cline` | `.clinerules` |
|
|
107
|
+
| 通义灵码 | `lingma` | `.lingma/rules/smart-flow.md` |
|
|
108
|
+
| 腾讯 CodeBuddy | `codebuddy` | `CODEBUDDY.md` |
|
|
109
|
+
| Windsurf | `windsurf` | `.windsurf/rules/smart-flow.md` |
|
|
110
|
+
| Zed | `zed` | `smart-flow.rules` |
|
|
111
|
+
| JetBrains AI | `jetbrains` | `.github/ai-instructions.md` |
|
|
112
|
+
| Continue | `continue` | `.continuerules` |
|
|
113
|
+
| Claude Code | `claude-code` | `CLAUDE.md` |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## CLI 命令参考
|
|
118
|
+
|
|
119
|
+
### 核心命令
|
|
95
120
|
|
|
96
121
|
```bash
|
|
97
|
-
#
|
|
98
|
-
|
|
122
|
+
ethan install [--platform <platform>] [--lang en] # 安装规则文件
|
|
123
|
+
ethan list [--json] # 列出所有 Skill
|
|
124
|
+
ethan run # 交互式 Skill 执行向导
|
|
125
|
+
ethan init # 生成 .ethanrc.json 配置文件
|
|
126
|
+
ethan validate # 校验 rules/ 与源码是否同步
|
|
127
|
+
ethan doctor # 环境与依赖健康检查
|
|
128
|
+
ethan mcp # 启动 MCP Server
|
|
129
|
+
ethan serve # 启动本地 Web UI Dashboard
|
|
130
|
+
```
|
|
99
131
|
|
|
100
|
-
|
|
101
|
-
npx ethan-skill list
|
|
102
|
-
npx ethan-skill list --json
|
|
132
|
+
### Git 集成(Phase 1)
|
|
103
133
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
134
|
+
```bash
|
|
135
|
+
ethan commit [--type <type>] # 读取 staged diff → Conventional Commit 提交信息
|
|
136
|
+
ethan review [--base <branch>] # 读取分支 diff → Blocker/Major/Minor Code Review
|
|
137
|
+
ethan pr [--template feature|bugfix|hotfix] # 生成 PR 标题 + 正文 + Checklist
|
|
138
|
+
ethan standup [--days <n>] [--format] # 根据提交历史生成站会发言稿
|
|
139
|
+
ethan changelog [--from <tag>] [--to <tag>] # 生成两 tag 间的 CHANGELOG
|
|
140
|
+
```
|
|
107
141
|
|
|
108
|
-
|
|
109
|
-
npx ethan-skill validate
|
|
142
|
+
### 开发工具(Phase 2)
|
|
110
143
|
|
|
111
|
-
|
|
112
|
-
|
|
144
|
+
```bash
|
|
145
|
+
ethan scan [--todo] [--deps] # 扫描 TODO/FIXME 或检查依赖安全漏洞
|
|
146
|
+
ethan explain [file] [--lines <range>] [--level <level>] # 解释代码(junior/senior/principal)
|
|
147
|
+
ethan test-case <file> [--framework vitest] [--coverage] # 生成单元测试提示词
|
|
148
|
+
ethan naming <description> [--style] [--lang] [--count] # 生成命名候选(camelCase/snake_case/...)
|
|
149
|
+
ethan readme [--template library|cli|service] # 扫描项目结构生成 README 草稿
|
|
150
|
+
ethan roast [file] [--pr] [--level mild|spicy|savage] # 幽默吐槽代码质量
|
|
151
|
+
```
|
|
113
152
|
|
|
114
|
-
|
|
115
|
-
npx ethan-skill stats
|
|
116
|
-
npx ethan-skill stats --reset
|
|
153
|
+
### 工作流(有状态推进)
|
|
117
154
|
|
|
118
|
-
|
|
119
|
-
|
|
155
|
+
```bash
|
|
156
|
+
ethan workflow start <pipeline> -c "任务描述" [--name <session>] # 启动工作流会话(支持命名会话)
|
|
157
|
+
ethan workflow done "本步摘要" [--name <session>] # 完成当前步骤,推进下一步
|
|
158
|
+
ethan workflow status [--name <session>] # 查看进度看板
|
|
159
|
+
ethan workflow reset [--name <session>] # 清除当前会话
|
|
160
|
+
ethan workflow list [--sessions] # 列出 Pipeline / 命名会话
|
|
120
161
|
```
|
|
121
162
|
|
|
122
|
-
|
|
163
|
+
### 运维增强(Phase 3)
|
|
123
164
|
|
|
124
|
-
|
|
165
|
+
```bash
|
|
166
|
+
ethan oncall [--severity P0|P1|P2] [--postmortem] # 生成 On-call 排查 SOP
|
|
167
|
+
ethan schedule add --cron "0 9 * * 1" --cmd "ethan standup" # 添加定时任务
|
|
168
|
+
ethan schedule list # 查看定时任务
|
|
169
|
+
ethan schedule remove <id> # 删除定时任务
|
|
170
|
+
ethan hooks install [--hook pre-commit|commit-msg] # 安装 Git Hook
|
|
171
|
+
ethan hooks list # 查看已安装 Hook
|
|
172
|
+
ethan hooks remove <hook> # 移除 Git Hook
|
|
173
|
+
```
|
|
125
174
|
|
|
126
|
-
###
|
|
175
|
+
### Skill 记忆库(Phase 4)
|
|
127
176
|
|
|
128
|
-
|
|
129
|
-
|
|
177
|
+
```bash
|
|
178
|
+
ethan memory add --title "..." --content "..." [--tags tag1,tag2] # 添加记忆条目
|
|
179
|
+
ethan memory search <keyword> # 全文搜索(标题/内容/标签)
|
|
180
|
+
ethan memory show <id> # 查看详情
|
|
181
|
+
ethan memory list [--type workflow|skill|custom] # 列出所有条目
|
|
182
|
+
ethan memory export [--output file.md] # 导出为 Markdown
|
|
183
|
+
ethan memory remove <id> # 删除条目
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
> 工作流完成后(`ethan workflow done`)自动将步骤摘要归档到记忆库,无需手动添加。
|
|
130
187
|
|
|
131
|
-
###
|
|
188
|
+
### 估算与复盘(Phase 4)
|
|
132
189
|
|
|
133
190
|
```bash
|
|
134
|
-
|
|
191
|
+
ethan estimate [--style hours|story-points|days] [--team <size>] # 三点估算 + T-shirt Size
|
|
192
|
+
ethan retro [--format 4l|ssc] [--from-workflow] # 生成迭代复盘提示词
|
|
135
193
|
```
|
|
136
194
|
|
|
137
|
-
###
|
|
195
|
+
### 统计与排行(Phase 5)
|
|
138
196
|
|
|
139
197
|
```bash
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
npm run dev # 监视模式编译
|
|
198
|
+
ethan stats show # 查看个人使用频次(ASCII 条形图)+ 连续天数
|
|
199
|
+
ethan stats leaderboard # 团队排行榜(~/.ethan-leaderboard.json)
|
|
200
|
+
ethan stats reset # 清空统计数据
|
|
144
201
|
```
|
|
145
202
|
|
|
146
|
-
###
|
|
203
|
+
### Pipeline 管理
|
|
147
204
|
|
|
148
205
|
```bash
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
npm run format:check # Prettier 格式校验
|
|
206
|
+
ethan pipeline list # 列出所有内置 + 自定义 Pipeline
|
|
207
|
+
ethan pipeline run <id> [-c "上下文"] # 运行 Pipeline
|
|
208
|
+
ethan pipeline-init [--name my-pipeline] # 生成自定义 YAML Pipeline 模板
|
|
153
209
|
```
|
|
154
210
|
|
|
155
|
-
###
|
|
211
|
+
### 插件 OS(Phase 6)
|
|
156
212
|
|
|
157
213
|
```bash
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
214
|
+
ethan plugin install <pkg> # 从 npm 安装社区 Skill 插件
|
|
215
|
+
ethan plugin publish [--dry-run] # 发布本地插件到 npm / 私有注册表
|
|
216
|
+
ethan plugin registry --set <url> # 配置私有插件注册表
|
|
217
|
+
ethan plugin registry --show # 查看当前注册表配置
|
|
218
|
+
ethan plugin search <keyword> [-n <limit>] # 搜索社区插件(ethan-skill-*)
|
|
161
219
|
```
|
|
162
220
|
|
|
163
|
-
|
|
164
|
-
- **Skills 契约**:ALL_SKILLS 唯一性、步骤完整性、nextSkill 有效性
|
|
165
|
-
- **Pipeline**:resolvePipeline 正确解析,skillIds 引用合法
|
|
166
|
-
- **触发词路由**:精确/模糊/大小写/空串/trim 场景
|
|
167
|
-
- **模板渲染**:11 个平台 × 输出正确性
|
|
221
|
+
---
|
|
168
222
|
|
|
169
|
-
|
|
223
|
+
## 17 个 MCP 工具
|
|
224
|
+
|
|
225
|
+
配置 MCP Server 后,AI 编辑器(Cursor / Cline / Continue 等)可直接调用:
|
|
226
|
+
|
|
227
|
+
| 工具名 | 说明 |
|
|
228
|
+
|--------|------|
|
|
229
|
+
| `requirement_understanding` | 需求理解 Skill |
|
|
230
|
+
| `task_breakdown` | 任务拆解 Skill |
|
|
231
|
+
| `solution_design` | 方案设计 Skill |
|
|
232
|
+
| `implementation` | 执行实现 Skill |
|
|
233
|
+
| `progress_tracking` | 进度跟踪 Skill |
|
|
234
|
+
| `task_report` | 任务报告 Skill |
|
|
235
|
+
| `weekly_report` | 周报生成 Skill |
|
|
236
|
+
| `code_review` | 代码审查 Skill |
|
|
237
|
+
| `debug` | 故障排查 Skill |
|
|
238
|
+
| `tech_research` | 技术调研 Skill |
|
|
239
|
+
| `ethan_pipeline` | 串联执行完整 Pipeline |
|
|
240
|
+
| `ethan_workflow_next` | 推进工作流到下一步(传入摘要,返回下一步提示词) |
|
|
241
|
+
| `ethan_workflow_status` | 查询工作流进度与当前步骤 |
|
|
242
|
+
| `ethan_memory_search` | 搜索 Skill 记忆库(项目级 + 全局) |
|
|
243
|
+
| `ethan_estimate` | 生成三点估算提示词(支持小时/故事点/人天) |
|
|
244
|
+
| `ethan_git_commit` | 读取 staged diff → Conventional Commit 提示词 |
|
|
245
|
+
| `ethan_git_review` | 读取分支 diff → Blocker/Major/Minor Review 提示词 |
|
|
170
246
|
|
|
171
|
-
|
|
172
|
-
2. 运行 `npm run build:rules` 重新生成规则文件
|
|
173
|
-
3. 运行 `npm test` 确认测试通过
|
|
174
|
-
4. 提交 `src/` 和 `rules/` 目录变更
|
|
247
|
+
---
|
|
175
248
|
|
|
176
|
-
|
|
249
|
+
## 浏览器扩展
|
|
177
250
|
|
|
178
|
-
|
|
179
|
-
2. 在 `src/skills/index.ts` 的 `ALL_SKILLS` 数组末尾添加
|
|
180
|
-
3. 运行 `npm run build:rules && npm test`
|
|
251
|
+
Chrome/Edge Manifest V3 扩展,将 Ethan 带入任意网页。
|
|
181
252
|
|
|
182
|
-
|
|
253
|
+
**功能:**
|
|
254
|
+
- **GitHub PR 一键 Review**:访问 PR 页面自动注入「⚡ Ethan Review」按钮,提取 PR 上下文生成完整 Code Review 提示词
|
|
255
|
+
- **右键菜单**:选中代码/文本 → 右键 → Ethan → Review / Explain / Naming / PR Review
|
|
256
|
+
- **Popup 面板**:6 个快捷操作 + 9 个 Skill 快捷按钮,所有提示词一键复制到剪贴板
|
|
257
|
+
- **纯本地**:无服务器、无账号,所有提示词在本地生成
|
|
183
258
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
259
|
+
**安装(开发者模式):**
|
|
260
|
+
|
|
261
|
+
1. Clone 仓库或下载 `browser-extension/` 目录
|
|
262
|
+
2. Chrome/Edge → `chrome://extensions/` → 开启「开发者模式」
|
|
263
|
+
3. 点击「加载已解压的扩展程序」→ 选择 `browser-extension/` 目录
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## VS Code 扩展
|
|
268
|
+
|
|
269
|
+
**安装:**
|
|
270
|
+
1. 下载 `dist/ethan-skill-*.vsix`
|
|
271
|
+
2. VS Code → Extensions → `...` → Install from VSIX
|
|
272
|
+
|
|
273
|
+
**功能:**
|
|
274
|
+
- **Skill 侧边栏树**:按分类分组展示 10 个 Skill,点击直接运行
|
|
275
|
+
- **Pipeline 侧边栏树**:展示 3 条 Pipeline,点击查看详情
|
|
276
|
+
- **17 个 @ethan 斜杠命令**:在 Copilot Chat 中使用 `@ethan /需求理解`、`@ethan /commit` 等
|
|
277
|
+
- **20 个命令面板命令**:包含 Git、开发工具、记忆、估算、复盘等全系列
|
|
278
|
+
- **状态栏快捷按钮**:底部状态栏 `⚡ Ethan`,单击打开 Skill 选择器
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## 项目配置(`.ethanrc.json`)
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
ethan init # 在当前目录生成配置文件
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
```json
|
|
289
|
+
{
|
|
290
|
+
"lang": "zh",
|
|
291
|
+
"disabledSkills": ["weekly-report"],
|
|
292
|
+
"customTriggers": { "需求": "requirement-understanding" },
|
|
293
|
+
"plugins": ["ethan-skill-agile"],
|
|
294
|
+
"registry": "https://your-private-registry.com"
|
|
295
|
+
}
|
|
296
|
+
```
|
|
188
297
|
|
|
189
298
|
---
|
|
190
299
|
|
|
@@ -193,57 +302,111 @@ npm run test:coverage # 生成覆盖率报告
|
|
|
193
302
|
### 单一数据源(Single Source of Truth)
|
|
194
303
|
|
|
195
304
|
```
|
|
196
|
-
src/skills/*.ts
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
→ rules/continue/.continuerules
|
|
206
|
-
→ rules/claude-code/CLAUDE.md
|
|
305
|
+
src/skills/*.ts ──→ [build-rules.ts] ──→ rules/cursor/smart-flow.mdc
|
|
306
|
+
──→ rules/copilot/copilot-instructions.md
|
|
307
|
+
──→ rules/cline/.clinerules
|
|
308
|
+
──→ rules/windsurf/.windsurf/rules/smart-flow.md
|
|
309
|
+
──→ rules/zed/smart-flow.rules
|
|
310
|
+
──→ rules/jetbrains/smart-flow.md
|
|
311
|
+
──→ rules/continue/.continuerules
|
|
312
|
+
──→ rules/claude-code/CLAUDE.md
|
|
313
|
+
──→ ... (共 11 个平台)
|
|
207
314
|
```
|
|
208
315
|
|
|
209
|
-
所有内容存放在 TypeScript 源文件,构建时生成各平台文件,避免多处同步。`rules/` 目录提交到仓库供直接使用。
|
|
210
|
-
|
|
211
316
|
### 目录结构
|
|
212
317
|
|
|
213
318
|
```
|
|
214
319
|
ethan-skill/
|
|
215
320
|
├── src/
|
|
216
|
-
│ ├── skills/
|
|
217
|
-
│ │ ├── types.ts
|
|
218
|
-
│ │ ├── index.ts
|
|
219
|
-
│ │ ├── pipeline.ts
|
|
220
|
-
│ │ └── 01~10-*.ts
|
|
221
|
-
│ ├──
|
|
222
|
-
│ ├──
|
|
223
|
-
│
|
|
224
|
-
│ ├──
|
|
225
|
-
│ └──
|
|
226
|
-
├──
|
|
227
|
-
|
|
228
|
-
├──
|
|
229
|
-
└──
|
|
321
|
+
│ ├── skills/ # 单一数据源(10 Skill + pipeline 定义)
|
|
322
|
+
│ │ ├── types.ts # SkillDefinition、Platform、PipelineDefinition
|
|
323
|
+
│ │ ├── index.ts # ALL_SKILLS 导出
|
|
324
|
+
│ │ ├── pipeline.ts # PIPELINES + resolvePipeline()
|
|
325
|
+
│ │ └── 01~10-*.ts # 各 Skill 定义(含 category、nextSkill)
|
|
326
|
+
│ ├── cli/ # 40+ CLI 命令入口
|
|
327
|
+
│ │ ├── index.ts # Commander.js 主程序
|
|
328
|
+
│ │ └── config.ts # .ethanrc.json 读写
|
|
329
|
+
│ ├── git/ # Git 工具函数
|
|
330
|
+
│ │ └── utils.ts # getStagedDiff / getBranchDiff / truncateDiff 等
|
|
331
|
+
│ ├── workflow/ # 有状态工作流引擎
|
|
332
|
+
│ │ └── state.ts # 会话持久化、Named Sessions、步骤推进
|
|
333
|
+
│ ├── mcp/ # MCP Server(17 个工具)
|
|
334
|
+
│ │ └── server.ts
|
|
335
|
+
│ ├── router/ # 触发词路由
|
|
336
|
+
│ ├── templates/ # 各平台渲染模板(11 个 case,强制穷举)
|
|
337
|
+
│ ├── context/ # 项目技术栈自动检测
|
|
338
|
+
│ ├── loader/ # 自定义 Skill YAML 加载器
|
|
339
|
+
│ ├── server/ # Web UI Dashboard
|
|
340
|
+
│ └── vscode/ # VS Code 扩展
|
|
341
|
+
├── browser-extension/ # Chrome/Edge MV3 扩展
|
|
342
|
+
├── vscode-extension/ # VS Code 扩展 manifest(20 命令、17 斜杠命令)
|
|
343
|
+
├── rules/ # 构建产物,11 个平台(提交到仓库)
|
|
344
|
+
├── docs/ # 官网(GitHub Pages)
|
|
345
|
+
├── scripts/build/ # 构建脚本(build-rules.ts / build-vscode.ts)
|
|
346
|
+
└── .ethan/ # 项目级运行时数据(workflow.json、memory/、pipelines/)
|
|
230
347
|
```
|
|
231
348
|
|
|
232
349
|
---
|
|
233
350
|
|
|
234
|
-
##
|
|
351
|
+
## 开发
|
|
352
|
+
|
|
353
|
+
### 环境要求
|
|
235
354
|
|
|
236
|
-
|
|
355
|
+
- Node.js >= 18
|
|
356
|
+
- npm >= 9
|
|
357
|
+
|
|
358
|
+
### 常用命令
|
|
237
359
|
|
|
238
360
|
```bash
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
npm run build:
|
|
242
|
-
npm
|
|
361
|
+
npm install # 安装依赖
|
|
362
|
+
npm run build # 编译 TypeScript → dist/
|
|
363
|
+
npm run build:rules # 生成 11 个平台规则文件
|
|
364
|
+
npm run build:all # 全量构建(build + build:rules)
|
|
365
|
+
npm run dev # 监视模式编译
|
|
366
|
+
|
|
367
|
+
npm run lint # ESLint 检查
|
|
368
|
+
npm run lint:fix # ESLint 自动修复
|
|
369
|
+
npm run format # Prettier 格式化
|
|
370
|
+
|
|
371
|
+
npm test # 运行所有测试(Vitest)
|
|
372
|
+
npm run test:watch # 监视模式
|
|
373
|
+
npm run test:coverage # 覆盖率报告
|
|
243
374
|
```
|
|
244
375
|
|
|
376
|
+
### 修改 Skill 内容
|
|
377
|
+
|
|
378
|
+
1. 编辑 `src/skills/0X-skill-name.ts`
|
|
379
|
+
2. `npm run build:rules` 重新生成规则文件
|
|
380
|
+
3. `npm test` 确认测试通过
|
|
381
|
+
4. 提交 `src/` 和 `rules/` 目录变更
|
|
382
|
+
|
|
383
|
+
### 添加新 Skill
|
|
384
|
+
|
|
385
|
+
1. 创建 `src/skills/0X-new-skill.ts`,实现 `SkillDefinition`(含 `category`、`nextSkill`)
|
|
386
|
+
2. 在 `src/skills/index.ts` 的 `ALL_SKILLS` 末尾追加
|
|
387
|
+
3. `npm run build:rules && npm test`
|
|
388
|
+
|
|
389
|
+
### 添加新平台
|
|
390
|
+
|
|
391
|
+
1. 在 `src/skills/types.ts` 的 `Platform` 联合类型添加新值
|
|
392
|
+
2. 在 `src/templates/copilot-md.template.ts` 的 `switch` 中添加 `case`(无 `default`,TypeScript 强制穷举)
|
|
393
|
+
3. 在 `scripts/build/build-rules.ts` 添加 `writeFile` 调用
|
|
394
|
+
4. 在 `src/cli/index.ts` 的 `platformMap` 添加安装路径
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## 版本历史
|
|
399
|
+
|
|
400
|
+
| 版本 | 主要变更 |
|
|
401
|
+
|------|---------|
|
|
402
|
+
| **v1.5.0** | MCP 新增 4 工具(git commit/review/memory search/estimate);VS Code 扩展 17 斜杠命令;插件 OS(publish/registry/search);浏览器扩展;自定义 YAML Pipeline;Stats 排行榜;记忆库;估算复盘 |
|
|
403
|
+
| **v1.3.0** | Git 集成(commit/review/pr/standup/changelog);开发工具(scan/explain/test-case/naming/readme/roast);On-call、定时任务、Git Hooks |
|
|
404
|
+
| **v1.2.0** | 新增代码审查、故障排查、技术调研 3 个 Skill;新增 Windsurf/Zed/JetBrains/Continue/Claude Code 5 个平台;validate/pipeline/doctor/stats 命令 |
|
|
405
|
+
| **v1.1.0** | 有状态工作流(workflow start/done/status);MCP Server;Web UI Dashboard;自动上下文检测 |
|
|
406
|
+
| **v1.0.0** | 7 个 Skill;6 个平台(Cursor/Copilot/Cline/灵码/CodeBuddy);CLI install/list |
|
|
407
|
+
|
|
245
408
|
---
|
|
246
409
|
|
|
247
410
|
## License
|
|
248
411
|
|
|
249
|
-
MIT
|
|
412
|
+
MIT © [aokiz](https://github.com/aokiz-ek)
|
package/dist/cli/index.js
CHANGED
|
@@ -59,7 +59,11 @@ function copyToClipboard(text) {
|
|
|
59
59
|
return true;
|
|
60
60
|
}
|
|
61
61
|
else if (process.platform === 'win32') {
|
|
62
|
-
|
|
62
|
+
// clip.exe 以系统 ANSI 码页读取 stdin,UTF-8 直接传入会乱码
|
|
63
|
+
// 解决方案:传入 UTF-16LE + BOM,Windows 剪贴板原生支持 UTF-16
|
|
64
|
+
const bom = Buffer.from([0xff, 0xfe]);
|
|
65
|
+
const utf16 = Buffer.from(text, 'utf16le');
|
|
66
|
+
(0, child_process_1.spawnSync)('clip', [], { input: Buffer.concat([bom, utf16]), shell: false });
|
|
63
67
|
return true;
|
|
64
68
|
}
|
|
65
69
|
else {
|