Command Palette

Search for a command to run...

Назад к скиллам
скилл № 62129

cargo-workspace-hygiene

Audit the Elph Rust workspace for dependency hygiene: duplicate crate versions, unused/dead dependencies, feature-flag bloat, workspace dependency…

БесплатноБез исполняемых скриптов
riipandiот 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.toml files (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, and make test. Forward package/feature selectors after -- (for example make check -- -p elph-ai). Use SCCACHE_DISABLE=1 only when the cache is unavailable or broken; record it in the report.
  • No unprompted tool installs. If cargo-machete/cargo-udeps/cargo-hakari aren't already installed, ask once before installing (they're dev-only, low-risk, but still an environment change) rather than silently running cargo 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 --hard or a broad git checkout -- to roll back a change. Inspect git 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

  1. git status --short and git diff --stat; stop to clarify if unrelated changes make ownership ambiguous.
  2. Confirm workspace layout with cargo metadata --no-deps --format-version 1 (use Python or manual inspection if jq is unavailable). Record package IDs, workspace_members, workspace_default_members, excluded packages, path dependencies, patches, and each package's rust-version.
  3. Run baseline gates through the repository wrapper: make fmt, make check, make lint, make test. Note pre-existing failures and platform-specific failures separately.
  4. Check optional tools with command -v cargo-machete cargo-udeps cargo-hakari or their --version commands. Do not install them automatically.
  5. Record whether Cargo.lock is tracked and wheth
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

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), без исполняемых скриптов.

Похожие скиллы

Сравнить cargo-workspace-hygiene с