All plugins
v2.0.0·Core·MIT · forkable

artifi-core-cost-allocation

Multi-method cost allocation engine

A flexible cost allocation engine supporting two modes: standalone allocations from GL account balances and document-linked allocations traced back to specific bills or invoices. Four allocation methods are available — fixed percentage, by headcount, by revenue, and custom formula. Every allocation enforces balanced debits and credits, prevents double-allocation of the same costs, and creates a full audit trail. Allocations can be voided with automatic reversing entries.

↗ View on GitHubClone the repo
COMMANDS · 2

Slash commands shipped.

/allocate-costs

Create and execute a cost allocation from start to finish. Supports standalone (from GL balances) and document-linked (from a specific bill/invoice). Guides through: entity/period selection, mode choice, source identification, allocation method, preview, and submission.

/allocation-preview

Calculate and preview an allocation without submitting. Shows preview table with source and target lines, total debits/credits, and source line account verification. Supports both standalone and document-linked modes.

HOW IT WORKS

Workflow steps · agent runs · validation gates.

Standalone Allocation

  1. 1

    Identify source costs — fetch balance of source account(s) for the allocation period

  2. 2

    Determine allocation method: fixed percentage, by headcount, by revenue, or custom formula

  3. 3

    Calculate target splits and show preview table with source and target lines

  4. 4

    User reviews and confirms the allocation preview

  5. 5

    Create allocation run and submit balanced debit/credit lines

  6. 6

    Optionally approve and post the GL journal entry immediately

Document-Linked Allocation

  1. 1

    Identify source transaction — find the source bill/invoice/JE and show GL lines

  2. 2

    Check existing allocations — verify account is not already fully allocated

  3. 3

    Select which line(s) to allocate: all expense lines or specific accounts

  4. 4

    Determine allocation method and calculate target splits

  5. 5

    User confirms preview including source document reference

  6. 6

    Create allocation run with source_transaction_id for full traceability

Voiding and Correcting

  1. 1

    Void an existing allocation run

  2. 2

    System creates reversing GL entry automatically

  3. 3

    Source account freed up for re-allocation

VALIDATION CHECKPOINTS · 8

Every run must pass.

If any checkpoint fails, the workflow stops and reports the issue. Nothing posts to the ledger until every check passes.

Source data exists (account has balance or transaction has allocatable lines)

Target accounts exist and are active

Total debits equal total credits (balanced)

At least one source line and one target line

For document-linked: source line accounts match source transaction GL lines

For document-linked: account not already fully allocated

User has reviewed and confirmed the preview

Submission succeeds without errors

REFERENCE DATA · 2 FILES

Structured knowledge included.

Formulas, templates, regulatory rules — not hardcoded values. Forkable per firm, per client.

allocation-methods.md

Fixed percentage, by headcount, by revenue, and custom formula calculation methods with examples

submission-format.md

JSON structure for allocation_run submission with source/target line format

MIT · BUILT FOR ARFITI · OPEN FOR EVERYONE

Designed to work out-of-the-box with the Arfiti ledger. Claude fetches your data, runs calculations, validates results, and submits entries automatically through MCP.

Or fork it. Skills, commands, validation logic, and reference data are all MIT-licensed. Swap the MCP tool calls for your own backend, or use the reference files as standalone Claude project resources.

SUBSCRIBE · NEW POSTS · NO SPAM

Get the next post in your inbox.

Practitioner notes on AI-native finance. One email when something new ships. Unsubscribe any time.