diff --git a/skills/project-diagramming-archify/SKILL.md b/skills/project-diagramming-archify/SKILL.md index 608ece4..13d40a5 100644 --- a/skills/project-diagramming-archify/SKILL.md +++ b/skills/project-diagramming-archify/SKILL.md @@ -47,6 +47,21 @@ Commands (from the vendored skill's fast authoring path): Create `/docs/` (+ `docs/archify/`) if missing. Never write artifacts outside the project directory. +## Publish to the central maps site (optional but recommended) + +After a successful `deliver`, offer to **publish** the project's `docs/` to the LAN maps site: + +```bash +~/.agents/skills/project-diagramming-archify/publish-maps.sh [] +``` + +- Uploads `docs/` to Caddy on `.35` → **`https://maps.lab.audasmedia.com.au//docs/`** (site index at `https://maps.lab.audasmedia.com.au/` — Caddy `file_server browse`, no auth, read-only static hosting). +- **Incremental + atomic** (rsync -az): only changed blocks transfer; no half-written files on failure. +- Excludes `*.visual-check.*` sidecars automatically (keeps the browse index clean). +- Works from any machine with ssh key access to `.35` (all three pi machines have it). +- `publish-maps.sh --list` shows what's already published. +- Wait for `visual-check` to pass first; `publish-maps.sh` does NOT re-run it. + ## Authoring rules (subset of the vendored skill — read SKILL.md for full invariants) - Omit `meta.visual_preset`, `meta.subtitle`, `meta.legend`, `meta.engineering_profile` by default. diff --git a/skills/project-diagramming-archify/publish-maps.sh b/skills/project-diagramming-archify/publish-maps.sh new file mode 100755 index 0000000..5058460 --- /dev/null +++ b/skills/project-diagramming-archify/publish-maps.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# publish-maps.sh — publish a project's docs/ (Archify maps, Mermaid sources, +# diagrams) to the central maps site behind Caddy on .35. +# +# URL: https://maps.lab.audasmedia.com.au//docs/ (file_server browse) +# Host: sam@192.168.20.35:/Docker/Containers/caddy/maps/ +# +# Usage: +# publish-maps.sh [] # default: current directory +# publish-maps.sh --list # list what's already published +# +# Incremental + atomic (rsync -az): only changed blocks transfer; files are +# renamed into place so a failure mid-run can't leave a half-written map. +set -euo pipefail + +REMOTE="sam@192.168.20.35" +DEST_ROOT="/Docker/Containers/caddy/maps" +SSH_E="-e ssh -o BatchMode=yes -o ConnectTimeout=8" + +if [[ "${1:-}" == "--list" ]]; then + ssh -o BatchMode=yes -o ConnectTimeout=8 "$REMOTE" "ls -1 $DEST_ROOT" \ + || { echo "cannot reach $REMOTE" >&2; exit 1; } + exit 0 +fi + +PROJ="${1:-$(pwd)}" +PROJ="$(cd "$PROJ" && pwd)" +NAME="$(basename "$PROJ")" +DOCS="$PROJ/docs" + +if [[ ! -d "$DOCS" ]]; then + echo "no docs/ found in $PROJ — nothing to publish" >&2 + exit 1 +fi + +DEST="$DEST_ROOT/$NAME/docs" +echo "→ publishing $PROJ/docs → $REMOTE:$DEST" + +# Create the project's parent dir on the remote (rsync won't make nested parents) +ssh -o BatchMode=yes -o ConnectTimeout=8 "$REMOTE" "mkdir -p $DEST" \ + || { echo "cannot create $DEST on $REMOTE" >&2; exit 1; } + +# -a archive, -z compress, --exclude Archify visual-check sidecars (screenshots +# + receipts live next to the map; keeps the browse index clean) +rsync -az \ + --exclude '*.visual-check.*' \ + "$SSH_E" \ + "$DOCS/" "$REMOTE:$DEST/" + +echo "✓ published: https://maps.lab.audasmedia.com.au/$NAME/docs/" +echo " (site index: https://maps.lab.audasmedia.com.au/)" \ No newline at end of file