AGENT SKILL

fleet-deploy

Deploy or restart only explicitly requested mono-agent consumers and prove their bounded health. Use when asked to deploy, restart named agents, or get a change live. Do not infer a full-fleet rollout from a release or merge.

License 许可
GPL-3.0
最近更新
2026-11-15
Stars
★ 2
Forks
1

01 前言 Front Matter

name
fleet-deploy
description
Deploy or restart only explicitly requested mono-agent consumers and prove their bounded health. Use when asked to deploy, restart named agents, or get a change live. Do not infer a full-fleet rollout from a release or merge.

02 资源文件 1

03 SKILL.md 正文

Exact-target deployment

Deployment is consumer adoption, not release aftercare. Resolve the user's named targets before changing anything and leave every other agent, service, and web console untouched.

Runtime topology

  • The normal mono-agent main checkout is the adoption source for the global local CLI and the primary managed instance. That serving process uses the same immutable managed-runtime installation as other com.mono-agent.* instances.
  • Every com.mono-agent.* serving process and instance wrapper must agree with its managed snapshot.
  • A separate product with its own package graph, lifecycle manager, and runbook is never part of an inferred mono-agent fleet deployment.

Instances with their own runtime or credential layout

Some instances are excluded from any fleet-wide restart, including one the user asked for as "all". Restarting them with the global CLI silently overrides a deliberate contract.

  • Pinned-runtime instances (<instance-dir>, label com.mono-agent.<instance>-<hash>) pin their runtime in host-versions.json and install that exact version from npm into .host/runtime via ./bin/bootstrap. ./bin/mono-agent refuses any background lifecycle command whose installed version disagrees with the pin. The global mono-agent restart never consults that guard, so a fleet restart pushes such an instance off its pin and its next bootstrap pulls it back. To move its version: edit host-versions.json, run ./bin/bootstrap --profile writer --skip-provider-login --skip-start, then ./bin/mono-agent restart from <instance-dir>. Never the global CLI.
  • External-credential instances (<instance-dir>) keep their chat token one level above the sandbox and need --env-file <credential-path> on every lifecycle command. A bare restart mutes such an instance silently while its scheduler keeps recording success.

Development still happens in worktrees. The live main checkout stays clean, and is advanced only to an already-reviewed commit when deployment is requested.

1. Classify the request

Use the narrowest operation:

Request Operation
Restart an unchanged target Restart only that target; do not rebuild
Adopt a reviewed mono-agent commit in the primary instance Fast-forward clean main, install/build, restart that instance
Adopt a reviewed commit in another named mono-agent Prepare clean main, then restart only the named instance so it installs its managed runtime
Adopt a published version in a separate product Use that product's own dependency-upgrade runbook

A release does not imply any row in this table.

2. Prepare checkout code only when needed

MONO_DEPLOY_REPO=/Users/example/Personal_Repositories/mono-agent
test -z "$(git -C "$MONO_DEPLOY_REPO" status --porcelain)"
git -C "$MONO_DEPLOY_REPO" fetch origin main
git -C "$MONO_DEPLOY_REPO" pull --ff-only origin main
git -C "$MONO_DEPLOY_REPO" rev-parse HEAD
cd "$MONO_DEPLOY_REPO"
pnpm install --frozen-lockfile
pnpm run build

Run this block once per adopted commit, not once per consumer. Never edit, stash, reset, or test a feature branch in the live checkout. If it is dirty or cannot fast-forward, stop and preserve the state.

3. Primary managed instance

The primary managed instance adopts the clean local main checkout through the normal managed-runtime restart path. Resolve its exact config directory and service label first, then operate from that directory:

INSTANCE_LABEL=com.mono-agent.<instance>-<hash>
cd "<instance-dir>"
mono-agent restart
launchctl print "gui/$(id -u)/$INSTANCE_LABEL" | grep -E 'state =|pid =|last exit code'
mono-agent --version
mono-agent validate
mono-agent status

Do not substitute a raw LaunchAgent kickstart for mono-agent restart. A raw kickstart only relaunches the snapshot already recorded in the plist and can silently keep the process on the prior version.

Then prove the running command resolves into the newly installed managed runtime, not merely that the checkout CLI reports the desired version:

INSTANCE_PID=$(launchctl print "gui/$(id -u)/$INSTANCE_LABEL" | awk '/pid =/{print $3; exit}')
test -n "$INSTANCE_PID"
INSTANCE_COMMAND=$(ps -p "$INSTANCE_PID" -o command=)
printf '%s\n' "$INSTANCE_COMMAND"
printf '%s\n' "$INSTANCE_COMMAND" | grep -F '/.mono-agent/runtimes/agent-app/'
git -C "$MONO_DEPLOY_REPO" rev-parse HEAD

Use a bounded error tail only; do not launch a full log or fleet audit:

tail -n 25 "$HOME/.mono-agent/logs/$INSTANCE_LABEL.err.log"

4. Other named mono-agent instances

For each explicitly named instance, resolve its config directory and service label, then operate from that directory:

cd <exact-instance-directory>
mono-agent restart
mono-agent validate
mono-agent status
tail -n 25 "$HOME/.mono-agent/logs/<exact-label>.err.log"

Verify the PID and command path from the exact plist/launchd label. Do not restart the primary instance last, enumerate every matching plist, or add historical instances unless the user requested a full fleet rollout.

5. Separate-product adoption is separate

When a separate product was explicitly named, follow that product's own runbook from its own checkout:

cd "<other-product-checkout>"
pnpm install --frozen-lockfile
pnpm build
pnpm typecheck
pnpm test
./bin/agents restart
./bin/agents status
./bin/agents versions

restart already runs that product's core preflight. Do not duplicate it with validate, core-preflight, preflight, or doctor during routine dependency adoption. Leave proactive intake stopped. Run live verification only when the user explicitly requests its real provider-backed capture proof.

Legacy tracker boundary

Do not invoke or post from scripts/fleet-green-check.mjs as part of current development, release, or deployment work. The implementation remains for historical compatibility, but it is not an active workflow authority and does not describe the primary instance's managed serving runtime.

Completion evidence

For each requested target, report its exact version, source commit or installed package proof, PID/command provenance, lifecycle status, and bounded error-tail result. Name any target that failed. Do not call unrelated consumers healthy or deployed when they were not inspected.

04 同仓库更多 Skills

robertsreberski
robertsreberski/mono-agent

worktree-feature

Start isolated mono-agent work with diff-aware setup, keep only required dist fresh, and ship through a PR with safe cleanup. Use for tracked repository changes, multi-commit work, or before executing an implementation plan.

★ 2
robertsreberski
robertsreberski/mono-agent

verify-green

Select and run the smallest risk-based verification lane that proves a mono-agent change. Use before claiming a change works, before committing or opening a PR, or when asked to verify, run the gate, make it green, or check architecture.

★ 2
robertsreberski
robertsreberski/mono-agent

repo-hygiene-gc

Explicit bulk branch/worktree garbage collection using API-bound deletion proof. Use when asked to clean up the repository or run a deliberate maintenance sweep; ordinary PR cleanup belongs to worktree-feature.

★ 2
robertsreberski
robertsreberski/mono-agent

release-lockstep

Cut and registry-verify a lockstep npm release of all @mono-agent packages. Use when asked to release, publish to npm, cut vX.Y.Z, or bump the version. A release never implies consumer deployment.

★ 2
robertsreberski
robertsreberski/mono-agent

pi-upstream-recon

Investigate the vendored pi packages' real API surface (pi-ai and pi-agent-core) before hand-rolling anything, and run pi version bumps safely. Use before implementing runtime/provider/session behavior, when pi behavior is surprising, or when asked to "bump pi".

★ 2
robertsreberski
robertsreberski/mono-agent

ops-log-hygiene

Check bounded logs for explicitly restarted services, or run a full log-health audit when requested or when symptoms justify it. Use for crash-loop diagnosis, oversized logs, restart churn, or an explicit live-fleet log audit.

★ 2