diff --git a/CLAUDE.md b/CLAUDE.md index 5456d21..f416cf0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -11,11 +11,11 @@ Dieses Repository enthält die globale Claude-Code-Workflow-Konfiguration für a ### Neuer Rechner (2 Schritte) ```bash -git clone https://gitea.troeger-net.org/martin/claude-workflow.git /mnt/projekte/claude-workflow -/mnt/projekte/claude-workflow/bootstrap.sh +git clone https://gitea.troeger-net.org/martin/claude-workflow.git +/bootstrap.sh ``` -Das Bootstrap-Skript erstellt alle Symlinks, prueft Voraussetzungen und zeigt fehlende Installationsbefehle an. +Der Pfad ist frei wählbar. Das Bootstrap-Skript erstellt alle Symlinks, prueft Voraussetzungen und zeigt fehlende Installationsbefehle an. ### Voraussetzungen @@ -40,13 +40,13 @@ echo 'DEIN_TOKEN' > ~/.config/gitea/token && chmod 600 ~/.config/gitea/token **Pushen (Rechner 1):** ```bash -cd /mnt/projekte/claude-workflow +cd git add -p && git commit -m "..." && git push ``` **Übernehmen (Rechner 2):** ```bash -cd /mnt/projekte/claude-workflow && git pull +cd && git pull ``` Da alles über Symlinks verbunden ist, sind Änderungen sofort aktiv. diff --git a/README.md b/README.md index 0e21910..b0e6660 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ Enthält Skills (`/go`, `/ship`, `/story`, `/plan-review`, `/workflow-review`), ## Einrichtung ```bash -git clone https://gitea.troeger-net.org/martin/claude-workflow.git /mnt/projekte/claude-workflow -/mnt/projekte/claude-workflow/bootstrap.sh +git clone https://gitea.troeger-net.org/martin/claude-workflow.git +/bootstrap.sh ``` Weitere Details in `CLAUDE.md`. diff --git a/bootstrap.sh b/bootstrap.sh index bf37671..4797c66 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,7 +1,7 @@ #!/bin/bash set -euo pipefail -REPO="/mnt/projekte/claude-workflow" +REPO="$(cd "$(dirname "$0")" && pwd)" echo "=== Claude-Workflow Bootstrap ===" @@ -27,8 +27,9 @@ ln -sf "$REPO/dotfiles/gitea-mcp-wrapper.sh" ~/.claude/gitea-mcp-wrapper.sh chmod +x "$REPO/dotfiles/gitea-mcp-wrapper.sh" echo " Dotfiles verlinkt" +ln -sfn "$REPO/hooks" ~/.claude/hooks chmod +x "$REPO/hooks/"*.sh -echo " Hooks ausfuehrbar" +echo " Hooks verlinkt und ausfuehrbar" # --- Voraussetzungen pruefen --- diff --git a/dotfiles/settings.json b/dotfiles/settings.json index 19ab979..7648abc 100644 --- a/dotfiles/settings.json +++ b/dotfiles/settings.json @@ -70,7 +70,7 @@ "hooks": [ { "type": "command", - "command": "bash /mnt/projekte/claude-workflow/hooks/pre-bash-checks.sh", + "command": "bash ~/.claude/hooks/pre-bash-checks.sh", "statusMessage": "Prüfe Bash-Sicherheitsregeln..." } ] @@ -82,7 +82,7 @@ "hooks": [ { "type": "command", - "command": "bash /mnt/projekte/claude-workflow/hooks/auto-format.sh" + "command": "bash ~/.claude/hooks/auto-format.sh" } ] } @@ -92,7 +92,7 @@ "hooks": [ { "type": "command", - "command": "bash /mnt/projekte/claude-workflow/hooks/verify-on-stop.sh" + "command": "bash ~/.claude/hooks/verify-on-stop.sh" } ] } diff --git a/hooks/auto-format.sh b/hooks/auto-format.sh index 0ba9fcd..6fd6308 100755 --- a/hooks/auto-format.sh +++ b/hooks/auto-format.sh @@ -4,7 +4,8 @@ set -euo pipefail -# Dateiname aus Umgebungsvariable (Claude Code setzt CLAUDE_TOOL_INPUT_FILE_PATH) +REPO_ROOT="$(dirname "$(cd "$(dirname "$(readlink -f "$0")")" && pwd)")" + FILE="${CLAUDE_TOOL_INPUT_FILE_PATH:-}" if [[ -z "$FILE" || ! -f "$FILE" ]]; then @@ -39,7 +40,7 @@ case "$EXT" in # Zweiter Pass: räumt die nun verwaisten Mehrfach-Leerzeilen auf (MD012). for _ in 1 2; do markdownlint-cli2 \ - --config /mnt/projekte/claude-workflow/.markdownlint-cli2.jsonc \ + --config "$REPO_ROOT/.markdownlint-cli2.jsonc" \ --fix "$FILE" >/dev/null 2>&1 || true done fi