What problem does it solve?
Changing deployment policy in a Mastra Factory setup requires editing typed rule configuration safely, without breaking sibling handlers, weakening tests, or leaking trusted server logic into browser code.
Core Features & Use Cases
- Locate rule configuration: Find
new MastraFactory, defaultFactoryRules, and the rules property without guessing file paths.
- Apply exact-leaf overrides: Replace a single handler leaf (e.g.,
work.<stage>.<source>.onEnter) while leaving sibling leaves and built-in behavior intact.
- Enforce safety constraints: Keep handlers within the five-second evaluation budget, use stable idempotency keys, and return typed
FactoryRuleDecision values.
- Use Case: A deployment needs to reject work-stage transitions from untrusted GitHub actors. The skill guides reading the built-in handler in
src/web/factory/rules/defaults.ts, replacing only that leaf, bumping the deployment-owned version, and running focused rule tests plus typecheck.
Quick Start
Ask the assistant to update the Factory rules configuration to override a specific rule leaf and verify the change with the narrow Factory rule tests.