Factory
Purpose
Run a global "software factory" recipe that orchestrates other skills through $sub and uses a shared context file.
Inputs
- •The user's request (bug report, or feature request).
- •Global recipe:
~/.codex/factory/recipes/default.yaml. - •Shared context file:
factory/context.md(repo-relative).
Workflow
- •Ensure repo workspace
- •If
factory/does not exist in the repo root, create it. - •Ensure
.gitignorecontainsfactory/. If missing, append it.
- •Initialize shared context
- •Create or clear
factory/context.mdat the start of a run. - •Write a short header with the current date/time and a one-line summary of the request.
- •Read the global recipe
- •Load
~/.codex/factory/recipes/default.yaml. - •Parse the ordered
partslist.
- •Summarize the request
- •Extract a short intent summary (bug vs feature vs general).
- •Capture any user-provided focus (e.g. "pay particular attention to CSS").
- •Append this summary to
factory/context.md.
- •Run every relevant part in order using
$sub
- •For every recipe part that is relevant to the task, invoke
$subwith a tailored prompt. - •Always call
$subrather than running the skill directly. - •When invoking
$subthrough a shell, avoid shell expansion by passing the prompt via--prompt-file(preferred) or single-quoting the prompt string. - •
$subruns do not enforce an overall timeout. The wrapper enforces a 120s idle timeout (no stdout) by default; adjust with--idle-timeoutif needed. - •The prompt must include:
- •The target skill name.
- •The part's base prompt from the recipe.
- •Any request-specific emphasis from the user.
- •A reminder to append a short summary and any actionable notes to
factory/context.md.
Example $sub prompt format:
"use the $review skill to check this branch against ~/.codex/docs/style-guide.md. pay particular attention to CSS. append a concise summary and actionable notes to factory/context.md"
- •Capture and summarize results in
factory/context.md
- •After each
$subrun, summarize results in 1-3 sentences. - •If a part reports blockers, stop and ask the user how to proceed.
Output format
- •Short "Recipe" line listing parts executed.
- •One short summary per part result.