Configure typed Mastra Factory rules and exact-leaf overrides in deployment code
62
72%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./mastracode/factory/factory-skills/configure-factory-rules/SKILL.mdHelp the user change Factory policy in the typed deployment configuration. Factory rules are trusted server code. Never place deployment policy in this skill, repository instructions, browser code, or a parallel actions system.
new MastraFactory, defaultFactoryRules, and the rules property.rules, start with defaultFactoryRules({ version, overrides }) and pass the result to MastraFactory.Do not guess a file path. Factory deployments can assemble MastraFactory from different entry points.
Use one rules tree:
work.<stage>.<source>.onEnter or onExitreview.<stage>.<source>.onEnter or onExittools.<toolName>.onResultgithub.<event>.onEventDo not create an actions config or execute authoritative policy in React. Each handler returns one typed FactoryRuleDecision or undefined.
Work and Review cards move independently. Never mirror their stages or mark Work Done only because a pull request merged.
An override replaces the exact handler leaf. It does not compose with the built-in handler at that leaf. Sibling leaves remain unchanged.
Before replacing a built-in leaf:
src/web/factory/rules/defaults.ts.undefined to allow the ingress with no decision, or return a typed rejection or bounded structured decision.idempotencyKey derived from immutable ingress identity.Set an explicit, deployment-owned version. Change it whenever rule behavior changes. The version identifies persisted evaluations and audit records; it must not be used as event identity or added to ingress deduplication keys.
write and admin are trusted; failures are untrusted.FactoryRuleDecision. Never mutate stage storage directly.undefined, accepted, and rejected paths when they apply.Do not weaken tests or bypass the transition service to make a policy work.
3b78ed9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.