use std::path::PathBuf;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("ADR directory not found. Run 'adrs init' to create one.")]
AdrDirNotFound,
#[error("ADR directory already exists: {0}")]
AdrDirExists(PathBuf),
#[error("ADR not found: {0}")]
AdrNotFound(String),
#[error("Multiple ADRs match '{query}': {matches:?}")]
AmbiguousAdr { query: String, matches: Vec<String> },
#[error("Invalid ADR number: {0}")]
InvalidNumber(String),
#[error("Invalid ADR format in {path}: {reason}")]
InvalidFormat { path: PathBuf, reason: String },
#[error("Missing required field '{field}' in {path}")]
MissingField { path: PathBuf, field: String },
#[error("Invalid status: {0}")]
InvalidStatus(String),
#[error("Invalid link format: {0}")]
InvalidLink(String),
#[error("Template not found: {0}")]
TemplateNotFound(String),
#[error("Template error: {0}")]
TemplateError(String),
#[error("Configuration error: {0}")]
ConfigError(String),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("YAML error: {0}")]
Yaml(#[from] serde_yaml::Error),
#[error("TOML error: {0}")]
Toml(#[from] toml::de::Error),
}