Payment tracker run

From aAAaqwq/AGI-Super-Team · View interactive version

Payment tracker run is an AI agent skill from the GitHub repository aAAaqwq/AGI-Super-Team. Automatic payment tracking and follow-up

How to use this skill

Skill file

Payment Tracker - Run

Monitors outstanding invoices, tracks payment status, sends reminders

When to use

How to execute

Full run

cd $AGENTS_PATH/payment-tracker
python3 payment_tracker_agent.py

This will execute:

  1. Load outstanding invoices from deals.csv
  2. Calculate payment status (OK/DUE_SOON/OVERDUE/PENDING_INVOICE)
  3. Enrich with client/company context
  4. Generate Telegram notification
  5. Create follow-up email drafts
  6. Log activities to activities.csv
  7. Git commit changes

Dry-run (no changes)

python3 payment_tracker_agent.py --dry-run

Without notifications

python3 payment_tracker_agent.py --no-notify

Test notification

python3 payment_tracker_agent.py --force-notify

Output

Telegram Notification

Sent to Saved Messages ('me'):

**Payment Tracker Report**

Total outstanding: **$4,827 USD**
2 overdue, 1 due soon, 0 pending invoice

🔴 **OVERDUE**

• **INV-095** - Enterprise Corp
  $XXX USD • 8 days overdue
  Action: Email Alice

🟡 **DUE SOON**

• **INV-096** - Client D
  $X,XXX USD • Due 2026-02-15 (5 days since invoice)

✅ **OK** (3 invoices on track)

Follow-up Drafts

File: $AGENTS_PATH/data/payment_followups/YYYY-MM-DD_followup_drafts.md

Contains ready-made email drafts for overdue invoices.

Activities Log

Entries in sales/crm/activities.csv:

Agent Log

JSON file: $AGENTS_PATH/data/payment_tracker_log.json

{
  "ts": "2026-02-12T10:00:00",
  "outstanding_total": 4827,
  "overdue_count": 2,
  "due_soon_count": 1,
  "pending_invoice_count": 0,
  "notifications_sent": true,
  "errors": []
}

Scheduled Run

The agent runs automatically via launchd:

Load schedule

cp $AGENTS_PATH/payment-tracker/com.yourcompany.payment-tracker.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.yourcompany.payment-tracker.plist

Unload schedule

launchctl unload ~/Library/LaunchAgents/com.yourcompany.payment-tracker.plist

Check status

launchctl list | grep payment-tracker

View logs

tail -f /tmp/payment-tracker-agent.log
tail -f /tmp/payment-tracker-agent-error.log

Payment Terms

Payment Categories

  1. OK: Invoice on track (days <= payment_terms - 3)
  2. DUE_SOON: Approaching deadline (payment_terms - 3 < days <= payment_terms)
  3. OVERDUE: Missed deadline (days > payment_terms)
  4. PENDING_INVOICE: Deal delivered but invoice not sent yet

Troubleshooting

Telegram not sending

# Test Telegram connection
cd $TG_TOOLS_PATH
python3 -c "from tg_utils.auth import get_client; import asyncio; asyncio.run(get_client())"

# Force notification
cd $AGENTS_PATH/payment-tracker
python3 payment_tracker_agent.py --force-notify

Activities not logging

# Check CSV permissions
ls -la $CRM_PATH/activities.csv

# Check git status
cd $PROJECT_ROOT
git status

# Dry-run to see what would be logged
cd $AGENTS_PATH/payment-tracker
python3 payment_tracker_agent.py --dry-run

Wrong payment terms

Edit constants in payment_tracker_agent.py:

DEFAULT_PAYMENT_TERMS_KNOWN = 7
DEFAULT_PAYMENT_TERMS_NEW = 14
DUE_SOON_BUFFER_DAYS = 3

Integration

Upstream

Downstream

Human Approval

Rollback

Stop agent

launchctl unload ~/Library/LaunchAgents/com.yourcompany.payment-tracker.plist

Revert activity logs

cd $PROJECT_ROOT
git log --grep="payment tracker"
git revert <commit-hash>

Clear agent log

rm $AGENTS_PATH/data/payment_tracker_log.json

Related skills

Owner

Your Name (your@email.com)

Process ID: #18

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.