一键导入
thiserror
Expert knowledge for Rust error handling with thiserror — derive macros for custom error types,
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert knowledge for Rust error handling with thiserror — derive macros for custom error types,
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Expert knowledge for the darkmatter Rust library - Markdown parsing, composition, frontmatter, terminal/HTML/Markdown rendering, style frontmatter, syntax highlighting, document comparison, and disclosure blocks. Use when parsing or composing Markdown, rendering Markdown to terminal/HTML/Markdown, working with DarkmatterPage, `style:` frontmatter, frontmatter hashing, disclosure blocks (`::disclosure` / `::details` / `::end-disclosure`), or comparing documents.
Use when working in the claudine/ package area or with the Claudine library/CLI — normalizing agentic-CLI lifecycle events and hooks, wrapping providers (Claude Code, Codex, Gemini, Goose, Kimi, OpenCode, Qwen, Kilo, Pi, Antigravity), composing Markdown prompts (compose/inline-compose/sequence), managing the MCP catalog, linking skills/commands/agents across providers, or researching agentic CLI platform behavior.
Expert knowledge for the unchained-ai LLM pipeline library including pipeline primitives, provider registry, model catalogs, rig-core integration, code generation, and agent status monitoring. Use when working in unchained-ai/, building LLM pipelines, adding providers/models, implementing pipeline steps, running the model generator, or querying agentic platform limits.
Expert knowledge for the Agent Client Protocol (ACP) and its underlying JSON-RPC standard, with Rust and TypeScript libraries. Use when implementing or integrating ACP, building an ACP client or agent, or devising strategies for interacting with agentic CLI providers (Claude Code, Codex, Kimi Code, OpenCode, Gemini CLI) over ACP.
Configuring models in agentic CLIs — adding local or cloud models to Claude Code, Codex, Gemini CLI, Goose, Kimi Code, OpenCode, Qwen Code, Pi, or Kilo Code. Use when wiring a local runner (Ollama, LM Studio, oMLX, llama.cpp, vLLM) into an agentic CLI, redirecting a provider's base URL (ANTHROPIC_BASE_URL, OPENAI_BASE_URL, model_providers, provider.<id>.options.baseURL), choosing between OpenAI-compatible and Anthropic-compatible endpoints, bridging a CLI to a different cloud vendor's models, or working with per-provider model config file shapes and merge semantics.
Detecting, configuring, and wiring local model runners into agentic CLIs. Use when working with Ollama, LM Studio, oMLX, llama.cpp (llama-server), or vLLM; probing which local runners are installed or running; hitting OpenAI-compatible local endpoints (/v1) or Anthropic-compatible /v1/messages; serving local models; or connecting a local model to OpenCode or Claude Code via base URL, ANTHROPIC_BASE_URL/ANTHROPIC_AUTH_TOKEN, or runner-native launch hooks.
| name | thiserror |
| description | Expert knowledge for Rust error handling with thiserror — derive macros for custom error types, |
| hash | 0818e6c807d7d386 |
A Rust crate for creating custom error types with minimal boilerplate using derive macros. Created by David Tolnay, it automatically implements Error, Display, and From traits.
Use for: Library development, public APIs, when callers need to match on specific error variants.
thiserror for libraries, anyhow for applicationsError and Debug together#[error("...")] for Display formatting with field interpolation#[from] for automatic From impl enabling ? operator conversion#[source] to mark the underlying cause (for error chaining)#[error(transparent)] to delegate Display/source to wrapped erroruse thiserror::Error;
#[derive(Error, Debug)]
pub enum MyError {
// Simple variant
#[error("Operation failed")]
Simple,
// With field interpolation
#[error("Invalid input: {input} (expected {expected})")]
InvalidInput { input: String, expected: String },
// Auto From impl with #[from]
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
// Explicit source without From
#[error("Database query failed")]
Database { #[source] source: sqlx::Error },
// Transparent wrapper
#[error(transparent)]
Other(#[from] anyhow::Error),
}
#[derive(Error, Debug)]
pub enum LibraryError {
#[error("Invalid configuration: {0}")]
Config(String),
#[error("Network request failed: {0}")]
Network(#[from] reqwest::Error),
#[error("Authentication failed for user {user}")]
Auth { user: String },
}
fn read_config(path: &str) -> Result<Config, ConfigError> {
let content = std::fs::read_to_string(path).map_err(|e| match e.kind() {
std::io::ErrorKind::NotFound => ConfigError::NotFound { path: path.into() },
std::io::ErrorKind::PermissionDenied => ConfigError::PermissionDenied { path: path.into() },
_ => ConfigError::Io(e),
})?;
// ...
}
#[derive(Error, Debug)]
pub enum ProcessError<T: std::fmt::Debug> {
#[error("Failed to process: {0:?}")]
Processing(T),
#[error("Validation failed: {0}")]
Validation(String),
}