creating-zed-extensions
БесплатноБез исполняемых скриптовНе проверенUse when creating Zed extensions with custom slash commands, language support, themes, or MCP servers - provides Rust/WASM extension structure, slash command…
Об этом скилле
Creating Zed Extensions
Overview
Zed extensions are Rust programs compiled to WebAssembly that can provide slash commands, language support, themes, grammars, and MCP servers. Extensions implement the zed::Extension trait and are distributed via Zed's extension registry.
When to Use
Create a Zed extension when:
- Adding custom slash commands to the Assistant (
/deploy,/analyze,/fetch-docs) - Providing language support (syntax highlighting, LSP, formatting)
- Creating custom color themes
- Integrating external tools via slash commands
- Providing MCP server integrations
Don't create for:
- Simple rules or instructions (use
.rulesfiles) - One-time scripts (use terminal)
- Project-specific configuration (use
.zed/settings.json)
Quick Reference
Extension Structure
my-extension/
├── Cargo.toml # Rust manifest
├── extension.toml # Extension metadata
└── src/
└── lib.rs # Extension implementation
Minimal Slash Command Extension
# extension.toml
id = "my-commands"
name = "My Commands"
version = "0.1.0"
authors = ["Your Name"]
repository = "https://github.com/username/my-commands"
license = "MIT"
[slash_commands.echo]
description = "echoes the provided input"
requires_argument = true
[slash_commands.greet]
description = "greets the user"
requires_argument = false
// src/lib.rs
use zed_extension_api::{self as zed, Result, SlashCommand, SlashCommandOutput};
struct MyExtension;
impl zed::Extension for MyExtension {
fn run_slash_command(
&self,
command: SlashCommand,
args: Vec<String>,
_worktree: Option<&zed::Worktree>,
) -> Result<SlashCommandOutput> {
match command.name.as_str() {
"echo" => {
if args.is_empty() {
return Err("echo requires an argument".to_string());
}
Ok(SlashCommandOutput {
text: args.join(" "),
sections: vec![],
})
}
"greet" => {
Ok(SlashCommandOutput {
text: "Hello! How can I help you today?".to_string(),
sections: vec![],
})
}
_ => Err(format!("Unknown command: {}", command.name)),
}
}
}
zed::register_extension!(MyExtension);
# Cargo.toml
[package]
name = "my-extension"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib"]
[dependencies]
zed_extension_api = "0.1.0"
Implementation
Complete Example: Documentation Fetcher
// src/lib.rs
use zed_extension_api::{self as zed, Result, SlashCommand, SlashCommandOutput, SlashCommandOutputSection};
use std::process::Command;
struct DocsExtension;
impl zed::Extension for DocsExtension {
fn run_slash_command(
&self,
command: SlashCommand,
args: Vec<String>,
worktree: Option<&zed::Worktree>,
) -> Result<SlashCommandOutput> {
match command.name.as_str() {
"docs" => self.fetch_docs(args, worktree),
"api" => self.fetch_api_reference(args),
_ => Err(format!("Unknown command: {}", command.name)),
}
}
fn complete_slash_command_argument(
&self,
command: SlashCommand,
_args: Vec<String>,
) -> Result<Vec<zed::SlashCommandArgumentCompletion>> {
match command.name.as_str() {
"docs" => Ok(vec![
zed::SlashCommandArgumentCompletion {
label: "rust".to_string(),
new_text: "rust".to_string(),
run_command: true,
},
zed::SlashCommandArgumentCompletion {
label: "typescript".to_string(),
new_text: "typescript".to_string(),
run_command: true,
},
zed::SlashCommandArgumentCompletion {
label: "python".to_string(),
new_text: "python".to_string(),
run_command: true,
},
]),
_ => Ok(vec![]),
}
}
}
impl DocsExtension {
fn fetch_docs(
&self,
args: Vec<String>,
worktree: Option<&zed::Worktree>,
) -> Result<SlashCommandOutput> {
if args.is_empty() {
return Err("docs requires a topic (e.g., /docs rust)".to_string());
}
let topic = args.join(" ");
let docs_url = format!("https://docs.rs/{}", topic);
// Use worktree context if available
let context = if let Some(wt) = worktree {
format!("\nProject: {}", wt.root_path())
} else {
String::new()
};
let output_text = format!(
"Documentation for: {}\nURL: {}{}\n\nFetching latest docs...",
topic, docs_url, context
);
Ok(SlashCommandOutput {
Установить creating-zed-extensions в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл creating-zed-extensions?
Use when creating Zed extensions with custom slash commands, language support, themes, or MCP servers - provides Rust/WASM extension structure, slash command API (run_slash_command, SlashCommandOutput), and development workflow for compiled extensions
Как установить скилл creating-zed-extensions?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл creating-zed-extensions запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic