gendesign/.worktreeinclude
lekss361 bc259b8024 chore(claude): agents view readiness — cleanup script, worktreeinclude, workflow rules
Подготовка к переходу на 'claude agents' dashboard как daily driver:

- scripts/cleanup-merged-worktrees.sh: removes worktrees whose branch is
  ancestor of forgejo/main. Run weekly via cron or manually after merge
  bursts. Safe — skips unmerged branches and current worktree.

- .worktreeinclude: copies .env files + .mcp.json into every new worktree
  (otherwise backend/frontend/MCP fail to start in fresh worktrees Claude
  creates for background sessions).

- .claude/rules/git-pr.md:
  - new MANDATORY workflow: default 'claude --bg --name X' background
    session (auto worktree, auto baseRef=fresh) vs foreground fallback
  - session naming convention (--name kebab-case)
  - polling section: preferred (agents view row status ●) vs foreground
    fallback (Skill loop)
  - new 'Multi-session workflow (Agent View)' section: parallelism budget,
    Ctrl+T pin, deprecated 'manual git worktree add', weekly cleanup ref

Local-only (not in this PR):
- .claude/settings.json: worktree.{baseRef:fresh, bgIsolation:worktree}
  (gitignored as personal preference)

Pre-cleanup state: 102 worktrees / 14GB. After: 99 / 14GB — only 3 squash-
merged branches removed via safe --is-ancestor check; 99 retained as
unmerged WIP. Aggressive cleanup (by age + Forgejo PR check) — future PR.
2026-05-24 12:13:59 +03:00

15 lines
559 B
Text

# Files copied into every new Claude Code worktree (despite being gitignored).
#
# `claude --bg` / `claude --worktree` / `claude agents` create fresh worktrees
# from a clean tree. Without these files copied, backend won't start (missing
# .env), frontend won't connect to API, MCP servers won't authenticate.
#
# Only gitignored files matched by these patterns are copied — tracked files
# are never duplicated.
#
# Reference: https://code.claude.com/docs/en/worktrees#copy-gitignored-files
backend/.env
backend/.env.runtime
frontend/.env.local
.mcp.json