# Finance/Legal Agent — Technical Setup Checklist
**Agent:** Harper (Finance & Legal)  
**Port:** 18792  
**Priority:** HIGH — Government grants could fund entire operation  
**Timeline:** Complete by Tuesday, Feb 18  

---

## Phase 1: Core Infrastructure (Day 1 - Monday)

### 1.1 Clawdbot Instance Setup
- [ ] **Create new Clawdbot instance**
  - Port: 18792
  - Workspace: `/home/ccuser/finance-legal/`
  - Gateway ID: `finance-legal`
  - Default model: `moonshot/kimi-chat`
  - High-stakes model: `anthropic/claude-opus-4-6`

- [ ] **Configure auth profiles**
  - Copy shared auth-profiles.json from `/root/.clawdbot/`
  - Test Opus model access for grant applications
  - Verify Kimi model for routine monitoring

### 1.2 Workspace Creation
```bash
# Create directory structure
mkdir -p /home/ccuser/finance-legal/
mkdir -p /home/ccuser/finance-legal/memory/{grants,compliance,cash-flow,tax,applications}
mkdir -p /home/ccuser/finance-legal/skills/{ato-api,asic-lookup,grant-finder,xero-connect}

# Set permissions
chown -R ccuser:ccuser /home/ccuser/finance-legal/
chmod 755 /home/ccuser/finance-legal/
```

### 1.3 Core Files Deployment
- [ ] **Deploy SOUL.md** from memory/plans/finance-legal-soul.md
- [ ] **Create IDENTITY.md**
```markdown
# IDENTITY.md — Finance & Legal Agent

You are Harper, the Finance & Legal Agent for RateRight Construction Platform.

## Your Role
- Government grant research and applications
- Tax optimization and ATO compliance
- Legal compliance monitoring (labour hire, privacy, consumer law)
- Cash flow forecasting and financial analysis
- Risk management and audit preparation

## Your Mission
Secure funding through government grants while ensuring 100% regulatory compliance and optimal tax efficiency.

## Key Focus
- R&D Tax Incentive: 43.5% refundable offset potential
- High-value grants: Entrepreneurs' Programme, NSW Digital Economy
- ATO compliance: BAS, income tax, GST obligations
- Legal frameworks: Labour hire licensing, Privacy Act, Consumer Law

## Your Model Routing
- Routine monitoring: Kimi (free)
- Grant applications: Opus (accuracy critical)
- Tax compliance: Opus (zero error tolerance)
- External data processing: Opus (dirty data protection)

Remember: You draft and analyze, Michael approves and submits.
```

- [ ] **Copy USER.md** from main workspace
- [ ] **Create AGENTS.md** with team coordination rules
- [ ] **Setup HEARTBEAT.md** with financial monitoring checklist
- [ ] **Initialize MEMORY.md** for financial insights
- [ ] **Create TOOLS.md** with API keys and financial tool configuration

### 1.4 Memory Structure Setup
- [ ] **Create daily log template** in `memory/YYYY-MM-DD.md` format
- [ ] **Setup grants tracking** in `memory/grants/`
- [ ] **Initialize compliance calendar** in `memory/compliance/`
- [ ] **Create cash flow templates** in `memory/cash-flow/`
- [ ] **Setup tax planning workspace** in `memory/tax/`

---

## Phase 2: Telegram Integration (Day 1)

### 2.1 Financial Topic Configuration
- [ ] **Verify Financial topic exists** in Rocky & Rivet group (-1003505625266)
  - Financial topic ID: 391 (from TOOLS.md)
  - Test access permissions
  - Verify message history access

### 2.2 Bot Communication Setup
- [ ] **Configure Harper to monitor Financial topic**
- [ ] **Setup approval workflow**
  - Grant applications → Financial topic for Michael's review
  - Tax strategies → Financial topic for approval
  - Urgent compliance alerts → Direct message to Michael
- [ ] **Test message formatting** for financial reports

---

## Phase 3: Government Data Integration (Day 2)

### 3.1 Grant Database Access
- [ ] **Setup grants.gov.au monitoring**
  - Automated daily scanning
  - Keyword filtering for construction, digital, R&D
  - Eligibility analysis automation
  - Application deadline tracking

- [ ] **Configure NSW Government sources**
  - SmartNSW portal monitoring
  - Digital Economy Strategy grants
  - Industry-specific opportunities
  - State compliance requirements

- [ ] **Federal agency integration**
  - business.gov.au monitoring
  - Department of Industry grants
  - Export development opportunities
  - Small business support schemes

### 3.2 Regulatory Monitoring Setup
- [ ] **ATO integration**
  - Daily ato.gov.au scanning for updates
  - BAS and tax deadline monitoring
  - R&D tax incentive guidance tracking
  - Small business concession changes

- [ ] **Legal compliance monitoring**
  - ACCC consumer law updates
  - Privacy Commissioner guidance
  - Fair Work employment law changes
  - NSW labour hire licensing updates

### 3.3 Web Scraping Configuration
```python
# Grant monitoring sites (daily scan)
GRANT_SITES = [
    "https://www.grants.gov.au/",
    "https://www.business.gov.au/grants-and-programs",
    "https://www.nsw.gov.au/grants-and-funding",
    "https://www.industry.gov.au/funding-and-incentives"
]

# Compliance monitoring sites (daily scan)
COMPLIANCE_SITES = [
    "https://www.ato.gov.au/business/",
    "https://www.accc.gov.au/business",
    "https://www.oaic.gov.au/privacy/guidance",
    "https://www.fairwork.gov.au/"
]
```

---

## Phase 4: Financial Analysis Tools (Day 2-3)

### 4.1 Cash Flow Forecasting
- [ ] **Build cash flow model**
  - Monthly revenue projections ($50 per hire × conversion rates)
  - Fixed cost tracking (VPS, domains, subscriptions, agent infrastructure)
  - Variable cost analysis (AI models, marketing, development)
  - Scenario planning (conservative, realistic, optimistic)

- [ ] **Integration with Growth Engine**
  - Revenue data from platform transactions
  - Customer acquisition cost analysis
  - Lifetime value calculations
  - Conversion funnel financial impact

### 4.2 Tax Optimization Tools
- [ ] **R&D Tax Incentive Calculator**
```python
# R&D calculation parameters
RD_REFUND_RATE = 0.435  # 43.5% for companies <$20M turnover
ELIGIBLE_ACTIVITIES = [
    "software_development",
    "algorithm_design", 
    "platform_architecture",
    "ai_model_development"
]

def calculate_rd_benefit(development_costs):
    return development_costs * RD_REFUND_RATE
```

- [ ] **Small Business Deduction Tracker**
  - Instant asset write-offs (up to $20K per item)
  - Software subscriptions and licenses
  - Professional development expenses
  - Marketing and advertising costs
  - Home office expenses (if applicable)

- [ ] **GST and BAS Calculator**
  - Quarterly GST obligations on $50 service fees
  - Input tax credit tracking
  - BAS statement preparation (draft only)

### 4.3 Grant Application System
- [ ] **Application template engine**
  - Standard grant application format
  - RateRight business profile integration
  - Financial projection models
  - Supporting document automation

- [ ] **Eligibility assessment tool**
  - Automated criteria checking
  - Risk-reward analysis
  - Application effort estimation
  - Success probability scoring

---

## Phase 5: Communication Integration (Day 3)

### 5.1 Rivet Coordination
- [ ] **Setup daily reporting** to Rivet via `RIVET-INBOX.md`
- [ ] **Create shared financial data** in `/home/ccuser/rateright-growth/rivet/memory/financial-sync/`
- [ ] **Configure urgent escalation** protocol for high-value opportunities
- [ ] **Test weekly financial summaries** and monthly strategic reports

### 5.2 Cross-Agent Integration
- [ ] **Susan (Sales) coordination**
  - Customer acquisition cost sharing
  - Marketing ROI analysis
  - Revenue forecasting collaboration
  - Budget approval workflow

- [ ] **Builder (Technical) coordination**
  - R&D activity tracking from git commits
  - Infrastructure cost analysis
  - Development expense categorization
  - Feature ROI assessment

### 5.3 Michael Communication Protocols
- [ ] **Urgent alert system** via Telegram Financial topic
- [ ] **Daily financial position** updates (voice notes during work hours)
- [ ] **Weekly cash flow forecast** summaries
- [ ] **Monthly financial strategy** briefings
- [ ] **Grant opportunity notifications** with approval workflow

---

## Phase 6: Security & Compliance (Day 4)

### 6.1 Data Protection
- [ ] **Financial data encryption** in memory files
- [ ] **API key security** configuration in `/root/.clawdbot/secrets.json`
- [ ] **Audit trail setup** for all financial recommendations
- [ ] **Backup procedures** for critical financial documents

### 6.2 Government Integration Security
- [ ] **Never store banking details** in agent memory
- [ ] **Encrypted communication** with government portals
- [ ] **Secure document handling** for grant applications
- [ ] **Privacy-compliant** data processing procedures

### 6.3 Compliance Safeguards
- [ ] **Professional advice boundaries** clearly defined
- [ ] **Approval requirements** hardcoded for all submissions
- [ ] **Conservative bias** in all financial recommendations
- [ ] **Documentation standards** for audit readiness

---

## Phase 7: Testing & Validation (Day 5)

### 7.1 Grant Research Testing
- [ ] **Test grant database scanning** and opportunity identification
- [ ] **Validate eligibility analysis** accuracy against known grants
- [ ] **Test application drafting** with sample grant opportunity
- [ ] **Verify deadline tracking** and alert system

### 7.2 Tax Calculation Validation
- [ ] **Test R&D tax incentive calculations** against ATO examples
- [ ] **Validate small business deduction** identification and categorization
- [ ] **Test GST and BAS calculations** with sample transactions
- [ ] **Verify cash flow forecasting** accuracy with historical data

### 7.3 Compliance Monitoring Testing
- [ ] **Test regulatory update detection** and impact analysis
- [ ] **Validate deadline alert system** with mock compliance obligations
- [ ] **Test escalation procedures** for urgent compliance issues
- [ ] **Verify audit trail documentation** completeness

### 7.4 Integration Testing
- [ ] **Test Rivet communication** via shared files and inboxes
- [ ] **Validate cross-agent data sharing** (Susan CAC/LTV, Builder R&D)
- [ ] **Test Michael notification** system for approvals and alerts
- [ ] **Verify heartbeat routine** execution and state tracking

---

## Phase 8: Production Deployment (Day 5)

### 8.1 Live Environment Setup
- [ ] **Deploy to production VPS** with full configuration
- [ ] **Start Harper agent** on port 18792
- [ ] **Initialize heartbeat routine** with financial monitoring schedule
- [ ] **Begin autonomous operation** with daily reporting to Rivet

### 8.2 Monitoring Setup
- [ ] **Configure error handling** and automatic recovery
- [ ] **Setup performance monitoring** for heartbeat execution
- [ ] **Initialize financial dashboard** with key metrics
- [ ] **Begin grant research** and opportunity identification

### 8.3 First Week Goals
- [ ] **Identify 5+ high-value grant opportunities** with RateRight eligibility
- [ ] **Complete R&D tax incentive analysis** for 2024-25 financial year
- [ ] **Setup comprehensive compliance calendar** with all ATO and regulatory deadlines
- [ ] **Generate first monthly cash flow forecast** with 3-month projection
- [ ] **Draft first grant application** for Michael's review and approval

---

## Success Criteria

**Day 1-2: Infrastructure Complete**
- Harper agent operational on port 18792
- All core files deployed and configured
- Government data monitoring active

**Day 3-4: Financial Tools Active**
- Cash flow forecasting operational
- Tax optimization calculations working
- Grant research and analysis functional

**Day 5: Production Ready**
- All testing complete and validated
- Cross-agent integration working
- First grant opportunities identified
- Michael approval workflow tested

**Week 1 Target: $100K+ Grant Pipeline**
- 5+ high-value grant applications prepared
- R&D tax incentive claim calculation complete
- Comprehensive compliance monitoring active
- Monthly financial reporting established

---

## Required Resources

### Technical Resources
- **VPS capacity** — May need RAM upgrade from 4GB to 8GB for 4 agents
- **API access** — Government databases, ATO services (when available)
- **Storage** — Additional disk space for financial document retention

### External Services (Future Integration)
- **Accounting system** — Xero or MYOB API integration
- **Banking** — Bank feed APIs for real-time cash position
- **Professional services** — Accountant and lawyer for complex matters

### Michael's Actions Required
- **Grant application approvals** — Review and authorize high-value applications
- **Tax strategy approval** — Confirm optimization strategies before implementation
- **Compliance decisions** — Final authority on regulatory interpretation
- **Financial decisions** — Approve spending, investment, and structure changes

---

*This checklist provides the complete roadmap for deploying Harper, the Finance/Legal agent, with a focus on government grant acquisition and regulatory compliance.*