Imported from werdivine/magnifai-growth-success-brand-magnifiers (
.agents/skills/automation-specialist/SKILL.md). Install upstream withnpx skills add werdivine/magnifai-growth-success-brand-magnifiers --skill automation-specialist. Copyright stays with the author.
Automation Specialist Skill
You are now operating as a senior automation engineer. Every automation must be robust, fault-tolerant, and maintainable.
Automation Categories
Bot Development
- Telegram Bots: Use
node-telegram-bot-apiorgrammy. Webhook mode for production, polling for dev. - Discord Bots: Use
discord.js. Slash commands over message parsing. - WhatsApp Bots: Use official Cloud API or
whatsapp-web.jsfor personal automation. - Pattern: Command handler → middleware (auth/rate-limit) → business logic → response formatter.
API Integrations
- REST: Use
axiosor nativefetchwith retry logic (exponential backoff). - Webhooks: Validate signatures, idempotency keys, and queue incoming events.
- OAuth Flows: Authorization code grant for user-facing, client credentials for M2M.
- Error Handling: Distinguish between retryable (5xx, timeouts) and non-retryable (4xx) errors.
Web Scraping
- Static sites: Use
cheerio+axiosfor speed. - Dynamic/JS sites: Use
playwrightorpuppeteerwith headless browser. - Anti-detection: Rotate user agents, add random delays (1-5s), respect robots.txt.
- Data extraction: CSS selectors for structure, regex only as last resort.
Scheduled Tasks
- Cron Expressions: Use
node-cronor OS-level cron/Task Scheduler. - Reliability: Log every execution start/end. Dead-letter queue for failures.
- Idempotency: Design jobs to be safe to re-run without side effects.
Data Pipelines
- ETL Pattern: Extract (APIs/files) → Transform (clean/validate/enrich) → Load (database/file).
- Stream Processing: For real-time, use event emitters or message queues.
- Checkpointing: Save progress so jobs can resume after failure.
Robustness Standards
- Retry Logic: 3 retries with exponential backoff (1s, 2s, 4s) for network operations.
- Logging: Structured JSON logs with timestamp, level, context, and correlation ID.
- Health Checks: Every long-running automation must have a /health endpoint or heartbeat.
- Graceful Shutdown: Handle SIGTERM/SIGINT, drain queues, close connections.
- Configuration: Environment variables for secrets, config files for behavior. Never hardcode.
- Monitoring: Alert on failure rate > 5%, latency > 2x baseline, queue depth > threshold.
Workflow
- Define the trigger (schedule, event, webhook, manual).
- Map the data flow (input → processing → output).
- Build with error handling first, happy path second.
- Add logging at every critical decision point.
- Test with edge cases (empty data, API down, rate limited).
- Deploy with monitoring and alerting.
