Build on OpenClaw
ERPClaw is a modular skill suite on the OpenClaw platform. Every module is an independent skill with a Python script and a SKILL.md manifest, with its tests kept alongside the code.
Architecture
Six layers, top to bottom. Every request flows through the same path.
Telegram / WhatsApp / Discord / Web UI
Users interact through any messaging platform or the Webclaw browser dashboard. Natural language in, structured results out.
OpenClaw (AI Router)
The AI runtime reads SKILL.md manifests, maps user intent to skill actions, and formats JSON responses into human-readable output.
SKILL.md (Manifest)
A Markdown manifest with YAML frontmatter that describes the skill's name, version, actions, parameters, and tiers of detail for the agent.
ERPClaw OS
The self-improving engine. Constitutional framework, module generation, semantic correctness, and gap detection. Governs all changes to the system.
db_query.py --action {name}
A single Python script per skill. Every action is routed through the --action flag. Output is always JSON to stdout. PyPika query builder for DB portability.
SQLite or PostgreSQL
All modules share one database. SQLite (default) or PostgreSQL (enterprise). WAL mode, foreign keys enforced, PyPika abstraction layer for DB-agnostic queries.
Skill API Quick Reference
Every skill follows the same two-file pattern: a SKILL.md manifest and a db_query.py script.
SKILL.md Format
name: erpclaw-selling
version: "1.0.0"
description: Sales orders, invoices, delivery notes
author: AvanSaber Inc.
scripts:
- name: db_query.py
description: Sales management
arguments:
- name: action
description: Action to execute
required: true
actions:
- name: add-customer
description: Create a new customer
tier: 1
- name: list-customers
description: List all customers
tier: 1Action Interface
# Every action follows the same pattern:
python3 db_query.py --action add-customer \
--company-id "$COMPANY_ID" \
--name "Acme Corp" \
--customer-type company \
--credit-limit 50000
# Output is always JSON:
{
"customer_id": "abc-123-def",
"name": "Acme Corp",
"customer_type": "company",
"status": "ok"
}Database Schema
One schema in a single database. Every module has its own table namespace. SQLite (default) or PostgreSQL (enterprise).
| Module | Description |
|---|---|
| Core (setup, GL) | Companies, users, accounts, GL entries, periods |
| Financial (journals, payments, tax, reports) | Journal entries, payment allocation, tax rules |
| Supply Chain (inventory, selling, buying) | Items, warehouses, stock ledger, SO/PO/invoices |
| Manufacturing | BOMs, work orders, job cards, MRP |
| HR & Payroll | Employees, leave, attendance, salary, expenses |
| CRM & Support | Leads, opportunities, campaigns, issues, SLAs |
| Projects & Quality | Projects, tasks, timesheets, inspections |
| Assets & Billing | Fixed assets, depreciation, subscriptions, metering |
| AI & Analytics | KPIs, anomalies, forecasts, scores |
| All of it, one schema | A single database with WAL mode and indexes to match (SQLite or PostgreSQL) |
One module holds the pen for each table
Any ERPClaw module can read any table in the shared database, but each table has exactly one module allowed to write to it. The rule is called read-many, write-one, and it decides how quickly a bug gets found and how far a bad one can travel.
Picture a document that eleven people can edit. When something in it is wrong, you open the version history and start guessing who changed what. Many business systems end up working like that document without anyone choosing it.
In ERPClaw, when a sales invoice is wrong, there is one owner to look at, not every module that might have touched it. A module that needs something changed elsewhere asks the owning module through its published actions instead of writing the rows itself, and ledger entries have a single writer: the shared posting engine, which checks every entry before it lands. Industry and add-on modules are held to this in code, not by convention: a validator reads each module's database statements and fails any module that writes directly to a table it does not own. That also contains the damage. A defect in an industry module cannot quietly rewrite the sales ledger, because it never had write access there.
The longer version: one writer per table. The rule is enforced alongside the other ERPClaw OS constitutional articles, and it drew more interest than we expected when we presented the architecture at IEEE IRI 2026 (the four questions from that talk).
Quick Start
From zero to a working skill in three steps.
Clone & Install
Clone the foundation, initialize the database, and load demo data.
git clone https://github.com/avansaber/erpclaw
cd erpclaw
python3 scripts/db_query.py --action initialize-database
python3 scripts/db_query.py --action seed-demo-dataTest
Run a module's tests to verify everything works.
cd scripts/erpclaw-selling && python3 -m pytest tests -vDevelop
Create your own skill following the standard two-file pattern.
# Create a new skill
mkdir my-skill && cd my-skill
# Add SKILL.md + scripts/db_query.py
# Follow the action pattern: --action my-action --param valueReady to build?
Full source code, test suites, and documentation. Everything you need to extend ERPClaw or build your own OpenClaw skills. Prefer to drive it from the AI tools you already use? ERPClaw speaks MCP, built in.