- Home
- Skills
- Code Quality & Review
- untangle
untangle
Systematically audit, triage, and refactor AI-generated codebases to remove duplicates and restore architectural integrity.
Free
Works with the AI Agents you already use
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
| ID | Finding | Location | Risk | Evidence |
|---|---|---|---|---|
| F-001 | Duplicate Auth Logic | src/auth/ | High | Both AuthService and IdentityManager handle session validation. |
| F-002 | Blind Test Suite | tests/auth.spec.ts | Critical | Test passed despite verifyToken returning true unconditionally. |
| F-003 | Dead Code Suspect | src/utils/legacy-parser.ts | Low | No static imports found; search for dynamic callers pending. |
| F-004 | Config Drift | config/default.json | Med | Three 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
- Review the full
UNTANGLE.mdledger for detailed command logs and coverage mapping. - Approve the proposed winners for the Auth consolidation in the Triage table.
- 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.mdfile 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.mdand CI configurations to ensure technical debt and "tangle" do not return.
How it works
- Audit phase runs baseline commands and maps the repo structure to identify high-risk areas without changing a single line of code.
- Triage phase presents a table of findings to the human, recommending which code to keep, fix, or remove based on risk and impact.
- Refactor phase executes approved changes on a dedicated branch, verifying every step with characterization tests and baseline checks.
- 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.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.
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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
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 to use
No account required to browse
Trust & safety
Security scan
Security scan passed 7 days ago
- Free with an Agensi account
- Software
Node.js
Git