Skip to content

me2resh/apexyard / .claude/skills/orbit

Run the opt-in ORBIT planning lifecycle for one managed project without replacing ApexYard governance.

FileKindSize
SKILL.mdskill md27.5 KB
lib/handoff-preflight.shexecutablescript9.2 KB
lib/record-check.shexecutablescript3.5 KB
lib/records-lint.shexecutablescript14.5 KB
lib/refresh-slice-record.shexecutablescript3.4 KB
lib/resolve-project-repo.shexecutablescript2.1 KB
lib/slice-pr-lint.shscript10.6 KB
lib/status-live.shexecutablescript3.4 KB
lib/warn-criterion-shape.shexecutablescript3.3 KB
lib/warn-uncovered-outcomes.shexecutablescript8.2 KB
tests/_lib-fixtures.shexecutablescript8.0 KB
tests/_lib-slice-fixtures.shscript1.8 KB
tests/smoke.shexecutablescript1.3 KB
tests/test_criterion_shape.shexecutablescript3.5 KB
tests/test_handoff_allows_duplicate_prefix_match.shexecutablescript1.9 KB
tests/test_handoff_preflight_happy_path.shexecutablescript1.9 KB
tests/test_handoff_refusal_cli_absent.shexecutablescript1.6 KB
tests/test_handoff_refusal_duplicate_search_fails.shexecutablescript1.5 KB
tests/test_handoff_refusal_duplicate_search_truncated.shexecutablescript2.1 KB
tests/test_handoff_refusal_duplicate_slice.shexecutablescript1.8 KB
tests/test_handoff_refusal_leak_scrub.shexecutablescript4.8 KB
tests/test_handoff_refusal_missing_option_value.shexecutablescript2.4 KB
tests/test_handoff_refusal_slice_id_double_quote.shexecutablescript2.9 KB
tests/test_handoff_refusal_slice_id_newline.shexecutablescript2.8 KB
tests/test_handoff_refusal_validate_fails.shexecutablescript1.4 KB
tests/test_record_check_blank_line.shexecutablescript4.1 KB
tests/test_record_check_change_only.shexecutablescript3.7 KB
tests/test_records_lint_changed_fields.shexecutablescript4.8 KB
tests/test_records_lint_faults.shexecutablescript6.1 KB
tests/test_records_lint_slice_evidence.shscript1.2 KB
tests/test_records_lint_slice_merge_base_drift.shexecutablescript7.2 KB
tests/test_records_lint_slice_provenance.shscript532 B
tests/test_records_lint_slice_scope.shscript1.8 KB
tests/test_records_lint_slice_warn.shscript324 B
tests/test_records_lint_upstream_skip.shscript3.0 KB
tests/test_refresh_slice_record.shscript3.4 KB
tests/test_resolve_project_repo_registry.shexecutablescript4.2 KB
tests/test_slice_pr_proposal.shscript2.9 KB
tests/test_slice_ticket_workflow.shscript1.4 KB
tests/test_status_live_squash_commit.shscript858 B
tests/test_status_live_writes_nothing.shexecutablescript1.9 KB
tests/test_uncovered_outcomes.shscript11.0 KB

tests/_lib-fixtures.sh

View on GitHub
#!/bin/bash
# _lib-fixtures.sh — shared sandbox + ORBIT record fixtures for the
# /orbit handoff smoke tests (apexyard#1446).
#
# Builds a throwaway orbit_root with a matching, schema-valid Plan,
# Snapshot, Reconciliation and Execution Slice, all named with synthetic
# (non-portfolio) identifiers, plus mock `orbit`/`gh` binaries on PATH.
#
# Usage:
#   source "$(dirname "$0")/_lib-fixtures.sh"
#   sb=$(make_sandbox)
#   orbit_root=$(fixtures_write_orbit_root "$sb")
#   slice_file="$orbit_root/slices/slice-demo-o1.json"

make_sandbox() {
  mktemp -d "${TMPDIR:-/tmp}/orbit-handoff-test.XXXXXX"
}

# Writes a valid, self-consistent Plan/Snapshot/Reconciliation/Slice record
# set under <sandbox>/orbit. Every record matches the real orbit-spec v0.1
# schemas (verified against the real CLI — see the PR body for the command).
# Prints the orbit_root path.
fixtures_write_orbit_root() {
  sb="$1"
  orbit_root="$sb/orbit"
  mkdir -p "$orbit_root/plans" "$orbit_root/snapshots" "$orbit_root/reconciliations" "$orbit_root/slices"

  cat > "$orbit_root/plans/plan-demo-widget.r1.json" <<'JSON'
{
  "specVersion": "0.1",
  "id": "plan-demo-widget",
  "revision": 1,
  "project": { "id": "demo-widget" },
  "title": "Demo widget plan",
  "intent": "Synthetic fixture plan for /orbit handoff smoke tests.",
  "outcomes": [{ "id": "o1-demo", "title": "Demo outcome" }],
  "acceptanceCriteria": [{ "id": "ac1-1", "outcomeId": "o1-demo", "statement": "Demo criterion." }]
}
JSON

  cat > "$orbit_root/snapshots/snapshot-demo-widget-1.json" <<'JSON'
{
  "specVersion": "0.1",
  "id": "snapshot-demo-widget-1",
  "project": { "id": "demo-widget" },
  "observedAt": "2026-09-28T00:00:00Z",
  "repositories": [
    { "repositoryId": "demo-widget", "branch": "main", "commit": "0000000000000000000000000000000000000a" }
  ]
}
JSON

  cat > "$orbit_root/reconciliations/reconciliation-demo-widget-r1.json" <<'JSON'
{
  "specVersion": "0.1",
  "id": "reconciliation-demo-widget-r1",
  "planId": "plan-demo-widget",
  "planRevision": 1,
  "projectSnapshotId": "snapshot-demo-widget-1",
  "reconciledAt": "2026-09-28T00:00:00Z",
  "observations": [],
  "criterionAssessments": [
    { "criterionId": "ac1-1", "status": "not-verified", "evidence": [], "explanation": "fixture" }
  ]
}
JSON

  cat > "$orbit_root/slices/slice-demo-o1.json" <<'JSON'
{
  "specVersion": "0.1",
  "id": "slice-demo-widget-o1",
  "planId": "plan-demo-widget",
  "outcomeId": "o1-demo",
  "basedOn": {
    "planRevision": 1,
    "reconciliationId": "reconciliation-demo-widget-r1",
    "repositories": { "demo-widget": "0000000000000000000000000000000000000a" }
  },
  "objective": "Fixture objective for the handoff smoke test.",
  "why": "Fixture reason.",
  "contributesTo": ["ac1-1"],
  "scope": { "include": ["fixture item"], "exclude": ["fixture excluded item"] }
}
JSON

  echo "$orbit_root"
}

# Installs a mock `orbit` on PATH inside <sandbox>/bin. `validate_exit`
# controls the `validate --all` exit code (default 0). `sync_exit` controls
# `sync github --dry-run`'s exit code (default 0, printing a clean preview
# whose body carries no private text — safe under any repo).
fixtures_install_mock_orbit() {
  sb="$1"
  validate_exit="${2:-0}"
  sync_exit="${3:-0}"
  mkdir -p "$sb/bin"
  cat > "$sb/bin/orbit" <<EOF
#!/bin/bash
if [ "\$1" = "validate" ]; then
  if [ "$validate_exit" != "0" ]; then
    echo "mock orbit: fixture validation failure" >&2
    exit "$validate_exit"
  fi
  echo "Validated 4 ORBIT records."
  exit 0
fi
if [ "\$1" = "sync" ] && [ "\$2" = "github" ]; then
  if [ "$sync_exit" != "0" ]; then
    echo "mock orbit: fixture sync failure" >&2
    exit "$sync_exit"
  fi
  echo '{"dryRun":true,"repo":"demo-org/demo-widget","title":"[Slice] Fixture objective for the handoff smoke test.","body":"## Orbit Execution Slice\n\nFixture objective for the handoff smoke test.\n\n### Why now\nFixture reason.\n\n### Scope\n**Includes**\n- fixture item\n\n**Excludes**\n- fixture excluded item\n\n### Orbit identifiers\n- Slice: \`slice-demo-widget-o1\`\n"}'
  exit 0
fi
echo "mock orbit: unhandled args: \$*" >&2
exit 99
EOF
  chmod +x "$sb/bin/orbit"
}

# Installs a mock `orbit` whose dry-run preview body carries `private_word`
# as the FIRST WORD of the "### Why now" line — i.e. in the raw JSON, the
# character immediately before it is the "n" of the "\n" escape, not a real
# newline. A scrub run against the raw JSON misses this; a scrub run against
# the jq -r plain-text body catches it. Used by the leak-scrub refusal test.
fixtures_install_mock_orbit_with_leak() {
  sb="$1"
  private_word="$2"
  mkdir -p "$sb/bin"
  cat > "$sb/bin/orbit" <<EOF
#!/bin/bash
if [ "\$1" = "validate" ]; then
  echo "Validated 4 ORBIT records."
  exit 0
fi
if [ "\$1" = "sync" ] && [ "\$2" = "github" ]; then
  echo '{"dryRun":true,"repo":"me2resh/apexyard","title":"[Slice] Fixture objective for the handoff smoke test.","body":"## Orbit Execution Slice\n\nFixture objective for the handoff smoke test.\n\n### Why now\n$private_word needs this before the deadline.\n\n### Scope\n**Includes**\n- fixture item\n\n**Excludes**\n- fixture excluded item\n\n### Orbit identifiers\n- Slice: \`slice-demo-widget-o1\`\n"}'
  exit 0
fi
echo "mock orbit: unhandled args: \$*" >&2
exit 99
EOF
  chmod +x "$sb/bin/orbit"
}

# Installs a mock `gh` on PATH inside <sandbox>/bin. `gh issue list` reads
# two env vars at call time (not baked in at install time), so one mock
# serves every duplicate-check scenario:
#   MOCK_GH_FAIL=1                       -> the search itself fails (exit 1)
#   MOCK_GH_ISSUE_LIST_JSON_FILE=<path>  -> `cat`s that file as the result
#   (neither set)                        -> prints an empty array
fixtures_install_mock_gh() {
  sb="$1"
  mkdir -p "$sb/bin"
  cat > "$sb/bin/gh" <<'EOF'
#!/bin/bash
if [ "$1" = "issue" ] && [ "$2" = "list" ]; then
  if [ "${MOCK_GH_FAIL:-0}" = "1" ]; then
    echo "gh: mock search failure (HTTP 502)" >&2
    exit 1
  fi
  if [ -n "${MOCK_GH_ISSUE_LIST_JSON_FILE:-}" ] && [ -f "${MOCK_GH_ISSUE_LIST_JSON_FILE:-}" ]; then
    cat "$MOCK_GH_ISSUE_LIST_JSON_FILE"
  else
    echo '[]'
  fi
  exit 0
fi
echo "mock gh: unhandled args: $*" >&2
exit 99
EOF
  chmod +x "$sb/bin/gh"
}

# Builds a fully sandboxed copy of the leak-scrub hook plus the
# handoff-preflight helper, at the SAME relative depth they have in the real
# repo (.claude/hooks/check-private-refs-runtime.sh and
# .claude/skills/orbit/lib/handoff-preflight.sh), so the helper's own
# self-location path resolution finds the sandboxed scrub — never the real
# fork's. Also copies _lib-registry-parser.sh into the sandbox hooks dir.
# The scrub fail-closes when that parser is missing, so every input would
# exit 2 (and the helper would exit 14) even when the preview text is clean.
# The parser sources no other file under .claude/hooks/, so nothing else is
# copied with it. _lib-portfolio-paths.sh and _lib-read-config.sh stay out:
# the scrub treats both as optional, and leaving them out keeps the sandbox
# isolated from this fork. Also writes a synthetic registry at
# <sandbox>/apexyard.projects.yaml with one private project, so the scrub
# has a real (but made-up) name to catch. Prints the path to the sandboxed
# helper.
fixtures_install_leak_scrub_sandbox() {
  sb="$1"
  private_name="${2:-zephyrvault}"
  private_repo="${3:-acme-private/zephyrvault}"

  real_root="$(cd "$(dirname "$0")/../../../.." && pwd)"
  mkdir -p "$sb/.claude/hooks" "$sb/.claude/skills/orbit/lib"
  cp "$real_root/.claude/hooks/check-private-refs-runtime.sh" "$sb/.claude/hooks/check-private-refs-runtime.sh"
  cp "$real_root/.claude/hooks/_lib-registry-parser.sh" "$sb/.claude/hooks/_lib-registry-parser.sh"
  cp "$real_root/.claude/skills/orbit/lib/handoff-preflight.sh" "$sb/.claude/skills/orbit/lib/handoff-preflight.sh"
  chmod +x "$sb/.claude/hooks/check-private-refs-runtime.sh" "$sb/.claude/skills/orbit/lib/handoff-preflight.sh"

  cat > "$sb/apexyard.projects.yaml" <<YAML
projects:
  - name: $private_name
    repo: $private_repo
    workspace: workspace/$private_name
YAML

  echo "$sb/.claude/skills/orbit/lib/handoff-preflight.sh"
}
planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies.Stars: 108kUpdated Claude CodeCodexVerifiedInstall
meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "会议纪要".Stars: 108kUpdated Claude CodeCodexVerifiedInstall