architectural-refactor_skill

This skill turns architectural assessments into a safe, verifiable refactor by executing plan-driven chunks with progress tracking and automated verification.
  • Makefile

2

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

3 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill petekp/agent-skills --skill architectural-refactor

  • SKILL.md12.8 KB

Overview

This skill executes architectural refactors deterministically by turning an assessment into a concrete, chunked plan and enforcing strict verification gates at every step. It externalizes progress to on-disk plan, manifest, and log files so work can resume safely after any context loss. The approach prevents agent drift by refusing to improvise and by requiring explicit user sign-off for plan changes.

How this skill works

Ingest an assessment and extract specific changes, target architecture, and ordering constraints. Build a refactor-plan of ordered, independently verifiable chunks, initialize a machine-readable manifest to track progress, and append activity to a human-readable log. Execute each chunk only if entry criteria pass, run full verification (tests/types/lint), commit changes, and update the manifest; stop and escalate on any unexpected failure.

When to use it

  • You have an architectural assessment, simplicity audit, or seam-ripper output and need to enact its recommendations safely.
  • You want to refactor a codebase in deterministic, reviewable increments rather than large, risky sweeps.
  • You need multi-session continuity so an agent or human can resume work without relying on chat context.
  • You require aggressive verification gates (tests, typechecks, linters) between every change.
  • You want to avoid agents making ad-hoc design decisions during refactoring.

Best practices

  • Write chunks that are independently verifiable and committable; prefer many small meaningful chunks over vague large ones.
  • Detect verification commands on first run and record them in the manifest so gates are stable across sessions.
  • Stop and ask when the assessment is ambiguous or a step cannot be performed as written—don’t improvise.
  • Ensure pre-flight checks: all tests pass and there are no uncommitted changes before starting.
  • Keep the manifest and log committed so any session can resume by reading disk files only.

Example use cases

  • Extract an auth token service into a new module following a security audit recommendation.
  • Incrementally decouple an API layer from core business logic across several committed chunks.
  • Apply seam-ripper findings to remove dead code and verify each removal via tests and linters.
  • Restructure module dependencies to invert a problematic dependency edge without breaking the build.
  • Handoff a partially completed refactor to another agent or engineer with full context on disk.

FAQ

The skill stops, attempts up to two fixes if clearly caused by the chunk, otherwise reverts the chunk, logs the failure, updates the manifest, and asks the user for direction.

Can the agent change the plan during execution?

Only with explicit user approval. If the agent discovers the plan is wrong, it stops, documents the issue, and requests a plan update before proceeding.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
architectural-refactor skill by petekp/agent-skills | VeilStrat