agentsclimarketplace

Code reducer

Skill bakerstreetco/skills/code-reducer

Reusable agent skills for real repository work: review, implementation, release, documentation, and project hygiene.

Install
npx -y skills add bakerstreetco/skills --skill code-reducer

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Reduce overly complex, unnecessary, duplicated, or defensive code in a file, module, feature path, or workflow while preserving behavior. Use when asked to simplify code, cut accidental complexity, make a workflow smaller, remove needless abstraction, collapse indirection, or explain how complex code can be reduced safely.

SKILL.md

3.8 KB, as published. Nobody here has run it

Code Reducer

Use this skill to make code or workflows smaller and easier to reason about without changing the intended behavior. Focus on removing accidental complexity, not on cosmetic rewrites.

Workflow

  1. Identify the target surface: the named file, module, command flow, UI path, API path, test setup, or workflow. If the request is broad, start from the smallest surface that proves the reduction pattern.
  2. Read the code in context. Inspect callers, tests, route/command entry points, data shape, recent diffs, and adjacent simpler patterns before proposing or editing.
  3. Write down the behavior that must not change: inputs, outputs, side effects, error handling, persistence, UI states, public API shape, logging, and compatibility constraints.
  4. Map complexity to evidence. Look for indirection, branching, generic configuration, duplicate state, adapters, defensive cases, layers, retries, mocks, or helpers that do not serve current behavior.
  5. Reduce in the smallest safe step. Prefer deleting unused paths, inlining one-use helpers, replacing generic abstractions with direct code, collapsing duplicate branches, removing configuration that has one real value, and using existing language or framework features.
  6. Preserve meaningful boundaries. Keep abstractions that isolate external APIs, security-sensitive behavior, concurrency, persistence, cross-platform differences, or repeated domain rules.
  7. Verify with focused checks. Run the closest tests, typecheck, lint, command, screenshot, or manual path that covers the changed behavior. Add or adjust tests when the reduction removes branches that were previously acting as accidental coverage.

Reduction Targets

  • One-use abstractions: inline helpers, classes, components, hooks, factories, or wrappers when their names do not carry useful domain meaning.
  • False generality: replace option bags, registries, strategy maps, plugin points, or generic type parameters that only support one production case.
  • Duplicate state: remove derived state, mirrored caches, duplicated flags, or parallel sources of truth when one source can drive the behavior.
  • Branch-heavy code: collapse equivalent branches, move exceptional cases to early returns, and make the common path direct.
  • Defensive clutter: remove guards for impossible states only after proving the type, parser, schema, caller, or runtime already enforces the invariant.
  • Workflow ceremony: remove redundant commands, generated handoff files, manual steps, or wrapper scripts when the underlying repo command is already clear and stable.
  • Test scaffolding: reduce bespoke mocks, fixtures, and setup helpers when simpler real data or existing test utilities cover the same behavior.

Guardrails

  • Do not simplify by weakening validation, hiding errors, changing public interfaces, or deleting compatibility paths without evidence.
  • Do not collapse boundaries around security, billing, authentication, data loss, migrations, concurrency, or external integrations just because the code looks verbose.
  • Do not combine unrelated cleanup with the reduction unless it is required to make the target simpler.
  • Do not introduce a new abstraction to remove a smaller old abstraction unless the net result is clearly simpler at the call sites and ownership boundary.

Reporting

In the final response, state what complexity was removed, what behavior was preserved, and what verification ran. If reduction is unsafe, report the smallest proven simplification and the specific evidence needed before going further.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.