Commands run for you

The commands skills, hooks, and workflows run, not you. They are listed so nothing the factory does is hidden. The commands a person runs are in Commands.

Tickets

Skills call these to read or change a ticket. Every one goes through one interface, which is what lets another ticket system be added later: Developing explains it. Each exits non-zero with the error when it cannot reach the ticket system: a failed read is never an empty answer. view and list take --json, which prints what the ticket system returned as one JSON value. edit, comment, and open refuse a body with a bare tag-like <word> the ticket system would swallow, name it, and post nothing.

N is the ticket's key as your ticket system writes it, such as 12 (GitHub Issues says how it writes one).

Command What it does
factory ticket view N Prints ticket N: its title, state, labels, body, and comments with their IDs and authors. A label you renamed shows its key beside it
factory ticket answers N Prints each comment on N that counts as an answer: its author can write to the repository, and it is not the factory's own. Says so when there is none
factory ticket view N --field NAME Prints one of title, state, labels (one per line), body, or ref, how the ticket system writes N in prose, such as #12, and nothing else
factory ticket list Lists the open tickets: key, title, and labels, separated by tabs
factory ticket list --label LABEL Only those with the label. --title "TITLE" keeps those whose title is exactly that
factory ticket edit N [--title TITLE] [--body-file FILE] Replaces N's title, its body, or both. --attach FILE adds an image to a body
factory ticket comment N --body-file FILE Comments on N and prints the comment's ID. --attach FILE adds an image
factory ticket open --title TITLE --body-file FILE Opens a ticket with the factory label and prints its key. --label LABEL adds another
factory ticket label N --add LABEL Adds a label to N. --remove LABEL takes one off
factory ticket label N --was-removed LABEL Prints yes if the label was ever removed from N, otherwise no
factory ticket link N Prints the text that makes a merged pull request close N, such as "Closes #12". --part prints the text that says it builds part of N, such as "Part of #4"
factory ticket branch N Prints the branch a build of N pushes, from code-host.branch-name, such as 12 or feature/octocat/12. Exits 1 when N does not exist, or the pattern has {user} and gh is not signed in
factory ticket blockers N One line per ticket N waits on: the ticket, as its system writes it, and whether it is open
factory ticket block N --by M Records that N waits on M
factory ticket unblock N --by M Removes that record
factory ticket repositories N Prints the repositories N names, each ✓ set up or ✗ with what to do, or the one line that says where N builds. Exits 1 with a ✗
factory ticket repositories N --set REPO... Records them on N, with who did. --add REPO... adds to them, and --after LATER=EARLIER after either says which merges after which. Exits 1, and records nothing, when one is not found, has another owner, or can't be written to, or the order goes in a circle (A ticket across repositories)
factory workspace N Clones each other repository N names under ~/.local/share/software-factory/work/, on N's branch, and prints where each is. Prints one line where N names no other. In the cloud, prints what the session was handed. Exits 1 when one can't be cloned
factory workspace N --remove Removes those clones. Keeps one with work that is not pushed, says so, and exits 1
factory ticket supports GROUP Prints yes or no for board, blockers, label-history, or attachments
factory ticket claim N Claims ticket N for this session. Prints claimed, held by, or blocked by. Adds the factory label first when N lacks it, and says so
factory ticket adopt N... Adds the factory label to each ticket named. --all-open labels every open ticket instead, and --since-lock FILE labels only when FILE, the .claude/factory.lock an update replaces, has no tickets.labels.factory. Prints each it labeled, then how many carry it
factory ticket still-live N Says whether this session still holds N
factory ticket stop N "reason" Releases N and says why
factory ticket end N A run's last step: releases this session's claim if no open pull request links N. Prints released, kept, or not live
factory ticket refining N Marks N as being refined. Adds the factory label first when N lacks it, and says so
factory ticket waiting N Marks N as waiting on your reply to a round of questions
factory ticket refined N Marks N as refined, unless its body lacks what a build reads. --check makes that check alone and posts nothing
factory ticket ready N Moves N to Ready. Only when you ask a session to. Adds the factory label first when N lacks it, and says so
factory ticket cost N Notes what this session has spent on ticket N so far
factory follow-up "TITLE" "WHAT IS WRONG" Lists a follow-up, its box empty, in this branch's open pull request. At most three. Refuses one that links a ticket, or has a bare tag-like <word>
factory pr follow-ups --event FILE Opens a ticket for each follow-up that was ticked when the pull request in FILE, the event the code host sent, merged, and that has none yet

A command that records something on a ticket, such as claim, refining, cost, open, or adopt, then starts the board sync, so the board follows it. When it cannot start it, it says so on a line of its own and still exits 0, and the nightly sync catches up:

? the board updates at the nightly sync: couldn't start the board sync (HTTP 403: Resource not accessible by integration)

factory ticket refined N posts nothing and exits 1 when N's body lacks a section a build reads, printing one line for each, such as missing: ## Acceptance criteria. With --check it prints sound for a body that passes. Your own skills and agents lists the sections.

Pull requests

Pull requests stay on the code host whatever the ticket system. A pull request's conversation comments and labels go through these, never the ticket system.

Command What it does
factory pr state [N] What stands between N and a merge: checks, review, threads, conflict
factory pr threads N The unresolved review threads, each with its comments. --all lists the resolved ones too
factory pr reply N COMMENT --body-file FILE Replies on a thread
factory pr resolve N COMMENT Resolves a thread
factory pr closes N The tickets N closes, by key
factory pr cost N Notes what this session spent on pull request N since it started
factory pr for-branch BRANCH The newest pull request from BRANCH, open or not: #N open, #N merged, or #N closed, or none when there has been none
factory pr wait-checks N Waits for every CI run on the pushed commit. Prints success, failure: with the failed checks, or no checks
factory pr ready N Marks a draft ready for review. When commit.gpgsign is true, refuses while the code host shows a commit as not verified
factory pr comments N N's conversation comments: ID, author, time, and first line. --author LOGIN, --contains TEXT, --from-approvers, which keeps the comments whose author can write to the repository, and --json, which prints each comment's id, user.login, body, and created_at
factory pr comment N --body-file FILE Posts a conversation comment and prints its ID. Refuses a bare tag-like <word>, as ticket comment does
factory pr comment-view ID Prints one conversation comment's body
factory pr label N --add LABEL Adds a label to N. --remove LABEL takes one off
factory pr watch N Waits until N needs attention, says why, and exits
factory pr watch N --release Stops watching N
factory pr review-pending N REVIEW Exits 0 when an approver's review has something of theirs to answer, and 1, saying why, when it has not
factory pr conflicts The pull requests the conflict sweep takes, one number a line; exits 0 when there is one and 1 when none
factory pr open --title TITLE --body-file FILE Opens a draft pull request from the current branch into the default branch and prints its number. --base BRANCH names another base, and --ready opens it ready for review. Fails in the code host's own words when the branch has nothing new or already has one open
factory pr view N --field FIELD Prints one field of N: head (its last commit, in full), branch, base, title, body, state, or mergeable (dirty for a conflict, unknown until the code host has worked it out)
factory pr review N REVIEW One review as JSON: its author, its body, and each comment it left on a line, with the comment a reply replies to
factory pr push Pushes this branch, or, in a session in the cloud, hands its commits over to be checked and pushed. Never the default branch
factory pr pull Merges the remote's commits on this branch. A session in the cloud already has the newest there were when it started
factory pr unverified N Each of N's commits the code host does not show as signed, with the reason. Prints nothing when it shows them all
factory pr uncovered [BASE] [LCOV] The lines the branch added or changed that the coverage report shows no test covers, a file at a time: MISS for a line no test ran, and PART for a line that ran with a branch never taken. BASE is what the branch is compared with, and is the default branch on your repository's remote, usually origin, when left out. LCOV is the report, and is coverage/lcov.info when left out. Prints nothing when every such line is covered
factory pr failed N For N's last commit, the failures wait-checks counts: each failed job's name and the last 200 lines of its log, from the newest run of each workflow started by a push or a pull request, and what a check that did not pass wrote about itself. Prints nothing when nothing failed
factory pr review-again N Asks for a fresh review of N's last commit. Exits 1, saying so, when no review has run on it
factory deps The open dependency pull requests, their checks, and what each needs
factory deps --any Exits 0 when a dependency pull request is open and 1 when none is

factory pr wait-checks N waits until the code host shows the commit you pushed as N's head, then until the newest run of each CI job started by that push or pull request has finished. It leaves out the factory's own jobs, so a failed board sync does not stop a pull request being marked ready. With no run two minutes after the commit became the head, it prints no checks and exits 0. A failure exits 3.

In a session in the cloud, these and the ticket commands work from what was handed over: a read answers from it, a write prints Asked: and is done after the session ends, and pr wait-checks, pr watch, and pr state --wait say that the run ends there (What a cloud run is).

Where pr-review is off, no automated review runs. factory pr state N then prints Claude review: none expected on this head, and factory pr state N --wait and factory pr watch N wait for none.

Workflows and hooks

Command Run by What it does State
factory board collect The board sync's job Reads the tickets and posts the comments a closed pull request or the nightly run needs Built
factory board apply The board sync's job Sets each ticket's column and fields from its comments Built
factory board --dry-run You, to see what it would set Reads the tickets and the board, prints what the sync would set, and writes nothing Built
factory merge-policy N The job that says who merges Decides whether N may merge without you, and why Built
factory review verdict The job that records the review's verdict Posts the "Review verdict" status for an event of a pull request. A review's own run posts it too, as it ends Built
factory approval-policies prepare DIR The approval policies' first job Reads a pull request's change from git, writes each policy's input, and posts the status of a draft, a change it can't read, or one no policy applies to Built
factory approval-policies commands DIR The job that runs the policies' commands, with no token Runs each policy's command on its input Built
factory approval-policies agent DIR I A job of its own for each policy's agent Runs policy I's agent, with tools that only read, on its input and what its command found Built
factory approval-policies status DIR The approval policies' last job Posts the "Approval policies" status and lists each finding in the run's summary Built
factory approval-policies kept NAME The approval policies' jobs Prints the run that kept the artifact NAME, when it is a run of the factory's own workflow started by a pull request's event Built
factory approval-policies approve DIR The job that runs when policy-override is added, or a review approves Approves what waited on the commit the label was added on, or takes the label off and says why Built
factory poller Your server Starts a build for each Ready ticket. See Builds Built
factory poller --once The poller's job One pass of the poller, with the board and Ready column from your settings Built
factory poller --once --preset FILE The poller's job in an organization's factory-config repository One pass for an organization: reads the board and Ready column from the preset FILE, and starts the builds of every repository with a ticket in Ready (The poller) Built
factory session ready KIND ID [REVIEW] Prepare, the first job of each cloud run Decides whether the session runs. KIND is build, review, answer, conflict, or dependency, and ID is a ticket's key for a build and a pull request's number for any other. It looks for work first, then for the build token, which the key of an organization's App counts as and a review does not need, and the coding agent's credential, as With a part off says Built
factory session prepare KIND ID Prepare Claims the ticket of a build, and writes the files the session works from: the default branch, the branch it works on, and what its factory commands may read. Ends the run, saying why, when there is nothing to hand over Built
factory session run Session, the second job Lays those files out, runs the coding agent in its sandbox, and keeps the commits, the requests, and a review's answer Built
factory session publish Publish, the last job Checks what the session left and does it: pushes, opens the pull request, posts what was asked for, waits for CI, and marks a draft ready or starts the next answer. For a review, posts the threads, the summary, and the verdict Built
factory session next PULL A review's Publish Starts the next answer to a pull request a build in the cloud opened, or says on it that it waits for a person Built
factory session each conflict|dependency The jobs that look for conflicts and for a dependency bot's pull requests Starts one run for each pull request that conflicts, or that the dependency bot has open Built
factory session repositories A job that makes a token from an organization's App Prints the repositories that token is for, separated by commas: the run's own, and each of the same owner that holds a preset the lock names Built
factory sync --check --against COMMIT --public "Factory files in step", on a pull request Checks the factory's files, and each preset's pin against COMMIT's lock. With --public, a preset it can't read with no sign-in is named and passed, since the review's run checks it. Without, it fails Built
factory session token Prepare and Publish, in an organization Signs GitHub's command-line tool and git in with a token made from the organization's App, which lasts an hour. No session runs in a job that does this (Who a cloud session acts as) Built
factory enroll The job that requires the verdict, on a push to the default branch Makes "Review verdict", and "Approval policies" where the settings have an approval policy, required before a merge to the default branch, once the setup's pull request has merged, or says who does it by hand (The jobs) Built
factory update --pull-requests The update job, and the update job of an organization's factory-config Opens a pull request for a newer release of the factory, and one for each preset repository whose preset changed (Updating). In an organization's factory-config, it opens one that raises the version .github/workflows/factory-poller.yml names Built
factory guard A hook, before each command Runs every guard below on one Bash call Built
factory guard commit Within factory guard Blocks a commit on your default branch, a push to it, a force push, or a commit while a commands.before-commit command fails, or a gh command that adds verdict-override or policy-override Built
factory guard ticket-text Within factory guard Refuses ticket text with a bare <tag>, which the ticket system would swallow Built
factory guard credentials Within factory guard, and a hook before each file read, search, or listing Refuses a call that reads the credentials file, which only the factory's commands read. A message or a search that only mentions it goes through Built
factory reviewers start A hook, when an agent starts Records a reviewer's run on the ticket, for its cost Built
factory reviewers stop A hook, when an agent stops The same Built
factory session-start A hook, when a session starts Shows unfinished branches and each ticket's state Built

The board sync runs collect and apply as two steps, so the board's token reaches only the second. The board's number comes from tickets.board in your settings.

Edit this page on GitHub