refactor(agents): убраны настройки Claude из git и пакет codex

Claude: из репозитория удалены settings.local.json (разрешения не нужны
при autoapprove), statusline-command.sh и устаревший CLAUDE.md; линкуются
только skills. install.sh убирает артефакты прежних прогонов.

Codex: пакет удалён целиком, ~/.codex - обычный каталог. Персональные
мостики скиллов убраны; миграция раскрывает свёрнутый симлинк и переносит
рантайм-данные. Чищены chezmoi-скрипты.

install.sh: migrate_claude_stow_symlink обобщена в migrate_folded_symlink.
Тесты: 3 устаревших удалены, 3 добавлены; assert_not_exists ловит битые
симлинки.
This commit is contained in:
Dmitry Dementiev committed 2026-10-10 17:15:34 +02:00
1 parent 346b3bfc61
commit c3efe60a00
14 files changed
+122 -407

No files matched your search

-3
View File
@@ -2,6 +2,3 @@
*
!skills
!.gitignore
!settings.local.json
!statusline-command.sh
!CLAUDE.md
-19
View File
@@ -1,19 +0,0 @@
# Глобальный словарь рабочего процесса
Термины владельца, общие для всех проектов на этой машине.
## Ревью по температуре
Ось — сколько авторского контекста несёт ревьюер:
- **Горячее ревью** — автор сам перечитывает свой артефакт глазами читателя,
не автора. Контекст полный, дёшево. Текстовые огрехи правит по месту молча;
находку уровня решений (противоречие, дыра в охвате) предъявляет владельцу,
не исправляя и не замалчивая.
- **Тёплое ревью** — другой агент, получивший бриф. Контекст частичный: знает
замысел, но не варился в нём.
- **Холодное ревью** — свежая сессия или субагент без общего контекста.
Независимо, дороже всех.
Просьба «перечитай свежим взглядом» двусмысленна — уточни температуру;
по умолчанию имеется в виду горячее.
-120
View File
@@ -1,120 +0,0 @@
{
"permissions": {
"allow": [
"Bash(cat *)",
"Bash(ls)",
"Bash(ls *)",
"Bash(wc *)",
"Bash(head *)",
"Bash(tail *)",
"Bash(find *)",
"Bash(tree)",
"Bash(tree *)",
"Bash(file *)",
"Bash(stat *)",
"Bash(diff *)",
"Bash(realpath *)",
"Bash(readlink *)",
"Bash(basename *)",
"Bash(dirname *)",
"Bash(sort *)",
"Bash(uniq *)",
"Bash(cut *)",
"Bash(awk *)",
"Bash(sed *)",
"Bash(grep *)",
"Bash(rg *)",
"Bash(jq *)",
"Bash(yq *)",
"Bash(tr *)",
"Bash(echo *)",
"Bash(printf *)",
"Bash(which *)",
"Bash(type *)",
"Bash(command -v *)",
"Bash(env)",
"Bash(env *)",
"Bash(printenv)",
"Bash(printenv *)",
"Bash(pwd)",
"Bash(uname *)",
"Bash(whoami)",
"Bash(id)",
"Bash(date)",
"Bash(date *)",
"Bash(hostname)",
"Bash(git log*)",
"Bash(git diff*)",
"Bash(git status*)",
"Bash(git show*)",
"Bash(git branch*)",
"Bash(git remote -v*)",
"Bash(git remote show*)",
"Bash(git tag*)",
"Bash(git stash list*)",
"Bash(git rev-parse*)",
"Bash(git ls-files*)",
"Bash(git blame*)",
"Bash(git shortlog*)",
"Bash(git config --get*)",
"Bash(git config --list*)",
"Bash(git fetch*)",
"Bash(git add*)",
"Bash(docker ps*)",
"Bash(docker logs*)",
"Bash(docker inspect*)",
"Bash(docker images*)",
"Bash(docker stats*)",
"Bash(docker info*)",
"Bash(docker version*)",
"Bash(docker compose ps*)",
"Bash(docker compose logs*)",
"Bash(docker compose:*)",
"Bash(docker restart:*)",
"Bash(docker exec:*)",
"Bash(docker run:*)",
"Bash(docker stop:*)",
"Bash(docker rm:*)",
"Bash(curl *)",
"Bash(wget *)",
"Bash(mkdir *)",
"Bash(cp *)",
"Bash(mv *)",
"Bash(touch *)",
"Bash(chmod *)",
"Bash(ln *)",
"Bash(npm *)",
"Bash(npx *)",
"Bash(yarn *)",
"Bash(pnpm *)",
"Bash(bun *)",
"Bash(go *)",
"Bash(cargo *)",
"Bash(make *)",
"Bash(python *)",
"Bash(python3 *)",
"Bash(pip *)",
"Bash(pip3 *)",
"Bash(pytest *)",
"Bash(node *)",
"Bash(deno *)",
"Bash(stow *)",
"Bash(gh api:*)",
"Bash(gh search:*)",
"Bash(gh issue:*)",
"Bash(gh repo:*)",
"Bash(codex *)",
"Bash(timeout 600 codex exec *)",
"Bash(rm -f /tmp/claude-plan-*)",
"Bash(rm -f /tmp/codex-*)",
"WebSearch",
"mcp__claude_ai_Context7__resolve-library-id",
"Write(/tmp/claude-plan-*)",
"Write(/tmp/codex-*)"
]
},
"statusLine": {
"type": "command",
"command": "bash ~/.claude/statusline-command.sh"
}
}
-116
View File
@@ -1,116 +0,0 @@
#!/usr/bin/env bash
# Статусная строка Claude Code. JSON приходит на stdin.
#
# user@host:.../dir (branch) | Model Name (NM context) ctx:N% | 5h:N% 7d:N%
#
# Работает в Linux и в Git Bash на Windows: без `hostname -s`, jq не обязателен.
# Порог, после которого путь сокращается до .../<последний каталог>
MAX_PATH_LEN="${STATUSLINE_MAX_PATH_LEN:-28}"
input="$(cat)"
# ── Разбор JSON ───────────────────────────────────────────────────────
# Числовое поле $2 внутри объекта $1 (резервный разбор, без jq).
json_num() {
printf '%s' "$input" \
| tr -d ' \t\n\r' \
| grep -o "\"$1\":{[^}]*}" \
| grep -o "\"$2\":[0-9.eE+-]*" \
| head -1 \
| cut -d: -f2
}
# Строковое поле $2 внутри объекта $1 (резервный разбор, без jq).
json_str() {
printf '%s' "$input" \
| tr -d '\n\r' \
| grep -o "\"$1\"[[:space:]]*:[[:space:]]*{[^}]*}" \
| grep -o "\"$2\"[[:space:]]*:[[:space:]]*\"[^\"]*\"" \
| head -1 \
| sed 's/.*"[[:space:]]*:[[:space:]]*"//; s/"$//'
}
if command -v jq >/dev/null 2>&1; then
IFS=$'\t' read -r cwd display_name ctx_pct rate5h rate7d <<EOF
$(printf '%s' "$input" | jq -r '
def num: if type == "number" then tostring else "" end;
[ (.workspace.current_dir // ""),
(.model.display_name // ""),
(.context_window.used_percentage | num),
(.rate_limits.five_hour.used_percentage | num),
(.rate_limits.seven_day.used_percentage | num)
] | @tsv' 2>/dev/null)
EOF
else
cwd="$(json_str workspace current_dir)"
display_name="$(json_str model display_name)"
ctx_pct="$(json_num context_window used_percentage)"
rate5h="$(json_num five_hour used_percentage)"
rate7d="$(json_num seven_day used_percentage)"
fi
# Проценты в JSON дробные — округляем до целых.
round_pct() {
case "$1" in
''|null) return 0 ;;
esac
awk -v v="$1" 'BEGIN { printf "%d", (v < 0 ? -int(-v + 0.5) : int(v + 0.5)) }' 2>/dev/null
}
ctx_pct="$(round_pct "$ctx_pct")"
rate5h="$(round_pct "$rate5h")"
rate7d="$(round_pct "$rate7d")"
# ── Путь ──────────────────────────────────────────────────────────────
# В Git Bash current_dir может прийти с обратными слэшами.
path="${cwd//\\//}"
home="${HOME//\\//}"
if [ -n "$home" ]; then
if [ "$path" = "$home" ]; then
path="~"
else
case "$path" in
"$home"/*) path="~${path#"$home"}" ;;
esac
fi
fi
if [ "${#path}" -gt "$MAX_PATH_LEN" ]; then
path=".../${path##*/}"
fi
# ── Остальные секции ──────────────────────────────────────────────────
branch=""
if [ -n "$cwd" ]; then
branch="$(git -C "$cwd" rev-parse --abbrev-ref HEAD 2>/dev/null)"
fi
# Размер контекста уже внутри display_name, убираем только префикс «Claude ».
model="${display_name#Claude }"
user="${USER:-${USERNAME:-$(id -un 2>/dev/null)}}"
host="${HOSTNAME:-$(hostname 2>/dev/null)}"
host="${host%%.*}"
GREEN=$'\033[32m'
YELLOW=$'\033[33m'
PURPLE=$'\033[35m'
CYAN=$'\033[36m'
RESET=$'\033[0m'
out="${GREEN}${user}@${host}${RESET}:${YELLOW}${path}${RESET}"
[ -n "$branch" ] && out="${out} ${PURPLE}(${branch})${RESET}"
out="${out} | ${CYAN}${model}${RESET}"
[ -n "$ctx_pct" ] && out="${out} ctx:${ctx_pct}%"
rates=""
[ -n "$rate5h" ] && rates="${rates} 5h:${rate5h}%"
[ -n "$rate7d" ] && rates="${rates} 7d:${rate7d}%"
[ -n "$rates" ] && out="${out} |${rates}"
printf '%s\n' "$out"
+1 -1
View File
@@ -1,3 +1,3 @@
# Claude Code управляется вручную через install.sh (копирование, не симлинк).
# Claude Code управляется вручную через install.sh (точечные симлинки).
# Этот файл не даёт stow случайно создать симлинк ~/.claude.
\.claude