factory-mission
Skill140 starsChanged 2 months agoMITView on GitHub
Use when executing a spec-gated mission from the queue — inner loop specify → plan → implement ↔ converge with tracker integration, worktree isolation, and a circuit breaker.
In this repository43 other files it gives its agents.
- architect-analyzeSkill
- architect-bootSkill
- architect-clarifySkill
- architect-implementSkill
- architect-initSkill
- architect-specifySkill
- writing-skillsSkill
- change-bootSkill
- change-clarifySkill
- change-initSkill
- change-publishSkill
- evals-analyzeSkill
- evals-clarifySkill
- evals-implementSkill
- evals-initSkill
- evals-specifySkill
- evals-validateSkill
- factory-architectSkill
- factory-cleanSkill
- factory-initSkill
- factory-learnSkill
- factory-productSkill
- factory-queueSkill
- factory-reviewSkill
- factory-ticketsSkill
- product-analyzeSkill
- product-bootSkill
- product-clarifySkill
- product-implementSkill
- product-initSkill
- product-roadmapSkill
- product-specifySkill
- team-bootSkill
- team-constitutionSkill
- team-diagnoseSkill
- team-discoverSkill
- team-initSkill
- team-levelupSkill
- team-repairSkill
- team-setupSkill
- team-skillsSkill
- workspaceSkill
- tech-radar-bootSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Stall Detection: After dispatching a subagent, observable progress is checked at a configurable window (default 20 min).
- Very specific: line 45
Read the run's mission.yml (.adlc/workflows/runs/<run_id>/mission.yml).
- Very specific: line 46
If --issue <ref> is specified:
- Very specific: line 49
Read the labels. If dispatch is interactive or gating is human-required -> HALT execution (hand back to interactive session).
- Distinctive: line 51
If no issue: read spec description from arguments.
- Very specific: line 82
If tracker-integrated: read all marker comments from the PR/MR/issue to compile the audit trail (converge decisions, test findings, …
- Very specific: line 84
Write per-implement logs to iterations.md.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
factory-mission
What this skill does
factory-mission is the execution-harness orchestrator of the software factory. It takes a feature description, structures it into a Mission Brief (goal, constraints, non-goals, success criteria), generates an ordered step list, and executes those steps via sequential subagent runs.
It implements the following key factory platform capabilities:
- Universal Skill Routing: Decoupled step dispatching. It scans installed skills and hands the inventory to subagents (the model picks which tool fits the step).
- Tracker-Agnostic Integration (
references/tracker-integration.md): When invoked with--issue <ref>, it pulls ticket context, respects automation/dispatch labels (autonomous/supervised), and writes back status comments + iteration logs. - Inter-Agent Comment Bus (
references/tracker-integration.md§Inter-Agent Comment Bus): When tracker-integrated, each step's terminal output (decisions, findings, artifact references — never drafts) is published as a structured comment on the PR/MR/issue. The next step reads previous markers before starting. This is the durable inter-agent memory that survives session boundaries, runtime switches, and pod crashes. Drafts stay on local disk. - Self-Contained Worker Brief: The Mission Brief is persisted to
.adlc/workflows/runs/<run_id>/brief.mdas a draft. Resumed runs and cross-runtime workers read it from disk — no session-context dependency. - Worktree Isolation: Each run gets its own git worktree. Never touches the user's main checkout. Cleaned up on exit (retained if unsaved work).
- Lease-Based Liveness: The state file carries a renewable lease with heartbeat + TTL. Resume can distinguish live, stale, and completed runs.
- Stall Detection: After dispatching a subagent, observable progress is checked at a configurable window (default 20 min). A hung agent that passes the circuit breaker is detected and killed.
- Lane-Based Dispatch (
references/lanes.md): Steps can run on different lanes —inline(this session),agent(fresh session of same CLI for maker/checker separation), orcli:<runtime>(optional cross-vendor). Theagentlane is the default for unattended stages. - Scratchpad Tools: Subagents share named, run-private scratchpads (
.adlc/workflows/runs/<run_id>/scratchpads/<name>.txt) to compile notes, drafts, and reviews incrementally before publishing. - Workflow Memory & Self-Improvement: Persistent JSONL database (
.adlc/workflows/memory.jsonl, workspace-global) stores learnings across runs.factory-learnperiodically runs retrospectives to prune/weight memories. - Hierarchical Context Parameters: Workflows and agents reference parameters as
{{params.<key>}}, resolved from most specific to least specific:agent < workflow < repository < project < default. - Decoupled Test/Code Separation: In
autonomousorsupervisedmodes, it splitsimplementinto sequentialtest(Test Agent writes failing tests under read-onlysrc/) andcode(Implement Agent writes code under read-onlytests/) runs — each closed by a mandatory mechanical gate (see Phase 5): the RED gate proves the new suite fails before coding starts; the GREEN gate proves it passes before converge is reached.
When to use
- "Build this feature end to end" inside a factory-enabled team.
- You want an execution loop with a circuit breaker, score-regression checking, and a robust resume mechanism (
factory-mission --resume). - You want to run autonomously against a ticket queue.
When NOT to use:
- For non-factory standalone projects (run
adlc-cli workflow run <workflow.yml>— the CLI engine, ADR-395). - Trivial 1-line changes (do them directly).
Process
factory-mission executes in alignment with the shared executor contract (references/executor.md) and the tracker-agnostic layer (references/tracker-integration.md).
Phase 0 to 4: Setup & Compilation
- Read the run's
mission.yml(.adlc/workflows/runs/<run_id>/mission.yml). Resolve execution and supervision. - If
--issue <ref>is specified:- Discover credentials and MCP/CLI tools (
references/tracker-integration.md). - Pull the issue content as the primary Brief description.
- Read the labels. If dispatch is
interactiveor gating ishuman-required-> HALT execution (hand back to interactive session). - The comment bus is active for this run — step outputs will be published as marker comments on the PR/MR/issue.
- Discover credentials and MCP/CLI tools (
- If no issue: read spec description from arguments. The comment bus is inactive — steps communicate through local files only.
- Structure the Mission Brief (Goal, Constraints, Non-Goals, Success Criteria). The Brief is a
draft— not published to the comment bus. - Resolve hierarchical Context Parameters from
agent < workflow < repository < project < defaultand embed the frozen value map in the brief. - Generate the step list based on route classification (
spec,change,quick). Each step declaresoutput_type(draft/decision/findings/artifact-ref) andreads_from(markers or local paths) per the executor contract.
Phase 5: Executing the Converge Loop
Execute steps sequentially. When reaching implement / converge:
Decoupled Test/Code Execution (mandated TDD)
In autonomous and supervised modes, the implement step is split into two sequential subagent dispatches, each closed by a mechanical verification run:
- The Test Agent (
teststep):- Instruction: Write a failing test suite based on
spec.mdintests/. - Enforcement: Mount
src/as hard read-only; onlytests/is writeable. - RED gate (mandatory): the executor runs the suite and asserts at least one test FAILS. A suite that passes immediately means the feature already exists or the tests assert nothing — route to
SPEC_CORRECTION_NEEDEDwith the run output; never proceed to thecodestep. Record the failing count in the run log.
- Instruction: Write a failing test suite based on
- The Implement Agent (
codestep):- Instruction: Write minimum implementation code in
src/to pass the tests. - Enforcement: Mount
tests/,spec.md, andplan.mdas hard read-only; onlysrc/is writeable. - GREEN gate (mandatory): the executor runs the suite again;
convergeis never reached with a red suite. Any failure loops straight back to thecodestep with the failure list attached (this loop-back does not consume the converge circuit breaker; only broken iterations do — use thecode-step retry cap frommission.yml).
- Instruction: Write minimum implementation code in
Skipping the split is allowed only when the run declares no test surface: tdd: false in mission.yml, a docs/config-only step, or interactive mode (the attended pair runs its own discipline — e.g. superpowers' test-driven-development). A code-bearing step in autonomous/supervised mode never skips it.
Converge Loop (Implement ↔ Converge)
- Execute implement step (or
test+codesteps — RED→GREEN gates enforced first). - Execute
convergestep (independent judge mode; checks against Brief and Non-Goals). - If
convergereturns:DONE(and quality is abovequality_threshold): Loop exits.CONTINUE: Incrementconsecutive_tasks_appended. Check circuit breaker (default 3) and score-regression counter. Repeat.SPEC_CORRECTION_NEEDED: Stop and route to Phase 6.
Phase 6: Completion & Write-Back
- If tracker-integrated: read all marker comments from the PR/MR/issue to compile the audit trail (converge decisions, test findings, implement artifact references, convergence history).
- Close the shared run: final
adlc-cli workflow state advance <run_id> --step <last> --status completed(the run dir is the durable archive; no separate move). - Write per-implement logs to
iterations.md. - If tracker-integrated:
- Post completion summary as a ticket comment (marker:
factory-mission:status=completed:run=<run_id>). - Transition lifecycle label from
executingtovalidation(ordoneif merged). - Stamp
agent-authoredon opened PRs. - Defer PR merge to code-owner approval (never auto-merge without approval).
- Post completion summary as a ticket comment (marker:
- Output the complete audit summary.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

