[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M757Z3YFX39SXMS175XW3WS2":3,"skill-same:01M757Z3YFX39SXMS175XW3WS2":88},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M757Z3YFX39SXMS175XW3WS2","codebase-portability",null,"Systematically find and fix hardcoded absolute paths across scripts, docs, and configs. Ensures codebases work regardless of clone location or OS. Covers BASH_SOURCE-based path derivation, OS-aware case dispatch, shutil.which for Python, and ${VAR:-default} fallback patterns for docs.","lukemcqueen\u002Fsteadfaste-fleet","lukemcqueen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F405240?v=4","01M757MHPAGRXTJAT46SKZP98R","Luke McQueen","01M757MHPZ573KP8DT9GB8SBQ7",4,"MIT","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: codebase-portability\nversion: 1.0.0\ncategory: devops\ndescription: >-\n  Systematically find and fix hardcoded absolute paths across scripts, docs,\n  and configs. Ensures codebases work regardless of clone location or OS.\n  Covers BASH_SOURCE-based path derivation, OS-aware case dispatch,\n  shutil.which for Python, and ${VAR:-default} fallback patterns for docs.\ntrigger: >-\n  User asks to fix hardcoded paths, remove absolute path assumptions, make\n  scripts portable, fix install-location assumptions, prevent path breakage\n  when cloning, or 'no hardcoded paths'. Also applicable when migrating a\n  codebase between machines or noticing a script has $HOME assumptions.\n---\n\n# Codebase Portability — Hardcoded Path Audit\n\nRemove absolute path assumptions from scripts, configs, and documentation\nso the codebase works regardless of where it's cloned or which OS runs it.\n\n---\n\n## Scan Phase\n\nRun **multiple independent pattern scans** in parallel to find all\nhardcoded paths before making any changes:\n\n```bash\n# Personal home directories (worst — breaks on any other user)\ngrep -rn '\u002Fhome\u002Fluke' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fhome\u002Fmoses' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002FUsers\u002F' . 2>\u002Fdev\u002Fnull\n\n# ~\u002Frepo-name assumptions (breaks if cloned elsewhere)\ngrep -rn '~\u002Fsteadfaste-fleet' . 2>\u002Fdev\u002Fnull\ngrep -rn '~\u002Fsteadfaste-fleet-private' . 2>\u002Fdev\u002Fnull\n\n# Hardcoded binary paths (breaks if OS\u002Fpkg-manager differs)\ngrep -rn '\u002Fusr\u002Flocal\u002Fbin\u002Fdocker' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fusr\u002Flocal\u002Fbin\u002Fbrew' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fopt\u002Fhomebrew\u002Fbin\u002F' . 2>\u002Fdev\u002Fnull\n\n# macOS-only nginx\u002Ffail2ban paths (ignores Linux)\ngrep -rn '\u002Fusr\u002Flocal\u002Fetc\u002Fnginx' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fusr\u002Flocal\u002Fetc\u002Ffail2ban' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fusr\u002Flocal\u002Fvar\u002Flog\u002Fnginx' . 2>\u002Fdev\u002Fnull\n\n# Other common absolute paths\ngrep -rn '\u002Fhome\u002F' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fopt\u002F' . 2>\u002Fdev\u002Fnull  # but NOT Dockerfile --mount target=\u002Froot\u002F\ngrep -rn '\u002Froot\u002F' . 2>\u002Fdev\u002Fnull\n```\n\n**Exclude noise:** shebangs (`#!\u002Fusr\u002Fbin\u002Fenv`), Docker build cache mounts\n(`target=\u002Froot\u002F`), standard OS paths (`\u002Fetc\u002Fssl`, `\u002Fetc\u002Fletsencrypt`),\noffline code corpus examples (reference snippets, not functional code),\n`.plist` files (macOS launchd, system-specific).\n\n## Categorize Findings\n\nSort into tiers before fixing:\n\n| Tier | Type | Examples | Action |\n|------|------|----------|--------|\n| **1 — Critical** | Executable scripts with absolute paths | `~\u002F...`, `\u002Fusr\u002Flocal\u002Fbin\u002Fdocker` | Fix immediately — blocks other users |\n| **2 — Portability** | OS-specific paths in scripts | macOS-only nginx paths | Add OS-aware dispatch |\n| **3 — Docs\u002FSkills** | Instructional `~\u002Frepo\u002F` paths | `cd ~\u002Fsteadfaste-fleet` in SKILL.md | Use `$FLEET_REPO` fallback pattern |\n| **4 — Stale** | Docs describing only one OS | macOS-only setup instructions | Add Linux notes or platform table |\n\n## Fix Patterns\n\n### Pattern A: Script-relative repo path (Shell)\n\nReplace `~\u002Frepo-name` or absolute `\u002Fhome\u002Fuser\u002Frepo-name` with auto-derived\npath from `BASH_SOURCE`:\n\n```bash\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$(cd \"$SCRIPT_DIR\u002F..\u002F..\" && pwd)\"  # walk up to repo root\n```\n\nFor scripts deeper in the tree, adjust the `..` count. Verify:\n\n```bash\ngrep -n 'FLEET_REPO\\|SCRIPT_DIR\\|SRC' path\u002Fto\u002Fscript.sh\n```\n\n### Pattern B: OS-aware path dispatch (Shell)\n\nReplace single-OS hardcoded paths with `case $(uname -s)`:\n\n```bash\ncase \"$(uname -s)\" in\n  Darwin)\n    if [[ \"$(uname -m)\" == \"arm64\" ]]; then\n      NGINX_DIR=\"\u002Fopt\u002Fhomebrew\u002Fetc\u002Fnginx\"\n    else\n      NGINX_DIR=\"\u002Fusr\u002Flocal\u002Fetc\u002Fnginx\"\n    fi\n    ;;\n  Linux)\n    NGINX_DIR=\"\u002Fetc\u002Fnginx\"\n    ;;\nesac\n```\n\nThen use `$NGINX_DIR` throughout.\n\n### Pattern C: Python binary discovery\n\nReplace hardcoded `\u002Fusr\u002Flocal\u002Fbin\u002Fdocker` with `shutil.which`:\n\n```python\nimport os, shutil\n\ndef _docker_bin() -> str:\n    \"\"\"Locate docker binary, falling back to PATH.\"\"\"\n    env = os.environ.get(\"DOCKER_BIN\")\n    if env:\n        return env\n    found = shutil.which(\"docker\")\n    return found or \"docker\"\n```\n\n### Pattern C2: Python OS-aware binary + config directory discovery\n\n`shutil.which` finds binaries on PATH, but config trees (nginx, fail2ban,\npostgres) live at OS-specific paths that `which` can't discover. For tools\nlike nginx where both the binary path AND the config directory vary by OS,\nprobe candidate paths directly:\n\n```python\nimport os, sys\n\ndef _detect_nginx_paths() -> tuple[str, str]:\n    \"\"\"Detect nginx binary and config directory, platform-aware.\n\n    Returns (nginx_bin, config_dir).\n    Linux:       \u002Fusr\u002Fsbin\u002Fnginx, \u002Fetc\u002Fnginx\n    macOS arm64: \u002Fopt\u002Fhomebrew\u002Fbin\u002Fnginx, \u002Fopt\u002Fhomebrew\u002Fetc\u002Fnginx\n    macOS x86_64: \u002Fusr\u002Flocal\u002Fbin\u002Fnginx, \u002Fusr\u002Flocal\u002Fetc\u002Fnginx\n    \"\"\"\n    candidates_bin = [\n        \"\u002Fusr\u002Fsbin\u002Fnginx\",\n        \"\u002Fusr\u002Flocal\u002Fbin\u002Fnginx\",\n        \"\u002Fopt\u002Fhomebrew\u002Fbin\u002Fnginx\",\n    ]\n    nginx_bin = next(\n        (p for p in candidates_bin if os.path.isfile(p)),\n        \"\u002Fusr\u002Fsbin\u002Fnginx\",  # fallback\n    )\n\n    if sys.platform == \"darwin\":\n        if os.uname().machine == \"arm64\":\n            conf_dir = \"\u002Fopt\u002Fhomebrew\u002Fetc\u002Fnginx\"\n        else:\n            conf_dir = \"\u002Fusr\u002Flocal\u002Fetc\u002Fnginx\"\n    else:\n        conf_dir = \"\u002Fetc\u002Fnginx\"\n\n    return nginx_bin, conf_dir\n```\n\n**When to use this vs Pattern C:** Use `shutil.which` when PATH resolution is\nsufficient (most user-facing commands). Use candidate probing + OS dispatch\nwhen the script also needs to find the tool's configuration tree, which\nlives outside PATH's scope. Both are correct — they solve different problems.\n\n**Same idiom for fail2ban, postgres, etc.** Adjust the candidate path lists\nfor the tool's known OS-specific install locations.\n\n### Pattern D: Doc\u002Fskill path references\n\nReplace bare `~\u002Frepo-name` with env-var fallback pattern:\n\n```markdown\ncd \"${FLEET_REPO:-$HOME\u002Fsteadfaste-fleet}\"\n```\n\nThis works unset (defaults to `~\u002Fsteadfaste-fleet`) or with `FLEET_REPO` override.\n\nFor private repos with no env var convention:\n\n```markdown\ncd \"${FLEET_REPO:-$HOME\u002Fsteadfaste-fleet}-private\"\n```\n\n### Pattern E: macOS-only config paths\n\nReplace `htpasswd \u002Fusr\u002Flocal\u002Fetc\u002Fnginx\u002F.htpasswd` with:\n\n```markdown\nhtpasswd \"${NGINX_HTPASSWD:-\u002Fusr\u002Flocal\u002Fetc\u002Fnginx\u002F.htpasswd}\"\n```\n\nAlso add OS-dependent note:\n\n```markdown\nLinux: `\u002Fetc\u002Fnginx\u002F.htpasswd`, macOS: `\u002Fusr\u002Flocal\u002Fetc\u002Fnginx\u002F.htpasswd`\n```\n\n### Pattern G: Stale pathlib path references after repo restructure\n\nWhen a repo restructures directory layout (e.g., `src\u002F` → `ops\u002F`, or\n`deploy\u002F` → `infra\u002F`), pathlib-based relative paths in Python files\nbecome stale in a way that grep for the full string `old\u002Fdir\u002F` misses,\nbecause pathlib splits them across string literals.\n\n**Example stale pattern:**\n\n```python\nMCP_SERVERS_DIR = FLEET_REPO \u002F \"src\" \u002F \"mcp-servers\"     # old\nFLEET_SCRIPTS = FLEET_REPO \u002F \"src\" \u002F \"scripts\"           # old\n```\n\n**Scan — use terminal grep, not search_files tool:**\n\n`search_files` (ripgrep) struggles with the `\"pattern\"` syntax needed\nto match pathlib string literals. Use terminal grep instead:\n\n```bash\n# Find all pathlib-based stale refs to old dir names\ngrep -rn '\"src\"' . 2>\u002Fdev\u002Fnull | grep -v '.git\u002F' | grep -v '__pycache__'\ngrep -rn '\"deploy\"' . 2>\u002Fdev\u002Fnull | grep -v '.git\u002F'\n\n# Also check docstrings and string formatting (non-pathlib refs)\ngrep -rn 'old-dir\u002F' . 2>\u002Fdev\u002Fnull | grep -v '.git\u002F'\ngrep -rn 'old_dir\u002F' . 2>\u002Fdev\u002Fnull | grep -v '.git\u002F'\n```\n\n**Mapping table — determine old→new mapping:**\n\n| Old prefix | New prefix | Example |\n|------------|-----------|---------|\n| `ops\u002Fscripts\u002F` | `ops\u002Fscripts\u002F` | Python scripts |\n| `src\u002Fmcp-servers\u002F` | `ops\u002Fservices\u002F` | MCP server code |\n| `src\u002Foffline\u002F` | `ops\u002Foffline\u002F` | Offline utilities |\n| `src\u002Fweb-cache\u002F` | `ops\u002Fweb-cache\u002F` | Web cache modules |\n|| `src\u002Fa2a\u002F` | `ops\u002Fservices\u002Fa2a\u002F` (now deprecated, merged into fleet-bus) | Agent card templates |\n\n**Fix using patch tool with exact quotes:**\n\nPathlib paths are built from separate `\"part\"` string literals, so\nthe patch must match the whole `\"old_part\" \u002F \"next_part\"` chain:\n\n```python\n# Before — two pathlib parts\nFLEET_SCRIPTS = FLEET_REPO \u002F \"src\" \u002F \"scripts\"\n\n# After — two parts, new names\nFLEET_SCRIPTS = FLEET_REPO \u002F \"ops\" \u002F \"scripts\"\n```\n\n**Don't forget strings in docstrings, comments, and `add_issue` calls:**\n\nThese are plain text (not pathlib), so a broader search is needed:\n\n```bash\ngrep -rn 'src\u002F' . 2>\u002Fdev\u002Fnull | grep -v '.git\u002F' | grep -i 'scripts\\|offline\\|mcp\\|a2a\\|web-cache'\n```\n\n**Don't touch legitimate search paths:**\n\nRepo-discovery candidates like `HOME \u002F \"src\" \u002F \"repo-name\"` are\n**locating the repo root**, not referencing internal paths. Skip these:\n\n```python\n# ✅ LEGITIMATE — repo discovery, not stale internal reference\nfor candidate in [HOME \u002F \"steadfaste-fleet\", HOME \u002F \"src\" \u002F \"steadfaste-fleet\"]:\n```\n\n**Verify with compile check:**\n\n```bash\npython3 -c \"import py_compile; py_compile.compile('path\u002Fto\u002Ffile.py', doraise=True)\" && echo \"OK\"\n```\n\nAfter all fixes, a final sweep should show ZERO remaining stale\nreferences:\n\n```bash\n# After all patches, confirm zero matches (should return only legit discovery paths)\ngrep -rn '\"src\"' path\u002Fto\u002Fscripts\u002F*.py | grep -v 'discovery\\|search\\|candidate'\n```\n\n**Concrete reference:** `references\u002Ffleet-path-migration-july2026.md` in this\nskill directory has the full transcript and file-by-file map from the\nJuly 2026 `src\u002F` → `ops\u002F` migration.\n\n### Pattern G2: sys.path.insert stale directory references after restructure\n\nWhen a repo renames a top-level directory (e.g., `runtime\u002F` → `core\u002F`),\nPython scripts that inject the old path via `sys.path.insert(0, \"...\u002Fold-dir\")`\nwill silently fail on import.\n\nThis is the same class of problem as Pattern G (pathlib stales after\nrestructure) but in a different Python construct — a plain string literal\nin a function call, not pathlib path parts.\n\n**Scan — search_files works fine for string literals (unlike pathlib):**\n\n```text\nsearch_files(pattern='sys.path.insert.*runtime')\nsearch_files(pattern='sys.path.insert.*old-dir')\nsearch_files(pattern='sys.path.insert.*src.*scripts')\n```\n\nThen verify the actual imported modules still exist at the new location:\n\n```bash\n# Check that the module the script tries to import actually exists\n# under the new path, not the old one\nfind ~\u002Fsteadfaste-fleet\u002Fcore -name 'sla_watchdog.py' 2>\u002Fdev\u002Fnull\n```\n\n**Fix — update the path string in sys.path.insert:**\n\n```python\n# Before\nsys.path.insert(0, \"~\u002Fsteadfaste-fleet\u002Fruntime\")\nfrom fleet_bus.workflow.sla_watchdog import main\n\n# After\nsys.path.insert(0, \"~\u002Fsteadfaste-fleet\u002Fcore\")\nfrom fleet_bus.workflow.sla_watchdog import main\n```\n\n**Two copies to patch (always):**\n\n| Where | Why |\n|-------|-----|\n| Repo source (`steadfaste-fleet\u002Fops\u002Fscripts\u002F...`) | Upstream — survives next `fleet-update.sh` |\n| Deployed copy (`~\u002F.steadfaste-fleet\u002Fscripts\u002F...`) | Runtime — runs right now |\n\nThe repo source comes first (upstream before one-off). If the deployed\ncopy and repo share the same inode (hard-linked), the first edit already\ncovers both — compare inodes (`stat -c '%i'` on GNU, `stat -f '%i'` on macOS).\n\n**Required post-fix steps for cron scripts:**\n\nAfter patching the deployed copy, the cron scheduler's internal\n`last_status` is not updated by a bare Python run. Run the script\nthrough the scheduler:\n\n```text\ncronjob(action='run', job_id='\u003Cjob-id>')\n```\n\nThen confirm `last_status` changed from `\"error\"` to `\"ok\"`.\n\n**Also check sibling scripts with the same pattern:**\n\nBefore declaring done, run the scan pattern broadly to find every\nscript with `sys.path.insert` pointing at any former directory name.\nIf the repo restructure renamed multiple dirs, check for each one:\n\n```text\nsearch_files(pattern='steadfaste-fleet\u002Fruntime')\nsearch_files(pattern='steadfaste-fleet\u002Fsrc.*scripts')\n```\n\nA batch of 3+ scripts with the same stale prefix means the scan was\ntoo narrow — widen it.\n\n### Pattern F: Cross-platform service management via boolean dispatch helpers\n\nWhen a script needs to start\u002Fstop\u002Fcheck **services** (not just find files), the\npattern used in `mycortex-wrapper.sh` encapsulates OS dispatch in helper functions\nrather than scattering `if\u002Fthen\u002Felif` throughout the business logic:\n\n```bash\n# ── OS detection — set booleans once ──\nIS_MAC=false; IS_LINUX=false\ncase \"$(uname -s)\" in\n  Darwin) IS_MAC=true  ;;\n  Linux)  IS_LINUX=true ;;\n  *)      echo \"⚠ Unknown OS: $(uname -s)\" >&2; IS_LINUX=true ;;\nesac\n\n# ── Service names (adjust per platform) ──\nSERVICE_NAME=\"legacy autopilot\"\nif $IS_MAC; then\n  SERVICE_NAME=\"legacy autopilot\"\nfi\n\n# ── Helper functions — OS dispatch encapsulated once ──\n\n_service_is_active() {\n  local name=\"$1\"\n  if $IS_LINUX; then\n    systemctl --user is-active --quiet \"$name\" 2>\u002Fdev\u002Fnull\n  elif $IS_MAC; then\n    local out\n    out=$(launchctl list \"$name\" 2>\u002Fdev\u002Fnull) || return 1\n    echo \"$out\" | grep -q '\"PID\"' && return 0 || return 1\n  fi\n}\n\n_service_stop() {\n  local name=\"$1\"\n  if $IS_LINUX; then\n    systemctl --user stop \"$name\" 2>\u002Fdev\u002Fnull || true\n  elif $IS_MAC; then\n    launchctl bootout gui\u002F$(id -u)\u002F\"$name\" 2>\u002Fdev\u002Fnull || true\n  fi\n}\n\n_service_start() {\n  local name=\"$1\"\n  if $IS_LINUX; then\n    systemctl --user start \"$name\" 2>\u002Fdev\u002Fnull || \\\n      echo \"⚠ Could not start $name — systemd service not installed\"\n  elif $IS_MAC; then\n    launchctl bootstrap gui\u002F$(id -u)\u002F\"$name\" 2>\u002Fdev\u002Fnull || \\\n      launchctl kickstart gui\u002F$(id -u)\u002F\"$name\" 2>\u002Fdev\u002Fnull || \\\n      echo \"⚠ Could not start $name — launchd plist not installed\"\n  fi\n}\n\n# ── Business logic — clean, no OS branches ──\nif _service_is_active \"$SERVICE_NAME\"; then\n    _service_stop \"$SERVICE_NAME\"\n    for i in $(seq 1 10); do\n        ! _service_is_active \"$SERVICE_NAME\" && break\n        sleep 1\n    done\nfi\n\n# ... run the command that needs exclusive access ...\n\n# On EXIT trap, restart:\nif ! _service_is_active \"$SERVICE_NAME\"; then\n    _service_start \"$SERVICE_NAME\"\nfi\n```\n\n**When to use this vs Pattern B:** Pattern B (variable assignment via `case`)\nis right when you only need to **evaluate** paths once (e.g., `NGINX_DIR`).\nPattern F (helper functions) is right when you need to **call** service\nmanagement repeatedly (start\u002Fstop\u002Fcheck) and don't want OS branches scattered\nthrough the main logic.\n\n**Concrete reference:** `ops\u002Fscripts\u002Fmanage\u002Fmycortex-wrapper.sh` in the\nsteadfaste-fleet repo uses this exact pattern — 3 helpers, clean business logic,\nno platform branches outside the helpers.\n\n### Pattern H: Cross-file terminology rename\n\nRename a concept, service name, or API across docs and config files (not just\npaths). The workflow is the same cross-file pipeline as the other patterns,\nadapted for content changes.\n\n**When to use:** The user asks to rename a system, tool, or concept across\ndocumentation (e.g., \"Agent Inbox → Agent Bus\").\n\n**Workflow — Search, Read, Categorize, Plan, Patch, Verify:**\n\n```text\nSearch (find all occurrences, all case\u002Fseparator variants)\n  ↓\nRead affected files (get full context around each match)\n  ↓\nCategorize (change \u002F keep-as-legacy \u002F skip-entirely \u002F excluded-by-rules)\n  ↓\nPlan (what exact text each match becomes, where to add legacy notes)\n  ↓\nPatch (batch independent files, one-at-a-time for complex edits)\n  ↓\nVerify (comprehensive re-search, confirm zero unexpected refs remain)\n```\n\n**Step 1 — Search.** Find all occurrences using multiple search patterns for\ndifferent case\u002Fseparator variants (they are independent, batch them):\n\n```text\nsearch_files(target='content', pattern='agent inbox')\nsearch_files(target='content', pattern='Agent Inbox')\nsearch_files(target='content', pattern='agent-inbox')\n```\n\nAlso check camelCase \u002F PascalCase \u002F SCREAMING_SNAKE if the term is composable.\n\n**Step 2 — Read and categorize.** For each file, decide each match's fate:\n\n| Category | Meaning | Example |\n|----------|---------|---------|\n| **Change** | Replace with new term, add legacy note on first mention | Descriptions of the current system |\n| **Legacy** | Keep old name but mark \"(previously OldName)\" | First mention in a doc about the new system |\n| **Historical** | Keep as-is — intentional record of what existed | Migration docs, changelogs, research notes |\n| **Excluded** | Do not touch per user instructions | orch-bus-setup.md, systemd units, cron names |\n| **Name-only** | Keep filename\u002Fcommand\u002Fscript name unchanged | Cron names like agent-inbox-workday |\n\n**Step 3 — Plan.** For each \"Change\" and \"Legacy\" match, decide the exact\nreplacement. The patch tool requires verbatim old_string\u002Fnew_string:\n\n```markdown\n# Heading replacement:\n# Agent Inbox Architecture -> Agent Bus Architecture (previously Agent Inbox)\n\n# Body text on first mention:\n# via the agent inbox -> via the Agent Bus (previously Agent Inbox)\n```\n\n**Substep — Check for substring collision.** If the old term is a prefix or\nsubstring of terms that must be preserved (e.g., rename `orch-bus-` to\n`bus-` but `orch-bus-workflow-*` stays), explicitly list the preserved\npatterns. Verify each preserved term would NOT be caught by a blanket\n`replace_all` on the old term. A single scan of the full match set against\nthe preserved list — done once — prevents half the files from needing rework.\n\n**Substep — Cross-check replacement consistency.** When the spec maps\nmultiple old→new pairs (e.g., `orch-bus-watch.sh` → `bus-watch.sh` and\n`orch-bus-recover-timeouts` → `bus-recover-timeouts`), sanity-check that\nno derived pair looks like a double-prefix error (`bus-bus-watch.sh`).\nIf one pair is inconsistent with the rest of the pattern, it's likely a\nspec typo — use the majority pattern.\n\n**Step 4 — Patch in batches.** Independent files can be patched concurrently.\nUse `replace_all=true` when **every** occurrence of the old string in that\nfile should change identically. Do NOT use `replace_all` in a file where\nsome matches are protected (e.g., a file containing both changeable\n`orch-bus-audit-watchdog` and protected `orch-bus-workflow-dispatcher`\nreferences). For mixed files, patch each unchangeable occurrence with a\ntargeted `old_string` that includes enough surrounding context to be\nunique, then apply `replace_all` for the remaining bulk matches, OR handle\nevery occurrence individually with targeted patches.\n\nDo NOT batch patches to the same file — concurrent patches to the same file\nrace on the inode. When batching across files, batch the independent ones.\n\n**Step 5 — Verify.** After all patches, re-run all search patterns. Confirm:\n\n- Every remaining reference is in an intentionally-kept category\n- The old term is never used to describe the current system\n- No excluded file was accidentally modified\n- Zero unplanned references remain\n\n**Reference file:** references\u002Fterminology-rename-agent-inbox-to-bus.md in\nthis skill's directory has the full worked example — 17 files, 60+ patches.\n\n## Scan Phase 2: GNU-only COMMANDS, not just GNU-only paths\n\nPath assumptions are half the portability surface; the other half is a command whose FLAG or\nsemantics differ on BSD\u002FmacOS, or that does not exist there — and those failures are worse, because\nseveral are SILENT (`grep -P` reports \"no matches\" when it never ran; `date -r \u003Cpath>` reads the path\nas a number and means something else). Run the command scan with the same parallel-grep discipline as\nthe path scan: `stat -c`, `date -r`, bare `sed -i` (BSD needs a suffix), `sha256sum`, `readlink -f`,\n`grep -P`, `timeout` (it is `gtimeout` on macOS), `nproc`.\n\n**A doc or a skill is a recipe an agent EXECUTES on the target platform** — a GNU-only command in a\nSKILL.md breaks the agent following it, so recipes are Tier 1 for this class, not Tier 3. Inline the\nportable form at the recipe, and treat a recipe teaching a STALE METHOD (an mtime comparison after\nthe method became a content hash) as the same defect: it answers confidently and wrongly.\n\nInventory, portable forms, safe-sweep mechanics (assert `count == 1` per edit, never hand-craft a\nparenthetical inside inline code, re-grep to prove zero): `references\u002Fgnu-only-commands-macos.md`.\n\n## Verification\n\nAfter each fix, confirm with targeted grep that the old pattern is gone:\n\n```bash\ngrep -c '\u002Fhome\u002Fluke' path\u002Fto\u002Fscript.sh          # should be 0\ngrep -c 'FLEET_REPO\\|SCRIPT_DIR' path\u002Fto\u002Fscript.sh  # should be >0\ngrep -c '_docker_bin' path\u002Fto\u002Fpython.py          # should be >0\n```\n\n### Shell scripts: always run `bash -n` after bulk edits\n\nThe `patch` tool's fuzzy matching can corrupt complex quoting inside heredocs\n(especially grep `-oP` patterns with embedded single-quote sequences inside\nbash `-c` strings). Always run a bulk syntax check after editing `.sh` files:\n\n```bash\nfor f in path\u002Fto\u002Fscripts\u002F*.sh; do\n  echo -n \"$f: \"\n  bash -n \"$f\" 2>&1 && echo \"OK\" || echo \"FAILED\"\ndone\n```\n\nThis catches:\n  - Indentation breaks from misaligned patch context\n  - Corrupted grep\u002Fsed quoting inside heredocs\n  - Broken continuation lines (`\\` at end of line)\n\n### Hard-linked script dirs\n\nOn Hermes deployments, `~\u002F.hermes\u002Fscripts\u002F` and `~\u002F.steadfaste-fleet\u002Fscripts\u002F` may\nshare the same inode (hard-linked copies). Editing one modifies both\nautomatically — no need to patch separately. Verify with:\n\n```bash\nstat -c '%i' ~\u002F.hermes\u002Fscripts\u002Fsome-script.sh ~\u002F.steadfaste-fleet\u002Fscripts\u002Fsome-script.sh 2>\u002Fdev\u002Fnull \\\n  || stat -f '%i' ~\u002F.hermes\u002Fscripts\u002Fsome-script.sh ~\u002F.steadfaste-fleet\u002Fscripts\u002Fsome-script.sh\n# Same inode → same file\n```\n\n### Final sweep: verify zero stale refs remain\n\nAfter all patches, use `search_files(output_mode='count')` to confirm zero\nmatches for each stale prefix:\n\n```bash\ngrep -rc 'old-src-dir\u002F' target-dir\u002F 2>\u002Fdev\u002Fnull | grep -v ':0$'\ngrep -rc 'old-deploy-dir\u002F' target-dir\u002F 2>\u002Fdev\u002Fnull | grep -v ':0$'\n```\n\n## Reference files\n\n| File | Covers |\n|------|--------|\n| `references\u002Fsystemd-percent-h-specifier.md` | systemd `%h` vs `%u` specifier nuances |\n| `references\u002Fmacos-memory-service-detection.md` | macOS-specific memory + service detection |\n| `references\u002Fsteadfaste-fleet-path-audit.md` | Full path audit of the steadfaste-fleet repo |\n| `references\u002Fmycortex-wrapper-crossplatform.md` | Concrete Pattern F example — mycortex-wrapper.sh |\n| `references\u002Fgh-cli-headless-install.md` | Install gh CLI without sudo + OAuth device-code flow |\n| `references\u002Ffleet-path-migration-july2026.md` | Stale pathlib path migration after `src\u002F` → `ops\u002F` restructure (Pattern G) |\n| `references\u002Fstale-syspath-post-runtime-restructure.md` | Stale `sys.path.insert` after `runtime\u002F` → `core\u002F` restructure (Pattern G2) |\n| `references\u002Fterminology-rename-agent-inbox-to-bus.md` | Full worked example — 17-file terminology rename (Pattern H) |\n| `references\u002Fpython-import-cwd-debugging.md` | Debugging Python imports that fail from one CWD but not another (sys.path + __file__ resolution diagnosis) |\n\n## Pitfalls\n\n- **Dockerfiles\u002Fcontainer paths** (`target=\u002Froot\u002F.npm`) are internal and do\n  NOT need fixing — they're inside the container, not the host.\n- **Offline code corpus** snippets are educational examples, not functional\n  code. Skip them.\n- **`.plist` files** are macOS launchd system files. Their paths are correct\n  for their target platform.\n- **Shebangs** (`#!\u002Fusr\u002Fbin\u002Fenv bash`) are standard and portable. Do not\n  change them.\n- **`\u002Fetc\u002Fnginx` on Linux** is a standard OS path, not project-specific.\n  OS-aware dispatch is the right fix, not removing it.\n- **A hardcoded `\u002Fhome\u002F\u003Coperator>\u002F` path in a repo is ALSO PII, not just a portability bug** — it leaks the local username and machine home layout. Target the REAL resolver (`Path.home().name`), not every `\u002Fhome\u002F*\u002F` (generic `\u002Fhome\u002Fuser\u002F` placeholders are intentional). Replace shell script defaults with `$HOME\u002F`, docs with `~\u002F`, and Python TEST FIXTURES with `pathlib.Path.home()` at runtime — a fixture that hardcodes the operator home is non-hermetic AND leaks it.\n- **Don't touch the table structure** when updating tables in docs — replace\n  only the content, not the pipe\u002Fdash separator rows.\n- **Escape-drift warning:** When using `patch` tool, read the exact line\n  from the file and paste it verbatim — escaping quotes differently\n  (`\\\\\\\"` vs `\\\"`) causes the patch to fail.\n- **`search_files` misses pathlib literal patterns:** The `search_files` tool\n  (ripgrep backend) returns 0 results for patterns like `\"src\"` because of\n  quote-escaping. For pathlib-based path searches (`\"old_dir\" \u002F \"subdir\"`),\n  **always use terminal `grep -rn`** with the exact quote syntax instead.\n  `search_files` works fine for continuous-string paths like `ops\u002Fscripts\u002F`.\n- **Governance lock must span the entire batch:** Multi-file patches on the\n  same repo may encounter a stale governance lock from a prior session.\n  Call `check_lock()` before starting. If the lock belongs to a different\n  task_id, force-acquire with `begin_change(..., force=True)`. Score and\n  release the cycle only once — after ALL patches are done and verified,\n  not mid-batch. Scoring mid-batch releases the lock and blocks subsequent\n  writes.","# Codebase Portability — Hardcoded Path Audit\n\nRemove absolute path assumptions from scripts, configs, and documentation\nso the codebase works regardless of where it's cloned or which OS runs it.\n\n---\n\n## Scan Phase\n\nRun **multiple independent pattern scans** in parallel to find all\nhardcoded paths before making any changes:\n\n```bash\n# Personal home directories (worst — breaks on any other user)\ngrep -rn '\u002Fhome\u002Fluke' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fhome\u002Fmoses' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002FUsers\u002F' . 2>\u002Fdev\u002Fnull\n\n# ~\u002Frepo-name assumptions (breaks if cloned elsewhere)\ngrep -rn '~\u002Fsteadfaste-fleet' . 2>\u002Fdev\u002Fnull\ngrep -rn '~\u002Fsteadfaste-fleet-private' . 2>\u002Fdev\u002Fnull\n\n# Hardcoded binary paths (breaks if OS\u002Fpkg-manager differs)\ngrep -rn '\u002Fusr\u002Flocal\u002Fbin\u002Fdocker' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fusr\u002Flocal\u002Fbin\u002Fbrew' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fopt\u002Fhomebrew\u002Fbin\u002F' . 2>\u002Fdev\u002Fnull\n\n# macOS-only nginx\u002Ffail2ban paths (ignores Linux)\ngrep -rn '\u002Fusr\u002Flocal\u002Fetc\u002Fnginx' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fusr\u002Flocal\u002Fetc\u002Ffail2ban' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fusr\u002Flocal\u002Fvar\u002Flog\u002Fnginx' . 2>\u002Fdev\u002Fnull\n\n# Other common absolute paths\ngrep -rn '\u002Fhome\u002F' . 2>\u002Fdev\u002Fnull\ngrep -rn '\u002Fopt\u002F' . 2>\u002Fdev\u002Fnull  # but NOT Dockerfile --mount target=\u002Froot\u002F\ngrep -rn '\u002Froot\u002F' . 2>\u002Fdev\u002Fnull\n```\n\n**Exclude noise:** shebangs (`#!\u002Fusr\u002Fbin\u002Fenv`), Docker build cache mounts\n(`target=\u002Froot\u002F`), standard OS paths (`\u002Fetc\u002Fssl`, `\u002Fetc\u002Fletsencrypt`),\noffline code corpus examples (reference snippets, not functional code),\n`.plist` files (macOS launchd, system-specific).\n\n## Categorize Findings\n\nSort into tiers before fixing:\n\n| Tier | Type | Examples | Action |\n|------|------|----------|--------|\n| **1 — Critical** | Executable scripts with absolute paths | `~\u002F...`, `\u002Fusr\u002Flocal\u002Fbin\u002Fdocker` | Fix immediately — blocks other users |\n| **2 — Portability** | OS-specific paths in scripts | macOS-only nginx paths | Add OS-aware dispatch |\n| **3 — Docs\u002FSkills** | Instructional `~\u002Frepo\u002F` paths | `cd ~\u002Fsteadfaste-fleet` in SKILL.md | Use `$FLEET_REPO` fallback pattern |\n| **4 — Stale** | Docs describing only one OS | macOS-only setup instructions | Add Linux notes or platform table |\n\n## Fix Patterns\n\n### Pattern A: Script-relative repo path (Shell)\n\nReplace `~\u002Frepo-name` or absolute `\u002Fhome\u002Fuser\u002Frepo-name` with auto-derived\npath from `BASH_SOURCE`:\n\n```bash\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nREPO_DIR=\"$(cd \"$SCRIPT_DIR\u002F..\u002F..\" && pwd)\"  # walk up to repo root\n```\n\nFor scripts deeper in the tree, adjust the `..` count. Verify:\n\n```bash\ngrep -n 'FLEET_REPO\\|SCRIPT_DIR\\|SRC' path\u002Fto\u002Fscript.sh\n```\n\n### Pattern B: OS-aware path dispatch (Shell)\n\nReplace single-OS hardcoded paths with `case $(uname -s)`:\n\n```bash\ncase \"$(uname -s)\" in\n  Darwin)\n    if [[ \"$(uname -m)\" == \"arm64\" ]]; then\n      NGINX_DIR=\"\u002Fopt\u002Fhomebrew\u002Fetc\u002Fnginx\"\n    else\n      NGINX_DIR=\"\u002Fusr\u002Flocal\u002Fetc\u002Fnginx\"\n    fi\n    ;;\n  Linux)\n    NGINX_DIR=\"\u002Fetc\u002Fnginx\"\n    ;;\nesac\n```\n\nThen use `$NGINX_DIR` throughout.\n\n### Pattern C: Python binary discovery\n\nReplace hardcoded `\u002Fusr\u002Flocal\u002Fbin\u002Fdocker` with `shutil.which`:\n\n```python\nimport os, shutil\n\ndef _docker_bin() -> str:\n    \"\"\"Locate docker binary, falling back to PATH.\"\"\"\n    env = os.environ.get(\"DOCKER_BIN\")\n    if env:\n        return env\n    found = shutil.which(\"docker\")\n    return found or \"docker\"\n```\n\n### Pattern C2: Python OS-aware binary + config directory discovery\n\n`shutil.which` finds binaries on PATH, but config trees (nginx, fail2ban,\npostgres) live at OS-specific paths that `which` can't discover. For tools\nlike nginx where both the binary path AND the config directory vary by OS,\nprobe candidate paths directly:\n\n```python\nimport os, sys\n\ndef _detect_nginx_paths() -> tuple[str, str]:\n    \"\"\"Detect nginx binary and config directory, platform-aware.\n\n    Returns (nginx_bin, config_dir).\n    Linux:       \u002Fusr\u002Fsbin\u002Fnginx, \u002Fetc\u002Fnginx\n    macOS arm64: \u002Fopt\u002Fhomebrew\u002Fbin\u002Fnginx, \u002Fopt\u002Fhomebrew\u002Fetc\u002Fnginx\n    macOS x86_64: \u002Fusr\u002Flocal\u002Fbin\u002Fnginx, \u002Fusr\u002Flocal\u002Fetc\u002Fnginx\n    \"\"\"\n    candidates_bin = [\n        \"\u002Fusr\u002Fsbin\u002Fnginx\",\n        \"\u002Fusr\u002Flocal\u002Fbin\u002Fnginx\",\n        \"\u002Fopt\u002Fhomebrew\u002Fbin\u002Fnginx\",\n    ]\n    nginx_bin = next(\n        (p for p in candidates_bin if os.path.isfile(p)),\n        \"\u002Fusr\u002Fsbin\u002Fnginx\",  # fallback\n    )\n\n    if sys.platform == \"darwin\":\n        if os.uname().machine == \"arm64\":\n            conf_dir = \"\u002Fopt\u002Fhomebrew\u002Fetc\u002Fnginx\"\n        else:\n            conf_dir = \"\u002Fusr\u002Flocal\u002Fetc\u002Fnginx\"\n    else:\n        conf_dir = \"\u002Fetc\u002Fnginx\"\n\n    return nginx_bin, conf_dir\n```\n\n**When to use this vs Pattern C:** Use `shutil.which` when PATH resolution is\nsufficient (most user-facing commands). Use candidate probing + OS dispatch\nwhen the script also needs to find the tool's configuration tree, which\nlives outside PATH's scope. Both are correct — they solve different problems.\n\n**Same idiom for fail2ban, postgres, etc.** Adjust the candidate path lists\nfor the tool's known OS-specific install locations.\n\n### Pattern D: Doc\u002Fskill path references\n\nReplace bare `~\u002Frepo-name` with env-var fallback pattern:\n\n```markdown\ncd \"${FLEET_REPO:-$HOME\u002Fsteadfaste-fleet}\"\n```\n\nThis works unset (defaults to `~\u002Fsteadfaste-fleet`) or with `FLEET_REPO` override.\n\nFor private repos with no env var convention:\n\n```markdown\ncd \"${FLEET_REPO:-$HOME\u002Fsteadfaste-fleet}-private\"\n```\n\n### Pattern E: macOS-only config paths\n\nReplace `htpasswd \u002Fusr\u002Flocal\u002Fetc\u002Fnginx\u002F.htpasswd` with:\n\n```markdown\nhtpasswd \"${NGINX_HTPASSWD:-\u002Fusr\u002Flocal\u002Fetc\u002Fnginx\u002F.htpasswd}\"\n```\n\nAlso add OS-dependent note:\n\n```markdown\nLinux: `\u002Fetc\u002Fnginx\u002F.htpasswd`, macOS: `\u002Fusr\u002Flocal\u002Fetc\u002Fnginx\u002F.htpasswd`\n```\n\n### Pattern G: Stale pathlib path references after repo restructure\n\nWhen a repo restructures directory layout (e.g., `src\u002F` → `ops\u002F`, or\n`deploy\u002F` → `infra\u002F`), pathlib-based relative paths in Python files\nbecome stale in a way that grep for the full string `old\u002Fdir\u002F` misses,\nbecause pathlib splits them across string literals.\n\n**Example stale pattern:**\n\n```python\nMCP_SERVERS_DIR = FLEET_REPO \u002F \"src\" \u002F \"mcp-servers\"     # old\nFLEET_SCRIPTS = FLEET_REPO \u002F \"src\" \u002F \"scripts\"           # old\n```\n\n**Scan — use terminal grep, not search_files tool:**\n\n`search_files` (ripgrep) struggles with the `\"pattern\"` syntax needed\nto match pathlib string literals. Use terminal grep instead:\n\n```bash\n# Find all pathlib-based stale refs to old dir names\ngrep -rn '\"src\"' . 2>\u002Fdev\u002Fnull | grep -v '.git\u002F' | grep -v '__pycache__'\ngrep -rn '\"deploy\"' . 2>\u002Fdev\u002Fnull | grep -v '.git\u002F'\n\n# Also check docstrings and string formatting (non-pathlib refs)\ngrep -rn 'old-dir\u002F' . 2>\u002Fdev\u002Fnull | grep -v '.git\u002F'\ngrep -rn 'old_dir\u002F' . 2>\u002Fdev\u002Fnull | grep -v '.git\u002F'\n```\n\n**Mapping table — determine old→new mapping:**\n\n| Old prefix | New prefix | Example |\n|------------|-----------|---------|\n| `ops\u002Fscripts\u002F` | `ops\u002Fscripts\u002F` | Python scripts |\n| `src\u002Fmcp-servers\u002F` | `ops\u002Fservices\u002F` | MCP server code |\n| `src\u002Foffline\u002F` | `ops\u002Foffline\u002F` | Offline utilities |\n| `src\u002Fweb-cache\u002F` | `ops\u002Fweb-cache\u002F` | Web cache modules |\n|| `src\u002Fa2a\u002F` | `ops\u002Fservices\u002Fa2a\u002F` (now deprecated, merged into fleet-bus) | Agent card templates |\n\n**Fix using patch tool with exact quotes:**\n\nPathlib paths are built from separate `\"part\"` string literals, so\nthe patch must match the whole `\"old_part\" \u002F \"next_part\"` chain:\n\n```python\n# Before — two pathlib parts\nFLEET_SCRIPTS = FLEET_REPO \u002F \"src\" \u002F \"scripts\"\n\n# After — two parts, new names\nFLEET_SCRIPTS = FLEET_REPO \u002F \"ops\" \u002F \"scripts\"\n```\n\n**Don't forget strings in docstrings, comments, and `add_issue` calls:**\n\nThese are plain text (not pathlib), so a broader search is needed:\n\n```bash\ngrep -rn 'src\u002F' . 2>\u002Fdev\u002Fnull | grep -v '.git\u002F' | grep -i 'scripts\\|offline\\|mcp\\|a2a\\|web-cache'\n```\n\n**Don't touch legitimate search paths:**\n\nRepo-discovery candidates like `HOME \u002F \"src\" \u002F \"repo-name\"` are\n**locating the repo root**, not referencing internal paths. Skip these:\n\n```python\n# ✅ LEGITIMATE — repo discovery, not stale internal reference\nfor candidate in [HOME \u002F \"steadfaste-fleet\", HOME \u002F \"src\" \u002F \"steadfaste-fleet\"]:\n```\n\n**Verify with compile check:**\n\n```bash\npython3 -c \"import py_compile; py_compile.compile('path\u002Fto\u002Ffile.py', doraise=True)\" && echo \"OK\"\n```\n\nAfter all fixes, a final sweep should show ZERO remaining stale\nreferences:\n\n```bash\n# After all patches, confirm zero matches (should return only legit discovery paths)\ngrep -rn '\"src\"' path\u002Fto\u002Fscripts\u002F*.py | grep -v 'discovery\\|search\\|candidate'\n```\n\n**Concrete reference:** `references\u002Ffleet-path-migration-july2026.md` in this\nskill directory has the full transcript and file-by-file map from the\nJuly 2026 `src\u002F` → `ops\u002F` migration.\n\n### Pattern G2: sys.path.insert stale directory references after restructure\n\nWhen a repo renames a top-level directory (e.g., `runtime\u002F` → `core\u002F`),\nPython scripts that inject the old path via `sys.path.insert(0, \"...\u002Fold-dir\")`\nwill silently fail on import.\n\nThis is the same class of problem as Pattern G (pathlib stales after\nrestructure) but in a different Python construct — a plain string literal\nin a function call, not pathlib path parts.\n\n**Scan — search_files works fine for string literals (unlike pathlib):**\n\n```text\nsearch_files(pattern='sys.path.insert.*runtime')\nsearch_files(pattern='sys.path.insert.*old-dir')\nsearch_files(pattern='sys.path.insert.*src.*scripts')\n```\n\nThen verify the actual imported modules still exist at the new location:\n\n```bash\n# Check that the module the script tries to import actually exists\n# under the new path, not the old one\nfind ~\u002Fsteadfaste-fleet\u002Fcore -name 'sla_watchdog.py' 2>\u002Fdev\u002Fnull\n```\n\n**Fix — update the path string in sys.path.insert:**\n\n```python\n# Before\nsys.path.insert(0, \"~\u002Fsteadfaste-fleet\u002Fruntime\")\nfrom fleet_bus.workflow.sla_watchdog import main\n\n# After\nsys.path.insert(0, \"~\u002Fsteadfaste-fleet\u002Fcore\")\nfrom fleet_bus.workflow.sla_watchdog import main\n```\n\n**Two copies to patch (always):**\n\n| Where | Why |\n|-------|-----|\n| Repo source (`steadfaste-fleet\u002Fops\u002Fscripts\u002F...`) | Upstream — survives next `fleet-update.sh` |\n| Deployed copy (`~\u002F.steadfaste-fleet\u002Fscripts\u002F...`) | Runtime — runs right now |\n\nThe repo source comes first (upstream before one-off). If the deployed\ncopy and repo share the same inode (hard-linked), the first edit already\ncovers both — compare inodes (`stat -c '%i'` on GNU, `stat -f '%i'` on macOS).\n\n**Required post-fix steps for cron scripts:**\n\nAfter patching the deployed copy, the cron scheduler's internal\n`last_status` is not updated by a bare Python run. Run the script\nthrough the scheduler:\n\n```text\ncronjob(action='run', job_id='\u003Cjob-id>')\n```\n\nThen confirm `last_status` changed from `\"error\"` to `\"ok\"`.\n\n**Also check sibling scripts with the same pattern:**\n\nBefore declaring done, run the scan pattern broadly to find every\nscript with `sys.path.insert` pointing at any former directory name.\nIf the repo restructure renamed multiple dirs, check for each one:\n\n```text\nsearch_files(pattern='steadfaste-fleet\u002Fruntime')\nsearch_files(pattern='steadfaste-fleet\u002Fsrc.*scripts')\n```\n\nA batch of 3+ scripts with the same stale prefix means the scan was\ntoo narrow — widen it.\n\n### Pattern F: Cross-platform service management via boolean dispatch helpers\n\nWhen a script needs to start\u002Fstop\u002Fcheck **services** (not just find files), the\npattern used in `mycortex-wrapper.sh` encapsulates OS dispatch in helper functions\nrather than scattering `if\u002Fthen\u002Felif` throughout the business logic:\n\n```bash\n# ── OS detection — set booleans once ──\nIS_MAC=false; IS_LINUX=false\ncase \"$(uname -s)\" in\n  Darwin) IS_MAC=true  ;;\n  Linux)  IS_LINUX=true ;;\n  *)      echo \"⚠ Unknown OS: $(uname -s)\" >&2; IS_LINUX=true ;;\nesac\n\n# ── Service names (adjust per platform) ──\nSERVICE_NAME=\"legacy autopilot\"\nif $IS_MAC; then\n  SERVICE_NAME=\"legacy autopilot\"\nfi\n\n# ── Helper functions — OS dispatch encapsulated once ──\n\n_service_is_active() {\n  local name=\"$1\"\n  if $IS_LINUX; then\n    systemctl --user is-active --quiet \"$name\" 2>\u002Fdev\u002Fnull\n  elif $IS_MAC; then\n    local out\n    out=$(launchctl list \"$name\" 2>\u002Fdev\u002Fnull) || return 1\n    echo \"$out\" | grep -q '\"PID\"' && return 0 || return 1\n  fi\n}\n\n_service_stop() {\n  local name=\"$1\"\n  if $IS_LINUX; then\n    systemctl --user stop \"$name\" 2>\u002Fdev\u002Fnull || true\n  elif $IS_MAC; then\n    launchctl bootout gui\u002F$(id -u)\u002F\"$name\" 2>\u002Fdev\u002Fnull || true\n  fi\n}\n\n_service_start() {\n  local name=\"$1\"\n  if $IS_LINUX; then\n    systemctl --user start \"$name\" 2>\u002Fdev\u002Fnull || \\\n      echo \"⚠ Could not start $name — systemd service not installed\"\n  elif $IS_MAC; then\n    launchctl bootstrap gui\u002F$(id -u)\u002F\"$name\" 2>\u002Fdev\u002Fnull || \\\n      launchctl kickstart gui\u002F$(id -u)\u002F\"$name\" 2>\u002Fdev\u002Fnull || \\\n      echo \"⚠ Could not start $name — launchd plist not installed\"\n  fi\n}\n\n# ── Business logic — clean, no OS branches ──\nif _service_is_active \"$SERVICE_NAME\"; then\n    _service_stop \"$SERVICE_NAME\"\n    for i in $(seq 1 10); do\n        ! _service_is_active \"$SERVICE_NAME\" && break\n        sleep 1\n    done\nfi\n\n# ... run the command that needs exclusive access ...\n\n# On EXIT trap, restart:\nif ! _service_is_active \"$SERVICE_NAME\"; then\n    _service_start \"$SERVICE_NAME\"\nfi\n```\n\n**When to use this vs Pattern B:** Pattern B (variable assignment via `case`)\nis right when you only need to **evaluate** paths once (e.g., `NGINX_DIR`).\nPattern F (helper functions) is right when you need to **call** service\nmanagement repeatedly (start\u002Fstop\u002Fcheck) and don't want OS branches scattered\nthrough the main logic.\n\n**Concrete reference:** `ops\u002Fscripts\u002Fmanage\u002Fmycortex-wrapper.sh` in the\nsteadfaste-fleet repo uses this exact pattern — 3 helpers, clean business logic,\nno platform branches outside the helpers.\n\n### Pattern H: Cross-file terminology rename\n\nRename a concept, service name, or API across docs and config files (not just\npaths). The workflow is the same cross-file pipeline as the other patterns,\nadapted for content changes.\n\n**When to use:** The user asks to rename a system, tool, or concept across\ndocumentation (e.g., \"Agent Inbox → Agent Bus\").\n\n**Workflow — Search, Read, Categorize, Plan, Patch, Verify:**\n\n```text\nSearch (find all occurrences, all case\u002Fseparator variants)\n  ↓\nRead affected files (get full context around each match)\n  ↓\nCategorize (change \u002F keep-as-legacy \u002F skip-entirely \u002F excluded-by-rules)\n  ↓\nPlan (what exact text each match becomes, where to add legacy notes)\n  ↓\nPatch (batch independent files, one-at-a-time for complex edits)\n  ↓\nVerify (comprehensive re-search, confirm zero unexpected refs remain)\n```\n\n**Step 1 — Search.** Find all occurrences using multiple search patterns for\ndifferent case\u002Fseparator variants (they are independent, batch them):\n\n```text\nsearch_files(target='content', pattern='agent inbox')\nsearch_files(target='content', pattern='Agent Inbox')\nsearch_files(target='content', pattern='agent-inbox')\n```\n\nAlso check camelCase \u002F PascalCase \u002F SCREAMING_SNAKE if the term is composable.\n\n**Step 2 — Read and categorize.** For each file, decide each match's fate:\n\n| Category | Meaning | Example |\n|----------|---------|---------|\n| **Change** | Replace with new term, add legacy note on first mention | Descriptions of the current system |\n| **Legacy** | Keep old name but mark \"(previously OldName)\" | First mention in a doc about the new system |\n| **Historical** | Keep as-is — intentional record of what existed | Migration docs, changelogs, research notes |\n| **Excluded** | Do not touch per user instructions | orch-bus-setup.md, systemd units, cron names |\n| **Name-only** | Keep filename\u002Fcommand\u002Fscript name unchanged | Cron names like agent-inbox-workday |\n\n**Step 3 — Plan.** For each \"Change\" and \"Legacy\" match, decide the exact\nreplacement. The patch tool requires verbatim old_string\u002Fnew_string:\n\n```markdown\n# Heading replacement:\n# Agent Inbox Architecture -> Agent Bus Architecture (previously Agent Inbox)\n\n# Body text on first mention:\n# via the agent inbox -> via the Agent Bus (previously Agent Inbox)\n```\n\n**Substep — Check for substring collision.** If the old term is a prefix or\nsubstring of terms that must be preserved (e.g., rename `orch-bus-` to\n`bus-` but `orch-bus-workflow-*` stays), explicitly list the preserved\npatterns. Verify each preserved term would NOT be caught by a blanket\n`replace_all` on the old term. A single scan of the full match set against\nthe preserved list — done once — prevents half the files from needing rework.\n\n**Substep — Cross-check replacement consistency.** When the spec maps\nmultiple old→new pairs (e.g., `orch-bus-watch.sh` → `bus-watch.sh` and\n`orch-bus-recover-timeouts` → `bus-recover-timeouts`), sanity-check that\nno derived pair looks like a double-prefix error (`bus-bus-watch.sh`).\nIf one pair is inconsistent with the rest of the pattern, it's likely a\nspec typo — use the majority pattern.\n\n**Step 4 — Patch in batches.** Independent files can be patched concurrently.\nUse `replace_all=true` when **every** occurrence of the old string in that\nfile should change identically. Do NOT use `replace_all` in a file where\nsome matches are protected (e.g., a file containing both changeable\n`orch-bus-audit-watchdog` and protected `orch-bus-workflow-dispatcher`\nreferences). For mixed files, patch each unchangeable occurrence with a\ntargeted `old_string` that includes enough surrounding context to be\nunique, then apply `replace_all` for the remaining bulk matches, OR handle\nevery occurrence individually with targeted patches.\n\nDo NOT batch patches to the same file — concurrent patches to the same file\nrace on the inode. When batching across files, batch the independent ones.\n\n**Step 5 — Verify.** After all patches, re-run all search patterns. Confirm:\n\n- Every remaining reference is in an intentionally-kept category\n- The old term is never used to describe the current system\n- No excluded file was accidentally modified\n- Zero unplanned references remain\n\n**Reference file:** references\u002Fterminology-rename-agent-inbox-to-bus.md in\nthis skill's directory has the full worked example — 17 files, 60+ patches.\n\n## Scan Phase 2: GNU-only COMMANDS, not just GNU-only paths\n\nPath assumptions are half the portability surface; the other half is a command whose FLAG or\nsemantics differ on BSD\u002FmacOS, or that does not exist there — and those failures are worse, because\nseveral are SILENT (`grep -P` reports \"no matches\" when it never ran; `date -r \u003Cpath>` reads the path\nas a number and means something else). Run the command scan with the same parallel-grep discipline as\nthe path scan: `stat -c`, `date -r`, bare `sed -i` (BSD needs a suffix), `sha256sum`, `readlink -f`,\n`grep -P`, `timeout` (it is `gtimeout` on macOS), `nproc`.\n\n**A doc or a skill is a recipe an agent EXECUTES on the target platform** — a GNU-only command in a\nSKILL.md breaks the agent following it, so recipes are Tier 1 for this class, not Tier 3. Inline the\nportable form at the recipe, and treat a recipe teaching a STALE METHOD (an mtime comparison after\nthe method became a content hash) as the same defect: it answers confidently and wrongly.\n\nInventory, portable forms, safe-sweep mechanics (assert `count == 1` per edit, never hand-craft a\nparenthetical inside inline code, re-grep to prove zero): `references\u002Fgnu-only-commands-macos.md`.\n\n## Verification\n\nAfter each fix, confirm with targeted grep that the old pattern is gone:\n\n```bash\ngrep -c '\u002Fhome\u002Fluke' path\u002Fto\u002Fscript.sh          # should be 0\ngrep -c 'FLEET_REPO\\|SCRIPT_DIR' path\u002Fto\u002Fscript.sh  # should be >0\ngrep -c '_docker_bin' path\u002Fto\u002Fpython.py          # should be >0\n```\n\n### Shell scripts: always run `bash -n` after bulk edits\n\nThe `patch` tool's fuzzy matching can corrupt complex quoting inside heredocs\n(especially grep `-oP` patterns with embedded single-quote sequences inside\nbash `-c` strings). Always run a bulk syntax check after editing `.sh` files:\n\n```bash\nfor f in path\u002Fto\u002Fscripts\u002F*.sh; do\n  echo -n \"$f: \"\n  bash -n \"$f\" 2>&1 && echo \"OK\" || echo \"FAILED\"\ndone\n```\n\nThis catches:\n  - Indentation breaks from misaligned patch context\n  - Corrupted grep\u002Fsed quoting inside heredocs\n  - Broken continuation lines (`\\` at end of line)\n\n### Hard-linked script dirs\n\nOn Hermes deployments, `~\u002F.hermes\u002Fscripts\u002F` and `~\u002F.steadfaste-fleet\u002Fscripts\u002F` may\nshare the same inode (hard-linked copies). Editing one modifies both\nautomatically — no need to patch separately. Verify with:\n\n```bash\nstat -c '%i' ~\u002F.hermes\u002Fscripts\u002Fsome-script.sh ~\u002F.steadfaste-fleet\u002Fscripts\u002Fsome-script.sh 2>\u002Fdev\u002Fnull \\\n  || stat -f '%i' ~\u002F.hermes\u002Fscripts\u002Fsome-script.sh ~\u002F.steadfaste-fleet\u002Fscripts\u002Fsome-script.sh\n# Same inode → same file\n```\n\n### Final sweep: verify zero stale refs remain\n\nAfter all patches, use `search_files(output_mode='count')` to confirm zero\nmatches for each stale prefix:\n\n```bash\ngrep -rc 'old-src-dir\u002F' target-dir\u002F 2>\u002Fdev\u002Fnull | grep -v ':0$'\ngrep -rc 'old-deploy-dir\u002F' target-dir\u002F 2>\u002Fdev\u002Fnull | grep -v ':0$'\n```\n\n## Reference files\n\n| File | Covers |\n|------|--------|\n| `references\u002Fsystemd-percent-h-specifier.md` | systemd `%h` vs `%u` specifier nuances |\n| `references\u002Fmacos-memory-service-detection.md` | macOS-specific memory + service detection |\n| `references\u002Fsteadfaste-fleet-path-audit.md` | Full path audit of the steadfaste-fleet repo |\n| `references\u002Fmycortex-wrapper-crossplatform.md` | Concrete Pattern F example — mycortex-wrapper.sh |\n| `references\u002Fgh-cli-headless-install.md` | Install gh CLI without sudo + OAuth device-code flow |\n| `references\u002Ffleet-path-migration-july2026.md` | Stale pathlib path migration after `src\u002F` → `ops\u002F` restructure (Pattern G) |\n| `references\u002Fstale-syspath-post-runtime-restructure.md` | Stale `sys.path.insert` after `runtime\u002F` → `core\u002F` restructure (Pattern G2) |\n| `references\u002Fterminology-rename-agent-inbox-to-bus.md` | Full worked example — 17-file terminology rename (Pattern H) |\n| `references\u002Fpython-import-cwd-debugging.md` | Debugging Python imports that fail from one CWD but not another (sys.path + __file__ resolution diagnosis) |\n\n## Pitfalls\n\n- **Dockerfiles\u002Fcontainer paths** (`target=\u002Froot\u002F.npm`) are internal and do\n  NOT need fixing — they're inside the container, not the host.\n- **Offline code corpus** snippets are educational examples, not functional\n  code. Skip them.\n- **`.plist` files** are macOS launchd system files. Their paths are correct\n  for their target platform.\n- **Shebangs** (`#!\u002Fusr\u002Fbin\u002Fenv bash`) are standard and portable. Do not\n  change them.\n- **`\u002Fetc\u002Fnginx` on Linux** is a standard OS path, not project-specific.\n  OS-aware dispatch is the right fix, not removing it.\n- **A hardcoded `\u002Fhome\u002F\u003Coperator>\u002F` path in a repo is ALSO PII, not just a portability bug** — it leaks the local username and machine home layout. Target the REAL resolver (`Path.home().name`), not every `\u002Fhome\u002F*\u002F` (generic `\u002Fhome\u002Fuser\u002F` placeholders are intentional). Replace shell script defaults with `$HOME\u002F`, docs with `~\u002F`, and Python TEST FIXTURES with `pathlib.Path.home()` at runtime — a fixture that hardcodes the operator home is non-hermetic AND leaks it.\n- **Don't touch the table structure** when updating tables in docs — replace\n  only the content, not the pipe\u002Fdash separator rows.\n- **Escape-drift warning:** When using `patch` tool, read the exact line\n  from the file and paste it verbatim — escaping quotes differently\n  (`\\\\\\\"` vs `\\\"`) causes the patch to fail.\n- **`search_files` misses pathlib literal patterns:** The `search_files` tool\n  (ripgrep backend) returns 0 results for patterns like `\"src\"` because of\n  quote-escaping. For pathlib-based path searches (`\"old_dir\" \u002F \"subdir\"`),\n  **always use terminal `grep -rn`** with the exact quote syntax instead.\n  `search_files` works fine for continuous-string paths like `ops\u002Fscripts\u002F`.\n- **Governance lock must span the entire batch:** Multi-file patches on the\n  same repo may encounter a stale governance lock from a prior session.\n  Call `check_lock()` before starting. If the lock belongs to a different\n  task_id, force-acquire with `begin_change(..., force=True)`. Score and\n  release the cycle only once — after ALL patches are done and verified,\n  not mid-batch. Scoring mid-batch releases the lock and blocks subsequent\n  writes.",{"name":5,"trigger":24,"version":25,"category":26,"description":7},"User asks to fix hardcoded paths, remove absolute path assumptions, make scripts portable, fix install-location assumptions, prevent path breakage when cloning, or 'no hardcoded paths'. Also applicable when migrating a codebase between machines or noticing a script has $HOME assumptions.","1.0.0","devops","main","9dc0e92c5fa81d4db5292b205716e8ea0c00d10e","skills\u002Fdevops\u002Fcodebase-portability",1,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet","steadfaste.com","https:\u002F\u002Fgithub.com\u002Flukemcqueen","AI Architect | Building Hermes Cortex: governed multi-agent AI for autonomous software engineering | Enterprise Tech Consultant","2026-11-14 22:33:34",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add lukemcqueen\u002Fsteadfaste-fleet --skill codebase-portability",{"tool":42,"command":43},"bunx","bunx skills add lukemcqueen\u002Fsteadfaste-fleet --skill codebase-portability",{"tool":45,"command":46},"pnpm","pnpm dlx skills add lukemcqueen\u002Fsteadfaste-fleet --skill codebase-portability","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002FSKILL.md",true,[50,56,60,64,68,72,76,80,84],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fcortex-path-migration-july2026.md","REFERENCE","参考文档",10180,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002Freferences\u002Fcortex-path-migration-july2026.md",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fgh-cli-headless-install.md",1805,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002Freferences\u002Fgh-cli-headless-install.md",{"path":61,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fgnu-only-commands-macos.md",3894,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002Freferences\u002Fgnu-only-commands-macos.md",{"path":65,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fhermes-cortex-path-audit.md",2963,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002Freferences\u002Fhermes-cortex-path-audit.md",{"path":69,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fmacos-memory-service-detection.md",3801,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002Freferences\u002Fmacos-memory-service-detection.md",{"path":73,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fpython-import-cwd-debugging.md",3501,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002Freferences\u002Fpython-import-cwd-debugging.md",{"path":77,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fstale-syspath-post-runtime-restructure.md",2193,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002Freferences\u002Fstale-syspath-post-runtime-restructure.md",{"path":81,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fsystemd-percent-h-specifier.md",3440,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002Freferences\u002Fsystemd-percent-h-specifier.md",{"path":85,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Fterminology-rename-agent-inbox-to-bus.md",4799,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcodebase-portability\u002Freferences\u002Fterminology-rename-agent-inbox-to-bus.md",[89,97,104,111,118,125],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":96},"01M7DXY4G8NSVB59K8B6S2AQNP","macbook-linux-maintenance","Legacy MacBook Linux fixes: GPU wedge, reboot hang, thermal.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fmacbook-linux-maintenance\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":96},"01M7DXXYJCXFJ3TGB84ZQ8KFE6","governance-regression-triage","Triage a host's governance issues: what changed.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fgovernance-regression-triage\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":96},"01M7DXXSAP1G8FDRJAMXQGBBMK","enforcement-immutability","Use when enforcement files lose their immutable flag.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fenforcement-immutability\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":96},"01M78SSDQVRYX64Y16X32TC0NS","steadfaste-fleet-repo-deploy","Use when committing to the steadfaste-fleet repo.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fsteadfaste-fleet-repo-deploy\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":96},"01M78SS928F3R2RJAYVW4E30CE","steadfaste-fleet-maintenance","Maintain an installed Steadfaste Fleet instance — update both the upstream Hermes Agent and the fleet repo layer, merge diverged histories, sync skills safely, and troubleshoot common issues. Covers the dual-update workflow (hermes update + fleet-update.sh), encrypted brain data backup, mycortex import, and recovery techniques.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fsteadfaste-fleet-maintenance\u002FSKILL.md",[],[],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":96},"01M78SP1CHW0T0BWE5ZT6JBPX8","fleet-preflight","DEPRECATED alias — merged into survey-before-action (2026-08-20). Load survey-before-action instead; its \"Repo-Specific Pre-Flight\" section covers git search, Hermes boundary, and deployment verification.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Ffleet-preflight\u002FSKILL.md",[],[]]