Accounting Engineのロゴ

Accounting Engine

コミュニティ
peterbamuhigire
accounting-engine

請求書、支払い、在庫、貸借一致の仕訳、勘定科目のマッピング、冪等性、取消仕訳、期間ロック、監査証跡、財務諸表に対応する複式簿記の会計方針と組み込み型の台帳エンジンを設計、実装する場合に使用します。

Add to TypingMind

概要

公開者peterbamuhigire
リポジトリchwezi-dev-engine
スキル名accounting-engine
スター
29
フォーク
6
同梱ファイル
5
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 5個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    peterbamuhigireがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Accounting Engine」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/finance-accounting/accounting-engine
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/peterbamuhigire/chwezi-dev-engine.git /tmp/chwezi-dev-engine
mkdir -p .claude/skills
cp -r /tmp/chwezi-dev-engine/skills/finance-accounting/accounting-engine .claude/skills/accounting-engine
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでAccounting Engineを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にAccounting Engineを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Accounting Engineは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Accounting Engine

Evidence Produced

CategoryArtifactFormatExample
CorrectnessLedger invariant test packMarkdown plus transaction fixturesbalanced posting, idempotency, reversal, period lock, subledger tie-out, and audit trail

Inputs

ArtefactRequired?Purpose
Transaction event and tenant contextyesDefine the event and isolation boundary
Account mapping and doctrine policyyesResolve balanced ledger accounts
Existing ledger and lock stateyesPrevent duplicate or closed-period posting

Outputs

ArtefactConsumerAcceptance condition
Posting contract and journal evidenceFeature services and finance reviewBalanced, idempotent, traceable, tenant-scoped

Capability contract

Read and search are required. Database writes, migrations, backfills, reversals, and period operations require explicit authority and a verified compensating path.

Degraded mode

Fallback without doctrine, mappings, or database access: return a posting design and unresolved control list; do not invent accounts or claim ledger correctness.

Decision rules

ConditionPosting actionFailure avoided
New valid economic eventAppend balanced journalMissing financial record
Duplicate idempotency keyReturn prior resultDouble posting
Error in posted journalPost linked reversal/correctionDestruction of audit history
Closed periodReject or use authorised later-period adjustmentPeriod integrity breach

Domain anti-patterns

  • Posting directly from controllers. Fix: use one posting service and contract.
  • Updating or deleting journals. Fix: reverse and repost with links.
  • Guessing accounts from feature names. Fix: require mapping-layer resolution.
  • Retrying without idempotency. Fix: persist and enforce the event key.
  • Mixing tenants in one posting context. Fix: require tenant scope on every ledger operation.

Use When

  • The product handles money, inventory value, payroll, tax, customer balances, supplier balances, assets, grants, donations, loans, refunds, wallet balances, or financial reporting.
  • A SaaS must replace routine bookkeeping in external products such as QuickBooks, Xero, Sage, Pastel, Tally, Zoho Books, or Wave.
  • You need architecture, schema, posting rules, tests, documentation, or review findings for ledger-backed business software.

Do Not Use When

  • The task is only financial analysis or projections without software architecture; use accounting-finance-controller or the business-plan finance skills.
  • The system only displays imported accounting reports and does not create business events or postings.
  • A jurisdiction requires a licensed accountant, auditor, or tax practitioner to exercise professional judgement; design the system support, but do not claim the software replaces that judgement.

Hard Rules

  • NEVER let a business module write directly to gl_entries, journal_lines, journal_entries, or any ledger table.
  • ALWAYS write ledger records through one service: LedgerPostingService::post(JournalEntry $entry) or the project-equivalent single posting service.
  • NEVER update, delete, or soft-delete posted journal lines. Corrections are reversing journals linked to the original entry.
  • NEVER store authoritative balances that cannot be rebuilt from journal lines. Materialized balances are caches with a documented rebuild command.
  • NEVER hardcode account codes in business logic. Use account mappings resolved at posting time.
  • NEVER use LIFO for IFRS or IFRS for SMEs tenants.
  • MUST reject posting when required account mappings are missing, inactive, cross-tenant, or not valid for the source document.

Canonical Architecture

Business modules emit events. A mapper turns events into balanced JournalEntry value objects. The posting service validates and writes the entry atomically. Reports, subledgers, balances, tax schedules, and dashboards are deterministic projections of the ledger.

text
Sales / Stock / Payroll / Assets / Payments / Grants
        -> business event
        -> account resolver and posting-rule mapper
        -> JournalEntry value object
        -> LedgerPostingService::post()
        -> append-only journal_entries + journal_lines
        -> reports, subledgers, tax schedules, dashboards

Required Model

Core tables:

  • chart_of_accounts
  • account_mappings
  • journal_entries
  • journal_lines
  • accounting_periods
  • posting_rule_versions
  • accounting_integrity_runs
  • accounting_audit_log

Every accounting table MUST carry tenant_id, unless the product is explicitly single-tenant. If legacy files use franchise_id, treat it as a project-specific tenant alias and document the mapping.

Posting Service Contract

php
<?php
declare(strict_types=1);

final readonly class JournalEntry
{
    public function __construct(
        public int $tenantId,
        public string $idempotencyKey,
        public DateTimeImmutable $entryDate,
        public string $sourceType,
        public string $sourceId,
        public string $description,
        /** @var list<JournalLine> */
        public array $lines,
        public ?int $reversesJournalId = null,
    ) {}
}

final readonly class JournalLine
{
    public function __construct(
        public int $accountId,
        public string $currency,
        public string $debitMinor,
        public string $creditMinor,
        public array $dimensions = [],
    ) {}
}

interface LedgerPostingService
{
    public function post(JournalEntry $entry): PostedJournal;
}

The service validates tenant scope, account status, open period, debit-credit equality, currency policy, idempotency, source document state, and mapping completeness before insert.

Integrity Checks

Run these per tenant and per accounting period from day one:

  • Debits equal credits per journal_entry_id.
  • Trial balance total debits equal total credits.
  • AR control account equals customer-tagged journal line balance.
  • AP control account equals supplier-tagged journal line balance.
  • Inventory control account equals stock-on-hand value by item/location/cost layer.
  • Fixed asset control account equals asset-register cost less disposals.
  • Payroll liability accounts equal unpaid statutory and employee deductions.
  • No journal exists in a locked period unless it is a permitted reopening workflow with approval evidence.
  • No ledger table has rows written outside the posting service.
  • Materialized balances rebuild to the same values as stored cache rows.

User Experience Principle

Non-accountants record business actions: Record Sale, Receive Payment, Buy Stock, Run Payroll, Record Asset Purchase, Receive Grant, Close Month. The system posts accounting behind the scenes. Accountant-facing roles get journals, CoA, mappings, period close, manual journal, and report exports.

Companion Skills

  • ledger-posting-engine-core (chwezi-accounting-doctrine) for IFRS-aligned industry templates.
  • inventory-costing-and-stock-accounting (chwezi-accounting-doctrine) for IAS 2 stock valuation and COGS flows.
  • payroll-and-statutory-postings-east-africa (chwezi-accounting-doctrine) for PAYE/NSSF/LST payroll journal shapes.
  • fixed-assets-and-depreciation for IAS 16 asset lifecycle.
  • multicurrency-and-fx for IAS 21 currency handling.
  • multi-tenant-saas-architecture, api-design-first, and advanced-testing-strategy for platform integration.

References

  • references/posting-engine-contract.md
  • references/integrity-invariants.md

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Accounting Engine」では何ができますか?

請求書、支払い、在庫、貸借一致の仕訳、勘定科目のマッピング、冪等性、取消仕訳、期間ロック、監査証跡、財務諸表に対応する複式簿記の会計方針と組み込み型の台帳エンジンを設計、実装する場合に使用します。

TypingMindでAccounting Engineを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Accounting Engineはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにAccounting Engineをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/finance-accounting/accounting-engineを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Accounting Engineを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Accounting Engineで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもAccounting Engineを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Accounting Engine」は無料ですか?

はい。peterbamuhigireがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇