scripts/task-start
#!/usr/bin/env bash# Begin one task of an inline plan execution in a single call: extract the# task's brief (via subagent-driven-development's task-brief, so both skills# share one workspace) and record BASE, the commit the task's review range is# cut from. One tool call instead of two, because every call in an inline# session is a turn that re-reads the whole context.## Usage: task-start PLAN_FILE TASK_NUMBER# Prints:# brief: <path to the task's brief file># base: <full SHA of HEAD>set -euo pipefail
if [ $# -ne 2 ]; then echo "usage: task-start PLAN_FILE TASK_NUMBER" >&2 exit 2fi
plan=$1n=$2sdd="$(cd "$(dirname "$0")/../../subagent-driven-development/scripts" && pwd)"
# BASE comes from the same repository the brief is written into (sdd-repo# also refuses one with no commit yet), not from the bare cwd.repo=$("${BASH:-bash}" "$sdd/sdd-repo" --with-commit)out=$("$sdd/task-brief" "$plan" "$n")brief=$(printf '%s\n' "$out" | sed -n 's/^wrote \(.*\): [0-9][0-9]* lines$/\1/p')[ -n "$brief" ] || { echo "task-brief did not report a path: $out" >&2; exit 1; }base=$(git -C "$repo" rev-parse --verify HEAD)
echo "brief: $brief"echo "base: $base"