Skill Simplify
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 |
Input Processing
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({ 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
functional (logic, routing, schemas) from descriptive (ASCII art, examples, display templates) — only descriptive blocks may be deleted
- 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
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 |
1---2name: skill-simplify3description: SKILL.md simplification with functional integrity verification. Analyze redundancy, optimize content, check no functionality lost. Triggers on "simplify skill", "optimize skill", "skill-simplify".4---5
6# Skill Simplify
7
8Three-phase pipeline: analyze functional inventory, apply optimization rules, verify integrity.
9
10**Phase Reference Documents** (read on-demand):
11
12| Phase | Document | Purpose |
13|-------|----------|---------|
14| 1 | [phases/01-analysis.md](phases/01-analysis.md) | Extract functional inventory, identify redundancy, validate pseudo-code format |
15| 2 | [phases/02-optimize.md](phases/02-optimize.md) | Apply simplification rules, fix format issues |
16| 3 | [phases/03-check.md](phases/03-check.md) | Verify functional integrity, validate format |
17
18## Input Processing
19
20```javascript
21const targetPath = input.trim()
22const targetFile = targetPath.endsWith('.md') ? targetPath : `${targetPath}/SKILL.md`
23const originalContent = Read(targetFile)
24const originalLineCount = originalContent.split('\n').length
25```
26
27## TodoWrite Pattern
28
29```javascript
30TodoWrite({ todos: [
31 { content: `Phase 1: Analyzing ${targetFile}`, status: "in_progress", activeForm: "Extracting functional inventory" },
32 { content: "Phase 2: Optimize", status: "pending" },
33 { content: "Phase 3: Integrity Check", status: "pending" }
34]})
35```
36
37## Core Rules
38
391. **Preserve ALL functional elements**: Code blocks with logic, agent calls, data structures, routing, error handling, input/output specs
402. **Only reduce descriptive content**: Flowcharts, verbose comments, duplicate sections, examples that repeat logic
413. **Never summarize algorithm logic**: If-else branches, function bodies, schemas must remain verbatim
424. **Classify code blocks**: Distinguish `functional` (logic, routing, schemas) from `descriptive` (ASCII art, examples, display templates) — only descriptive blocks may be deleted
435. **Merge equivalent variants**: Single/multi-perspective templates differing only by a parameter → one template with variant comment
446. **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
457. **Validate pseudo-code**: Check bracket matching, variable consistency, structural completeness
468. **Quantitative verification**: Phase 3 counts must match Phase 1 counts for functional categories; descriptive block decreases are expected
47
48## Error Handling
49
50| Error | Resolution |
51|-------|------------|
52| Target file not found | Report error, stop |
53| Check FAIL (missing functional elements) | Show delta, revert to original, report which elements lost |
54| Check WARN (descriptive decrease or merge) | Show delta with justification |
55| Format issues found | Report in check, fix in Phase 2 |