cargo-workspace-hygiene
Audit the Elph Rust workspace for dependency hygiene: duplicate crate versions, unused/dead dependencies, feature-flag bloat, workspace dependency…
от riipandi★ 34 звезды на GitHub
Установить cargo-workspace-hygiene в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Cargo Workspace Hygiene
Language
Split by destination:
- In-chat responses, plans, summaries — follow the language the user is currently using (Indonesian, English, etc). Crate names, paths, versions, flags stay literal English.
- Any documentation edits written to files (
docs/**, permanent comments) — always English, regardless of chat language.
Purpose
Keep Elph's dependency graph and Cargo.toml files lean without changing runtime
behavior or public package contracts: no avoidable duplicate versions, unused
dependencies, feature-flag creep, or drift from the workspace dependency table.
This is structural dependency hygiene only — not vulnerability/license auditing
(rust-dep-audit) and not code-level splitting (rust-lean-refactor).
Elph workspace baseline
Before making assumptions, verify the current metadata. The normal workspace is the six-package graph containing:
elph(crates/coding-agent) — the application, CLI, and main TUI;elph-agent— the app-agnostic agent runtime;elph-ai— provider adapters, model catalogs, and public LLM types;elph-tui— reusable iocraft components (included through a path dependency);floppy— memory/storage integration;rendown— terminal/Markdown rendering.
The root Cargo.toml uses resolver 2, edition 2024, a large
[workspace.dependencies] table, and a local [patch.crates-io] override for
iocraft under vendor/iocraft. crates/control-plane, elph-cron,
elph-sandbox, and other explicitly excluded packages are not automatically
covered by the normal workspace gate; include them only when the user asks.
The former extension packages were removed; do not expect or recreate them
during a dependency audit.
Scope
- Default scope: the whole workspace's
Cargo.tomlfiles (root + all member crates), since duplication and unification are inherently cross-crate concerns. - If the user names a specific crate, still check its deps against the rest of the workspace for duplicates — hygiene issues are relational, not per-crate.
Safety Rules
- No version bumps without a call-out. Deduping to a shared version is only safe when semver-compatible for all consumers; if unifying would force a minor/major bump on some crate, propose it explicitly and let the user decide rather than silently bumping.
- Unused-dependency removal needs confirmation if it's not obviously safe. A dep with zero references found by tooling is a strong signal, but re-exports, macro-only usage, or feature-gated code paths can hide real usage — verify before removing, and if genuinely uncertain, ask rather than delete.
- Use repository wrappers for gates: run
make fmt,make check,make lint, andmake test. Forward package/feature selectors after--(for examplemake check -- -p elph-ai). UseSCCACHE_DISABLE=1only when the cache is unavailable or broken; record it in the report. - No unprompted tool installs. If
cargo-machete/cargo-udeps/cargo-hakariaren't already installed, ask once before installing (they're dev-only, low-risk, but still an environment change) rather than silently runningcargo install. - One category of change at a time — don't mix a version-unification pass with a feature-trim pass with an unused-dep removal pass in one unverified diff. Verify gates between categories.
- Legacy/back-compat deps (a dep kept only for an old code path) follow the same ask-before-remove rule as other skills — don't fold "unused dependency" and "deliberately-kept-for-legacy" into the same silent bucket.
- Generated and vendored inputs are not normal source evidence: do not edit
crates/elph-ai/models/**/*.json,schemas/,vendor/iocraft/,target/, build output, or lockfiles generated by a command unless the requested change explicitly includes them. - Do not destroy parallel work. Never use
git reset --hardor a broadgit checkout --to roll back a change. Inspectgit status, preserve unrelated edits, and use a targeted patch or ask when ownership is unclear. - Git is opt-in: do not commit or push unless the user explicitly requests it.
Workflow
Phase 1 — Baseline
git status --shortandgit diff --stat; stop to clarify if unrelated changes make ownership ambiguous.- Confirm workspace layout with
cargo metadata --no-deps --format-version 1(use Python or manual inspection ifjqis unavailable). Record package IDs,workspace_members,workspace_default_members, excluded packages, path dependencies, patches, and each package'srust-version. - Run baseline gates through the repository wrapper:
make fmt,make check,make lint,make test. Note pre-existing failures and platform-specific failures separately. - Check optional tools with
command -v cargo-machete cargo-udeps cargo-hakarior their--versioncommands. Do not install them automatically. - Record whether
Cargo.lockis tracked and wheth
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл cargo-workspace-hygiene?
Audit the Elph Rust workspace for dependency hygiene: duplicate crate versions, unused/dead dependencies, feature-flag bloat, workspace dependency inheritance, target-specific dependencies, and lockfile drift. Proposes and safely applies fixes (unify to [workspace.dependencies], drop unused deps, trim feature sets), verifying the repository's make check/lint/test gates stay green. Use when user asks to clean up Cargo.toml(s), dedupe dependency versions, find unused crates, unify workspace deps, or audit workspace dependency structure. Does not cover security advisories or license compliance — see rust-dep-audit for that.
Как установить скилл cargo-workspace-hygiene?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cargo-workspace-hygiene запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…