---
name: step-03-steps
description: Generate step files for progressive step loading skills
next_step: steps/step-04-validate.md
---

# Step 3: Generate Step Files

## MANDATORY EXECUTION RULES:
- ONLY execute this step for progressive skills ({skill_type} = "progressive")
- If not progressive, skip directly to step-04-validate.md
- Generate ALL step files with proper chaining
- Each step must follow the standard format

## YOUR TASK:
Generate step files for progressive step loading. Each step file must have proper frontmatter, sections, and next_step chaining.

---

## EXECUTION SEQUENCE:

### 1. Load Step Template

```
Read: "templates/step-template.md"
```

### 2. Generate Each Step File

For each step in {steps} array (from Step 1 design):

**File path:** `{target_dir}/steps/step-{number}-{name}.md`

**Frontmatter:**

```yaml
---
name: step-{number}-{name}
description: {step_description}
next_step: steps/step-{next_number}-{next_name}.md
---
```

For the LAST step: omit `next_step` field.

**Content structure for each step:**

```markdown
# Step {N}: {Title}

## MANDATORY EXECUTION RULES:
- [Rules specific to this step]
- FORBIDDEN to skip to next step until this step is complete

## YOUR TASK:
{step_description}

---

## EXECUTION SEQUENCE:

### 1. [First subtask]
[Instructions for the first subtask]

### 2. [Second subtask]
[Instructions for the second subtask]

### N. Show Summary
[Display step results in compact format]

---

## SUCCESS METRICS:
- [What indicates this step succeeded]
- [Measurable outcomes]

## NEXT STEP:
After showing summary, proceed directly to `./step-{next_number}-{next_name}.md`
```

### 3. Special Handling for Step 00 (Init)

The first step (step-00-init) should always include:

```markdown
## EXECUTION SEQUENCE:

### 1. Parse Input
Parse flags and arguments from $ARGUMENTS.
[Include flag parsing based on skill's <parameters>]

### 2. Validate Input
[Validate required fields, ask user if missing]

### 3. Initialize State
[Set all state variables to defaults or parsed values]

### 4. Show Summary
Display compact initialization summary table.
```

### 4. Special Handling for Last Step

The last step should include:

```markdown
## EXECUTION SEQUENCE:

### 1. [Final validation or action]

### 2. Final Summary
Display:
- What was accomplished
- Files created/modified
- Any warnings or next steps

## NEXT STEP:
This is the final step. Skill execution is complete.
```

### 5. Write All Step Files

Use Write tool for each step file. Run writes in parallel if possible.

### 6. Confirm Generation

```
Generated {step_count} step files:

| File | Next Step |
|------|-----------|
| steps/step-00-{name}.md | → step-01-{name}.md |
| steps/step-01-{name}.md | → step-02-{name}.md |
| ... | ... |
| steps/step-{N}-{name}.md | (final) |

→ Validating skill...
```

---

## SUCCESS METRICS:
- All step files created in {target_dir}/steps/
- Each step has proper frontmatter (name, description, next_step)
- Step chaining is correct (no broken references)
- First step handles initialization
- Last step has completion summary
- Standard sections present in each step

## NEXT STEP:
After generating all step files, proceed directly to `./step-04-validate.md`
