/engineering:accounting-enginefrom engineering
Designs and implements double-entry accounting policy with an embedded ledger engine for invoices, payments, stock, balanced postings, mapped accounts, idempotency, reversals, period locks, audit trails, and financial statements.
Ships in engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Category | Artifact | Format | Example |
|---|---|---|---|
| Correctness | Ledger invariant test pack | Markdown plus transaction fixtures | balanced posting, idempotency, reversal, period lock, subledger tie-out, and audit trail |
| Artefact | Required? | Purpose |
|---|---|---|
| Transaction event and tenant context | yes | Define the event and isolation boundary |
| Account mapping and doctrine policy | yes | Resolve balanced ledger accounts |
| Existing ledger and lock state | yes | Prevent duplicate or closed-period posting |
| Artefact | Consumer | Acceptance condition |
|---|---|---|
| Posting contract and journal evidence | Feature services and finance review | Balanced, idempotent, traceable, tenant-scoped |
Read and search are required. Database writes, migrations, backfills, reversals, and period operations require explicit authority and a verified compensating path.
Fallback without doctrine, mappings, or database access: return a posting design and unresolved control list; do not invent accounts or claim ledger correctness.
| Condition | Posting action | Failure avoided |
|---|---|---|
| New valid economic event | Append balanced journal | Missing financial record |
| Duplicate idempotency key | Return prior result | Double posting |
| Error in posted journal | Post linked reversal/correction | Destruction of audit history |
| Closed period | Reject or use authorised later-period adjustment | Period integrity breach |
MAX+1, or outside the posting transaction. Fix: allocate from the tenant counter inside the posting transaction, journal counter locked last (tenant-document-numbering).accounting-finance-controller or the business-plan finance skills.gl_entries, journal_lines, journal_entries, or any ledger table.LedgerPostingService::post(JournalEntry $entry) or the project-equivalent single posting service.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.
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
Core tables:
chart_of_accountsaccount_mappingsjournal_entriesjournal_linesaccounting_periodsposting_rule_versionsaccounting_integrity_runsaccounting_audit_logEvery 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.
<?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.
Run these per tenant and per accounting period from day one:
journal_entry_id.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.
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/posting-engine-contract.mdreferences/integrity-invariants.mdreferences/chwezi-finance-engine-skeletons/php-mysql/posting-service-skeleton.php (opens in a new tab)references/chwezi-finance-engine-skeletons/php-mysql/schema.sql (opens in a new tab)references/chwezi-finance-engine-skeletons/reviewer-checklist.md (opens in a new tab)references/integrity-invariants.md (opens in a new tab)references/posting-engine-contract.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub peterbamuhigire/chwezi-dev-engine --plugin engineering169 skills in this plugin
/accounting-finance-controllerUse when coordinating accounting and finance implementation reviews, doctrine routing, control evidence, remediation priorities, and release decisions across a software system./advanced-testing-strategyUse when designing or reviewing test strategy for production systems, APIs, mobile apps, SaaS platforms, ERP workflows, and AI-enabled systems. Covers unit, integration, contract, end-to-end, regression, release-gate, and risk-based testing decisions./ai-agent-commercial-operationsUse when pricing, billing, refunding, recognizing revenue, or packaging commercial terms for agentic AI services, or when defining agent SLAs, customer commitments, SLA dashboards, breach credits, and service evidence.Other plugins' skills for the same job