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 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
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
| 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.