untangle

    1

    Systematically audit, triage, and refactor AI-generated codebases to remove duplicates and restore architectural integrity.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    untangle

    Example session with this skill installed

    audit the current repository and start the untangle ledger. check if the tests actually work by breaking the auth logic temporarily.

    • Read your context and instructions
    • Compiled the untangle

    I have completed the initial Audit phase. I ran the baseline commands (npm install, npm test) and performed a "test the tests" check on the authentication logic. While the suite passed initially, it failed to notice when I manually bypassed the JWT verification in src/auth/service.ts, which has been logged as a high-risk finding.

    Audit Findings Summary

    IDFindingLocationRiskEvidence
    F-001Duplicate Auth Logicsrc/auth/HighBoth AuthService and IdentityManager handle session validation.
    F-002Blind Test Suitetests/auth.spec.tsCriticalTest passed despite verifyToken returning true unconditionally.
    F-003Dead Code Suspectsrc/utils/legacy-parser.tsLowNo static imports found; search for dynamic callers pending.
    F-004Config Driftconfig/default.jsonMedThree different database connection strings defined; only one is used.

    Scorecard

    • Build/Install: Pass
    • One way to do things: Fail (Auth, Data Access)
    • Tests catch regressions: Fail
    • Decisions documented: Fail

    Next steps

    1. Review the full UNTANGLE.md ledger for detailed command logs and coverage mapping.
    2. Approve the proposed winners for the Auth consolidation in the Triage table.
    3. Authorize the creation of characterization tests for the src/auth/ slice.

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

    About this skill

    AI-assisted development often leaves a trail of duplicate logic, dead code, and tests that pass without actually verifying behavior. This skill systematically audits and cleans "slop" from repositories where rapid generation has outpaced architectural integrity. It replaces vague cleanup efforts with a rigorous, evidence-based ledger that tracks every finding from discovery through to verified refactoring.

    What it does

    • Architectural Auditing performs a read-only analysis of entry points, import directions, and high-risk modules like auth and data writes.
    • Decision Ledgering maintains an UNTANGLE.md file to track findings, proposed fixes, and human approvals across multiple sessions.
    • Test Validation executes "test the tests" cycles by deliberately breaking business rules to see if the existing suite catches regressions.
    • Surgical Refactoring consolidates competing implementations into a single "winner" based on usage frequency and framework conventions.
    • Enforcement Setup creates AGENTS.md and CI configurations to ensure technical debt and "tangle" do not return.

    How it works

    1. Audit phase runs baseline commands and maps the repo structure to identify high-risk areas without changing a single line of code.
    2. Triage phase presents a table of findings to the human, recommending which code to keep, fix, or remove based on risk and impact.
    3. Refactor phase executes approved changes on a dedicated branch, verifying every step with characterization tests and baseline checks.
    4. Sustain phase locks in the clean state by updating READMEs, lint rules, and agent instructions.

    Frameworks & tools

    Works with any stack that provides a CLI for building, linting, and testing. It uses ephemeral analysis tools via npx, uvx, or go run to avoid polluting the project's permanent dependency list.

    Why this beats prompting it yourself

    Generic cleanup prompts often result in massive, unreviewable diffs or new abstraction layers that add more complexity. This skill enforces a "subtract only" rule and requires a documented audit trail, ensuring that every deletion is proven safe and every consolidation is human-approved.

    Use cases

    • Auditing a repo built entirely by agents to find hidden technical debt.
    • Consolidating three different ways the app handles authentication or error logging.
    • Safely removing "dead" code that might still be reached by dynamic lookups.
    • Preparing a legacy codebase so it is safe for other coding agents to work in.

    Known limitations

    Does not perform full rewrites or add new dependencies. Requires an existing build/test suite to verify behavior. Dynamic reach analysis for dead code is limited to string and config lookups.

    Requires a functional build and test suite for verification. Cannot automatically rotate leaked credentials. Refactors are limited to approved findings in the ledger.

    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

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 7 days ago

    • Free with an Agensi account

    Requires

    Node.js
    Git

    Permissions

    Terminal / Shell
    Write Files
    Listed7 days ago

    What's inside

    Frequently Asked Questions

    Untangle specializes in 'de-slopping' repositories where rapid AI generation has created redundant logic and architectural drift. Unlike generic prompts, it uses a structured ledger system to prove every deletion is safe and every consolidation follows your project's specific conventions.

    Untangle is framework-agnostic and works with any stack that has a CLI for building and testing (Node.js, Python, Go, etc.). It runs via ephemeral tools like npx or uvx, ensuring no unnecessary dependencies are added to your project's permanent package file.

    Safety is central to the skill; it operates on a dedicated branch and utilizes a 'Decision Ledger' (UNTANGLE.md) where a human must approve triage recommendations before any refactoring begins. It also performs 'test the tests' cycles to ensure your existing suite is actually capable of catching regressions.

    You receive the full skill package including the audit workflows, the Decision Ledger templates, and the 'Sustain' phase configuration files like AGENTS.md. These components work together to not only clean your current debt but prevent future AI agents from re-introducing 'tangle' to your codebase.

    Untangle requires an existing build and test suite to verify its changes. While it excels at identifying dead code and duplicate logic, it is designed for surgical refactoring rather than performing full architectural rewrites or adding new third-party libraries.

    New in Code Quality & Review