oh-my-customcode 0.153.0 → 0.154.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/.claude/agents/arch-documenter.md +17 -0
- package/templates/.claude/agents/fe-design-expert.md +20 -0
- package/templates/.claude/agents/mgr-creator.md +2 -10
- package/templates/.claude/agents/mgr-updater.md +2 -10
- package/templates/.claude/hooks/hooks.json +10 -0
- package/templates/.claude/hooks/scripts/feedback-collector.sh +9 -6
- package/templates/.claude/hooks/scripts/r007-r008-drift-advisor.sh +117 -0
- package/templates/.claude/hooks/scripts/session-reflection.sh +53 -1
- package/templates/.claude/hooks/scripts/skill-extractor-analyzer.sh +8 -1
- package/templates/.claude/rules/MAY-optimization.md +15 -0
- package/templates/.claude/rules/MUST-agent-design.md +11 -23
- package/templates/.claude/rules/MUST-agent-identification.md +35 -0
- package/templates/.claude/rules/MUST-enforcement-policy.md +6 -5
- package/templates/.claude/rules/MUST-language-policy.md +16 -0
- package/templates/.claude/rules/MUST-orchestrator-coordination.md +42 -0
- package/templates/.claude/rules/MUST-tool-identification.md +37 -0
- package/templates/.claude/rules/SHOULD-hud-statusline.md +2 -0
- package/templates/manifest.json +1 -1
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -50,3 +50,20 @@ When invoked for plan/spec authoring tasks:
|
|
|
50
50
|
Rationale: Single-agent giant prompts cause latency timeouts and waste context (#1085). Decomposition by domain enables parallel execution and review loops.
|
|
51
51
|
|
|
52
52
|
Reference rules: R009 (parallel execution), R018 (Agent Teams).
|
|
53
|
+
|
|
54
|
+
## Output Constraints (Large Artifact Reply)
|
|
55
|
+
|
|
56
|
+
큰 산출물(>50줄 또는 >2000자)을 호출자에게 회신할 때:
|
|
57
|
+
- **파일 절대경로** 와 **행 수** 만 회신
|
|
58
|
+
- 작성된 핵심 섹션 제목을 bullet 3-7개로 요약
|
|
59
|
+
- 파일 본문 자체는 LLM 출력으로 재출력하지 않음 — 호출자가 `Read` 또는 `cat` 으로 직접 확인
|
|
60
|
+
|
|
61
|
+
이유: 대용량 텍스트 재출력은 토큰 낭비 + 타임아웃 위험 + 컨텍스트 압박. 디스크에 이미 쓴 파일이 진실의 원본이다.
|
|
62
|
+
|
|
63
|
+
### Exceptions
|
|
64
|
+
|
|
65
|
+
- 호출자가 명시적으로 본문을 보여달라고 요구한 경우
|
|
66
|
+
- 산출물이 50줄 또는 2000자 이하인 경우
|
|
67
|
+
- 변경 diff 같은 작은 patch 형태인 경우
|
|
68
|
+
|
|
69
|
+
Reference issue: #1087.
|
|
@@ -8,6 +8,7 @@ effort: medium
|
|
|
8
8
|
skills:
|
|
9
9
|
- impeccable-design
|
|
10
10
|
- web-design-guidelines
|
|
11
|
+
- diagram-design
|
|
11
12
|
tools: [Read, Write, Edit, Grep, Glob, Bash]
|
|
12
13
|
maxTurns: 20
|
|
13
14
|
disallowedTools: [Bash]
|
|
@@ -112,8 +113,27 @@ Flag these patterns as AI slop:
|
|
|
112
113
|
- Backend or API code → use appropriate language/framework agent
|
|
113
114
|
- Bundle size analysis → use `tool-npm-expert`
|
|
114
115
|
|
|
116
|
+
## Claude Design Handoff
|
|
117
|
+
|
|
118
|
+
When receiving artifacts from Claude Design (Anthropic's conversational design tool):
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
Receive handoff (tokens JSON + component specs)
|
|
122
|
+
↓
|
|
123
|
+
1. Validate token integrity (OKLCH colors, consistent spacing scale, type hierarchy)
|
|
124
|
+
2. Convert tokens → CSS custom properties
|
|
125
|
+
3. Implement component specs → framework components (all variant states)
|
|
126
|
+
4. Verify motion specs have functional purpose + prefers-reduced-motion guard
|
|
127
|
+
5. Run AI Slop Test before declaring implementation done
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Handoff validation checklist** — see `guides/claude-design/index.md` for the full token integrity, component fidelity, motion verification, and slop check criteria.
|
|
131
|
+
|
|
132
|
+
**Agent boundary**: Claude Design handoff stops at aesthetics and visual implementation. For accessibility compliance (WCAG, semantic HTML), pass to `fe-vercel-agent` or invoke `web-design-guidelines`.
|
|
133
|
+
|
|
115
134
|
## Reference Guides
|
|
116
135
|
|
|
136
|
+
- `guides/claude-design/index.md` — Claude Design artifact handoff workflow and validation checklist
|
|
117
137
|
- `guides/impeccable-design/typography.md` — type scale, font pairing, hierarchy
|
|
118
138
|
- `guides/impeccable-design/color-and-contrast.md` — OKLCH, palette strategy, tinted neutrals
|
|
119
139
|
- `guides/impeccable-design/motion-design.md` — timing rules, easing, purposeful animation
|
|
@@ -18,17 +18,9 @@ maxTurns: 25
|
|
|
18
18
|
permissionMode: bypassPermissions
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## .claude/ 경로 처리 (CC v2.1.121+)
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Pattern:
|
|
26
|
-
1. Write tool → `/tmp/fix-{topic}-$$.sh` containing heredoc/sed/cp targeting `.claude/`
|
|
27
|
-
2. Bash tool → `bash /tmp/fix-{topic}-$$.sh`
|
|
28
|
-
|
|
29
|
-
Read tool on `.claude/` paths is exempt (sensitive-path bypass for read-only). For `templates/.claude/` paths, the same pattern applies (also sensitive).
|
|
30
|
-
|
|
31
|
-
Reference: R010 (.claude/rules/MUST-orchestrator-coordination.md), #1046, #1052, #1062.
|
|
23
|
+
Direct Write/Edit/Bash on `.claude/**` and `templates/.claude/**` is permitted under `mode: "bypassPermissions"` as of CC v2.1.121 (#1101). The legacy `/tmp/*.sh` bypass is deprecated. For CC < v2.1.121, see git history for the legacy pattern.
|
|
32
24
|
|
|
33
25
|
You are an agent creation specialist following R006 (MUST-agent-design.md) rules.
|
|
34
26
|
|
|
@@ -22,17 +22,9 @@ tools:
|
|
|
22
22
|
permissionMode: bypassPermissions
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## .claude/ 경로 처리 (CC v2.1.121+)
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Pattern:
|
|
30
|
-
1. Write tool → `/tmp/fix-{topic}-$$.sh` containing heredoc/sed/cp targeting `.claude/`
|
|
31
|
-
2. Bash tool → `bash /tmp/fix-{topic}-$$.sh`
|
|
32
|
-
|
|
33
|
-
Read tool on `.claude/` paths is exempt (sensitive-path bypass for read-only). For `templates/.claude/` paths, the same pattern applies (also sensitive).
|
|
34
|
-
|
|
35
|
-
Reference: R010 (.claude/rules/MUST-orchestrator-coordination.md), #1046, #1052, #1062.
|
|
27
|
+
Direct Write/Edit/Bash on `.claude/**` and `templates/.claude/**` is permitted under `mode: "bypassPermissions"` as of CC v2.1.121 (#1101). The legacy `/tmp/*.sh` bypass is deprecated. For CC < v2.1.121, see git history for the legacy pattern.
|
|
36
28
|
|
|
37
29
|
You are an external source synchronization specialist keeping external components up-to-date.
|
|
38
30
|
|
|
@@ -208,6 +208,16 @@
|
|
|
208
208
|
],
|
|
209
209
|
"description": "Advisory pre-processing of user input \u2014 skill matching hints and intent analysis"
|
|
210
210
|
},
|
|
211
|
+
{
|
|
212
|
+
"matcher": "*",
|
|
213
|
+
"hooks": [
|
|
214
|
+
{
|
|
215
|
+
"type": "command",
|
|
216
|
+
"command": "bash .claude/hooks/scripts/r007-r008-drift-advisor.sh"
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
"description": "Proactive R007/R008 drift advisory \u2014 checks last assistant turn for identification omission (#1229)"
|
|
220
|
+
},
|
|
211
221
|
{
|
|
212
222
|
"matcher": "*",
|
|
213
223
|
"hooks": [
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
set -euo pipefail
|
|
6
6
|
|
|
7
7
|
# Pass through stdin (Stop hook protocol)
|
|
8
|
-
cat
|
|
8
|
+
input=$(cat)
|
|
9
9
|
|
|
10
10
|
# Dependencies check
|
|
11
|
-
command -v jq >/dev/null 2>&1 || exit 0
|
|
12
|
-
command -v sqlite3 >/dev/null 2>&1 || exit 0
|
|
11
|
+
command -v jq >/dev/null 2>&1 || { echo "$input"; exit 0; }
|
|
12
|
+
command -v sqlite3 >/dev/null 2>&1 || { echo "$input"; exit 0; }
|
|
13
13
|
|
|
14
14
|
# PID scoping
|
|
15
15
|
OUTCOMES_FILE="/tmp/.claude-task-outcomes-${PPID}"
|
|
16
|
-
[ -f "$OUTCOMES_FILE" ] || exit 0
|
|
16
|
+
[ -f "$OUTCOMES_FILE" ] || { echo "$input"; exit 0; }
|
|
17
17
|
|
|
18
18
|
# DB path
|
|
19
19
|
DB_PATH="${HOME}/.config/oh-my-customcode/eval-core.sqlite"
|
|
20
|
-
[ -f "$DB_PATH" ] || exit 0
|
|
20
|
+
[ -f "$DB_PATH" ] || { echo "$input"; exit 0; }
|
|
21
21
|
|
|
22
22
|
# Log file for error diagnostics
|
|
23
23
|
LOG_FILE="/tmp/.claude-feedback-collector-${PPID}.log"
|
|
@@ -65,7 +65,7 @@ for agent_type in "${!FAILURE_COUNTS[@]}"; do
|
|
|
65
65
|
action_type="augment"
|
|
66
66
|
fi
|
|
67
67
|
|
|
68
|
-
failure_rate=$(awk "BEGIN {printf \"%.2f\", $count/$total}")
|
|
68
|
+
failure_rate=$(awk "BEGIN {printf \"%.2f\", $count/$total}" 2>/dev/null || echo "0.00")
|
|
69
69
|
description="Agent '${agent_type}' failed ${count}/${total} times (${failure_rate} failure rate) in session"
|
|
70
70
|
|
|
71
71
|
escaped_agent_type=$(_sql_escape "$agent_type")
|
|
@@ -86,4 +86,7 @@ if [ "$INSERTED" -gt 0 ]; then
|
|
|
86
86
|
echo "[feedback-collector] Extracted ${INSERTED} failure pattern(s) from session outcomes" >&2
|
|
87
87
|
fi
|
|
88
88
|
|
|
89
|
+
# CRITICAL: Always pass through input and exit 0
|
|
90
|
+
# This hook MUST NEVER block session termination
|
|
91
|
+
echo "$input"
|
|
89
92
|
exit 0
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# r007-r008-drift-advisor.sh — UserPromptSubmit hook: PROACTIVE R007/R008 drift advisory (#1229)
|
|
3
|
+
#
|
|
4
|
+
# Inspects the LAST completed assistant turn in the session transcript for R007/R008
|
|
5
|
+
# compliance BEFORE Claude responds. If the previous turn drifted (missing identification
|
|
6
|
+
# header / tool prefix), emits a stderr advisory so the upcoming response self-corrects.
|
|
7
|
+
#
|
|
8
|
+
# This is the PROACTIVE complement to the retroactive session-reflection.sh (Stop hook, #1190).
|
|
9
|
+
# Detection patterns are reused from session-reflection.sh.
|
|
10
|
+
#
|
|
11
|
+
# Advisory-only: ALWAYS exits 0, ALWAYS passes stdin through to stdout, NEVER blocks.
|
|
12
|
+
# Performance: parses ONLY the last assistant turn (not the whole transcript).
|
|
13
|
+
#
|
|
14
|
+
# 환경변수 override (테스트/디버깅용):
|
|
15
|
+
# OMCUSTOM_R007_ADVISOR=off — advisory 완전 비활성화 (pass-through)
|
|
16
|
+
# OMCUSTOM_TRANSCRIPT_BASE — transcript 디렉토리 경로 override
|
|
17
|
+
|
|
18
|
+
set -euo pipefail
|
|
19
|
+
|
|
20
|
+
# ── UserPromptSubmit 프로토콜: stdin을 먼저 읽음 ──
|
|
21
|
+
input=$(cat)
|
|
22
|
+
|
|
23
|
+
# ── Opt-out 체크 ──
|
|
24
|
+
if [ "${OMCUSTOM_R007_ADVISOR:-}" = "off" ]; then
|
|
25
|
+
echo "$input"
|
|
26
|
+
exit 0
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# ── jq 의존성 체크 ──
|
|
30
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
31
|
+
echo "$input"
|
|
32
|
+
exit 0
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# ── session_id 추출 ──
|
|
36
|
+
session_id=$(echo "$input" | jq -r '.session_id // empty' 2>/dev/null)
|
|
37
|
+
if [ -z "$session_id" ]; then
|
|
38
|
+
echo "$input"
|
|
39
|
+
exit 0
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
# ── 경로 결정 (환경변수 override 지원) ──
|
|
43
|
+
TRANSCRIPT_BASE="${OMCUSTOM_TRANSCRIPT_BASE:-${HOME}/.claude/projects/-Users-sangyi-workspace-projects-oh-my-customcode}"
|
|
44
|
+
TRANSCRIPT_PATH="${TRANSCRIPT_BASE}/${session_id}.jsonl"
|
|
45
|
+
|
|
46
|
+
if [ ! -f "$TRANSCRIPT_PATH" ]; then
|
|
47
|
+
echo "$input"
|
|
48
|
+
exit 0
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# ── 마지막 assistant 메시지 추출 (성능: 전체 transcript 스캔 회피) ──
|
|
52
|
+
# 파일을 역순으로 읽으며 첫 번째 role=="assistant" 라인을 찾는다.
|
|
53
|
+
last_assistant=""
|
|
54
|
+
while IFS= read -r line; do
|
|
55
|
+
role=$(echo "$line" | jq -r '.role // empty' 2>/dev/null) || continue
|
|
56
|
+
if [ "$role" = "assistant" ]; then
|
|
57
|
+
last_assistant="$line"
|
|
58
|
+
break
|
|
59
|
+
fi
|
|
60
|
+
done < <(tail -r "$TRANSCRIPT_PATH" 2>/dev/null || tac "$TRANSCRIPT_PATH" 2>/dev/null)
|
|
61
|
+
|
|
62
|
+
if [ -z "$last_assistant" ]; then
|
|
63
|
+
echo "$input"
|
|
64
|
+
exit 0
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
# ── content 배열 파싱 ──
|
|
68
|
+
content_raw=$(echo "$last_assistant" | jq -c '.content // []' 2>/dev/null) || content_raw="[]"
|
|
69
|
+
|
|
70
|
+
r007_violations=0
|
|
71
|
+
r008_violations=0
|
|
72
|
+
|
|
73
|
+
# ── R007: 첫 번째 text 블록의 첫 줄 체크 ──
|
|
74
|
+
first_text=$(echo "$content_raw" | jq -r '[.[] | select(.type == "text")][0].text // empty' 2>/dev/null) || first_text=""
|
|
75
|
+
if [ -n "$first_text" ]; then
|
|
76
|
+
first_line=$(printf '%s' "$first_text" | head -1)
|
|
77
|
+
# R007 패턴: '┌─ Agent:' 또는 '[anything]' 단축 형태
|
|
78
|
+
if ! printf '%s' "$first_line" | grep -qE '(^┌─ Agent:|^\[.+\])'; then
|
|
79
|
+
r007_violations=$((r007_violations + 1))
|
|
80
|
+
fi
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
# ── R008: tool_use 블록 직전 text에 prefix 체크 ──
|
|
84
|
+
content_length=$(echo "$content_raw" | jq 'length' 2>/dev/null) || content_length=0
|
|
85
|
+
i=0
|
|
86
|
+
while [ "$i" -lt "$content_length" ]; do
|
|
87
|
+
block_type=$(echo "$content_raw" | jq -r ".[$i].type // empty" 2>/dev/null) || { i=$((i+1)); continue; }
|
|
88
|
+
|
|
89
|
+
if [ "$block_type" = "tool_use" ]; then
|
|
90
|
+
has_prefix=false
|
|
91
|
+
if [ "$i" -gt 0 ]; then
|
|
92
|
+
prev_type=$(echo "$content_raw" | jq -r ".[$(( i - 1 ))].type // empty" 2>/dev/null) || true
|
|
93
|
+
if [ "$prev_type" = "text" ]; then
|
|
94
|
+
prev_text=$(echo "$content_raw" | jq -r ".[$(( i - 1 ))].text // empty" 2>/dev/null) || true
|
|
95
|
+
# R008 패턴: '[agent-name][model] → Tool:' 또는 '→ Target:'
|
|
96
|
+
if printf '%s' "$prev_text" | grep -qE '\[.+\]\[.+\] ?(→|->|—>) ?(Tool|Target):'; then
|
|
97
|
+
has_prefix=true
|
|
98
|
+
fi
|
|
99
|
+
fi
|
|
100
|
+
fi
|
|
101
|
+
if [ "$has_prefix" = "false" ]; then
|
|
102
|
+
r008_violations=$((r008_violations + 1))
|
|
103
|
+
fi
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
i=$((i+1))
|
|
107
|
+
done
|
|
108
|
+
|
|
109
|
+
# ── advisory 출력 (위반 시에만) ──
|
|
110
|
+
if [ "$r007_violations" -gt 0 ] || [ "$r008_violations" -gt 0 ]; then
|
|
111
|
+
printf '[R007/R008 Advisory] 직전 응답에서 식별 누락 감지 (R007 헤더=%d, R008 접두사=%d). 이번 응답은 ┌─ Agent: 헤더로 시작하고, 모든 도구 호출에 [agent][model] → Tool: 접두사를 포함하십시오.\n' \
|
|
112
|
+
"$r007_violations" "$r008_violations" >&2
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
# ── 항상 stdin pass-through 후 exit 0 (advisory는 절대 차단 금지) ──
|
|
116
|
+
echo "$input"
|
|
117
|
+
exit 0
|
|
@@ -32,6 +32,16 @@ if [ -z "$session_id" ]; then
|
|
|
32
32
|
exit 0
|
|
33
33
|
fi
|
|
34
34
|
|
|
35
|
+
# ── Phase 2 (#1196): background_tasks / session_crons 추출 (CC v2.1.145+) ──
|
|
36
|
+
# 신규 필드 미존재 시 빈 배열로 처리 (graceful degrade).
|
|
37
|
+
bg_tasks_json=$(echo "$input" | jq -c '.background_tasks // []' 2>/dev/null || echo '[]')
|
|
38
|
+
session_crons_json=$(echo "$input" | jq -c '.session_crons // []' 2>/dev/null || echo '[]')
|
|
39
|
+
bg_tasks_count=$(echo "$bg_tasks_json" | jq 'length' 2>/dev/null || echo 0)
|
|
40
|
+
session_crons_count=$(echo "$session_crons_json" | jq 'length' 2>/dev/null || echo 0)
|
|
41
|
+
|
|
42
|
+
# 미완료 백그라운드 태스크: running/pending/in_progress 상태 카운트
|
|
43
|
+
bg_dangling_count=$(echo "$bg_tasks_json" | jq '[.[] | select(.status == "running" or .status == "pending" or .status == "in_progress")] | length' 2>/dev/null || echo 0)
|
|
44
|
+
|
|
35
45
|
# ── 경로 결정 (환경변수 override 지원) ──
|
|
36
46
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
37
47
|
|
|
@@ -62,6 +72,9 @@ TRANSCRIPT_PATH="$1"
|
|
|
62
72
|
PROJECT_ROOT="$2"
|
|
63
73
|
SESSION_ID="$3"
|
|
64
74
|
SCRIPT_DIR="$4"
|
|
75
|
+
BG_TASKS_JSON="${5:-[]}"
|
|
76
|
+
SESSION_CRONS_JSON="${6:-[]}"
|
|
77
|
+
BG_DANGLING_COUNT="${7:-0}"
|
|
65
78
|
|
|
66
79
|
# 출력 디렉토리 준비
|
|
67
80
|
OUTPUT_DIR="${PROJECT_ROOT}/.claude/outputs/reflections"
|
|
@@ -142,6 +155,30 @@ while IFS= read -r line; do
|
|
|
142
155
|
|
|
143
156
|
done < "$TRANSCRIPT_PATH"
|
|
144
157
|
|
|
158
|
+
# ── Phase 2 (#1196): background_tasks / session_crons 분석 ──
|
|
159
|
+
bg_total=$(echo "$BG_TASKS_JSON" | jq 'length' 2>/dev/null || echo 0)
|
|
160
|
+
cron_total=$(echo "$SESSION_CRONS_JSON" | jq 'length' 2>/dev/null || echo 0)
|
|
161
|
+
bg_dangling_lines=""
|
|
162
|
+
cron_lines=""
|
|
163
|
+
|
|
164
|
+
if [ "$bg_total" -gt 0 ]; then
|
|
165
|
+
# dangling 태스크 목록 (최대 5개): id + status + description (60자 truncate)
|
|
166
|
+
bg_dangling_lines=$(echo "$BG_TASKS_JSON" | jq -r '
|
|
167
|
+
[.[] | select(.status == "running" or .status == "pending" or .status == "in_progress")]
|
|
168
|
+
| .[0:5]
|
|
169
|
+
| map(" - id=\(.id // "?") status=\(.status // "?") desc=\((.description // "") | .[0:60])")
|
|
170
|
+
| join("\n")
|
|
171
|
+
' 2>/dev/null || echo "")
|
|
172
|
+
fi
|
|
173
|
+
|
|
174
|
+
if [ "$cron_total" -gt 0 ]; then
|
|
175
|
+
cron_lines=$(echo "$SESSION_CRONS_JSON" | jq -r '
|
|
176
|
+
.[0:5]
|
|
177
|
+
| map(" - id=\(.id // "?") schedule=\(.schedule // "?") prompt=\((.prompt // "") | .[0:60])")
|
|
178
|
+
| join("\n")
|
|
179
|
+
' 2>/dev/null || echo "")
|
|
180
|
+
fi
|
|
181
|
+
|
|
145
182
|
# ── 로그 작성 ──
|
|
146
183
|
{
|
|
147
184
|
echo ""
|
|
@@ -150,14 +187,26 @@ done < "$TRANSCRIPT_PATH"
|
|
|
150
187
|
echo "- **R007 violations**: ${r007_violations}"
|
|
151
188
|
echo "- **R008 violations**: ${r008_violations}"
|
|
152
189
|
echo "- Total assistant turns analyzed: ${total_turns}"
|
|
190
|
+
echo "- **Background tasks (#1196)**: total=${bg_total}, dangling=${BG_DANGLING_COUNT}"
|
|
191
|
+
echo "- **Session crons (#1196)**: total=${cron_total}"
|
|
153
192
|
if [ $sample_count -gt 0 ]; then
|
|
154
193
|
echo ""
|
|
155
194
|
echo "### Sample violations (최대 3개)"
|
|
156
195
|
printf '%s\n' "${sample_lines}"
|
|
157
196
|
fi
|
|
197
|
+
if [ -n "$bg_dangling_lines" ]; then
|
|
198
|
+
echo ""
|
|
199
|
+
echo "### Dangling background tasks (최대 5개)"
|
|
200
|
+
printf '%s\n' "${bg_dangling_lines}"
|
|
201
|
+
fi
|
|
202
|
+
if [ -n "$cron_lines" ]; then
|
|
203
|
+
echo ""
|
|
204
|
+
echo "### Session crons (최대 5개)"
|
|
205
|
+
printf '%s\n' "${cron_lines}"
|
|
206
|
+
fi
|
|
158
207
|
} >> "${LOG_FILE}"
|
|
159
208
|
|
|
160
|
-
echo "[session-reflection] Analysis complete: R007=${r007_violations} R008=${r008_violations} turns=${total_turns}" >&2
|
|
209
|
+
echo "[session-reflection] Analysis complete: R007=${r007_violations} R008=${r008_violations} turns=${total_turns} bg_dangling=${BG_DANGLING_COUNT} crons=${cron_total}" >&2
|
|
161
210
|
WORKER_EOF
|
|
162
211
|
|
|
163
212
|
chmod +x "$WORKER_SCRIPT"
|
|
@@ -172,6 +221,9 @@ WORKER_ERR_LOG="/tmp/.claude-reflection-err-${PPID}.log"
|
|
|
172
221
|
"$PROJECT_ROOT" \
|
|
173
222
|
"$session_id" \
|
|
174
223
|
"$SCRIPT_DIR" \
|
|
224
|
+
"$bg_tasks_json" \
|
|
225
|
+
"$session_crons_json" \
|
|
226
|
+
"$bg_dangling_count" \
|
|
175
227
|
2>>"$WORKER_ERR_LOG"
|
|
176
228
|
rm -f "$WORKER_SCRIPT"
|
|
177
229
|
) &
|
|
@@ -4,11 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
set -euo pipefail
|
|
6
6
|
|
|
7
|
+
# Pass through stdin (Stop hook protocol)
|
|
8
|
+
input=$(cat)
|
|
9
|
+
|
|
7
10
|
OUTCOMES_FILE="/tmp/.claude-task-outcomes-${PPID}"
|
|
8
11
|
PROPOSALS_FILE="/tmp/.claude-skill-proposals-${PPID}"
|
|
9
12
|
|
|
10
13
|
# Early exit if no outcomes
|
|
11
14
|
if [ ! -f "$OUTCOMES_FILE" ] || [ ! -s "$OUTCOMES_FILE" ]; then
|
|
15
|
+
echo "$input"
|
|
12
16
|
exit 0
|
|
13
17
|
fi
|
|
14
18
|
|
|
@@ -36,7 +40,10 @@ if [ "$CANDIDATES" -gt 0 ] 2>/dev/null; then
|
|
|
36
40
|
echo "[skill-extractor] Run /skill-extractor to review and create" >&2
|
|
37
41
|
|
|
38
42
|
# Save proposal count for Stop prompt hook to pick up
|
|
39
|
-
echo "{\"candidates\": $CANDIDATES, \"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}" > "$PROPOSALS_FILE"
|
|
43
|
+
echo "{\"candidates\": $CANDIDATES, \"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}" > "$PROPOSALS_FILE" || true
|
|
40
44
|
fi
|
|
41
45
|
|
|
46
|
+
# CRITICAL: Always pass through input and exit 0
|
|
47
|
+
# This hook MUST NEVER block session termination
|
|
48
|
+
echo "$input"
|
|
42
49
|
exit 0
|
|
@@ -10,6 +10,21 @@
|
|
|
10
10
|
| Caching | Same data accessed repeatedly | Cache file contents, reuse search results |
|
|
11
11
|
| Lazy Loading | Large datasets, partial use | Read only needed files, stream results |
|
|
12
12
|
|
|
13
|
+
### Capability-Aware Tool Scheduling
|
|
14
|
+
|
|
15
|
+
When dispatching parallel tool calls, consider per-tool capabilities to optimize scheduling:
|
|
16
|
+
|
|
17
|
+
| Capability | Parallelizable? | Example |
|
|
18
|
+
|-----------|----------------|---------|
|
|
19
|
+
| Read-only, no side effects | Yes | Read, Glob, Grep |
|
|
20
|
+
| Write with independent targets | Yes | Write(file-A) + Write(file-B) |
|
|
21
|
+
| Write with shared target | No | Sequential edits to same file |
|
|
22
|
+
| External with rate limits | Throttle | WebFetch, API calls |
|
|
23
|
+
|
|
24
|
+
This aligns with R009 (parallel execution) detection criteria and extends it with tool-level scheduling awareness.
|
|
25
|
+
|
|
26
|
+
Inspired by [ouroboros PR #353](https://github.com/Q00/ouroboros/pull/353) capability graph pattern.
|
|
27
|
+
|
|
13
28
|
## Token Optimization
|
|
14
29
|
|
|
15
30
|
- Include only necessary info, remove duplicates, use summaries
|
|
@@ -79,6 +79,7 @@ disableSkillShellExecution: true # Disable inline shell execution in skills (v2
|
|
|
79
79
|
`isolation`, `background`, `maxTurns`, `maxTokens`, `mcpServers`, `hooks`, `permissionMode`, `disallowedTools`, `limitations` are supported in Claude Code v2.1.63+. Hook types `PostCompact`, `Elicitation`, `ElicitationResult` require v2.1.76+. `CwdChanged`, `FileChanged` hook events and `managed-settings.d/` drop-in directory require v2.1.83+. Conditional `if` field for hooks requires v2.1.85+. `PermissionDenied` hook event requires v2.1.88+. `refreshInterval` setting for status line auto-refresh interval added in v2.1.97+. Monitor tool and subprocess sandboxing (`CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`, `CLAUDE_CODE_SCRIPT_CAPS`) added in v2.1.98+. Settings resilience (unrecognized hook event names no longer cause settings.json to be ignored) improved in v2.1.101+. PreCompact hook block support (exit 2 / `{"decision":"block"}`) added in v2.1.105+. Skill description listing cap raised from 250 to 1,536 characters in v2.1.105+. Plugin `monitors` manifest key for background monitors added in v2.1.105+. `ENABLE_PROMPT_CACHING_1H` and `FORCE_PROMPT_CACHING_5M` env vars for prompt cache TTL control added in v2.1.108+. Skill tool can now discover and invoke built-in slash commands (`/init`, `/review`, `/security-review`) in v2.1.108+. `/recap` session context feature and `/undo` alias for `/rewind` added in v2.1.108+. `/tui` command and `tui` setting for fullscreen rendering added in v2.1.110+. PushNotification tool for mobile push notifications (Remote Control + config required) added in v2.1.110+. `autoScrollEnabled` config for fullscreen mode added in v2.1.110+. SDK/headless `TRACEPARENT`/`TRACESTATE` distributed trace linking added in v2.1.110+. Bash tool maximum timeout enforcement added in v2.1.110+. Write tool IDE diff feedback (informs model when user edits proposed content) added in v2.1.110+. `--resume`/`--continue` now resurrects unexpired scheduled tasks in v2.1.110+. `/focus` command (separated from Ctrl+O) added in v2.1.110+. `xhigh` effort level for Opus 4.7 (between `high` and `max`; other models fall back to `high`) added in v2.1.111+. `/effort` interactive slider with arrow-key navigation (when called without arguments) added in v2.1.111+. Auto mode no longer requires `--enable-auto-mode` in v2.1.111+. PowerShell tool progressive rollout (`CLAUDE_CODE_USE_POWERSHELL_TOOL` env var) added in v2.1.111+. Read-only bash commands with glob patterns (`ls *.ts`) and `cd <project-dir> &&` prefix no longer trigger permission prompt in v2.1.111+. `/less-permission-prompts` built-in skill for permission allowlist scanning added in v2.1.111+. `/ultrareview` parallel multi-agent cloud code review added in v2.1.111+. `/skills` menu sorting by estimated token count (press `t`) added in v2.1.111+. `OTEL_LOG_RAW_API_BODIES` env var for full API request/response body logging added in v2.1.111+. Plan files named after prompt content (not random words) in v2.1.111+. Plugin error handling improvements (dependency conflict errors, stale version recovery, install recovery) in v2.1.111+.
|
|
80
80
|
`sandbox.network.deniedDomains` setting for domain blocking within `allowedDomains` wildcards added in v2.1.113+. Subagent mid-stream stall detection with auto-fail after 10 minutes added in v2.1.113+. Bash `find -exec`/`-delete` no longer auto-approved under `Bash(find:*)` allow rules in v2.1.113+. Bash deny rules now match exec wrappers (`env`/`sudo`/`watch`/`ionice`/`setsid`) in v2.1.113+. Native binary spawning (per-platform optional dependency) replaces bundled JavaScript in v2.1.113+. `/loop` Esc now cancels pending wakeups in v2.1.113+.
|
|
81
81
|
Agent frontmatter `hooks:` fire when agent runs as main-thread agent via `--agent` flag (previously subagent-only) in v2.1.116+. `/reload-plugins` auto-installs missing plugin dependencies from added marketplaces in v2.1.116+.
|
|
82
|
+
Hook JSON output `terminalSequence` field for desktop notifications, window title changes, and terminal bells without controlling terminal added in v2.1.141+. `claude agents --cwd <path>` flag to scope session list to a directory added in v2.1.141+. Background agents launched via `/bg` now preserve current permission mode (no longer revert to default) in v2.1.141+. `CLAUDE_CODE_PLUGIN_PREFER_HTTPS` env var to clone GitHub plugin sources over HTTPS instead of SSH added in v2.1.141+. `ANTHROPIC_WORKSPACE_ID` env var for workload identity federation workspace scoping added in v2.1.141+.
|
|
82
83
|
-->
|
|
83
84
|
|
|
84
85
|
## Hook Event Types
|
|
@@ -253,32 +254,19 @@ Current CC behavior: under `bypassPermissions`, all `.claude/**` paths (includin
|
|
|
253
254
|
2. Use Write/Edit directly for `.claude/**` paths — no `/tmp/*.sh` wrapping needed
|
|
254
255
|
3. For CC < v2.1.121: see git history of this section (pre-v0.126.0) for the legacy bypass pattern
|
|
255
256
|
|
|
256
|
-
<!-- DETAIL:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
| Path | Tool | Allow rule | Result |
|
|
257
|
+
<!-- DETAIL: Pre-v2.1.121 sensitive path behavior (historical)
|
|
258
|
+
| Path | Tool | Allow rule | Result (CC < v2.1.121) |
|
|
260
259
|
|------|------|-----------|--------|
|
|
261
|
-
| `.claude/**` | Bash (`cp`, `mkdir`, `rm`) | `Bash(*)` allowed | Prompt (sensitive-path
|
|
262
|
-
| `.claude/**` | Write, Edit | `Write(.claude/**)` allowed | Prompt (sensitive-path
|
|
263
|
-
| `templates/.claude/**` | Write, Edit | `Write(templates/.claude/**)` allowed | Prompt (
|
|
264
|
-
| `.claude/outputs/**` | Write, Edit | `Write(.claude/outputs/**)` | Prompt (
|
|
265
|
-
| `.claude/outputs/**` | Bash via `/tmp/*.sh` | — | Allowed (bypass
|
|
266
|
-
|
|
267
|
-
#### Recommended practice
|
|
268
|
-
|
|
269
|
-
1. **Prefer `Write`/`Edit` over `Bash(cp)`/`Bash(mkdir)`** — `Write`/`Edit` provide better auditability and avoid shell injection risk
|
|
270
|
-
2. **Add allow rules defensively** — `Write(.claude/**)`, `Edit(.claude/**)`, `Write(templates/.claude/**)`, `Edit(templates/.claude/**)` in `.claude/settings.local.json`. Rules may not bypass sensitive-path check but document intent and aid future CC behavior changes
|
|
271
|
-
3. **For `.claude/outputs/**` specifically**: Use `Bash via /tmp/*.sh` bypass — Write/Edit on this path triggers sensitive-path prompt despite being the artifact convention path (confirmed v0.111.1+, #1043, #1046)
|
|
260
|
+
| `.claude/**` | Bash (`cp`, `mkdir`, `rm`) | `Bash(*)` allowed | Prompt (sensitive-path overrode) |
|
|
261
|
+
| `.claude/**` | Write, Edit | `Write(.claude/**)` allowed | Prompt (sensitive-path overrode) |
|
|
262
|
+
| `templates/.claude/**` | Write, Edit | `Write(templates/.claude/**)` allowed | Prompt (#960, #961, #981) |
|
|
263
|
+
| `.claude/outputs/**` | Write, Edit | `Write(.claude/outputs/**)` | Prompt (#1043) |
|
|
264
|
+
| `.claude/outputs/**` | Bash via `/tmp/*.sh` | — | Allowed (legacy bypass) |
|
|
272
265
|
-->
|
|
273
266
|
|
|
274
|
-
<!--
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
#### Cross-references
|
|
279
|
-
|
|
280
|
-
- `feedback_sensitive_path.md` — session memory with Bash + Write scope (#960, #961, #981)
|
|
281
|
-
- `feedback_templates_claude_glob.md` — `.claude/**` glob does not cover `templates/.claude/**`, separate allow rules required
|
|
267
|
+
<!-- DETAIL: Cross-references
|
|
268
|
+
- `feedback_sensitive_path*.md` — historical (pre-v2.1.121) memories, marked with status: historical (#1101)
|
|
269
|
+
- `feedback_templates_claude_glob.md` — `.claude/**` glob does not cover `templates/.claude/**`, separate allow rules required (still applies for non-bypassPermissions modes)
|
|
282
270
|
-->
|
|
283
271
|
|
|
284
272
|
### Artifact Channel Protocol
|
|
@@ -75,3 +75,38 @@ Correct: With sub-skill
|
|
|
75
75
|
| General conversation | "claude (default)" |
|
|
76
76
|
| Long tasks | Show progress with agent context |
|
|
77
77
|
| Skill invocation | Integrated `claude → {skill-name}` format |
|
|
78
|
+
|
|
79
|
+
## Multi-Turn Self-Check (MANDATORY)
|
|
80
|
+
|
|
81
|
+
매 응답 시작 전, 이전 응답이 자동 체크리스트를 통과했는지 의존하지 말고 다시 자가 점검:
|
|
82
|
+
|
|
83
|
+
1. 이번 응답이 `┌─ Agent: ...` 또는 `[agent-name]` 단축 헤더로 시작하는가?
|
|
84
|
+
2. 이번 응답에서 호출하는 모든 도구에 `[agent-name][model] → Tool: ...` prefix 가 있는가?
|
|
85
|
+
|
|
86
|
+
체크 실패 시 즉시 헤더/prefix 추가 후 도구 호출. PostCompact hook 만으로 보장되지 않으며 압축 없이도 멀티턴 누락이 발생하므로 매 턴 자가 점검 강제.
|
|
87
|
+
|
|
88
|
+
### Common Multi-Turn Violation
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
턴 1: ┌─ Agent: claude (default) ✓
|
|
92
|
+
턴 2: (헤더 없음, 짧은 답변이라 생략) ✗
|
|
93
|
+
턴 3: 도구 호출 prefix 누락 ✗
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
응답 길이/턴 위치 무관. 짧은 답변에도 헤더는 필수.
|
|
97
|
+
|
|
98
|
+
Reference issue: #1096.
|
|
99
|
+
|
|
100
|
+
### Short Response Discipline
|
|
101
|
+
|
|
102
|
+
응답 길이와 무관하게 R007 헤더 필수. 다음과 같은 짧은 응답에서도 누락 금지:
|
|
103
|
+
|
|
104
|
+
| 응답 유형 | 헤더 필수? |
|
|
105
|
+
|-----------|------------|
|
|
106
|
+
| 한 줄 진단 ("확인했습니다") | YES |
|
|
107
|
+
| 회고/사과 응답 | YES |
|
|
108
|
+
| 사용자 질문 재확인 | YES |
|
|
109
|
+
| 도구 호출 없는 텍스트 응답 | YES |
|
|
110
|
+
| 1단어 응답 ("네"/"OK") | YES |
|
|
111
|
+
|
|
112
|
+
Reference issues: #1188 item #2, #1198 item #2.
|
|
@@ -14,6 +14,7 @@ oh-my-customcode uses an **advisory-first enforcement model**. Most rules are en
|
|
|
14
14
|
| Soft Block | Stop hook prompt | R011 session-end saves | Auto-performs then approves |
|
|
15
15
|
| Conversation Block | PostToolUse hook + `continueOnBlock` (CC v2.1.139+), exit 2 | stuck-detector, context-budget-advisor, cost-cap-advisor | Feeds rejection reason into conversation; Claude continues with awareness |
|
|
16
16
|
| Advisory | PostToolUse hooks | R007, R008, R009, R010, R018 | Warns via stderr, never blocks |
|
|
17
|
+
| Advisory (proactive) | UserPromptSubmit hook | R007, R008 (`r007-r008-drift-advisor.sh`, #1229) | Reads last assistant turn; emits stderr advisory before next response if header/prefix absent. Complements retroactive Stop-hook (`session-reflection.sh`, #1190). |
|
|
17
18
|
| Prompt-based | CLAUDE.md + rules/ + PostCompact | All MUST rules | Behavioral guidance in context |
|
|
18
19
|
|
|
19
20
|
## Why Advisory-First
|
|
@@ -23,15 +24,15 @@ oh-my-customcode uses an **advisory-first enforcement model**. Most rules are en
|
|
|
23
24
|
3. **Composability**: External skills and internal rules can coexist without deadlocks
|
|
24
25
|
4. **PostCompact reinforcement**: R007/R008/R009/R010/R018 are re-injected after context compaction
|
|
25
26
|
|
|
26
|
-
## Hard Enforcement Candidates — R010 git-delegation-guard (conditional), R007/R008 UserPromptSubmit
|
|
27
|
+
## Hard Enforcement Candidates — R010 git-delegation-guard (conditional), R007/R008 UserPromptSubmit advisory **implemented** (#1229, proactive) + retroactive Stop-hook (#1190); hard-block variant still candidate if advisory insufficient (#1096). Promoted: rule-deletion-guard.sh (2026-04-08). See details via Read tool.
|
|
27
28
|
|
|
28
29
|
<!-- DETAIL: Hard Enforcement Candidates (Future)
|
|
29
30
|
If advisory enforcement proves insufficient for specific rules, these are candidates for promotion to hard-block:
|
|
30
31
|
|
|
31
|
-
| Rule | Candidate Hook | Condition for Promotion |
|
|
32
|
-
|
|
33
|
-
| R010 | git-delegation-guard.sh | If orchestrator-direct-write violations exceed 3/session |
|
|
34
|
-
| R007/R008 | (
|
|
32
|
+
| Rule | Candidate Hook | Status | Condition for Promotion |
|
|
33
|
+
|------|---------------|--------|------------------------|
|
|
34
|
+
| R010 | git-delegation-guard.sh | Candidate | If orchestrator-direct-write violations exceed 3/session |
|
|
35
|
+
| R007/R008 | `r007-r008-drift-advisor.sh` (UserPromptSubmit, #1229) | **Advisory implemented** — proactive pre-response check; retroactive: `session-reflection.sh` (Stop, #1190). Two-layer drift detection: proactive (#1229) + retroactive (#1190). | Promote to hard-block if advisory proves insufficient (#1096) |
|
|
35
36
|
|
|
36
37
|
Promotion requires: (1) measured violation rate data, (2) user approval, (3) rollback plan.
|
|
37
38
|
|
|
@@ -7,10 +7,26 @@
|
|
|
7
7
|
| Context | Language |
|
|
8
8
|
|---------|----------|
|
|
9
9
|
| User communication | Korean |
|
|
10
|
+
| User communication honorific | 합쇼체 (formal polite, "-습니다/-합니다") |
|
|
10
11
|
| Code, file contents, commits | English |
|
|
11
12
|
| Error messages to user | Korean |
|
|
12
13
|
| PR title/body, GitHub issues | Korean (default, overridable in project CLAUDE.md) |
|
|
13
14
|
|
|
15
|
+
## Honorific Level
|
|
16
|
+
|
|
17
|
+
Korean user-facing output MUST use 합쇼체 (formal polite ending: -습니다/-합니다/-십시오), NOT 반말 (informal) or 해요체 (semi-formal).
|
|
18
|
+
|
|
19
|
+
| Anti-pattern (반말/생략) | Required (합쇼체) |
|
|
20
|
+
|--------------------------|-------------------|
|
|
21
|
+
| "확인" / "확인했음" | "확인했습니다" |
|
|
22
|
+
| "재호출" / "재호출함" | "재호출하겠습니다" |
|
|
23
|
+
| "수정" / "수정함" | "수정하겠습니다" |
|
|
24
|
+
| "안 멈췄음" | "멈추지 않았습니다" |
|
|
25
|
+
| "이상함" | "이상합니다" |
|
|
26
|
+
| "OK" / "좋다" | "확인했습니다" / "좋습니다" |
|
|
27
|
+
|
|
28
|
+
**Why**: Token-saving 모드에서 LLM 이 비격식체로 회귀하는 패턴이 #1202 / #1188 item #1 에서 관찰됨. 격식 수준은 R000 사용자 통신 규약의 핵심 부분.
|
|
29
|
+
|
|
14
30
|
## Delegation Model
|
|
15
31
|
|
|
16
32
|
User delegates ALL file operations to AI agent. User does NOT directly edit files.
|
|
@@ -268,6 +268,48 @@ Before spawning any agent:
|
|
|
268
268
|
```
|
|
269
269
|
|
|
270
270
|
|
|
271
|
+
### Background Agent Permission Mode (`/bg` flow)
|
|
272
|
+
|
|
273
|
+
> **v2.1.141+**: Background agents launched via `/bg` or `←←` now preserve the current session's permission mode instead of reverting to default. Previously, detaching a session could cause `bypassPermissions` to be lost, triggering unexpected permission prompts in unattended flows.
|
|
274
|
+
|
|
275
|
+
| CC Version | `/bg` permission behavior |
|
|
276
|
+
|------------|--------------------------|
|
|
277
|
+
| < v2.1.141 | Reverts to default — `bypassPermissions` may be lost on detach |
|
|
278
|
+
| >= v2.1.141 | Preserves current permission mode — `/bg` flows no longer need extra workaround |
|
|
279
|
+
|
|
280
|
+
`mode: "bypassPermissions"` on every Agent tool call is still required (applies to Agent tool, not `/bg` shell command).
|
|
281
|
+
|
|
282
|
+
## Agent Capability Pre-Check
|
|
283
|
+
|
|
284
|
+
Before delegating a task to a subagent, MUST verify the target agent's tool capabilities against the task requirements. Failure to pre-check causes round-trip waste (delegation → failure → re-delegation).
|
|
285
|
+
|
|
286
|
+
### Required Checks
|
|
287
|
+
|
|
288
|
+
| Task involves | Verify in target agent frontmatter |
|
|
289
|
+
|--------------|-----------------------------------|
|
|
290
|
+
| `gh` / shell commands | `tools:` includes Bash AND `disallowedTools:` excludes Bash |
|
|
291
|
+
| `Read` external files | `tools:` includes Read |
|
|
292
|
+
| `Write` files | `tools:` includes Write (and target path not in `disallowedTools` scope) |
|
|
293
|
+
| MCP server calls | `mcpServers:` includes the required server |
|
|
294
|
+
|
|
295
|
+
### Known Limitations (Active Cache)
|
|
296
|
+
|
|
297
|
+
| Agent | Limitation | Workaround |
|
|
298
|
+
|-------|-----------|-----------|
|
|
299
|
+
| `arch-documenter` | `disallowedTools: [Bash]` — cannot run `gh`, shell scripts | Pre-collect data via orchestrator, pass as content; OR use `general-purpose` for the Bash-needing portion |
|
|
300
|
+
| `qa-engineer` | (verify each invocation) | — |
|
|
301
|
+
|
|
302
|
+
### Common Violation
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
❌ WRONG: Delegate `gh issue view` to arch-documenter without pre-check
|
|
306
|
+
→ Agent fails ("Bash not allowed") → 2-3min round-trip waste
|
|
307
|
+
|
|
308
|
+
✓ CORRECT: Pre-check arch-documenter.disallowedTools → collect data first → pass as content
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Reference issues: #1202 item #2, `feedback_arch_documenter_bash_precheck.md`.
|
|
312
|
+
|
|
271
313
|
## Sensitive Path Handling (Historical: pre-CC v2.1.121)
|
|
272
314
|
|
|
273
315
|
> **Status**: Deprecated as of CC v2.1.121 (2026-04-28) and further relaxed in v2.1.126 (2026-05-01). Direct Write/Edit/Bash on `.claude/`, `.git/`, `.vscode/` works without prompts under `bypassPermissions` mode in CC v2.1.121+ (issue #1101).
|
|
@@ -95,3 +95,40 @@ Parallel spawn description parameter:
|
|
|
95
95
|
Agent(description: "[1] Go code review", subagent_type: "lang-golang-expert", ...)
|
|
96
96
|
Agent(description: "[2] Python code review", subagent_type: "lang-python-expert", ...)
|
|
97
97
|
```
|
|
98
|
+
|
|
99
|
+
## Multi-Turn Self-Check (MANDATORY)
|
|
100
|
+
|
|
101
|
+
매 도구 호출 직전, 이전 호출이 prefix 를 가졌는지에 의존하지 말고 다시 자가 점검:
|
|
102
|
+
|
|
103
|
+
1. 이 호출 위에 `[agent-name][model] → Tool: <tool-name>` 라인이 있는가?
|
|
104
|
+
2. agent-name 과 model 이 현재 컨텍스트와 일치하는가?
|
|
105
|
+
|
|
106
|
+
체크 실패 시 즉시 prefix 추가 후 호출.
|
|
107
|
+
|
|
108
|
+
### Common Multi-Turn Violation
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
호출 1 (턴 1): [claude][sonnet] → Tool: Read ✓
|
|
112
|
+
호출 2 (턴 1, 같은 턴 추가 호출): (prefix 없음) ✗
|
|
113
|
+
호출 3 (턴 2 첫 호출): (prefix 없음) ✗
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
같은 턴 내 추가 호출, 새 턴 첫 호출 모두 prefix 필수.
|
|
117
|
+
|
|
118
|
+
Reference issue: #1096.
|
|
119
|
+
|
|
120
|
+
### Short Response Discipline
|
|
121
|
+
|
|
122
|
+
도구 호출 prefix 도 응답 길이와 무관하게 필수. 같은 턴 내 여러 도구를 호출할 때 각 호출 직전에 개별 prefix 표시:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
[agent][model] → Tool: Read
|
|
126
|
+
[agent][model] → Target: file1.md
|
|
127
|
+
<Read call>
|
|
128
|
+
|
|
129
|
+
[agent][model] → Tool: Bash
|
|
130
|
+
[agent][model] → Target: gh issue list
|
|
131
|
+
<Bash call>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Reference issues: #1188 item #3, #1198 item #3.
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
Format: `─── [Spawn] {subagent_type}:{model} | {description} ───` — implemented in `.claude/hooks/hooks.json` (PreToolUse → Agent/Task matcher). Display for multi-step/parallel/long-running ops only.
|
|
17
17
|
|
|
18
|
+
> **v2.1.141+**: Hook JSON output can include `terminalSequence` field to emit window title changes or terminal bells without terminal control. Complementary to HUD stderr channel — e.g., update window title on task completion or ring bell after long parallel run. Modifying `.claude/hooks/` requires explicit user approval (R001).
|
|
19
|
+
|
|
18
20
|
<!-- DETAIL: HUD Events full spec
|
|
19
21
|
### When to Display: Multi-step tasks, parallel execution, long-running operations. Skip for single brief operations.
|
|
20
22
|
### Parallel Display:
|
package/templates/manifest.json
CHANGED