skywalkskills

CatalogueArchitecture & Code Health

D3Ready

Dead Code, Duplication & Complexity Audit

Finds code nothing calls, logic copied in several places, and functions that have grown past what a reviewer can hold.

What it examines

  • Code with no remaining callers
  • Duplicated logic that will drift
  • Functions and files whose complexity dominates a change
  • Where a deletion or a merge is safe

What you get back

A findings file. Each item has the evidence, how serious it is, and a fix.

Dependencies

  • An AI coding agent that reads SKILL.md files, such as Claude Code, Codex or Gemini CLI
  • Read access to the repository
  • Git history. A snapshot of the files without history is not enough.
  • Node.js, to run the analysis tool that ships in the package’s tool folder
  • For the remediate skill: a build and test command that works, so every deletion can be proven safe
  • Python 3 with the jsonschema package, to check findings.json before fixing anything

How it works

The audit is read-only and works from the repository alone. It calls code dead only when two signals agree: nothing references it, and the file has not been touched in a long time compared with the pace of the repository.

It also finds duplicated code and overly complex functions. The symbol detection is a pattern set, not a full parser, and the report says so when your main language is not well covered.

The remediate skill reads findings.json. For dead code it deletes, runs your build and tests, and rolls the deletion back automatically if they fail.

Setup

  1. Unzip the download and keep the whole folder. Copy its audit and remediate folders into your agent's skills folder (for Claude Code, .claude/skills/) in the repository you want to check.
  2. Confirm Node.js is installed and the repository is a full clone with history. Check that your build and tests pass before you start.
  3. Open the repository in your agent and ask it to run the d3-dead-code-duplication-complexity-audit skill.
  4. Check the result with the validator: pip install jsonschema, then python3 path/to/the-unzipped-folder/schema/validate.py findings.json.
  5. Ask your agent to run the d3-dead-code-duplication-complexity-remediate skill using findings.json. Fix some findings and leave the rest open if you like.

Run it with your agent

Copy the prompt, fill in the parts in square brackets, and paste it into your agent.

Audit prompt

Run the d3-dead-code-duplication-complexity-audit skill on this repository. Run the bundled tool with Node.js against this repository, and use the full git history. Mode: audit only. Do not change any code. Write findings.json and findings.md in the repository root.

Fix prompt, after you have findings.json

Run the d3-dead-code-duplication-complexity-remediate skill using findings.json. Work through the findings I choose, and leave the rest open.

What is inside

The files that make up this skill, as your agent reads them.

packages/d3-dead-code-duplication-complexity

audit › SKILL.md

Sign in to download

Use the email and password you signed up with.