Skip to main content
Esta página todavía está en inglés. La traducción al español está en progreso.

Routine Examples

Walkthrough of two real routines showing how all the pieces fit together.

Example 1: Community Pulse

What it does: Reads Discord and WhatsApp messages from the last 24 hours, analyzes activity, sentiment, and support questions, then generates an HTML report. Agent: Pulse (pulse-community) Skill: pulse-daily Schedule: Daily at 20:00

The script

ADWs/routines/examples/community_daily.py:

How it flows

  1. Runner calls claude --print --agent pulse-community with a prompt to execute /pulse-daily
  2. Claude loads the Pulse agent system prompt
  3. Pulse reads the pulse-daily SKILL.md instructions
  4. The skill tells Pulse to:
    • Fetch Discord messages via the Discord API
    • Fetch WhatsApp messages via the Evolution API
    • Analyze activity, sentiment, top topics, support questions
    • Read the HTML template from .claude/templates/html/
    • Fill the template with collected data
    • Save to workspace/community/reports/daily/
    • Send a Telegram notification with the summary
  5. Runner logs the result and updates metrics

The schedule entry

In config/routines.yaml:

Output

An HTML report saved to:
Plus a Telegram message with a brief summary.

Example 2: Financial Pulse

What it does: Queries Stripe for MRR, charges, churn, and failures. Queries Omie for payables, receivables, and invoices. Generates an HTML financial snapshot. Agent: Flux (flux-finance) Skill: fin-daily-pulse Schedule: Daily at 19:00

The script

ADWs/routines/examples/financial_pulse.py:

What the skill does (step by step)

The fin-daily-pulse SKILL.md instructs Flux to:
  1. Collect Stripe data — MRR from active subscriptions, today’s charges (succeeded vs failed), 30-day churn rate, 7-day refunds, new customers
  2. Collect Omie data — overdue receivables, payables due in 7 days, pending invoices
  3. Consolidate transactions — all financial movements for the day
  4. Classify health — green (healthy), yellow (warning), or red (risk) based on churn rate, overdue amounts, and MRR trend
  5. Generate alerts — payment failures, overdue accounts, missing invoices, anomalies
  6. Fill HTML template — reads .claude/templates/html/custom/financial-pulse.html and replaces placeholders
  7. Save to workspace/finance/reports/daily/[C] YYYY-MM-DD-financial-pulse.html
  8. Notify via Telegram — sends a short summary with MRR and alert count

Adapting an Example for Your Use Case

To create a routine similar to these:

1. Identify the components

2. Create or reuse a skill

If an existing skill covers your use case, reuse it. Otherwise create a new SKILL.md in .claude/skills/my-skill/SKILL.md with step-by-step instructions.

3. Create the routine script

Copy one of the examples above and change:
  • The skill name in run_skill()
  • The agent name
  • The log name
  • The banner text

4. Register the schedule

Add an entry to config/routines.yaml and optionally add a Makefile target:

5. Test manually

Check make logs and make metrics to verify it ran correctly.

Using the create-routine skill

Instead of doing this manually, run /create-routine in Claude Code. It generates the script, Makefile target, and schedule entry for you.