Agent skill

Extract A Type

by celeriant in celeriant/celeriant-db

Refactor a named Rust type or its surrounding code with an agreed scope.

Apache-2.0Auto-check passedDevelopment

Install Extract A Type

skills CLI
$ npx skills add celeriant/celeriant-db --skill extract-a-type -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install celeriant/celeriant-db extract-a-type --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/celeriant/celeriant-db.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/extract-a-type .claude/skills/extract-a-type && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
extract-a-type
GitHub stars
114
Token cost
~934 tokens
SKILL.md length
438 words
Files
3 (incl. references)
Skills in repo
13
Repo updated
First seen
Licence
Apache-2.0

At a glance

Refactor a named Rust type or its surrounding code with an agreed scope.

  • Works in 5 steps: Inspect git status --short and existing… → Run cargo check --workspace… → Find construction sites, field accesses,… → …
  • Pull X into its own file
  • SKILL.md covers Diagnose, Agree on scope, Refactor and Verify, plus 1 more section
  • Calls cargo and git

What it does

Extract A Type is an agent skill from celeriant/celeriant-db. Refactor a named Rust type or its surrounding code with an agreed scope. Triggers on "refactor X", "clean up X", "tidy this file", "dedupe this", "pull X into its own file", "this type is doing too much". Use simplify for changeset-wide cleanup and code-review for bug hunting.

Its SKILL.md is about 930 tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/receivers.md` and `references/split-signals.md`).

It sits in Development, covering Refactoring. It works with Rust. The repository describes itself as: Fast, distributed per-aggregate event log with strict ordering and optimistic concurrency control. The licence is Apache-2.0.

When your agent uses it

  • Pull X into its own file
  • This type is doing too much

Example prompts

  • “refactor X”
  • “clean up X”
  • “tidy this file”
  • “/extract-a-type”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Inspect git status --short and existing diffs. Preserve unrelated work. Obtain approval for a WIP commit and its contents before creating…
  2. Run cargo check --workspace --all-targets. Report baseline failures and resolve them separately before refactoring.
  3. Find construction sites, field accesses, helpers, and distinctive error strings with rg. Search the whole workspace.
  4. Read each affected site. Record its path, current behavior, and proposed behavior change in a drift table. Mark unchanged behavior as none.
  5. Identify existing test coverage. For non-mechanical changes without coverage, propose characterization tests against current behavior…

What it can do on your machine

Read from SKILL.md and the folder at commit d071a6d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Extract A Type loads about 934 tokens when it runs, and up to ~1.4k if it reads all its reference files. Until then it costs about 73 tokens; SKILL.md has 438 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~934
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from celeriant/celeriant-db at commit d071a6d, republished under its Apache-2.0 licence (© celeriant). 438 words, ~934 tokens.

Download SKILL.mdSave it as .claude/skills/extract-a-type/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
extract-a-type
description
Refactor a named Rust type or its surrounding code with an agreed scope. Triggers on "refactor X", "clean up X", "tidy this file", "dedupe this", "pull X into its own file", "this type is doing too much". Use simplify for changeset-wide cleanup and code-review for bug hunting.

Extract a type

Diagnose

  1. Inspect git status --short and existing diffs. Preserve unrelated work. Obtain approval for a WIP commit and its contents before creating one.
  2. Run cargo check --workspace --all-targets. Report baseline failures and resolve them separately before refactoring.
  3. Find construction sites, field accesses, helpers, and distinctive error strings with rg. Search the whole workspace.
  4. Read each affected site. Record its path, current behavior, and proposed behavior change in a drift table. Mark unchanged behavior as none.
  5. Identify existing test coverage. For non-mechanical changes without coverage, propose characterization tests against current behavior first. Permit compiler-only verification for mechanical moves, renames, and import rewrites.

Agree on scope

Present the site count, drift table, proposed changes, and verification plan before editing. Obtain agreement unless the user already authorized that scope.

  • Clarify the intended outcome when ambiguous.
  • Report incidental bugs separately.
  • For more than roughly 20 sites or 3 crates, propose batches: add the new form, delegate from the old form, migrate callers, then remove compatibility code.
  • Separate refactors, contract changes, and bug fixes into distinct commits. Preserve existing behavioral assertions during refactoring.

Refactor

  1. Reuse existing pure transformations. Keep I/O, clocks, and environment access at the boundary. Reject an intermediate layer whose body forwards to an existing function without a caller that requires it.
  2. Check dependency direction before moving code. Preserve deliberate crate separation; a lean consumer must not gain a heavy dependency. Keep equivalent helpers that a deliberate boundary requires; remove only the incorrect copy.
  3. Migrate identical call sites together. Handle sites with distinct surrounding logic individually. Compile between batches.
  4. Move cohesive field operations onto the type. Read receivers.md when choosing receivers or changing visibility.
  5. Keep unit-test helpers behind cfg(test). Keep integration helpers in shared test modules or a support crate accessible to their consumers.
  6. Remove dead imports and unused dependencies. Use cargo machete when available; inspect feature-gated code, tests, and benches before deleting dependencies.
  7. Update documentation and compile-checked examples that teach the old API.
Show full SKILL.md (102 more words)Show less

Keep formatting local. Do not run a workspace-wide formatter.

Verify

  • Run cargo check --workspace --all-targets with no new warnings.
  • Run affected tests, including characterization tests established before the refactor.
  • Execute tests for each changed behavior recorded in the drift table, including successful cases that must remain valid.
  • Inspect the final diff against the agreed scope. Report deviations and unresolved failures.

Load guidance when needed

ConditionLoad
Error enum changeserror-handling
Test worktesting
Hot-path changesbuild-method:performance-discipline
Config defaults or API breakagedefaults-and-breakage
Call ordering or cleanuptype-enforced-ordering
Globals or ownership choicesdata-ownership
Interior borrows near await pointsglommio-locking-patterns
Possible responsibility splitsplit-signals.md

© celeriant, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .claude/skills/extract-a-type of celeriant/celeriant-db.

  • SKILL.md
  • references/receivers.md
  • references/split-signals.md

Open the folder on GitHubat commit d071a6d

Compare with similar skills

Extract A Type next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Extract A Type compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Extract A Type this skillceleriant/celeriant-db114—~934Automated safety check: PassApache-2.0
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
RTK Rust Design Patternsrtk-ai/rtk83k—~1.9kAutomated safety check: PassApache-2.0
RTK Rust Code Simplifierrtk-ai/rtk83k—~1.1kAutomated safety check: PassApache-2.0
Rust Hygiene Audittsz-org/tsz577—~1.5kAutomated safety check: PassApache-2.0

Similar skills

  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Reviews RTK's Rust code for over-engineering and verbose patterns, applying idioms like iterator chains and early returns while protecting a specific list of constraints from being simplified away.

    83k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Run a deep DRY + code-hygiene audit of the Rust workspace and turn the findings into verified, deduplicated, hierarchical GitHub tech-debt issues.

    577 GitHub stars~1.5k tokensUpdated 28 days ago
    DevelopmentAuto-check passed
  • Coding Agent

    mastra-ai/mastra

    Authoring playbook for building agents that write, edit, review, or refactor code.

    29k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed

More from celeriant/celeriant-db

All 13 skills in this repo
  • Error Handling

    celeriant/celeriant-db

    Error handling patterns in Celeriant. An agent skill from celeriant/celeriant-db.

    114 GitHub stars~550 tokensUpdated 9 days ago
    Auto-check passed
  • Testing

    celeriant/celeriant-db

    How to write and run tests in Celeriant. An agent skill from celeriant/celeriant-db.

    114 GitHub stars~951 tokensUpdated 9 days ago
    Auto-check passed
  • Understanding Celeriant Structure

    celeriant/celeriant-db

    Celeriant codebase architecture, crate responsibilities, and how they fit together.

    114 GitHub stars~803 tokensUpdated 9 days ago
    Auto-check passed
  • Client Server Protocol

    celeriant/celeriant-db

    Celeriant's client-server protocol invariants, network behavior, failure modes, and shard routing.

    114 GitHub stars~1.6k tokensUpdated 9 days ago
    Auto-check passed
  • Database Architecture

    celeriant/celeriant-db

    Core architecture invariants for Celeriant. An agent skill from celeriant/celeriant-db.

    114 GitHub stars~1.5k tokensUpdated 9 days ago
    Auto-check passed
  • Glommio Locking Patterns

    celeriant/celeriant-db

    Locking patterns for Glommio's single-threaded async executors.

    114 GitHub stars~876 tokensUpdated 9 days ago
    Auto-check passed

Works with

Categories

Questions about Extract A Type

What does Extract A Type do?

Refactor a named Rust type or its surrounding code with an agreed scope. Extract A Type is an agent skill from celeriant/celeriant-db. Refactor a named Rust type or its surrounding code with an agreed scope.

When should I use Extract A Type?

Extract A Type fits situations like: pull X into its own file; this type is doing too much.

How do I install Extract A Type in Claude Code?

Run `npx skills add celeriant/celeriant-db --skill extract-a-type -a claude-code`. Or copy the skill folder (.claude/skills/extract-a-type in celeriant/celeriant-db) into .claude/skills/extract-a-type in your project. Claude Code loads it when a task matches its description.

How do I install Extract A Type in Codex?

Run `npx skills add celeriant/celeriant-db --skill extract-a-type -a codex`. Or copy the skill folder (.claude/skills/extract-a-type in celeriant/celeriant-db) into .agents/skills/extract-a-type in your project. Codex loads it when a task matches its description.

Can I use Extract A Type in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add celeriant/celeriant-db --skill extract-a-type -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/extract-a-type, .gemini/skills/extract-a-type, .github/skills/extract-a-type and .opencode/skills/extract-a-type in your project.

What does Extract A Type need to run?

Going by SKILL.md and its folder, Extract A Type needs the command-line tools its instructions call (cargo and git).

Does Extract A Type access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Extract A Type safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Extract A Type use?

Extract A Type is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Extract A Type use?

About 934 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 468 tokens, read only when the agent opens those files.

What are the alternatives to Extract A Type?

Skills that share tags, products or a category with Extract A Type: Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars), Rust Best Practices (farm-fe/farm, 5.6k stars), RTK Rust Design Patterns (rtk-ai/rtk, 83k stars) and RTK Rust Code Simplifier (rtk-ai/rtk, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Extract A Type?

celeriant (a GitHub organization) maintains it in celeriant/celeriant-db, which has 114 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on September 28, 2026.

Source: celeriant/celeriant-db on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.