Factory Spec - MODEL Phase Orchestrator

VerifiedCaution

Orchestrates the MODEL phase of a factory: sequentially delegates the generation of functional specs (pm), technical specs (architect), and memory rules (rules-memory), with gate checks between steps. Useful for automatically producing specifications, ADRs, and project rules from an initial brief and scope.

Sby Skills Guide Bot
DevelopmentIntermediate
1406/2/2026
Claude Code
#spec-generation#architecture-decision-records#workflow-orchestration#model-phase

Recommended for

Our review

Orchestrates the MODEL phase by delegating generation of functional and technical specs, ADRs, and memory rules to sub-agents with gate checks.

Strengths

  • Automates a complex document generation pipeline
  • Ensures synchronization and validation of intermediate deliverables
  • Integrates quality gates for early error detection

Limitations

  • Depends on sub-agents availability and completeness
  • Does not cover modeling beyond specs and ADRs
  • Requires a pre-existing project structure (e.g., docs/brief.md, tools/)
When to use it

Use at the start of a project to formalize specifications and architecture decisions before development.

When not to use it

Avoid if the project is already in advanced development or if specifications are not needed.

Security analysis

Caution
Quality score85/100

The skill uses Bash to execute node scripts (gate-check.js, factory-log.js) which are assumed to be part of the repository. These are legitimate development tools, but Bash execution inherently carries risk if scripts are compromised. No destructive or exfiltrating actions are instructed.

No concerns found

Examples

Run full MODEL phase
Execute the factory-spec skill to run the MODEL phase: generate specs, ADRs, and rules from docs/brief.md and docs/scope.md.
Regenerate specs only
Re-run the MODEL phase for the current project, skipping gate checks if already passed.

name: factory-spec description: "Phase MODEL - Génère specs + ADR + rules" context: fork allowed-tools: Read, Glob, Grep, Task, Bash

Factory Spec - Phase MODEL

Tu es l'orchestrateur de la phase MODEL.

Workflow

⚠️ SYNCHRONISATION OBLIGATOIRE : Chaque étape DOIT être terminée avant de passer à la suivante. Les agents ont des dépendances : architect dépend de pm, rules-memory dépend de architect.

  1. Vérifier Gate 1 : node tools/gate-check.js 1

    • Si exit code ≠ 0 → STOP immédiat
  2. Déléguer à l'agent pm via Task tool :

    Task(
      subagent_type: "pm",
      prompt: "Produis docs/specs/system.md et docs/specs/domain.md depuis docs/brief.md et docs/scope.md",
      description: "PM - Specs fonctionnelles"
    )
    

    ⏳ ATTENDRE que le Task soit terminé avant de continuer. ✅ Vérifier : docs/specs/system.md ET docs/specs/domain.md existent.

  3. Déléguer à l'agent architect via Task tool :

    Task(
      subagent_type: "architect",
      prompt: "Produis docs/specs/api.md et docs/adr/ADR-0001-stack.md depuis docs/specs/system.md et docs/specs/domain.md",
      description: "Architect - Specs techniques"
    )
    

    ⏳ ATTENDRE que le Task soit terminé avant de continuer. ✅ Vérifier : docs/specs/api.md ET docs/adr/ADR-0001-*.md existent.

  4. Déléguer à l'agent rules-memory via Task tool :

    Task(
      subagent_type: "rules-memory",
      prompt: "Génère les rules dans .claude/rules/ et enrichis CLAUDE.md depuis docs/specs/* et docs/adr/*",
      description: "Rules-Memory - Rules et mémoire"
    )
    

    ⏳ ATTENDRE que le Task soit terminé avant de continuer.

  5. Vérifier les outputs :

    • docs/specs/system.md existe
    • docs/specs/domain.md existe
    • docs/specs/api.md existe
    • docs/adr/ADR-0001-*.md existe
  6. Exécuter Gate 2 : node tools/gate-check.js 2

    • Si exit code ≠ 0 → STOP immédiat avec rapport des erreurs
  7. Logger via :

    node tools/factory-log.js "MODEL" "completed" "Phase MODEL terminée"
    
  8. Retourner un résumé avec liste des specs générées

En cas d'échec

Si Gate 2 échoue → STOP et rapport des fichiers manquants.

Related skills