brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
refactor-skill-structureRefactor over-long or poorly structured SKILL.md. Extract examples to references/EXAMPLES.md, split compound procedures, reorganize sections for progressive disclosure. Use when skill exceeds 500-line CI limit, when code blocks dominate skill body, when a procedure step contains multiple unrelated operations, or after content update pushed skill over the li…
Independent GitHub snapshot · Automated classification · Original documentation governs
Refactor SKILL.md that exceeded 500-line limit or developed structural problems. This skill extracts extended code examples to references/EXAMPLES.md, splits compound procedures into focused sub-procedures, adds cross-references for progressive disclosure, verifies skill stays complete and valid after restructure.
references/EXAMPLES.md (default: yes, if extractable content exists)Read skill. Build section-by-section line budget to ID where bloat lives.
# Total line count
wc -l < skills/<skill-name>/SKILL.md
# Line count per section (approximate)
grep -n "^## \|^### " skills/<skill-name>/SKILL.md
Classify bloat sources:
Got: Line budget showing which sections over-sized and which bloat category applies to each. Largest sections = primary refactoring targets.
If fail: Skill under 500 lines and no structural issues apparent? This skill may not be needed. Verify refactoring request justified before proceed.
Move code blocks longer than 15 lines to references/EXAMPLES.md file. Keep brief inline snippets (3-10 lines) in main SKILL.md.
Create references directory:
mkdir -p skills/<skill-name>/references/
For each extractable code block:
references/EXAMPLES.md under descriptive headingSee [EXAMPLES.md](references/EXAMPLES.md#heading) for the complete configuration.Structure references/EXAMPLES.md with clear headings:
# Examples
## Example 1: Full Configuration
Complete configuration file for [context]:
\```yaml
# ... full config here ...
\```
## Example 2: Multi-Variant Setup
### Variant A: Development
\```yaml
# ... dev config ...
\```
### Variant B: Production
\```yaml
# ... prod config ...
\```
Got: All code blocks >15 lines extracted. Main SKILL.md keeps brief inline snippets for readability. Cross-references link to extracted content. references/EXAMPLES.md well-organized with descriptive headings.
If fail: Extract code blocks no reduces line count enough (still over 500)? Proceed to Step 3 for procedure splitting. Skill has very few code blocks (e.g., natural-language skill)? Focus on Steps 3 and 4 instead.
Identify procedure steps that perform multiple unrelated operations. Split them.
Signs of compound step:
For each compound step:
### Step N: for each operationGot: Each procedure step does one thing. No step exceeds 30 lines. Step count may rise but each step independently verifiable.
If fail: Splitting step creates too granular steps (e.g., 20+ total)? Group related micro-steps under single step with numbered sub-steps. Sweet spot = 5-12 procedure steps.
Ensure main SKILL.md keeps readability and discoverability after extraction.
For each extraction:
[EXAMPLES.md](references/EXAMPLES.md#section-anchor)Cross-reference patterns:
See [EXAMPLES.md](references/EXAMPLES.md#full-configuration) for the complete configuration with all options.See [EXAMPLES.md](references/EXAMPLES.md#variants) for development, staging, and production variants.See [EXAMPLES.md](references/EXAMPLES.md#troubleshooting) for additional error scenarios.Got: Every extraction has corresponding cross-reference. Reader can follow main SKILL.md for common case and drill into references for details.
If fail: Cross-references make text flow awkward? Consolidate multiple references into single note at end of procedure step: For extended examples including [X], [Y], and [Z], see [EXAMPLES.md](references/EXAMPLES.md).
Re-measure SKILL.md line count after all changes.
# Check main SKILL.md
lines=$(wc -l < skills/<skill-name>/SKILL.md)
[ "$lines" -le 500 ] && echo "SKILL.md: OK ($lines lines)" || echo "SKILL.md: STILL OVER ($lines lines)"
# Check references file if created
if [ -f skills/<skill-name>/references/EXAMPLES.md ]; then
ref_lines=$(wc -l < skills/<skill-name>/references/EXAMPLES.md)
echo "EXAMPLES.md: $ref_lines lines"
fi
# Total content
echo "Total content: $((lines + ${ref_lines:-0})) lines"
Got: SKILL.md under 500 lines. Ideally under 400 lines to leave room for future growth. references/EXAMPLES.md no line limit.
If fail: Still over 500 lines after extraction and splitting? Consider whether skill should split into two separate skills. Skill covering too much ground = sign of scope creep. Use create-skill to author second skill. Update Related Skills cross-references in both.
After refactoring, verify skill still has all required sections and frontmatter intact.
Run review-skill-format checklist:
# Quick section check
for section in "## When to Use" "## Inputs" "## Procedure" "## Common Pitfalls" "## Related Skills"; do
grep -q "$section" skills/<skill-name>/SKILL.md && echo "$section: OK" || echo "$section: MISSING"
done
grep -qE "## Validation( Checklist)?" skills/<skill-name>/SKILL.md && echo "Validation: OK" || echo "Validation: MISSING"
Got: All sections present. No content accidentally deleted during extraction. Cross-references in SKILL.md resolve to actual headings in EXAMPLES.md.
If fail: Section accidentally removed? Restore from git history: git diff skills/<skill-name>/SKILL.md to see what changed. Cross-references broken? Verify heading anchors in EXAMPLES.md match links in SKILL.md (GitHub-flavored markdown anchor rules: lowercase, hyphens for spaces, strip punctuation).
references/EXAMPLES.md with descriptive headingsreview-skill-format validation passes on refactored skillgrep -c "heading-text" references/EXAMPLES.md.review-skill-format — Run format validation after refactoring to confirm skill still compliantupdate-skill-content — Content updates often trigger structural refactoring when they push skill over line limitcreate-skill — Reference canonical structure when decide how to organize extracted contentevolve-skill — When skill needs split into two separate skills, use evolution to create derivative