Source profileQuality 91/100Review permissions

gaelic-ghost/socket/plugins/rust-skills/skills/build-library-crate/SKILL.md

build-library-crate

Implement reusable Rust library crates after the project shape is chosen, including public API design, module visibility, error types, feature flags, documentation examples, unit tests, integration tests, doctests, and Cargo validation. Use for Rust library implementation, API refactors, crate-boundary cleanup, or package-facing behavior.

Source repository stars
6
Declared platforms
0
Static risk flags
1
Last source update
2026-08-21
Source checked
2026-08-25

Decision brief

What it does: where it fits

Implement reusable Rust library crates after the project shape is chosen, including public API design, module visibility, error types, feature flags, documentation examples, unit tests, integration tests, doctests, and Cargo validation. Use for Rust library implementation, API refactors, crate-boundary cleanup, or package-facing behavior.

Best for

  • Implement reusable Rust library behavior with a small public API, clear module visibility, and tests at the boundary users actually call.
  • The practical goal is a crate that is easy to use from downstream code, easy to test inside the repository, and honest about compatibility, features, and errors.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/gaelic-ghost/socket --skill "plugins/rust-skills/skills/build-library-crate"
Safe inspection promptEditorial

Inspect the Agent Skill "build-library-crate" from https://github.com/gaelic-ghost/socket/blob/1140bc0b60f2c938b81d67dcee88a5eeb2e2f39d/plugins/rust-skills/skills/build-library-crate/SKILL.md at commit 1140bc0b60f2c938b81d67dcee88a5eeb2e2f39d. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Workflow

    1. Inspect the crate shape: - Cargo.toml - src/lib.rs - modules under src/ - tests/ - public examples and documentation comments - features and optional dependencies - package metadata if the crate is publishable 2. Identify the caller: - internal binary - sibling workspace crat…

    Inspect the crate shape:Cargo.tomlsrc/lib.rs
  2. 02

    Purpose

    Implement reusable Rust library behavior with a small public API, clear module visibility, and tests at the boundary users actually call.

    Implement reusable Rust library behavior with a small public API, clear module visibility, and tests at the boundary users actually call.The practical goal is a crate that is easy to use from downstream code, easy to test inside the repository, and honest about compatibility, features, and errors.
  3. 03

    Source Check

    Use repo-local Rust files, checked-out dependency sources, Dash MCP or Dash HTTP for installed Rust and Cargo docsets, and then official Rust and Cargo documentation when Dash/local coverage is missing or stale:

    The Rust Programming LanguageThe Cargo BookCargo package layout
  4. 04

    Module And Visibility Guidance

    Prefer private modules with explicit public re-exports:

    Prefer private modules with explicit public re-exports:Use pub(crate) for shared internal behavior that crosses modules inside one crate. Avoid pub just to make tests easy; use unit tests in the module for private behavior and integration tests for public behavior.Split modules when a file starts owning unrelated jobs such as parsing, validation, rendering, and I/O.
  5. 05

    Feature Guidance

    Use Cargo features for real optional behavior:

    optional dependenciesformat or backend supportstd versus nostd

Permission review

Static risk signals and limitations

Runs scripts

medium · line 99

The documentation asks the agent to run terminal commands or scripts.

cargo test -p package-name

Runs scripts

medium · line 100

The documentation asks the agent to run terminal commands or scripts.

cargo test -p package-name --doc

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score91/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars6SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
gaelic-ghost/socket
Skill path
plugins/rust-skills/skills/build-library-crate/SKILL.md
Commit
1140bc0b60f2c938b81d67dcee88a5eeb2e2f39d
License
Apache-2.0
Collected
2026-08-25
Default branch
main
View the original SKILL.md

Build Rust Library Crate

Purpose

Implement reusable Rust library behavior with a small public API, clear module visibility, and tests at the boundary users actually call.

The practical goal is a crate that is easy to use from downstream code, easy to test inside the repository, and honest about compatibility, features, and errors.

Source Check

Use repo-local Rust files, checked-out dependency sources, Dash MCP or Dash HTTP for installed Rust and Cargo docsets, and then official Rust and Cargo documentation when Dash/local coverage is missing or stale:

Use the repository's existing API style before introducing a new pattern.

Workflow

  1. Inspect the crate shape:
    • Cargo.toml
    • src/lib.rs
    • modules under src/
    • tests/
    • public examples and documentation comments
    • features and optional dependencies
    • package metadata if the crate is publishable
  2. Identify the caller:
    • internal binary
    • sibling workspace crate
    • external library user
    • FFI or generated-code caller
    • tests and examples only
  3. Shape the public API:
    • expose the smallest set of types and functions users need
    • keep implementation modules private by default
    • re-export stable public types deliberately from lib.rs
    • prefer explicit inputs and outputs over hidden global state
    • make ownership and borrowing convenient for likely callers
  4. Shape errors:
    • use concrete error types when callers need to match variants
    • use opaque errors only when callers only need display/debug behavior
    • include operation context in error messages
    • preserve source errors when that helps diagnostics
  5. Add tests and docs at the right boundary.

Module And Visibility Guidance

Prefer private modules with explicit public re-exports:

mod parser;

pub use parser::{ParseError, parse_document};

Use pub(crate) for shared internal behavior that crosses modules inside one crate. Avoid pub just to make tests easy; use unit tests in the module for private behavior and integration tests for public behavior.

Split modules when a file starts owning unrelated jobs such as parsing, validation, rendering, and I/O.

Feature Guidance

Use Cargo features for real optional behavior:

  • optional dependencies
  • format or backend support
  • std versus no_std
  • expensive integrations

Do not add feature flags for uncertain future work. Every feature should have tests or at least a documented validation path.

Testing Strategy

Use unit tests for private transformations and edge cases.

Use integration tests under tests/ when the public API should be exercised like a downstream caller:

use my_crate::parse_document;

#[test]
fn parses_empty_document() {
    let document = parse_document("").unwrap();
    assert!(document.items().is_empty());
}

Use doctests when examples in public documentation should stay compiling and accurate.

Validation

Choose the narrowest command that proves the change:

cargo test -p package-name
cargo test -p package-name --doc
cargo clippy -p package-name --all-targets --all-features
cargo fmt --check

For publishable crates, defer packaging details to rust:package-workflow.

Output Shape

Return:

  1. Library surface: public types, functions, modules, features, and errors changed.
  2. Caller impact: who uses the API and what becomes easier or safer.
  3. Visibility: what is public, pub(crate), or private and why.
  4. Tests: unit, integration, doctest, or feature coverage added or recommended.
  5. Validation: exact Cargo commands run or skipped with the concrete reason.
  6. Next skill: usually rust:testing-workflow, rust:tooling-style-workflow, or rust:package-workflow.

Guardrails

  • Do not expose implementation modules as public API by accident.
  • Do not add feature flags without a real optional behavior and validation path.
  • Do not hide compatibility changes to MSRV, edition, or public API.
  • Do not use local path dependencies in shared or publishable crate surfaces.
  • Do not make test convenience the reason for broad public visibility.

Frequently asked questions

What to verify before installation and use

What does the build-library-crate source document cover?

Implement reusable Rust library crates after the project shape is chosen, including public API design, module visibility, error types, feature flags, documentation examples, unit tests, integration tests, doctests, and Cargo validation. Use for Rust library implementation, API refactors, crate-boundary cleanup, or package-facing behavior.

How do I install build-library-crate?

The source record exposes this install command: npx skills add https://github.com/gaelic-ghost/socket --skill "plugins/rust-skills/skills/build-library-crate". Inspect the command and pinned source before running it.

Which permission-related actions were detected?

Static rules flagged exec-script in the source; the page lists the matching lines and excerpts.

Alternatives

Compare before choosing

Computed 976

mgiovani/cc-arsenal

team-review

Multi-agent review team: architecture, security, performance, testing, style, docs/UX, plus an adversary that cross-examines the other 6, for security-sensitive, architectural, or large PRs (15+ files) where a single-agent pass risks missing cross-cutting issues. Use for auth/payments/PII changes, schema/pattern changes, compliance sign-off, or when asked to 'get the review team on this' / 'multi-agent review' / 'thorough review before merge'. For a standard PR or a quick pre-merge check, use /r

Computed 969

Postpartum-genushyacinthus29/dotnet-skills

dotnet-maui

Build, review, or migrate .NET MAUI applications across Android, iOS, macOS, and Windows with correct cross-platform UI, platform integration, and native packaging assumptions.

Computed 9420

upex-galaxy/agentic-qa-boilerplate

test-automation

Plan, write, and review automated tests following KATA (Komponent Action Test Architecture) on Playwright + TypeScript, or explain existing automated tests in a sealed read-only mode. Use when writing E2E or API/integration tests, creating Page or Api components, designing ATCs, parameterizing test data, registering fixtures, reviewing test code for KATA compliance, or requesting break-down-tests / a plain-English test breakdown. The explain mode reads source and reports assertions without enter

Computed 9420

upex-galaxy/agentic-qa-boilerplate

test-documentation

Analyze, prioritize, and document test cases in TMS (Jira/Xray), or repair an existing Story-ATS-ATP-ATR-TC cascade through a sealed explicit mode. Use for Test/ATP/ATR artifacts, ROI and automation verdicts, maintaining traceability, fix-traceability, or broken TMS links. The repair-traceability mode audits, plans, waits for explicit approval, applies, and verifies without launching the general documentation workflow. Do NOT use for writing test code (test-automation) or running suites (regress