Install
$ agentstack add skill-smykla-skalski-sai-refactor-council ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Refactor Council (Copilot)
Summon seven sourced refactoring-and-architecture reviewer agents, then produce a safety-first, sequenced refactoring plan that a separate adversary agent has stress-tested. The reviewers are native Copilot custom agents bundled with this plugin; the current session agent acts as the orchestrator. The reviewers argue from the writers' actual published positions and disagree with each other on purpose - the disagreement is the value.
The roster (7 + adversary)
Bundled as custom agents under agents/ (namespaced, e.g. refactor-council:fowler-refactoring-reviewer). Registry and symptom map: [references/refactoring-catalog.md](references/refactoring-catalog.md) for the smell/refactoring vocabulary and safety discipline.
| Reviewer agent | Lens | |---|---| | fowler-refactoring-reviewer | Refactoring catalog + smells; small behavior-preserving steps; two hats; Rule of Three; Strangler Fig | | martin-clean-architecture-reviewer | SOLID; Clean Architecture & the Dependency Rule; small functions; naming; frameworks/DB as details | | feathers-legacy-reviewer | Legacy = code without tests; seams; characterization tests; Sprout/Wrap; get-it-under-test-first | | beck-tidy-first-reviewer | Structural vs behavioral changes; tidyings; coupling/optionality economics; baby steps | | metz-abstraction-reviewer | Duplication over the wrong abstraction; flocking rules; squint test; depend on stable things | | ousterhout-deep-module-reviewer | Deep modules; complexity is the enemy; anti-over-decomposition; comments are load-bearing | | tornhill-hotspot-advisor | Behavioral code analysis; hotspots (complexity x churn); change coupling; where to refactor |
After synthesis, refactor-adversary red-teams the findings and plan.
Parsing the request
- Read flags:
--no-scan,--no-adversary,--since(default12.month),--personas(subset of the seven; default all seven). - The remaining text is the target: a path, a directory, an
@file, ordiff(usegit diff). If none is resolvable, ask which file/dir/diff to review - do not invent one.
Workflow
Phase 1 - Setup
Resolve the target. Read [references/refactoring-catalog.md](references/refactoring-catalog.md) so you and the reviewers name smells and refactorings precisely and enforce the safety discipline in the plan.
Phase 2 - Scan (skip if --no-scan)
Run the bundled scanners via shell and gather a compact evidence bundle:
- Smells:
python3 scripts/smell_scan.py --human - Hotspots (git repos only):
python3 scripts/hotspots.py --since --human - Safety net: detect tests near the target (
*_test.*,*.test.*,*.spec.*,test/,tests/,__tests__/). Record present / absent / partial.
The bundle (top located smells, top hotspots + coupling pairs, test-net status) is load-bearing - pass it to every reviewer. If not a git repo or history is shallow, say so and note that prioritization is weakened.
Phase 3 - Reviewer delegation (sequential by default)
Delegate each selected reviewer through the agent tool, giving each: the target context, the scan evidence bundle, the Persona output contract below, and the instruction that the first line must be ## review.
Default to sequential delegation - one reviewer at a time. Copilot parallel fan-out via /fleet over-parallelizes and burns AI credits, and offers no reliability guarantee for an 8-agent council; sequential delegation is the reliable path here. Only fan out in parallel if the user explicitly asks, and then run small waves ( review` and contain the contract sections. Re-delegate an invalid reviewer once with the same bundle; if still invalid, continue and note the missing lens. Never surface raw reviewer envelopes or readiness text.
Phase 4 - Synthesize (critique + plan)
Write one integrated review using the Synthesis output shape below. Surface disagreement (especially Uncle Bob vs Ousterhout on functions/comments; Uncle Bob's DRY reflex vs Metz; decomposition vs Ousterhout); do not flatten it. Include the safety-net status, a sequenced smallest-first refactoring plan (characterization-tests-first when untested; structural vs behavioral separated, two hats), and an explicit "Do NOT refactor" list (cold code, duplication cheaper than abstraction, extraction that adds complexity).
Phase 5 - Adversarial pass (skip only if --no-adversary)
Delegate refactor-adversary with the full synthesized review (findings + plan), the target context, and the scan evidence. It returns SHIP / SHIP WITH CHANGES / HOLD plus challenged recommendations, what survived scrutiny, unsafe-as-sequenced reordering, and what the council missed. Apply the same validate-and-retry rule once.
Phase 6 - Final output
Fold the adversary verdict in before presenting: REJECT/REORDER/WEAKEN revise the plan in place; mark "survived scrutiny" items high-confidence; add a "Risks the council missed" section; if HOLD, lead with it and do not present the contested step without the fix. Keep reviewer framing internal (see Privacy).
Persona output contract
## review
### What I see
### What concerns me
### What I'd refactor and how
target, smallest-first>
### Safety net I'd require first
### Where I'd be wrong
Synthesis output shape
# Refactoring review:
## Convergence (high-confidence signals)
## Disagreement (real tradeoffs you must decide)
## Per-persona top-3
## Safety net status
## Refactoring plan (sequenced, smallest-first)
## Do NOT refactor (and why)
## Risks the council missed (from the adversary)
## Adversary verdict
(Same content as the Claude skill: convergence first, named disagreement, per-persona top-3 in voice, safety-net status with characterization-tests-first when untested, a sequenced behavior-preserving plan with structural vs behavioral marked, an explicit do-not-refactor list, and the adversary's caught risks and verdict.)
Privacy / scope
The reviewer dossiers under agents/references/ are private review aids derived from each thinker's public writing. Do not republish wholesale; keep reviewer framing internal - if a review leaves the team, restate the argument in your own voice. This is a refactoring council: it preserves behavior by definition, so it does not by itself verify correctness, security, or performance. The adversary partially covers those gaps; for a full audit use a staff-level or language-specific review.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: smykla-skalski
- Source: smykla-skalski/sai
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.