How xingkongliang/skills-manager works
Purpose and Entry Points
Skills Manager is a cross-platform desktop application and companion CLI for maintaining a central library of AI-agent skills, deploying them to global/project tool directories, and backing them up through Git. The React/Tauri desktop entry path is src/main.tsx → src/App.tsx → Rust host src-tauri/src/main.rs / src-tauri/src/lib.rs. The shared-core CLI entry point is src-tauri/src/bin/skills-manager-cli.rs.
Desktop UI and Client Boundary
The frontend is React 19/TypeScript built by Vite, with Tauri IPC as its backend boundary. Application-wide state and command integration are centered in src/context/AppContext.tsx and src/lib/tauri.ts. Primary UI domains are library installation and management (src/views/MySkills.tsx, src/views/InstallSkills.tsx), global/project/linked workspaces (src/views/WorkspaceView.tsx, src/views/ProjectDetail.tsx), and backup/settings (src/views/Backup.tsx, src/views/Settings.tsx).
Rust Command API and Application State
Tauri commands provide the explicit UI-to-core API and partition operations by business domain: skills, workspaces/projects, sync, backup Git, settings, scanning, and tool management. Main command registration/module boundary is src-tauri/src/commands/mod.rs; representative handlers include src-tauri/src/commands/skills.rs, src-tauri/src/commands/sync.rs, and src-tauri/src/commands/git_backup.rs. Shared initialization, database handles, configuration, and runtime services are coordinated through src-tauri/src/core/app_state.rs.
Central Library, Metadata, and Installation
The canonical skill content lives in a configurable central repository (default ~/.skills-manager), while SQLite holds rebuildable metadata such as tags, presets, source state, and per-agent toggles. Storage and import/update behavior are implemented by src-tauri/src/core/skill_store.rs, src-tauri/src/core/skill_metadata.rs, and src-tauri/src/core/installer.rs. Inputs cross a trust/path boundary—local folders, archives, Git sources, and skills.sh—and are guarded by src-tauri/src/core/path_guard.rs; content hashes support change detection in src-tauri/src/core/content_hash.rs.
Workspaces, Tool Adapters, and Sync
Tool adapters define supported agents/custom tools and their global or project-local skill directories. src-tauri/src/core/tool_adapters.rs and src-tauri/src/core/tool_service.rs resolve target paths and capabilities. Scanner services inspect both managed and externally present skills (src-tauri/src/core/scanner.rs, src-tauri/src/core/project_scanner.rs), enabling adoption and live workspace views. src-tauri/src/core/sync_engine.rs applies preset/library selections to targets via copy or symlink, with installation cancellation coordination in src-tauri/src/core/install_cancel.rs.
Git Backup, Remote Sync, and Conflict Handling
The central library can be versioned and synchronized against arbitrary Git remotes or GitHub-created private repositories. Git execution/credentials/remotes are isolated in src-tauri/src/core/git_backup.rs, src-tauri/src/core/git2_engine.rs, and src-tauri/src/core/github_api.rs; GitHub device authorization tokens are handled through platform-secure credential support. Background backup behavior is managed by src-tauri/src/core/auto_backup.rs. Skill-aware cross-device merge is a separate subsystem—protocol, snapshots, validation, conflict decisions, and application live under src-tauri/src/core/merge/mod.rs, src-tauri/src/core/merge/resolve.rs, and src-tauri/src/core/merge/apply.rs.
Runtime, Infrastructure, and Safety
The packaged runtime is Tauri 2 with Rust, SQLite (rusqlite), React, Tailwind, and i18n resources under src/i18n/. Desktop permissions/capabilities and packaging are defined in src-tauri/capabilities/default.json and src-tauri/tauri.conf.json. File watching, repository locking, migrations, audit logging, and panic-safe diagnostics protect concurrent desktop/CLI use and filesystem mutation: src-tauri/src/core/file_watcher.rs, src-tauri/src/core/repo_lock.rs, and src-tauri/src/core/audit_log.rs.
Main entry points: mod.rs Command API · AppContext.tsx App context · skill_store.rs Central skill library · installer.rs Skill installer
Components 20
Desktop client
React frontend and Tauri IPC boundary.
- Desktop entry
src/main.tsx - App shell
src/App.tsx - App context · Application-wide state and command integration.
src/context/AppContext.tsx - Tauri client · Frontend boundary for invoking Rust commands.
src/lib/tauri.ts - Skill library views · Library management and skill installation UI.
src/views/MySkills.tsx - Workspace views · Global, project, and linked workspace UI.
src/views/WorkspaceView.tsx - Backup and settings
src/views/Backup.tsx
Core services
Shared Rust application logic used by desktop and CLI.
- Tauri host · Desktop runtime entry and command host.
src-tauri/src/main.rs - Companion CLI · Shares the core application services.
src-tauri/src/bin/skills-manager-cli.rs - Command API · Domain-partitioned UI-to-core API.
src-tauri/src/commands/mod.rs - Application state · Coordinates initialization, configuration, database handles, and services.
src-tauri/src/core/app_state.rs - Central skill library · Canonical configurable repository for skill content.
src-tauri/src/core/skill_store.rs - Skill metadata · Rebuildable tags, presets, source state, and per-agent toggles.
src-tauri/src/core/skill_metadata.rs - Skill installer · Imports and updates skill content from supported sources.
src-tauri/src/core/installer.rs - Path guard · Validates local folders, archives, Git sources, and skills.sh inputs.
src-tauri/src/core/path_guard.rs
Deployment and backup
Workspace synchronization and Git-backed library protection.
- Tool adapters · Resolves agent capabilities and global or project skill directories.
src-tauri/src/core/tool_service.rs - Workspace scanner · Finds managed and externally present skills for adoption and live views.
src-tauri/src/core/scanner.rs - Sync engine · Applies library and preset selections by copy or symlink.
src-tauri/src/core/sync_engine.rs - Git backup · Executes repository backup, credentials, and remote synchronization.
src-tauri/src/core/git_backup.rs - Skill-aware merge · Resolves and applies cross-device skill conflicts.
src-tauri/src/core/merge/mod.rs
Connections 27
- Desktop entry → App shell: mounts
- App shell → App context: provides state
- App context → Skill library views: drives
- App context → Workspace views: drives
- App context → Backup and settings: drives
- App context → Tauri client: invokes through
- Tauri client → Command API: IPC commands
- Tauri host → Command API: registers
- Companion CLI → Application state: uses
- Command API → Application state: accesses
- Application state → Central skill library: coordinates
- Application state → Skill metadata: coordinates
- Command API → Skill installer: imports skills
- Skill installer → Path guard: validates inputs
- Skill installer → Central skill library: writes content
- Skill installer → Skill metadata: records state
- Command API → Tool adapters: manages tools
- Tool adapters → Workspace scanner: provides target paths
- Workspace scanner → Skill metadata: updates discovered state
- Command API → Sync engine: starts sync
- Sync engine → Central skill library: reads selections
- Sync engine → Tool adapters: deploys to targets
- Command API → Git backup: runs backup
- Git backup → Central skill library: versions repository
- Git backup → Skill-aware merge: resolves divergence
- Skill-aware merge → Central skill library: applies merged content
- Skill-aware merge → Skill metadata: reconciles state