‹ 首页

domain-financial

@signalpilot-labs · 收录于 5 天前 · 上游提交 6 天前

Financial reporting rules: grain consistency, balance sheets, double-entry ledgers, fiscal year boundaries, period-over-period calculations.

适合你,如果你需要生成或校验符合规范的财务报表

/ 通过 npx 安装 校验哈希
npx oh-my-skill add signalpilot-labs/signalpilot/domain-financial
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- signalpilot-labs/signalpilot/domain-financial
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify signalpilot-labs/signalpilot/domain-financial
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
473GitHub stars
~479上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 436a4c4 · 表述以原文为准
它做什么

Claude 将按照会计规则处理财务报告:从事实表聚合数据,确保报告粒度一致,正确拆分资产负债表中的留存收益和当年收益,在分类账中同时显示借贷双方,计算环比时首次返回 NULL。

什么时候触发

当用户询问财务报告、资产负债表、分类账或期间对比时触发,要求使用交易事实表驱动或指定粒度。

装好后可以这样说
按规则从事实表聚合,不显示零交易账户。
检查所有指标使用相同粒度 COUNT(*)。
根据财政年度边界区分两者。
技能原文 SKILL.md作者撰写 · Apache-2.0 · 436a4c4

Financial Reporting

Driving Table

When aggregating transactions or metrics, drive FROM the fact/transaction table (journal_entries, invoices, payments), not the dimension table (accounts, customers). Accounts with zero transactions MUST NOT appear in transaction reports - they have no data to aggregate.

Grain Consistency

All metrics in a report MUST operate at the same grain - mixing grains produces silently wrong totals.

Use COUNT() on a line-item fact table, not COUNT(DISTINCT document_id) - the grain is the line item, not the document, so COUNT() is consistent with SUM(amount).

NEVER use COUNT(DISTINCT) just because a key represents a document or entity - a transaction fact table's grain is the transaction row.

Do NOT use a YML column description to choose between COUNT(*) and COUNT(DISTINCT) - descriptions explain semantics, not aggregation method. The source table's grain determines the correct aggregation.

Balance Sheets

A balance sheet has exactly three components:

  1. Regular accounts (ASSET, LIABILITY, EQUITY) - cumulative running balances
  2. Retained Earnings - cumulative P&L from ALL prior fiscal years
  3. Current Year Earnings - cumulative P&L from the current fiscal year only

Query the project's configuration or organization table for fiscal year end settings - these values vary per tenant and MUST be used to compute the boundary, not hard-coded.

P&L transactions before the fiscal year boundary = Retained Earnings. P&L from the boundary onward = Current Year Earnings.

If the YML description specifies this earnings split, implement it exactly as written.

Double-Entry Ledgers

Every transaction has offsetting debits and credits - when unioning ledger entries, preserve BOTH sides.

Running balances MUST be computed with a window function ordered by transaction_date AND a deterministic tiebreaker (transaction_id or a sequence index) - ordering by date alone is non-deterministic when multiple transactions share a timestamp.

Period-Over-Period

See dbt-workflow "Incremental Models and Period-Over-Period Columns" for the full rule. On first build, period-over-period columns MUST be NULL. Do NOT substitute 0.

按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。