Streamline AI docs, add skills, enforce symlink-everything policy
- Add .claude/skills/: homelab-context (auto-loads key facts each session), homelab-status (/homelab-status command), deploy-config (symlink setup guide) - Remove AGENTS.md and ai/sessions/: superseded by plan mode + skill system - Remove 4 obsolete session commands (session-start/list/switch, reload-instructions) - Rewrite CLAUDE.md: remove duplicate content, enforce symlink policy, clarify sudo pattern - Trim docs/services.md from 946 to ~230 lines: remove planning-era content, keep install steps and current status for migration reference - Strip stale "sudo cp" deploy header from ssh-honeypot.service (now symlinked to repo) - Update TODO.md: mark NAS migration and symlink tasks done, add jellyfin upgrade warning
This commit is contained in:
52
.claude/skills/deploy-config/SKILL.md
Normal file
52
.claude/skills/deploy-config/SKILL.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
name: deploy-config
|
||||
description: Set up symlinks from system config locations to this repo. Use when setting up on a new machine, or when a config file is found to be a real file instead of a symlink (config drift). Not for routine config changes — just edit the repo file directly.
|
||||
disable-model-invocation: true
|
||||
allowed-tools: Write, Bash(chmod *), Bash(diff *), Bash(ls *)
|
||||
---
|
||||
|
||||
All system configs should be symlinked to this repo. Editing the repo file IS editing the live config.
|
||||
|
||||
## Symlink Map
|
||||
|
||||
| System location | Repo source |
|
||||
|---|---|
|
||||
| `/etc/nginx/sites-available/homelab` | `config/nginx/homelab.conf` |
|
||||
| `/var/www/homelab/index.html` | `config/www/index.html` |
|
||||
| `/etc/systemd/system/copyparty.service` | `config/systemd/copyparty.service` |
|
||||
| `/etc/systemd/system/glances-web.service` | `config/systemd/glances-web.service` |
|
||||
| `/etc/systemd/system/ssh-honeypot.service` | `config/systemd/ssh-honeypot.service` |
|
||||
| `/opt/docker/<service>/docker-compose.yml` | `config/docker/<service>/docker-compose.yml` |
|
||||
|
||||
## When to use this skill
|
||||
|
||||
- **New machine setup**: Create all symlinks from scratch
|
||||
- **Drift detected**: A system file is a real file instead of a symlink — replace it with a symlink
|
||||
- **New config added to repo**: Create the initial symlink for it
|
||||
|
||||
## How to create/fix a symlink
|
||||
|
||||
Generate a script in `scripts/tmp/symlink-<name>.sh`:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
set -e
|
||||
REPO="/home/hoborg/homelab/<repo-path>"
|
||||
SYSTEM="<system-path>"
|
||||
|
||||
# Back up if it's a real file (not already a symlink)
|
||||
[ ! -L "$SYSTEM" ] && cp "$SYSTEM" "${SYSTEM}.backup.$(date +%Y%m%d)" && echo "Backup created"
|
||||
|
||||
ln -sf "$REPO" "$SYSTEM" && echo "Symlink created"
|
||||
# Add post-link steps here (e.g. nginx -t && systemctl reload nginx, systemctl daemon-reload)
|
||||
```
|
||||
|
||||
Tell the user to run: `sudo bash ~/homelab/scripts/tmp/symlink-<name>.sh`
|
||||
|
||||
## Routine config changes
|
||||
|
||||
Just edit `config/<path>` in the repo. The symlink means it's already live. Then:
|
||||
- Nginx: `sudo nginx -t && sudo systemctl reload nginx`
|
||||
- Systemd unit: `sudo systemctl daemon-reload && sudo systemctl restart <service>`
|
||||
- Docker: `cd /opt/docker/<service> && docker compose restart`
|
||||
- www/index.html: no action needed (served directly)
|
||||
Reference in New Issue
Block a user