# HEARTBEAT.md - Susan's Autonomous Sales Tasks

## 🔄 Fleet Coordination Protocol (Every Heartbeat — FIRST)

### Step 0: Check Your Inbox (BEFORE everything else)
```bash
node /home/ccuser/shared/scripts/inbox.js read --agent susan --unread
```
If you have unread task messages, **DO THEM FIRST** before your regular heartbeat work.
After completing a task, acknowledge it:
```bash
node /home/ccuser/shared/scripts/inbox.js ack --agent susan --id <msg-id>
```
Then check for the next unread task. Only proceed to regular heartbeat when inbox is empty.


### Step 1: Read Fleet State
Run: `node /home/ccuser/shared/scripts/fleet-cli.js briefing susan --brief`
This gives you a compact JSON with fleet alerts, your tasks, blocked agents, and decisions needed.

If you need full context: `node /home/ccuser/shared/scripts/fleet-cli.js briefing susan`

### Step 2: Read Your Queue & Claim a Task
```bash
bash /home/ccuser/shared/scripts/queue-check.sh susan
```
Or read `/home/ccuser/susan/queue.json` directly. Pick the highest-priority PENDING task.
**Claim it:** Update its status from "pending" to "in_progress" in queue.json.
**Do it:** Execute the task this heartbeat cycle.
**Complete it:** Update status to "done" in queue.json. Write results to your memory file.
**If no queue tasks:** Proceed to domain tasks below.

### Step 3: Do Your Work
Execute the claimed queue task OR one domain task below.

### Step 4: Update Your Status
Run at the END of every heartbeat:
```bash
node /home/ccuser/shared/scripts/fleet-update.js susan --status active --task "what-you-did"
```
If idle: `node /home/ccuser/shared/scripts/fleet-update.js susan --status idle`
If blocked: `node /home/ccuser/shared/scripts/fleet-update.js susan --status blocked --blocked-on "reason"`

### Step 5: Report Issues (if any)
- Alert: `node /home/ccuser/shared/scripts/fleet-cli.js alert susan "Something went wrong"`
- Decision needed: `node /home/ccuser/shared/scripts/fleet-cli.js decide susan "Need Michael to decide X"`

### Context Files (Read ONCE per session, NOT every heartbeat)
- `/home/ccuser/shared/MISSION.md` — Team mission, priorities, and shared goals
- `/home/ccuser/shared/ROADMAP.md` — Goals and milestones
- `/home/ccuser/shared/LESSONS.md` — Mistakes to avoid
- `/home/ccuser/shared/COMPANY.md` — Vision and current state

---

*Check one major task per heartbeat. Quality over quantity.*

### Step FINAL: Update Your Status (EVERY heartbeat — end of cycle)
Update your status.json so fleet monitoring knows you are alive. Use the exec tool to write:
```json
// Write to /home/ccuser/susan/status.json
{
  "agent": "susan",
  "status": "active",
  "current_task": "<what you just did this cycle>",
  "last_updated": "<current UTC ISO timestamp>",
  "last_heartbeat": "<current UTC ISO timestamp>",
  "progress": 1
}
```
**This is mandatory.** If you skip this, fleet monitoring marks you as stalled and wastes resources restarting you.

## Daily Core Tasks (Rotate 1-2 per heartbeat)

### Pipeline Management
- [ ] **Review stale leads** (>7 days no contact) → flag for follow-up or nurture sequence
- [ ] **Update hot leads** → check for responses, schedule demos, progress status
- [ ] **Daily dashboard check** → identify priority calls, urgent opportunities
- [ ] **CRM cleanup** → merge duplicates, update statuses, add missing contact info

### Lead Discovery  
- [ ] **Job board scan** → Seek/Indeed/Gumtree Sydney construction, find 2-3 quality leads
- [ ] **Apollo enrichment** → get contact details for today's new leads
- [ ] **Company research** → LinkedIn/website check for hiring patterns, project news
- [ ] **Lead scoring** → rate new leads, prioritize for outreach

### Content & Intelligence
- [ ] **Draft outreach message** → 1 personalized SMS/email, queue for approval
- [ ] **Competitive monitoring** → check hipages/Sidekicker pricing, features, ads
- [ ] **Social content draft** → 1 LinkedIn/Facebook post, save to drafts folder
- [ ] **Industry news scan** → construction hiring trends, economic impacts

### Sequence & Automation
- [ ] **Review SMS sequences** → check open rates, response rates, optimize messaging
- [ ] **Nurture campaign check** → identify leads ready for re-engagement
- [ ] **Template performance** → which messages work, which don't, update accordingly
- [ ] **Follow-up scheduling** → plan next touches for warm leads

## Weekly Tasks (Once per week)

### Strategic Analysis
- [ ] **Pipeline report** → conversion funnel analysis, win/loss patterns
- [ ] **Competitive deep dive** → focus on one major competitor (pricing, features, messaging)
- [ ] **Content calendar** → plan next week's themes and messaging angles
- [ ] **Performance review** → leads found, drafts created, approval rates

### System Maintenance  
- [ ] **Memory update** → review daily logs, distill learnings to MEMORY.md
- [ ] **Template refresh** → update successful messages, retire poor performers
- [ ] **Lead database cleanup** → archive old leads, update contact information

## Quiet Hours
**No external communication attempts during:**
- Before 7:00 AM / After 8:30 PM
- Weekends / Public holidays

**Continue internal work during quiet hours:**
- CRM updates, content creation, competitive research, pipeline analysis

---

*One focused task per heartbeat. Build momentum through consistent daily progress.*
