with one click
miniboxarchitecture
Navigate and understand minibox codebase architecture
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Navigate and understand minibox codebase architecture
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Remove AI-generated code slop by comparing current branch against base branch and eliminating unnecessary comments, defensive bloat, type workarounds, and style inconsistencies. Use this skill when reviewing AI-generated code, before merging PRs, when code quality seems degraded, or when you notice AI tells like excessive comments or defensive checks. Trigger for phrases like "remove slop", "clean AI code", "remove unnecessary code", "fix code quality", or when diff shows obvious AI-generated patterns.
Expert BAML (BoundaryML) schema design, code review, and test generation following established standards and conventions. Use this whenever users mention BAML, want to design AI functions, create schemas for LLM interactions, generate test cases, or review existing BAML code. Covers class/function/enum design, client configuration, prompt engineering, and comprehensive testing patterns.
Audit Claude Code agents, skills, commands, and hooks for quality, completeness, and adherence to templates and best practices. Use this skill when reviewing workspace components, ensuring quality standards, preparing for deployment, or investigating component issues. Trigger for phrases like "audit components", "check agents", "review skills", "validate commands", or proactively before major releases or when onboarding new components.
Comprehensive helper for working with the DevLoop development observability tool - both using it to analyze development patterns and contributing to its development. Use when running DevLoop commands, interpreting council mode analysis, understanding git activity patterns, reviewing Claude Code sessions, or working on DevLoop's hexagonal architecture codebase. Trigger for phrases like "run devloop", "analyze branch", "council mode", "development patterns", or when working on the DevLoop Rust codebase itself.
Remove emojis from project files and replace them with text equivalents. Use this skill when the user mentions removing emojis, cleaning up documentation, code review mentions emoji issues, or when you notice emojis in files that should be emoji-free. Also trigger for phrases like "clean emojis", "no emojis", "remove emoji", or "emoji cleanup".
Guide automated git bisect sessions to find regression commits with smart test execution and commit analysis. Use this skill when tracking down bugs introduced by specific commits, finding when tests started failing, debugging performance regressions, or investigating when features broke. Trigger for phrases like "find the bad commit", "when did this break", "bisect", "regression hunt", or when the user needs to identify which commit introduced an issue.
| name | minibox:architecture |
| description | Navigate and understand minibox codebase architecture |
Navigate and understand the minibox container runtime architecture and codebase.
Use this skill when:
minibox/
├── minibox/ # Core library
│ ├── src/
│ │ ├── container/ # Container primitives
│ │ │ ├── namespace.rs # Namespace setup
│ │ │ ├── cgroups.rs # Cgroup v2 management
│ │ │ ├── process.rs # Process spawning
│ │ │ └── rootfs.rs # Filesystem operations
│ │ ├── image/ # Image management
│ │ │ ├── registry.rs # Docker Hub client
│ │ │ ├── manifest.rs # OCI manifest parsing
│ │ │ └── layers.rs # Layer extraction
│ │ ├── network/ # Network setup (future)
│ │ └── lib.rs
│ └── Cargo.toml
├── miniboxd/ # Daemon
│ ├── src/
│ │ ├── main.rs # Server initialization
│ │ ├── handler.rs # Request handlers
│ │ ├── state.rs # Container state
│ │ └── protocol.rs # Wire protocol
│ └── Cargo.toml
├── minibox-cli/ # CLI tool
│ ├── src/
│ │ ├── main.rs # Command parsing
│ │ └── client.rs # Daemon client
│ └── Cargo.toml
└── Cargo.toml # Workspace config
minibox/src/container/)namespace.rs - Namespace isolation
clone_with_namespaces() - Create child process with namespaceslibc::clone() with namespace flagscgroups.rs - Resource management
CgroupManager - Lifecycle for cgroups v2create() - Setup cgroup hierarchy under /sys/fs/cgroup/minibox/add_process() - Add PID to cgroupset_limits() - Apply memory/CPU limitsprocess.rs - Container process lifecycle
spawn_container_process() - Clone and initialize childexecvp() user commandwait_for_exit() - Wait for process completionrootfs.rs - Filesystem operations
setup_overlay() - Create overlay filesystempivot_root() - Switch root filesystemmount_proc() - Mount /proc in containerminibox/src/image/)registry.rs - Docker Hub client
pull_image() - Download image from Docker Hubmanifest.rs - OCI manifest parsing
layers.rs - Layer extraction
miniboxd/src/)main.rs - Server initialization
/var/run/minibox.sockhandler.rs - Request handlers
handle_run() - Create and start container
handle_stop() - Stop container
handle_remove() - Cleanup container
state.rs - Container state management
protocol.rs - Wire protocol
DaemonRequest - Client → Daemon messagesDaemonResponse - Daemon → Client messagesminibox-cli/src/)main.rs - Command-line interface
client.rs - Daemon communication
Namespaces provide isolation:
Implementation:
// container/namespace.rs
clone_with_namespaces(
CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWNET |
CLONE_NEWIPC | CLONE_NEWUTS
)
Cgroups control resources:
Directory structure:
/sys/fs/cgroup/minibox/<container-id>/
├── cgroup.procs # PIDs in cgroup
├── memory.max # Memory limit
└── cpu.weight # CPU weight
Overlay provides copy-on-write:
Mount command:
mount -t overlay overlay \
-o lowerdir=<layers>,upperdir=<upper>,workdir=<work> \
<merged>
Create (handle_run)
Run (Process execution)
Stop (handle_stop)
Remove (handle_remove)
All components use tracing crate:
#[instrument]
fn handle_run(...) {
info!("Starting container");
debug!("Container ID: {}", id);
}
Enable with environment variables:
RUST_LOG=debug ./miniboxd
RUST_LOG=minibox::container=trace ./miniboxd
CLI (minibox-cli run ubuntu /bin/bash)
↓ Unix socket
Daemon (miniboxd)
↓ handle_run
Pull image (if not cached)
↓
Generate container ID
↓
Setup overlay filesystem
├─ Create directories
├─ Mount overlay
└─ Setup /proc
↓
Create cgroup
├─ Create /sys/fs/cgroup/minibox/<id>
├─ Write memory.max
└─ Write cpu.weight
↓
Spawn container process
├─ clone() with namespaces
├─ Child: set hostname
├─ Child: add to cgroup
├─ Child: pivot_root
├─ Child: close fds
└─ Child: execvp /bin/bash
↓
Return container ID to CLI
Key runtime paths:
/var/run/minibox.sock - Daemon socket/var/lib/minibox/containers/<id>/ - Container data
pid - Process ID fileoverlay/ - Overlay directoriesrootfs/ - Merged root filesystem/var/lib/minibox/images/ - Image cache/sys/fs/cgroup/minibox/<id>/ - Container cgroupCurrently no tests exist. Priority areas for testing:
Daemon uses hybrid approach:
spawn_blockinglibc syscalls are inherently synchronousExample:
spawn_blocking(move || {
spawn_container_process(...) // Blocking clone()
}).await
DaemonResponse::ErrorFor a comprehensive visual overview, view assets/architecture-diagram.txt which shows:
For implementation-level details, load references/component-details.md which covers:
For detailed implementation patterns:
minibox/src/container/process.rs for process spawning detailsminibox/src/container/cgroups.rs for resource managementminiboxd/src/handler.rs for request handling flow