#![deny(unsafe_code)]
//! Skill recommendations based on usage patterns and project context.
//!
//! This crate provides intelligent skill discovery and creation:
//!
//! - **Usage analytics**: Parse Claude Code and Codex CLI session data
//! - **Project context**: Analyze languages, dependencies, frameworks
//! - **Recommendations**: Combine multiple signals for smart suggestions
//! - **Skill creation**: Search GitHub or generate via LLM
//!
//! # Examples
//!
//! ## Analyze a project
//!
//! ```no_run
//! use skrills_intelligence::{analyze_project, ProjectProfile};
//! use std::path::Path;
//!
//! let profile = analyze_project(Path::new(".")).unwrap();
//! println!("Languages: {:?}", profile.languages);
//! println!("Project type: {:?}", profile.project_type);
//! ```
//!
//! ## Search GitHub for skills
//!
//! ```no_run
//! # async fn example() -> anyhow::Result<()> {
//! use skrills_intelligence::search_github_skills;
//!
//! let results = search_github_skills("database migration", 5).await?;
//! for skill in results {
//!     println!("{}: {}", skill.skill_path, skill.repo_url);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Build usage analytics
//!
//! ```no_run
//! use skrills_intelligence::{build_analytics, save_analytics, SkillUsageEvent};
//! use std::path::Path;
//!
//! let events: Vec<SkillUsageEvent> = vec![]; // Load from session data
//! let analytics = build_analytics(events);
//! println!("Tracked {} skills", analytics.frequency.len());
//! save_analytics(&analytics, Path::new("analytics.json")).unwrap();
//! ```

pub mod context;
pub mod create;
pub mod recommend;
#[cfg(test)]
pub(crate) mod test_support;
pub mod types;
pub mod usage;

pub use types::Confidence;

pub use context::{
    analyze_project, analyze_project_with_options, AnalyzeProjectOptions, DependencyInfo,
    LanguageInfo, ProjectProfile, ProjectType,
};
pub use create::{
    fetch_skill_content, generate_skill_sync, generate_skill_with_llm, get_available_cli,
    is_cli_available, search_github_skills, search_skills_advanced, CliEnvironment,
    CreateSkillRequest, CreateSkillResult, CreationMethod, GitHubSkillResult,
};
pub use recommend::{
    compute_similarity, find_similar_skills, has_similar_skill, match_skill,
    summarize_recommendations, MatchedField, RecommendationSignal, ScoreBreakdown, SkillGap,
    SkillGapAnalysis, SkillInfo, SkillMatch, SmartRecommendation, DEFAULT_THRESHOLD,
};
pub use usage::{
    build_analytics, default_analytics_cache_path, get_cooccurring_skills, load_analytics,
    load_or_build_analytics, parse_claude_command_history, parse_claude_sessions, recency_score,
    save_analytics, CommandEntry, PromptAffinity, SkillUsageEvent, TimeRange, UsageAnalytics,
};
