Create DevForgeAI-aware Claude Code subagents with structural anti-skip enforcement (Execute-Verify-Record pattern) across all 6 phases. Prevents token optimization bias through lean orchestration, per-phase reference loading, checkpoint persistence, and artifact verification. Use when user runs /create-agent command, requests custom subagent creation with framework integration, or says "create a subagent" or "generate an agent". Supports guided, template, domain, and custom spec modes. Do NOT use for skill creation (use skill-creator) or command creation (use manual workflow).
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Create DevForgeAI-aware Claude Code subagents with structural anti-skip enforcement (Execute-Verify-Record pattern) across all 6 phases. Prevents token optimization bias through lean orchestration, per-phase reference loading, checkpoint persistence, and artifact verification. Use when user runs /create-agent command, requests custom subagent creation with framework integration, or says "create a subagent" or "generate an agent". Supports guided, template, domain, and custom spec modes. Do NOT use for skill creation (use skill-creator) or command creation (use manual workflow).
This skill expands inline. After invocation, execute Phase 00 Initialization immediately. Do not wait passively, ask permission, or offer execution options.
Self-Check (if ANY box is true = VIOLATION):
Stopping to ask about token budget
Stopping to offer execution options
Waiting passively for user to say "go"
Asking "should I execute this?"
Skipping a phase because it "seems simple"
Skipping reference loading because "already covered"
Generating agent file without completing Phase 05 validation
IF any box checked: EXECUTION MODEL VIOLATION. Go directly to Phase 00 Initialization now.
Anti-Skip Enforcement Contract
This skill enforces 4 independent anti-skip layers. ALL FOUR must fail for a step to be skipped:
Per-phase reference loading - Each phase loads its reference file fresh via Read(). NOT consolidated. Prevents "already covered" rationalization.
Checkpoint-based state tracking - Phase completion verified by checking checkpoint JSON data keys and current_phase field.
Artifact verification - Checkpoint JSON existence checked via Glob(), generated files verified on disk.
Step registry with data key completion - Each phase has minimum step counts and required data keys. Phase exit criteria checked before proceeding.
Execute-Verify-Record Pattern: Every mandatory step in every phase file has three parts:
EXECUTE: The exact Read, Write, AskUserQuestion, or Task call to perform
VERIFY: How to confirm the action happened (file exists, data key populated, response non-empty)
RECORD: Update checkpoint JSON with captured data
Token Optimization Bias is PROHIBITED. Do not skip, compress, or shortcut any step. Every phase step exists because a previous failure proved it necessary.
This phase runs inline because it creates the state that all other phases depend on.
Step 0.1: Parse Arguments
IF conversation contains "--resume AGENT-":
Extract AGENT_ID from argument
MODE = "resume"
ELSE:
MODE = "new"
Extract $NAME, $MODE, $TEMPLATE, $DOMAIN, $SPEC_FILE from conversation markers
Step 0.2: Handle Resume Mode
IF MODE == "resume":
checkpoint_path = "devforgeai/workflows/agent-creation/${AGENT_ID}.checkpoint.json"
Glob(pattern=checkpoint_path)
IF found:
Read(file_path=checkpoint_path)
Restore session state from checkpoint
CURRENT_PHASE = checkpoint.progress.current_phase
Display: "Resuming ${AGENT_ID} from Phase ${CURRENT_PHASE}"
GOTO Phase Orchestration Loop at CURRENT_PHASE
ELSE:
Display: "No checkpoint found for ${AGENT_ID}."
AskUserQuestion:
Question: "No checkpoint found. What would you like to do?"
Header: "Resume"
Options:
- label: "Start a new agent creation"
description: "Begin fresh session"
- label: "Cancel"
description: "Exit without action"
IF "Start new": MODE = "new", continue below
IF "Cancel": EXIT skill
Step 0.3: Generate Session ID (New Session)
IF MODE == "new":
# Scan for highest existing ID
Glob(pattern="devforgeai/workflows/agent-creation/AGENT-*.checkpoint.json")
# Extract highest NNN, increment
AGENT_ID = "AGENT-{NNN+1}" (zero-padded to 3 digits minimum)
# Ensure output directory exists
Glob(pattern="devforgeai/workflows/agent-creation/.gitkeep")
IF not found: Create directory structure
FOR phase_num in range(CURRENT_PHASE, 7): # Phases 01-06
1. LOAD: Read(file_path="src/claude/skills/spec-driven-agents/phases/{phase_files[phase_num]}")
Load the phase file FRESH. Do NOT rely on memory of previous reads.
2. REFERENCE: Read the phase's reference file as specified in the phase Contract section.
Each phase references a file in src/claude/skills/spec-driven-agents/references/.
3. EXECUTE: Follow EVERY step in the phase file using EXECUTE-VERIFY-RECORD triplets.
- Each step's EXECUTE tells you exactly what action to perform
- Each step's VERIFY tells you how to confirm the action happened
- Each step's RECORD tells you how to update the checkpoint
4. EXIT CRITERIA: Verify ALL phase exit criteria are met before proceeding.
IF any required data key is null or empty: HALT.
5. CHECKPOINT: Update checkpoint JSON with phase completion.
Write updated checkpoint to disk.
6. CONTEXT CHECK: If estimated context > 70%, offer save-and-resume via AskUserQuestion.
IF user chooses "Save and resume later":
Write final checkpoint, display resume command, EXIT skill.
Phase Table
Phase
Name
File
Min Steps
Required Data
00
Initialization
(inline above)
5
session_id, checkpoint on disk
01
Framework Context Loading
phases/phase-01-framework-context.md
3
references_loaded[>=3]
02
Requirements Gathering
phases/phase-02-requirements-gathering.md
5
agent_name, purpose, domain, tools, model
03
Specification Assembly
phases/phase-03-specification-assembly.md
3
spec_file on disk
04
Agent Generation
phases/phase-04-agent-generation.md
2
generated_file on disk
05
Validation
phases/phase-05-validation.md
3
validation_status, 12-point results
06
Result Processing
phases/phase-06-result-handoff.md
3
output displayed, checkpoint deleted
Required Subagents
Phase
Subagent
Enforcement
04
agent-generator
BLOCKING (must invoke via Task, cannot generate inline)
Templates:src/claude/skills/spec-driven-agents/assets/templates/ (loaded via Read, not duplicated)
Workflow Completion Validation
IF phases_completed < 6: HALT "WORKFLOW INCOMPLETE - {completed_count}/6 phases"
IF generated_file not on disk (Glob returns empty): HALT "Subagent file not generated"
IF validation_status != "PASS" and validation_status != "PASS WITH WARNINGS": HALT "Validation not passed"
IF checkpoint still exists: Delete checkpoint (session complete)