Skip to content

sno-ai/sno-station-skills / skills/T-delegation-and-work-orders/pl/skills/pl

MANUAL-ONLY — load solely when the human owner types `/pl`, uses `$pl`, or asks you to act as the Project Lead (PL). Supervise one project lane and its executor agents. A charter or dispatch means: you are an EXECUTOR, not the PL.

FileKindSize
SKILL.mdskill md61.7 KB
references/callsigns.txtmarkdown384 B
references/decision-rights.mdmarkdown4.8 KB
references/dispatch-template.mdmarkdown38.2 KB
references/pocket-card.mdmarkdown1.9 KB
references/progress-reporting-hooks.mdmarkdown2.3 KB
references/todo-template.mdmarkdown6.9 KB
scripts/agent-cli-help.tother1.2 KB
scripts/attempt-gate.shexecutablescript3.6 KB
scripts/attempt-gate.tother4.6 KB
scripts/callsign-transfer-e2e.shexecutablescript7.9 KB
scripts/callsign-worktree.tother1.7 KB
scripts/callsign.shexecutablescript15.2 KB
scripts/convergence-watch.shexecutablescript8.6 KB
scripts/core-structure.tother5.7 KB
scripts/docker-env-doctor.shexecutablescript19.4 KB
scripts/exec-sentinel.shexecutablescript5.8 KB
scripts/exec-sentinel.tother2.4 KB
scripts/exec-state.shexecutablescript20.8 KB
scripts/exec-state.tother23.1 KB
scripts/exec-trust.shscript5.3 KB
scripts/exec-trust.tother6.4 KB
scripts/executor-wall.shexecutablescript6.8 KB
scripts/executor-wall.texecutablescript9.5 KB
scripts/fence-check.shexecutablescript4.4 KB
scripts/general-env-doctor.shexecutablescript14.0 KB
scripts/general-env-doctor.tother5.8 KB
scripts/gpu-watch.shexecutablescript4.5 KB
scripts/gpu-watch.tother1.5 KB
scripts/lane-open.shexecutablescript4.1 KB
scripts/lane-open.tother3.9 KB
scripts/lane-resolve.shexecutablescript5.0 KB
scripts/lane-resolve.texecutablescript7.0 KB
scripts/log-watch.shexecutablescript10.9 KB
scripts/log-watch.texecutablescript6.8 KB
scripts/on-station-proof.texecutablescript1.9 KB
scripts/portable-paths.tother1.5 KB
scripts/roster-git.tother4.1 KB
scripts/roster-reach.tother2.8 KB
scripts/roster.shexecutablescript19.9 KB
scripts/script-running.shscript5.8 KB
scripts/script-running.tother3.7 KB
scripts/selftest/run-selftest.shexecutablescript1.2 KB
scripts/spawn-exec-generation-e2e.shexecutablescript1.9 KB
scripts/spawn-exec-help.tother2.8 KB
scripts/spawn-exec-interactive-e2e.shscript13.2 KB
scripts/spawn-exec-lane-resolve.tother3.5 KB
scripts/spawn-exec-mission-state-e2e.shscript1.8 KB
scripts/spawn-exec-on-station-e2e.shexecutablescript2.2 KB
scripts/spawn-exec-operate.tother9.4 KB
scripts/spawn-exec.shexecutablescript36.8 KB
scripts/todo-close-evidence.tother1.2 KB
scripts/todo.shexecutablescript35.5 KB
scripts/todo.tother27.9 KB

scripts/lane-resolve.sh

View on GitHub
#!/usr/bin/env bash
# lane-resolve.sh — resolve ONE registry row, and take every field from that same row.
#
# The registry is keyed on (repository, lane), and a repository may carry several lanes.
# A lookup that matches on repository alone and takes the first row would hand lane B
# lane A's Reach address and lane A's owning COS, with no error. So this script resolves the
# row once, fails closed when it is not exactly one, and reads every field from that row.
# A lookup that cannot say which lane it means is refused rather than guessed.
#
# usage: lane-resolve.sh [--repo <path-or-name>] [--lane <lane>] [--field <name>]
#   --repo    path or bare name; defaults to the current directory
#   --lane    required only when the repository carries more than one; defaults to $PL_LANE
#   --field   lane | addr | cos_token | cos_addr | state | all   (default: all)
# prints  lane<TAB>pl_addr<TAB>owning_cos<TAB>cos_addr<TAB>state
# exit 0 = resolved · 64 = no row, ambiguous lane, or a malformed address · 65 = no registry
#
# For a lane that no COS has claimed, cos_addr is $SNO_OWNER_ADDR: the Reach address of the
# owner's own seat (the person or agent who supervises unclaimed lanes). Export it before
# running the PL, for example: export SNO_OWNER_ADDR=owner.me@host1
# Needs the cos skill's cos-claim.sh (override with $PL_COS_CLAIM).
set -Eeuo pipefail

skill_dir="$(cd -- "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")/.." && pwd)"
cos_dir="$skill_dir/../cos"
if [[ -d "$skill_dir/../../../cos/skills/cos" ]]; then
  cos_dir="$skill_dir/../../../cos/skills/cos"
fi

REGISTRY="${PL_REGISTRY:-$HOME/.local/state/pl-registry.tsv}"
COS_CLAIM="${PL_COS_CLAIM:-$cos_dir/scripts/cos-claim.sh}"

repo=""
lane="${PL_LANE:-}"
field="all"
while [[ $# -gt 0 ]]; do
  case "$1" in
    --repo)  repo="${2:-}"; shift 2 ;;
    --lane)  lane="${2:-}"; shift 2 ;;
    --field) field="${2:-}"; shift 2 ;;
    -h|--help)
      sed -n '/^# usage:/,/^# Needs the cos skill/p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
    *) printf 'lane-resolve: unknown argument: %s\n' "$1" >&2; exit 64 ;;
  esac
done

case "$field" in
  lane|addr|cos_token|cos_addr|state|all) ;;
  *) printf 'lane-resolve: --field takes lane|addr|cos_token|cos_addr|state|all, got: %s\n' \
       "$field" >&2; exit 64 ;;
esac

[[ -f "$REGISTRY" ]] || {
  printf 'lane-resolve: no registry at %s\n' "$REGISTRY" >&2; exit 65; }

[[ -n "$repo" ]] || repo="$PWD"
repo="$(basename -- "$repo")"

[[ -x "$COS_CLAIM" ]] || {
  printf 'lane-resolve: cos-claim.sh not found or not executable: %s (install the cos skill or set PL_COS_CLAIM)\n' "$COS_CLAIM" >&2; exit 65; }
registry_target="$(readlink -f -- "$REGISTRY")" || {
  printf 'lane-resolve: cannot resolve registry target: %s\n' "$REGISTRY" >&2; exit 65; }
if ! SNO_PL_REGISTRY="$registry_target" "$COS_CLAIM" reap "$repo" >/dev/null; then
  printf 'lane-resolve: could not reclaim expired lanes for %s\n' "$repo" >&2
  exit 65
fi

# Retired rows are not candidates: a closed lane must never resolve as the live one.
rows="$(awk -F '\t' -v r="$repo" -v l="$lane" '
  NR > 1 && $1 == r && $2 != "-" && toupper($7) != "RETIRED" &&
      (l == "" || $2 == l) {
    print $2 "\t" $3 "\t" $6 "\t" $7
  }' "$REGISTRY")"

count="$(printf '%s' "$rows" | grep -c . || true)"

if [[ "$count" -eq 0 ]]; then
  if [[ -n "$lane" ]]; then
    printf 'lane-resolve: no active row for repository %s lane %s\n' "$repo" "$lane" >&2
  else
    printf 'lane-resolve: no active row for repository %s\n' "$repo" >&2
  fi
  exit 64
fi

if [[ "$count" -gt 1 ]]; then
  printf 'lane-resolve: %s carries %s active lanes; name one with --lane or $PL_LANE:\n' \
    "$repo" "$count" >&2
  printf '%s\n' "$rows" | cut -f1 | sed 's/^/  /' >&2
  exit 64
fi

IFS=$'\t' read -r r_lane r_addr r_cos r_state <<< "$rows"

# The address shape is checked here rather than at each call site: a placeholder in the
# registry would otherwise look like a real address until something tries to send.
case "$r_addr" in
  pl.*@*) ;;
  *) printf 'lane-resolve: %s lane %s has no strict PL address (%s)\n' \
       "$repo" "$r_lane" "${r_addr:-<empty>}" >&2; exit 64 ;;
esac

# An unclaimed lane is not an error — it means the owner supervises it until a COS claims it.
case "$r_cos" in
  cos/*) cos_addr="cos.${r_cos#cos/}@$(hostname)" ;;
  *)
    # Only the fields that print the supervisor address need the owner's address.
    [[ "$field" != cos_addr && "$field" != all ]] || [[ -n "${SNO_OWNER_ADDR:-}" ]] || {
      printf 'lane-resolve: %s lane %s is not claimed by a COS, so cards go to the owner'"'"'s own Reach seat, but SNO_OWNER_ADDR is not set. Export it (for example: export SNO_OWNER_ADDR=owner.me@host1) and retry\n' \
        "$repo" "$r_lane" >&2; exit 64; }
    cos_addr="${SNO_OWNER_ADDR:-}" ;;
esac

case "$field" in
  lane)      printf '%s\n' "$r_lane" ;;
  addr)      printf '%s\n' "$r_addr" ;;
  cos_token) printf '%s\n' "$r_cos" ;;
  cos_addr)  printf '%s\n' "$cos_addr" ;;
  state)     printf '%s\n' "$r_state" ;;
  all)       printf '%s\t%s\t%s\t%s\t%s\n' "$r_lane" "$r_addr" "$r_cos" "$cos_addr" "$r_state" ;;
esac
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: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall