How this skill is triggered — by the user, by Claude, or both
Slash command
/openspec-autodev:parallel-devThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are the external parallel execution script generator.
You are the external parallel execution script generator.
This skill creates a parallel-dev.sh bash script that uses claude -p CLI to run multiple Claude Code instances in parallel for large-scale feature development.
Use this instead of the built-in parallel batch mode (auto-dev Step 4) when:
Resolve the session directory(缺失或空则生成,与 auto-dev 一致):
SESSION_ID=$(cat .claude/current-session-id 2>/dev/null | tr -d '\r\n' || true)
if [ -z "$SESSION_ID" ]; then
SESSION_ID="$(whoami 2>/dev/null || echo unknown)-$(date +%s)"
mkdir -p ".claude/sessions/${SESSION_ID}"
printf '%s\n' "$SESSION_ID" > .claude/current-session-id
fi
SESSION_DIR=".claude/sessions/${SESSION_ID}"
mkdir -p "${SESSION_DIR}"
Read ${SESSION_DIR}/current-plan.md to get:
If neither ${SESSION_DIR}/current-plan.md nor .claude/current-plan.md (legacy) exists, tell the user to run /openspec-autodev:auto-dev $ARGUMENTS first (at least through Phase 2).
Generate parallel-dev.sh in the project root with the following structure:
#!/bin/bash
# parallel-dev.sh — Auto-generated by openspec-autodev
# Feature: $ARGUMENTS
# Generated: <timestamp>
#
# Usage: bash parallel-dev.sh
# Requirements: claude CLI must be installed and authenticated
set -euo pipefail
FEATURE="<feature-slug>"
SPECS="openspec/changes/$FEATURE/specs.md"
DESIGN="openspec/changes/$FEATURE/design.md"
SESSION_ID=$(cat .claude/current-session-id 2>/dev/null | tr -d '\r\n' || true)
if [ -z "$SESSION_ID" ]; then
SESSION_ID="$(whoami 2>/dev/null || echo unknown)-$(date +%s)"
mkdir -p ".claude/sessions/${SESSION_ID}"
printf '%s\n' "$SESSION_ID" > .claude/current-session-id
fi
RESULTS_DIR=".claude/sessions/${SESSION_ID}/results"
mkdir -p "$RESULTS_DIR"
echo "╔══════════════════════════════════════════╗"
echo "║ OpenSpec AutoDev — Parallel Execution ║"
echo "║ Feature: $FEATURE"
echo "╚══════════════════════════════════════════╝"
# ====== Batch N: <description> ======
# For each batch from the parallel plan:
echo ">>> Batch 1: <batch description>..."
<for each task in batch>
claude -p "Read $SPECS and $DESIGN.
Execute micro-task <TASK-ID> (<task description>).
Follow strict TDD: Red → Green → Refactor.
Write result summary to $RESULTS_DIR/<TASK-ID>.md" \
--allowedTools "Read,Write,Edit,Bash" &
PID_<TASK_ID>=$!
</for each>
wait <all PIDs>
echo ">>> Batch 1 complete"
# ... repeat for each batch ...
# ====== Final Verification ======
echo ">>> Running full test suite..."
npm test
echo ">>> All batches complete!"
chmod +x parallel-dev.sh
Report:
✅ Generated parallel-dev.sh
📋 Script details:
Feature: <feature>
Batches: <N>
Total tasks: <M>
Estimated parallel instances: <max concurrent>
🚀 To run:
bash parallel-dev.sh
⚠️ Requirements:
- claude CLI must be installed and authenticated
- Run from the project root directory
- Ensure no other claude instances are conflicting
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub wonder-zhang/openspec-autodev --plugin openspec-autodev