cos: Skill for Claude Code

.claude/skills/cos-upgrade/SKILL.md

cos-upgrade is a skill for Claude Code from philipyaz/cos. It costs 237 tokens per session (3,910 once invoked), scanned C, original, MIT.

A post-update runbook for upgrading an existing Cos installation, where Cos includes a board, data store, sidecars, backup system, or board-facing wrappers.

In plain words
What is it for?
Backing up before an upgrade, checking required changes, installing dependencies, rebuilding components, and updating hubs and spokes in the right order.
Why use it?
It turns changes from a code pull into an ordered upgrade checklist and avoids treating a first-time setup as an upgrade.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

This is philipyaz/cos's own configuration. It tells Claude Code how to work on cos itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cos configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node backup/backup.mjs; echo "backup exit $?" # must be 0 (written AND pushed); 2 = local only (note it), 4 = not the lease-holding hub (STOP).

Reuse

Borrowing it

Nothing to install: this file belongs to philipyaz/cos. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/philipyaz/cos/main/.claude/skills/cos-upgrade/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/philipyaz/cos

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cos-upgrade

README.md
[![agentmods](https://agentmods.dev/badge/skills/philipyaz/cos/cos-upgrade/github.svg)](https://agentmods.dev/skills/philipyaz/cos/cos-upgrade)
Your own site
<a href="https://agentmods.dev/skills/philipyaz/cos/cos-upgrade"><img src="https://agentmods.dev/badge/skills/philipyaz/cos/cos-upgrade/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cos-upgrade

Your own site · 80×15
<a href="https://agentmods.dev/skills/philipyaz/cos/cos-upgrade"><img src="https://agentmods.dev/badge/skills/philipyaz/cos/cos-upgrade.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 237 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,910 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00237 $0.03910
Opus 5 $0.00118 $0.01955
Sonnet 5 $0.00047 $0.00782
Haiku 4.5 $0.00024 $0.00391

Measured 5d ago against content hash bfd37f881ecf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

cos-upgrade scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -fsS --max-time 5 "$BOARD_URL/api/healthz" | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{const j=JSON.parse(s);const w=Number(process.argv[1]);console.log("hub app",j.appVersion,"schema",j.schem

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

[ "${COS_DEVICE_ROLE:-hub}" = hub ] && curl -s "$BOARD_URL/api/healthz" # note appVersion / schemaVersion / diskSchemaVersion BEFORE
.claude/skills/cos-upgrade/SKILL.md · 209 lines

How it starts

The opening of the file, as written. The whole thing — 209 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cos — upgrade an existing install (the post-pull runbook)

git pull changes files. It does not rebuild the production board, restart a launchd bridge that still runs the old server code, hand Cowork the rebuilt skill bundle it installed months ago, or create the scheduled trigger automation.json just gained. Each of those is a silent no-op — the repo is green, the tests pass, and your sweeps run last month's procedure. Only the store takes care of itself, and only in one direction: it migrates up on the next read, and refuses every write when the code is older than the file (503 store-newer-than-code) — see docs/reference/migration.md.

This skill is the deterministic answer. The planner (scripts/upgrade-check.mjs) turns what your pull changed into the ordered list of what this machine must do; you apply it. Never re-run cos-setup to upgrade — it is the first-run path and assumes empty state.

Roles. A hub runs the board, the store, the sidecars and the backup. A spoke runs only the board-facing MCP wrappers. Upgrade the hub first, then every spoke (a wrapper newer than the hub calls routes the hub does not have yet).

Step 0 — preflight (read-only)

source "$(git rev-parse --show-toplevel)/config/load-config.sh"   # REPO_ROOT, BOARD_URL, ports, COS_DEVICE_ROLE
cd "$REPO_ROOT"
git status --porcelain            # must be EMPTY — a dirty tree makes the pull ambiguous; stash or commit first
git rev-parse --abbrev-ref HEAD   # expect main (an upgrade tracks main or a release tag, never a feature branch)
PRE_PULL="$(git rev-parse HEAD)"; echo "running: $PRE_PULL"
echo "role: ${COS_DEVICE_ROLE:-hub}"
[ "${COS_DEVICE_ROLE:-hub}" = hub ] && curl -s "$BOARD_URL/api/healthz"   # note appVersion / schemaVersion / diskSchemaVersion BEFORE

CHECKPOINT: clean tree on main, PRE_PULL captured, healthz answered (hub). On a spoke, also confirm the hub is already upgraded: curl -s "$BOARD_URL/api/healthz" must report an appVersion / schemaVersion ≥ what you are about to pull (compare with git show origin/main:package.json and git show origin/main:board/lib/types.ts | grep SCHEMA_VERSION).

Read the full file on GitHub · 209 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago Changed · +5 lines bfd37f881ecf
  2. 10d ago First seen · 204 lines · 237 tokens per session scan C 47f4bd0051a8

Subscribe to this mod's changes

cos-upgrade is a skill published in the GitHub repository philipyaz/cos (4 stars, last pushed today), licensed MIT. It adds 237 tokens to every session and 3,910 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.