refactor-service

Diagnoses a microservice or pipeline and produces a behavior-preserving refactoring plan.

3|Updated Feb 15, 2025
One-click install
npx skills add https://github.com/mark-torres10/ai_tools --skill refactor-service-mark-torres10
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-service
Source: https://github.com/mark-torres10/ai_tools/tree/main/skills/refactor-service
Command: npx skills add https://github.com/mark-torres10/ai_tools --skill refactor-service-mark-torres10

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Refactoring a microservice or pipeline without a clear diagnosis often breaks behavior, misses test gaps, and skips documentation. This Skill inspects an existing service and produces a structured, behavior-preserving refactoring plan before any code changes happen. ## Core Features & Use Cases - Service Diagnosis: Maps service boundaries, entry points, data flow, invariants, modularity issues, test coverage, lint/type health, and docs status. - Structured Refactoring Plan: Produces sections covering invariants, refactor boundaries, modularization, test coverage, ruff/pyright/CI checks, READMEs, runbooks, discovered bugs, and rollback risks. - Planning-Only Safety: Enforces a hard boundary that no code, tests, configs, or docs are modified during diagnosis. - Use Case: Ask it to plan a refactor of an ETL pipeline service; it inspects the repo, records behavior contracts, and returns a diagnosis plus a plan a coding agent can later execute. ## Quick Start Ask the assistant to diagnose the service at a given path and produce a refactoring plan covering modularity, tests, lint/type health, README, and runbook without changing any code.

Frequently Asked Questions about refactor-service

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I plan a microservice refactor before changing code?

Run a diagnosis that maps the service boundary, traces the happy-path data flow, and records behavior invariants. Then produce a plan covering modularization, test coverage, lint/type checks, docs, and rollback risks before any implementation begins.

How to refactor a pipeline or ETL job without breaking behavior?

Capture behavior-preserving invariants such as schemas, output formats, idempotency, and retry semantics, and name the test that protects each one. Prefer small refactors with characterization tests around public behavior before moving internals.

Does this skill modify code during the refactoring diagnosis?

No. It is planning-only and enforces a hard boundary: it reads files and runs safe diagnostic commands but never changes code, tests, configs, CI, or docs. Implementation happens only in a later, explicitly requested step.

What should a service refactoring plan include for tests and CI?

It should list exact test files to add or update, fixtures needed, happy-path and failure-mode coverage, plus the exact ruff, pyright, test, and CI commands with expected passing results. Pre-existing failures are separated from failures the refactor must fix.

When should I not use a service refactoring planner?

Avoid it for broad architecture brainstorming without a concrete service target, for generic bug-finding code reviews, for rewrites that change behavior from scratch, or for implementation after a plan is already approved.