Skip to main content
ClaudeWave
Skill1.4k estrellas del repoactualizado 28d ago

cpp-deploy

cpp-deploy provides Dockerfile patterns and build configuration for containerizing C/C++ applications using CMake or Meson build systems. Use this skill when deploying a C or C++ project that contains CMakeLists.txt or meson.build, as it automates multi-stage Docker builds that compile the application in a GCC container and copy only the final binary to a slim runtime image.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/nixopus/nixopus /tmp/cpp-deploy && cp -r /tmp/cpp-deploy/api/skills/cpp-deploy ~/.claude/skills/cpp-deploy
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# C/C++ Deployment

## Detection

Project is C/C++ if `CMakeLists.txt` or `meson.build` exists in the root.

## Versions

Latest CMake (or Meson) and Ninja installed during build. No explicit version pinning by default.

## Build

### Build Process

1. Install CMake or Meson and Ninja
2. Configure and build into `./build` (or `/build`)
3. Executable placed in the build directory

### Start Command

Executable name matches the project root directory name, located in the build directory.
Example: project `my_app/` → `./build/my_app` or `/build/my_app`.

### Output

- Build directory: `/build` (or `./build`)
- Source tree not included in final container; only build artifacts

## Build Systems

| File | Build system |
|---|---|
| `CMakeLists.txt` | CMake |
| `meson.build` | Meson |

Both use Ninja as the default generator/backend.

## Install Stage Optimization

Copy in order:
- `CMakeLists.txt` or `meson.build`
- `meson.options` (Meson)
- `src/`, `include/`, or full source tree

## Base Images

| Stage | Image |
|---|---|
| Build | `gcc` or `clang` + CMake/Meson + Ninja |
| Runtime | `debian:bookworm-slim` or `alpine` (copy binary only) |

## Dockerfile Patterns

### CMake

```dockerfile
FROM gcc:13-bookworm AS build
RUN apt-get update && apt-get install -y cmake ninja-build && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY CMakeLists.txt ./
COPY src src
RUN cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release && cmake --build build

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates libstdc++6 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/build/my_app .
EXPOSE 8080
CMD ["./my_app"]
```

### Meson

```dockerfile
FROM gcc:13-bookworm AS build
RUN apt-get update && apt-get install -y meson ninja-build && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY meson.build meson.options* ./
COPY src src
RUN meson setup build -Dbuildtype=release && ninja -C build

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates libstdc++6 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/build/my_app .
EXPOSE 8080
CMD ["./my_app"]
```
api-catalogSkill

Reference for all Nixopus API operations callable via nixopus_api(method, path, body)

caddyfile-generationSkill

Generate Caddyfile configurations for static sites and reverse proxies — SPA fallback routing, cache headers, compression, redirects, and error pages. Use when deploying a static site that needs custom Caddy configuration, or when the user needs SPA routing, caching, or redirect rules.

compose-setupSkill

Generate docker-compose.yml for multi-service setups including databases, caches, and service dependencies. Use when the app needs a database, cache, message broker, or has multiple independently deployable services.

container-resource-tuningSkill

Size container memory and CPU limits, diagnose OOM kills and CPU throttling, and recommend resource adjustments by ecosystem. Use when containers are being OOM-killed, running slowly, or when setting initial resource limits for a deployment.

database-migrationSkill

Run database migrations safely during deployment — framework-specific commands, pre-deploy vs post-deploy timing, health gates, and rollback strategies. Use when the app has a database migration system and needs migrations run during deployment.

deno-deploySkill

Build and deploy Deno applications — version detection, dependency caching, and Dockerfile patterns. Use when deploying a Deno project, or when deno.json or deno.jsonc is detected.

deploy-delegationSkill

Sub-agent routing table — which agent handles diagnostics, machine health, infrastructure, GitHub, billing, and notifications. Load when the current task is not a direct deployment.

deploy-flowSkill

Full deploy pipeline — source detection, hints-driven analysis, project creation, deployment monitoring, and live URL delivery. Load when the user wants to deploy an application.