Skip to content
rust-core logo

Rust Core Development

rust-core

Comprehensive Rust development expertise covering core principles, patterns, error handling, async programming, testing, and performance optimization. Use when working on Rust projects requiring guidance on: (1) Language fundamentals (ownership, lifetimes, borrowing), (2) Architectural decisions ...

SKILL.md

Full skill instructions

Rust Core Development

Comprehensive guidance for Rust development across web, CLI, desktop, AI/​LLM applications, and systems programming.

Quick Reference Guide

By Task Type

Getting Started

  • New Project Setup: Use scripts/​init_rust_project.sh to scaffold a project with best practices
  • Core Principles: See references/​principles.md for ownership, borrowing, and Rust fundamentals
  • Common Errors: See references/​common-errors.md for solutions to frequent compiler errors

Writing Code

Domain-Specific Development

Code Quality

Project Management

By Question Type

QuestionReference
"How do I handle errors?"error-handling.md
"Which web framework should I use?"web-frameworks.md
"How do I work with async/​await?"async-patterns.md
"How do I integrate OpenAI/​Claude?"ai-llm.md
"How do I build a CLI?"cli-tui.md
"How do I create a desktop app?"desktop-tauri.md
"Why won't this compile?"common-errors.md
"How do I improve performance?"performance.md
"How do I add logging?"logging-observability.md
"How should I name this?"naming.md
"What are best practices?"principles.md
"How do I test this?"testing.md

Core Workflows

1. Starting a New Project

  1. Initialize Project

    ./​scripts/​init_rust_project.sh my-project
    
  2. Set Up Development Tools

    • Configure linting: Copy assets/​configs/​clippy.toml and assets/​configs/​rustfmt.toml
    • Configure security: Copy assets/​configs/​deny.toml
    • Run audit: ./​scripts/​audit_dependencies.sh
  3. Add Logging

    ./​scripts/​setup_logging.sh
    
  4. Choose Architecture

2. Implementing Features

  1. Design First

  2. Write Code

    • Follow naming conventions from naming.md
    • Use appropriate patterns and error handling
    • Add tracing/​logging as you go
  3. Test

    • Write unit tests (see testing.md)
    • Add integration tests for public APIs
    • Consider property-based tests for complex logic

3. Code Review and Refinement

  1. Self-Review

    • Run through code-review.md checklist
    • Check for common anti-patterns
    • Verify error handling
  2. Performance Check

    • Profile if performance-critical (see performance.md)
    • Benchmark changes with Criterion
    • Avoid premature optimization
  3. Security Audit

    ./​scripts/​audit_dependencies.sh
    

Decision Guides

Choosing a Web Framework

Use Axum when:

  • Building modern REST/​GraphQL APIs
  • Want composable middleware (Tower ecosystem)
  • Prefer type-driven extractors
  • Building microservices

Use Actix-web when:

  • Need maximum performance
  • Building high-throughput APIs
  • Want mature, battle-tested framework
  • Familiar with actor model

Use Rocket when:

  • Rapid prototyping
  • Want batteries-included features
  • Smaller team or learning Rust web
  • Traditional web application

See web-frameworks.md for detailed comparison and code examples.

Error Handling Strategy

Use anyhow for:

  • Applications (binaries)
  • Quick prototyping
  • Internal tools
  • When you need ergonomic error handling with context

Use thiserror for:

  • Libraries (public APIs)
  • When consumers need to handle specific error cases
  • Type-safe error hierarchies
  • Production code with well-defined error types

See error-handling.md for patterns and examples.

When to Use Async

Use async/​await when:

  • I/​O-bound operations (network, file system)
  • Web servers handling many concurrent requests
  • Database connection pooling
  • Working with streams of data

Don't use async when:

  • CPU-bound operations (use spawn_blocking instead)
  • Simple CLI tools
  • Performance isn't critical
  • Complexity isn't justified

See async-patterns.md for Tokio patterns and best practices.

Automation Scripts

Available Scripts

scripts/​init_rust_project.sh Initialize a new Rust project with best practices:

  • Common dependencies (anyhow, thiserror, serde, tracing)
  • Benchmark setup with Criterion
  • Optimized release profile
  • Proper .gitignore

Usage: ./​scripts/​init_rust_project.sh my-project [bin|lib]

scripts/​audit_dependencies.sh Audit dependencies for security and licensing:

  • Runs cargo-audit for security vulnerabilities
  • Runs cargo-deny for license compliance
  • Shows outdated dependencies

Usage: ./​scripts/​audit_dependencies.sh

scripts/​setup_logging.sh Set up tracing-based logging:

  • Adds tracing dependencies
  • Creates logging module with JSON support
  • Provides initialization code

Usage: ./​scripts/​setup_logging.sh

Configuration Templates

assets/​configs/​clippy.toml

Clippy linting configuration for strict code quality

assets/​configs/​rustfmt.toml

Code formatting configuration (100 char width, Unix newlines)

assets/​configs/​deny.toml

cargo-deny configuration for:

  • Security advisory checking
  • License compliance (MIT, Apache-2.0, BSD allowed)
  • Duplicate dependency detection
  • Source verification

Reference Documentation

All reference files provide in-depth guidance on specific topics:

Core Language

Development

Async & Concurrency

Domains

Libraries

When to Consult References

Load references progressively as needed:

  1. Starting out: Read principles.md to understand Rust fundamentals
  2. Choosing approach: Consult domain-specific guides (web-frameworks.md, ai-llm.md, etc.)
  3. Implementing: Reference patterns.md and error-handling.md
  4. Debugging: Check common-errors.md
  5. Optimizing: See performance.md
  6. Reviewing: Use code-review.md checklist

Don't load all references at once—consult them as specific needs arise.

Best Practices Summary

  1. Embrace the borrow checker - Work with ownership, not against it
  2. Use type-driven design - Make invalid states unrepresentable
  3. Handle errors explicitly - Use Result and Option, avoid unwrap()
  4. Test comprehensively - Unit tests, integration tests, property tests
  5. Profile before optimizing - Measure, don't guess
  6. Add structured logging - Use tracing for observability
  7. Review security - Audit dependencies, validate inputs
  8. Follow conventions - rustfmt, clippy, naming conventions
  9. Document public APIs - Doc comments with examples
  10. Keep it simple - Prefer clarity over cleverness

More skills from diegosouzapw

accessibility logo
diegosouzapw/awesome-omni-skill

accessibility

Accessibility guidelines for VS Code features — covers accessibility help dialogs, accessible views, verbosity settings, accessibility signals, ARIA alerts/status announcements, keyboard navigation, and ARIA labels/roles. Applies to both new interactive UI surfaces and updates to existing feature...

62 1
View
mermaid-diagrams logo
diegosouzapw/awesome-omni-skill

mermaid-diagrams

Mermaid diagram creation for flowcharts, sequences, ERDs, and more. Generate diagrams from text in markdown files. Use for documentation, architecture diagrams, and visual representations. Triggers on mermaid, flowchart, sequence diagram, ERD, entity relationship, gantt chart, pie chart, class di...

62 1
View
tauri2-react-rust logo
diegosouzapw/awesome-omni-skill

tauri2-react-rust

Guides development of cross-platform desktop apps with Tauri 2, TypeScript, React, and Rust. Use when building Tauri apps, implementing IPC, designing Rust backend or TypeScript/React frontend, when researching or cloning a website (open site, snapshot elements), when verifying local dev or built...

62 1
View
fp-ts-errors logo
diegosouzapw/awesome-omni-skill

fp-ts-errors

Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with fp-ts.

62 0
View
ring:pre-dev-research logo
diegosouzapw/awesome-omni-skill

ring:pre-dev-research

Gate 0 research phase for pre-dev workflow. Dispatches 3 parallel research agents to gather codebase patterns, external best practices, and framework documentation BEFORE creating PRD/TRD. Outputs research.md with file:line references.

62 0
View
create-assistant logo
diegosouzapw/awesome-omni-skill

create-assistant

Create and configure Vapi voice AI assistants with models, voices, transcribers, tools, hooks, and advanced settings. Use when building voice agents, phone bots, customer support assistants, or any conversational AI that handles phone or web calls.

62 0
View
codex-headless logo
diegosouzapw/awesome-omni-skill

codex-headless

Delegiere Aufgaben an OpenAI Codex CLI im Headless-Mode. Nutzt ChatGPT Subscription (KEIN API Key). Nur Workspace-Zugriff, KEIN System-Zugriff. Auto-Accept mit --full-auto. Web-Recherche mit --search.

62 0
View
social-media-scheduler logo
diegosouzapw/awesome-omni-skill

social-media-scheduler

Generate a full week of social media content for any topic. Outputs platform-optimized posts for Twitter/X, LinkedIn, and Instagram with hashtags and posting times.

62 0
View
Data Privacy Compliance logo
diegosouzapw/awesome-omni-skill

Data Privacy Compliance

Data privacy and regulatory compliance specialist for GDPR, CCPA, HIPAA, and international data protection laws. Use when implementing privacy controls, conducting data protection impact assessments, ensuring regulatory compliance, or managing data subject rights. Expert in consent management, da...

62 0
View
triple-review logo
diegosouzapw/awesome-omni-skill

triple-review

Reviews a task using the TRIPLE protocol, as the review agent.

62 0
View
Tech Stack & Architecture Decision logo
diegosouzapw/awesome-omni-skill

Tech Stack & Architecture Decision

Define and document the technology stack and architecture decisions for a project. Use when the user needs to choose a tech stack, make architecture decisions, define infrastructure choices, or document technology selections. Triggers on requests like "define the tech stack", "choose technologies...

62 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View