Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    StreamTeem Refactor

    1

    Stop shipping fragile code and start making structural improvements with confidence.

    $1.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    StreamTeem Refactor

    StreamTeem Refactor

    Example session with this skill installed

    Refactor the OrderProcessor class in src/services. It's too long and handles both validation and database persistence. I want to keep all behavior the same.

    • Read your context and instructions
    • Compiled the streamteem refactor

    I have analyzed OrderProcessor.ts and categorized this as a

    Planned refactor because it involves splitting responsibilities and potentially changing internal interfaces.

    Refactor: Decouple OrderProcessor Logic

    MetricBaselinePost-Refactor
    Unit Tests14 Passed, 0 Failed18 Passed (4 new pinning tests)
    Integration Tests5 Passed5 Passed
    Linter Warnings2 (Complexity)0
    Files Changedsrc/services/OrderProcessor.tsOrderProcessor.ts, OrderValidator.ts, OrderRepository.ts

    Changes Made

    • Extracted Validation: Moved logic from OrderProcessor.validate() to a new OrderValidator class.
    • Extracted Persistence: Moved db.save() calls to a dedicated OrderRepository.

    Pinned Behavior: Added characterization tests for the DiscountError edge case to ensure the specific error message string remained identical.

    • Cleaned Up: Removed unused imports for db-client within the main service.

    Found Along the Way

    • Found a potential bug in calculateTax() where rounding occurs twice; recorded in a characterization test but not "fixed" to preserve current behavior.
    • Identified that OrderRepository could be shared with RefundService in a future refactor.

    Next steps

    1. Review the new OrderValidator.ts and OrderRepository.ts files for architectural alignment.
    2. Approve the fix for the tax rounding bug identified during the baseline phase.
    3. Merge the characterization tests into the main branch to prevent future regressions.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Stop shipping fragile code and start making structural improvements with confidence. This skill provides a systematic approach to refactoring that prioritizes safety and behavior preservation. It addresses the common pain point of "refactor-induced regression" by enforcing a strict workflow: baseline testing, pinning untested behavior, and executing small, reversible steps.

    What it does

    • Pin behavior using characterization tests to capture current logic (even "odd" behavior) before structural changes.
    • Size work by categorizing tasks as Quick, Planned, or Large to prevent scope creep.
    • Diagnose smells with evidence-based findings mapped to specific files and line numbers.
    • Verify integrity through post-refactor comparisons against baseline test results, linting, and public surface checks.
    • Detect side effects by monitoring return values, error types, side-effect ordering, and concurrency.

    How it works

    1. Baseline and Scope: The skill checks git status, runs the full test suite, and records a baseline of passes, fails, and warnings.
    2. Safety Net: It analyzes coverage and writes characterization tests for untested paths to create a seam for safe editing.
    3. Planning: For non-trivial work, it generates a step-by-step plan into a decision log for approval.
    4. Execution: It applies changes one at a time, verifying with tests after every single modification to ensure green status.

    Frameworks & tools

    Works with any stack using git and local test runners. Integrates with language-specific refactoring tools, coverage reporters, and project linters.

    Why this beats prompting it yourself

    Generic prompts often lead to "rewrite" behavior that introduces bugs or changes public APIs. This skill enforces a professional engineering workflow that guarantees behavior remains identical while making the code significantly cheaper to maintain.

    Use cases

    • Decoupling logic from global state to enable unit testing.
    • Consolidating duplicate logic before adding new features.
    • Breaking down "God classes" or oversized functions into manageable units.
    • Cleaning up legacy codebases where the original intent is undocumented.

    Known limitations

    Does not support codebases without an executable test suite or environments where build tools are inaccessible. Requires user intervention if public interfaces have external callers.

    Requires an executable test suite and a clean git state. Cannot safely refactor code without a way to verify behavior. Limited to internal repository scope for public interface changes.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 4 days ago

    Requires

    Git
    Runnable local test suite

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Shell to run git status and the project test suite. Read/write to change code and add characterization tests. Verifies after every step.

    Listed4 days ago

    What's inside

    Frequently Asked Questions

    Unlike basic LLM prompts that often 'rewrite' code and introduce regressions, this skill enforces a strict engineering workflow using characterization tests and behavior-pinning to ensure the logic remains identical while the structure improves.

    The skill is compatible with any programming language or framework that uses Git and has a local test runner; it adapts to your existing linting and coverage tools to maintain your project's specific standards.

    No, the skill requires an executable test suite to function, as it relies on baseline comparisons and automated verification steps to guarantee that its structural changes haven't altered program behavior.

    The skill categorizes every task as Quick, Planned, or Large, generating a step-by-step decision log for any non-trivial changes so you can review and approve the plan before execution begins.

    You receive the full refactoring workflow logic, including the automated baseline recording, characterization test generation, and the iterative execution engine that verifies code integrity after every modification.

    New in Code Quality & Review