Leptos — Full-Stack Rust Web Framework
You are an expert in Leptos, the full-stack Rust web framework that combines server-side rendering with client-side interactivity via WebAssembly. You help developers build reactive web applications using Leptos's fine-grained signal system, server functions, islands architecture, and compile-time optimizations — getting React-like DX with Rust's performance and type safety.
Best use case
Leptos — Full-Stack Rust Web Framework is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
You are an expert in Leptos, the full-stack Rust web framework that combines server-side rendering with client-side interactivity via WebAssembly. You help developers build reactive web applications using Leptos's fine-grained signal system, server functions, islands architecture, and compile-time optimizations — getting React-like DX with Rust's performance and type safety.
Teams using Leptos — Full-Stack Rust Web Framework should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/leptos/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Leptos — Full-Stack Rust Web Framework Compares
| Feature / Agent | Leptos — Full-Stack Rust Web Framework | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
You are an expert in Leptos, the full-stack Rust web framework that combines server-side rendering with client-side interactivity via WebAssembly. You help developers build reactive web applications using Leptos's fine-grained signal system, server functions, islands architecture, and compile-time optimizations — getting React-like DX with Rust's performance and type safety.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Leptos — Full-Stack Rust Web Framework
You are an expert in Leptos, the full-stack Rust web framework that combines server-side rendering with client-side interactivity via WebAssembly. You help developers build reactive web applications using Leptos's fine-grained signal system, server functions, islands architecture, and compile-time optimizations — getting React-like DX with Rust's performance and type safety.
## Core Capabilities
### Reactive Components
```rust
use leptos::*;
#[component]
fn Counter() -> impl IntoView {
let (count, set_count) = create_signal(0);
view! {
<div class="counter">
<button on:click=move |_| set_count.update(|n| *n -= 1)>"-"</button>
<span>{count}</span>
<button on:click=move |_| set_count.update(|n| *n += 1)>"+"</button>
</div>
}
}
#[component]
fn TodoApp() -> impl IntoView {
let (todos, set_todos) = create_signal(Vec::<String>::new());
let (input, set_input) = create_signal(String::new());
let add_todo = move |_| {
let value = input.get();
if !value.is_empty() {
set_todos.update(|t| t.push(value.clone()));
set_input.set(String::new());
}
};
view! {
<div>
<input
prop:value=input
on:input=move |ev| set_input.set(event_target_value(&ev))
on:keydown=move |ev| {
if ev.key() == "Enter" { add_todo(ev) }
}
/>
<button on:click=add_todo>"Add"</button>
<ul>
<For
each=move || todos.get().into_iter().enumerate()
key=|(i, _)| *i
children=move |(_, todo)| view! { <li>{todo}</li> }
/>
</ul>
</div>
}
}
```
### Server Functions
```rust
// Server functions run on the server, callable from client
#[server(GetPosts, "/api")]
pub async fn get_posts(page: u32) -> Result<Vec<Post>, ServerFnError> {
let db = use_context::<PgPool>().unwrap();
let posts = sqlx::query_as!(
Post,
"SELECT * FROM posts ORDER BY created_at DESC LIMIT 20 OFFSET $1",
((page - 1) * 20) as i64,
)
.fetch_all(&db)
.await?;
Ok(posts)
}
#[server(CreatePost, "/api")]
pub async fn create_post(title: String, body: String) -> Result<Post, ServerFnError> {
let db = use_context::<PgPool>().unwrap();
let user = use_context::<AuthUser>().ok_or(ServerFnError::new("Unauthorized"))?;
let post = sqlx::query_as!(
Post,
"INSERT INTO posts (title, body, author_id) VALUES ($1, $2, $3) RETURNING *",
title, body, user.id,
)
.fetch_one(&db)
.await?;
Ok(post)
}
// Use in component — works on both server (SSR) and client (WASM)
#[component]
fn PostList() -> impl IntoView {
let posts = create_resource(|| (), |_| get_posts(1));
view! {
<Suspense fallback=move || view! { <p>"Loading..."</p> }>
{move || posts.get().map(|result| match result {
Ok(posts) => view! {
<ul>
{posts.into_iter().map(|p| view! {
<li><a href=format!("/posts/{}", p.id)>{&p.title}</a></li>
}).collect_view()}
</ul>
}.into_view(),
Err(e) => view! { <p class="error">{e.to_string()}</p> }.into_view(),
})}
</Suspense>
}
}
```
### SSR + Hydration
```rust
// main.rs — Full-stack setup with Actix
#[actix_web::main]
async fn main() -> std::io::Result<()> {
let db = PgPool::connect(&env::var("DATABASE_URL").unwrap()).await.unwrap();
HttpServer::new(move || {
let leptos_options = get_configuration(None).await.unwrap().leptos_options;
App::new()
.app_data(web::Data::new(db.clone()))
.route("/api/{tail:.*}", leptos_actix::handle_server_fns())
.leptos_routes(
leptos_options.clone(),
generate_route_list(App),
App,
)
.service(Files::new("/", &leptos_options.site_root))
})
.bind("0.0.0.0:3000")?
.run()
.await
}
```
## Installation
```bash
cargo install cargo-leptos
cargo leptos new --git leptos-rs/start
cd my-app
cargo leptos watch # Dev server with hot reload
cargo leptos build --release # Production build
```
## Best Practices
1. **Fine-grained signals** — Leptos tracks signal dependencies at the expression level; only the exact DOM nodes that depend on a signal update
2. **Server functions** — Use `#[server]` for database queries, auth, file I/O; they compile to API endpoints automatically
3. **Suspense for async** — Wrap async data loading in `<Suspense>`; shows fallback during loading, streams content with SSR
4. **Islands for performance** — Use islands architecture: static HTML with interactive WASM islands; minimal JS shipped
5. **Type-safe routing** — Use `leptos_router` for compile-time checked routes; no runtime 404s from typos
6. **Resource for data fetching** — `create_resource` handles loading states, caching, and refetching automatically
7. **Context for DI** — Use `provide_context` / `use_context` for database pools, auth state, config
8. **WASM size** — Leptos produces small WASM bundles (~200KB gzipped for a full app); fine-grained reactivity means less code shippedRelated Skills
zero-trust-config-helper
Zero Trust Config Helper - Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category.
deploying-monitoring-stacks
This skill deploys monitoring stacks, including Prometheus, Grafana, and Datadog. It is used when the user needs to set up or configure monitoring infrastructure for applications or systems. The skill generates production-ready configurations, implements best practices, and supports multi-platform deployments. Use this when the user explicitly requests to deploy a monitoring stack, or mentions Prometheus, Grafana, or Datadog in the context of infrastructure setup.
cdk-stack-generator
Cdk Stack Generator - Auto-activating skill for AWS Skills. Triggers on: cdk stack generator, cdk stack generator Part of the AWS Skills skill category.
terraform-stacks
Comprehensive guide for working with HashiCorp Terraform Stacks. Use when creating, modifying, or validating Terraform Stack configurations (.tfcomponent.hcl, .tfdeploy.hcl files), working with stack components and deployments from local modules, public registry, or private registry sources, managing multi-region or multi-environment infrastructure, or troubleshooting Terraform Stacks syntax and structure.
technology-stack-blueprint-generator
Comprehensive technology stack blueprint generator that analyzes codebases to create detailed architectural documentation. Automatically detects technology stacks, programming languages, and implementation patterns across multiple platforms (.NET, Java, JavaScript, React, Python). Generates configurable blueprints with version information, licensing details, usage patterns, coding conventions, and visual diagrams. Provides implementation-ready templates and maintains architectural consistency for guided development.
rust-mcp-server-generator
Generate a complete Rust Model Context Protocol server project with tools, prompts, resources, and tests using the official rmcp SDK
microsoft-agent-framework
Create, update, refactor, explain, or review Microsoft Agent Framework solutions using shared guidance plus language-specific references for .NET and Python.
containerize-aspnet-framework
Containerize an ASP.NET .NET Framework project by creating Dockerfile and .dockerfile files customized for the project.
../../../engineering-team/playwright-pro/skills/browserstack/SKILL.md
No description provided.
ralph-tui-create-beads-rust
Convert PRDs to beads for ralph-tui execution using beads-rust (br CLI). Creates an epic with child beads for each user story. Use when you have a PRD and want to use ralph-tui with beads-rust as the task source. Triggers on: create beads, convert prd to beads, beads for ralph, ralph beads, br beads.
systems-programming-rust-project
You are a Rust project architecture expert specializing in scaffolding production-ready Rust applications. Generate complete project structures with cargo tooling, proper module organization, testing
startup-metrics-framework
This skill should be used when the user asks about "key startup metrics", "SaaS metrics", "CAC and LTV", "unit economics", "burn multiple", "rule of 40", "marketplace metrics", or requests guidance on tracking and optimizing business performance metrics.