Overview
While OpenFang ships with powerful bundled Hands, you can create custom Hands tailored to your specific workflows. This guide walks through building a Hand from scratch using the HAND.toml format.Hand Anatomy
Every Hand consists of:- Metadata — ID, name, description, category, icon
- Tools — Which tools the agent can access
- Requirements (optional) — External dependencies, API keys
- Settings (optional) — User-configurable options
- Agent Configuration — LLM settings and system prompt
- Dashboard Metrics (optional) — Performance tracking
File Structure
HAND.toml Format
Basic Structure
Example: News Digest Hand
Let’s build a Hand that reads news sites and generates a daily digest.Step 1: Create the Directory
Step 2: Write HAND.toml
news_digest_YYYY-MM-DD.{md,html}
Phase 5 — State Persistence
- Add new articles to
news_digest_seen.json(avoid re-featuring) - memory_store
news_digest_state: last_run, total_articles, total_digests - Update dashboard metrics:
- memory_store
news_digest_articles_read— total articles ever processed - memory_store
news_digest_digests_generated— total digests created - memory_store
news_digest_last_run— timestamp
- memory_store
Guidelines
- NEVER fabricate articles or sources — every headline must come from actual fetch
- Skip articles more than 48 hours old unless it’s a weekly digest
- Prioritize diverse sources — don’t feature 10 articles from the same site
- For breaking news, feature at the top even if slightly older
- If a source is unreachable, skip it gracefully and continue """
Dashboard metrics
[dashboard] [[dashboard.metrics]] label = “Articles Read” memory_key = “news_digest_articles_read” format = “number” [[dashboard.metrics]] label = “Digests Generated” memory_key = “news_digest_digests_generated” format = “number” [[dashboard.metrics]] label = “Last Run” memory_key = “news_digest_last_run” format = “text”Step 4: Test
news_digest_2026-03-06.md.
Advanced Features
External Dependencies
If your Hand requires external tools:API Keys
Settings with Options
text— Free text inputselect— Dropdown with predefined optionstoggle— Boolean on/off
Knowledge Graph Usage
If your Hand tracks entities and relationships:Event Publishing
If your Hand should notify other systems:System Prompt Best Practices
Effective system prompts:
- Start with Phase 0 — Platform detection and state recovery
- Multi-phase structure — Break workflow into clear phases
- Explicit tools — Show exact shell commands or tool calls
- Error handling — Describe what to do when things fail
- Cross-platform — Handle Windows, macOS, Linux differences
- Examples — Include concrete examples of outputs
- Guidelines — End with behavioral rules and edge cases
Prompt Structure Template
Tools Reference
Available Tools
| Tool | Purpose |
|---|---|
shell_exec | Run shell commands |
file_read | Read files |
file_write | Write files |
file_list | List directory contents |
web_fetch | Fetch web pages |
web_search | Search the web |
memory_store | Store key-value data |
memory_recall | Retrieve stored data |
knowledge_add_entity | Add entity to knowledge graph |
knowledge_add_relation | Add relationship to knowledge graph |
knowledge_query | Query knowledge graph |
schedule_create | Create scheduled task |
schedule_list | List schedules |
schedule_delete | Delete schedule |
event_publish | Publish event to event bus |
browser_navigate | Navigate browser to URL |
browser_click | Click element in browser |
browser_type | Type text in browser |
browser_screenshot | Take browser screenshot |
browser_read_page | Read current page content |
browser_close | Close browser session |
Testing Your Hand
Manual Testing
Iterative Development
- Start with a minimal system prompt
- Test with simple tasks
- Add complexity incrementally
- Handle errors as they appear
- Refine based on actual behavior
Common Issues
“Hand doesn’t activate”Check HAND.toml syntax. Ensure
id, name, description are present.
“Tool not found”Verify tool name in
tools array matches OpenFang’s tool names exactly.
“Settings not working”Settings are referenced in system prompt via User Configuration section — check the prompt reads them correctly. “Metrics not showing”
Ensure
memory_store calls use the exact key names defined in [dashboard.metrics].
Real-World Examples
Email Digest Hand
Reads your inbox, categorizes emails, generates daily summaries. Key features:- IMAP integration
- Email categorization (important, spam, newsletters)
- Smart summaries
- Action item extraction
Backup Hand
Automated backup management with verification. Key features:- Schedule-based backups
- Multiple destinations (local, S3, etc.)
- Integrity verification
- Retention policies
Code Review Hand
Reviews pull requests and provides feedback. Key features:- GitHub/GitLab integration
- Static analysis
- Best practice checks
- Automated comments
Invoice Processing Hand
Extracts data from invoices and updates accounting system. Key features:- PDF parsing
- Data extraction
- Validation
- QuickBooks/Xero integration
Sharing Your Hand
Publishing
- Test thoroughly
- Write clear documentation in SKILL.md
- Add examples to system prompt
- Share the directory:
Installation by Others
Tips & Best Practices
For maintainable Hands:
- Keep system prompts under 3000 tokens for cost efficiency
- Use phases for clarity — easier to debug
- Include examples in prompts — improves reliability
- Test on all platforms you support (Windows, macOS, Linux)
- Version your Hand (include version in metadata comments)
- Document settings thoroughly
- Provide sensible defaults
- Handle errors gracefully (don’t crash on missing files, network errors, etc.)
Next Steps
Browse Existing Hands
Study bundled Hands for inspiration
Tool Reference
Learn about available tools
Community
Share your Hands with the community:- OpenFang GitHub Discussions
- Discord server (coming soon)
- Submit to the official Hand registry