fst-domain-invariants

Documents verified business invariants for timesheet, warehouse, payroll, and access control domains.

Updated May 5, 2026
One-click install
npx skills add https://github.com/nikegeorgian-stack/otgruzka-tovara --skill fst-domain-invariants-nikegeorgian-stack
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fst-domain-invariants
Source: https://github.com/nikegeorgian-stack/otgruzka-tovara/tree/main/.cursor/skills/fst-domain-invariants
Command: npx skills add https://github.com/nikegeorgian-stack/otgruzka-tovara --skill fst-domain-invariants-nikegeorgian-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents accidental violations of verified business rules when modifying the FiberCell FST codebase, such as mass data wipes, edits to closed accounting periods, or unauthorized timesheet mutations. ## Core Features & Use Cases - Domain Invariant Reference: Maps each business rule (month close, warehouse document posting, payroll calculation, role access) to its enforcing functions and source files. - Anti-Wipe Safeguards: Documents the assertNoMassStoreWipe thresholds protecting employees, timesheets, warehouse, finance, and audit data during SQL sync. - Mandatory Journaling Rules: Lists required audit APIs (appendAudit, appendWarehouseAudit, appendEmployeeJournal) that must accompany every mutation. - Use Case: Before changing warehouse document logic, consult this Skill to confirm that postWarehouseDocument validation, status transitions, and audit logging invariants remain intact. ## Quick Start Ask the AI to review your planned changes against the fst-domain-invariants rules before modifying timesheet, warehouse, or payroll logic.

Frequently Asked Questions about fst-domain-invariants

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely modify timesheet logic without breaking business rules?▼

Check the invariants mapped to `commitTimesheetDraft`, `voidTimesheetEntry`, and `canMutateTimesheet` before editing. Any change must preserve draft batch commits, document voiding, and actor permission checks defined in `timesheetGuard.ts`.

What prevents mass data wipes during SQL sync?▼

The `assertNoMassStoreWipe` function in `src/lib/cloud/refuseStoreWipe.ts` refuses bulk deletions across employees, timesheet cells, warehouse, finance, and audit collections before cloud save. Thresholds are defined per domain and must not be bypassed.

Can I edit records after a month is closed?▼

No. `isMonthClosed` and `isMonthWriteLocked` in `src/lib/monthManage.ts` block writes to closed months, and warehouse periods are guarded by `isWarehousePeriodClosed`. Finance operations check these guards in `financeSlice.ts`.

Is audit logging required for every data mutation?▼

Yes. Mutations must call `appendAudit` for the global audit ring, `appendWarehouseAudit` for warehouse changes, or `appendEmployeeJournal` for HR actions. Skipping journal writes violates the domain invariants.

What are the limitations of this invariant reference?▼

It documents rules at a high level and links to enforcing code rather than executing validation itself. Detailed payroll rules live in the `fst-payroll-georgia` skill, and architecture details are in `docs/ARCHITECTURE.md`.