site-architecture
Skill179 starsChanged 13 days agoApache-2.0View on GitHub
Capsem system architecture: service, per-VM processes, CLI, guest agent, vsock, network proxy. Use when you need the design to write, review, or debug across components.
66 other projects use a version of this.
Adopted by
Most recently taken up by
- darkweb19/skillstheir own version, first seen Nov 8, 2026
- About-Intelligence/awesome-marketing-skillstheir own version, first seen Nov 8, 2026
- salacoste/daytona-seo-notchtheir own version, first seen Nov 1, 2026
- GAPZ787/claude-skillstheir own version, first seen Nov 1, 2026
- matteotitta/claude-marketing-websitetheir own version, first seen Nov 1, 2026
- Tonybleything76/claude_skillstheir own version, first seen Oct 25, 2026
Used with
Projects with it also use popups, free-tools 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.
CesarjoquinSkillpopups
When the user wants to create or optimize popups, modals, overlays, slide-ins, or banners for conversion purposes. Also use when the user mentions "exit intent," "popup conversions," "modal optimization," "lead capture popup," "email popup," "announcement banner," "overlay," "collect emails with a popup," "exit popup," "scroll trigger," "sticky bar," or "notification bar." Use this for any overlay or interrupt-style conversion element. For forms outside of popups, see cro. For general page conversion optimization, see cro.
Also in 23 projects that use this
CesarjoquinSkillfree-tools
When the user wants to plan, evaluate, or build a free tool for marketing purposes — lead generation, SEO value, or brand awareness. Also use when the user mentions "engineering as marketing," "free tool," "marketing tool," "calculator," "generator," "interactive tool," "lead gen tool," "build a tool for leads," "free resource," "ROI calculator," "grader tool," "audit tool," "should I build a free tool," or "tools for lead gen." Use this whenever someone wants to build something useful and give it away to attract leads or earn links. For downloadable content lead magnets (ebooks, checklists, templates), see lead-magnets.
Also in 24 projects that use this
coreyhaines31Skillmarketing-council
When the user wants multiple expert perspectives on a marketing question — a simulated board of advisors staffed by legendary marketers (Seth Godin, David Ogilvy, Eugene Schwartz, April Dunford, Rory Sutherland, Alex Hormozi, Byron Sharp, and more). Also use when the user mentions 'marketing council,' 'board of advisors,' 'advisory board,' 'what would Seth Godin say,' 'what would Ogilvy think,' 'channel Hormozi,' 'get multiple perspectives,' 'debate this,' 'have the council review,' 'marketing mentors,' or asks how a famous marketer would approach their problem. The council gives each advisor's take through their documented frameworks, surfaces where they disagree, and synthesizes a recommendation. For executing the winning direction, hand off to positioning, offers, copywriting, ads, or the relevant skill.
Also in 18 projects that use this
ukunal91appSkillcommunity-marketing
Build and leverage online communities to drive product growth and brand loyalty. Use when the user wants to create a community strategy, grow a Discord or Slack community, manage a forum or subreddit, build brand advocates, increase word-of-mouth, drive community-led growth, engage users post-signup, or turn customers into evangelists. Trigger phrases: "build a community," "community strategy," "Discord community," "Slack community," "community-led growth," "brand advocates," "user community," "forum strategy," "community engagement," "grow our community," "ambassador program," "community flywheel.
Also in 34 projects that use this
Hussain-ElfalahSkillandreessen
Also in 4 projects that use this
Hussain-ElfalahSkillbusiness-investment-advisor
Also in 4 projects that use this
- +4 more from Cesarjoquin
- +1 more from Hussain-Elfalah
Other versions66 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 66
- coreyhaines31/marketingskills★ 59ksame name
- LeoYeAI/openclaw-marketing-skills★ 1ksame name
- Nexus-JPF/note-companion★ 874same name
- alinaqi/maggy★ 711same name
- alinaqi/claude-bootstrap★ 708same name
- vercel-labs/marketing-team-eve-template★ 459same name
- Cesarjoquin/Marketing-Skills★ 190same name
- b1rdmania/ghostclaw★ 91same name
- open-fox/agents★ 55same name
- SZcalligrapher/slash-skills-subscription★ 32same name
56 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- asset-pipelineSkill
- build-imagesSkill
- build-initrdSkill
- citadelSkill
- dev-benchmarkSkill
- dev-bug-reviewSkill
- dev-cacheSkill
- dev-capsem-doctorSkill
- dev-capsemSkill
- dev-ciSkill
- dev-debuggingSkill
- dev-gateSkill
- dev-installationSkill
- dev-justSkill
- dev-mcpSkill
- dev-mitm-proxySkill
- dev-rust-patternsSkill
- dev-session-debugSkill
- dev-setupSkill
- dev-skillsSkill
- dev-sprintSkill
- dev-startSkill
- dev-testing-frontendSkill
- dev-testing-hypervisorSkill
- dev-testing-pythonSkill
- dev-testingSkill
- dev-testing-vmSkill
- frontend-designSkill
- ironbankSkill
- meta-find-skillsSkill
- meta-organize-skillsSkill
- meta-skill-creationSkill
- release-processSkill
- site-infraSkill
- site-marketingSkill
- use-capsemSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 0 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 62 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
Read references/service-and-guest-protocols.md before changing the service/process topology, CLI or MCP execution paths, gateway/service …
- Very specific: line 43
Read references/storage-network-and-lifecycle.md before changing VM storage or forks, network interception, security or logger ownership, …
- Very specific: line 46
Read references/crate-and-privilege-model.md before moving responsibilities between crates, changing capsem-process permissions or …
- Very specific: line 49
Read references/key-files.md before locating the implementation owner for an architectural change.
- Very specific: line 51
Read references/tauri-v2.md before changing capsem-app or its Tauri v2 configuration and IPC.
- Very specific: line 57
All VM operations route through capsem-service to one capsem-process per session.
- Very specific: line 95
Read references/key-files.md for the full annotated source map.
- Very specific: line 99
Read references/tauri-v2.md for Tauri v2 patterns and the registered handler in crates/capsem-app/src/lib.rs for shell commands.
“Common” is measured: kept by at least 6 in 10 of the 62 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.
Files
Capsem Architecture
System overview
Capsem sandboxes AI agents in air-gapped Linux VMs on macOS using Apple's Virtualization.framework (with a KVM backend for Linux). It runs as a daemon service (like Docker). The system has these layers:
Host-side:
- capsem-service (daemon): always-running background service. Axum HTTP server over Unix Domain Socket (
~/.capsem/run/service.sock). Manages VM lifecycle, routes API calls to per-VM processes. It is the only client of a VM owner: container setup (service-owned OCI pull and staging), exposures (/vms/{id}/exposures, admitted by the owner asnetwork.lifecycleevents), and thecapsem.stream.v3WebSocket at/vms/{id}/stream(terminal, streaming exec, container attach) all translate to typed owner IPC here; CLI, TUI, web and SDKs never dial a per-VM socket. - capsem-process (per-VM): one process per sandbox. Boots the VM, bridges vsock connections (terminal + control), manages structured jobs (exec, file I/O) via a job store.
- capsem (CLI): user-facing CLI. Sessions are named by the service
(
vm-Nunless the user supplies a name) and sized by create flags with fixed defaults.capsem shellopens the TUI/session picker, creates or attaches through the authenticated gateway, using the Rust SDK and shared API types. Direct UDS HTTP is restricted to local status/asset administration and service startup. Failed gateway authentication never falls back to UDS. User-facing copy says sessions; implementation/debug output may say VM when describing the virtualization layer. - @capsem/mcp (npm MCP server): separately installed stdio server for AI agents. Uses the TypeScript SDK and an explicit gateway URL/token; it has no UDS, VM-runtime, or virtualization access.
- capsem-gateway (HTTP gateway): TCP-to-UDS reverse proxy (default port 19222). Bearer token auth, CORS, 10MB body limit. Provides an explicit route table plus
/status(cached 1s) and/vms/{id}/stream(authenticatedcapsem.stream.v3WebSocket upgrade tunneled unchanged to the service, which translates it to typed VM-owner IPC). Unknown routes return 404; the frontend and tray app connect through the gateway. Writes runtime files to~/.capsem/run/(gateway.token, gateway.port, gateway.pid). - capsem-app (Tauri GUI): thin webview shell. Connects to gateway at
http://127.0.0.1:19222. No VM logic, no capsem-core dependency. The registered shell commands live incrates/capsem-app/src/lib.rs: frontend logging, log-path diagnostics and opening external URLs. Update checks use the service API. Bundlesweb/app/distso the app can render the service-unavailable screen when gateway is unreachable. - capsem-tray (system tray): menu-bar companion process. Polls the gateway for VM status, shows running/stopped counts, and provides quick actions (open dashboard, quit). Non-standalone: refuses to run without
--parent-pidpointing at a live capsem-service, acquires a system-wide singleton lock at~/.capsem/run/tray.lock(only one tray ever in the menu bar), and self-exits within 500ms when its parent dies. Contract enforced bycapsem-guardon the companion side, not the spawner. - capsem-guard (shared library): parent-watch + singleton primitives used by capsem-tray and capsem-gateway. Provides
watch_parent_or_exit,Singleton::try_acquire, and the umbrellainstall(parent_pid, lock_path). Guarantees companions die with their parent and can't run standalone or as multiple instances -- closes the orphan-accumulation class of bug thatkill_on_drop(true)alone cannot cover under SIGKILL/OOM/test-harness termination. See/dev-rust-patternslesson 18.
Guest-side:
- capsem-init (
capsem-init): PID 1, sets up air-gapped networking, mounts filesystems, deploys guest binaries, launches daemons, writes boot timing JSONL - capsem-pty-agent (
capsem-pty-agent): main guest agent -- PTY bridge, control channel, exec, file I/O, shutdown handler (see "Guest agent architecture" below) - capsem-tun (
capsem-tun): guest end of a network cable. One tap per attached network, MACcapsem_proto::privatelink::mac_of(address), MTU 65521, pumping ethernet frames as u16-framed records over that cable's own vsock:5009 connection. The VM owner holds each cable's stream and hands a duplicate to that network's switch onplug(). A wire, not a stack: it parses nothing, and every protocol crosses it. - capsem-sysutil (
capsem-sysutil): guest suspend helper. Opens its own vsock:5004 connection independently of the agent, so suspend works even if the agent is hung. Symlinked by capsem-init only to/usr/local/bin/suspend; in-VM shutdown commands are disabled. - capsem-net-proxy (
capsem-net-proxy): redirects HTTPS traffic to host MITM proxy via vsock - capsem-mcp-server (
capsem-mcp-server): guest MCP stdio-to-framed-vsock relay for tool calls to the host MITM MCP endpoint
Reference routing
- Read
references/service-and-guest-protocols.mdbefore changing the service/process topology, CLI or MCP execution paths, gateway/service routes, host IPC, vsock framing or ports, or any guest agent binary. - Read
references/storage-network-and-lifecycle.mdbefore changing VM storage or forks, network interception, security or logger ownership, ephemeral sessions, installation, service registration, companion launch, or updates. - Read
references/crate-and-privilege-model.mdbefore moving responsibilities between crates, changing capsem-process permissions or environment, changing session/socket/share boundaries, or changing MITM CA-key handling. - Read
references/key-files.mdbefore locating the implementation owner for an architectural change; it is the full annotated source map. - Read
references/tauri-v2.mdbefore changing capsem-app or its Tauri v2 configuration and IPC. The app remains a thin webview shell; VM operations and update checks route through the gateway.
Core invariants
- All VM operations route through
capsem-serviceto onecapsem-processper session. No other host binary boots a VM or talks to guest vsock directly. - The service and gateway expose an explicit route table. Unknown routes return
404; do not add compatibility aliases or generic forwarding. Every public
method/path pair is approval-locked in
config/public-surface.toml. - Terminal bytes, control messages, lifecycle requests, and exec output use
distinct vsock responsibilities. Preserve the port and framing contract in
references/service-and-guest-protocols.md. - The guest is air-gapped: it has no real NIC, DNS, or direct internet. HTTPS reaches the host only through the guest net proxy and the MITM/security path.
- VMs start unplugged. A private network is one confined L2 switch process
(
capsem-router --network);plug()/unplug()connect a VM's cable to it. Plugged VMs talk over any protocol. The switch forwards on MAC only and is a network, not a security boundary: never add per-flow relays, admission, or IP/TCP parsing to it. Seereferences/storage-network-and-lifecycle.md. - Corp config owns enterprise constraints and wins; the user's
settings.tomland built-in defaults supply the rest of the policy; the one VM runtime and OCI images own what a guest runs; settings own UI preferences. All enforcement and detection compiles into oneSecurityRuleSetoverSecurityEvent. - Credential capture/injection belongs to the credential broker. Durable
ledger storage belongs to
capsem-logger; routes, MCP helpers, UI handlers, benchmarks, and network formatters must not open SQLite or own projection caches. Missing tables or columns are schema failures, never empty data. - Workspace and overlay bytes are session state, never
a hidden image-authoring rail; package changes go through the runtime
package set (
/build-images) or an OCI image underimages/. capsem-processclears its inherited environment, uses 0600 sockets and a 0700 session directory, attaches read-only assets and guest binaries, and shares onlysession_dir/guest/with the VM. These controls do not confine a compromised same-UID host worker by themselves. The VM owner, proxy, ledger and native MCP workers enforce OS confinement before readiness. The service retains native MCP child handles and generation-bound cleanup authority.- capsem-app contains no VM logic or
capsem-coredependency. Gateway and tray are service-owned companions and must self-exit with their parent.
Key source files
Read references/key-files.md for the full annotated source map.
Tauri v2 reference
Read references/tauri-v2.md for Tauri v2 patterns and the registered handler in
crates/capsem-app/src/lib.rs for shell commands. All VM operations and update
checks route through the gateway.
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
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.

