Skills watch

opensilk-accounting

Build accounting software, or make a POS, online shop, CRM, purchasing, inventory or asset app post correctly to a real double-entry ledger, on open-silk + open-ketoan instead of inventing accounting logic. Use when the user wants an accounting system, bookkeeping, a general ledger, posting sales / purchases / payments, cost of goods, period close, or asks "connect my app to accounting".

Score 54writing hoanganh8389/opensilk-skills source file first seen 2026-12-01

Why it scored this

named +4 · described +6 · substantial +6 · right length +4 · evals +5 · numbered-steps +5 · code-fences +3 · active +5 · unseen-before +8 · specific-vocabulary +8

The file

---
name: opensilk-accounting
description: Build accounting software, or make a POS, online shop, CRM, purchasing, inventory or asset app post correctly to a real double-entry ledger, on open-silk + open-ketoan instead of inventing accounting logic. Use when the user wants an accounting system, bookkeeping, a general ledger, posting sales / purchases / payments, cost of goods, period close, or asks "connect my app to accounting".
---

# Build accounting on OpenSilk

`<kit>/opensilk.json` pins **open-silk** (core) and **open-ketoan** (accounting kernel: single posting gate, append-only ledger, accountant-owned posting rules, lifecycle checks, error library). Anything not in that file is unverified.

## Four rules you never break

1. No valid business document, no journal entry. Every entry traces to its source and version.
2. The ledger is append-only. Mistakes are fixed with adjusting or reversing documents.
3. One posting gate. UI, POS, API, modules and AI all go through the kernel.
4. The accountant owns account mapping. Apps send `docType`, `reasonCode` and catalog codes; they never pick debit / credit accounts or write ledger tables.

## 1. Understand the need (no writes)

Map the request to needs in `<kit>/opensilk.json`: `accounting-system`, `pos-to-ledger`, `shop-to-ledger`, `crm-to-ledger`, `purchasing-inventory`, `fixed-assets`, `accounting-module`, `ai-assistant`, `manufacturing`. Choose a path:

- **A. Accounting system**: the user's accounting software *is* an open-ketoan clone, extended with modules.
- **B. Connect an app**: the user's app sends documents to a running open-ketoan server.

For a retail POS on path B: **open-kiot** (https://github.com/hoanganh8389/open-kiot) is the planned retail POS for store chains, built on open-silk to work with open-ketoan and open-cake. It is at P0: research and proposed ADRs, no code yet, and it is not pinned in `opensilk.json`. Do not install it or call its APIs; say it is planned. Its proposed rules can guide a POS you build now, quoted as proposals: the till keeps selling when accounting is offline (sale, payment, stock move and outbox in one transaction, the document goes to open-ketoan after commit), one idempotency key per cashier action, a stable `docKey@version`, money never in floats. Read `docs/research/02-retail-business-canon.md` and `docs/adr/` there.

Check the jurisdiction. The kernel ships **Vietnamese** rule packs only; for other countries say so before planning (see `customWork`).

## 2. Plan

```bash
node <kit>/tools/opensilk.mjs plan --project <app> --need <needs>
```

Present `reuse`, `notYetAvailable`, `customWork` and `blockers`. **Wait for approval.**

## 3. Get the sources (after approval)

- Always: `node <kit>/tools/opensilk.mjs fetch --project <app>`, and add `.opensilk/` to `.gitignore`.
- Path A: `git clone https://github.com/hoanganh8389/open-ketoan.git <app> && git -C <app> switch -c my-app <commit from opensilk.json>`; then follow its README quick install. Its `AGENTS.md` and `skills/` now govern the project.
- Path B: the user needs a running open-ketoan server and an API key; the README quick install in the vendored copy explains both. Do not start servers without approval.

## 4. Read only what the plan lists

Start with `skills/open-ketoan-standard/SKILL.md` in the vendored copy (always), then the plan's `read` files. Those skills contain the real commands (`event check`, `flow check`, `explain`, `module new / check`) and when to run them. Docs are in Vietnamese; read them as they are and answer in the user's language.

## 5. Build the business part

- Write a pure `toDocument(event) → document` per document type, with tests and a sample file that passes the kernel's event check.
- Send a business event only after it happened (goods moved, money changed hands, invoice issued). Quotes, carts, open orders: never.
- Exactly one system sends each document type.
- Never hard-code account numbers, tax rates, costing or depreciation formulas in the app.
- Where the kernel has a closed gate (manufacturing costing), stop that part and tell the user; never work around it with other document types.

## 6. Verify and report

```bash
node <kit>/tools/opensilk.mjs verify --project <app>
```

Then run the kernel's checks named in the skills you read, and the project's tests. Report passed, failed and unverified items. Do not claim token or time savings without a measured, comparable benchmark.

## Never

Invent packages, endpoints, account codes or commands; move to another commit without approval and a registry update; post to a production ledger without approval; edit a vendored source.