skill-simplify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill Simplify
SKILL文档简化流程
Three-phase pipeline: analyze functional inventory, apply optimization rules, verify integrity.
Phase Reference Documents (read on-demand):
| Phase | Document | Purpose |
|---|---|---|
| 1 | phases/01-analysis.md | Extract functional inventory, identify redundancy, validate pseudo-code format |
| 2 | phases/02-optimize.md | Apply simplification rules, fix format issues |
| 3 | phases/03-check.md | Verify functional integrity, validate format |
三步处理流程:分析功能清单、应用优化规则、验证完整性。
阶段参考文档(按需查阅):
| 阶段 | 文档 | 用途 |
|---|---|---|
| 1 | phases/01-analysis.md | 提取功能清单,识别冗余内容,验证伪代码格式 |
| 2 | phases/02-optimize.md | 应用简化规则,修复格式问题 |
| 3 | phases/03-check.md | 验证功能完整性,确认格式合规 |
Input Processing
输入处理
javascript
const targetPath = input.trim()
const targetFile = targetPath.endsWith('.md') ? targetPath : `${targetPath}/SKILL.md`
const originalContent = Read(targetFile)
const originalLineCount = originalContent.split('\n').lengthjavascript
const targetPath = input.trim()
const targetFile = targetPath.endsWith('.md') ? targetPath : `${targetPath}/SKILL.md`
const originalContent = Read(targetFile)
const originalLineCount = originalContent.split('\n').lengthTodoWrite Pattern
TodoWrite任务模式
javascript
TodoWrite({ todos: [
{ content: `Phase 1: Analyzing ${targetFile}`, status: "in_progress", activeForm: "Extracting functional inventory" },
{ content: "Phase 2: Optimize", status: "pending" },
{ content: "Phase 3: Integrity Check", status: "pending" }
]})javascript
TodoWrite({ todos: [
{ content: `Phase 1: Analyzing ${targetFile}`, status: "in_progress", activeForm: "Extracting functional inventory" },
{ content: "Phase 2: Optimize", status: "pending" },
{ content: "Phase 3: Integrity Check", status: "pending" }
]})Core Rules
核心规则
- Preserve ALL functional elements: Code blocks with logic, agent calls, data structures, routing, error handling, input/output specs
- Only reduce descriptive content: Flowcharts, verbose comments, duplicate sections, examples that repeat logic
- Never summarize algorithm logic: If-else branches, function bodies, schemas must remain verbatim
- Classify code blocks: Distinguish (logic, routing, schemas) from
functional(ASCII art, examples, display templates) — only descriptive blocks may be deleteddescriptive - Merge equivalent variants: Single/multi-perspective templates differing only by a parameter → one template with variant comment
- Fix format issues: Nested backtick template literals in code fences → convert to prose; hardcoded option lists → flag for dynamic generation; workflow handoff references → ensure execution steps present
- Validate pseudo-code: Check bracket matching, variable consistency, structural completeness
- Quantitative verification: Phase 3 counts must match Phase 1 counts for functional categories; descriptive block decreases are expected
- 保留所有功能元素:包含逻辑的代码块、Agent调用、数据结构、路由、错误处理、输入/输出规范
- 仅精简描述性内容:流程图、冗长注释、重复章节、重复逻辑的示例
- 绝不总结算法逻辑:If-else分支、函数体、架构必须完整保留原文
- 分类代码块:区分(逻辑、路由、架构)与
functional(ASCII图形、示例、展示模板)——仅可删除描述性代码块descriptive - 合并等效变体:仅参数不同的单/多视角模板→合并为带变体注释的单个模板
- 修复格式问题:代码围栏中的嵌套反引号模板字面量→转换为普通文本;硬编码选项列表→标记为需动态生成;工作流交接引用→确保包含执行步骤
- 验证伪代码:检查括号匹配、变量一致性、结构完整性
- 量化验证:第三阶段的功能类别计数必须与第一阶段一致;描述性块数量预期会减少
Error Handling
错误处理
| Error | Resolution |
|---|---|
| Target file not found | Report error, stop |
| Check FAIL (missing functional elements) | Show delta, revert to original, report which elements lost |
| Check WARN (descriptive decrease or merge) | Show delta with justification |
| Format issues found | Report in check, fix in Phase 2 |
| 错误 | 解决方式 |
|---|---|
| 目标文件未找到 | 报告错误,终止流程 |
| 验证失败(缺失功能元素) | 显示差异,恢复为原始内容,报告丢失的元素 |
| 验证警告(描述性内容减少或合并) | 显示差异并说明理由 |
| 发现格式问题 | 在验证阶段报告,在第二阶段修复 |