Commit graph

3 commits

Author SHA1 Message Date
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
73bdff41a7 chore(claude-config): align with 2026 best practices (#495) 2026-05-24 08:48:42 +00:00
lekss361
ae0fce3528
refactor(claude): split 700-line CLAUDE.md into path-scoped .claude/rules/ (#188)
Old CLAUDE.md was 700 lines — exceeded Anthropic 200-line recommendation,
adherence degraded under context pressure.

Refactor per research findings:

- CLAUDE.md 700 -> 97 lines (essential only, pointers to rules)
- .claude/rules/{backend,frontend,sql,git-pr,deploy}.md (NEW, path-scoped)
- ~/.claude/CLAUDE.md (NEW, 21 lines) — personal cross-project prefs
- memory/ — deleted 12 feedback files promoted to proper layer (CLAUDE.md
  rules table, .claude/rules/, ~/.claude/CLAUDE.md). 7 remaining = workflow
  details.
- .gitignore: !.claude/agents/, !.claude/rules/ exceptions

Total auto-loaded per session: 97 (CLAUDE.md) + 21 (~/.claude) = 118 lines
vs prior 700. Rules in .claude/rules/ load only when matching paths touched.

Resolves conflict no_self_review vs pre_push_review: now single rule in
git-pr.md Review workflow section (pre-push = local lint; post-push =
external Claude window posting as lekss361).

Code-reviewer feedback applied:
- paths: frontmatter added to git-pr.md
- Auto-merge scope blocked-list now includes .claude/rules/*.md changes
  to prevent self-extending rules without human approval.

Co-authored-by: lekss361 <claudestars@proton.me>
2026-05-15 23:06:33 +03:00