Refactor
Skill rulebased-io/claude-plugin/packages/second-brain/skills/refactor
Split large notes into atomic pieces or merge small related notes. Update all wiki-links after restructuring. Use when notes have grown too large or are too fragmented.From its SKILL.md
npx -y skills add rulebased-io/claude-plugin --skill refactorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.9 KB, 682 tokens by cl100k_base, as published. Nobody here has run it
Reshape notes to maintain atomic note principles.
When to Use
- A note has grown too large (500+ lines)
- Multiple small notes cover the same topic
- Moving notes between folders
- Reorganizing after a connect or organize session
/rulebased-second-brain:refactorinvoked
Procedure
Read AGENTS.md Structure table for folder locations and system/conventions.md for frontmatter rules before proceeding.
Mode 1: Split a Large Note
- Read the target note fully.
- Identify natural split points: separate topics, distinct h2/h3 sections, different content types
- Propose split plan:
Split "system-design-notes.md" (450 lines) into: 1. load-balancing.md — lines 1-120 2. database-sharding.md — lines 121-280 3. caching-layers.md — lines 281-400 4. system-design-overview.md — lines 401-450 (MOC) Proceed? [yes / adjust / cancel] - Execute split:
- Create each new note with frontmatter per
system/conventions.md - Inherit tags from the original
created= original'screated,updated= now- Add cross-links between all split notes via
relatedfield - Create a summary/MOC note if 3+ pieces
- Create each new note with frontmatter per
- Update references: find all
[[wiki-links]]to original → update to most relevant split note - Handle original: move to
archives/with redirect note
Mode 2: Merge Small Notes
- Identify merge candidates (or accept user selection):
- Overlapping tags AND similar titles
- Notes < 20 lines that reference each other
- Multiple inbox items on the same topic
- Propose merge plan and get approval
- Execute merge:
- Choose the most complete note as target
- Append content under clear section headers
- Combine tags (deduplicate)
- Update
updatedtimestamp
- Update references: redirect all links from merged-away notes to target
- Archive merged-away notes with redirect marker
Mode 3: Move / Promote
Read AGENTS.md to determine valid destination folders. Common moves:
inbox/→ content folder (promote from capture to organized)- Any folder →
archives/(archive inactive content) - Between content folders (reclassify)
Update all references, related fields, and frontmatter after move.
Rules
- Never lose content during refactoring. Every line from original must appear in result.
- Always update
[[wiki-links]]across the entire brain after any move/split/merge. - Archive originals instead of deleting them.
- Show a clear before/after plan and get user approval before executing.
- Preserve original
createddates. Only updateupdated. - If a split creates a note < 10 lines, warn that it might be too small.
- Use folder paths from AGENTS.md, not hardcoded paths.
$ARGUMENTS
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.