Skip to content
Agentmart
Submit a tool

shrinkray

Shrinks repositories while preserving behavior by removing dead code, duplication, and verbosity with measured verification.

Skill by 0xdewy

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/0xdewy-shrinkray

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Shrinks repositories while preserving behavior by removing dead code, duplication, and verbosity with measured verification. Only use when explicitly requested.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/shrinkray

What's inside

Skill name
shrinkray
Description
Shrinks repositories while preserving behavior by removing dead code, duplication, and verbosity with measured verification. Only use when explicitly requested.
License
MIT
Instructions
79 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (8)

  • SKILL.md
  • evals.json · evals/
  • subagent-prompts.md · references/
  • deadcode_scan.py · scripts/
  • dependency_index.py · scripts/
  • detect_runner.py · scripts/
  • less_code_pass.py · scripts/
  • measure_loc.py · scripts/

SKILL.md (first lines)

# Shrinkray

Reduce repository size while preserving behavior. Prefer direct edits for a
small target; use agents only when evidence identifies independent bloat
categories that benefit from parallel work.

Size and dead-code work only; bug, security, and architecture cleanup is
`code-smellz`, and build minification is not this skill. Load
`../common/patterns/execution-contract.md`,
`../common/patterns/quarantine-loop.md`, and
`../common/patterns/scaling.md`. Use `references/subagent-prompts.md` only when
dispatching a role.

## Modes

- `--quick`: deterministic pass, then directly apply clear dead-code and
  verbosity findings. No agent budget.
- `--standard`: dispatch the 2-3 primary roles justified by evidence once.
  Budget: 3.
- `--thorough`: add structural roles, use propose-then-implement, and repeat
  the shared loop to convergence. Budget cap: 5.

Default non-interactive runs to `--standard`; use `--quick` for an obviously
small target.

## Evidence passes

After Phase 0 captures baseline LOC and tests, run these before dispatch:

1. **Phase 0.4:** run
   `scripts/less_code_pass.py <WORKSPACE> <WORKSPACE>`. For Python,
   JavaScript, TypeScript, and Rust it invokes `less-code` (`lc`), which applies
   and verifies transformations with its own frozen-suite/API/doc gates and
   reverts a failing layer. Pass `--test-command` when runner detection has
   high confidence so it uses the Phase 4 suite. The tool and supported
   language are optional; record a skip reason and continue when `ran` is
   false. Record `total_loc_removed` and per-language `tests_ok` from
   `less_code_pass.json`. Do not send its already-applied changes through agent
   triage or `git apply`.
2. **Phase 0.5:** run `scripts/deadcode_scan.py` and
   `scripts/dependency_index.py` on the resulting tree. The first combines
   language dead-code tools and type checking. The second records caller and
   importer counts, including single-caller symbols, single-importer files,
   and single-implementor interfaces.

Use `../common/scripts/detect_runner.py` and `measure_loc.py` for runner and
measurement support. The deterministic pass runs in every mode because it
spends no agent budget.

## Roles and application

Primary roles verify and apply evidence-backed candidates: Dead Code Hunter,
Ghost File Hunter, Verbosity Reducer, and Code Consolidator. Thorough mode may
also use structural roles for standard-library replacement, indirection
inlining, table-driven conversion, shipped-flag removal, and module merging.
Structural roles first propose candidates from the dependency index; the
orchestrator selects proposals before implementation.

Each agent is read-only and writes one findings JSON file; structural roles
also write one proposal JSON. Findings use:

```text
{id, category, file, lines, description, estimated_loc_saved, confidence, source_tool, patch}
```

Use `lines: "all"` for ghost files and categories `dead_code`, `ghost_file`,
`consolidate`, or `verbosity`. Apply ghost files, dead code, consolidation,
then verbosity. Weight tool-certified findings above model-only findings.
Phase 0.4 output is exempt because `lc` applies and verifies its own changes.

Run the shared type-check and test gates after edits. For the second minimizer
pass, re-run `scripts/deadcode_scan.py` on each changed file and feed new
findings into the same iteration's triage. Finish with:

```text
DONE: <WORKSPACE> — <lines> lines removed across <iterations> iterations (-<pct>% LOC)
```

From 0xdewy/skills, MIT.

More from 0xdewy/skills

Signals

Stars
0
Forks
0
Open issues
2
Last commit (this folder)
Oct 11, 2026 (17 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from 0xdewy

Cite this page

shrinkray skill. Agent Mart. https://agentmart.dev/skills/0xdewy-shrinkray (last updated 2026-10-24)