status-machines

Validate status transitions against explicit maps and record audit entries.

59|14|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/vobase/vobase --skill status-machines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: status-machines
Source: https://github.com/vobase/vobase/tree/main/packages/cli/skills/status-machines
Command: npx skills add https://github.com/vobase/vobase --skill status-machines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Many business domains require strict lifecycle control for record statuses; unchecked or arbitrary status updates lead to data corruption, broken reports, and lost auditability. This Skill enforces explicit transition maps and server-side validation so handlers cannot perform invalid state jumps or trigger side effects before validation.

Core Features & Use Cases

  • Explicit transition maps: Keep allowed edges next to handlers so reviewers see permitted flows at a glance.
  • Server-side validation and error semantics: Reject invalid transitions with clear 422 responses and preserve the prior state.
  • Audit trail integration: Record old and new status and the actor for every accepted mutation to support accountability and debugging.
  • Use Cases: Invoices, purchase orders, payments, and shipments where transitions like draft → paid must be guarded and terminal states enforced.

Quick Start

Use the status-machines skill to validate and apply a status change for an invoice, rejecting invalid transitions and writing an audit entry.

Frequently Asked Questions about status-machines

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

FAQPage Schema
How do I prevent invalid status transitions for server-side business records?

To prevent invalid status transitions, you enforce explicit transition maps and server-side validation. This validates lifecycle state changes against permitted edges prior to mutation, rejecting invalid jumps with 422 responses.

What is the best way to validate invoice lifecycle state changes before applying updates?

Validating invoice lifecycle state changes requires checking the requested update against an explicit transition map. This ensures permitted flows like draft to paid are guarded and terminal states are enforced before the record mutation occurs.

How do I record old and new status values in an audit trail when a record is updated?

Recording old and new status values in an audit trail involves capturing the prior state and the actor for every accepted mutation. This supports accountability and debugging when status transitions are validated and applied.

Does server-side status validation work for purchase orders and payment workflows?

Server-side status validation works for purchase orders, payments, and shipments. It applies controlled lifecycle validation to these handlers, ensuring business records cannot perform invalid state jumps or trigger side effects before validation.

Why should I use explicit state-machine transitions instead of direct status updates?

Explicit state-machine transitions prevent arbitrary status updates that lead to data corruption and broken reports. Keeping allowed edges next to handlers lets reviewers see permitted flows at a glance and preserves prior state on rejection.

What HTTP error should my API return for an invalid status transition?

Your API should return a 422 response for an invalid status transition. This server-side validation error semantics rejects invalid jumps while preserving the prior state of the business record.