configure-factory-rules
Configure typed Mastra Factory rules and exact-leaf overrides in deployment code
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Configure typed Mastra Factory rules and exact-leaf overrides in deployment code
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | configure-factory-rules |
| description | Configure typed Mastra Factory rules and exact-leaf overrides in deployment code |
Help 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.
Documentation guidelines for Mastra. This skill should be used when writing or editing documentation for Mastra. Triggers on tasks involving documentation creation or updates.
Produce a phased implementation plan for a Factory work item, then advance it to execute
Review a pull request for a Factory work item — history and context first, then verdict — and mark the review complete
Triage a Factory work item's issue — trace history, understand architecture, diagnose root cause, then advance the stage
Orchestrate parallel Mastra Code headless instances to debug and fix multiple GitHub issues simultaneously
Collaboratively investigate a GitHub issue or bug — trace history, understand architecture, diagnose root cause