agentleFS
yansirccyansircc/llm-broker/.claude/skills/deploy/SKILL.md

deploy

Skill1 starsChanged 9 months agoMITView on GitHub

Build and deploy broker (`llm-broker`) to production. Triggers: deploy, 部署, push to production, 发布, ship it, 上线. Handles: frontend build, Go cross-compile, remote snapshot, upload, migrate, restart, verification, rollback.

100 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use azure-kusto-graph, azure-kusto-irql and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    azure-kusto-graph

    Build and query Kusto graphs from natural language. Covers transient graphs (make-graph), persistent graph models/snapshots, pattern matching (graph-match), shortest paths, connected components, and graph-to-table export. Generates the edges-first thinking: define edges, define node lookups, union, make-graph. WHEN: make-graph, graph-match, graph-shortest-paths, graph-to-table, graph-mark-components, persistent graph, graph model, graph snapshot, build a graph from data, find paths between nodes, pattern matching in graph, connected components, transient graph, Kusto graph, KQL graph.

    Also in 3 projects that use this

  • MicrosoftSkill

    azure-kusto-irql

    Compose IRQL (Incident Response Query Language) queries for Kusto cybersecurity investigations. Translates natural language hunting questions into composable IRQL pipelines using Get_*, Extract_*, and Enrich_* functions. WHEN: IRQL query, security hunt, threat hunting KQL, incident response query, compose hunting pipeline, failed logins, phishing investigation, lateral movement, process execution, file creation events.

    Also in 3 projects that use this

  • pvnarpSkill

    incident

    Guides incident response and post-mortem analysis. Covers triage, mitigation, root cause analysis, and prevention. Use when responding to active incidents, writing post-mortems, or improving incident processes.

    Also in 7 projects that use this

  • ww-w-aiSkill

    starter

    Static web development guide for beginners. Covers HTML/CSS/JavaScript and Next.js App Router basics. Project initialization with "init starter". Triggers: static website, portfolio, landing page, HTML CSS, beginner, 정적 웹, 포트폴리오, 초보자, 静的サイト, 初心者, 静态网站, 初学者, sitio web estático, site statique, statische Website, sito web statico Do NOT use for: fullstack apps (use $dynamic), enterprise (use $enterprise).

    Also in 3 projects that use this

  • +8 more from microsoft

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 85 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run scripts/deploy.sh from the repo root (or any worktree).

    line 11
  2. Distinctive:

    Create a remote snapshot of binary, env, service unit, and SQLite DB

    line 15
  3. Very specific:

    Stop service, run migrate, replace binary, restart

    line 17
  4. Distinctive:

    Verify service health — if restart fails, auto-restore the snapshot

    line 18
  5. Distinctive:

    Before starting any deploy, tell the human the rollback command first so they can recover immediately if the release looks wrong.

    line 21
  6. Distinctive:

    If the host is already blue-green enabled, the script refuses to re-run unless forced:

    line 41
  7. Distinctive:

    After bootstrap, regular deploys can keep using:

    line 47
  8. Distinctive:

    No snapshot exists — first deploy can only fail forward.

    line 86

“Common” is measured: kept by at least 6 in 10 of the 85 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deploy broker

Run scripts/deploy.sh from the repo root (or any worktree). The script handles the full pipeline:

  1. Build SvelteKit frontend (web/ → internal/ui/dist)
  2. Cross-compile Go binary for linux/amd64
  3. Create a remote snapshot of binary, env, service unit, and SQLite DB
  4. Upload to remote via scp
  5. Stop service, run migrate, replace binary, restart
  6. Verify service health — if restart fails, auto-restore the snapshot
  7. Smoke test HTTP endpoints — /health, admin API, frontend pages

Before starting any deploy, tell the human the rollback command first so they can recover immediately if the release looks wrong. At minimum print bash .claude/skills/deploy/scripts/restore.sh latest, and after the snapshot is created, surface the exact snapshot-specific rollback command emitted by the script.

bash .claude/skills/deploy/scripts/deploy.sh

deploy.sh now supports strategy selection:

  • DEPLOY_STRATEGY=auto (default) — if the remote has blue-green layout, use blue-green deploy; otherwise use legacy single-instance deploy
  • DEPLOY_STRATEGY=legacy — force the old stop-replace-restart path
  • DEPLOY_STRATEGY=bluegreen — force blue-green slot deploy

Blue-green bootstrap

Bootstrap a host into blue-green mode once:

bash .claude/skills/deploy/scripts/bluegreen_setup.sh

If the host is already blue-green enabled, the script refuses to re-run unless forced:

FORCE_BOOTSTRAP=1 bash .claude/skills/deploy/scripts/bluegreen_setup.sh

After bootstrap, regular deploys can keep using:

bash .claude/skills/deploy/scripts/deploy.sh

Rollback

Manually rollback to the most recent snapshot:

bash .claude/skills/deploy/scripts/restore.sh latest

Or restore a specific snapshot:

bash .claude/skills/deploy/scripts/restore.sh 20260309T211816Z-deploy

deploy.sh rollback is also available as a shortcut:

bash .claude/skills/deploy/scripts/deploy.sh rollback

Partial deploy

To skip frontend build for a Go-only change:

SKIP_FRONTEND=1 bash .claude/skills/deploy/scripts/deploy.sh

Failure handling

  • Service fails after deploy — script auto-restores the snapshot it just took
  • Blue-green bootstrap fails — script auto-restores the snapshot it just took
  • Manual rollback — use restore.sh or the rollback shortcut
  • No snapshot exists — first deploy can only fail forward; nothing remote is deleted before upload succeeds
  • npm/go/scp fails — exits before touching the remote runtime

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.