@shirayner/ace 0.1.7 → 0.1.8-SNAPSHOT.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 +55 -19
- package/bin/ace.js +1 -0
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/auto-goal/SKILL.md +131 -87
- package/plugin/skills/auto-goal/references/recovery.md +29 -0
- package/plugin/skills/auto-goal/references/state-template.md +97 -0
- package/src/commands/doctor.js +12 -5
- package/src/commands/init.js +9 -5
- package/src/commands/list.js +26 -0
- package/src/commands/spec.js +57 -0
- package/src/commands/uninstall.js +65 -31
- package/src/core/constants.js +23 -20
- package/src/core/installer.js +84 -4
- package/src/core/merger.js +15 -3
- package/src/core/team-installer.js +96 -0
- package/src/core/ui.js +0 -1
- package/templates/CLAUDE.md +28 -14
- package/templates/ace/rules/git.md +50 -0
- package/templates/ace/rules/gitflow.md +109 -0
- package/templates/{rules/ace → ace/rules}/thinking.md +5 -0
- package/templates/hooks/ace.bash-guard.sh +71 -0
- package/templates/hooks/ace.content-guard.sh +68 -0
- package/templates/hooks/ace.file-guard.sh +29 -0
- package/templates/hooks/ace.java-compile-check.sh +4 -2
- package/templates/hooks/ace.stop-verify.sh +28 -0
- package/templates/openspec/config.yaml +43 -12
- package/templates/scripts/statusline-command.sh +2 -0
- package/templates/scripts/statusline.py +32 -0
- package/templates/settings.json +58 -2
- package/templates/hookify/hookify.ace.block-dangerous-ops.local.md +0 -16
- package/templates/hookify/hookify.ace.code-quality-gate.local.md +0 -45
- package/templates/hookify/hookify.ace.dangerous-commands.local.md +0 -20
- package/templates/hookify/hookify.ace.protect-secrets.local.md +0 -17
- package/templates/hookify/hookify.ace.require-verification.local.md +0 -13
- package/templates/hookify/hookify.ace.safe-git-commands.local.md +0 -38
- package/templates/hookify/hookify.ace.sensitive-data.local.md +0 -22
- /package/templates/{rules/ace → ace/rules}/clean-code.md +0 -0
- /package/templates/{rules/ace → ace/rules}/code-quality.md +0 -0
- /package/templates/{rules/ace → ace/rules}/context-hygiene.md +0 -0
- /package/templates/{rules/ace → ace/rules}/interactive-clarify.md +0 -0
- /package/templates/{rules/ace → ace/rules}/memory-policy.md +0 -0
- /package/templates/{rules/ace → ace/rules}/reporting.md +0 -0
- /package/templates/{rules/ace → ace/rules}/task-recovery.md +0 -0
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: code-quality-gate
|
|
3
|
-
enabled: true
|
|
4
|
-
event: file
|
|
5
|
-
conditions:
|
|
6
|
-
- field: file_extension
|
|
7
|
-
operator: in
|
|
8
|
-
value: [".js", ".ts", ".tsx", ".java", ".py", ".go", ".rs"]
|
|
9
|
-
action: warn
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
**代码质量检查**
|
|
13
|
-
|
|
14
|
-
保存代码文件时,请自检以下项目:
|
|
15
|
-
|
|
16
|
-
## 检查清单
|
|
17
|
-
|
|
18
|
-
### 1. 调试代码
|
|
19
|
-
- [ ] 已移除 `console.log` / `System.out.println` / `print`
|
|
20
|
-
- [ ] 已移除 `debugger;` 语句
|
|
21
|
-
- [ ] 已移除临时代码注释 (`// TEMP`, `// HACK`)
|
|
22
|
-
|
|
23
|
-
### 2. 代码规范
|
|
24
|
-
- [ ] 函数长度适中(理想 20 行内,最多 30 行)
|
|
25
|
-
- [ ] 嵌套深度不超过 3 层
|
|
26
|
-
- [ ] 无魔法值,使用命名常量
|
|
27
|
-
- [ ] 错误处理显性化
|
|
28
|
-
|
|
29
|
-
### 3. 测试相关
|
|
30
|
-
- [ ] 新增代码有对应测试
|
|
31
|
-
- [ ] 测试能通过
|
|
32
|
-
- [ ] 考虑边界条件
|
|
33
|
-
|
|
34
|
-
### 4. 敏感信息
|
|
35
|
-
- [ ] 无硬编码密码/API Key
|
|
36
|
-
- [ ] 配置文件使用环境变量
|
|
37
|
-
|
|
38
|
-
## 代码异味标记
|
|
39
|
-
|
|
40
|
-
| 标记 | 含义 | 建议 |
|
|
41
|
-
|------|------|------|
|
|
42
|
-
| `TODO` | 待办事项 | 确保有跟进计划 |
|
|
43
|
-
| `FIXME` | 需要修复 | 优先处理或创建 Issue |
|
|
44
|
-
| `HACK` | 临时方案 | 记录原因,计划重构 |
|
|
45
|
-
| `XXX` | 警告标记 | 高风险代码,需要审查 |
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: block-dangerous-commands
|
|
3
|
-
enabled: true
|
|
4
|
-
event: bash
|
|
5
|
-
pattern: rm\s+-rf|sudo\s+|dd\s+if=|mkfs|format\s+|>:\s*/
|
|
6
|
-
action: block
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**危险命令 detected!**
|
|
10
|
-
|
|
11
|
-
此命令可能造成数据丢失或系统损坏:
|
|
12
|
-
- `rm -rf` - 强制递归删除
|
|
13
|
-
- `sudo` - 特权执行
|
|
14
|
-
- `dd if=` / `mkfs` / `format` - 磁盘操作
|
|
15
|
-
- `> /path` - 重定向到系统文件
|
|
16
|
-
|
|
17
|
-
请确认:
|
|
18
|
-
1. 路径是否正确
|
|
19
|
-
2. 是否有备份
|
|
20
|
-
3. 是否可以使用更安全的方式
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: protect-secrets
|
|
3
|
-
enabled: true
|
|
4
|
-
event: file
|
|
5
|
-
conditions:
|
|
6
|
-
- field: file_path
|
|
7
|
-
operator: regex_match
|
|
8
|
-
pattern: \.env$|\.env\.|credentials|\.key$|secrets|\.pem$|\.p12$|password
|
|
9
|
-
action: warn
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
**敏感文件编辑警告!**
|
|
13
|
-
|
|
14
|
-
正在编辑可能包含敏感信息的文件。请确认:
|
|
15
|
-
- 文件已加入 .gitignore
|
|
16
|
-
- 未硬编码任何凭据或密钥
|
|
17
|
-
- 使用环境变量引用敏感值
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: safe-git-commands
|
|
3
|
-
enabled: true
|
|
4
|
-
event: bash
|
|
5
|
-
pattern: git\s+push\s+.*(-f|--force)|git\s+reset\s+--hard|git\s+clean\s+-fd|git\s+rebase\s+-i|git\s+commit\s+--amend
|
|
6
|
-
action: warn
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**Git 危险操作警告!**
|
|
10
|
-
|
|
11
|
-
即将执行可能影响团队协作的 Git 命令,请确认:
|
|
12
|
-
|
|
13
|
-
## 受保护命令
|
|
14
|
-
|
|
15
|
-
### Force Push (`git push --force`)
|
|
16
|
-
⚠️ 这会覆盖远程分支历史,可能影响其他协作者
|
|
17
|
-
- **建议**: 使用 `git push --force-with-lease`
|
|
18
|
-
- **确认**: 已通知团队成员,无人基于此分支工作
|
|
19
|
-
|
|
20
|
-
### Reset Hard (`git reset --hard`)
|
|
21
|
-
⚠️ 这会丢弃所有未提交的更改
|
|
22
|
-
- **建议**: 先用 `git stash` 保存更改
|
|
23
|
-
- **确认**: 已备份重要修改
|
|
24
|
-
|
|
25
|
-
### Clean Force (`git clean -fd`)
|
|
26
|
-
⚠️ 这会删除未跟踪的文件和目录
|
|
27
|
-
- **建议**: 先用 `git clean -n` 预览将被删除的文件
|
|
28
|
-
- **确认**: 不会误删重要文件
|
|
29
|
-
|
|
30
|
-
### Interactive Rebase (`git rebase -i`)
|
|
31
|
-
⚠️ 修改已发布的提交会改变历史
|
|
32
|
-
- **建议**: 仅对本地未推送的提交使用
|
|
33
|
-
- **确认**: 了解变基后需要 force push
|
|
34
|
-
|
|
35
|
-
### Amend Commit (`git commit --amend`)
|
|
36
|
-
⚠️ 修改已推送的提交需要 force push
|
|
37
|
-
- **建议**: 仅修改本地最新提交
|
|
38
|
-
- **确认**: 尚未推送到远程
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: warn-sensitive-data
|
|
3
|
-
enabled: true
|
|
4
|
-
event: file
|
|
5
|
-
action: warn
|
|
6
|
-
conditions:
|
|
7
|
-
- field: new_text
|
|
8
|
-
operator: regex_match
|
|
9
|
-
pattern: (API_KEY|SECRET|TOKEN|PASSWORD|PWD)\s*[=:]\s*["'][^"']+["']
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
**敏感信息 detected!**
|
|
13
|
-
|
|
14
|
-
文件内容可能包含硬编码凭证:
|
|
15
|
-
- API_KEY / API_SECRET
|
|
16
|
-
- TOKEN / ACCESS_TOKEN
|
|
17
|
-
- PASSWORD / PWD
|
|
18
|
-
|
|
19
|
-
建议:
|
|
20
|
-
1. 使用环境变量替代硬编码
|
|
21
|
-
2. 确认文件已在 .gitignore 中
|
|
22
|
-
3. 考虑使用密钥管理服务
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|