agentleFS
insight68insight68/Skills/skills/finance-reconcile/SKILL.md

finance-reconcile

Skill5 starsChanged 9 months agoMITView on GitHub

Comprehensive financial audit tool for balance sheets and income statements. Use when Claude needs to verify balance sheet equilibrium, validate income statement items against detail records, track account changes with opening/closing balance reconciliation, verify cross-statement relationships, or generate audit reports with account analysis and transaction tracing.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify balance sheet with account changes:

    line 16
  2. Distinctive:

    Use JSON config file for custom column names:

    line 42
  3. Very specific:

    When --output is specified, generates an Excel file with these sheets:

    line 185
  4. Very specific:

    Default tolerance is ±0.01 yuan.

    line 235
  5. Distinctive:

    Consider these factors when setting tolerance:

    line 244
  6. Distinctive:

    Check balance sheet total rows

    line 259
  7. Distinctive:

    Check account type classification

    line 261
  8. Distinctive:

    Ensure account names match exactly

    line 271
  9. Distinctive:

    Verify debit/credit records

    line 272
  10. Distinctive:

    Check for missing change records

    line 273
  11. Distinctive:

    Ensure detail table includes all items

    line 283
  12. Distinctive:

    Check item name consistency

    line 284
  13. Distinctive:

    Consider profit distribution events

    line 295
  14. Distinctive:

    Verify income statement net profit

    line 296

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Finance Audit

Overview

Comprehensive financial audit tool that validates balance sheets and income statements. Performs four core audits: balance sheet equilibrium, income statement verification, account change tracking, and cross-statement relationship validation.

Quick Start

Basic Balance Sheet Audit

Verify balance sheet with account changes:

scripts/reconcile.py \
    --balance-sheet balance_sheet.xlsx \
    --account-changes account_changes.xlsx \
    --output audit_report.xlsx

Complete Financial Audit (Balance Sheet + Income Statement)

Full audit including profit statement:

scripts/reconcile.py \
    --balance-sheet balance_sheet.xlsx \
    --account-changes account_changes.xlsx \
    --income-statement income_statement.xlsx \
    --income-details income_details.xlsx \
    --transactions transactions.xlsx \
    --output complete_audit.xlsx \
    --period "2024年1月"

Using Custom Column Names

Use JSON config file for custom column names:

scripts/reconcile.py \
    --balance-sheet bs.xlsx \
    --account-changes ac.xlsx \
    --config my_config.json

Command Parameters

ParameterShortRequiredDescription
--balance-sheet-bYesBalance sheet file path
--account-changes-aYesAccount change details file path
--income-statement-iNoIncome statement file path
--income-details-dNoIncome statement details file path
--transactions-tNoTransaction details file path
--output-oNoOutput Excel audit report path
--period-pNoAudit period (default: 本期)
--tolerance-NoTolerance for acceptable difference (default: 0.01)
--config-cNoJSON config file for column names
--bs-sheet-NoBalance sheet sheet name or index
--ac-sheet-NoAccount changes sheet name or index
--is-sheet-NoIncome statement sheet name or index
--id-sheet-NoIncome details sheet name or index
--trans-sheet-NoTransaction details sheet name or index

Required File Formats

1. Balance Sheet (资产负债表) - Required

ColumnDescription
科目Account name
期初余额Opening balance
期末余额Closing balance
类型Account type (资产/负债/所有者权益)
金额Amount for totals

2. Account Changes (科目变动明细表) - Required

ColumnDescription
科目Account name
借方Debit amount
贷方Credit amount

3. Income Statement (利润表) - Optional

ColumnDescription
项目Income statement item
金额Amount

4. Income Details (利润明细表) - Optional

ColumnDescription
项目Item name (must match income statement)
金额Detail amount

5. Transactions (交易明细表) - Optional

ColumnDescription
科目Affected account
借方Debit amount
贷方Credit amount
日期 (optional)Transaction date
凭证号 (optional)Voucher number

See references/file_formats.md for detailed format specifications and custom column configuration.

Audit Objectives

The script performs four core audit objectives:

1. Balance Sheet Equilibrium Verification

Formula: 资产总计 = 负债总计 + 所有者权益总计

Verifies that the balance sheet is balanced overall.

2. Income Statement Verification

Logic: Income statement items = Corresponding detail summary

Validates each income statement item (revenue, expenses, etc.) against detail records.

3. Account Change Tracking

Logic: Opening Balance + Changes = Closing Balance

For each account:

  • Asset accounts: Closing = Opening + Debit - Credit
  • Liability/Equity accounts: Closing = Opening + Credit - Debit

4. Cross-Statement Relationship Validation

Logic: Retained earnings change ≈ Net profit

Validates relationships between balance sheet and income statement.

See references/verification_rules.md for detailed audit logic and troubleshooting.

Audit Outputs

Console Report

================================================================================
                              财务审计报告 - 本期
================================================================================

一、审计概述
--------------------------------------------------------------------------------
审计结果: 通过 ✓

二、资产负债表审计
--------------------------------------------------------------------------------
资产总计: ¥1,000,000.00
负债总计: ¥600,000.00
所有者权益总计: ¥400,000.00
资产负债平衡: 是 ✓

三、利润表审计
--------------------------------------------------------------------------------
利润项目匹配: 5/5

四、报表勾稽关系
--------------------------------------------------------------------------------
净利润: ¥100,000.00
未分配利润变动: ¥100,000.00
勾稽关系验证: 通过 ✓

五、不平衡项目清单
--------------------------------------------------------------------------------
  无不平衡项目

Excel Audit Report

When --output is specified, generates an Excel file with these sheets:

SheetContent
审计报告Full audit report text
科目变动分析Account analysis with opening/closing balances
交易影响追踪Transaction impact tracking
利润表核对Income statement verification results
不平衡项List of unbalanced items

Account Change Analysis Table

科目科目类型期初余额借方变动贷方变动净变动期末余额是否平衡差异
货币资金资产10000020000020000120000是0

Using the Script as a Module

from scripts.reconcile import (
    audit_financial_statements,
    generate_audit_report,
    export_audit_report
)

result, accounts = audit_financial_statements(
    balance_sheet_file='balance_sheet.xlsx',
    account_changes_file='account_changes.xlsx',
    income_statement_file='income_statement.xlsx',
    income_details_file='income_details.xlsx',
    transactions_file='transactions.xlsx',
    tolerance=0.01,
    period='2024年1月'
)

# Print console report
print(generate_audit_report(result, period='2024年1月'))

# Export Excel report
export_audit_report(result, 'audit_report.xlsx', accounts, period='2024年1月')

# Check audit result
if result.is_passed:
    print("Audit passed!")
else:
    print(f"Found {len(result.unbalanced_items)} unbalanced items")

Tolerance Setting

Default tolerance is ±0.01 yuan. Adjust with --tolerance:

scripts/reconcile.py \
    --balance-sheet bs.xlsx \
    --account-changes ac.xlsx \
    --tolerance 1.0

Consider these factors when setting tolerance:

  • Exchange rate fluctuations (for foreign currency)
  • System precision differences
  • Rounding errors

Troubleshooting

Balance Sheet Not Balanced

Possible causes:

  • Incorrect balance entries
  • Incorrect totals calculation
  • Opening/closing mismatch

Solutions:

  1. Check balance sheet total rows
  2. Verify account balances
  3. Check account type classification

Account Changes Unbalanced

Possible causes:

  • Missing change records
  • Incorrect debit/credit direction
  • Account name mismatch

Solutions:

  1. Ensure account names match exactly
  2. Verify debit/credit records
  3. Check for missing change records

Income Statement Not Matching

Possible causes:

  • Missing detail items
  • Inconsistent item names
  • Incorrect summary calculation

Solutions:

  1. Ensure detail table includes all items
  2. Check item name consistency
  3. Verify summary calculations

Cross-Statement Relationship Failed

Possible causes:

  • Profit distribution (dividends, retained earnings)
  • Mismatched accounting periods
  • Incorrect net profit calculation

Solutions:

  1. Consider profit distribution events
  2. Verify income statement net profit
  3. Confirm period consistency

Resources

scripts/reconcile.py

Core audit script supporting:

  • Balance sheet equilibrium verification
  • Income statement validation
  • Account change tracking
  • Cross-statement relationship validation
  • Transaction impact tracing
  • Comprehensive audit report generation

references/file_formats.md

Detailed file format specifications, column name mapping, and configuration options.

references/verification_rules.md

Comprehensive audit rules, validation logic, output examples, and troubleshooting guide.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.