xero-accounting
Integrate with the Xero accounting API to sync invoices, expenses, bank transactions, and contacts — and generate financial reports like P&L and balance sheet. Use when: connecting apps to Xero, automating bookkeeping workflows, syncing accounting data, or pulling financial reports programmatically.
What this skill does
# Xero Accounting
## Overview
Integrate your application with Xero's accounting platform via the Xero API. This skill covers OAuth2 authentication, syncing core accounting objects (invoices, bills, expenses, contacts, bank transactions), and pulling financial reports (P&L, balance sheet, trial balance). Supports both one-time imports and continuous sync patterns.
## Instructions
### Step 1: Set up OAuth2 authentication
Xero uses OAuth2 with PKCE. Register your app at [developer.xero.com](https://developer.xero.com), then implement the token flow:
```python
# xero_auth.py — OAuth2 token management for Xero API
import requests
import base64
import json
import os
from datetime import datetime, timedelta
XERO_CLIENT_ID = os.environ["XERO_CLIENT_ID"]
XERO_CLIENT_SECRET = os.environ["XERO_CLIENT_SECRET"]
XERO_REDIRECT_URI = os.environ["XERO_REDIRECT_URI"]
TOKEN_FILE = ".xero_tokens.json"
def get_auth_url():
"""Generate the OAuth2 authorization URL."""
import secrets
state = secrets.token_urlsafe(16)
params = {
"response_type": "code",
"client_id": XERO_CLIENT_ID,
"redirect_uri": XERO_REDIRECT_URI,
"scope": "openid profile email accounting.transactions accounting.reports.read accounting.contacts offline_access",
"state": state,
}
query = "&".join(f"{k}={v}" for k, v in params.items())
return f"https://login.xero.com/identity/connect/authorize?{query}"
def exchange_code_for_tokens(code: str) -> dict:
"""Exchange authorization code for access + refresh tokens."""
credentials = base64.b64encode(
f"{XERO_CLIENT_ID}:{XERO_CLIENT_SECRET}".encode()
).decode()
response = requests.post(
"https://identity.xero.com/connect/token",
headers={
"Authorization": f"Basic {credentials}",
"Content-Type": "application/x-www-form-urlencoded",
},
data={
"grant_type": "authorization_code",
"code": code,
"redirect_uri": XERO_REDIRECT_URI,
},
)
tokens = response.json()
tokens["expires_at"] = (
datetime.utcnow() + timedelta(seconds=tokens["expires_in"])
).isoformat()
save_tokens(tokens)
return tokens
def refresh_access_token(tokens: dict) -> dict:
"""Refresh the access token using the refresh token."""
credentials = base64.b64encode(
f"{XERO_CLIENT_ID}:{XERO_CLIENT_SECRET}".encode()
).decode()
response = requests.post(
"https://identity.xero.com/connect/token",
headers={
"Authorization": f"Basic {credentials}",
"Content-Type": "application/x-www-form-urlencoded",
},
data={
"grant_type": "refresh_token",
"refresh_token": tokens["refresh_token"],
},
)
new_tokens = response.json()
new_tokens["expires_at"] = (
datetime.utcnow() + timedelta(seconds=new_tokens["expires_in"])
).isoformat()
save_tokens(new_tokens)
return new_tokens
def get_valid_token() -> str:
"""Return a valid access token, refreshing if needed."""
tokens = load_tokens()
expires_at = datetime.fromisoformat(tokens["expires_at"])
if datetime.utcnow() >= expires_at - timedelta(minutes=5):
tokens = refresh_access_token(tokens)
return tokens["access_token"]
def get_tenant_id(access_token: str) -> str:
"""Get the Xero organisation (tenant) ID."""
response = requests.get(
"https://api.xero.com/connections",
headers={"Authorization": f"Bearer {access_token}"},
)
connections = response.json()
return connections[0]["tenantId"] # Use first connected org
def save_tokens(tokens: dict):
with open(TOKEN_FILE, "w") as f:
json.dump(tokens, f)
def load_tokens() -> dict:
with open(TOKEN_FILE) as f:
return json.load(f)
```
### Step 2: Create an API client
```python
# xero_client.py — Reusable Xero API client
import requests
from xero_auth import get_valid_token, get_tenant_id
class XeroClient:
BASE_URL = "https://api.xero.com/api.xro/2.0"
def __init__(self):
self.token = get_valid_token()
self.tenant_id = get_tenant_id(self.token)
def _headers(self):
return {
"Authorization": f"Bearer {self.token}",
"Xero-Tenant-Id": self.tenant_id,
"Accept": "application/json",
"Content-Type": "application/json",
}
def get(self, endpoint: str, params: dict = None) -> dict:
response = requests.get(
f"{self.BASE_URL}/{endpoint}",
headers=self._headers(),
params=params,
)
response.raise_for_status()
return response.json()
def post(self, endpoint: str, data: dict) -> dict:
response = requests.post(
f"{self.BASE_URL}/{endpoint}",
headers=self._headers(),
json=data,
)
response.raise_for_status()
return response.json()
def put(self, endpoint: str, data: dict) -> dict:
response = requests.put(
f"{self.BASE_URL}/{endpoint}",
headers=self._headers(),
json=data,
)
response.raise_for_status()
return response.json()
```
### Step 3: Sync invoices
```python
# sync_invoices.py — Create and retrieve invoices in Xero
from xero_client import XeroClient
from datetime import datetime
client = XeroClient()
def create_invoice(contact_name: str, line_items: list, due_date: str, currency: str = "USD") -> dict:
"""
Create a sales invoice (ACCREC) in Xero.
line_items format:
[{"description": "...", "quantity": 1, "unitAmount": 100.0, "accountCode": "200"}]
"""
payload = {
"Invoices": [{
"Type": "ACCREC",
"Contact": {"Name": contact_name},
"DueDate": due_date, # e.g. "2025-03-31"
"CurrencyCode": currency,
"LineItems": [
{
"Description": item["description"],
"Quantity": item["quantity"],
"UnitAmount": item["unitAmount"],
"AccountCode": item.get("accountCode", "200"),
}
for item in line_items
],
"Status": "AUTHORISED",
}]
}
result = client.post("Invoices", payload)
invoice = result["Invoices"][0]
print(f"Created invoice {invoice['InvoiceNumber']} — Total: {invoice['Total']}")
return invoice
def list_invoices(status: str = "AUTHORISED", modified_since: str = None) -> list:
"""Retrieve invoices, optionally filtered by status or modified date."""
params = {"Status": status}
headers_extra = {}
if modified_since:
headers_extra["If-Modified-Since"] = modified_since
result = client.get("Invoices", params=params)
return result.get("Invoices", [])
def mark_invoice_paid(invoice_id: str, amount: float, account_code: str = "090") -> dict:
"""Record a payment against an invoice."""
payload = {
"Payments": [{
"Invoice": {"InvoiceID": invoice_id},
"Account": {"Code": account_code},
"Amount": amount,
"Date": datetime.utcnow().strftime("%Y-%m-%d"),
}]
}
result = client.post("Payments", payload)
return result["Payments"][0]
```
### Step 4: Sync bank transactions
```python
# sync_bank_transactions.py — Push bank transactions into Xero
from xero_client import XeroClient
client = XeroClient()
def create_bank_transaction(
account_id: str,
contact_name: str,
amount: float,
date: str,
description: str,
account_code: str = "400",
tx_type: str = "SPEND", # SPEND or RECEIVE
) -> dict:
"""Record a bank transaction (spend or receive money)."""
payload = {
"BankTransactions": [{
"Type": tx_type,
"Contact": {"Name": contact_name},
"BankAccount": {"AccountID"Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.