skill-simplify

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Simplify

SKILL文档简化流程

Three-phase pipeline: analyze functional inventory, apply optimization rules, verify integrity.
Phase Reference Documents (read on-demand):
PhaseDocumentPurpose
1phases/01-analysis.mdExtract functional inventory, identify redundancy, validate pseudo-code format
2phases/02-optimize.mdApply simplification rules, fix format issues
3phases/03-check.mdVerify functional integrity, validate format
三步处理流程:分析功能清单、应用优化规则、验证完整性。
阶段参考文档(按需查阅):
阶段文档用途
1phases/01-analysis.md提取功能清单,识别冗余内容,验证伪代码格式
2phases/02-optimize.md应用简化规则,修复格式问题
3phases/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').length
javascript
const targetPath = input.trim()
const targetFile = targetPath.endsWith('.md') ? targetPath : `${targetPath}/SKILL.md`
const originalContent = Read(targetFile)
const originalLineCount = originalContent.split('\n').length

TodoWrite 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

核心规则

  1. Preserve ALL functional elements: Code blocks with logic, agent calls, data structures, routing, error handling, input/output specs
  2. Only reduce descriptive content: Flowcharts, verbose comments, duplicate sections, examples that repeat logic
  3. Never summarize algorithm logic: If-else branches, function bodies, schemas must remain verbatim
  4. Classify code blocks: Distinguish
    functional
    (logic, routing, schemas) from
    descriptive
    (ASCII art, examples, display templates) — only descriptive blocks may be deleted
  5. Merge equivalent variants: Single/multi-perspective templates differing only by a parameter → one template with variant comment
  6. 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
  7. Validate pseudo-code: Check bracket matching, variable consistency, structural completeness
  8. Quantitative verification: Phase 3 counts must match Phase 1 counts for functional categories; descriptive block decreases are expected
  1. 保留所有功能元素:包含逻辑的代码块、Agent调用、数据结构、路由、错误处理、输入/输出规范
  2. 仅精简描述性内容:流程图、冗长注释、重复章节、重复逻辑的示例
  3. 绝不总结算法逻辑:If-else分支、函数体、架构必须完整保留原文
  4. 分类代码块:区分
    functional
    (逻辑、路由、架构)与
    descriptive
    (ASCII图形、示例、展示模板)——仅可删除描述性代码块
  5. 合并等效变体:仅参数不同的单/多视角模板→合并为带变体注释的单个模板
  6. 修复格式问题:代码围栏中的嵌套反引号模板字面量→转换为普通文本;硬编码选项列表→标记为需动态生成;工作流交接引用→确保包含执行步骤
  7. 验证伪代码:检查括号匹配、变量一致性、结构完整性
  8. 量化验证:第三阶段的功能类别计数必须与第一阶段一致;描述性块数量预期会减少

Error Handling

错误处理

ErrorResolution
Target file not foundReport 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 foundReport in check, fix in Phase 2
错误解决方式
目标文件未找到报告错误,终止流程
验证失败(缺失功能元素)显示差异,恢复为原始内容,报告丢失的元素
验证警告(描述性内容减少或合并)显示差异并说明理由
发现格式问题在验证阶段报告,在第二阶段修复