self-evolve-framework 1.0.6 → 1.0.8
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
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
>
|
|
5
5
|
> ⚠️ 此包专为 [CodeBuddy](https://www.codebuddy.ai) 设计,依赖 `.codebuddy/rules/` 和 `.codebuddy/skills/` 目录结构,非 CodeBuddy 环境无效。
|
|
6
6
|
|
|
7
|
+
## 由来
|
|
8
|
+
|
|
9
|
+
维护了两个项目,各自打磨了一套 Skill 规则。每次改进都要在两边重复复制粘贴,很快变得难以同步。直到 AI 建议:"为什么不打包成 npm 包?"
|
|
10
|
+
|
|
11
|
+
于是有了 Self-Evolve Framework。
|
|
12
|
+
|
|
13
|
+
一套规则,`npx` 即用,两边同步,不再需要手动搬运。
|
|
14
|
+
|
|
15
|
+
这本质上是一个私人工具箱——觉得好用的 Skill、好用的规则,会持续往里集成。方便自己,也顺手方便别人。
|
|
16
|
+
|
|
7
17
|
## 安装
|
|
8
18
|
|
|
9
19
|
```bash
|
|
@@ -22,6 +32,9 @@ npx self-evolve-framework init --dry-run
|
|
|
22
32
|
|
|
23
33
|
# 跳过 CLAUDE.md 更新
|
|
24
34
|
npx self-evolve-framework init --skip-claude-md
|
|
35
|
+
|
|
36
|
+
# 跳过 Impeccable 设计质量工具安装
|
|
37
|
+
npx self-evolve-framework init --skip-impeccable
|
|
25
38
|
```
|
|
26
39
|
|
|
27
40
|
## 安装了什么
|
|
@@ -32,18 +45,23 @@ npx self-evolve-framework init --skip-claude-md
|
|
|
32
45
|
│ ├── self-evolve.mdc ← 编排层(always 激活)
|
|
33
46
|
│ └── ponytail.mdc ← 代码最小化原则
|
|
34
47
|
├── skills/
|
|
35
|
-
│
|
|
36
|
-
│
|
|
48
|
+
│ ├── skillopt-sleep/
|
|
49
|
+
│ │ └── SKILL.md ← 离线进化分析
|
|
50
|
+
│ └── impeccable/
|
|
51
|
+
│ └── SKILL.md ← 设计质量审计
|
|
37
52
|
CLAUDE.md ← 追加自我进化章节
|
|
38
53
|
```
|
|
39
54
|
|
|
55
|
+
> 可选:用 `--skip-impeccable` 跳过 Impeccable skill 安装。
|
|
56
|
+
> 首次使用前在 CodeBuddy 对话中输入 `impeccable init` 创建设计上下文。
|
|
57
|
+
|
|
40
58
|
## 使用
|
|
41
59
|
|
|
42
60
|
### 每日自动生效
|
|
43
61
|
|
|
44
62
|
self-evolve rule 在每个对话中 always 激活:
|
|
45
|
-
- **改代码前** → Ponytail 检查 + CodeGraph 影响评估
|
|
46
|
-
- **改代码后** → 自动 `npm run build` + `cargo check` 验证
|
|
63
|
+
- **改代码前** → Ponytail 检查 + CodeGraph 影响评估 + 核心边界审计
|
|
64
|
+
- **改代码后** → 自动 `npm run build` + `cargo check` 验证 + Impeccable 设计审计
|
|
47
65
|
- **验证失败** → 分析修复 → 记录到记忆 → ≥2 次同模式 → 自动写规则
|
|
48
66
|
- **会话结束** → 超 7 天未审计 → 提醒
|
|
49
67
|
|
|
@@ -55,8 +73,15 @@ self-evolve rule 在每个对话中 always 激活:
|
|
|
55
73
|
skillopt-sleep dry-run → 每日健康检查,5 秒出报告
|
|
56
74
|
skillopt-sleep run → 周改进提案
|
|
57
75
|
skillopt-sleep adopt → 采纳建议
|
|
76
|
+
impeccable audit → 设计质量技术审计
|
|
77
|
+
impeccable critique → 设计评审
|
|
78
|
+
impeccable polish → 页面润色
|
|
58
79
|
```
|
|
59
80
|
|
|
81
|
+
### 设计上下文
|
|
82
|
+
|
|
83
|
+
在 CodeBuddy 对话中输入 `impeccable init` 生成 `PRODUCT.md` 和 `DESIGN.md`,让后续审计更精准。
|
|
84
|
+
|
|
60
85
|
## 前提
|
|
61
86
|
|
|
62
87
|
- CodeBuddy IDE(VSCode 系)
|
|
@@ -71,10 +96,12 @@ self-evolve-framework/
|
|
|
71
96
|
├── bin/cli.js # CLI 安装工具
|
|
72
97
|
├── template/
|
|
73
98
|
│ ├── rules/
|
|
74
|
-
│ │ ├── self-evolve.mdc
|
|
99
|
+
│ │ ├── self-evolve.mdc ← 编排层(含 Impeccable 集成)
|
|
75
100
|
│ │ └── ponytail.mdc
|
|
76
101
|
│ └── skills/
|
|
77
|
-
│
|
|
78
|
-
│
|
|
102
|
+
│ ├── skillopt-sleep/
|
|
103
|
+
│ │ └── SKILL.md ← 离线进化引擎(含设计质量分析)
|
|
104
|
+
│ └── impeccable/
|
|
105
|
+
│ └── SKILL.md ← 设计质量审计 skill
|
|
79
106
|
└── README.md
|
|
80
107
|
```
|
package/bin/cli.js
CHANGED
|
@@ -33,12 +33,13 @@ function showHelp() {
|
|
|
33
33
|
选项:
|
|
34
34
|
--project <path> 指定目标项目路径(默认当前目录)
|
|
35
35
|
--skip-claude-md 跳过更新 CLAUDE.md
|
|
36
|
+
--skip-impeccable 跳过复制 Impeccable skill
|
|
36
37
|
--dry-run 预览要复制的文件,不实际写入
|
|
37
38
|
|
|
38
39
|
示例:
|
|
39
40
|
npx self-evolve-framework init
|
|
40
41
|
npx self-evolve-framework init --project ./my-app
|
|
41
|
-
npx self-evolve-framework init --skip-claude-md --dry-run
|
|
42
|
+
npx self-evolve-framework init --skip-claude-md --skip-impeccable --dry-run
|
|
42
43
|
`)
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -46,6 +47,7 @@ async function init(args) {
|
|
|
46
47
|
const baseDir = resolve(args["--project"] || process.cwd())
|
|
47
48
|
const dryRun = !!args["--dry-run"]
|
|
48
49
|
const skipClaudeMd = !!args["--skip-claude-md"]
|
|
50
|
+
const skipImpeccable = !!args["--skip-impeccable"]
|
|
49
51
|
|
|
50
52
|
console.log(`📍 项目路径: ${baseDir}`)
|
|
51
53
|
console.log(`🧪 ${dryRun ? "DRY RUN — 不写入文件" : "执行中..."}\n`)
|
|
@@ -56,6 +58,11 @@ async function init(args) {
|
|
|
56
58
|
{ src: "skills/skillopt-sleep", dest: ".codebuddy/skills/skillopt-sleep" },
|
|
57
59
|
]
|
|
58
60
|
|
|
61
|
+
// 默认复制 impeccable skill(除非 --skip-impeccable)
|
|
62
|
+
if (!skipImpeccable) {
|
|
63
|
+
dirs.push({ src: "skills/impeccable", dest: ".codebuddy/skills/impeccable" })
|
|
64
|
+
}
|
|
65
|
+
|
|
59
66
|
let count = 0
|
|
60
67
|
for (const { src, dest } of dirs) {
|
|
61
68
|
const srcDir = resolve(TEMPLATE_DIR, src)
|
|
@@ -74,7 +81,7 @@ async function init(args) {
|
|
|
74
81
|
## 自我进化(always 激活)
|
|
75
82
|
|
|
76
83
|
统一由 \`.codebuddy/rules/self-evolve.mdc\` 编排。
|
|
77
|
-
调度 Ponytail(代码最小化)+ CodeGraph(依赖分析)+ Skillopt-Sleep
|
|
84
|
+
调度 Ponytail(代码最小化)+ CodeGraph(依赖分析)+ Skillopt-Sleep(离线进化)+ Impeccable(设计质量)
|
|
78
85
|
→ 形成 **post-edit 验证 → 错误记忆 → 规则推荐** 闭环。
|
|
79
86
|
`
|
|
80
87
|
if (existsSync(claudePath)) {
|
|
@@ -102,6 +109,7 @@ async function init(args) {
|
|
|
102
109
|
console.log("\n📖 使用指南(在 CodeBuddy 对话中输入):")
|
|
103
110
|
console.log(" skillopt-sleep dry-run → 每日健康检查")
|
|
104
111
|
console.log(" skillopt-sleep run → 周改进提案")
|
|
112
|
+
console.log(" impeccable audit/critique → 设计质量审查")
|
|
105
113
|
}
|
|
106
114
|
}
|
|
107
115
|
|
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ self-evolve.mdc(编排层 — 当前文件)
|
|
|
14
14
|
├── ponytail.mdc → 代码最小化检查(每个操作前)
|
|
15
15
|
├── CodeGraph MCP → 依赖图分析(重构/调 bug 时)
|
|
16
16
|
├── 核心边界审计 → 删/改功能前确认承重墙(本文件内联)
|
|
17
|
+
├── Impeccable → 设计质量审计(前端修改后自动触发)
|
|
17
18
|
└── skillopt-sleep → 离线进化分析(按需调)
|
|
18
19
|
↓
|
|
19
20
|
post-edit 验证闭环 ← ⭐ 核心
|
|
@@ -41,8 +42,12 @@ self-evolve.mdc(编排层 — 当前文件)
|
|
|
41
42
|
→ 失败 → 分析错误 → 修复 → 重试 build → 最多 3 次
|
|
42
43
|
2. Rust:在 src-tauri 目录运行 cargo check(如果存在)
|
|
43
44
|
→ 失败 → 分析错误 → 修复 → 重试 cargo check → 最多 3 次
|
|
44
|
-
3.
|
|
45
|
-
|
|
45
|
+
3. ★ 设计质量:如果修改涉及前端文件(html/css/jsx/tsx/vue/svelte),
|
|
46
|
+
调用 impeccable skill 检查设计质量(对话中输入 `impeccable detect`)
|
|
47
|
+
→ 发现 P0/P1 问题 → 修复 → 重新检测
|
|
48
|
+
→ P2/P3 问题 → 记入记忆,下次会话再处理
|
|
49
|
+
4. 全部通过 → 进入步骤 4
|
|
50
|
+
5. 3 次仍失败 → 停止,向用户报告错误并请求协助
|
|
46
51
|
```
|
|
47
52
|
|
|
48
53
|
### 步骤 4:写入记忆
|
|
@@ -112,6 +117,37 @@ self-evolve.mdc(编排层 — 当前文件)
|
|
|
112
117
|
| `skillopt-sleep run` | 每周总结时(生成周改进提案) |
|
|
113
118
|
| `skillopt-sleep adopt` | 审阅后采纳建议 |
|
|
114
119
|
|
|
120
|
+
## 🔧 Impeccable 设计质量规则
|
|
121
|
+
|
|
122
|
+
> 技能位于 `.codebuddy/skills/impeccable/SKILL.md`。每次前端修改自动触发设计审计。
|
|
123
|
+
|
|
124
|
+
### 自动审计触发条件
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
触发时机:步骤 3(自动验证)中检测到前端文件改动
|
|
128
|
+
执行方式:对话中输入 impeccable detect 调用 skill
|
|
129
|
+
质量分级:
|
|
130
|
+
P0(阻断)→ 立即修复
|
|
131
|
+
P1(严重)→ 立即修复
|
|
132
|
+
P2(一般)→ 记入记忆,下次会话处理
|
|
133
|
+
P3(建议)→ 记入记忆,下次会话处理
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### 按需审查
|
|
137
|
+
|
|
138
|
+
在 CodeBuddy 对话中输入:
|
|
139
|
+
|
|
140
|
+
| 命令 | 作用 |
|
|
141
|
+
|------|------|
|
|
142
|
+
| `impeccable audit` | 五维度技术质量检查 |
|
|
143
|
+
| `impeccable critique` | 设计评审(评分 + 角色测试) |
|
|
144
|
+
| `impeccable polish` | 最终润色打磨 |
|
|
145
|
+
| `impeccable detect` | 自动检测反模式 |
|
|
146
|
+
|
|
147
|
+
### 设计上下文
|
|
148
|
+
|
|
149
|
+
首次使用前运行 `impeccable init`,生成 `PRODUCT.md` 和 `DESIGN.md` 作为设计上下文,让审计更精准。
|
|
150
|
+
|
|
115
151
|
## 记忆存储路径
|
|
116
152
|
|
|
117
153
|
```text
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: impeccable
|
|
3
|
+
description: AI 前端设计质量审计。检测 UI 反模式、可访问性、布局一致性。扫描 html/css/jsx/tsx/vue/svelte 文件。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Impeccable — 前端设计质量审计
|
|
7
|
+
|
|
8
|
+
> CodeBuddy 适配版(纯指令模式,底层调用 `npx impeccable` 执行)。
|
|
9
|
+
|
|
10
|
+
## 核心命令
|
|
11
|
+
|
|
12
|
+
通过在对话中输入以下命令触发。执行时会调用 `npx impeccable <command>` 底层 CLI。
|
|
13
|
+
|
|
14
|
+
| 对话输入 | 作用 | 底层调用 |
|
|
15
|
+
|----------|------|---------|
|
|
16
|
+
| `impeccable audit` | 五维度技术质量检查(P0-P3 严重性分级) | `npx impeccable audit` |
|
|
17
|
+
| `impeccable critique` | 设计评审(评分 + 可用性测试) | `npx impeccable critique` |
|
|
18
|
+
| `impeccable polish` | 页面最终润色打磨 | `npx impeccable polish` |
|
|
19
|
+
| `impeccable detect` | 自动检测反模式 | `npx impeccable detect` |
|
|
20
|
+
| `impeccable layout` | 修复布局、间距和视觉节奏 | `npx impeccable layout` |
|
|
21
|
+
| `impeccable typeset` | 修复排版问题 | `npx impeccable typeset` |
|
|
22
|
+
| `impeccable colorize` | 为单色界面添加颜色 | `npx impeccable colorize` |
|
|
23
|
+
| `impeccable clarify` | 重写混淆的 UX 文案 | `npx impeccable clarify` |
|
|
24
|
+
| `impeccable distill` | 简化界面,去除多余元素 | `npx impeccable distill` |
|
|
25
|
+
| `impeccable harden` | 使界面更健壮(处理边界情况) | `npx impeccable harden` |
|
|
26
|
+
| `impeccable optimize` | 诊断并修复 UI 性能问题 | `npx impeccable optimize` |
|
|
27
|
+
| `impeccable init` | 创建设计上下文(PRODUCT.md + DESIGN.md) | `npx impeccable init` |
|
|
28
|
+
| `impeccable craft` | 设计并构建一个新功能 | `npx impeccable craft` |
|
|
29
|
+
| `impeccable shape` | 生成设计简报 | `npx impeccable shape` |
|
|
30
|
+
|
|
31
|
+
## 质量分级
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
P0(阻断)→ 修复后才能继续
|
|
35
|
+
P1(严重)→ 当前会话修复
|
|
36
|
+
P2(一般)→ 记入记忆,下次处理
|
|
37
|
+
P3(建议)→ 记入记忆,下次处理
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 设计上下文
|
|
41
|
+
|
|
42
|
+
`impeccable init` 生成 `PRODUCT.md` 和 `DESIGN.md`。这两份文件作为设计上下文,能让后续审计更精准。
|
|
43
|
+
|
|
44
|
+
## 在工作流中的位置
|
|
45
|
+
|
|
46
|
+
详见 `.codebuddy/rules/self-evolve.mdc` 步骤 3(自动验证):
|
|
47
|
+
每次修改前端文件后,自动检查设计质量,仅当发现 P0/P1 问题才中断流程。
|
|
@@ -15,6 +15,8 @@ AI 从以下来源收集项目数据:
|
|
|
15
15
|
- 构建/编译错误记录(从 `.codebuddy/memory/`)
|
|
16
16
|
- 已知问题列表
|
|
17
17
|
- 现有规则集(`.codebuddy/rules/`)
|
|
18
|
+
- 设计上下文(`PRODUCT.md`、`DESIGN.md`,如果存在)
|
|
19
|
+
- 前端文件的设计质量报告(如果安装了 Impeccable skill,调用 `impeccable detect` 检查项目前端设计质量)
|
|
18
20
|
|
|
19
21
|
### 阶段 2:Mine — 挖掘模式
|
|
20
22
|
分析收集到的数据,识别:
|
|
@@ -23,6 +25,7 @@ AI 从以下来源收集项目数据:
|
|
|
23
25
|
- **缺失约束**:重复发生但无规则防范的问题
|
|
24
26
|
- **优化机会**:可简化的逻辑、可合并的文件
|
|
25
27
|
- **★ 核心边界**:识别模块间的契约接口、关键用户路径和其依赖方,标记"改/删前必须审慎"的承重区域
|
|
28
|
+
- **★ 设计异嗅**:分析 Impeccable 检测报告中的 P0/P1 反复出现的问题模式,识别设计约束缺失或 DESIGN.md 与实现不一致的区域
|
|
26
29
|
|
|
27
30
|
### 阶段 3:Replay — 回放验证
|
|
28
31
|
对每个发现的问题:
|