skills/audit-trail/SKILL.md
> **OpenClaw skill context:** This skill supports ClawKeeper v1.5 as an OpenClaw-native SMB finance-agent platform. Implementations should preserve tenant isolation, deterministic policy enforcement, and auditable financial operations. --- name: audit-trail description: "Maintain immutable audit log for all financial actions. Use when logging user actions, tracking entity changes, generating audit reports, or investigating compliance issues. Ensures complete accountability and traceability." --
npx skillsauth add alexi5000/clawkeeper skills/audit-trailInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
OpenClaw skill context: This skill supports ClawKeeper v1.5 as an OpenClaw-native SMB finance-agent platform. Implementations should preserve tenant isolation, deterministic policy enforcement, and auditable financial operations.
Maintains a comprehensive, immutable audit log of all financial actions, providing complete traceability for compliance, security, and troubleshooting.
Every financial action triggers:
INSERT INTO audit_log (
tenant_id, user_id, action, entity_type, entity_id,
changes, ip_address, user_agent, timestamp
)
VALUES (
$1, -- tenant_id (from context)
$2, -- user_id (from JWT)
$3, -- action: create, update, delete, approve, reject, export, import
$4, -- entity_type: invoices, transactions, accounts, etc.
$5, -- entity_id: UUID of entity
$6, -- changes: JSONB with old/new values
$7, -- ip_address: client IP
$8, -- user_agent: browser/API client
NOW()
);
For CREATE:
{
"action": "create",
"new": {
"id": "uuid",
"vendor_name": "Office Depot",
"amount": 50000,
...
}
}
For UPDATE:
{
"action": "update",
"old": {
"status": "pending_approval",
"approved_by": null
},
"new": {
"status": "approved",
"approved_by": "user-uuid",
"approved_at": "2026-01-15T14:30:00Z"
},
"fields_changed": ["status", "approved_by", "approved_at"]
}
For DELETE:
{
"action": "delete",
"deleted": {
"id": "uuid",
"vendor_name": "...",
...
}
}
Query audit log with filters:
async function generate_audit_report(filters: {
tenant_id: string;
start_date: string;
end_date: string;
user_id?: string;
entity_type?: string;
action?: string;
}): Promise<AuditReport> {
const entries = await query_audit_log(filters);
return {
summary: {
total_actions: entries.length,
by_action: count_by_field(entries, 'action'),
by_entity: count_by_field(entries, 'entity_type'),
by_user: count_by_field(entries, 'user_id'),
},
entries: entries.map(format_audit_entry),
};
}
Track approval workflows:
-- All actions on an invoice
SELECT
timestamp,
users.name as performed_by,
action,
changes
FROM audit_log
JOIN users ON audit_log.user_id = users.id
WHERE entity_type = 'invoices'
AND entity_id = $1
ORDER BY timestamp ASC;
Shows complete history:
Log security-sensitive actions:
Enforce immutability:
audit_log table has no UPDATE/DELETE policiesSELECT * FROM audit_log
WHERE tenant_id = $1
AND user_id = $2
AND timestamp BETWEEN $3 AND $4
ORDER BY timestamp DESC;
SELECT * FROM audit_log
WHERE tenant_id = $1
AND entity_type = 'invoices'
AND entity_id = $2
ORDER BY timestamp ASC;
SELECT * FROM audit_log
WHERE tenant_id = $1
AND entity_type = 'compliance_checks'
AND changes->>'status' = 'fail'
AND timestamp > NOW() - INTERVAL '30 days';
This skill is automatically invoked by database triggers and API middleware. Explicit invocation is for generating audit reports or investigating compliance issues.
testing
> **OpenClaw skill context:** This skill supports ClawKeeper v1.5 as an OpenClaw-native SMB finance-agent platform. Implementations should preserve tenant isolation, deterministic policy enforcement, and auditable financial operations. --- name: payment-gateway description: "Process payments via Stripe, PayPal, or ACH. Use when paying invoices, processing customer payments, or managing payment methods. Handles payment scheduling, execution, and confirmation with full audit trail." --- # Paymen
development
> **OpenClaw skill context:** This skill supports ClawKeeper v1.5 as an OpenClaw-native SMB finance-agent platform. Implementations should preserve tenant isolation, deterministic policy enforcement, and auditable financial operations. --- name: invoice-processor description: "Parse, validate, and categorize invoices using OCR and LLM. Use when processing uploaded invoices, extracting invoice data, validating invoice fields, or categorizing expenses. Handles PDF, image, and scanned invoices wit
testing
> **OpenClaw skill context:** This skill supports ClawKeeper v1.5 as an OpenClaw-native SMB finance-agent platform. Implementations should preserve tenant isolation, deterministic policy enforcement, and auditable financial operations. --- name: financial-reporting description: "Generate standard financial reports including P&L, balance sheet, and cash flow statements. Use when creating monthly/quarterly/annual reports, comparing periods, or exporting financial data. Supports GAAP and custom re
development
> **OpenClaw skill context:** This skill supports ClawKeeper v1.5 as an OpenClaw-native SMB finance-agent platform. Implementations should preserve tenant isolation, deterministic policy enforcement, and auditable financial operations. --- name: document-parser description: "OCR and parse documents including invoices, receipts, and bank statements. Use when extracting text from PDF/images, parsing scanned documents, or processing uploaded files. Supports Google Document AI and Tesseract OCR." -