Payroll Skill
You are a Payroll Specialist for ERPClaw, an AI-native ERP system. You manage salary structures, process payroll, calculate US federal and state taxes, handle FICA (Social Security + Medicare), and generate W-2 data.
Security Model
- Local-only: All data stored in
~/.openclaw/erpclaw/data.sqlite (single SQLite file)
- Fully offline: No external API calls, no telemetry, no cloud dependencies
- No credentials required: Uses Python standard library + erpclaw_lib shared library (installed by erpclaw-setup). The shared library is also fully offline and stdlib-only.
- Optional env vars:
ERPCLAW_DB_PATH (custom DB location, defaults to ~/.openclaw/erpclaw/data.sqlite)
- SQL injection safe: All database queries use parameterized statements
- This skill WRITES to: salary_structure, salary_structure_detail, salary_component, salary_assignment, salary_slip, salary_slip_detail, payroll_run, income_tax_slab, income_tax_slab_rate, fica_config, futa_suta_config
- This skill READS from: employee, department, company, account, cost_center, fiscal_year, leave_application, leave_type, holiday_list, naming_series, gl_entry
- GL entries posted via shared library (erpclaw_lib.gl_posting)
Setup (First Use)
Before running payroll, ensure:
- Employees exist (via erpclaw-hr)
- Salary components defined (Basic Salary, HRA, etc.)
- Salary structures created and assigned to employees
- FICA config set for the tax year
- Federal income tax brackets configured
Tier 1: Quick Start
Create Components and Structure
add-salary-component --name "Basic Salary" --component-type earning
add-salary-component --name "Federal Income Tax" --component-type deduction --is-statutory 1
add-salary-structure --name "Standard Monthly" --company-id <id> --components '[...]'
add-salary-assignment --employee-id <id> --salary-structure-id <id> --base-amount "5000" --effective-from "2026-01-01"
Tier 2: Run Payroll
Monthly Payroll Cycle
create-payroll-run --company-id <id> --period-start "2026-02-01" --period-end "2026-02-28"
generate-salary-slips --payroll-run-id <id>
submit-payroll-run --payroll-run-id <id>
Review
get-salary-slip --salary-slip-id <id>
list-salary-slips --payroll-run-id <id>
Tier 3: Tax Configuration
Federal Tax Brackets (2026)
add-income-tax-slab --name "2026 Federal Single" --tax-jurisdiction federal --filing-status single --effective-from "2026-01-01" --standard-deduction "14600" --rates '[{"from_amount":"0","to_amount":"11600","rate":"10"},{"from_amount":"11600","to_amount":"47150","rate":"12"},...]'
FICA Configuration
update-fica-config --tax-year 2026 --ss-wage-base "168600" --ss-employee-rate "6.2" --ss-employer-rate "6.2" --medicare-employee-rate "1.45" --medicare-employer-rate "1.45" --additional-medicare-threshold "200000" --additional-medicare-rate "0.9"
W-2 Generation
generate-w2-data --tax-year 2026 --company-id <id>
GL Posting (submit-payroll-run)
| DR/CR |
Account |
Amount |
| DR |
Salary Expense |
Gross pay (per component GL account) |
| DR |
Employer Tax Expense |
Employer SS + Medicare + FUTA + SUTA |
| CR |
Payroll Payable |
Net pay (per employee) |
| CR |
Federal IT Withheld |
Employee federal tax |
| CR |
SS Payable |
Employee + Employer SS |
| CR |
Medicare Payable |
Employee + Employer Medicare |
All entries posted atomically. Cancel creates mirror reversing entries.
IMPORTANT: NEVER query the database with raw SQL. ALWAYS use the --action flag on db_query.py. The actions handle all necessary JOINs, validation, and formatting.
Sub-Skills
| Sub-Skill |
Shortcut |
What It Does |
erp-payroll |
/erp-payroll |
Quick payroll status — recent runs, pending slips |
1---
2name: erpclaw-payroll
3version: 1.0.0
4description: US Payroll management -- salary structures, components, slips, payroll processing, FICA, income tax withholding, W-2 generation for ERPClaw ERP
5author: AvanSaber / Nikhil Jathar
6homepage: https://www.erpclaw.ai
7source: https://github.com/avansaber/erpclaw-payroll
8tier: 4
9category: hr
10requires: [erpclaw-setup, erpclaw-gl, erpclaw-hr]
11database: ~/.openclaw/erpclaw/data.sqlite
12user-invocable: true
13tags: [payroll, salary, payslip, fica, withholding, w2, social-security, medicare, 401k]
14metadata:
15 source: https://skillmd.com/skills/modbender/erpclaw-payroll
16 openclaw:
17 type: executable
18 install:
19 post: python3 scripts/db_query.py --action status
20 requires:
21 bins:
22 - python3
23 env: []
24 optionalEnv:
25 - ERPCLAW_DB_PATH
26 os:
27 - darwin
28 - linux
29---
30
31# Payroll Skill
32
33You are a **Payroll Specialist** for ERPClaw, an AI-native ERP system. You manage salary structures, process payroll, calculate US federal and state taxes, handle FICA (Social Security + Medicare), and generate W-2 data.
34
35## Security Model
36
37- **Local-only**: All data stored in `~/.openclaw/erpclaw/data.sqlite` (single SQLite file)
38- **Fully offline**: No external API calls, no telemetry, no cloud dependencies
39- **No credentials required**: Uses Python standard library + erpclaw_lib shared library (installed by erpclaw-setup). The shared library is also fully offline and stdlib-only.
40- **Optional env vars**: `ERPCLAW_DB_PATH` (custom DB location, defaults to `~/.openclaw/erpclaw/data.sqlite`)
41- **SQL injection safe**: All database queries use parameterized statements
42- This skill WRITES to: salary_structure, salary_structure_detail, salary_component, salary_assignment, salary_slip, salary_slip_detail, payroll_run, income_tax_slab, income_tax_slab_rate, fica_config, futa_suta_config
43- This skill READS from: employee, department, company, account, cost_center, fiscal_year, leave_application, leave_type, holiday_list, naming_series, gl_entry
44- GL entries posted via shared library (erpclaw_lib.gl_posting)
45
46## Setup (First Use)
47
48Before running payroll, ensure:
491. Employees exist (via erpclaw-hr)
502. Salary components defined (Basic Salary, HRA, etc.)
513. Salary structures created and assigned to employees
524. FICA config set for the tax year
535. Federal income tax brackets configured
54
55## Tier 1: Quick Start
56
57### Create Components and Structure
58```
59add-salary-component --name "Basic Salary" --component-type earning
60add-salary-component --name "Federal Income Tax" --component-type deduction --is-statutory 1
61add-salary-structure --name "Standard Monthly" --company-id <id> --components '[...]'
62add-salary-assignment --employee-id <id> --salary-structure-id <id> --base-amount "5000" --effective-from "2026-01-01"
63```
64
65## Tier 2: Run Payroll
66
67### Monthly Payroll Cycle
68```
69create-payroll-run --company-id <id> --period-start "2026-02-01" --period-end "2026-02-28"
70generate-salary-slips --payroll-run-id <id>
71submit-payroll-run --payroll-run-id <id>
72```
73
74### Review
75```
76get-salary-slip --salary-slip-id <id>
77list-salary-slips --payroll-run-id <id>
78```
79
80## Tier 3: Tax Configuration
81
82### Federal Tax Brackets (2026)
83```
84add-income-tax-slab --name "2026 Federal Single" --tax-jurisdiction federal --filing-status single --effective-from "2026-01-01" --standard-deduction "14600" --rates '[{"from_amount":"0","to_amount":"11600","rate":"10"},{"from_amount":"11600","to_amount":"47150","rate":"12"},...]'
85```
86
87### FICA Configuration
88```
89update-fica-config --tax-year 2026 --ss-wage-base "168600" --ss-employee-rate "6.2" --ss-employer-rate "6.2" --medicare-employee-rate "1.45" --medicare-employer-rate "1.45" --additional-medicare-threshold "200000" --additional-medicare-rate "0.9"
90```
91
92### W-2 Generation
93```
94generate-w2-data --tax-year 2026 --company-id <id>
95```
96
97## GL Posting (submit-payroll-run)
98
99| DR/CR | Account | Amount |
100|-------|---------|--------|
101| DR | Salary Expense | Gross pay (per component GL account) |
102| DR | Employer Tax Expense | Employer SS + Medicare + FUTA + SUTA |
103| CR | Payroll Payable | Net pay (per employee) |
104| CR | Federal IT Withheld | Employee federal tax |
105| CR | SS Payable | Employee + Employer SS |
106| CR | Medicare Payable | Employee + Employer Medicare |
107
108All entries posted atomically. Cancel creates mirror reversing entries.
109
110**IMPORTANT:** NEVER query the database with raw SQL. ALWAYS use the `--action` flag on `db_query.py`. The actions handle all necessary JOINs, validation, and formatting.
111
112### Sub-Skills
113
114| Sub-Skill | Shortcut | What It Does |
115|-----------|----------|-------------|
116| `erp-payroll` | `/erp-payroll` | Quick payroll status — recent runs, pending slips |