# Aligned Stem Workflow

Incremental audio production with duration alignment handling, per-stem verification...

- Repository: https://github.com/HKUDS/AgentPilot (7784 stars)
- Category: Media
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add HKUDS/AgentPilot --skill aligned-stem-workflow -g -a claude-code -y`
Codex: `npx skills add HKUDS/AgentPilot --skill aligned-stem-workflow -g -a codex -y`
Cursor: `npx skills add HKUDS/AgentPilot --skill aligned-stem-workflow -g -a cursor -y`
Gemini CLI: `npx skills add HKUDS/AgentPilot --skill aligned-stem-workflow -g -a gemini-cli -y`

## Description

Incremental audio production with duration alignment handling, per-stem verification, and adaptive extension strategies

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Aligned Stem Audio Production Workflow

This skill provides a resilient pattern for audio production that emphasizes **incremental verification**, **fail-fast** principles, and **automatic duration alignment**. Each major step produces verified outputs before proceeding, with explicit handling for stem duration mismatches using appropriate extension strategies.

## Overview

Follow these steps in strict order. Each step must complete successfully and pass verification before proceeding to the next:

1. **Early timing calculation** - Derive section transitions from BPM and duration first
2. **Verify reference audio** - Validate input file properties and extract target duration
3. **Generate and verify each stem individually** - One stem at a time with immediate verification
4. **Detect and resolve duration mismatches** - Apply appropriate extension strategy (zero-pad, loop, or crossfade)
5. **Generate drum stem separately** - Dedicated drum extension with rhythm patterns
6. **Apply effects with verification** - Process each stem and verify output
7. **Export master track** - Mix all verified stems
8. **Archive and final verification** - Package deliverables with comprehensive checks

## Key Differences from Standard Workflow

- **Incremental verification**: Verify each stem immediately after generation, not just at the end
- **Fail-fast approach**: Stop and report errors at each step rather than accumulating failures
- **Early timing**: Calculate section transitions before any audio generation
- **Duration alignment**: Explicit detection and resolution of stem duration mismatches
- **Adaptive extension**: Choose appropriate strategy (zero-pad/loop/crossfade) based on stem type
- **Separated drums**: Drum stem generation is a distinct step with rhythm-specific processing
- **Memory-efficient**: Process stems individually to avoid large array operations that cause sandbox failures

## Step 1: Calculate Timing Parameters (Early)

The rest: https://github.com/HKUDS/AgentPilot/blob/HEAD/openspace/benchmarks/gdpval/skills/audio-track-production-enhanced-enhanced/SKILL.md
