rewrite all docs in English

This commit is contained in:
lyn
2026-04-17 13:44:20 +00:00
parent fb72550eea
commit 97a7d89deb
4 changed files with 109 additions and 108 deletions

View File

@@ -1,6 +1,6 @@
# claw-skills # claw-skills
ClawSkills 管理和协作套件,提供 scripts workflows 来规范 skill 的使用和改进流程。 ClawSkills management and collaboration suite — scripts and workflows for using and improving skills.
## Scripts ## Scripts
@@ -24,23 +24,23 @@ claw-skills/scripts/promote-improvements
### fix-skills ### fix-skills
如果使用某个 skill 或其脚本没有达到预期效果,或脚本报错: When a skill or its scripts fail to produce expected results, or throw errors:
> **不要轻易使用 workaround** > **Do not resort to workarounds lightly.**
> 参考 `{baseDir}/workflows/fix-skills.md`,按该流程定位根因并修复。 > Follow `{baseDir}/workflows/fix-skills.md` — identify the root cause first, then fix properly.
### improve-skills ### improve-skills
如果使用 skill 的过程中发现现有 skill 或 workflow 存在以下问题: When using a skill and you find:
- 有误导或歧义 - Misleading or ambiguous descriptions
- 没有覆盖到你的使用情景 - Missing coverage for your use case
- 效果不理想 - Suboptimal or confusing behavior
> 参考 `{baseDir}/workflows/improve-skills.md` 进行改进。 > Follow `{baseDir}/workflows/improve-skills.md` to improve it.
### create-skills ### create-skills
如果工作过程中发现某些模式或流程可以显著提高效率,但目前没有 skill 覆盖: When you notice patterns or workflows that could improve efficiency but have no skill covering them:
> 参考 `{baseDir}/workflows/create-skills.md` 创建新的 skill > Follow `{baseDir}/workflows/create-skills.md` to create a new skill.

View File

@@ -1,55 +1,56 @@
# create-skills # create-skills
当工作过程中发现某些模式或流程可以显著提高效率,但目前没有 skill 覆盖时使用。 Used when you notice patterns or workflows that could improve efficiency but have no skill covering them.
## 原则 ## Principle
不是所有重复操作都需要变成 skill。先问这个模式是否通用到值得抽象 Not every repetitive task needs to become a skill. Ask first: is this pattern general enough to warrant abstraction?
## 流程 ## Process
### 1. 识别模式 ### 1. Identify the Pattern
- 记录重复出现的操作序列 - Record the repeating sequence of operations
- 分析:每次都在做类似的什么事情? - Analyze: what are you doing repeatedly across tasks?
- 评估:这个操作是否有通用性,还是只是当前任务的特例 - Evaluate: is this operation general-purpose or a one-off特例?
### 2. 评估是否值得做成 skill ### 2. Assess Whether It's Worth Making a Skill
- **值得做的特征** **Worth doing when:**
- 同一个操作在不同 agent/workspace 中重复出现 - The same operation recurs across different agents/workspaces
- 操作步骤固定,结果可预期 - The steps are fixed, results are predictable
- 涉及外部系统调用(gitkeycloak、文件操作等) - Involves external system calls (git, keycloak, file ops, etc.)
- **不值得做的特征**
- 一次性任务
- 步骤不固定,依赖上下文判断
- 纯对话/分析类工作
### 3. 设计 skill **Not worth doing when:**
- One-off task
- Steps vary depending on context
- Purely conversational/analytical work
- **名称**`{action}-{target}`(如 `git-clone-repo``keycloak-create-user` ### 3. Design the Skill
- **SKILL.md 内容**
- 描述:这个 skill 做什么
- 使用场景:什么时候用
- 脚本列表:所有相关脚本及其调用方式
- **脚本**
- 放在 `scripts/`
- 每个脚本单一职责
- 提供 `--help``-h` 支持
### 4. 实现 - **Name:** `{action}-{target}` (e.g., `git-clone-repo`, `keycloak-create-user`)
- **SKILL.md contents:**
- Description: what this skill does
- Use cases: when to use it
- Scripts: all related scripts and how to call them
- **Scripts:**
- Place under `scripts/`
- Each script has a single responsibility
- Provide `--help` or `-h` support
- 编写脚本,测试通过 ### 4. Implement
- 编写 SKILL.md
- 本地验证
### 5. 提交 - Write the scripts, verify they work
- Write the SKILL.md
- Test locally
- 按 promote-improvements 流程提交到自己的分支 ### 5. Submit
- commit message 包含skill 名称、功能描述、使用示例
- 通知 hang说明新增 skill 的用途
### 6. 上线 - Follow promote-improvements to push to your branch
- Commit message includes: skill name, what it does, usage example
- Notify hang with the new skill's purpose
- hang merge 后skill 进入 ClawSkills 正式列表 ### 6. Ship
- 其他 agent 通过 learn.sh 自动获取
- hang merges it; skill enters the official ClawSkills list
- Other agents pull it automatically via learn.sh

View File

@@ -1,46 +1,46 @@
# fix-skills # fix-skills
当 skill 或脚本未达到预期效果,或脚本报错时使用。 Used when a skill or its scripts fail to produce expected results, or throw errors.
## 原则 ## Principle
**不要轻易使用 workaround。** 先定位根因,再决定修复方式。 **Do not resort to workarounds lightly.** Identify the root cause first, then fix properly.
## 流程 ## Process
### 1. 收集信息 ### 1. Gather Information
- 记录触发场景:怎么调用的,期望什么结果,实际什么结果 - Record the triggering scenario: how it was called, expected result, actual result
- 记录错误信息:完整输出(含 stack trace 或脚本调试输出) - Record the error output in full (stack traces, debug output)
- 确认环境模型版本、节点、skill 版本(git log 有帮助) - Confirm the environment: model version, node, skill version (git log helps)
### 2. 分析根因 ### 2. Analyze Root Cause
按以下顺序排查: Investigate in this order:
1. **输入/参数是否正确** — 传给脚本或工具的参数是否符合预期? 1. **Are inputs/parameters correct?** — Do they match what the script or tool expects?
2. **依赖是否满足** — 所需 secrettoken、配置文件是否存在? 2. **Are dependencies satisfied?** — Are required secrets, tokens, config files present?
3. **脚本逻辑是否有 bug** — 读源码,必要时加 `set -x` 调试 3. **Is there a bug in the script logic?** — Read the source, add `set -x` if needed
4. **skill 设计是否有缺陷** — 逻辑本身是否覆盖了这个场景? 4. **Is there a design flaw in the skill?** — Does the logic actually cover this scenario?
### 3. 定位到文件 ### 3. Pinpoint the File
- 确认问题出在哪个文件的哪一行 - Identify which file and which line the problem is in
- 如果是 skill 本身的问题 → 进入 [improve-skills](./improve-skills.md) 流程 - If it's a skill issue → follow the [improve-skills](./improve-skills.md) workflow
- 如果是脚本执行环境问题 → 记录在 memory/ 并提给 hang - If it's an execution environment issue → document in memory/ and escalate to hang
### 4. 修复 ### 4. Fix
- 在本地测试修复方案 - Test the fix locally
- 如果需要修改 skill 文件 → 按 improve-skills 流程提交 PR 或直接 push 到分支 - If skill files need to be modified → follow improve-skills process to PR or push to a branch
- 避免引入新的 side effect - Avoid introducing new side effects
### 5. 验证 ### 5. Verify
- 复现原场景,确认问题已解决 - Reproduce the original scenario; confirm the issue is resolved
- 记录修复内容到 memory/YYYY-MM-DD.md - Log the fix in memory/YYYY-MM-DD.md
### 6. 上报(如需要) ### 6. Escalate if Needed
- 如果问题需要 hang 或其他 agent 介入 → 在 report channel 记录 - If the issue requires hang or another agent → post in report channel
- 包含:场景、期望/实际结果、根因、修复方案 - Include: scenario, expected/actual result, root cause, fix applied

View File

@@ -1,49 +1,49 @@
# improve-skills # improve-skills
当发现现有 skill workflow 存在以下问题时使用: Used when a skill or workflow has one of these problems:
- 有误导或歧义 - Misleading or ambiguous
- 没有覆盖到你的使用情景 - Missing coverage for your use case
- 效果不理想 - Suboptimal or confusing behavior
## 原则 ## Principle
改进比 work-around 更好。发现问题时及时修正,避免后续其他人踩同样的坑。 Improvement is better than workaround. Fix problems when you find them, so others don't hit the same坑.
## 流程 ## Process
### 1. 识别问题 ### 1. Identify the Problem
- 记录哪个 skill 的哪个部分有问题 - Record which skill and which part has the issue
- 具体描述:哪里误导、哪里缺失、哪里效果差 - Describe specifically: what's misleading, what's missing, what's not working well
- 记录触发场景:什么情况下发现这个问题 - Record the scenario where you encountered it
### 2. 评估影响范围 ### 2. Assess Impact
- 这个问题会影响多少人? - How many people will this affect?
- 是 skill 设计问题还是描述/文档问题? - Is it a design issue or a documentation issue?
- 修复复杂度如何? - What's the complexity of the fix?
### 3. 确定改进方案 ### 3. Design the Fix
- **文档问题** → 改 SKILL.md 或相关描述 - **Documentation issue** → update SKILL.md or related descriptions
- **逻辑缺陷** → 修改脚本或 skill 逻辑 - **Logic flaw** → modify the script or skill logic
- **覆盖缺失** → 新增流程或脚本 - **Missing coverage** → add a new workflow or script
- **流程不顺** → 重新设计 workflow - **Process issue** → redesign the workflow
### 4. 执行改进 ### 4. Implement
- 在本地或分支上修改 - Make changes locally or on a branch
- 更新 SKILL.md(如果改了描述) - Update SKILL.md if behavior changed
- 如果改动较大,先在本地测试 - Test if the change is significant
### 5. 提交 ### 5. Submit
- promote-improvements 流程提交到自己的分支 - Follow promote-improvements to push to your branch
- commit message 说明改进内容 - Commit message should describe what was changed and why
- 附上问题描述和解决思路(便于 hang review - Include problem description and fix rationale for hang's review
### 6. 通知 hang ### 6. Notify hang
- 完成后告知 hang说明改了什么、为什么改 - After completion, tell hang what was changed and why
- hang 决定是 merge 还是继续调整 - Let hang decide whether to merge or iterate further