v0.1.6·Advanced
Best Practices
Best practices for using the CLI effectively
Best Practices
Follow these best practices to get the most out of the CLI and its ecosystem.
General Usage
Command Organization
- Use meaningful command names
- Group related commands logically
- Provide clear help text for all commands
Error Handling
- Always provide actionable error messages
- Include suggestions for recovery
- Log detailed information for debugging
Performance
- Minimize expensive operations in the hot path
- Cache results when appropriate
- Use concurrent execution for independent tasks
Hooks Best Practices
Validation Hooks
Use PreToolUse hooks for validation:
Side Effects
Use PostToolUse hooks for cleanup:
Skills Best Practices
Single Responsibility
Each skill should have a single, well-defined purpose.
Documentation
Provide comprehensive documentation:
- Describe what the skill does
- List all configuration options
- Include usage examples
Error Handling
Handle errors gracefully and provide clear feedback:
Agents Best Practices
Clear Instructions
Provide clear, unambiguous instructions to agents:
Tool Selection
Choose tools that are:
- Well-tested and reliable
- Properly documented
- Focused on specific tasks
Error Recovery
Implement fallback strategies for common failure scenarios.
MCP Servers Best Practices
Server Design
- Keep servers lightweight and focused
- Implement proper timeout handling
- Provide meaningful error messages
Resource Management
- Clean up resources promptly
- Limit concurrent connections
- Monitor memory usage
© 2025 UI Lab • Built for humans and machines