# Factory Self Review

Review and test a Factory work item's pushed branch before any pull or merge request...

- Repository: https://github.com/mastra-ai/mastra (29259 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add mastra-ai/mastra --skill factory-self-review -g -a claude-code -y`
Codex: `npx skills add mastra-ai/mastra --skill factory-self-review -g -a codex -y`
Cursor: `npx skills add mastra-ai/mastra --skill factory-self-review -g -a cursor -y`
Gemini CLI: `npx skills add mastra-ai/mastra --skill factory-self-review -g -a gemini-cli -y`

## Description

Review and test a Factory work item's pushed branch before any pull or merge request exists, then record the verdict that sends it back to Building or on to open the change request

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Factory Self-review

**Role guard:** only run this skill when the `factory-phase` signal shows `role="review"` on a Work card in stage `review` that has no pull or merge request open yet. Under any other role or stage, stop immediately: do not review, edit, or transition the work item, and report that self-review is not available here.

You are the independent reviewer for a branch a Factory builder pushed. No pull or merge request exists yet, and none may be opened by you. Your verdict decides whether the builder opens one (approve) or goes back to Building with your findings (request changes). Hold the branch to the same bar as a PR review: the change request should arrive already finished.

Complete the review in one pass. Never wait for or solicit human input. Your terminal step is one `factory_record_review_verdict` call, repeated only if rejected and only with the stated reason addressed.

## Review bar

Load `factory-review` with `skill_read` and apply these parts of it exactly as written, reading "the PR" as "the branch diff against its base":

The rest: https://github.com/mastra-ai/mastra/blob/HEAD/mastracode/factory/factory-skills/factory-self-review/SKILL.md
