Skip to content

jnMetaCode/superpowers-zh / skills/subagent-driven-development

subagent-driven-development

Verified

当在当前会话中执行包含独立任务的实现计划时使用

FileKindSize
SKILL.mdskill md17.7 KB
implementer-prompt.mdmarkdown6.0 KB
re-review-prompt.mdmarkdown5.0 KB
references/example-workflow.mdmarkdown2.5 KB
references/final-review.mdmarkdown1.6 KB
references/finishing.mdmarkdown868 B
references/fix-loop.mdmarkdown4.3 KB
references/preflight-and-resuming.mdmarkdown3.8 KB
references/report-handling.mdmarkdown1.6 KB
scripts/review-packageexecutablescript2.4 KB
scripts/sdd-repoexecutablescript2.3 KB
scripts/sdd-workspaceexecutablescript4.7 KB
scripts/task-briefexecutablescript4.6 KB
task-reviewer-prompt.mdmarkdown9.0 KB

scripts/sdd-workspace

View on GitHub
#!/usr/bin/env bash
# Resolve and ensure the working-tree directory SDD uses for one plan's
# short-lived artifacts: task briefs, implementer reports, review packages,
# and the progress ledger. Print the plan directory's absolute path.
#
# One directory per plan (.superpowers/sdd/<plan-basename>/) so a follow-up
# plan in the same working tree can never read or overwrite another plan's
# artifacts. A stale ledger misread as current progress makes controllers
# skip whole task sequences — plan-scoping removes that failure structurally.
#
# Basename slugs collide when two plans share a filename (docs/alpha/plan.md
# vs docs/beta/plan.md), so each workspace records its owning plan's path in
# a plan-path marker (repo-relative in-repo, absolute outside). A workspace
# owned by a different plan is skipped and the slug disambiguated with the
# plan's parent-directory name, then a counter. A workspace with no marker
# predates the marker scheme and is adopted for the current plan so in-flight
# workspaces keep resolving — which means the first collision on such a
# legacy workspace adopts instead of detecting; acceptable, marker-less
# workspaces age out as plans finish.
#
# The workspace lives in the working tree (not under .git/) because Claude Code
# treats .git/ as a protected path and denies agent writes there — which blocks
# an implementer subagent from writing its report file. A self-ignoring
# .gitignore at .superpowers/sdd/ keeps every plan's workspace out of
# `git status` and out of accidental commits without modifying any tracked file.
#
# Single source of truth for the workspace location, so task-brief and
# review-package cannot drift to different directories.
#
# The repository is the current directory's (see sdd-repo). -C DIR runs as
# if started in DIR, the way git -C does: a caller working on another
# checkout or worktree needs no `cd DIR ;` prefix, a compound that harnesses
# cannot allowlist because DIR differs on every run (#1799).
#
# Usage: sdd-workspace [-C DIR] PLAN_FILE
set -euo pipefail

here=$(cd "$(dirname "$0")" && pwd)
if [ "${1:-}" = "-C" ]; then
  [ -d "${2:-}" ] || { echo "bad -C directory: ${2:-}" >&2; exit 2; }
  cd "$2"
  shift 2
fi

if [ $# -ne 1 ]; then
  echo "usage: sdd-workspace [-C DIR] PLAN_FILE" >&2
  exit 2
fi

plan=$1
[ -f "$plan" ] || { echo "no such plan file: $plan" >&2; exit 2; }

slug=$(basename "$plan" .md)
[ -n "$slug" ] && [ "$slug" != "." ] && [ "$slug" != ".." ] \
  || { echo "cannot derive a workspace name from: $plan" >&2; exit 2; }

# Physical path, spelled the way pwd -P spells the plan path below: on Git
# Bash, rev-parse prints C:/Users/... while pwd prints /c/Users/..., and the
# repo-relative marker check needs both in the same form. Two steps, so a
# failing sdd-repo stops the script instead of handing cd an empty path.
# Invoke via bash rather than direct exec: some extractors (Python zipfile)
# strip Unix exec bits when unpacking marketplace packages (#2040).
toplevel=$("${BASH:-bash}" "$here/sdd-repo")
root=$(CDPATH='' cd -- "$toplevel" && pwd -P)
base="$root/.superpowers/sdd"

# Normalize the plan path (physical directory, so relative/absolute/../
# spellings of one plan compare equal) and express it as the marker value:
# repo-relative when the plan lives under the repo root, absolute otherwise.
plan_dir=$(CDPATH='' cd -- "$(dirname "$plan")" && pwd -P)
plan_abs="$plan_dir/$(basename "$plan")"
case "$plan_abs" in
  "$root"/*) plan_id=${plan_abs#"$root"/} ;;
  *)         plan_id=$plan_abs ;;
esac

# True when the workspace at $1 is (or becomes) this plan's: an existing
# marker must name this plan; a missing marker means a new workspace or a
# pre-marker legacy one, and either way the plan claims it by writing one.
owns() {
  if [ -e "$1/plan-path" ]; then
    [ "$(cat "$1/plan-path")" = "$plan_id" ]
  else
    mkdir -p "$1"
    printf '%s\n' "$plan_id" > "$1/plan-path"
  fi
}

dir="$base/$slug"
if ! owns "$dir"; then
  parent=$(basename "$plan_dir")
  dir="$base/$slug-$parent"
  if ! owns "$dir"; then
    n=2
    while ! owns "$base/$slug-$parent-$n"; do n=$((n + 1)); done
    dir="$base/$slug-$parent-$n"
  fi
fi

# Create-only: a repo may commit its own .gitignore here (e.g. to version
# progress.md ledgers); overwriting it would revert that on every run.
[ -e "$base/.gitignore" ] || printf '*\n' > "$base/.gitignore"

# On Windows (Git Bash, MSYS2, Cygwin) print C:/Users/... rather than
# /c/Users/... or /tmp/...: the caller may be PowerShell or another native
# tool, which can't resolve MSYS paths, and bash accepts this form too.
# Only the printed path changes; the plan-path markers above keep pwd -P's
# spelling, so existing workspaces still match their plans.
CDPATH='' cd -- "$dir"
if command -v cygpath >/dev/null 2>&1; then cygpath -m "$PWD"; else pwd; fi
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 463kUpdated Claude CodeCodexVerifiedInstall
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 463kUpdated Claude CodeCodexVerifiedInstall
discernment-nudgeanthropics/skillsAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.Stars: 195kUpdated Claude CodeCodexVerifiedInstall
internal-commsanthropics/skillsA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).Stars: 195kUpdated Claude CodeCodexVerifiedInstall