task-start 963 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. # Begin one task of an inline plan execution in a single call: extract the
  3. # task's brief (via subagent-driven-development's task-brief, so both skills
  4. # share one workspace) and record BASE, the commit the task's review range is
  5. # cut from. One tool call instead of two, because every call in an inline
  6. # session is a turn that re-reads the whole context.
  7. #
  8. # Usage: task-start PLAN_FILE TASK_NUMBER
  9. # Prints:
  10. # brief: <path to the task's brief file>
  11. # base: <full SHA of HEAD>
  12. set -euo pipefail
  13. if [ $# -ne 2 ]; then
  14. echo "usage: task-start PLAN_FILE TASK_NUMBER" >&2
  15. exit 2
  16. fi
  17. plan=$1
  18. n=$2
  19. sdd="$(cd "$(dirname "$0")/../../subagent-driven-development/scripts" && pwd)"
  20. out=$("$sdd/task-brief" "$plan" "$n")
  21. brief=$(printf '%s\n' "$out" | sed -n 's/^wrote \(.*\): [0-9][0-9]* lines$/\1/p')
  22. [ -n "$brief" ] || { echo "task-brief did not report a path: $out" >&2; exit 1; }
  23. echo "brief: $brief"
  24. echo "base: $(git rev-parse HEAD)"