Files
sar/.claude/skills/bmad-story-automator/steps-c/step-02b-preflight-finalize.md
julian 17c08e6392 chore: initial monorepo scaffold + WDS Phase 1+2 artifacts
- Nx 22.7 monorepo (pnpm 11.1, TypeScript 5.9, Node 24)
- apps/api: NestJS 11 (CJS conforme CODING-RULES.md PGD-DB-004)
- apps/web: React 19 + Vite 8 (ESM)
- libs/shared/api-interface: Zod contract base
- Docker Compose dev: Postgres 18, Valkey 8, MinIO, Mailpit
- WDS artifacts:
  - design-artifacts/A-Product-Brief/ (5 docs canônicos + 16 dialogs)
  - design-artifacts/B-Trigger-Map/ (hub + 4 personas + feature impact)
- Stack canon: STACK.md v2.2 + CODING-RULES.md v2.0 + brand.md
- AGENTS.md + README.md como entrada para devs/agentes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 14:34:20 +00:00

2.5 KiB

name, description, nextStep, outputFolder, outputFile, stateHelper, ensureMarkerGitignore, deriveProjectSlug, markerFormat
name description nextStep outputFolder outputFile stateHelper ensureMarkerGitignore deriveProjectSlug markerFormat
step-02b-preflight-finalize Finalize preflight and start execution ./step-03-execute.md {output_folder}/story-automator {outputFolder}/orchestration-{epic_id}-{timestamp}.md ../scripts/story-automator ../scripts/story-automator ../scripts/story-automator ../data/marker-file-format.md

Step 2b: Pre-flight Finalize

Goal: Finalize preflight artifacts, create marker, and start execution. Interaction mode: Deterministic auto-proceed.


Do

1. Create Complexity + Agents Files

Derive deterministic filenames:

state_base=$(basename "{outputFile}" .md)
complexity_path="{outputFolder}/complexity-${state_base}.json"
agents_dir="{outputFolder}/agents"
agents_path="$agents_dir/agents-${state_base}.md"

Write complexity file:

mkdir -p "$(dirname "$complexity_path")"
echo "$stories_json" | jq -c '{stories:.}' > "$complexity_path"

Build deterministic agents file:

mkdir -p "$agents_dir"
"{stateHelper}" orchestrator-helper agents-build \
  --state-file "{outputFile}" \
  --complexity-file "$complexity_path" \
  --output "$agents_path" \
  --config-json "$agent_config_json"

Update state frontmatter with file paths:

agents_path_json=$(printf '%s' "$agents_path" | jq -R '.')
complexity_path_json=$(printf '%s' "$complexity_path" | jq -R '.')
"{stateHelper}" orchestrator-helper state-update "{outputFile}" \
  --set "agentsFile=$agents_path_json" \
  --set "complexityFile=$complexity_path_json"

2. Create Marker and Begin Execution

Create marker file (see {markerFormat} for JSON structure):

# Resolve the active marker path for the selected runtime layout and gitignore it.
marker_info=$("{stateHelper}" orchestrator-helper marker path)
marker_entry=$(echo "$marker_info" | jq -r '.entry')
"{ensureMarkerGitignore}" ensure-marker-gitignore --gitignore ".gitignore" --entry "$marker_entry"

# Create marker
project_slug=$(echo "$("{deriveProjectSlug}" derive-project-slug --project-root "{project-root}")" | jq -r '.slug')
"{stateHelper}" orchestrator-helper marker create --epic "$epic_id" --story "$first_story_id" \
  --remaining "$selected_count" --state-file "{outputFile}" \
  --project-slug "$project_slug" --pid "$$" --heartbeat "{timestamp}"

Set status="IN_PROGRESS", log "Execution started". Update frontmatter (append step-02b-preflight-finalize, set lastUpdated).


Then

→ Load, read entire file, and execute {nextStep}