From 539b6f40bca5d9f46e9132ec30064648961115c8 Mon Sep 17 00:00:00 2001 From: Maciej Pienczyn Date: Sat, 10 Jan 2026 14:44:41 +0100 Subject: [PATCH] docs: Add Auto Claude configuration and merge conflict resolution guide - Document Auto Claude state files that should never be committed - Add pre-commit hook that automatically unstages Auto Claude files - Include troubleshooting steps for merge conflicts - Document worktree management commands This prevents future merge conflicts caused by .auto-claude-* files. Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 4f54e5c..9039b3c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -192,6 +192,69 @@ ssh maciejpi@10.22.68.249 "cd /var/www/nordabiznes && sudo -u www-data git pull - **User:** www-data - **SSL verify:** disabled (`git -c http.sslVerify=false`) +## Auto Claude - Konfiguracja i rozwiązywanie problemów + +### Pliki stanu Auto Claude (WAŻNE!) + +Auto Claude tworzy lokalne pliki stanu które **NIE POWINNY** być commitowane: +- `.auto-claude-security.json` - stan bezpieczeństwa projektu +- `.auto-claude-status` - status bieżącego zadania +- `.auto-claude/` - katalog roboczy Auto Claude + +**Problem:** Auto Claude czasami dodaje te pliki do staging area w worktree branches, co powoduje konflikty merge gdy branch jest mergowany do master. + +**Rozwiązanie (wdrożone 2026-01-10):** + +1. **`.gitignore`** - pliki są ignorowane: + ``` + .auto-claude/ + .auto-claude-security.json + .auto-claude-status + ``` + +2. **Pre-commit hook** - automatycznie usuwa te pliki ze staging area: + ``` + .git/hooks/pre-commit + ``` + Hook sprawdza przed każdym commitem czy pliki Auto Claude są staged i automatycznie je usuwa. + +3. **Pliki usunięte z śledzenia** - wykonano `git rm --cached` na master + +### Rozwiązywanie konfliktów merge z Auto Claude + +Jeśli pojawi się konflikt merge z plikami `.auto-claude-*`: + +```bash +# 1. Sprawdź czy to konflikt zmiana/usunięcie +git status + +# 2. Usuń pliki Auto Claude z merge (akceptuj usunięcie z master) +git rm .auto-claude-security.json .auto-claude-status + +# 3. Dokończ merge +git commit -m "Merge branch 'feature' - resolve Auto Claude file conflicts" +``` + +### Worktrees Auto Claude + +Auto Claude tworzy worktrees dla każdego zadania w: +``` +.auto-claude/worktrees/tasks// +``` + +Każdy worktree ma własny branch i własne pliki stanu. Po zamergowaniu zadania worktree może być usunięty. + +**Sprawdzenie aktywnych worktrees:** +```bash +git worktree list +``` + +**Usunięcie nieaktualnego worktree:** +```bash +git worktree remove .auto-claude/worktrees/tasks/ +git branch -d auto-claude/ +``` + ## Konwencje danych ### Identyfikatory firm