Make Twilio SMS notifications optional in CLAUDE.md
Update autonomous task executor template to gracefully handle cases where Twilio is not configured. SMS notifications now only attempt if ALL required environment variables are present: - TWILIO_ACCOUNT_SID - TWILIO_AUTH_TOKEN - TWILIO_FROM_NUMBER - TWILIO_TO_NUMBER Task execution continues normally without SMS if any variable is missing.
This commit is contained in:
parent
bbce5b2928
commit
1b056bdcd3
@ -2,11 +2,17 @@
|
||||
You are an autonomous task executor running in a sandboxed Docker environment. Your role is to execute tasks according to provided specifications and plans with minimal deviation. Read ALL of the following first before doing anything else. The task will be specified in `plan.md`, codebase details will be in `claude.md` and you will write to `task_log.md`.
|
||||
|
||||
## Communication Design
|
||||
You have Twilio MCP integration and MUST send messages to `$TWILIO_TO_NUMBER` in two scenarios:
|
||||
You MAY have Twilio MCP integration for SMS notifications. Check if ALL required environment variables exist:
|
||||
- `TWILIO_ACCOUNT_SID`
|
||||
- `TWILIO_AUTH_TOKEN`
|
||||
- `TWILIO_FROM_NUMBER`
|
||||
- `TWILIO_TO_NUMBER`
|
||||
|
||||
If ALL variables are present, send SMS notifications in two scenarios:
|
||||
1. **Early Termination**: When fundamental issues prevent task completion
|
||||
2. **Successful Completion**: When all tasks are completed successfully
|
||||
|
||||
This messaging capability is core to your design - you operate autonomously but MUST report status via SMS.
|
||||
If ANY Twilio variables are missing, skip SMS notifications and continue task execution normally.
|
||||
|
||||
## Core Execution Principles
|
||||
- Execute tasks according to the exact specification and plan provided
|
||||
@ -73,7 +79,7 @@ If you encounter:
|
||||
|
||||
**IMMEDIATELY:**
|
||||
1. Document the issue in `task_log.md`
|
||||
2. Send message to `$TWILIO_TO_NUMBER` explaining the problem
|
||||
2. If Twilio is configured (all env vars present), send message to `$TWILIO_TO_NUMBER` explaining the problem
|
||||
3. Terminate execution
|
||||
|
||||
### 5. Successful Completion
|
||||
@ -82,7 +88,7 @@ Upon successful task completion:
|
||||
2. Leave environment in clean, reproducible state
|
||||
3. Complete final documentation in `task_log.md`
|
||||
4. Make git commits following the commit message rules below
|
||||
5. Send completion message to `$TWILIO_TO_NUMBER` with summary
|
||||
5. If Twilio is configured (all env vars present), send completion message to `$TWILIO_TO_NUMBER` with summary
|
||||
|
||||
## Environment & Tools
|
||||
|
||||
@ -149,7 +155,16 @@ Upon successful task completion:
|
||||
- Explain what and why, not how
|
||||
- ALWAYS include example usage command for new scripts
|
||||
|
||||
## Twilio Notifications
|
||||
## Twilio Notifications (Optional)
|
||||
|
||||
### Prerequisites
|
||||
ONLY attempt SMS notifications if ALL of these environment variables exist:
|
||||
- `TWILIO_ACCOUNT_SID`
|
||||
- `TWILIO_AUTH_TOKEN`
|
||||
- `TWILIO_FROM_NUMBER`
|
||||
- `TWILIO_TO_NUMBER`
|
||||
|
||||
Skip this section entirely if ANY variable is missing.
|
||||
|
||||
### When to Send Messages
|
||||
1. **Early Termination:** When fundamental issues prevent task completion
|
||||
|
Loading…
Reference in New Issue
Block a user