Skip to content
cccskills
FreePublished on GitHub

refactor

Plan, execute, and validate a codebase modernization or refactor with clean-slate thinking while preserving semantics. Use when the user asks how to approach a rewrite vs incremental change or what the risk is (strategy), is ready to apply a refactor plan safely (implementation), or asks whether a refactor broke anything or is complete (validation).

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19 stars(GitHub 19 + cccskills 0)

Run score Not tested

See how to install

Files included (4)

  • SKILL.md4.7 KB
  • references/implementation-playbook.md3.0 KB
  • references/strategy-guide.md1.3 KB
  • references/validation-checklist.md912 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Refactor

One skill, three phases (merged from the former refactor-strategy, refactor-implementation and refactor-validation skills on 2026-09-21). Run the host gate before and after.

Host gate means the repository's own full gate, named in its AGENTS.md/CLAUDE.md. In abi (/Users/donald/sources/repos/abi) that is ./tools/check.sh (it drives ./tools/cargo.sh; never invoke bare cargo there); hand-run cargo test there needs < /dev/null. A bare cargo test is not a gate: in a default-members workspace it can run zero tests and pass.

Phase 1: strategy

Use when: This skill should be used when the user asks how to approach a modernization — e.g. 'should we rewrite or do this incrementally', 'plan a refactor of X', 'what's the risk here' — at the start of significant work.

Provides structured approaches for modernizing codebases using clean-slate thinking while preserving semantics.

When to use

Apply this skill at the beginning of any significant modernization effort.

Core Principles

  • Always start by defining the ideal modern implementation ("what would this look like written today?").
  • Identify invariants and behavioral contracts that must be preserved.
  • Choose strategy based on risk, size, and coupling: incremental, strangler-fig phased, or full rewrite of a module.
  • Produce a concrete plan with milestones, validation gates, and rollback options.

Recommended Process

  1. Capture current behavior and success criteria (tests, contracts, SLAs).
  2. Sketch the ideal modern design (modules, types, error handling, concurrency model, APIs).
  3. Perform gap analysis between current and ideal.
  4. Decide transformation strategy:
    • Small/low-risk → direct rewrite of the module.
    • Large/high-risk → phased (strangler fig, parallel implementation, feature flags).
  5. Define validation criteria for each phase (parity tests, property tests, performance budgets).
  6. Document the plan with clear "Definition of Done" for each step.

Clean-Slate Mindset

When designing the target:

  • Use current language idioms and stdlib features.
  • Prefer explicit over implicit.
  • Design for testability and observability from day one.
  • Eliminate accidental complexity introduced by historical constraints.
  • Choose composition and clear boundaries.

Additional Resources

  • references/strategy-guide.md — detailed decision trees and examples of each strategy.
  • examples/sample-plan-outline.md — real plan outlines from previous modernizations.

Use this skill before touching code. Always run the host gate (see above) before and after.

Optional host settings

For repo-local strictness (focus areas, gate list, claims discipline), copy the example template from the modern-refactor package to the host project as an optional Claude-side local override file (host-side only; this skill does not ship or auto-load host overrides).

Phase 2: implementation

Use when: This skill should be used when the user is ready to execute a refactor plan and asks how to apply it safely — e.g. 'implement this modernization plan', 'extract this safely', 'how do I cut over without breaking things'.

Safe transformation techniques for applying modern designs while preserving behavior.

Principles

  • Write modern impl beside old (parallel) when risk high.
  • Use strangler fig for gradual cutover.
  • Validate at each step with the host gate, parity, contracts.
  • Prefer direct boring code.

Additional Resources

  • references/implementation-playbook.md
  • examples/parallel-extract-outline.md

Pair with the Rust-aware abi or refactor-planner agent for larger modules.

Phase 3: validation

Use when: This skill should be used when the user asks to verify a refactor is done correctly — e.g. 'did I break anything', 'is this refactor complete', 'validate this change meets modern standards' — as the final gate.

Validation layers for modernization: behavioral parity, modern quality, structural.

Layers

  • Behavioral: contracts, tests, host gate, check-parity pass.
  • Modern: apply patterns from modern-patterns, no legacy smells.
  • Structural: boundaries clean, no god files, explicit over implicit.

Additional Resources

  • references/validation-checklist.md

Run the validation skill plus a Rust-aware abi or refactor-planner agent review as the final step.

<!-- synced from central: ~/.grok/skills/refactor/SKILL.md -->

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Maintain the Abbey / Aviva / Abi Discord system prompts in the Rust abbey-bot (`src/ask.rs`) and keep the hosted Grok bots (Grok Bot Abbey, Aviva Grok) in step with them. Use when the user says "improve grok bots", "abbey prompt", "persona prompt", "ask.rs", "system prompt", "tip floor", asks to change how Abbey/Aviva/Abi speak on Discord, or after an abbey-bot PR merges and the hosted bot's tip floor needs bumping. Runs as /abbey-system-prompt.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

Validate ABI docs and external collateral against repo evidence and docs/contracts/external-claims-audit.mdx. Use when auditing claims, scanning docs for unsupported QPS/sharding/FHE/AES language, checking one claim before publish, or re-confirming the external-claims audit. Agent procedure only — not a CLI or slash command. Pair with abi-doc-claims-sync when editing docs.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

Synchronize ABI Markdown and docs claims with executable behavior. Use before editing README, AGENTS.md, CLAUDE.md, GEMINI.md, docs/**/*.mdx, walkthroughs, changelogs, or any old ABI Markdown that mentions WDBX, MCP, GPU, clustering, compression, FHE, agents, or benchmarks.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

Plan and execute ABI repo work from the TODO board, roadmap/spec docs, stable Rust 1.99.1 constraints, and validation gates. Use when the user asks to find ABI todos/roadmaps, organize a large implementation from tasks/todo.md, or decide the next safe work slice. Distinct from the goals skill — that skill owns the persistent ledger tasks/goals.md; this skill plans from the active board and north-star specs.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

Validate ABI MCP JSON-RPC stdio and its custom loopback HTTP compatibility endpoint, including auth, limits, notifications, and shutdown.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

Review ABI's 16 compiled-in plugin fixtures, manifest validation, manual bundled registry, and real CLI/MCP run dispatch without claiming dynamic loading.

The English summary is being prepared. Showing the original description.

donaldfilimon/abi19Updated Oct 27, 2026

See all skills by donaldfilimon

Report a problem with this skill