Features: - Multi-platform bot (Slack, Telegram) - Memory system with SQLite FTS - Tool use capabilities (file ops, commands) - Scheduled tasks system - Dynamic model switching (/sonnet, /haiku) - Prompt caching for cost optimization Optimizations: - Default to Haiku 4.5 (12x cheaper) - Reduced context: 3 messages, 2 memory results - Optimized SOUL.md (48% smaller) - Automatic caching when using Sonnet (90% savings) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
69 lines
1.9 KiB
Markdown
69 lines
1.9 KiB
Markdown
---
|
|
name: adapter-dev
|
|
description: Help develop and debug messaging platform adapters for ajarbot
|
|
user-invocable: true
|
|
disable-model-invocation: true
|
|
allowed-tools: Read, Grep, Glob, Edit, Bash
|
|
context: fork
|
|
agent: Plan
|
|
---
|
|
|
|
# Adapter Development Skill
|
|
|
|
You are helping develop messaging platform adapters for ajarbot using the OpenClaw-inspired architecture.
|
|
|
|
## When invoked
|
|
|
|
1. **Analyze the request**: Understand what adapter work is needed
|
|
2. **Check existing patterns**: Review `adapters/slack/` and `adapters/telegram/` for patterns
|
|
3. **Follow the base contract**: All adapters must implement `BaseAdapter` from `adapters/base.py`
|
|
4. **Test the implementation**: Suggest tests and validation steps
|
|
|
|
## Key files to reference
|
|
|
|
- `adapters/base.py` - Base adapter interface
|
|
- `adapters/runtime.py` - Runtime integration
|
|
- `adapters/slack/adapter.py` - Slack Socket Mode example
|
|
- `adapters/telegram/adapter.py` - Telegram example
|
|
- `README_ADAPTERS.md` - Architecture documentation
|
|
|
|
## Common tasks
|
|
|
|
### Create new adapter
|
|
1. Create `adapters/<platform>/adapter.py`
|
|
2. Implement required methods from `BaseAdapter`
|
|
3. Define capabilities (threads, reactions, max length, etc.)
|
|
4. Add to `bot_runner.py`
|
|
5. Update config template
|
|
|
|
### Debug adapter issues
|
|
1. Check `validate_config()` returns true
|
|
2. Verify credentials format
|
|
3. Test `health_check()` method
|
|
4. Review async event handler registration
|
|
5. Check message chunking logic
|
|
|
|
### Update existing adapter
|
|
1. Read current implementation
|
|
2. Understand the change request
|
|
3. Follow existing patterns
|
|
4. Preserve backward compatibility
|
|
5. Update documentation
|
|
|
|
## Security considerations
|
|
|
|
- Never log credentials or tokens
|
|
- Validate all user input before processing
|
|
- Use platform-specific rate limits
|
|
- Handle errors gracefully
|
|
- Respect user allowlists
|
|
|
|
## Output format
|
|
|
|
Provide:
|
|
1. Clear explanation of changes
|
|
2. Code implementation
|
|
3. Configuration updates needed
|
|
4. Testing steps
|
|
5. Documentation updates
|