SpecOpsPipeline: Lead-Worker Code Audit & Refactor

    1

    Orchestrate subagents to audit codebases and perform scoped refactors in isolated git worktrees.

    Free

    4 uses5.0 (1 review)

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    SpecOpsPipeline: Lead-Worker Code Audit & Refactor

    Example session with this skill installed

    Audit the current project for outdated error handling patterns and refactor them using the Lead-Worker workflow.

    • Read your context and instructions
    • Compiled the specopspipeline

    I have completed the preflight and audit of the codebase. I found 8 instances of legacy error handling patterns that should be migrated to the new Result type.

    Audit & Execution Plan

    Task IDSeverityScopeWorker TierDependency
    err-01Highsrc/auth/*StandardNone
    err-02Highsrc/api/v1/*StandardNone
    err-03Mediumsrc/utils/parsers.tsLightNone

    Gap Report Findings

    Finding [err-01]: src/auth/service.ts:42 - Uses throw-catch for flow control. Evidence: throw new AuthError(). Fix: Return Err(AuthError).
    2. Finding [err-02]: src/api/v1/router.ts:15 - Missing error propagation. Fix: Wrap response in Result wrapper.
    3.

    Finding [err-03]: src/utils/parsers.ts:89 - Native Error used instead of domain errors. Fix: Map to ParserError.

    Execution Plan

    • Mode: independent
    • Session: split (Recommended due to task count)
    • Parallelism: 3 workers
    • PR Mode: Open and Auto-merge on APPROVE

    Next steps

    1. Review the generated specs in .git/so-run/spec-*.md.
    2. Approve the plan to dispatch workers to their respective worktrees.
    3. Switch to the lead_phase2 model once I provide the resume command.

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

    About this skill

    Scale code audits and large-scale refactors without losing control or cluttering your context. This skill implements a Lead-Worker orchestration pattern that delegates specific, scoped tasks to subagents while you maintain the role of high-level architect and reviewer.

    What it does

    • Lead-Worker orchestration manages subagents to execute refactors in isolated git worktrees.
    • Automated gap analysis scans codebases read-only to produce structured findings and fix proposals.
    • Isolated execution enforces whitelists so subagents cannot touch files outside their assigned scope.
    • Dependency-aware scheduling runs independent tasks in parallel and related tasks in ordered stages.
    • Rigid verification gates every subagent contribution through Definition of Done (DoD) checks and diff reviews.

    How it works

    1. Preflight and Audit: The Lead scans the repository to identify issues and groups them into specific tasks.
    2. Spec and Plan: You approve an execution plan where each task has a dedicated spec, whitelist, and DoD criteria.
    3. Dispatch: Subagents are launched into separate worktrees to implement the fixes simultaneously.
    4. Gate and Review: The Lead validates each worktree against the whitelist and re-runs tests before approving the PR.

    Frameworks & tools

    Uses standard git worktree features, bash scripts for lifecycle management, and GitHub CLI for PR orchestration.

    Why this beats prompting it yourself

    Manual prompting for large refactors often leads to context drift, hallucinated file paths, and accidental regressions. This skill provides a structured state machine that isolates subagents, strictly enforces file boundaries, and automates the tedious verification of multi-file changes.

    Use cases

    • Legacy cleanup to remove technical debt across large directory structures in parallel.
    • Security patching by sweeping for vulnerabilities and delegating specific fixes to workers.
    • API migrations where repetitive changes across many files need strict verification.

    Known limitations

    Requires a functional git environment and existing test suites for DoD verification. Parallel worker limits are dictated by the host machine's resources and API rate limits.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.

    Requires git worktree support. Relies on existing repo test suites for DoD verification. Parallel worker execution is subject to model rate limits.

    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 buying a skill.

    Reviews

    5.0
    1 review
    5
    1
    4
    0
    3
    0
    2
    0
    1
    0

    This skill has been used 4 times.

    Trust & safety

    Security scan

    Security scan passed 3 days ago

    • Free with an Agensi account

    Software
    Git

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed26 days ago
    Updated3 days ago

    What's inside

    Frequently Asked Questions

    This skill prevents context drift and accidental regressions by isolating subagents in dedicated git worktrees with strict file whitelists, ensuring they only modify specific, pre-approved areas of your codebase.

    The skill requires a functional git environment, the GitHub CLI for PR management, and an existing test suite to power its 'Definition of Done' verification gates.

    Yes, the Lead-Worker orchestration allows you to run independent refactoring tasks in parallel, with the Lead agent managing dependency-aware scheduling to ensure related tasks are handled in the correct order.

    You receive the complete orchestration logic for the Lead-Worker pattern, the automated gap analysis modules, and the lifecycle scripts for managing isolated git worktrees.

    The skill uses a 'Spec and Plan' stage where the Lead agent generates a structured proposal for you to review and approve before any subagents are dispatched to modify code.

    New in Agents & Orchestration

    Free