google/capsem/dev-installation

Claude Code and agent skill by google/capsem

Trust tier 4
  • vendor
Source check pending

Checking that the SKILL.md file is still in the repository.

The native package installer: install, update, uninstall, service registration, asset download, corp config. Use when working on those or the installed ~/.capsem/ layout.

Install

npx vskill@latest install google/capsem/dev-installation

SKILL.md

The same SKILL.md was published earlier as google/capsem/dev-installation.

Native Package Installer

Installed layout

~/.capsem/
bin/capsem, capsem-service, capsem-process, capsem-tui,
capsem-mcp-aggregator, capsem-mcp-builtin,
capsem-gateway, capsem-tray, capsem-admin, capsem-mock-server
assets/manifest.json, manifest-metadata.json, {asset-name}-{hash16}.{ext}
run/service.sock, service.pid, instances/, persistent/
corp.toml (CLI-provisioned corp config)
corp-source.json (corp config source metadata)

CLI commands (no service required)

These commands dispatch before UdsClient creation -- they work without the service running:

CommandModuleWhat
capsem versionmain.rsPrint version + build hash
capsem updateupdate.rsCheck the selected release manifest URL and report the matching binary installer
`capsem service install\uninstall\status`service_install.rsService registration
`capsem completions bash\zsh\fish`completions.rsShell completions
capsem uninstall --yesuninstall.rsFull removal

Path discovery (paths.rs)

discover_paths() finds sibling binaries and assets:

  1. current_exe().parent() -> bin_dir -> the packaged host binary cohort:

capsem, capsem-service, capsem-process, capsem-tui, capsem-mcp-aggregator, capsem-mcp-builtin, capsem-gateway, capsem-tray, capsem-admin, capsem-mock-server

  1. Assets: ~/.capsem/assets/ (the only installed layout -- packages install

manifest URL provenance, then postinstall hydrates the live manifest and assets through capsem update --assets --manifest <URL>)

Auto-launch (main.rs UdsClient)

try_ensure_service() runs on every service-dependent command:

  1. Check socket connectivity
  2. Try systemd/LaunchAgent if unit installed (via try_start_via_service_manager())
  3. Fall back to direct spawn only for explicit development commands; installed

package paths are otherwise authoritative

  1. Poll socket for 5s

The request() method wraps all HTTP calls with retry-on-connect-fail.

The host MCP server is the separately installed @capsem/mcp npm package. Native installation must not install Node.js or download that package.

Service registration (service_install.rs)

Pure generators (unit-testable on all platforms):

  • generate_plist() -> macOS LaunchAgent XML
  • generate_systemd_unit() -> systemd user unit

Side-effecting:

  • install_service() -> write + launchctl bootstrap / systemctl --user enable --now
  • uninstall_service() -> launchctl bootout / systemctl --user disable --now + delete
  • service_status() -> installed + running + pid + unit_path

Package install

The package is the install unit. It may accept a manifest URL override for corp and development installs, records that URL in packaged manifest-metadata.json, hydrates the live manifest through capsem update --assets --manifest <URL> during postinstall, installs/restarts service files, and writes timestamped install logs. Packages do not carry a ~/.capsem/assets/manifest.json payload: VM assets are the channel's one runtime, hydrated from the manifest. They do not run an AI-provider setup wizard and they do not create a user policy file.

Postinstall writes the selected verified release document unchanged to ~/.capsem/assets/manifest.json. The boot resolver derives its compact runtime view in memory; it must never serialize that view over the installed release graph. The adjacent ~/.capsem/assets/manifest-metadata.json sidecar, with schema capsem.manifest_metadata.v1, is the only sidecar for provenance and update state. CLI status and About Capsem both read the service's canonical GET /system/status response, which includes those exact two JSON documents.

The public installer fetches the selected manifest once and hands postinstall two identities: its logical URL and root-owned exact payload bytes. The hidden preactivation rail consumes those bytes through stdin, uses the logical URL for relative assets and checked_url, and preserves the package-owned polling URL, channel, and origin. The request and payload remain paired for package-manager retry after failure; postinstall removes both only after success.

Package maintainer scripts

  • macOS .pkg: build_system/packaging/macos/pkg-scripts/preinstall unloads the LaunchAgent, kills

stale package-owned helpers, removes old app/share payloads, then build_system/packaging/macos/pkg-scripts/postinstall copies binaries, hydrates assets, registers the service, waits for service/gateway readiness, and opens the app.

  • Linux .deb: build_system/packaging/linux/deb-preinst.sh is packaged as DEBIAN/preinst. It

requires a non-root installing account from sudo's SUDO_USER (or an explicit non-root USER in the package environment). A root-only unattended install fails rather than choosing UID 1000. Both maintainer scripts run every ~/.capsem write, log append, and deletion as that account; root handles only package-owned paths and VM-device setup. The preinstall helper also drops to that account before signalling a checked process, closing PID-reuse races across users. Preinstall normally runs systemctl --user stop capsem.service when a user systemd session is available, then kills the stale helper cohort before package replacement so old service/gateway/tray/process binaries cannot survive from old inodes. A self-update started by an older installed service is the one exception: /proc/self/cgroup proves that dpkg belongs to capsem.service, so preinst preserves that unit and cohort until the old updater activates the new manifest and requests its managed restart. Postinstall detects the same service-owned transaction and defers manifest hydration, update-status refresh, service registration, and readiness because the public manifest still selects the previous package until publication and the new client must not probe the deliberately preserved old service; the old updater already owns the exact preverified candidate and final restart. This is the bootstrap for releases whose previous service does not yet contain the sibling systemd-run updater. For ordinary installs, build_system/packaging/linux/deb-postinst.sh symlinks the packaged binaries into ~/.capsem/bin, hydrates assets, and invokes capsem install to register or enable the user service without restarting an already active unit mid-transaction. Adding the user to kvm is not immediate access for an already-running systemd --user manager: postinstall must apply the shared narrow ACL helper after the packaged udev rule, and the Docker/systemd proof deliberately starts its manager before installation to preserve that test. Never make /dev/kvm or /dev/vhost-vsock world-writable in CI; doing so hides the installed-package permission boundary.

Self-update (update.rs)

  • read_cached_update_notice() -> sync file read on every command
  • refresh_update_cache_if_stale() -> background 24h-cached check merged atomically into the installed manifest-metadata.json sidecar
  • run_update() -> check the selected manifest URL and stage one complete compatible release transaction before mutating the installation
  • capsem update --yes -> verifies every changed package/runtime artifact, prints the tested package-manager apply command for audit, executes it through sudo when the native package changes, and atomically activates the selected release graph; this is the one ordinary update path used by the installed service. It also removes a leftover ~/.capsem/profiles directory from older installs with a no-follow contained removal (a symlink is removed as the link)
  • capsem update --assets -> low-level diagnostic/repair rail for hydrating the locally installed manifest or an explicit --manifest URL; normal product surfaces never direct users to apply assets separately
  • Corporate VM asset channels use capsem update --assets --manifest <URL>; --corp <URL> provisions policy config and must not be combined with --assets
  • --manifest and --corp are URL-only inputs. Local files must use file:///absolute/path, while hosted release and corporate channels use https://... or http://...; bare paths are rejected so update checks share one URL-based mechanism.
  • Stable/nightly switching uses the one complete installed transaction: capsem update --yes --channel <stable|nightly>. Explicit channel transitions may downgrade; Linux uses apt-get --allow-downgrades. The single metadata file records the installed manifest URL separately from the most recently checked URL.
  • An explicit corporate asset manifest moves the installation into a one-way locked channel. Persist channel_kind=corporate and channel_locked=true; later public-channel or different-manifest selections must fail before fetch or mutation.
  • Runtime images/evidence belong to the selected channel's one runtime document. Updating the nightly runtime can refresh only nightly runtime image refs and matching digests; it must not mutate stable, packages, or per-binary inventory.
  • The runtime may set min_capsem_version when it requires newer client behavior. That is the compatibility hook; the runtime must not point at the selected Capsem binary.
  • Layout detection: MacosPkg, LinuxDeb, UserDir, Development (development bails with "build from source")
  • Pre-updater installed binaries cannot be retrofitted through the release

channel. If a shipped binary prints "Binary self-update is not yet wired up", that install needs one manual .pkg or .deb bootstrap into a version that contains the package apply path; only then can later binary releases move through capsem update --yes.

  • Installed update smokes require that all packaged host binaries expose a version surface and report the same installed Capsem package version after replacement.

Corp config provisioning (capsem-core: corp_provision.rs)

  • fetch_corp_config(url) -> GET + validate + return content + ETag
  • validate_corp_toml(content) -> parse as SettingsFile
  • install_corp_config(dir, content, source) -> write corp.toml + corp-source.json
  • refresh_corp_config_if_stale(dir) -> background conditional GET with ETag

Loader changes: corp_config_paths() returns [/etc, ~/.capsem/] with first-wins merge.

Remote manifest + asset download (capsem-core: asset_manager.rs)

  • download_missing_assets(manifest, binary_version, arch, dir, progress) -> hydrate missing or corrupt assets from the manifest's release-channel URLs
  • copy_missing_local_assets(...) -> same contract for file:// corporate/local manifests
  • cleanup_unused_assets(base_dir, manifest) -> remove hash-named files no longer referenced by non-deprecated releases

Test harness

Docker-based e2e tests in tests/capsem_install/:

FileTests
test_smoke.pyHarness works (systemd, binaries, build hash)
test_auto_launch.pyAuto-launch, path discovery, asset resolution, error cases
test_service_install.pyInstall/uninstall/status, idempotent, systemd integration
test_corp_config.pyProvisioning, validation, precedence
test_update.pyDev build bail, layout detection, cache, preserve-on-fail
test_completions.pybash/zsh/fish output
test_uninstall.pyFull cleanup
test_lifecycle.pyEnd-to-end user journey
test_reinstall.pyBinary replacement verification
test_error_paths.pyFailure scenarios with actionable errors

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 31 Oct 2026.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
64
Repository forks
9
7-day trend score
21

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Jul 2026, 4 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill CERTIFIED badge
[![vskill CERTIFIED](https://verified-skill.com/api/v1/skills/google/capsem/dev-installation/badge)](https://verified-skill.com/skills/google/capsem/dev-installation)

Something wrong with this skill or its page? Tell us.