How automation works
Claudio executes the workflow
MCPs are orchestrated to gather data, generate reports, and send outputs.
Available automation scripts
Weekly bot report
File:scripts/weekly-bot-report.sh
Generates and emails a weekly performance report for the WhatsApp bot.
Schedule:
- Frequency: Every Monday
- Time: 9:00 AM
- Cron expression:
0 9 * * 1
Reads funnel metrics
Pulls data from the “Full Funnel Performance” spreadsheet (ID:
1PI2NnSzDhxCrb-NY18WgEiNpQyujgSG0RkPCw4c7IM8).Calculates WoW changes
Compares last week vs. previous week with absolute delta and percentage change.
Generates HTML email
Creates a formatted report with tables, color-coded metrics (PropHero blue
#2050f6), and green/red arrows for improvements/declines.Sends via Gmail
Emails the report to [email protected] with subject “Reporte Semanal Bot - Full Funnel Performance”.
- Nuevos Leads
- Group Calls Booked (Direct)
- New Lead No Booked
- Group Calls Booked by Bot (Total)
- First Time - Group Calls Booked by Bot
- % First Time
- Rescheduled - Group Calls Booked by Bot
- % Rescheduled
- Group Calls Booked (Total)
- % Group Calls Booked by Bot (from Total Group Calls)
- Group Call Attended (Total)
- Group Call Attended (Booked by Bot)
- Show Up Rate (Total)
- Bot - Show Up Rate
- Google Sheets (read metrics)
- Gmail (send report)
Monthly DS & AI report
File:scripts/monthly-ds-ai-report.sh
Generates a comprehensive monthly review for the DS & AI squad and publishes it to Google Drive.
Schedule:
- Frequency: First day of each month
- Time: 10:00 AM
- Cron expression:
0 10 1 * *
Pulls completed tasks
Fetches tasks completed or in progress during the previous month from sprint lists.
Calculates delivery metrics
Computes Say/Do Ratio, Carry-over, Bug Rate, Cycle Time, and Completion Rate per Epic.
Builds structured report
Creates a report following the meeting agenda: Wins & Learnings, Metrics, Initiatives & Epics Review, Recap.
- Wins & Learnings (0–10 min) — Top 3 wins, biggest learnings, general updates
- Metrics (10–30 min) — Outcome metrics, delivery metrics, speed & quality, team health
- Initiatives & Epics Review (30–50 min) — Planned vs delivered, epic status, risks & blockers
- Recap (50–60 min) — Summary, decisions, next steps
- ClickUp (Epics, tasks, Initiatives)
- Google Docs (create report)
Kill bot processes
File:scripts/kill_bot_processes.sh
Maintenance script to safely terminate bot processes and clean up lock files.
Purpose: Use this when bots (Telegram or Slack) become unresponsive or you need to restart them.
What it does:
Manual execution:
Log files
All automation scripts write logs toscripts/logs/:
| Script | Log File |
|---|---|
| Weekly bot report | weekly-bot-report.log |
| Monthly DS & AI report | monthly-ds-ai-report.log |
Setting up cron jobs
To configure these scripts to run automatically:Requirements
- Claude Code CLI installed at the path specified in the script
- MCPs configured (Google Sheets, Gmail, ClickUp, Google Docs)
- Workspace path correctly set in the script
- Write permissions for log directory
Customizing scripts
You can modify the prompts in the scripts to:- Change recipients for email reports
- Add or remove metrics from reports
- Adjust report formatting (colors, tables, sections)
- Change output destinations (different folders, channels)
claude -p.
Monitoring
To monitor automation health:Check recent logs
Check recent logs
Verify cron is running
Verify cron is running
Test script manually
Test script manually
Run the script directly to verify it works before relying on cron.
Set up alerts
Set up alerts
Configure email notifications for cron failures or add monitoring via your preferred tool.
Troubleshooting
Script doesn't run on schedule
Script doesn't run on schedule
- Verify cron is enabled on your system
- Check script has execute permissions (
chmod +x script.sh) - Ensure absolute paths are used in the script and crontab
- Check system logs:
grep CRON /var/log/syslog
Script runs but fails
Script runs but fails
- Check the log file for error messages
- Verify MCP configurations are valid
- Test MCPs manually with
claude -p "test prompt" - Ensure API tokens and credentials haven’t expired
No logs generated
No logs generated
- Verify the
scripts/logs/directory exists - Check write permissions on the logs directory
- Run the script manually to see if it creates logs