/factory:release-managerfrom factory
Automates daily release management: branch cutting, risk review, status gates, merging, migrations, deploy verification, health monitoring, rollback, and reporting for factory products.
Ships in factory. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Automated daily release execution for factory products. Design: the factory repo's
docs/superpowers/specs/2026-11-03-release-manager-design.md; commands: README "Release manager".
The generic flow is below. Steps that differ per product (migration tool, deploy target, deploy
check, rollback command, extra allowed pushes, comms sender) come from the product's release guide:
RELEASE.md at the root of the product repo on main, read in Step 0. The factory flow needs no
RELEASE.md: its steps are in "Releasing the factory itself".
mode from factory --json release status <product>. In
shadow, cut the release branch, run the release-risk review, post the review comment and the
factory/review status, then stop and report shadow: stopped before merge.live.factory release status <product> --json before the merge, before
migrations and before the deploy. Stop if paused is true or hold is not null. If a gate trips
after the merge, record factory release record <product> held --note "<exact step to resume>",
post factory ask --project <project-id> --kind urgent naming that step, and stop; resume that
step when the owner messages the thread after resume/unhold.factory release record <product> started --pr N ... [--sha S] before cutting the branch;... shipped --pr N ... --sha <merge-sha> after a clean watch;... rolled-back --note "<issue url>" on rollback;... rollback-failed --note "<details>" if rollback fails;... held --pr N ... --note "<reason>" when holding PRs.factory/review status on the exact head commit:
gh api repos/<owner>/<repo>/statuses/<head-sha> -f state=success -f context=factory/review -f description="Release review clean, 1 round".main, staging or develop, and never force-push. Allowed
non-force pushes: the release branch, a revert branch, the merge of main back into develop
(Step 6 and Rollback step 3), and extra pushes the product's RELEASE.md lists, which may only
be non-force fast-forwards to develop or staging, never main.${CLAUDE_JOB_DIR:-/tmp}/tmp (or a temp dir),
never in a primary checkout. Remove it at cleanup. The factory's live checkout (~/factory-live
in the README) is touched only in "Releasing the factory itself".factory/review on the old head.baseSha only on ship-all. The release branch is cut from the plan's
Cut from: <baseSha> line (not origin/develop) only when the verdict is ship-all, which
means nothing is held. If any PR is held (no-release label, 10-PR cap, Friday filter,
cherry-pick conflict), the shape is cherry-pick or solo-red.factory ask takes --project <project-id>, read from the project field of
factory --json release status <product>.<date> in the plan header (Release manager (factory release plan, <date>):).<date> is not today in the release clock's time zone (factory/release.py), stop and
reply stale plan from <date>; waiting for today's run.factory --json release status <product>. If it is wait (or ship
is empty), stop with wait: <reasons>. Record nothing, cut nothing.factory: read RELEASE.md on the product's main. Missing: post
factory ask --project <project-id> --kind action asking the owner to add one, and stop.
Record nothing, cut nothing (a started with no end blocks the factory's own release all day).factory release record <product> started --pr <numbers...>.RELEASE.md (for example: staging migrations already applied).ship-all: every unreleased PR, cut from baseSha, then merge origin/main into it.solo-red: that one PR, cherry-picked onto origin/main (same recipe as cherry-pick).cherry-pick: new branch from origin/main, git cherry-pick -m 1 <merge sha> per approved
PR in mergedAt order. On a conflict: git cherry-pick --abort, drop the PR, record
factory release record <product> held --pr <num> --note "cherry-pick conflict", continue.
record shipped --pr lists only the PRs actually merged.main (release: develop → main (YYYY-MM-DD) or release: x.y.z).main:
ship-all: git diff --stat origin/develop is empty; cherry-pick: matches the picked commits.main (hotfixes merged straight to main).RELEASE.md is a release-risk item: list it in the review comment.factory/review status on the exact head commit (hard rule 5).shadow: stopped before merge and stop.RELEASE.md (for example: the migration tool is logged in). On
failure, factory ask --project <project-id> --kind urgent and stop before merging.gh pr merge <pr-number> -R <owner>/<repo> --merge --match-head-commit <head-sha>step 4 (migrations)).RELEASE.md says, and confirm they completed.factory ask --project <project-id> --kind urgent --title "Migration failed on <product>", and
record factory release record <product> held --note "migration failure".step 5 (deploy verification)).RELEASE.md says (for example: pods run image sha-<merge-sha-7>, or the
hosting provider's production deployment is ready and smoke routes return 200). The factory
itself: section "Releasing the factory itself" below.factory --json release watch <product> --minutes 30 (--minutes 60 for solo-red).factory release record <product> shipped --pr <numbers...> --sha <merge-sha>. After a
cherry-pick or solo-red release, merge main back into develop without force:
W=${CLAUDE_JOB_DIR:-/tmp}/tmp/dev-sync-$(date +%m%d)
git -C <repo> fetch -q origin develop
git -C <repo> worktree add --detach $W origin/develop
git -C $W merge --no-edit origin/main
git -C $W push origin HEAD:refs/heads/develop
git -C <repo> worktree remove --force $W
kind (http or signal) from the JSON and roll back now (section "Rollback").factory ask --project <project-id> --kind urgent --title "Release watch failed configuration on <product>". Do not record shipped, do not roll back.factory update <project> --health on-track --agent <handle> "Shipped <product> release: PRs <numbers...> (SHA <merge-sha>)"The morning plan either appends a "Develop queue" section to the ship message or sends its own
message starting "Release manager (factory release queue". factory release queue-today <product> --json
always gives the current list.
shipped is recorded. On a
no-ship day, right away. Never Friday to Sunday. Never for the factory flow (it merges into
main). Shadow mode: report only. One queue run per product per day.paused or a hold is set.factory --json release queue-recheck <owner/repo#n>; exit 3 means skip it and note the reason.
Keep its head_sha: the only commit the gate checked.gh api repos/<owner>/<repo>/statuses/<head_sha> -f state=success -f context=factory/review -f description="Dependency batch: green CI, patch or minor".gh pr merge <n> -R <owner/repo> --merge --match-head-commit <head_sha>. Never --admin.factory release queue-done <owner/repo#n> merged.develop-fix =
make develop's CI green in a new PR. Agents never merge. Record each with
factory release queue-done <owner/repo#n> agent-sent --note "<task link>"
(develop fix: factory release queue-done <product> agent-sent --develop-fix --note "<task link>").gh api -X PATCH repos/<owner>/<repo>/pulls/<n> -f base=develop; gh pr edit fails on repos
with classic project cards) and close (gh pr close <n> --comment "Closed from the factory develop queue"),
then factory release queue-done <ref> retargeted|closed.asks_new is not empty, one factory ask --project <project-id> --kind action
listing those items (OK a feature, retarget, revive or close).For products registered with --comms-* flags.
shipped: factory comms changelog <product>. Write one plain-words line per
user-facing PR from its body (never beyond what the body says), in each of the product's
languages, into a JSON file and run factory comms copy <product>@<at> --file <copies.json>.factory comms due <product> --json. Nothing due: stop.
A big PR gets its own feature email, unless the product has --comms-feature-emails off: then it
waits for the Friday digest, and a feature job skipped by the owner also sends its PRs there.needs-edit or failed, then
factory comms draft <job> --file <draft.json>. A ready job is already approved: go to step 6.
The command refuses anything untrue: fix the draft, never the rule.
subject, each of sentences (with its audience),
caption and video.frames. Text comes only from the PR body; no numbers the PR does not state.--comms-langs and --comms-audiences."defer": {"<pr>": "YYYY-MM-DD"}; it comes back on its date.factory comms bundle <job> --with <job>...
first (an approved ready job also needs --revoke). The first job keeps every PR and needs a new
draft and approval; the others become bundled. Defer PRs before bundling, not after.video.frames, real product screens only. If the render fails:
factory comms video-failed <job>; after 2 h the job sends with a static card.needs-approval and opens one
inbox item. When the answer arrives, factory comms decide <job> send|edit|skip --ask dN, then
factory resolve dN. Never send a job that is not ready.factory comms check <job>. Exit 3 means do not send.RELEASE.md names: always a dry run, then a test send, then the real
send with the expected count, repeated while remaining > 0. stuck > 0: stop, never resend.
No RELEASE.md on the product's main, or no sender in it: factory ask --project <project-id> --kind action
and do not send. The test goes to the team inbox. A product's first live send waits for the owner's go on that
test (factory ask --project <project-id> --kind action).factory comms sent <job> --count <recipients the sender reported>, or
factory comms failed <job> --reason "..." when nothing went out (it stays due).factory --json release watch <product> --minutes 30 (60 for solo-red), as a BACKGROUND
command. The Bash background timeout must be at least window + 15 minutes (30 min: 2700000 ms;
60 min: 4500000 ms; max 7200000 ms). The harness notifies on exit: never sleep, never poll.
factory release check <product> (default every 300 s) and logs each sample to
$FACTORY_HOME/release-watch-<product>.log.http checks, and errors + business signal checks. A streak resets when its
group passes.http failures, or 2 consecutive signal failures. After the
window, at most 2 more samples; a check still failing then means rollback.When the watch exits 3:
RELEASE.md (for example: revert the
image-tag commit in the deploy repo, or promote the previous hosting deployment). Never touch the
database migration.factory release check <product>.main, then sync develop (every flow except factory, which has its own):
B=revert/release-$(date +%F)
W=${CLAUDE_JOB_DIR:-/tmp}/tmp/revert-$(date +%m%d)
git -C <repo> fetch -q origin main
git -C <repo> worktree add -b $B $W origin/main
git -C $W revert --no-commit -m 1 <release merge sha> || { echo "revert conflict: stop, urgent ask"; exit 1; } # cherry-pick flow: git -C $W revert --no-commit <shaN> ... <sha1>
# Keep migration files: the database keeps the migration, so main must keep the file.
M=$(git -C $W ls-tree -r --name-only HEAD | grep -E '(^|/)migrations/|^prisma/|^supabase/migrations/' || true)
[ -n "$M" ] && git -C $W checkout HEAD -- $M
git -C $W commit --no-edit -m "revert: release $(date +%F)"
git -C $W push origin $B
PUSHED_SHA=$(git -C $W rev-parse HEAD)
gh pr create -R <owner>/<repo> --base main --head $B --title "revert: release $(date +%F)" --body "Rollback release. Migration files are kept: the database keeps the migration."
git -C <repo> worktree remove --force $W
Give it the release-risk review, post factory/review on $PUSHED_SHA, merge with
--match-head-commit $PUSHED_SHA, then merge main back into develop (Step 6 recipe).
If RELEASE.md says the rollback turned off automatic production promotion, promote the revert
deployment once it is ready and its smoke routes (from RELEASE.md) pass, then run
factory release check <product>.factory ask --project <project-id> --kind urgent \
--title "Rollback on <product>: release failed watch" \
--context "Watch failed. Code rolled back to the previous version. Issue filed." \
--option a="Investigate root cause and review revert PR" --reco a
factory release record <product> rolled-back --pr <the release's PRs> --note "<issue url>".
Those PRs count as done; a reland is a new PR, unless the owner calls the rollback a false alarm:
after a cherry-pick or solo-red rollback, factory release reland <product> --pr <n>... puts them
back in the next plan; after a ship-all or factory rollback the revert reached the base branch, so
the reland is a PR that reverts the revert. rolled-back sets a 24-hour hold.factory release record <product> rollback-failed --note "<details>"
(this pauses the product) and post an urgent ask "CRITICAL: Rollback failed on ".factory release unhold <product> itself, only after the
revert PR is merged and develop synced (the CLI enforces 24 h).Code rollback cannot undo a migration, so schema changes must work with the code already running:
main still reads.factory release record <product> held --pr <num> --note "Migration drops/narrows column still read by main",
recut without that PR, and never post factory/review on the old head.--flow factory)The factory runs from a live checkout (~/factory-live in the README) and deploys main only:
steps 1 to 3 do not apply.
factory --json release status <each>
that no other release is in flight.shadow means stop before the deploy and report shadow: stopped before deploy.PREV_SHA=$(git -C ~/factory-live rev-parse HEAD); git -C ~/factory-live fetch -q origin;
NEW_SHA=<baseSha from the plan>.factory release record factory started --sha "$NEW_SHA" --note "prev=$PREV_SHA" (shell
variables do not survive between tool calls; the note keeps the previous SHA).git -C ~/factory-live checkout -q --detach "$NEW_SHA" (the verdict's baseSha, not origin/main).~/factory-live/bin/factory config set ..., then factory doctor.factory office install <file>; a failed Office
build does not block the release, say so in the report.~/factory-live/bin/factory build, stop the server (README), then ~/factory-live/deploy/watchdog.sh.~/factory-live/bin/factory cron sync installs the cron lines of deploy/crontab.txt (skip it when
factory cron --help fails: an older SHA). List its added, changed and removed lines in the report.
A failed sync does not roll back the deploy: post an urgent factory ask with its error.solo-red: use --minutes 60 and a background
timeout of 4500000 ms): it must not run the code it just deployed. Read the previous SHA from the
latest started note (prev=<sha>) in factory --json release status factory, then in ONE
background command:
W=${CLAUDE_JOB_DIR:-/tmp}/tmp/factory-prev-<prev-sha>; git -C <dev clone> fetch origin <prev-sha> && git -C <dev clone> worktree add --detach $W <prev-sha> && FACTORY_HOME=~/.factory python3 $W/bin/factory --json release watch factory --minutes <30, or 60 on solo-red>; rc=$?; git -C <dev clone> worktree remove --force $W; exit $rc
Exit 0: factory release record factory shipped --sha <new-sha>. Exit 1: record held --sha <new-sha> --note "watch could not run: <error>", urgent ask, no rollback. Other: urgent ask, no rollback.lastStarted.note (prev=<sha>). Empty: stop and post an urgent ask
"Factory rollback aborted: prev SHA missing".git -C ~/factory-live checkout -q --detach <prev-sha>, build, stop the server, run the watchdog,
then ~/factory-live/bin/factory cron sync when that SHA has it (it puts back that SHA's cron
lines; name them in the urgent ask).
Then do generic Rollback steps 2, 4 and 5: factory release check factory, file the issue,
post the urgent "Rollback on factory" ask.main so the next run does not redeploy the bad commits (the reverse diff works
across merges and keeps later commits). <new-sha> is lastStarted.sha:
NEW=<new-sha>; PREV=<prev-sha>
[ -n "$NEW" ] && [ -n "$PREV" ] || { echo "missing sha: stop, urgent ask"; exit 1; }
B=revert/factory-release-$(date +%F)
W=${CLAUDE_JOB_DIR:-/tmp}/tmp/factory-revert-$(date +%m%d)
git -C <dev clone> fetch -q origin main
git -C <dev clone> worktree add -b $B $W origin/main
git -C $W diff $NEW $PREV | git -C $W apply --index --3way || { echo "apply conflict: stop, urgent ask"; exit 1; }
git -C $W commit -m "revert: factory release $(date +%F) ($PREV..$NEW)"
git -C $W push origin $B
gh pr create -R <owner>/<factory repo> --base main --head $B --title "revert: factory release $(date +%F)" --body "Rollback of $PREV..$NEW"
git -C <dev clone> worktree remove --force $W
Release-risk review, factory/review on the pushed SHA, merge with --match-head-commit.factory release record factory rolled-back --pr <the release's PRs> --note "<issue url>".record factory rollback-failed and an urgent ask; the dashboard may be down, so
also tell the owner through whatever channel they gave you outside the factory.RELEASE.md holds (one per product repo)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub artguru-tech-team/factory-oss --plugin factory4 skills in this plugin
/factoryUse in every agent session that works on a planned project (a roadmap row, a build with phases, a metric loop, the bug lane), and whenever you need a decision from the owner. Keeps the factory dashboard true through the `factory` CLI: plan and progress, project updates, questions for the owner and their answers. Triggers: starting work on a roadmap row, a PR opened or merged, an experiment finished, 'ask the owner', 'I need a decision', 'update the dashboard', 'post an update', a blocker, 'delegate a task', 'which account or model runs this'./factory-policiesWorking policies for software factory builds and PRs. Use before building any feature (prototype-first policy) and before merging any PR (mandatory review loop and merge gate)./intakeUse when you sit in a team's WhatsApp or Telegram group and a teammate reports a bug: talk it through, then file it as an `intake` issue with `factory intake file`. Triggers: a bug report in the team chat, a teammate says 'it is broken', 'the app crashed', 'payments fail', someone pastes a recording link, 'file this', 'open a ticket for this'.Other plugins' skills for the same job