AgentSkillsCN

factory

由 Supervisor 加载全局工厂配方,并通过 $sub 技能逐一执行各部分任务。

SKILL.md
--- frontmatter
name: factory
description: Supervisor that loads the global factory recipe and runs each part via the $sub skill.

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

  1. Ensure repo workspace
  • If factory/ does not exist in the repo root, create it.
  • Ensure .gitignore contains factory/. If missing, append it.
  1. Initialize shared context
  • Create or clear factory/context.md at the start of a run.
  • Write a short header with the current date/time and a one-line summary of the request.
  1. Read the global recipe
  • Load ~/.codex/factory/recipes/default.yaml.
  • Parse the ordered parts list.
  1. 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.
  1. Run every relevant part in order using $sub
  • For every recipe part that is relevant to the task, invoke $sub with a tailored prompt.
  • Always call $sub rather than running the skill directly.
  • When invoking $sub through a shell, avoid shell expansion by passing the prompt via --prompt-file (preferred) or single-quoting the prompt string.
  • $sub runs do not enforce an overall timeout. The wrapper enforces a 120s idle timeout (no stdout) by default; adjust with --idle-timeout if 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"

  1. Capture and summarize results in factory/context.md
  • After each $sub run, 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.