Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/incommensurablehubris/fullstack-director/08-refactornpx skills add IncommensurableHubris/fullstack-director --skill 08-refactorgit clone --depth 1 https://github.com/IncommensurableHubris/fullstack-directorWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/incommensurablehubris/fullstack-director/08-refactor)<a href="https://agentmods.dev/skills/incommensurablehubris/fullstack-director/08-refactor"><img src="https://agentmods.dev/badge/skills/incommensurablehubris/fullstack-director/08-refactor.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00244 | $0.03861 |
| Opus 5 | $0.00122 | $0.01930 |
| Sonnet 5 | $0.00049 | $0.00772 |
| Haiku 4.5 | $0.00024 | $0.00386 |
Grade A, and why
08-refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.
08 · Refactor — improve structure, preserve behavior, reconcile
A cross-cutting refactor activity (named by function, not an SDLC seat — like status). It fills the gap between
05's within-sprint tidy and a rewrite: after several sprints, structural debt accrues that no one sprint owns —
cross-cutting duplication, dead code, god files, doc drift. 08 improves structure while preserving behavior,
reconciles the realization docs, and appends amendment rows only where a refactor surfaces a declaration
contradiction.
Kent Beck's rule frames it: "For each desired change, make the change easy (warning: this may be hard), then make the
easy change." 08 is the first half — it makes future change easy by improving structure without changing what the
software does. Its graded value is not "cleaner code" (a strong engineer writes that too). It is the provably
behavior-preserving change + the correctly-routed reconcile (a local doc fix vs a gated spine amendment) that
/status and the release gate can trust.
The seat's two defining properties
- Sequential — no subagents.
shared/subagent-protocol.md: "Build and refactor stay sequential." The health pass is a single sequential read, not a parallel panel; Reconcile runs INLINE —08's Reconcile-sibling is02(the first inline appender), not03(which spawns a subagent). Nothing here spawns. - Appender — but most findings are local.
shared/spec-amendment-protocol.md: the appenders are 00 / 02 / 03 / 08.08emitsamendment-log.jsonrows — but only for declaration-level findings. A code↔doc drift is a realization fix, corrected locally, never an amendment.
Operating principle — improve structure, preserve behavior, reconcile locally, escalate only declarations
- Two Hats (Fowler). Either you change structure or behavior — never both in a commit. A bug found
mid-refactor routes to
/05; a vuln to/07; a feature to/04.08fixes none of them — it notes and routes. A smell is08's iff it is maintainability, not a bug, a vuln, or missing behavior. - Behavior preservation is the non-negotiable gate (below) — the safety-net oracle, unchanged, green before and
after, and still biting. This is
08's honesty gate, the analog of05's EXECUTED gate. - Baby steps + explicit move-typing. One named move (Extract Method/Module, Move, Inline, Rename, Replace Conditional…) → run the oracle → commit, or revert-don't-debug. Telling the model the exact move type is the single biggest accuracy lever (ICSE: 15.6%→86.7% vs "clean this up").
- Reconcile: critic, not builder. Bound findings to "changes this slice / violates the contract." A clean, healthy slice yields ~zero refactors and ~zero amendments — surfacing invented ones is the crying-wolf failure mode.
What ships with it
38 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- evals/build_fixture.py 7.4 KB runs code
- evals/check_refactor.py 25 KB runs code
- evals/evals.json 15 KB
- evals/fixtures/app/.gitignore 28 B
- evals/fixtures/app/package-lock.json 263 B
- evals/fixtures/app/package.json 330 B
- evals/fixtures/app/src/auth.js 900 B runs code
- evals/fixtures/app/src/digest.js 944 B runs code
- evals/fixtures/app/src/server.js 1.8 KB runs code
- evals/fixtures/app/src/store.js 1.1 KB runs code
- evals/fixtures/app/test/api.test.js 891 B runs code
- evals/fixtures/base/docs/architecture/adr/ADR-001.md 668 B
- evals/fixtures/base/docs/architecture/adr/ADR-002.md 1.3 KB
- evals/fixtures/base/docs/architecture/adr/README.md 548 B
- evals/fixtures/base/docs/architecture/system.md 4.3 KB
- evals/fixtures/base/docs/planning/sprints/sprint-02.md 1.6 KB
- evals/fixtures/base/docs/quality/qa-report-sprint-02.md 1022 B
- evals/fixtures/base/docs/spec/amendment-log.json 659 B
- evals/fixtures/base/docs/spec/architecture-constraints.md 1.2 KB
- evals/fixtures/base/docs/spec/capabilities/api.md 1.6 KB
- evals/fixtures/base/docs/spec/capabilities/digest.md 1.9 KB
- evals/fixtures/base/docs/spec/capabilities/standups.md 844 B
- evals/fixtures/base/docs/spec/specification.md 2.8 KB
- evals/fixtures/cases/behavior-trap/src/digest.js 1.9 KB runs code
- evals/fixtures/cases/behavior-trap/test/api.test.js 1.8 KB runs code
- evals/fixtures/cases/clean/.gitkeep 184 B
- evals/fixtures/cases/needs-refactor/docs/architecture/system.md 3.7 KB
- evals/fixtures/cases/needs-refactor/src/digest.js 2.1 KB runs code
- evals/fixtures/cases/needs-refactor/test/api.test.js 2.1 KB runs code
- evals/fixtures/cases/reconcile/docs/spec/architecture-constraints.md 1.7 KB
- evals/README.md 11 KB
- references/health-assessment.md 4.4 KB
- references/reconcile-refactor.md 6.4 KB
- references/refactor-execution.md 3.9 KB
- references/refactoring-catalog.md 4.6 KB
- templates/health-assessment.md 1.6 KB
- templates/refactor-plan.md 1.4 KB
- templates/refactor-report.md 1.5 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 167 lines · 244 tokens per session scan A 394d968baf55
08-refactor is a skill published in the GitHub repository IncommensurableHubris/fullstack-director (5 stars, last pushed 24d ago), licensed MIT. It adds 244 tokens to every session and 3,861 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
gsd-audit-milestone
Audit milestone completion against original intent before archiving.
spec-kitty-charter-doctrine
Run charter interview, generation, context, and sync workflows for project governance in Spec Kitty 3.x. Access doctrine artifacts programmatically via DoctrineService. Resolve agent profiles. Load action-scoped governance context iteratively, not all at once. Triggers: "interview for charter", "generate charter"…
spec-kitty-spdd-reasons
Drive REASONS Canvas authoring and review for Spec Kitty missions that opted in to Structured-Prompt-Driven Development (SPDD) via charter selection. Triggers: "use SPDD", "use REASONS", "generate a REASONS canvas", "apply structured prompt driven development", "make this mission SPDD". Does NOT handle: enforcing SPDD…
conductor-implement
Executes the tasks defined in the specified track's plan. Use this to start or continue working on a feature, bug fix, or chore.
dependency-upgrade
Plan, batch, and verify dependency upgrades safely. Triages outdated packages into risk tiers, upgrades in order (dev/minor/patch first, runtime majors last), verifies each batch, and produces an auditable commit sequence. Use when asked to "upgrade deps", "bump packages", "update nodemodules", "fix vulnerabilities"…
forensics
Post-mortem a failed GSD auto-mode run. Traces symptom to root cause via .gsd/ activity, journal, metrics, and lock artifacts, producing a filing-ready bug report with file:line refs and a fix suggestion. Use when asked to "forensics", "post-mortem", "why did auto-mode fail", "trace the stuck loop", "debug the crash"…