Critical Rules
- ALWAYS read credentials from
~/.config/home-server/credentials.env — NEVER hardcode API keys in commands or output
- ALWAYS prefer the Coolify API (
$COOLIFY_API_URL) over direct Docker commands for service management
- When deploying new services, ALWAYS try Coolify one-click templates first before custom docker-compose
- One-click services MUST have "Connect to Predefined Network" enabled for Traefik routing — remind the user or set it via API
- docker_compose_raw MUST be base64-encoded when PATCHing via the Coolify API
- FQDN is stored separately on the
service_applications table — updating docker-compose alone does NOT update routing
- NEVER expose services publicly without explicit user confirmation — all services are Tailscale-only by default
- Before making infrastructure changes, state what you're about to do and get confirmation
- When troubleshooting cert issues, check: (1) container network includes coolify-proxy, (2) Traefik labels have correct port, (3) ACME cert exists in
/data/coolify/proxy/acme.json
- Glance config at
/data/coolify/services/l0cws0skkokg08k44g4ocswc/config/glance.yml live-reloads — no restart needed
Credentials
All credentials are stored at ~/.config/home-server/credentials.env (chmod 600). To load them:
# Read a single value
grep '^COOLIFY_API_TOKEN=' ~/.config/home-server/credentials.env | cut -d= -f2- | tr -d '"'
# Source all values (for multi-command operations)
set -gx (grep -v '^#' ~/.config/home-server/credentials.env | grep '=' | string split -m1 '=')
If the credentials file is missing, use the credential-manager agent to recreate it from memory.
Server Architecture
Read ~/.config/home-server/server-config.md for the complete server topology, service UUIDs, container names, volume mounts, and network layout.
Read ~/.config/home-server/coolify-patterns.md for Coolify API patterns, common operations, and known gotchas.
Read ~/.config/home-server/networking.md for Tailscale, Cloudflare, and Traefik configuration details.
Workflow
Step 1: Understand Intent
Parse the user's natural language request and classify it:
- Deploy: New service deployment → use
coolify-specialist agent
- Configure: Modify existing service settings → use
coolify-specialist or app-tuner agent
- Network: DNS, certs, routing, public access → use
networking-specialist agent
- Troubleshoot: Something broken → read logs, check config, determine which specialist to dispatch
- Optimize: Tune performance or quality → use
app-tuner agent
- Status: Check what's running → query Coolify API directly (no agent needed)
- Dashboard: Modify Glance → edit the config file directly (live-reloads)
Step 2: Load Credentials
Before any API call, load the relevant credentials:
COOLIFY_TOKEN=$(grep '^COOLIFY_API_TOKEN=' ~/.config/home-server/credentials.env | cut -d= -f2- | tr -d '"')
Step 3: Dispatch to Specialist
For complex tasks, dispatch to the appropriate agent using the Agent tool:
| Task Domain |
Agent |
Model |
| Coolify API, deployments, docker-compose |
home-server:coolify-specialist |
sonnet |
| Tailscale, Cloudflare, Traefik, certs |
home-server:networking-specialist |
sonnet |
| App-specific tuning, docs research |
home-server:app-tuner |
sonnet |
| Post-session skill updates |
home-server:retrospect |
sonnet |
For simple tasks (status checks, Glance edits, single API calls), handle directly without spawning an agent.
Step 4: Validate
After making changes:
- Verify the service is running: check Coolify API status
- Verify HTTPS works:
curl -vk https://{service}.home.birdcar.dev 2>&1 | grep 'subject:'
- Verify the cert is Let's Encrypt (not TRAEFIK DEFAULT CERT)
- For app-specific changes, verify the app is responding correctly
Step 5: Update Knowledge (if applicable)
If this session revealed new information about the server (new services, changed configs, gotchas discovered), update:
~/.claude/projects/-home-birdcar/memory/MEMORY.md — for cross-session memory
~/.claude/projects/-home-birdcar/memory/media-server-setup.md — for detailed server notes
~/.config/home-server/server-config.md — for skill-internal reference
Common Operations Quick Reference
Check all services status
curl -s -H "Authorization: Bearer $COOLIFY_TOKEN" "$COOLIFY_API_URL/projects" | python3 -m json.tool
Deploy a one-click service
- Create via Coolify UI or API
- Enable "Connect to Predefined Network" (
connect_to_docker_network: true)
- Set FQDN in Coolify UI
- Verify Traefik picks it up and issues cert
Restart a service
curl -s -X POST -H "Authorization: Bearer $COOLIFY_TOKEN" "$COOLIFY_API_URL/services/{uuid}/restart"
Check Traefik cert status
sudo python3 -c "
import json
with open('/data/coolify/proxy/acme.json') as f:
data = json.load(f)
for r, info in data.items():
for c in info.get('Certificates', []):
print(c['domain']['main'])
"
1---2name: home-server3description: Manages the nest home server: Coolify deployments, Traefik routing, Tailscale networking, Cloudflare DNS, and all deployed applications (Jellyfin, *arr stack, LazyLibrarian, Kavita, Audiobookshelf, Castopod, Home Assistant, Glance, SABnzbd, n8n, etc). Use when the user asks to deploy, configure, troubleshoot, or optimize any service on their home server, manage DNS/networking, check service status, or tune application settings. Also triggers on mentions of Coolify, Traefik, Tailscale, Cloudflare, or any deployed service by name. Do NOT use for creating or modifying Claude Code skills, plugins, or commands. Do NOT use for general Docker administration unrelated to this server's Coolify instance.4---56## Critical Rules78- ALWAYS read credentials from `~/.config/home-server/credentials.env` — NEVER hardcode API keys in commands or output9- ALWAYS prefer the Coolify API (`$COOLIFY_API_URL`) over direct Docker commands for service management10- When deploying new services, ALWAYS try Coolify one-click templates first before custom docker-compose11- One-click services MUST have "Connect to Predefined Network" enabled for Traefik routing — remind the user or set it via API12- docker_compose_raw MUST be base64-encoded when PATCHing via the Coolify API13- FQDN is stored separately on the `service_applications` table — updating docker-compose alone does NOT update routing14- NEVER expose services publicly without explicit user confirmation — all services are Tailscale-only by default15- Before making infrastructure changes, state what you're about to do and get confirmation16- When troubleshooting cert issues, check: (1) container network includes coolify-proxy, (2) Traefik labels have correct port, (3) ACME cert exists in `/data/coolify/proxy/acme.json`17- Glance config at `/data/coolify/services/l0cws0skkokg08k44g4ocswc/config/glance.yml` live-reloads — no restart needed1819## Credentials2021All credentials are stored at `~/.config/home-server/credentials.env` (chmod 600). To load them:2223```bash24# Read a single value25grep '^COOLIFY_API_TOKEN=' ~/.config/home-server/credentials.env | cut -d= -f2- | tr -d '"'2627# Source all values (for multi-command operations)28set -gx (grep -v '^#' ~/.config/home-server/credentials.env | grep '=' | string split -m1 '=')29```3031If the credentials file is missing, use the `credential-manager` agent to recreate it from memory.3233## Server Architecture3435Read `~/.config/home-server/server-config.md` for the complete server topology, service UUIDs, container names, volume mounts, and network layout.3637Read `~/.config/home-server/coolify-patterns.md` for Coolify API patterns, common operations, and known gotchas.3839Read `~/.config/home-server/networking.md` for Tailscale, Cloudflare, and Traefik configuration details.4041## Workflow4243### Step 1: Understand Intent4445Parse the user's natural language request and classify it:4647- **Deploy**: New service deployment → use `coolify-specialist` agent48- **Configure**: Modify existing service settings → use `coolify-specialist` or `app-tuner` agent49- **Network**: DNS, certs, routing, public access → use `networking-specialist` agent50- **Troubleshoot**: Something broken → read logs, check config, determine which specialist to dispatch51- **Optimize**: Tune performance or quality → use `app-tuner` agent52- **Status**: Check what's running → query Coolify API directly (no agent needed)53- **Dashboard**: Modify Glance → edit the config file directly (live-reloads)5455### Step 2: Load Credentials5657Before any API call, load the relevant credentials:5859```bash60COOLIFY_TOKEN=$(grep '^COOLIFY_API_TOKEN=' ~/.config/home-server/credentials.env | cut -d= -f2- | tr -d '"')61```6263### Step 3: Dispatch to Specialist6465For complex tasks, dispatch to the appropriate agent using the Agent tool:6667| Task Domain | Agent | Model |68| ---------------------------------------- | ----------------------------------- | ------ |69| Coolify API, deployments, docker-compose | `home-server:coolify-specialist` | sonnet |70| Tailscale, Cloudflare, Traefik, certs | `home-server:networking-specialist` | sonnet |71| App-specific tuning, docs research | `home-server:app-tuner` | sonnet |72| Post-session skill updates | `home-server:retrospect` | sonnet |7374For simple tasks (status checks, Glance edits, single API calls), handle directly without spawning an agent.7576### Step 4: Validate7778After making changes:79801. Verify the service is running: check Coolify API status812. Verify HTTPS works: `curl -vk https://{service}.home.birdcar.dev 2>&1 | grep 'subject:'`823. Verify the cert is Let's Encrypt (not TRAEFIK DEFAULT CERT)834. For app-specific changes, verify the app is responding correctly8485### Step 5: Update Knowledge (if applicable)8687If this session revealed new information about the server (new services, changed configs, gotchas discovered), update:88891. `~/.claude/projects/-home-birdcar/memory/MEMORY.md` — for cross-session memory902. `~/.claude/projects/-home-birdcar/memory/media-server-setup.md` — for detailed server notes913. `~/.config/home-server/server-config.md` — for skill-internal reference9293## Common Operations Quick Reference9495### Check all services status9697```bash98curl -s -H "Authorization: Bearer $COOLIFY_TOKEN" "$COOLIFY_API_URL/projects" | python3 -m json.tool99```100101### Deploy a one-click service1021031. Create via Coolify UI or API1042. Enable "Connect to Predefined Network" (`connect_to_docker_network: true`)1053. Set FQDN in Coolify UI1064. Verify Traefik picks it up and issues cert107108### Restart a service109110```bash111curl -s -X POST -H "Authorization: Bearer $COOLIFY_TOKEN" "$COOLIFY_API_URL/services/{uuid}/restart"112```113114### Check Traefik cert status115116```bash117sudo python3 -c "118import json119with open('/data/coolify/proxy/acme.json') as f:120 data = json.load(f)121for r, info in data.items():122 for c in info.get('Certificates', []):123 print(c['domain']['main'])124"125```