Skip to content

mikemindel/restructure-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Restructure — a Claude Code Agent Skill

A Claude Code Agent Skill that restructures a codebase by applying the Single Responsibility Principle — one extraction per cycle, verify, commit, reassess. It changes the shape of a system (module and class boundaries) rather than the internals of any one function.

Restructure modules by applying the Single Responsibility Principle — one extraction per cycle, commit, reassess. Triggers on "restructure", "split this module", "SRP refactor".

This repository is a portfolio example of an Agent Skill I designed and built. It's extracted from a larger private skill library; the sibling skills and reference docs it depends on are vendored here (under skills/ and docs/) so every cross-reference resolves and you can read it as it actually runs.


What it does

Given a module that has grown to hold several responsibilities, the skill runs a disciplined loop:

  1. Assess — score each file for structural tension (complexity × churn), so effort lands where it pays.
  2. Pick one extraction — the single highest-priority split, chosen by an explicit lexicographic rule, not a vibe.
  3. Execute in a fresh sub-agent — no accumulated context to bias the change.
  4. Verify against a gate — the change must match its stated intent before it lands.
  5. Commit atomically, then reassess — the next cycle starts from the new reality, never a stale plan.

The design choice throughout: make future change easier, one small reversible step at a time.

How it's built

Piece What it demonstrates
skills/restructure/SKILL.md The stable principles — the entry point Claude reads first
WORKFLOW.md The orchestrator + fresh-sub-agent execution model, phase by phase
PRIORITIES.md The lexicographic priority ladder — check one thing at a time, act on the highest that fires
scripts/tension_score.py Deterministic Python scoring (complexity × churn), with a passing unit-test suite
reference/ The design rationale — including a post-mortem on a taxonomy approach that didn't converge

The architecture leans on a few reusable patterns, all included here as context: an orchestrator + sub-agent execution model, a loop-until-satisfied verification gate, and the restructuring-vs-refactoring distinction that defines the skill's boundary.

Run the tests

cd skills/restructure/scripts
python3 -m pytest tests/ -q

Repository layout

skills/
  restructure/        the skill itself — SKILL, WORKFLOW, PREPARE, PRIORITIES, reference/, scripts/
  srp/ agility/ ...   sibling skills it references, vendored so links resolve
docs/                 the patterns, distinctions, and principles it builds on

skills/restructure/ is the work. Everything else is the surrounding context, included verbatim so nothing is a dead link.

Author

Built by Mike Mindel.

Licence

MIT.

About

A Claude Code Agent Skill that restructures a codebase by applying the Single Responsibility Principle — a portfolio example of skill authoring.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages