Skip to main content

modular-factory

CI Python 3.11+ License: GPL v3

A software factory you install into any repository. Label a GitHub issue. Agents decide whether it is worth building, write a spec, build it on a branch, and review it. By default a maintainer merges the pull request. A project can turn the merge step on so the factory merges it.

It runs inside the coding tool you already use: Claude Code, Cursor, or Codex. Everything a project changes lives in factory/: pipelines as YAML in factory/pipes/, and the rest in factory/factory.toml.

Documentation

The dashboard's board view: Jira boards, GitHub issues and the factory's jobs, all made up

Status: not yet run inside a real tool. Automated tests play the orchestrator and the agents against a stand-in for GitHub. Nobody has yet run a job end to end in Claude Code, Cursor, or Codex. Expect problems on the first real run. See what is untested.

Contents

Requirements

  • Python 3.11 or later
  • git
  • GitHub CLI gh, signed in (gh auth login)
  • One of Claude Code, Cursor, or Codex

The factory adds nothing to the project's dependencies. Pipelines need PyYAML. A uv tool or pipx install brings it. mfactory doctor checks for it.

Install

Install the mfactory command once:

uv tool install modular-factory

pipx install modular-factory is the same install. The install guide has both, and a script for a machine without either:

curl -fsSL https://raw.githubusercontent.com/danielsmag/modular-factory/master/install.sh | bash -s -- --global

Read the script before you pipe it to a shell.

Then, in each repository:

mfactory install --tool claude

Use --tool cursor or --tool codex instead, or repeat --tool for several. In your coding tool:

/mfactory setup

That reads the project and fills in factory/factory.toml: what the project is for, and the commands that install, lint, and test it. Commit factory/, .factory/, and the generated agent files to your base branch, and push.

To install straight into one repository, without the command on your PATH:

curl -fsSL https://raw.githubusercontent.com/danielsmag/modular-factory/master/install.sh | bash -s -- --tool claude

Use

In the tool What it does
/mfactory run Work through every issue labeled factory
/mfactory run 12 Run issue 12 now
/mfactory run 12 --pipe hotfix Run issue 12 on the named pipe
/mfactory approve 12 Answer a job that is waiting
/mfactory plan summary What needs attention, what is held, the last scan
/mfactory plan Talk through findings. Nothing changes until you say so
/mfactory plan <request> Manage issues: create, list, open, move, comment, close
/mfactory <anything else> Ask about jobs, or describe a feature to file as an issue

The same verbs work from a terminal: mfactory run, mfactory plan summary, mfactory plan approve F-3, mfactory issue list.

From /mfactory plan, or a terminal, you can also manage your own work on GitHub and Jira without starting a job: "create a test issue", "show my open Jira cards", "move PROJ-12 to In Progress", "comment on #34". These run mfactory issue list | show | create | comment | move | close. An issue you open through /mfactory goes in the factory's queue (issue create --queue) unless you call it a test or say it is not for the factory; mfactory issue create on its own stays out of the queue unless you pass --queue. A card with a running job is moved by step with mfactory move. Before changing an issue, the orchestrator runs mfactory issue guide and follows your own skills, plugin skills and rules for tickets ([skills].issues and [rules].issues, every one on the machine by default).

A job that needs a person stops and says so on the issue or the pull request. Answer there, for example /mfactory changes Use the existing Money type, or in your tool. Other jobs keep running.

Jobs can come from a Jira kanban board instead of, or as well as, GitHub issues. With kind = ["github", "jira"] both queues feed one project, and each job talks on its own tracker. See Tracker: a Jira board.

Pipeline

A pipeline is a pipe: YAML in factory/pipes/, checked against the JSON Schema in .factory/schema/pipe.schema.json. mfactory install writes factory/pipes/default.yaml. This is that default, printed by .factory/bin/mfactory graph:

intake           agent   ACCEPT -> spec | NEEDS-INFO -> ask-author (max 2) | REJECT -> rejected
ask-author       human   ANSWER -> intake | REJECT -> rejected
spec             agent   DONE -> spec-approval
spec-approval    human   off, continues as APPROVE -> build
build            agent   READY -> gate | BLOCKED -> escalated
gate             checks  PASS -> review | FAIL -> debug (max 2)
debug            agent   off, continues as FOUND -> build
review           review  PASS -> approve | CHANGES -> build (max 2)
approve          agent   APPROVE -> ready-to-merge | ESCALATE -> escalated
ready-to-merge   human   FEEDBACK -> build (max 3) | REJECT -> rejected
merge            merge   off, continues as MERGED -> ready-to-verify
ready-to-verify  human   off, continues as VERIFY -> verify
verify           verify  off, continues as PASS -> done
escalated        human   FEEDBACK -> build | REJECT -> rejected

The factory does not merge unless the project turns that step on. Spec approval, debug, a wait for deploy, and a check after merge ship switched off. Edit factory/pipes/default.yaml in place. A second file can extend default and change only what differs. A job keeps the pipe it starts with.

Recipes for merging, optional steps, your own steps, loop limits, several pipes, and a follow-up after merge are in the configuration reference.

mfactory pipes list
mfactory pipes validate
mfactory graph --pipe hotfix

mfactory migrate pipes moves old [steps.*] tables out of factory.toml. mfactory migrate layout moves a root factory.toml or a pipelines/ folder into factory/. mfactory doctor says when either is due.

Planner

Once several issues are open, the planner reads the queue across every project in the workspace. It reports what one job cannot see: duplicates, an issue that must wait for another, two issues that touch the same files, a low-priority job ahead of a critical one. It only suggests. Nothing in a tracker or a job changes until you approve a finding.

/mfactory plan summary scans when tickets changed, then reports plainly, with Needs attention first. In /mfactory plan you can ask about a finding. The orchestrator runs plan approve, plan dismiss, or plan release only when you say so, and shows what it will do first. Between queue passes, /mfactory run runs a due scan without holding up a job.

The dashboard badge counts open findings at or above alert_at. The Planner view (#/planner) lists each finding and the action it proposes. Browser notifications are opt-in. Settings are in Planner.

Dashboard

mfactory start dashboard
mfactory stop

The page comes with the global install (uv tool install modular-factory). It is read-only and stays on your machine. Approvals and feedback go through /mfactory or an issue comment. It opens on Overview. A sidebar lists the views and collapses to icons.

  • Overview: running, waiting, failed, and open pull requests, the jobs in progress, who a job is waiting on, the pipe, the trackers, and runtime.
  • Jobs: every job, filtered and sorted, with the state of each step. A job opens its pipeline as a graph, its visits, files, cost, and agent logs.
  • Pipelines: each pipe as a graph, with schema problems in its YAML.
  • Trackers: Jira boards you choose, GitHub issues, and factory jobs by step.
  • Planner: open findings and the action each one proposes.
  • Settings: factory/factory.toml merged over the defaults, and which file set each value.

The dashboard's jobs table, with each job's pipeline and the state of every step, all made up

A job's page: its pipeline drawn as a graph, each step coloured by its state, with one step's visits and files open

mfactory install adds the project to ~/.mfactory/workspace.toml. The dashboard lists every project there. One checkout that is not listed still opens its own page. See several projects.

If Jira credentials come from JIRA_EMAIL and JIRA_API_TOKEN, start the dashboard from a shell that has them.

Commands

mfactory install | upgrade | uninstall | doctor | status | sync
mfactory config show | graph | models | skills
mfactory pipes list | show | validate | schema
mfactory migrate pipes | layout
mfactory queue | create | next | done | answer
mfactory plan summary | show | approve | dismiss | release
mfactory issue list | show | create | comment | move | close | guide
mfactory checks | telemetry status | events | validate | export | prune
mfactory dashboard | start dashboard | stop | version
mfactory workspace add | remove | list | queue | init

From anywhere in a repository, .factory/bin/mfactory <command> is the same CLI. The full reference is the CLI page.

Documentation

Read the docs. The same guides are in the repository:

Guide What it covers
Install Install, setup, upgrade, remove, several projects
Configuration Every key in factory/factory.toml and in a pipe
Telemetry Local execution records, privacy, export
Design How it works, guards, what is untested, what changed

Development

python3 -m pip install pytest ruff   # skip when .venv already has them
make check                 # ruff, bash -n install.sh, pytest
make help                  # mfactory CLI targets
make sample-dashboard      # the dashboard with made-up jobs

The factory itself uses Python's standard library and PyYAML.

Licence

GPLv3. See NOTICE and what changed.

Metadata

Release files for modular-factory 0.42.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modular-factory 0.42.1
File Size Uploaded Provenance Actions
modular_factory-0.42.1.tar.gz 329.1 kB With provenance Details for modular_factory-0.42.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for modular-factory 0.42.1
File Interpreter ABI Platform Actions
modular_factory-0.42.1-py3-none-any.whl Python 3 none any Details for modular_factory-0.42.1-py3-none-any.whl

Total release size: 737.9 kB

Release files / modular_factory-0.42.1.tar.gz

Download URL modular_factory-0.42.1.tar.gz
Size 329.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7e7ebb8abf317fd23a66a5005fa96af8005ebaca324e9b2b76b11b2093647128
BLAKE2b-256 checksum
How to use checksums
81b0b150ffa076bcc9f2f1f614c99b2097dced0d79115302d4762081639f09c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / modular_factory-0.42.1-py3-none-any.whl

Download URL modular_factory-0.42.1-py3-none-any.whl
Size 408.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fafcba38d884c5ef0e816a2bd54179b0cb4cefbe27025dcdaf5c55c4255175c3
BLAKE2b-256 checksum
How to use checksums
8a3e2ac8124b549d527ddecd141ae210396fdbe92a3d3ecd2ccf12b7fae7226e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for modular-factory 0.42.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for modular_factory-0.42.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page