dx-refactor-discover

dx-refactor-discover is a skill for Claude Code from dikamilo/dx-workflow. It costs 29 tokens per session (2,817 once invoked), scanned A, original, MIT.

A workflow for searching a codebase for worthwhile refactoring opportunities. Refactoring means restructuring existing code without changing its intended behavior, and this workflow presents findings for the user to choose from.

In plain words
What is it for?
Use it when you want to find structural improvements, such as making a shallow module more useful or identifying better boundaries between parts of the code. It can outline interface alternatives, but it does not write a plan or change code.
Why use it?
It helps identify design problems before anyone edits code. It separates discovery from implementation so only selected opportunities become tracked changes.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions subagents.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dikamilo/dx-workflow/dx-refactor-discover
Any agent
npx skills add dikamilo/dx-workflow --skill dx-refactor-discover
Clone the repo
git clone --depth 1 https://github.com/dikamilo/dx-workflow

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dx-refactor-discover

README.md
[![agentmods](https://agentmods.dev/badge/skills/dikamilo/dx-workflow/dx-refactor-discover.svg)](https://agentmods.dev/skills/dikamilo/dx-workflow/dx-refactor-discover)
Your own site
<a href="https://agentmods.dev/skills/dikamilo/dx-workflow/dx-refactor-discover"><img src="https://agentmods.dev/badge/skills/dikamilo/dx-workflow/dx-refactor-discover.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,817 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.02817
Opus 5 $0.00015 $0.01409
Sonnet 5 $0.00006 $0.00563
Haiku 4.5 $0.00003 $0.00282

Measured 5d ago against content hash d893e66ba913, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

dx-refactor-discover scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/dx-refactor-discover/SKILL.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

dx-refactor-discover

Start with no concrete target — "find me refactor opportunities." Scan the codebase for design problems worth fixing — shallow modules to turn deep, plus whatever the wider design lenses surface — present them inline as markdown, and promote whichever the user picks into a normal container. This skill discovers and hands off — it can sketch alternative interfaces for whichever candidates the user picks, but it writes no plan.md and edits no code.

Guard. If context/ isn't scaffolded (no changes/ or efforts/), stop and tell the user to run /dx-init. The findings this run produces are ephemeral — there is no debt register; anything not promoted or recorded as a lesson leaves no trace.

1 — Load the vocabulary

Invoke dx-references with topic module-design — its terms (deep vs shallow, seam, leverage and locality, adapter, dependency category, the deletion test) are how every finding is phrased, and its ## Rejected framings says which words stay out. Read foundation/glossary.md for naming (a one-line habit — no section) and foundation/lessons.md so you skip anything a prior run already rejected ("don't re-deepen X because Y").

2 — Scan

Optionally scoped by [area or path]; unscoped means the whole tree. Invoke dx-references with design-lenses — module depth is the primary lens, not the only one, and problems outside it go unfound if nothing else is looking. Fan out to built-in Explore subagents to walk it — explore for friction, don't run rigid heuristics.

Recency is the default prior. Walk back a stretch of git log --oneline and let the paths that keep showing up pull attention first — churn is where a deepening pays back soonest. If the log is scattered with no clear hot spot, widen the net instead.

Look for: understanding one concept that means bouncing between many small modules; shallow modules (interface nearly as wide as the implementation); pure functions extracted only for testability while the real bug hides in how they're called; seams that leak; and what the other lenses catch — knowledge duplicated across modules, one module changing for unrelated reasons, coupling that makes a single edit ripple. Apply the deletion test to each suspect: would deleting it concentrate complexity, or just move it? "Concentrates" is the signal.

Read the full file on GitHub · 100 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 100 lines · 29 tokens per session scan A d893e66ba913

Subscribe to this mod's changes

dx-refactor-discover is a skill published in the GitHub repository dikamilo/dx-workflow (5 stars, last pushed 4d ago), licensed MIT. It adds 29 tokens to every session and 2,817 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

gke-reliability

Improves GKE workload reliability, using PDBs, health probes, and topology spread constraints. Use when configuring GKE workload reliability, setting up PDBs, or configuring GKE health probes (liveness, readiness, startup). Don't use for disaster recovery setup or full cluster backups (use gke-backup-dr instead).

google/skills · 73 tokens

gke-workload-security

Audits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running cluster security audits (auditcluster.sh), configuring Workload Identity Federation (impersonation, KSA/GSA binding, and pod setup), enforcing Network Policies (default-deny…

google/skills · 181 tokens

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

google-cloud-solution-agentic-analytics-spark-knowledge-catalog

Discovers requirements and generates guidance to design and deploy a governed, secure agentic-analytics solution for data that's distributed across Google Cloud, other cloud providers, or on-premises. Data that's outside Google Cloud (such as data from Databricks, Snowflake, Salesforce, SAP, or Oracle systems) is…

google/skills · 138 tokens

twitter-reader

Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…

himself65/finance-skills · 161 tokens