Skip to content

salvo-rs/salvo-skills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Salvo

Salvo AI Agent Skills

Salvo Framework   Documentation   Discord

Website crates.io Documentation

AI agent skills for the Salvo web framework. These skills help AI assistants understand and generate Salvo code more effectively.

What are Agent Skills?

Agent Skills are specialized knowledge modules that AI assistants can load to perform specific tasks. They follow the Agent Skills open standard and work with tools like GitHub Copilot, Claude Code, and other AI coding assistants.

Available Skills (28 Total)

Core Framework

Skill Description
salvo-basic-app Create basic Salvo applications with handlers, routers, and server setup
salvo-routing Configure routers with path parameters, nested routes, and filters
salvo-middleware Implement middleware for authentication, logging, CORS, and request processing
salvo-error-handling Handle errors gracefully with custom error types and error pages
salvo-path-syntax Path parameter syntax guide with {} syntax (v0.76+) and migration examples

Data Handling

Skill Description
salvo-data-extraction Extract and validate data from requests (JSON, forms, query params, path params)
salvo-database Integrate databases using SQLx, Diesel, SeaORM, or other ORMs
salvo-file-handling Handle file uploads, downloads, and multipart forms
salvo-static-files Serve static files, directories, and embedded assets
salvo-caching Implement caching strategies for improved performance

Security

Skill Description
salvo-auth Implement authentication and authorization (JWT, Basic Auth, sessions)
salvo-session Manage user sessions for login, shopping carts, and preferences
salvo-csrf Protect against Cross-Site Request Forgery attacks
salvo-cors Configure CORS and security headers for browser access
salvo-rate-limiter Implement rate limiting to protect APIs from abuse
salvo-tls-acme Configure TLS/HTTPS with automatic certificate management

Real-time Communication

Skill Description
salvo-realtime Overview of real-time features with WebSocket and SSE
salvo-websocket Full-duplex bidirectional WebSocket communication
salvo-sse Server-Sent Events for live notifications and feeds

Performance & Operations

Skill Description
salvo-compression Compress HTTP responses using gzip, brotli, or zstd
salvo-timeout Configure request timeouts to prevent slow requests
salvo-concurrency-limiter Limit concurrent requests to protect resources
salvo-graceful-shutdown Handle in-flight requests before server shutdown
salvo-logging Implement request logging, tracing, and observability

Advanced Features

Skill Description
salvo-openapi Generate OpenAPI documentation automatically from handlers
salvo-proxy Implement reverse proxy for load balancing and API gateways
salvo-flash Flash messages for one-time notifications across redirects
salvo-testing Write unit and integration tests using TestClient

Quick Start

For GitHub Copilot / VS Code

  1. Copy the skill directories to your project:

    cp -r salvo-skills/salvo-* .github/skills/
  2. Enable agent skills in VS Code settings:

    {
      "chat.useAgentSkills": true
    }
  3. Skills will automatically activate when you ask Copilot about Salvo!

For Claude Code

  1. Copy the skill directories to your project:

    cp -r salvo-skills/salvo-* .claude/skills/
  2. Skills will be automatically loaded when working with Salvo code.

Usage Examples

Once installed, you can ask your AI assistant questions like:

  • "Create a basic Salvo web server with a hello world endpoint"
  • "Add JWT authentication to my Salvo API"
  • "How do I extract JSON data from a POST request in Salvo?"
  • "Set up a WebSocket chat handler in Salvo"
  • "Generate OpenAPI documentation for my Salvo endpoints"
  • "Configure CORS for my API"
  • "Add rate limiting to protect my endpoints"
  • "Set up HTTPS with Let's Encrypt"
  • "Implement graceful shutdown for my server"
  • "Add CSRF protection to my forms"
  • "Create a file upload endpoint with validation"

The AI will use these skills to provide accurate, framework-specific guidance.

Key Concepts Covered

Handlers and Routing

  • #[handler] macro for request handlers
  • Path parameters with {id} syntax
  • Nested routers with push()
  • HTTP method handlers (get, post, put, patch, delete)

Middleware

  • Using hoop() to attach middleware
  • FlowCtrl for flow control
  • Depot for request-scoped data sharing
  • Onion model execution order

Data Extraction

  • JsonBody<T> for JSON requests
  • req.param(), req.query() for parameters
  • Extractible derive macro for complex extraction
  • Validation with validator crate

Database Integration

  • affix_state::inject() for dependency injection
  • depot.obtain::<T>() for retrieving state
  • SQLx, SeaORM, Diesel support

Authentication & Security

  • JWT with JwtAuth middleware
  • Basic Auth with BasicAuthValidator
  • Session-based auth with SessionHandler
  • Role-based access control (RBAC)
  • CORS configuration
  • CSRF protection
  • Rate limiting

Real-time Communication

  • WebSocket with WebSocketUpgrade
  • SSE with SseEvent and SseKeepAlive
  • Broadcasting patterns
  • Connection management

Performance

  • Response compression (gzip, brotli, zstd)
  • Caching strategies
  • HTTP/2 and HTTP/3 support
  • Concurrency limiting
  • Request timeouts

Operations

  • Graceful shutdown with ServerHandle
  • Logging with tracing
  • Request timing and metrics

OpenAPI

  • #[endpoint] macro for documentation
  • ToSchema and ToParameters derives
  • SwaggerUi integration

Skill Structure

Each skill contains:

  • SKILL.md - Main skill file with YAML frontmatter and instructions
  • Examples - Code snippets demonstrating common patterns
  • Best Practices - Framework-specific recommendations
  • Setup Instructions - Dependencies and configuration

Contributing

Contributions are welcome! To add or improve skills:

  1. Fork the repository
  2. Create a new skill directory or modify existing ones
  3. Follow the Agent Skills specification
  4. Submit a pull request

Skill Format

Each skill must have a SKILL.md file with:

---
name: skill-name
description: Brief description of what the skill does and when to use it
---

# Skill Title

Detailed instructions, examples, and best practices...

License

These skills are part of the Salvo project and follow the same license.

Links

Support

If you find these skills helpful, please consider:


Made with love for the Salvo community

About

Salvo skills for ai agents like claude or github

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors