consolidation-wizard

Automated consolidation-report generation skill. Based on consolidation rules in China Accounting Standard (CAS 33) and IFRS 10, it guides users via conversational prompts to upload parent and subsidiary standalone financial statements and intercompany transaction data, then automates policy harmonization, trial balance (TB) conversion, generation of nine types of elimination entries, and calculation of non-controlling interests. Outputs a complete Excel workbook containing consolidation working papers, elimination-entry details, consolidated balance sheet, and consolidated income statement. Designed for group consolidations, audit practice, and listed-company financial reporting, with support for CAS and IFRS consolidation differences. Trigger terms: consolidation report, consolidated financial statements, elimination, group consolidation, TB, non-controlling interest calculation, consolidation.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "consolidation-wizard" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-b48a17a01f2a23d47ddcff24312f44e595b1a9f585ecdfca5bb4ee784f47d01b. Verify the upstream source and version against https://skillhub.cn/skills/user_9355e276/consolidation-wizard before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Automated consolidation-report generation skill. Based on consolidation rules in China Accounting Standard (CAS 33) and IFRS 10, it guides users via conversational prompts to upload parent and subsidiary standalone financial statements and intercompany transaction data, then automates policy harmonization, trial balance (TB) conversion, generation of nine types of elimination entries, and calculation of non-controlling interests. Outputs a complete Excel workbook containing consolidation working papers, elimination-entry details, consolidated balance sheet, and consolidated income statement. Designed for group consolidations, audit practice, and listed-company financial reporting, with support for CAS and IFRS consolidation differences. Trigger terms: consolidation report, consolidated financial statements, elimination, group consolidation, TB, non-controlling interest calculation, consolidation.

0 Downloads

Introduction source: third_party · user_9355e276 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: 合并报表生成器
description: >-
  合并财务报表自动生成技能。基于中国企业会计准则(CAS 33)和国际财务报告准则(IFRS 10)的合并规则,
  通过深度对话引导用户上传母子公司单体报表及内部交易数据,自动完成会计政策统一、试算平衡表(TB)转换、
  9类抵销分录生成、少数股东权益计算,最终输出包含合并工作底稿、抵销分录明细、合并资产负债表和合并利润表
  的完整Excel工作簿。适用于集团财务合并、审计实务、上市公司财报编制等场景。触发词包括合并报表、合并财务报表、
  合并抵消、合并抵销、集团合并、TB表、试算平衡表、少数股东权益计算、consolidation。
  支持中国会计准则(CAS)和国际准则(IFRS)的合并差异处理。
agent_created: true

合并报表生成器

概述

本技能实现从单体报表到合并财务报表的全流程自动化编制。核心参照微信公众号「得合并者得天下!合并财务报表实务技巧汇编」中的实务方法论, 采用打通资产负债表和利润表的TB表(试算平衡表)作为合并基础,避免传统教材割裂两张表的做法。AI与用户深度对话, 逐步引导提供合并所需全部基础资料,最终输出专业格式的Excel合并报表工作簿。

适用场景

触发本技能的关键词或场景:

  • 用户提及"合并报表""合并财务报表""集团合并""合并抵销/抵消""TB表""试算平衡表""少数股东权益""consolidation"
  • 用户需要编制母子公司合并财务报表
  • 用户需要了解合并规则或合并流程(即使不生成报表,也应加载本技能以提供专业解答)
  • 用户询问权益法调整、抵销分录编制、有效持股比例计算等合并实务问题

核心能力

  1. 深度对话引导 — 与用户多轮对话,了解合并主体结构、持股关系、会计政策、内部交易等
  2. 单体报表处理 — 接收母公司及各子公司资产负债表和利润表,自动转换TB格式并校验勾稽关系
  3. 9类抵销分录自动生成 — 长期股权投资、内部往来、存货/固定资产/无形资产未实现损益、内部收入成本、内部投资收益、内部资产减值、内部分红
  4. 少数股东权益计算 — 自动计算有效持股比例,区分名义持股与实际持股
  5. 合并报表输出 — 生成包含合并工作底稿、抵销分录明细、合并资产负债表、合并利润表的Excel工作簿

合并规则知识库

当用户询问合并规则、合并原理或实务方法时,先加载 references/consolidation_rules.md 获取完整知识, 向用户提供专业解释。核心规则要点:

  • TB表原理:将资产负债表和利润表融合为一张表,资产/费用用正数(借),负债/权益/收入用负数(贷),Check行=0表示平衡
  • 期初未分配利润核对:倒推期初数与上年审计报告一致,不一致时冲回子公司调整+跟调审计调整
  • 长期股权投资抵销:实务中无需先做权益法调整,直接抵销+少数股东损益分录
  • 有效持股比例:各路径乘积之和,计算少数股东损益时使用有效比例,计算实收资本时使用名义比例
  • 境内外准则差异:CAS 33 vs IFRS 10,控制模型、投资性主体、结构化实体等

工作流程

阶段一:需求了解(深度对话)

启动技能后,通过多轮对话了解用户合并场景。使用 show_widget 渲染交互式HTML表单推进流程。 至少需要确认以下信息:

  1. 合并主体结构

    • 母公司名称
    • 子公司数量及名称
    • 各子公司持股比例(直接+间接)
    • 是否存在结构化主体或合伙企业
  2. 会计政策与期间

    • 采用的会计准则(中国企业会计准则/国际财务报告准则/其他)
    • 报告期间(年度/季度/月度)
    • 母子公司的会计政策是否一致,是否需要调整
    • 记账本位币
  3. 内部交易情况

    • 内部往来余额(应收账款/应付账款、其他应收款/其他应付款)
    • 内部存货交易及未实现利润
    • 内部固定资产/无形资产交易
    • 内部收入与成本
    • 内部分红
  4. 特殊事项

    • 是否存在同一控制/非同一控制下合并
    • 是否有商誉
    • 期初未分配利润是否需要调整

注意:初始化时先渲染结构化信息收集弹窗,供用户填写主体结构和持股比例。 弹窗必须包含「下一步:上传报表 ↗」按钮(使用 sendPrompt()),推进到文件上传阶段。 不要在弹窗中直接收报表文件——文件上传走独立的上传弹窗。

阶段二:准备阶段 — 文件上传

当用户确认主体结构后,进入文件上传阶段。展示上传交互弹窗,让用户上传以下文件:

  1. 母公司的资产负债表和利润表(Excel格式)
  2. 各子公司的资产负债表和利润表(Excel格式)
  3. 期初未分配利润明细(如有)
  4. 内部交易明细(如有)

上传弹窗设计要求:

必须使用 show_widget 渲染包含以下元素的HTML弹窗:

  • <input type="file" multiple> — 让用户点选文件
  • 文件列表预览区 — 显示已选文件的名称和大小
  • 「开始处理合并报表 ↗」按钮 — 使用 FileReader.readAsDataURL() 并行读取所有文件, 然后对每个文件逐条发送 sendPrompt('__MERGE_FILE__'+JSON.stringify({i,total,name,size,b64})), 间隔500ms逐文件发送,避免静默丢弃。

AI接收文件的处理: 收到 __MERGE_FILE__ 消息后:

  • 解析JSON,解码base64写盘到 output/merge_input/ 目录
  • 记录已收文件,收齐所有文件后进入处理阶段
  • 未收到任何 __MERGE_FILE__ 前严禁自动扫描或跑脚本

阶段三:处理阶段 — 自动合并

收到所有文件后,执行以下自动化处理流程:

步骤1:解析单体报表

使用 scripts/tb_converter.py 中的 parse_financial_statement() 函数解析每个Excel文件。 读取每张工作表,提取资产负债表和利润表数据。

步骤2:会计政策统一检查

检查各实体报表的项目名称、科目分类是否与母公司的会计政策一致。若不一致, 向用户报告差异并确认是否按母公司政策调整。

步骤3:TB表转换与校验

使用 scripts/tb_converter.py 中的 convert_to_tb() 函数:

from scripts.tb_converter import convert_to_tb, validate_tb

# 对每个实体
tb = convert_to_tb(bs_df, pl_df, entity_name, opening_re=..., profit_distribution=...)
result = validate_tb(tb, entity_name)
  • 将资产负债表和利润表合并为TB格式
  • 资产/费用→正数,负债/权益/收入→负数
  • 将未分配利润拆分为「期初未分配利润」+ 利润表各项目
  • CHECK行验证平衡(=0)

若CHECK不等于0,向用户报告并排查原因。

步骤4:核对期初未分配利润

对每个子公司,比对倒推的期初未分配利润与上年审计报告期末未分配利润。 不一致时:冲回子公司自身调整,再跟调上年审计调整。

步骤5:生成抵销分录

使用 scripts/consolidation_engine.py 中的 ConsolidationEngine 类:

from scripts.consolidation_engine import ConsolidationEngine, Entity, Ownership, InterTransaction

engine = ConsolidationEngine()

# 添加实体
for entity_data in entities:
    entity = Entity(name=..., bs=bs_df, pl=pl_df, is_parent=..., tb=tb_df)
    engine.add_entity(entity)

# 添加持股关系
for own in ownerships:
    engine.add_ownership(Ownership(parent=..., subsidiary=..., ratio=...))

# 添加内部交易
for trans in internal_transactions:
    engine.add_inter_transaction(InterTransaction(
        type=..., from_entity=..., to_entity=..., amount=..., unrealized_profit=...
    ))

# 生成抵销分录
engine.generate_eliminations()

# 获取抵销明细和合并工作底稿
elimination_detail = engine.get_elimination_detail()
worksheet = engine.build_worksheet()

引擎自动生成9类抵销分录:

  1. 长期股权投资与被投资单位权益抵销(含少数股东权益计算)
  2. 内部往来抵销
  3. 存货未实现内部损益抵销
  4. 固定资产未实现内部损益抵销
  5. 无形资产未实现内部损益抵销
  6. 内部收入与成本抵销
  7. 内部投资收益抵销
  8. 内部资产减值损失抵销
  9. 内部分红抵销

步骤6:生成合并报表Excel

使用 scripts/excel_generator.py 中的 generate_consolidation_excel() 函数:

from scripts.excel_generator import generate_consolidation_excel

output_path = generate_consolidation_excel(
    worksheet_df=worksheet,
    elimination_detail_df=elimination_detail,
    entity_info=entity_info_dict,
    output_path="output/合并财务报表.xlsx",
    report_period="2024年度",
    reporting_currency="人民币"
)

生成的Excel包含4个工作表:

  • 合并工作底稿(含各实体TB、汇总、抵销分录、合并数、CHECK)
  • 抵销分录明细(按类别分组)
  • 合并资产负债表
  • 合并利润表

阶段四:交付阶段 — 输出与解释

  1. 验证合并结果:确认合并数CHECK行≈0,资产负债平衡
  2. 向用户展示关键数据:
    • 合并资产总额、负债总额、净资产
    • 合并营业收入、净利润
    • 少数股东权益/损益
  3. 解释重要抵销分录:列出金额最大的几笔抵销分录及其含义
  4. 用 present_files 交付Excel文件

交互设计规范

弹窗设计原则

  • 每个阶段使用专门的 show_widget 渲染HTML弹窗
  • 按钮必须使用 sendPrompt() 推送流程,按钮文字加 ↗ 箭头
  • 弹窗颜色使用WorkBuddy设计系统CSS变量(通过 read_me 加载)
  • 在IDE light主题下使用浅色背景+深色文字

阶段一弹窗:主体结构与持股关系

<!-- 关键设计要素 -->
- 实体管理区:添加/删除母公司和子公司,填写名称、持股比例
- 持股关系可视化:简单的树形结构展示
- 会计政策选择:中国会计准则(CAS)/国际财务报告准则(IFRS)
- 报告期间选择
- 「下一步:上传报表 ↗」按钮

阶段二弹窗:文件上传

<!-- 关键设计要素 -->
- <input type="file" multiple accept=".xlsx,.xls,.csv">
- 文件分类提示:哪些文件需要上传(母公司BS/PL、子公司BS/PL、内部交易明细)
- 已选文件列表预览
- 「开始处理合并报表 ↗」按钮

输出规范

文件存放

  • 处理过程中间文件:output/merge_input/(用户上传的原始文件)
  • 最终交付文件:output/合并财务报表_[日期].xlsx

交付物清单

  1. 合并财务报表.xlsx — 最终Excel工作簿(主交付物)
  2. 简要文字总结 — 关键合并数据概览和重要抵销分录说明

参考资料

  • references/consolidation_rules.md — 合并规则详细手册(当用户询问合并规则时加载)
  • 脚本模块在 scripts/ 目录下,按需导入执行

注意事项

  1. 数据安全:用户上传的财务数据敏感,处理完毕后不在对话中保留原始金额明细
  2. 专业判断:AI辅助生成的抵销分录仅供参考,最终应以注册会计师专业判断为准
  3. 准则适配:默认采用中国企业会计准则(CAS),用户可选择IFRS,AI需提示关键差异
  4. 错误处理:TB表不平衡时,先帮助用户排查单体报表问题再继续合并
  5. 文件格式:接受 .xlsx、.xls、.csv 格式的财务报表文件
  6. 大文件处理:如有大量子公司或多年数据,分批次处理避免内存溢出

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 直接解决企业合并财务报表编制的核心痛点
  • 适用于集团财务合并、审计实务、上市公司财报编制等专业场景
  • 支持中国会计准则(CAS)和国际准则(IFRS)的合并差异处理
Trigger Precision92/100

Highlights

  • 触发词精准完整,覆盖多种变体
  • 边界清晰,包含中英文关键词
  • 涵盖核心概念如合并报表、抵销分录、少数股东权益等
Structure and Standards88/100

Areas to improve

  • Document is too long Reported severity: Minor

    SKILL.md 内容超过500行,建议适当拆分

    Recommendation: 可将部分详细说明移至 references/consolidation_rules.md

Highlights

  • Phase/步骤清晰,有出口条件
  • 含端到端示例,frontmatter完整
  • 工作流程分阶段明确,交互设计规范清晰
Execution Reliability85/100

Areas to improve

  • Missing referenced files Reported severity: Minor

    SKILL.md 引用了 references/consolidation_rules.md 和 scripts/ 目录下的脚本文件,但未传入

    Recommendation: 请补充 references/consolidation_rules.md 和 scripts/tb_converter.py、scripts/consolidation_engine.py、scripts/excel_generator.py 等脚本文件

Highlights

  • 工具来源明确,参数正确
  • 覆盖主要异常,不可逆操作有确认机制
  • 有完整的错误处理和数据安全规范
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.