Skip to content
pedrosousa13Public

About

Agent-agnostic control plane for running software development as a loop. Issue pickup, TDD subagents, review gate, PR auto-merge. Drives Claude Code, Codex or Pi.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Factory

The control plane for running AI-driven software development in a loop. This repo defines the workflow โ€” preferences, loop protocol, conventions. Software gets built in separate project repos under ~/apps/, each with its own issue tracker.

The maintainer plans interactively; an AI Loop Session consumes the queue and only pings when it has a question. See GLOSSARY.md for the glossary and docs/adr/ for foundational decisions.

The loop at a glance

  1. Plan (you, interactive): /grill-ask (the grilling interview as structured questions with researched recommendations) โ†’ /to-spec โ†’ /to-tickets files tracer-bullet issues to the project's issue tracker, labeled ready-for-agent. An effort too big or foggy for one session gets charted first with /wayfinder โ€” a map of decision tickets on the same tracker, resolved one per session until a spec is in reach; the loop never sees them (PROTOCOL.md, "Wayfinder maps").
  2. Run (AI, autonomous): /factory in the project repo starts a Loop Session:
    • reads the newest handoff in .scratch/handoffs/, if any
    • picks the next unblocked ready-for-agent issue โ€” priority first, then oldest โ€” and moves it to a started state
    • implements subagent-driven (TDD subagents following /tdd; the session only orchestrates), gated by /code-review
    • lands it: branch per issue โ†’ PR (body by /pr) โ†’ auto-merge when tests, typecheck, and review are green โ†’ issue completed
    • questions: push notification, then a ~15 min timer while the session keeps working; unanswered โ†’ question posted to the issue, needs-info, work stays on its branch, loop continues
    • at each issue boundary: context above ~40% โ†’ /handoff to .scratch/handoffs/ and stop
    • queue runs out โ†’ triages any needs-triage reports, notifies you, runs /retro on the session, and opens a Planning Session with you. The loop never invents work.
    • every question comes as a structured prompt, with a researched recommendation first: the plugin's SessionStart hook routes each one through /ask-structured, even when another skill would ask in plain text
  3. Steer (you, from anywhere): set priorities and answer needs-info questions in the tracker.

Resuming after a handoff, a reboot, or a week away is always the same command: /factory. With no argument, it works out the next step itself: it adopts an unstamped repo, migrates an old stamp, or works the whole Queue. /factory <milestone> scopes the Queue to one milestone.

PROTOCOL.md is the full Loop Session spec; the /factory skill executes it (source in skills/factory/, shipped as part of the Factory plugin).

New project

Run /factory-new <name>. It will:

  1. Create the repo under ~/apps/<name> with git + a private GitHub remote
  2. Pick the issue tracker โ€” GitHub Issues by default (the repo itself is the tracker), or Linear (a project on the Side projects team)
  3. Stamp Factory conventions: .factory/config.json (the stamp โ€” tracker, merge policy, attack surface), AGENTS.md, docs/agents/ (issue tracker, triage labels, domain docs), triage labels on the tracker, .scratch/ in .gitignore
  4. Drop you into a Planning Session to produce the first issues

Existing project

Run /factory-adopt inside the repo. It will:

  1. Stamp the repo with the same conventions as above, after detecting which tracker it already uses (an existing docs/agents/issue-tracker.md, open GitHub issues, or a GitHub remote paired with a matching Linear project) โ€” creating the remote, labels, and any project the tracker needs only where missing, and merging into an existing AGENTS.md/CLAUDE.md rather than overwriting
  2. Re-triage sweep: every open issue gets a category label (Feature/Improvement/Bug) + a state label (needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix), and issues destined for agents get durable agent briefs written into them โ€” you approve in batches
  3. Leave the project loop-ready: /factory works from that point on

Already stamped, out of date

Run /factory-migrate inside the repo. A repo stamped by an older Factory โ€” the legacy v1 stamp (an adapter doc with a Factory loop operations section, no .factory/config.json), or a v2 stamp below the plugin's current version โ€” is migrated, not re-adopted. The skill detects the stamp, builds one combined plan for every pending step, shows one diff, and takes one approval. The v1-to-v2 step reads the tracker off the old adapter doc's title for one-tap confirmation and asks only what the old stamp cannot answer: merge policy and attack surface. The v2-to-v3 step renames CONTEXT.md to GLOSSARY.md, the name upstream skills now read, and asks nothing. Preflight names this skill whenever it finds a stale stamp. /factory routes into it in the same session, and the one-diff approval still applies. PROTOCOL.md, "Migration", is the contract.

Conventions all projects share

  • Issue tracker: GitHub Issues by default, Linear supported; one tracker per repo. See docs/agents/issue-tracker.md for the tool conventions.
  • Triage labels: the five canonical states, 1:1 names. See docs/agents/triage-labels.md.
  • Domain docs: single-context GLOSSARY.md + docs/adr/ per repo, created lazily. See docs/agents/domain.md.
  • Security sweeps: a Project with an attack surface carries an OWASP Top 10 sweep issue in every milestone that touches it; declines are recorded in its GLOSSARY.md. See PROTOCOL.md, "Security sweeps".
  • Git: branch per issue, PR, auto-merge on green. No half-done work on main โ€” parked issues live on their branch.
  • Context discipline: Loop Sessions stay under ~40% context; subagents do the implementation; /handoff bridges sessions.
  • Notifications: Pings use Claude Code's built-in push notifications. See PROTOCOL.md, "Ping and Park".

Install

What the Factory assumes on the machine:

  1. Claude Code, plus the Linear MCP server connected to the Side projects workspace for any Linear-backed Project.

  2. gh authenticated, git over SSH.

  3. Skills: the engineering skills (/code-review, /handoff, /triage, /grilling, /tdd, โ€ฆ) installed under ~/.claude/skills (/pr and /retro too, used at landing and at run-out when present), as editable copies via npx skills@latest add mattpocock/skills -g (update with npx skills@latest update -g). Preflight checks that path, so Matt Pocock's self-updating plugin install does not satisfy it. New repos get their per-repo config (AGENTS.md, docs/agents/) via /setup-matt-pocock-skills, or via /factory-new for new projects and /factory-adopt for existing ones.

  4. The Factory plugin, installed from its marketplace:

    /plugin marketplace add pedrosousa13/factory
    /plugin install factory

    Since this is a private repo, set CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1 โ€” background pulls disable git credential helpers, so a failed pull would otherwise trigger a full re-clone.

    /factory should then show up in any Claude Code session's skill list.

Use

  1. Plan in the project repo: /grilling an idea into shape, slice it into ready-for-agent issues (see "The loop at a glance").
  2. Run /factory in the project repo and walk away. The Loop Session works the Queue and pings only when it has a question.
  3. Steer from the tracker: reorder priorities, answer needs-info questions. Re-running /factory is always the right way to resume.

PROTOCOL.md is the contract for what the Loop Session does at every step.

About

Agent-agnostic control plane for running software development as a loop. Issue pickup, TDD subagents, review gate, PR auto-merge. Drives Claude Code, Codex or Pi.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages