Agent Tools & Capabilities
Relevant source files
The following files were used as context for generating this wiki page:
Termul manages AI coding agents using the Agent Client Protocol (ACP). It provides these agents with a project-aware environment through "Skills" and specialized "Tools." The system allows agents to interact with the local filesystem, execute commands, and perform complex tasks like searching or editing code.
Agent Skills Discovery
Skills are Zed-compatible SKILL.md packages that provide instructions to an agent. The system discovers these skills by scanning specific directories on the host machine.
Skill Scoping and Hierarchy
Termul looks for skills in two locations:
- Global Skills: Located at
~/.agents/skills/. - Project-Local Skills: Located at
{project}/.agents/skills/.
Project-local skills take precedence and override global skills with the same name.
Sources: [src-tauri/src/skills/mod.rs:1-8](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src-tauri/src/skills/mod.rs#L1-L8), [src-tauri/src/skills/mod.rs:184-187](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src-tauri/src/skills/mod.rs#L184-L187)
Data Flow for Skill Resolution
The following diagram illustrates how the Rust backend resolves skills for the renderer:
The scan process ignores invalid directory names and requires an absolute project root path to prevent undefined behavior during Tauri command execution.
Sources: [src-tauri/src/skills/mod.rs:136-160](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src-tauri/src/skills/mod.rs#L136-L160), [src-tauri/src/skills/mod.rs:189-197](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src-tauri/src/skills/mod.rs#L189-L197)
Tool Call Infrastructure
Agents perform actions by emitting tool_call updates. Termul captures these calls, presents them in the UI, and manages their lifecycle.
Tool Call Lifecycle
A tool call progresses through several states:
- Pending: The initial state when a call is first identified.
- In Progress: The agent is actively executing the tool.
- Completed: The tool finished successfully.
- Failed: The tool encountered an error.
Sources: [src/renderer/components/chat/tool-call-summary.ts:167-172](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src/renderer/components/chat/tool-call-summary.ts#L167-L172)
Core Tool Categories
Termul supports several standardized tool types through ACP:
| Tool Kind | Verb (Active) | Primary Data Extracted |
|---|---|---|
read | Reading / Read | File name and line range |
edit | Editing / Edited | File name and diff line counts (+/-) |
execute | Running / Ran | Command line or script name |
search | Searching / Searched | Search query or pattern |
think | Thinking | Thought text or task description |
Sources: [src/renderer/components/chat/tool-call-summary.ts:175-236](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src/renderer/components/chat/tool-call-summary.ts#L175-L236)
Implementation Details
Skill Parsing
The system parses SKILL.md files by splitting them into YAML frontmatter and a Markdown body. It validates skill names to ensure they only contain lowercase letters, digits, and hyphens.
pub fn parse_skill_md(content: &str) -> Result<(HashMap<String, String>, String), String> {
let trimmed = content.trim_start();
if !trimmed.starts_with("---") {
return Ok((HashMap::new(), content.trim().to_string()));
}
// ... logic to extract frontmatter and body
}
Sources: [src-tauri/src/skills/mod.rs:66-96](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src-tauri/src/skills/mod.rs#L66-L96)
Tool Summary Extraction
The renderer uses pure helper functions to generate human-readable summaries for the chat timeline. It performs a best-effort extraction of file paths using a prioritized list of keys: path, filePath, file_path, file, target_file, targetFile, abspath, absPath, filename, and fileName.
Sources: [src/renderer/components/chat/tool-call-summary.ts:47-60](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src/renderer/components/chat/tool-call-summary.ts#L47-L60), [src/renderer/components/chat/tool-call-summary.ts:133-142](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src/renderer/components/chat/tool-call-summary.ts#L133-L142)
Subagent Recognition
Termul identifies "Subagent" or "Task" dispatches by inspecting the rawInput of think calls. If the input contains a subagent_type or both a description and prompt, the UI treats it as a sub-task rather than simple internal reasoning.
Sources: [src/renderer/components/chat/tool-call-summary.ts:79-88](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src/renderer/components/chat/tool-call-summary.ts#L79-L88), [src/renderer/components/chat/tool-call-summary.ts:246-250](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src/renderer/components/chat/tool-call-summary.ts#L246-L250)
Cross-Platform Availability
The tool and skill APIs are adapted for both desktop (Tauri) and web environments.
Sources: [src/renderer/lib/skills-api.ts:27-37](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/src/renderer/lib/skills-api.ts#L27-L37)
Termul treats workspaces as first-class citizens, ensuring that agent tools and skills are contextually aware of the specific project project directory they are operating within.
Sources: [README.md:4-6](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/README.md#L4-L6), [CONTEXT.md:65-67](https://github.com/gnoviawan/troupe/blob/15b88212cc65a286ab7d490dc73985b7fb919893/CONTEXT.md#L65-L67)