Loading...
Loading...
Compare original and translation side by side
pnpmpackageManagerlockfile# skill duplicates (global)
ls ~/.claude/skills/
Grep "<key>" ~/.claude/skills/*/SKILL.md
# CLAUDE.md duplicates
Grep "<key>" ~/.claude/CLAUDE.md
Grep "<key>" <project-root>/CLAUDE.md # if there is a matching project
# lint rule duplicates
ls <project-root>/rules/
Grep "<key>" <project-root>/rules/[skill append][rule]digraph classify {
"Mechanically detectable?" [shape=diamond];
"Short instruction to apply every time?" [shape=diamond];
"Involves multi-step procedure or judgment?" [shape=diamond];
"ast-grep rule / lint" [shape=box];
"CLAUDE.md rule" [shape=box];
"skill" [shape=box];
"keep as note" [shape=box];
"Mechanically detectable?" -> "ast-grep rule / lint" [label="yes"];
"Mechanically detectable?" -> "Short instruction to apply every time?" [label="no"];
"Short instruction to apply every time?" -> "CLAUDE.md rule" [label="yes"];
"Short instruction to apply every time?" -> "Involves multi-step procedure or judgment?" [label="no"];
"Involves multi-step procedure or judgment?" -> "skill" [label="yes"];
"Involves multi-step procedure or judgment?" -> "keep as note" [label="no"];
}| Decision axis | Output destination | Example |
|---|---|---|
| Detectable at the code/config syntax level | | "Do not use |
| Short, always-applied, no judgment involved | | "Use pnpm v10 or later" |
| Requires procedure, contextual judgment, or templates | New skill or append to existing skill | "Steps to write a C binding for MoonBit" |
| Project-specific and one-off | Do not adopt (keep in commit message / PR description) | — |
ast-grep~/.claude/CLAUDE.mdCLAUDE.mdpnpmpackageManagerlockfile# skill重复检查(全局)
ls ~/.claude/skills/
Grep "<key>" ~/.claude/skills/*/SKILL.md
# CLAUDE.md重复检查
Grep "<key>" ~/.claude/CLAUDE.md
Grep "<key>" <project-root>/CLAUDE.md # 如果有匹配的项目
# lint规则重复检查
ls <project-root>/rules/
Grep "<key>" <project-root>/rules/[skill append][rule]ast-grep-practicerules/rule-tests/digraph classify {
"Mechanically detectable?" [shape=diamond];
"Short instruction to apply every time?" [shape=diamond];
"Involves multi-step procedure or judgment?" [shape=diamond];
"ast-grep rule / lint" [shape=box];
"CLAUDE.md rule" [shape=box];
"skill" [shape=box];
"keep as note" [shape=box];
"Mechanically detectable?" -> "ast-grep rule / lint" [label="yes"];
"Mechanically detectable?" -> "Short instruction to apply every time?" [label="no"];
"Short instruction to apply every time?" -> "CLAUDE.md rule" [label="yes"];
"Short instruction to apply every time?" -> "Involves multi-step procedure or judgment?" [label="no"];
"Involves multi-step procedure or judgment?" -> "skill" [label="yes"];
"Involves multi-step procedure or judgment?" -> "keep as note" [label="no"];
}| 决策维度 | 输出目标 | 示例 |
|---|---|---|
| 可通过代码/配置语法层面检测 | | 「不要使用 |
| 简短、需始终遵循、无需判断 | | 「使用pnpm v10或更高版本」 |
| 需要流程、上下文判断或模板 | 新增Skill或追加到现有Skill | 「为MoonBit编写C语言绑定的步骤」 |
| 项目特定的一次性内容 | 不采纳(保留在提交信息/PR描述中) | — |
ast-grep~/.claude/CLAUDE.mdCLAUDE.mdundefinedast-grep-practicerules/rule-tests/Always attach the reason in parentheses (so that your future self can judge edge cases).undefinedwriting-skills---
name: <kebab-case>
description: Use when <specific situation> / <symptom>
---始终在括号中附上理由(以便未来的你能判断边缘情况)。undefinedwriting-skills---
name: <kebab-case>
description: Use when <specific situation> / <symptom>
---Array.from(set).lengthset.sizeSetMap.sizeArray.from(...).lengthrules/no-array-from-size.ymlid: no-array-from-size
language: TypeScript
severity: warning
rule:
pattern: Array.from($COLL).length
message: Set/Map のサイズは .size プロパティを使う。undefinedpnpm install~/.claude/CLAUDE.md- pnpm は v10 以上を使う(理由: lockfile 形式が v9 以前と非互換で CI 差分が出る)Array.from(set).lengthset.sizeSetMap.sizeArray.from(...).lengthrules/no-array-from-size.ymlid: no-array-from-size
language: TypeScript
severity: warning
rule:
pattern: Array.from($COLL).length
message: Set/Map のサイズは .size プロパティを使う。extern "c"moonbit.hnative-stublink.nativemoon.pkg.jsonmoonbit-c-bindingpnpm install~/.claude/CLAUDE.md- pnpm は v10 以上を使う(理由: lockfile 形式が v9 以前と非互換で CI 差分が出る)| Rationalization that surfaces | Reality |
|---|---|
| "It is project-specific but let's make a skill just in case" | Skills bloat and searchability drops. A commit message / PR is enough. |
| "Skip approval and write it out first; I can show it later" | Modifying CLAUDE.md / skills on your own makes future behavior unpredictable. Always: propose -> approve -> write out. |
| "I kind of could write it in ast-grep, but writing it in natural language as a rule is faster" | Writing statically detectable things in prose means agents do not follow them. Prefer ast-grep. |
| "The insight is thin, but I have to write something to save face" | Zero proposals is also a correct answer. An empty retrospective causes no harm. |
| "Dedup checks are tedious; skip them, erase duplicates later" | If duplicate rules remain, behavior splits. Dedup is a mandatory step. |
| "Omit the failure side and only write the final solution" | Without describing the failure, your future self will fall into the same pitfall again. |
extern "c"moonbit.hmoon.pkg.jsonnative-stublink.nativemoonbit-c-bindingundefined| 出现的自我合理化想法 | 实际情况 |
|---|---|
| 「这是项目特定内容,但以防万一还是做成Skill吧」 | Skill会变得冗余,搜索效率下降。提交信息/PR描述已足够。 |
| 「跳过批准直接写入,之后再展示给用户」 | 擅自修改CLAUDE.md/Skill会导致未来行为不可预测。请始终遵循:提出方案 -> 获得批准 -> 写入内容的顺序。 |
| 「我可以用ast-grep实现,但用自然语言写成规则更快」 | 将可静态检测的内容写成自然语言会导致Agent无法遵循。优先选择ast-grep。 |
| 「经验很单薄,但为了面子还是得写点什么」 | 不提出任何方案也是正确的选择。空的回顾不会造成危害。 |
| 「去重检查太繁琐,先跳过,之后再删除重复内容」 | 如果保留重复规则,行为会出现分歧。去重是必填步骤。 |
| 「省略失败部分,只写最终解决方案」 | 不描述失败情况,未来的你会再次落入同样的陷阱。 |
undefined
**Format rules:**
- If there is only 1 lesson, omit the `### Lesson N` heading and write only one Retrospective block
- If any of "Adoption candidates," "Duplicate detected," or "Not adopted" is empty, omit the whole section (do not write a "none" line)
- Always end each proposal line with "from lesson N" (if it spans multiple lessons, you may enumerate as "from lessons 1, 3")
- When "Adoption candidates" is empty and only "Duplicate detected" remains, replace the closing sentence from `Please indicate which to adopt` with `No adoption candidates. Please review for the record.`
- Write out only items the user instructs you to adopt. Do not write silently.undefined
**格式规则:**
- 如果只有1条经验,省略`### 经验N`标题,只写一个回顾块
- 如果「待采纳候选」、「检测到重复」或「未采纳」中的任何一个为空,省略整个章节(不要写「无」)
- 每条方案建议行末尾必须写上「来自经验N」(如果涉及多条经验,可以列举为「来自经验1、3」)
- 当「待采纳候选」为空且只有「检测到重复」时,将结尾句子从「请指出要采纳的内容」替换为「无待采纳候选。请审阅备案。」
- 仅写入用户指示采纳的内容。不要擅自写入。undefined<section name><skill name>undefinedundefinedundefined<section name>~/.claude/CLAUDE.mdundefinedundefinedast-grepWhy:~/.claude/CLAUDE.mdundefinedsuperpowers:writing-skillsast-grep-practiceupdate-configsuperpowers:writing-skillsast-grep-practiceupdate-config