2.7 KiB
2.7 KiB
[2026-02-26 15:52] ✅ Fixed blog-backup skill to match mission-control-docs pattern
What was requested
Matt asked to continue fixing issues with the daily blog and create a skill similar to mission-control-docs.
What was done
1. Updated blog-backup skill library (~/.agents/skills/blog-backup/lib/blog.sh)
- Integrated shared
auth-apitransport module - Added proper error handling with
blog_error()function - Added new functions for complete CRUD:
blog_post_create()- Create digestsblog_post_list()- List digests with filtersblog_post_get()- Get specific digest by IDblog_post_delete()- Delete digestsblog_post_search()- Search digests by contentblog_post_status()- Check if digest exists for dateblog_health()- Check API health
- Updated
_api_call()to use x-api-key header (blog-backup specific auth)
2. Created CLI script (/Users/mattbruce/Documents/Projects/OpenClaw/Web/blog-backup/scripts/blog.sh)
- Full CLI matching the pattern of
mc.shin mission-control - Commands:
post,list,get,delete,search,status,health - Auto-detects
BLOG_MACHINE_TOKENfrom.env.localif available - Comprehensive help and usage documentation
- Made executable with proper permissions
3. Added contract tests (~/.agents/skills/blog-backup/tests/test_contract.sh)
- Tests all API call patterns for the skill functions
- Mocks
_api_callto verify correct method/endpoint/payload - All 6 tests pass:
- blog_post_create contract
- blog_post_list contract
- blog_post_get contract
- blog_post_delete contract
- blog_post_status contract
- blog_health contract
4. Updated SKILL.md documentation
- Documented all functions with examples
- Added CLI usage section
- Documented file structure
- Added testing instructions
5. Updated TOOLS.md
- Added CLI Access section with examples
- Enhanced Skill Usage section with all functions
Commits Made
- blog-backup project:
Add CLI script for blog-backup API operations(e3b47b6) - workspace:
Update TOOLS.md with blog-backup CLI documentation(8ddd307)
Architecture
Following the API-centric CLI pattern:
Skill (blog.sh) → auth-api transport → API (x-api-key) → Database
Testing
# Run contract tests
bash ~/.agents/skills/blog-backup/tests/test_contract.sh
# Test CLI
cd /Users/mattbruce/Documents/Projects/OpenClaw/Web/blog-backup
./scripts/blog.sh health
./scripts/blog.sh list --limit 5
Next Steps
- The blog-backup API currently returns empty results (no digests in database)
- Daily digest cron job should resume populating data
- Consider adding TTS (text-to-speech) integration if needed