domain-attachment
domain-attachment guides domain configuration for Nixopus applications through three paths: attaching auto-generated subdomains at project creation time (preferred), adding subdomains post-creation via add_application_domain, or setting up custom domains with manual DNS verification via CNAME and TXT records. Use the creation-time path for standard deployments and fall back to post-creation flows only when modifying existing applications or enabling custom domains requiring DNS provider configuration.
git clone --depth 1 https://github.com/nixopus/nixopus /tmp/domain-attachment && cp -r /tmp/domain-attachment/api/skills/domain-attachment ~/.claude/skills/domain-attachmentSKILL.md
# Domain Attachment
## Preferred: Pass Domain at Creation Time
The fastest path — zero extra tool calls after project creation:
1. Call `generate_random_subdomain` to get a subdomain.
2. Pass `domains: ["<subdomain>"]` in the `createProject` call.
3. Done — the domain is attached at creation, wildcard DNS and TLS are automatic.
Use this path for all standard deploys. Only fall back to the post-creation flow below when adding domains to an existing app or when the user wants a custom domain.
## Post-Creation: Auto-Generated Subdomain
If the app already exists and has no domain:
1. Call `generate_random_subdomain`.
2. Call `add_application_domain` with id (app UUID) and the subdomain.
3. Done — wildcard DNS and TLS are handled automatically.
## Step 4: Custom Domain Setup
If the user wants a custom domain (e.g. `app.example.com`):
1. Call `create_domain` with the domain name.
2. The response includes DNS setup instructions. Relay them clearly to the user:
- **CNAME record**: point the domain to their assigned `subdomain.nixopus.ai`
- **TXT record**: `_nixopus-verify.{domain}` with the verification value from the response
3. Tell the user to add both records at their DNS provider (Cloudflare, Namecheap, Route53, GoDaddy, etc.).
4. After the user confirms DNS is configured, call `update_domain` with the domain ID to verify.
5. If verification succeeds, call `add_application_domain` to attach the domain.
6. If verification fails:
- DNS propagation can take minutes to 48 hours depending on the provider.
- Suggest the user wait and retry, or check their DNS records are correct.
- For deeper troubleshooting: `read_skill("domain-tls-routing")`.
## Common DNS Provider Notes
| Provider | Propagation | Notes |
|----------|-------------|-------|
| Cloudflare | Near-instant | Disable orange cloud (proxy) for the CNAME initially so verification passes |
| Namecheap | 5-30 minutes | Use "CNAME Record" type, host = subdomain part only |
| Route53 | 60 seconds | Standard CNAME + TXT |
| GoDaddy | Up to 48 hours | Slowest propagation |
## Important
- Never skip domain attachment — a deployed app without a domain is not reachable.
- For Compose apps, `add_application_domain` accepts an optional `service_name` and `port` to route to a specific service.Reference for all Nixopus API operations callable via nixopus_api(method, path, body)
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.
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.
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.
Build and deploy C/C++ applications — CMake, Meson, Ninja, and Dockerfile patterns. Use when deploying a C or C++ project, or when CMakeLists.txt or meson.build is detected.
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.
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.
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.