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 procs, reorg for progressive disclosure. Use → skill > 500-line CI limit, code blocks dominate, proc step has multi unrelated ops, or update pushed over limit.
Independent GitHub snapshot · Automated classification · Original documentation governs
Refactor SKILL.md exceeded 500-line limit or w/ structural problems. Extract code examples to references/EXAMPLES.md, split compound procs into focused sub-procs, add cross-refs for progressive disclosure, verify skill complete + valid after restructure.
references/EXAMPLES.md? (default yes if extractable)Read skill + create section line budget → ID bloat.
# Total line count
wc -l < skills/<skill-name>/SKILL.md
# Line count per section (approximate)
grep -n "^## \|^### " skills/<skill-name>/SKILL.md
Classify bloat:
→ Line budget showing oversized sections + bloat category. Largest = primary refactor targets.
If err: skill < 500 lines + no structural issues → skill not needed. Verify request justified.
Move code blocks > 15 lines to references/EXAMPLES.md, leave brief inline (3-10 lines) in main.
Create dir:
mkdir -p skills/<skill-name>/references/
For each extractable block:
references/EXAMPLES.md w/ descriptive headingSee [EXAMPLES.md](references/EXAMPLES.md#heading) for the complete configuration.Structure references/EXAMPLES.md w/ 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 ...
\```
→ All blocks > 15 lines extracted. Main SKILL.md keeps brief inline. Cross-refs link to extracted. references/EXAMPLES.md well-organized.
If err: extracting doesn't reduce enough (still > 500) → Step 3 splitting. Few code blocks (natural-lang skill) → focus Steps 3 + 4.
ID proc steps doing multi unrelated ops + split.
Signs compound step:
For each compound:
### Step N: for each→ Each proc step does one thing. No step > 30 lines. Step count may grow but each indep verifiable.
If err: splitting → too granular (20+ total) → group related micro-steps under single step w/ numbered sub. Sweet spot 5-12 steps.
Ensure main SKILL.md maintains readability + discoverability after extract.
For each extraction:
[EXAMPLES.md](references/EXAMPLES.md#section-anchor)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.→ Every extraction has cross-ref. Reader follows main for common case, drills into refs for detail.
If err: cross-refs make text awkward → consolidate multi refs into single note at end of step: For extended examples including [X], [Y], and [Z], see [EXAMPLES.md](references/EXAMPLES.md).
Re-measure SKILL.md after 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"
→ SKILL.md < 500. Ideal < 400 → room future growth. references/EXAMPLES.md no limit.
If err: still > 500 after extract + split → skill should decompose into 2 separate skills. Too much ground = scope creep. Use create-skill for second + update Related Skills cross-refs both.
After refactor, verify skill has all required sections + 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"
→ All sections present. No content accidentally deleted during extract. Cross-refs in SKILL.md resolve to actual headings in EXAMPLES.md.
If err: section accidentally removed → restore from git: git diff skills/<skill-name>/SKILL.md. Cross-refs broken → verify heading anchors in EXAMPLES.md match links in SKILL.md (GitHub anchor: lowercase, hyphens for spaces, strip punctuation).
references/EXAMPLES.md w/ descriptive headingsreview-skill-format validation passesgrep -c "heading-text" references/EXAMPLES.md.review-skill-format — run format validation after refactor → confirm compliantupdate-skill-content — content updates often trigger structural refactor when push over limitcreate-skill — reference canonical structure when deciding how to organize extractedevolve-skill — split into 2 separate skills → use evolution to create derivative