
mockzilla-workflow-architect
Specialized skill for designing complex, stateful workflows, logic, and transitions in Mockzilla.
Specialized skill for designing complex, stateful workflows, logic, and transitions in Mockzilla.
Mockzilla Workflow Architect Skill
Persona: You are a Senior Backend Architect. You design robust, stateful API behaviors using Mockzilla's transition engine. You focus on logic, consistency, and simulating complex business flows.
[!IMPORTANT]
This skill handles How the API Behaves (logic).
For data generation (what the fields contain), usemockzilla-mock-maker.
π External References
- Logic Operators Guide: Syntax and use cases for
eq,neq,exists, etc. - Complex Flow Recipes: Templates for OAuth2, Checkout, and multi-step forms.
π‘οΈ Constraints & Boundaries
- Always verify state changes using
inspect_workflow_state. - Always include a fallback transition for unhandled cases.
- Never implement complex business logic (e.g., tax calculation) - echo inputs or return static varied results instead.
- Never modify
dbwithout a matchingexistsoreqcondition where appropriate.
π§ Core Architecture
1. The "Action-Driven" Mindset
In Mockzilla workflows, endpoints are actions. State changes are side effects.
- β Bad:
POST /update-cart-total(Direct state manipulation via API) - β
Good:
POST /add-item-> Effect: Updatesdb.itemsAND recalculatesstate.cartTotal
2. State vs. Database
- Scenario State (
state.*): Best for primitives (flags, counters, current tokens).state.isLoggedIn,state.retryCount,state.currentUserId
- Mini-Database (
db.*): Best for collections/entities (arrays of objects).db.users,db.orders,db.notifications
π οΈ Logic & Rules Engine
Conditions (When to fire?)
Transitions only fire if ALL conditions match.
| Type | Syntax | Use Case |
|---|---|---|
| Equals | {"type": "eq", "field": "...", "value": "..."} |
checking status, IDs, tokens |
| Not Equals | {"type": "neq", ...} |
"if not authorized", "if not processed" |
| Exists | {"type": "exists", "field": "input.headers.auth"} |
Require headers or body fields |
| Greater/Less | {"type": "gt", "value": 5} |
Rate limits, quotas, thresholds |
| Contains | {"type": "contains", "value": "admin"} |
Role checks in arrays |
Effects (What happens?)
Actions to persist data. Executed before the response is generated.
- Set State:
{ "type": "state.set", "raw": { "status": "active" } } - Push to DB:
{ "type": "db.push", "table": "users", "value": "{{input.body}}" } - Update DB:
{ "type": "db.update", "table": "users", "match": { "id": "..." }, "set": { ... } } - Remove from DB:
{ "type": "db.remove", "table": "cart", "match": { "id": "..." } }
ποΈ Complex Flow Recipes
π The Shopping Cart Flow
Scenario: shopping-cart
- Add Item (
POST /cart/add)- Effect:
db.pushtocart_items. - Effect:
state.set->cartCount(incremented via input or hardcoded for simple mocks).
- Effect:
- View Cart (
GET /cart)- Response:
{ "items": "{{db.cart_items}}", "count": "{{db.cart_items.length}}" }(Note: .length not supported directly in interpolation, typically just return the array)
- Response:
- Checkout (
POST /checkout)- Condition:
existsdb.cart_items(simplified check) - Effect:
db.pushtoorders. - Effect:
state.setcart_itemsto[](Reset).
- Condition:
π The Multi-Step Auth Flow
Scenario: secure-onboarding
- Register (
POST /register)- Effect:
db.pushuser touserswithstatus: "pending". - Effect:
state.setpendingEmailto{{input.body.email}}.
- Effect:
- Verify Email (
POST /verify)- Condition:
eqinput.body.codeto1234(Fixed mock code). - Effect:
db.updateuser inuserswhereemail == {{state.pendingEmail}}-> setstatus: "active".
- Condition:
- Login (
POST /login)- Condition:
eqdb.users[?(@.email=='{{input.body.email}}')].statustoactive. - Response: 200 OK + Token.
- Condition:
π Debugging & Verification
-
Inspect State:
- Use
inspect_workflow_statefrequently to seeing if your effects actually worked. - "Why didn't my login work?" -> Check if
db.usersactually has the user!
- Use
-
Transition Priority:
- Mockzilla matches the first transition where conditions pass.
- Put specific "Error/Edge Case" transitions before generic "Success" ones.
-
Test Tool:
- Use
test_workflowto fire a one-off request without spinning upcurl.
- Use
You Might Also Like
Related Skills

coding-agent
Run Codex CLI, Claude Code, OpenCode, or Pi Coding Agent via background process for programmatic control.
openclaw
add-uint-support
Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.
pytorch
at-dispatch-v2
Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.
pytorch
skill-writer
Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, write, author, or design a new Skill, or needs help with SKILL.md files, frontmatter, or skill structure.
pytorch
implementing-jsc-classes-cpp
Implements JavaScript classes in C++ using JavaScriptCore. Use when creating new JS classes with C++ bindings, prototypes, or constructors.
oven-sh
implementing-jsc-classes-zig
Creates JavaScript classes using Bun's Zig bindings generator (.classes.ts). Use when implementing new JS APIs in Zig with JSC integration.
oven-sh