Development AI Factory

The Martenweave Core repository contains a repository-native Development AI Factory: the conventions, definitions, and a small harness that let AI coding agents (for example Kimi) safely analyze, improve, test, document, and prepare the product with minimal maintainer involvement.

Everything on this page describes what exists today in the Core repository at docs/factory/ and the ./factory script at the repository root. It is not a separate platform, a hosted service, or a roadmap item.

What the factory is

How to use it

Prerequisites: a Core checkout with the development environment installed (python3.11 -m venv .venv && .venv/bin/python -m pip install -e '.[dev]'), plus jq for the Northstar demo and Node/npm for Workbench gates. Run from the repository root.

./factory audit           # inspect repos, docs, backlog → findings (L0, read-only)
./factory plan            # rank open agent-ready issues → recommended next task
./factory run-next        # execution brief for the top task (agent, skills, gates)
./factory review          # diff hygiene + critical-review checklist for current work
./factory validate        # deterministic gates G3–G10 (tests, lint, build, contracts,
                          # examples, Northstar regression, Workbench, docs)
./factory release-check   # G11 release evidence (read-only; never tags or publishes)

Every command also supports --json for machine consumption.

An agent session follows the loop documented in docs/factory/WORKFLOWS.md: inspect → compare with the north star → verified gaps → issues → smallest valuable task → patch → gates → critical review → docs sync → merge or request approval → continue.

Autonomy levels

Defined in docs/factory/policies/AUTONOMY_LEVELS.md:

Hard prohibitions (P1–P10 in AGENT_PREVENTIONS.md): never weaken tests, duplicate existing functionality, invent capabilities, change the north star, build chatbots/workflow engines/SaaS, modify canonical model data without review, or publish releases automatically.

Quality gates

Eleven gates (G1–G11) are defined in QUALITY_GATES.md: product scope, architecture consistency, security/privacy, schema compatibility, unit and integration tests, Ruff and package build, API and MCP contract tests, the Northstar synthetic pilot regression (bash scripts/demo_northstar_pilot.sh), Workbench build and smoke tests, documentation/website consistency, and release readiness. ./factory validate runs the full deterministic set; a failing gate blocks the patch — it never "warns".

Agents and memory

Seven specialist agent definitions live in docs/factory/agents/: Product & Architecture, Core Development, AI & MCP, SAP/MDM Domain Quality, Testing & Release, Documentation & Website, and Security & Critical Review. Shared project memory lives in docs/factory/memory/ and is updated in the same patch as any change to project truth.

Does it work?

The factory was built and dogfooded on 2026-07-19. Its first live loop runs — planner priority ranking (#553), CLI documentation drift (#546), planner L3 handling (#554), doctor host-tool checks (#547), and Workbench owner-name resolution (#548) — each shipped with full gate evidence and are closed in the Core issue tracker. At the time of writing the Core suite reports 1823 passed, 3 skipped tests, and the Northstar pilot regression passes 11/11 steps.

Support