fix(skills): ужесточены permissions и добавлен TODO для codex-review
- Зачем:
- Codex-ревью выявило permission bypass через Bash(timeout *) и
сохраняющиеся safety prompts на $() и > в bash-командах.
- Что:
- permission сужен до Bash(timeout 600 codex exec *), rm-паттерны конкретизированы.
- REVIEW_ID использует $RANDOM для энтропии, resume пишет в файл вместо pipe.
- добавлен TODO в AGENTS.md: план замены bash-паттернов на нативные инструменты.
- Проверка:
- /codex-review при следующем использовании.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
6190fbaf08
commit
3c690bdb12
3 files changed
+22
-6
No files matched your search
@@ -44,6 +44,21 @@ This repository contains personal dotfiles and configurations for a highly produ
|
|||||||
* **Safe Commands:** `git status`, `git diff`, and `git add` are pre-approved in the policy.
|
* **Safe Commands:** `git status`, `git diff`, and `git add` are pre-approved in the policy.
|
||||||
* **Commits:** Always use the `conventional-commits` skill for generating commit messages. Use the ` Способ B` (temporary file) if direct Heredoc causes issues.
|
* **Commits:** Always use the `conventional-commits` skill for generating commit messages. Use the ` Способ B` (temporary file) if direct Heredoc causes issues.
|
||||||
|
|
||||||
|
## 📋 TODO
|
||||||
|
|
||||||
|
### codex-review: убрать permission prompts
|
||||||
|
|
||||||
|
Скилл `codex-review` (`agents/.agents/skills/codex-review/SKILL.md`) вызывает
|
||||||
|
safety warnings Claude Code на `$()` и `>` в bash-командах. Allow-list не помогает —
|
||||||
|
это отдельный слой проверок.
|
||||||
|
|
||||||
|
**Решение:** переписать шаги скилла, заменив bash-паттерны на встроенные инструменты:
|
||||||
|
|
||||||
|
- **Шаг 2 (Session ID):** Claude генерирует ID сам, без `$(date)` в bash.
|
||||||
|
- **Шаг 3 (Diff):** `git diff` → результат через Write tool вместо `>` redirect.
|
||||||
|
- **Шаг 7 (Resume):** stdout tool result вместо `> file 2>&1`.
|
||||||
|
- Шаги 4 и 9 — без изменений (`-o` и `rm -f` работают).
|
||||||
|
|
||||||
## ⚠️ Important Files for Reference
|
## ⚠️ Important Files for Reference
|
||||||
* `README.md`: Detailed installation and usage instructions.
|
* `README.md`: Detailed installation and usage instructions.
|
||||||
* `bash/.bash_functions`: Proxy and environment management functions.
|
* `bash/.bash_functions`: Proxy and environment management functions.
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ user_invocable: true
|
|||||||
### Шаг 2: Сгенерировать Session ID
|
### Шаг 2: Сгенерировать Session ID
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
REVIEW_ID=$(date +%s | tail -c 9)
|
REVIEW_ID="$(date +%s)-${RANDOM}"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Шаг 3: Подготовить материал для ревью
|
### Шаг 3: Подготовить материал для ревью
|
||||||
@@ -212,10 +212,10 @@ timeout 600 codex exec resume ${CODEX_SESSION_ID} \
|
|||||||
Here's what I changed:
|
Here's what I changed:
|
||||||
[Список правок]
|
[Список правок]
|
||||||
|
|
||||||
Please re-review. End with VERDICT: APPROVED or VERDICT: REVISE" 2>&1 | tail -200
|
Please re-review. End with VERDICT: APPROVED or VERDICT: REVISE" > /tmp/codex-review-${REVIEW_ID}.md 2>&1
|
||||||
```
|
```
|
||||||
|
|
||||||
**Примечание:** `resume` не поддерживает `-o`. Вывод читается из stdout через `tail -200`.
|
**Примечание:** `resume` не поддерживает `-o`. Вывод перенаправляется в файл через `>`. Затем читай файл как обычно (Шаг 5).
|
||||||
|
|
||||||
**Fallback** — если `resume` не сработал (сессия истекла, session ID не захвачен):
|
**Fallback** — если `resume` не сработал (сессия истекла, session ID не захвачен):
|
||||||
|
|
||||||
|
|||||||
@@ -104,9 +104,10 @@
|
|||||||
"Bash(gh issue:*)",
|
"Bash(gh issue:*)",
|
||||||
"Bash(gh repo:*)",
|
"Bash(gh repo:*)",
|
||||||
"Bash(codex *)",
|
"Bash(codex *)",
|
||||||
"Bash(timeout *)",
|
"Bash(timeout 600 codex exec *)",
|
||||||
"Bash(rm -f /tmp/claude-*)",
|
"Bash(rm -f /tmp/claude-diff-*)",
|
||||||
"Bash(rm -f /tmp/codex-*)",
|
"Bash(rm -f /tmp/claude-plan-*)",
|
||||||
|
"Bash(rm -f /tmp/codex-review-*)",
|
||||||
"WebSearch",
|
"WebSearch",
|
||||||
"mcp__claude_ai_Context7__resolve-library-id",
|
"mcp__claude_ai_Context7__resolve-library-id",
|
||||||
"Write(/tmp/claude-plan-*)",
|
"Write(/tmp/claude-plan-*)",
|
||||||
|
|||||||
Reference in new issue
Block a user