Agent skill
tool-architecture
Install this agent skill to your Project
npx add-skill https://github.com/BA-CalderonMorales/terminal-jarvis/tree/main/.github/skills/tool-architecture
SKILL.md
Tool Architecture & Integration Pattern
The "Why" Behind Tool Integration
Terminal Jarvis uses a hybrid configuration architecture designed to balance ease of contribution with robust runtime performance.
1. The "Seed Data" Pattern (TOML Files)
We define tools in config/tools/*.toml rather than hardcoding them in Rust or requiring manual database entry.
- Why?:
- Accessibility: Anyone can add a tool by copying an existing TOML file. No Rust knowledge required.
- Portability: TOML files are distributed with the NPM and Cargo packages, ensuring all users get the latest tool definitions on install.
- Seed Strategy: On first run, the application reads these TOML files and "seeds" the local SQLite database.
2. The Database-First Runtime
While configuration starts in TOML, runtime execution relies on the SQLite database (src/db/tools/).
- Why?:
- Performance: Querying a relational DB is faster than parsing 20+ TOML files on every command.
- User Overrides: Users can modify tool settings (like
requires_sudo) locally without editing read-only system files. - State Tracking: The DB tracks installation status, last used dates, and successful/failed execution metrics.
3. The Command Mapping Layer
src/tools/tools_command_mapping.rs provides the glue between user input and the configuration system.
- Why?:
- Aliasing: Maps
run gptto thecodexconfiguration. - Sanitization: Ensures we have a static registry of known tools before hitting the database.
- Compile-Time Safety: Provides a partial check that tools referenced in code actually exist.
- Aliasing: Maps
How to Add a New Tool (The "Golden Path")
- Create Config: Add
config/tools/<tool_name>.toml(Follow existing schema). - Register Mapping: Add entry to
src/tools/tools_command_mapping.rs. - Sync Distribution: Copy TOML to
npm/terminal-jarvis/config/tools/.
This pattern ensures that a new tool is immediately available to all users across all platforms (Rust/NPM/Homebrew) without complex migration scripts.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
versioning
release
multi-repo
tool-config
testing
token-budget
Didn't find tool you were looking for?