brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
rust-error-observabilityUse when adding, changing, debugging, or reviewing Rust service error handling and observability, especially when separating domain errors from HTTP responses, adding thiserror/anyhow, implementing ResponseError or IntoResponse, adding tracing spans, redacting secrets, or diagnosing async failures.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this skill to make Rust service failures understandable to operators while keeping user-facing responses safe. Treat error handling and telemetry as one design surface.
thiserror for expected branches that callers
should match on.anyhow or opaque application
errors when callers should not match every dependency failure.ResponseError,
Axum IntoResponse, or a small adapter function.unwrap, expect, or stringly map_err in service paths unless the
invariant is local and the panic message is useful.Read references/error-boundaries.md when choosing between thiserror,
anyhow, opaque errors, and framework response adapters.
#[tracing::instrument(skip(...))] for request bodies, pools, clients,
passwords, tokens, and large values.Read references/tracing.md for spans, subscriber setup, and test logging.
Read references/secrets-and-pii.md before touching secret-bearing values.
Keep response errors stable and intentional:
pub enum SubscribeError {
Validation(SubscribeValidationError),
Unexpected(anyhow::Error),
}
impl actix_web::ResponseError for SubscribeError {
fn status_code(&self) -> actix_web::http::StatusCode {
match self {
Self::Validation(_) => actix_web::http::StatusCode::BAD_REQUEST,
Self::Unexpected(_) => actix_web::http::StatusCode::INTERNAL_SERVER_ERROR,
}
}
}
The response body should be safe for users. The trace event should carry the diagnostic context operators need.
references/error-boundaries.md: choosing error types and response adapters.references/tracing.md: spans, fields, subscriber setup, and test output.references/secrets-and-pii.md: redaction rules for secrets and sensitive
user data.