Google Workspace Integration Skill
This skill enables generation of professional tax optimization reports and direct communication with accountants using Google Workspace products.
Capabilities
Product Use Case
Google Docs Professional tax audit reports with legislation references
Google Sheets Financial calculations, deduction summaries, loss tracking
Gmail Direct email to accountant with report attachments
Google Drive Store and organize all tax documents
Authentication
Required Google Cloud APIs
- Gmail API
- Google Docs API
- Google Sheets API
- Google Drive API
OAuth 2.0 Scopes
const GOOGLE_SCOPES = [ 'https://www.googleapis.com/auth/gmail.send', 'https://www.googleapis.com/auth/gmail.compose', 'https://www.googleapis.com/auth/documents', 'https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/drive.file' ];
Environment Variables
GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret GOOGLE_REDIRECT_URI=http://localhost:3000/api/auth/google/callback
Report Templates
- Tax Optimization Summary Report (Google Docs)
Tax Optimization Report for [Business Name]
Prepared by ATO Tax Optimization Suite
Date: [Current Date]
Executive Summary
[Auto-generated summary of findings and total potential recovery]
Section 1: R&D Tax Incentive (Division 355 ITAA 1997)
Findings
- [List of identified R&D activities]
Potential Benefit
- Eligible expenditure: $X
- Refundable offset (43.5%): $Y
Legislation Reference
Division 355 of the Income Tax Assessment Act 1997 ATO Guidance: Guide to the R&D Tax Incentive
Action Required
☐ Review identified activities with tax advisor ☐ Prepare registration with AusIndustry ☐ Document contemporaneous records
Section 2: Bad Debt Recovery (Section 25-35 ITAA 1997)
Findings
- [List of identified bad debts]
Potential Benefit
- Total bad debts: $X
- Income tax deduction value: $Y
- GST recovery (Division 21): $Z
Legislation Reference
Section 25-35 ITAA 1997 - Bad debts Division 21 GST Act 1999 - Bad debt adjustments GSTR 2000/2 - GST and bad debts
Action Required
☐ Document write-off decisions before June 30 ☐ Process credit notes in Xero ☐ Include GST adjustment in next BAS
Section 3: Loss Carry-Forward Analysis
Findings
- Accumulated losses: $X
- Similar Business Test status: [PASS/UNCERTAIN/FAIL]
Potential Benefit
- Loss utilization value: $X × tax rate = $Y
Legislation Reference
Division 36 ITAA 1997 - Tax losses Division 165/166 ITAA 1997 - Company loss tests LCR 2019/1 - Similar Business Test
Action Required
☐ Consider private ruling if losses significant ☐ Document business evolution for SiBT ☐ Coordinate with tax return lodgment
Section 4: ATO Payment Negotiation
Current Position
- Outstanding debt: $X
- Less: Recoverable amounts: $Y
- Net position: $Z
Recommended Approach
[Auto-generated based on net position]
Legislation Reference
Taxation Administration Act 1953 ATO Payment Plan Guidelines
Action Required
☐ Lodge all outstanding returns ☐ Compile financial hardship documentation ☐ Contact ATO or engage tax advisor
Appendix A: Complete Findings List
[Detailed itemized list]
Appendix B: Xero Transaction References
[List of relevant Xero transactions]
Appendix C: Legislation Quick Reference
[All legislation citations in one place]
IMPORTANT DISCLAIMER This report is generated by an AI-assisted analysis tool and is provided for informational purposes only. All recommendations should be reviewed by a Registered Tax Agent or qualified accountant before implementation.
Generated by ATO Tax Optimization Suite [Timestamp]
- Financial Summary Spreadsheet (Google Sheets)
Sheet 1: Executive Summary
Category Potential Benefit Confidence Priority
R&D Tax Incentive $X HIGH 1
Bad Debt Recovery $X HIGH 2
Loss Carry-Forward $X MEDIUM 3
SBITO $1,000 HIGH 4
Other Deductions $X MEDIUM 5
TOTAL $X
Sheet 2: R&D Activities
Activity Description Eligible Spend Offset (43.5%)
[Activity 1] [Description] $X $Y
Sheet 3: Bad Debts
Customer Invoice Amount GST Status Write-off Date
[Customer] [INV-XXX] $X $Y BAD YYYY-MM-DD
Sheet 4: Loss History
Financial Year Loss Amount SiBT Eligible Notes
FY2022-23 $X Yes
FY2023-24 $X Yes
Sheet 5: ATO Position
Category Amount
Outstanding Income Tax $X
Outstanding GST $X
Outstanding PAYG $X
Penalties $X
Interest $X
Total Owing $X
Less: Recoverable ($X)
Net Position $X
- Email Template (Gmail)
Subject: Tax Optimization Analysis - [Business Name] - Action Required
Dear [Accountant Name],
I have conducted a comprehensive tax optimization analysis using the ATO Tax Optimization Suite and identified several opportunities that require your professional review.
SUMMARY OF FINDINGS: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TOTAL POTENTIAL RECOVERY: $[AMOUNT]
Key Opportunities Identified:
-
R&D Tax Incentive (Division 355 ITAA 1997) Potential benefit: $[X] ⚠️ Registration deadline: [DATE]
-
Bad Debt Deductions (Section 25-35 ITAA 1997) Potential benefit: $[X] ⚠️ Write-off deadline: June 30
-
Loss Carry-Forward (Division 36 ITAA 1997) Potential benefit: $[X] ⚠️ Similar Business Test requires review
-
ATO Payment Negotiation Current debt: $[X] Net after offsets: $[Y]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ATTACHMENTS:
- Tax_Optimization_Report.pdf (Full report with legislation references)
- Financial_Summary.xlsx (Detailed calculations)
ACTION REQUIRED: Please review the attached documents and advise on:
- Eligibility for the identified benefits
- Any additional information required
- Next steps for implementation
- ATO engagement strategy (if applicable)
I would appreciate the opportunity to discuss these findings at your earliest convenience.
Best regards, [Name] [Business Name] [Contact Details]
This analysis was prepared using the ATO Tax Optimization Suite. All recommendations require professional review before implementation.
API Implementation
Google Docs Report Generation
import { google } from 'googleapis';
async function generateTaxReport(auth: any, reportData: TaxReportData) { const docs = google.docs({ version: 'v1', auth });
// Create new document
const createResponse = await docs.documents.create({
requestBody: {
title: Tax Optimization Report - ${reportData.businessName} - ${reportData.date}
}
});
const documentId = createResponse.data.documentId;
// Insert content using batchUpdate await docs.documents.batchUpdate({ documentId, requestBody: { requests: generateReportRequests(reportData) } });
return documentId; }
Google Sheets Financial Summary
async function generateFinancialSpreadsheet(auth: any, data: FinancialData) { const sheets = google.sheets({ version: 'v4', auth });
// Create new spreadsheet
const createResponse = await sheets.spreadsheets.create({
requestBody: {
properties: {
title: Tax Analysis - ${data.businessName} - ${data.date}
},
sheets: [
{ properties: { title: 'Executive Summary' } },
{ properties: { title: 'R&D Activities' } },
{ properties: { title: 'Bad Debts' } },
{ properties: { title: 'Loss History' } },
{ properties: { title: 'ATO Position' } }
]
}
});
const spreadsheetId = createResponse.data.spreadsheetId;
// Populate data await sheets.spreadsheets.values.batchUpdate({ spreadsheetId, requestBody: { valueInputOption: 'USER_ENTERED', data: generateSheetData(data) } });
return spreadsheetId; }
Gmail Send with Attachments
async function sendToAccountant(auth: any, emailData: EmailData) { const gmail = google.gmail({ version: 'v1', auth });
const message = createMimeMessage({
to: emailData.accountantEmail,
subject: Tax Optimization Analysis - ${emailData.businessName},
body: generateEmailBody(emailData),
attachments: emailData.attachments
});
await gmail.users.messages.send({ userId: 'me', requestBody: { raw: Buffer.from(message).toString('base64url') } }); }
Integration with Agent Fleet
Workflow Integration
The Google Workspace skill integrates with all agents:
<report_generation> <sources> <agent>rnd_tax_specialist</agent> <agent>bad_debt_recovery_agent</agent> <agent>business_transition_agent</agent> <agent>loss_recovery_agent</agent> </sources> <outputs> <google_doc>Full report with legislation</google_doc> <google_sheet>Financial calculations</google_sheet> <gmail>Direct to accountant</gmail> </outputs> </report_generation>
Usage
Generate and Send Report
/send-to-accountant
This command will:
-
Compile all findings from recent analyses
-
Generate Google Doc report with legislation references
-
Generate Google Sheet with financial calculations
-
Send via Gmail to configured accountant email
Configuration
<accountant_config> <name>Your Accountant Name</name> <email>accountant@example.com</email> <firm>Accounting Firm Name</firm> <cc_emails> <email>your@email.com</email> </cc_emails> </accountant_config>