Plan: Sales Tax Report — FO + Shiplap + Sundance
Objective
Upgrade the existing Shopify-based sales tax portal to produce a clean, CPA-ready quarterly sales tax report broken down by state/nexus. Output should be something Martin can open and use directly for Q1 2026 filing.
Context
- Existing portal was built from scratch using Shopify order data
- Portal location: check
~/ai-projects-local/mission-control/for existing tax report scripts - Shopify orders have
billing_address.province_code(state) +total_taxfields - QuickBooks MCP is connected for all 5 companies — can cross-reference
- CPA name: Martin
- Q1 2026 filing = Jan 1 – Mar 31, 2026
- Stores: Fabric Outlet, Shiplap Quilt Shop, Sundance Quilting
Key files to check first:
~/ai-projects-local/mission-control/scripts/— search for any existingtax,sales_tax, ornexusscripts~/ai-projects-local/shopify-bigquery-pipeline/data/shopify.db— primary data source- QuickBooks MCP — cross-reference with
qb_get_profit_lossandqb_list_transactions
Phase 1: Audit Existing Portal + Data Assessment
DISPATCH tasks:
- Search for all existing sales tax scripts:
grep -rl "tax" ~/ai-projects-local/mission-control/scripts/ - Read any found scripts and document: what they do, what data they use, what's broken/missing
-
Query
shopify.dbto assess tax data quality:sql SELECT strftime('%Y-%m', created_at) as month, billing_province, COUNT(*) as order_count, SUM(total_tax) as total_tax, SUM(total_price) as total_revenue FROM orders WHERE created_at >= '2026-01-01' AND created_at < '2026-04-01' GROUP BY month, billing_province ORDER BY month, total_tax DESC -
Run same query for each store (use
storecolumn or separate databases) - Identify: which states have tax collected? Any states with $0 tax where we likely have nexus? Any NULL/missing state fields?
- Pull QuickBooks trial balance Q1 2026 via MCP for cross-reference totals
- Write findings report:
reports/sales-tax-data-audit-q1-2026.md
Acceptance Criteria:
- Complete picture of Q1 tax data per state per store
- Data quality issues documented
- QuickBooks totals available for cross-reference
- Any data gaps identified before building the report
[STOP — Ready for UAT: Phase 1] Cole reviews: audit report. Do the state totals look roughly right? Any states that seem missing? Any data quality concerns to fix before proceeding?
Phase 2: Build State-Level Tax Report
DISPATCH tasks:
- Write
scripts/sales_tax_report.pywith: - Date range parameter (default: previous quarter) - Per-store breakdown - State-level aggregation:state | taxable_sales | tax_collected | order_count- Nexus states summary (states where tax was collected) - Combined totals across all stores + per-store subtotals - Cross-reference each state total against QuickBooks via MCP
- Flag any discrepancy >$10 between Shopify and QuickBooks
- Generate two output formats: - Google Sheet (for Martin to work in): one tab per store + combined tab - PDF summary (for filing reference): clean formatted table
- Include metadata: report generated date, date range, data source, version
Acceptance Criteria:
- Report runs without errors for Q1 2026
- All 3 stores represented
- State totals reconcile within $10 of QuickBooks
- Both output formats produced
- Discrepancies flagged clearly
[STOP — Ready for UAT: Phase 2] Cole reviews: open the Google Sheet. Do the state totals look correct? Do they reconcile with what you expect? Any states that seem wrong?
Phase 3: Polish + Second-Opinion Pass
DISPATCH tasks:
- Run the
second-opinionskill on the report script and output - Implement any critical feedback from second-opinion
- Polish the Google Sheet: - Professional formatting (not raw data dump) - Summary tab with key numbers (total tax collected, total taxable sales, # of nexus states) - Color coding: states with high tax liability highlighted - Column: "Filing Status" (blank — Martin fills this in) - Column: "Notes" (blank — Martin fills this in)
- Add a "How to Read This Report" tab with brief instructions for Martin
- Test edge cases: months with $0 tax, orders with missing state, refunds
Acceptance Criteria:
- Second-opinion review completed
- Sheet is clean, professional, ready to hand to a CPA
- Summary tab gives instant overview
- Refunds handled correctly (negative tax)
[STOP — Ready for UAT: Phase 3 — Final] Cole reviews: would you hand this to Martin right now? If yes, approve. If not, note what needs changing.
Phase 4: Automate for Future Quarters
DISPATCH tasks:
- Add CLI arguments:
--quarter Q1 --year 2026(and--monthfor monthly runs) - Add to LaunchAgent or cron: run on the 5th of each month for prior month
- Auto-save to
~/ai-projects/mission-control/reports/sales-tax-YYYY-QX.xlsx - Slack notification when report is ready: "Q1 2026 sales tax report ready for review"
- Document:
docs/sales-tax-report-guide.md
Acceptance Criteria:
- Quarterly and monthly modes both work
- Auto-save working
- Slack alert fires
- Guide written
[STOP — Ready for UAT: Phase 4] Cole reviews: run the script for Q4 2025 as a historical test. Does it produce correct output?
Execution Log
(Mission Control updates this as phases complete)
~/ai-projects/mission-control/plans/sales-tax-report.md