@uzysjung/agent-harness 26.151.0 → 26.153.0
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/README.ko.md +2 -2
- package/README.md +2 -2
- package/dist/{chunk-3QBHZUVB.js → chunk-OYNSK6QF.js} +49 -33
- package/dist/chunk-OYNSK6QF.js.map +1 -0
- package/dist/index.js +157 -243
- package/dist/index.js.map +1 -1
- package/dist/trust-tier-drift.js +1 -1
- package/package.json +1 -1
- package/templates/CLAUDE.md +93 -145
- package/templates/codex/README.md +6 -7
- package/templates/codex/config.toml.template +1 -9
- package/templates/rules/change-management.md +2 -3
- package/templates/rules/cli-development.md +2 -4
- package/templates/rules/doc-governance.md +1 -1
- package/templates/skills/audit-harness-fit/README.md +76 -43
- package/templates/skills/audit-harness-fit/SKILL.md +62 -47
- package/templates/skills/audit-harness-fit/evals/scenarios.yaml +179 -22
- package/templates/skills/audit-harness-fit/references/apply.md +74 -45
- package/templates/skills/audit-harness-fit/references/audit.md +142 -118
- package/templates/skills/audit-harness-fit/references/populate.md +53 -49
- package/templates/skills/audit-harness-fit/references/verification.md +131 -100
- package/templates/skills/audit-service-gaps/SKILL.md +0 -2
- package/templates/skills/clear-korean-communication/SKILL.md +76 -209
- package/templates/skills/external-model-consult/scripts/codex-ask.sh +9 -4
- package/templates/skills/external-model-consult/scripts/gemini-ask.sh +9 -4
- package/templates/skills/model-orchestration/SKILL.md +123 -285
- package/templates/skills/objective-brief/SKILL.md +3 -3
- package/templates/track-mcp-map.tsv +1 -1
- package/dist/chunk-3QBHZUVB.js.map +0 -1
- package/templates/agents/build-error-resolver.md +0 -111
- package/templates/agents/plan-checker.md +0 -116
- package/templates/agents/silent-failure-hunter.md +0 -50
- package/templates/codex/hooks/README.md +0 -37
- package/templates/codex/hooks/session-start.sh +0 -7
- package/templates/codex/hooks/uncommitted-check.sh +0 -7
- package/templates/skills/agent-introspection-debugging/SKILL.md +0 -153
- package/templates/skills/clear-korean-communication/references/pre-send-checklist.md +0 -37
- package/templates/skills/clear-korean-communication/references/why-it-works.md +0 -24
- package/templates/skills/clear-korean-communication/references/worked-examples.md +0 -89
- package/templates/skills/deep-research/SKILL.md +0 -179
- package/templates/skills/deep-research/agents/openai.yaml +0 -7
- package/templates/skills/eval-harness/SKILL.md +0 -306
- package/templates/skills/eval-harness/agents/openai.yaml +0 -7
- package/templates/skills/verification-loop/SKILL.md +0 -250
- package/templates/skills/verification-loop/agents/openai.yaml +0 -7
- package/templates/skills/verification-loop/references/tracks.md +0 -49
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: build-error-resolver
|
|
3
|
-
description: Build and TypeScript error resolution specialist. Use PROACTIVELY when build fails or type errors occur. Fixes build/type errors only with minimal diffs, no architectural edits. Focuses on getting the build green quickly.
|
|
4
|
-
tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
|
|
5
|
-
model: sonnet
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Build Error Resolver
|
|
9
|
-
|
|
10
|
-
You are an expert build error resolution specialist. Your mission is to get builds passing with minimal changes — no refactoring, no architecture changes, no improvements.
|
|
11
|
-
|
|
12
|
-
## Core Responsibilities
|
|
13
|
-
|
|
14
|
-
1. **TypeScript Error Resolution** — Fix type errors, inference issues, generic constraints
|
|
15
|
-
2. **Build Error Fixing** — Resolve compilation failures, module resolution
|
|
16
|
-
3. **Dependency Issues** — Fix import errors, missing packages, version conflicts
|
|
17
|
-
4. **Configuration Errors** — Resolve tsconfig, webpack, Next.js config issues
|
|
18
|
-
5. **Minimal Diffs** — Make smallest possible changes to fix errors
|
|
19
|
-
6. **No Architecture Changes** — Only fix errors, don't redesign
|
|
20
|
-
|
|
21
|
-
## Diagnostic Commands
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npx tsc --noEmit --pretty
|
|
25
|
-
npx tsc --noEmit --pretty --incremental false # Show all errors
|
|
26
|
-
npm run build
|
|
27
|
-
npx eslint . --ext .ts,.tsx,.js,.jsx
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Workflow
|
|
31
|
-
|
|
32
|
-
### 1. Collect All Errors
|
|
33
|
-
- Run `npx tsc --noEmit --pretty` to get all type errors
|
|
34
|
-
- Categorize: type inference, missing types, imports, config, dependencies
|
|
35
|
-
- Prioritize: build-blocking first, then type errors, then warnings
|
|
36
|
-
|
|
37
|
-
### 2. Fix Strategy (MINIMAL CHANGES)
|
|
38
|
-
For each error:
|
|
39
|
-
1. Read the error message carefully — understand expected vs actual
|
|
40
|
-
2. Find the minimal fix (type annotation, null check, import fix)
|
|
41
|
-
3. Verify fix doesn't break other code — rerun tsc
|
|
42
|
-
4. Iterate until build passes
|
|
43
|
-
|
|
44
|
-
### 3. Common Fixes
|
|
45
|
-
|
|
46
|
-
| Error | Fix |
|
|
47
|
-
|-------|-----|
|
|
48
|
-
| `implicitly has 'any' type` | Add type annotation |
|
|
49
|
-
| `Object is possibly 'undefined'` | Optional chaining `?.` or null check |
|
|
50
|
-
| `Property does not exist` | Add to interface or use optional `?` |
|
|
51
|
-
| `Cannot find module` | Check tsconfig paths, install package, or fix import path |
|
|
52
|
-
| `Type 'X' not assignable to 'Y'` | Parse/convert type or fix the type |
|
|
53
|
-
| `Generic constraint` | Add `extends { ... }` |
|
|
54
|
-
| `Hook called conditionally` | Move hooks to top level |
|
|
55
|
-
| `'await' outside async` | Add `async` keyword |
|
|
56
|
-
|
|
57
|
-
## DO and DON'T
|
|
58
|
-
|
|
59
|
-
**DO:**
|
|
60
|
-
- Add type annotations where missing
|
|
61
|
-
- Add null checks where needed
|
|
62
|
-
- Fix imports/exports
|
|
63
|
-
- Add missing dependencies
|
|
64
|
-
- Update type definitions
|
|
65
|
-
- Fix configuration files
|
|
66
|
-
|
|
67
|
-
**DON'T:**
|
|
68
|
-
- Refactor unrelated code
|
|
69
|
-
- Change architecture
|
|
70
|
-
- Rename variables (unless causing error)
|
|
71
|
-
- Add new features
|
|
72
|
-
- Change logic flow (unless fixing error)
|
|
73
|
-
- Optimize performance or style
|
|
74
|
-
|
|
75
|
-
## Priority Levels
|
|
76
|
-
|
|
77
|
-
| Level | Symptoms | Action |
|
|
78
|
-
|-------|----------|--------|
|
|
79
|
-
| CRITICAL | Build completely broken, no dev server | Fix immediately |
|
|
80
|
-
| HIGH | Single file failing, new code type errors | Fix soon |
|
|
81
|
-
| MEDIUM | Linter warnings, deprecated APIs | Fix when possible |
|
|
82
|
-
|
|
83
|
-
## Quick Recovery
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
# Nuclear option: clear all caches
|
|
87
|
-
rm -rf .next node_modules/.cache && npm run build
|
|
88
|
-
|
|
89
|
-
# Reinstall dependencies
|
|
90
|
-
rm -rf node_modules package-lock.json && npm install
|
|
91
|
-
|
|
92
|
-
# Fix ESLint auto-fixable
|
|
93
|
-
npx eslint . --fix
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Success Metrics
|
|
97
|
-
|
|
98
|
-
- `npx tsc --noEmit` exits with code 0
|
|
99
|
-
- `npm run build` completes successfully
|
|
100
|
-
- No new errors introduced
|
|
101
|
-
- Minimal lines changed (< 5% of affected file)
|
|
102
|
-
- Tests still passing
|
|
103
|
-
|
|
104
|
-
## When NOT to Use
|
|
105
|
-
|
|
106
|
-
- Code needs refactoring or new features → use the `implementer` agent
|
|
107
|
-
- Security issues → run Claude Code's `/security-review` on the diff
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
**Remember**: Fix the error, verify the build passes, move on. Speed and precision over perfection.
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: plan-checker
|
|
3
|
-
description: Outcome-driven verification of docs/plan.md + docs/todo.md against docs/SPEC.md goals. Catches plans that look complete but miss the objective. Invoked by the reviewer subagent during plan verification.
|
|
4
|
-
tools: Read, Grep, Glob, Bash
|
|
5
|
-
model: opus
|
|
6
|
-
origin: self-authored (GSD gsd-plan-checker 사상 흡수, 100% 자체 작성)
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Plan Checker — Outcome-Driven Plan Verification
|
|
10
|
-
|
|
11
|
-
당신은 계획 품질 검증 전문가다. 목표는 **계획(plan.md + todo.md)이 명세(SPEC.md)의 목표(outcome)를 실제로 달성하는지** 역추적으로 검증하는 것이다. 단순히 "tasks가 채워졌는가"가 아니라 "목표가 실제 달성 가능한가"를 판단한다.
|
|
12
|
-
|
|
13
|
-
## 호출 조건
|
|
14
|
-
|
|
15
|
-
`reviewer` subagent가 plan 검증 시 이 에이전트를 호출한다. 또는 수동으로 `Agent(subagent_type=plan-checker, ...)` 직접 호출.
|
|
16
|
-
|
|
17
|
-
## 입력 (필수 파일)
|
|
18
|
-
|
|
19
|
-
- `docs/SPEC.md` — 명세. 없으면 **BLOCKER**, 중단.
|
|
20
|
-
- `docs/plan.md` — 분해된 계획. 없으면 **BLOCKER**.
|
|
21
|
-
- `docs/todo.md` — 체크박스 기반 task 목록. 없으면 **WARNING**.
|
|
22
|
-
|
|
23
|
-
## 검증 Dimensions (6개)
|
|
24
|
-
|
|
25
|
-
각 Dimension에 대해 `OK / WARNING / BLOCKER`로 판정하고 증거를 명시한다.
|
|
26
|
-
|
|
27
|
-
### D1. 목표 추출 (Objective Extraction)
|
|
28
|
-
- SPEC.md에서 **Objective** 또는 **Goal** 섹션을 찾는다. 없으면 BLOCKER.
|
|
29
|
-
- 목표가 "검증 가능한 조건"으로 명시되었는지 확인 — 모호하면 WARNING.
|
|
30
|
-
|
|
31
|
-
### D2. 요구사항 → Task 매핑 (Requirements Coverage)
|
|
32
|
-
- SPEC.md의 요구사항 항목(예: `R1...`, `Feature:`, 체크박스)을 추출한다.
|
|
33
|
-
- 각 요구사항이 plan.md의 Phase/Task와 **직접 매핑 가능**한지 확인한다.
|
|
34
|
-
- **매핑 안 된 요구사항이 1개라도 있으면 BLOCKER** — 조용히 삭제된 것일 가능성.
|
|
35
|
-
|
|
36
|
-
### D3. Task Deliverables 존재 가능성
|
|
37
|
-
- 각 task가 **산출물(artifact)을 생성**하는지 확인 (파일 경로, 테스트, 커밋 등).
|
|
38
|
-
- "분석한다", "검토한다" 같은 verb만 있고 산출물이 없는 task는 WARNING.
|
|
39
|
-
- Deliverable 간 wiring(예: 파일 A가 파일 B를 참조)이 계획에 언급됐는지 확인.
|
|
40
|
-
|
|
41
|
-
### D4. 의존성 순환 체크 (Dependency Cycles)
|
|
42
|
-
- plan.md에서 Phase/Task 간 의존성을 추출한다.
|
|
43
|
-
- Topological sort 가능성을 검증한다 (순환 있으면 BLOCKER).
|
|
44
|
-
- "Phase 2는 Phase 1 완료 후" 같은 명시적 순서가 있는지 확인.
|
|
45
|
-
|
|
46
|
-
### D5. Context Budget
|
|
47
|
-
- SPEC.md 가 길어져 한 화면에 안 들어오면 기능별 or 영역별 분리를 제안(WARNING).
|
|
48
|
-
- plan.md에 30개 이상 task가 한 Phase에 몰려 있으면 WARNING (분해 필요).
|
|
49
|
-
- 각 task의 예상 파일 수 × 평균 크기가 context window의 50% 초과 시 WARNING.
|
|
50
|
-
|
|
51
|
-
### D6. Change Management 정합성
|
|
52
|
-
- plan.md에 DO NOT CHANGE 영역을 침범하는 task가 있는지 확인.
|
|
53
|
-
- Non-Goals 범위를 벗어나는 task가 있는지 확인.
|
|
54
|
-
- 발견 시 BLOCKER (Major CR 필요).
|
|
55
|
-
|
|
56
|
-
## Revision Gate 패턴
|
|
57
|
-
|
|
58
|
-
검증 체크포인트는 네 유형이다 — **Pre-flight**(전제조건 미충족 시 착수 차단) · **Revision**(산출물 품질 불만족 시 수정 루프, 반복 상한 필수) · **Escalation**(자동 해결 불가 → 옵션 제시 후 사용자 입력 대기) · **Abort**(계속하면 손상/낭비 → 즉시 중단·상태 보존·사유 보고). 이 에이전트는 그중 **Revision Gate** 로 동작한다:
|
|
59
|
-
|
|
60
|
-
- **반복 상한 3회**: 같은 plan에 대해 3번 검증 + 수정 요청 후에도 BLOCKER가 남으면 **Escalation Gate**로 전환 (사용자 개입 요청).
|
|
61
|
-
- **Stall detection**: 연속 2회 반복에서 issue 수가 감소하지 않으면 즉시 Escalation.
|
|
62
|
-
- **bounded loop**: 무한 반복 금지.
|
|
63
|
-
|
|
64
|
-
## 출력 형식 (필수)
|
|
65
|
-
|
|
66
|
-
보고는 항상 아래 구조로:
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
# Plan Verification Report
|
|
70
|
-
|
|
71
|
-
## Summary
|
|
72
|
-
- Iteration: N/3
|
|
73
|
-
- BLOCKERs: X
|
|
74
|
-
- WARNINGs: Y
|
|
75
|
-
- OK: Z
|
|
76
|
-
- Overall: BLOCK | PASS_WITH_WARNINGS | PASS
|
|
77
|
-
|
|
78
|
-
## D1. Objective Extraction
|
|
79
|
-
Status: OK | WARNING | BLOCKER
|
|
80
|
-
Evidence: <file:line 또는 구체적 증거>
|
|
81
|
-
Recommendation: <있는 경우>
|
|
82
|
-
|
|
83
|
-
## D2. Requirements Coverage
|
|
84
|
-
...
|
|
85
|
-
|
|
86
|
-
## D3. Task Deliverables
|
|
87
|
-
...
|
|
88
|
-
|
|
89
|
-
## D4. Dependency Cycles
|
|
90
|
-
...
|
|
91
|
-
|
|
92
|
-
## D5. Context Budget
|
|
93
|
-
...
|
|
94
|
-
|
|
95
|
-
## D6. Change Management
|
|
96
|
-
...
|
|
97
|
-
|
|
98
|
-
## Next Action
|
|
99
|
-
(a) 사용자에게 escalate
|
|
100
|
-
(b) 수정 후 재검증
|
|
101
|
-
(c) 통과 — plan 검증 완료
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## 핵심 원칙
|
|
105
|
-
|
|
106
|
-
1. **Outcome-driven**: "계획이 완성되어 보이는가"가 아니라 "목표(outcome)에 도달하는가"를 역추적으로 묻는다.
|
|
107
|
-
2. **추정 금지**: 모든 판정에 증거(파일:라인 또는 명시적 인용).
|
|
108
|
-
3. **Bounded loop**: 3회 초과 반복 절대 금지. Escalation이 Revision의 기본 탈출구.
|
|
109
|
-
4. **당신은 executor가 아니다**: 계획을 수정하지 않는다. 문제점만 보고한다. 수정은 사용자 또는 다른 에이전트가 수행.
|
|
110
|
-
5. **Context Compliance**: SPEC의 DO NOT CHANGE / Non-Goals 영역을 침범하는 plan은 자동 BLOCKER.
|
|
111
|
-
|
|
112
|
-
## 한계 (명시)
|
|
113
|
-
|
|
114
|
-
- 이 에이전트는 `docs/SPEC.md` + `docs/plan.md` + `docs/todo.md` 구조를 가정한다. 다른 구조면 동작 안 함.
|
|
115
|
-
- LLM 기반 판단이므로 False positive/negative 가능. BLOCKER는 항상 증거 재검토.
|
|
116
|
-
- 코드 실행 후 결과를 검증하지 않는다 (이건 `reviewer` 또는 test-harness의 역할).
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: silent-failure-hunter
|
|
3
|
-
description: Review code for silent failures, swallowed errors, bad fallbacks, and missing error propagation.
|
|
4
|
-
model: sonnet
|
|
5
|
-
tools: [Read, Grep, Glob, Bash]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Silent Failure Hunter Agent
|
|
9
|
-
|
|
10
|
-
You have zero tolerance for silent failures.
|
|
11
|
-
|
|
12
|
-
## Hunt Targets
|
|
13
|
-
|
|
14
|
-
### 1. Empty Catch Blocks
|
|
15
|
-
|
|
16
|
-
- `catch {}` or ignored exceptions
|
|
17
|
-
- errors converted to `null` / empty arrays with no context
|
|
18
|
-
|
|
19
|
-
### 2. Inadequate Logging
|
|
20
|
-
|
|
21
|
-
- logs without enough context
|
|
22
|
-
- wrong severity
|
|
23
|
-
- log-and-forget handling
|
|
24
|
-
|
|
25
|
-
### 3. Dangerous Fallbacks
|
|
26
|
-
|
|
27
|
-
- default values that hide real failure
|
|
28
|
-
- `.catch(() => [])`
|
|
29
|
-
- graceful-looking paths that make downstream bugs harder to diagnose
|
|
30
|
-
|
|
31
|
-
### 4. Error Propagation Issues
|
|
32
|
-
|
|
33
|
-
- lost stack traces
|
|
34
|
-
- generic rethrows
|
|
35
|
-
- missing async handling
|
|
36
|
-
|
|
37
|
-
### 5. Missing Error Handling
|
|
38
|
-
|
|
39
|
-
- no timeout or error handling around network/file/db paths
|
|
40
|
-
- no rollback around transactional work
|
|
41
|
-
|
|
42
|
-
## Output Format
|
|
43
|
-
|
|
44
|
-
For each finding:
|
|
45
|
-
|
|
46
|
-
- location
|
|
47
|
-
- severity
|
|
48
|
-
- issue
|
|
49
|
-
- impact
|
|
50
|
-
- fix recommendation
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# templates/codex/hooks/ — Codex Hook 스크립트
|
|
2
|
-
|
|
3
|
-
> **Linked**: `docs/decisions/ADR-002-codex-hook-gap.md` v2 D1~D5
|
|
4
|
-
> **Transform**: `scripts/claude-to-codex.sh` (Phase C)가 `.claude/hooks/*.sh`를 대부분 그대로 포팅
|
|
5
|
-
|
|
6
|
-
## Hook 매핑 요약
|
|
7
|
-
|
|
8
|
-
| Codex event (snake_case) | 스크립트 | 원본 (Claude) | 상태 |
|
|
9
|
-
|--------------------------|----------|---------------|------|
|
|
10
|
-
| `session_start` | `session-start.sh` | `.claude/hooks/session-start.sh` | Phase C 포팅 예정 |
|
|
11
|
-
| `post_tool_use` | `uncommitted-check.sh` | `.claude/hooks/uncommitted-check.sh` | Phase C 포팅 예정 |
|
|
12
|
-
| ❌ (hook 사용 안 함) | ❌ | `.claude/hooks/protect-files.sh` | **Codex sandbox로 이관 (ADR-002 v2 D3)** |
|
|
13
|
-
|
|
14
|
-
## stdin/stdout 호환
|
|
15
|
-
|
|
16
|
-
Claude Code hook 스크립트가 stdin에서 읽는 필드는 Codex에서도 동일 이름으로 제공됨. 본체 수정 불필요:
|
|
17
|
-
|
|
18
|
-
- stdin 공통: `session_id, transcript_path, cwd, permission_mode, hook_event_name` (PascalCase)
|
|
19
|
-
- stdin 이벤트별: `tool_name, tool_input, tool_use_id, prompt, source, model`
|
|
20
|
-
- stdout: `systemMessage, additionalContext, updatedInput, decision (allow|deny|ask), reason, continue`
|
|
21
|
-
- exit 0 = 성공 / exit 2 = blockable 차단 (stderr → reason) / 기타 = non-blocking error
|
|
22
|
-
|
|
23
|
-
## 치명적 제약 — Issue #16732
|
|
24
|
-
|
|
25
|
-
`pre_tool_use` / `post_tool_use` 가 Bash 툴에만 발화. ApplyPatch(파일 쓰기)에 대해선 fire 안 함.
|
|
26
|
-
|
|
27
|
-
**영향**:
|
|
28
|
-
- `uncommitted-check.sh` — 파일 저장 후 감지가 필요한 경우 ApplyPatch 이후 상태는 못 잡음. Bash 커밋/저장 경로는 잡힘. Codex `stop` 이벤트(turn 종료) 추가 등록으로 보완 가능 (Phase C 설계 옵션)
|
|
29
|
-
|
|
30
|
-
## 미구현
|
|
31
|
-
|
|
32
|
-
- 각 `.sh` 스크립트 본체 — Phase C에서 `.claude/hooks/`에서 포팅
|
|
33
|
-
- 포팅 과정에서 Codex 전용 env var(`CODEX_HOME` 등) 대응 필요 시 wrapper 추가
|
|
34
|
-
|
|
35
|
-
## 보안
|
|
36
|
-
|
|
37
|
-
Codex `sandbox_mode = "workspace-write"` + `approval_policy = "on-request"` 가 파일 쓰기 1차 방어. Hook 스크립트는 보조 역할.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Placeholder — Phase C에서 `.claude/hooks/uncommitted-check.sh`로부터 포팅
|
|
3
|
-
# stdin JSON 필드는 Claude Code와 호환 (ADR-002 v2 D5)
|
|
4
|
-
# Codex event 매핑은 templates/codex/hooks/README.md 참조
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
echo "not-yet-implemented (Phase C)" >&2
|
|
7
|
-
exit 0
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: agent-introspection-debugging
|
|
3
|
-
description: Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.
|
|
4
|
-
origin: ECC
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Agent Introspection Debugging
|
|
8
|
-
|
|
9
|
-
Use this skill when an agent run is failing repeatedly, consuming tokens without progress, looping on the same tools, or drifting away from the intended task.
|
|
10
|
-
|
|
11
|
-
This is a workflow skill, not a hidden runtime. It teaches the agent to debug itself systematically before escalating to a human.
|
|
12
|
-
|
|
13
|
-
## When to Activate
|
|
14
|
-
|
|
15
|
-
- Maximum tool call / loop-limit failures
|
|
16
|
-
- Repeated retries with no forward progress
|
|
17
|
-
- Context growth or prompt drift that starts degrading output quality
|
|
18
|
-
- File-system or environment state mismatch between expectation and reality
|
|
19
|
-
- Tool failures that are likely recoverable with diagnosis and a smaller corrective action
|
|
20
|
-
|
|
21
|
-
## Scope Boundaries
|
|
22
|
-
|
|
23
|
-
Activate this skill for:
|
|
24
|
-
- capturing failure state before retrying blindly
|
|
25
|
-
- diagnosing common agent-specific failure patterns
|
|
26
|
-
- applying contained recovery actions
|
|
27
|
-
- producing a structured human-readable debug report
|
|
28
|
-
|
|
29
|
-
Do not use this skill as the primary source for:
|
|
30
|
-
- feature verification after code changes; use `verification-loop`
|
|
31
|
-
- framework-specific debugging when a narrower ECC skill already exists
|
|
32
|
-
- runtime promises the current harness cannot enforce automatically
|
|
33
|
-
|
|
34
|
-
## Four-Phase Loop
|
|
35
|
-
|
|
36
|
-
### Phase 1: Failure Capture
|
|
37
|
-
|
|
38
|
-
Before trying to recover, record the failure precisely.
|
|
39
|
-
|
|
40
|
-
Capture:
|
|
41
|
-
- error type, message, and stack trace when available
|
|
42
|
-
- last meaningful tool call sequence
|
|
43
|
-
- what the agent was trying to do
|
|
44
|
-
- current context pressure: repeated prompts, oversized pasted logs, duplicated plans, or runaway notes
|
|
45
|
-
- current environment assumptions: cwd, branch, relevant service state, expected files
|
|
46
|
-
|
|
47
|
-
Minimum capture template:
|
|
48
|
-
|
|
49
|
-
```markdown
|
|
50
|
-
## Failure Capture
|
|
51
|
-
- Session / task:
|
|
52
|
-
- Goal in progress:
|
|
53
|
-
- Error:
|
|
54
|
-
- Last successful step:
|
|
55
|
-
- Last failed tool / command:
|
|
56
|
-
- Repeated pattern seen:
|
|
57
|
-
- Environment assumptions to verify:
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Phase 2: Root-Cause Diagnosis
|
|
61
|
-
|
|
62
|
-
Match the failure to a known pattern before changing anything.
|
|
63
|
-
|
|
64
|
-
| Pattern | Likely Cause | Check |
|
|
65
|
-
| --- | --- | --- |
|
|
66
|
-
| Maximum tool calls / repeated same command | loop or no-exit observer path | inspect the last N tool calls for repetition |
|
|
67
|
-
| Context overflow / degraded reasoning | unbounded notes, repeated plans, oversized logs | inspect recent context for duplication and low-signal bulk |
|
|
68
|
-
| `ECONNREFUSED` / timeout | service unavailable or wrong port | verify service health, URL, and port assumptions |
|
|
69
|
-
| `429` / quota exhaustion | retry storm or missing backoff | count repeated calls and inspect retry spacing |
|
|
70
|
-
| file missing after write / stale diff | race, wrong cwd, or branch drift | re-check path, cwd, git status, and actual file existence |
|
|
71
|
-
| tests still failing after “fix” | wrong hypothesis | isolate the exact failing test and re-derive the bug |
|
|
72
|
-
|
|
73
|
-
Diagnosis questions:
|
|
74
|
-
- is this a logic failure, state failure, environment failure, or policy failure?
|
|
75
|
-
- did the agent lose the real objective and start optimizing the wrong subtask?
|
|
76
|
-
- is the failure deterministic or transient?
|
|
77
|
-
- what is the smallest reversible action that would validate the diagnosis?
|
|
78
|
-
|
|
79
|
-
### Phase 3: Contained Recovery
|
|
80
|
-
|
|
81
|
-
Recover with the smallest action that changes the diagnosis surface.
|
|
82
|
-
|
|
83
|
-
Safe recovery actions:
|
|
84
|
-
- stop repeated retries and restate the hypothesis
|
|
85
|
-
- trim low-signal context and keep only the active goal, blockers, and evidence
|
|
86
|
-
- re-check the actual filesystem / branch / process state
|
|
87
|
-
- narrow the task to one failing command, one file, or one test
|
|
88
|
-
- switch from speculative reasoning to direct observation
|
|
89
|
-
- escalate to a human when the failure is high-risk or externally blocked
|
|
90
|
-
|
|
91
|
-
Do not claim unsupported auto-healing actions like “reset agent state” or “update harness config” unless you are actually doing them through real tools in the current environment.
|
|
92
|
-
|
|
93
|
-
Contained recovery checklist:
|
|
94
|
-
|
|
95
|
-
```markdown
|
|
96
|
-
## Recovery Action
|
|
97
|
-
- Diagnosis chosen:
|
|
98
|
-
- Smallest action taken:
|
|
99
|
-
- Why this is safe:
|
|
100
|
-
- What evidence would prove the fix worked:
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Phase 4: Introspection Report
|
|
104
|
-
|
|
105
|
-
End with a report that makes the recovery legible to the next agent or human.
|
|
106
|
-
|
|
107
|
-
```markdown
|
|
108
|
-
## Agent Self-Debug Report
|
|
109
|
-
- Session / task:
|
|
110
|
-
- Failure:
|
|
111
|
-
- Root cause:
|
|
112
|
-
- Recovery action:
|
|
113
|
-
- Result: success | partial | blocked
|
|
114
|
-
- Token / time burn risk:
|
|
115
|
-
- Follow-up needed:
|
|
116
|
-
- Preventive change to encode later:
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Recovery Heuristics
|
|
120
|
-
|
|
121
|
-
Prefer these interventions in order:
|
|
122
|
-
|
|
123
|
-
1. Restate the real objective in one sentence.
|
|
124
|
-
2. Verify the world state instead of trusting memory.
|
|
125
|
-
3. Shrink the failing scope.
|
|
126
|
-
4. Run one discriminating check.
|
|
127
|
-
5. Only then retry.
|
|
128
|
-
|
|
129
|
-
Bad pattern:
|
|
130
|
-
- retrying the same action three times with slightly different wording
|
|
131
|
-
|
|
132
|
-
Good pattern:
|
|
133
|
-
- capture failure
|
|
134
|
-
- classify the pattern
|
|
135
|
-
- run one direct check
|
|
136
|
-
- change the plan only if the check supports it
|
|
137
|
-
|
|
138
|
-
## Integration with ECC
|
|
139
|
-
|
|
140
|
-
- Use `verification-loop` after recovery if code was changed.
|
|
141
|
-
- Use `recurrence-prevention` when the failure pattern is worth a rule, a gate, or a later skill.
|
|
142
|
-
- Use `council` when the issue is not technical failure but decision ambiguity.
|
|
143
|
-
- Use `workspace-surface-audit` if the failure came from conflicting local state or repo drift.
|
|
144
|
-
|
|
145
|
-
## Output Standard
|
|
146
|
-
|
|
147
|
-
When this skill is active, do not end with “I fixed it” alone.
|
|
148
|
-
|
|
149
|
-
Always provide:
|
|
150
|
-
- the failure pattern
|
|
151
|
-
- the root-cause hypothesis
|
|
152
|
-
- the recovery action
|
|
153
|
-
- the evidence that the situation is now better or still blocked
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Pre-send checklist
|
|
2
|
-
|
|
3
|
-
Run this once against the finished draft, fix what fails, then re-check the items
|
|
4
|
-
you touched. It is a self-check, not something to report — never append
|
|
5
|
-
"검수했습니다" or "모든 항목을 확인했습니다" to the answer itself.
|
|
6
|
-
|
|
7
|
-
## Lead and referent
|
|
8
|
-
|
|
9
|
-
1. 첫 문장에 결과·현상 또는 추천이 있는가? (좌표·메커니즘으로 시작하지 않았는가)
|
|
10
|
-
2. 코드를 읽지 않은 사람도 첫 문장을 이해할 수 있는가?
|
|
11
|
-
3. 설명 대상과 지시 대상이 명확한가 — 같은 이름이 두 대상을 가리키지 않는가?
|
|
12
|
-
4. 파일 경로·함수명이 주장보다 먼저 나오지 않는가?
|
|
13
|
-
|
|
14
|
-
## Facts and evidence
|
|
15
|
-
|
|
16
|
-
5. 발생 조건 · 시스템 동작 · 관찰된 결과가 서로 구분되는가?
|
|
17
|
-
6. 확인된 사실 · 확인된 원인 · 해석 · 가설 · 예상 · 의견이 구분되는가?
|
|
18
|
-
7. 측정하지 않은 수치나 효과를 만들지 않았는가? (없으면 "미측정"으로 표시)
|
|
19
|
-
8. 영향받는 역할이 명확한가?
|
|
20
|
-
9. 최종 사용자에게 직접 영향이 없는데 사용자 이득을 지어내지 않았는가?
|
|
21
|
-
|
|
22
|
-
## Language
|
|
23
|
-
|
|
24
|
-
10. 한국어에서 통용되지 않는 번역식 비유가 있는가?
|
|
25
|
-
11. 코드나 시스템을 사람처럼 표현했는가? (의도·기억·판단을 부여하지 마라)
|
|
26
|
-
12. 같은 결론을 도입부·표·결론에서 반복하지 않았는가?
|
|
27
|
-
|
|
28
|
-
## Form
|
|
29
|
-
|
|
30
|
-
13. 불필요한 표·ASIS→TOBE·제목·섹션을 쓰지 않았는가? (한두 문장으로 충분한 답에
|
|
31
|
-
표를 씌우는 것이 이 스킬의 가장 흔한 오용이다)
|
|
32
|
-
14. 더 짧고 구체적인 문장으로 바꿀 수 있는가?
|
|
33
|
-
|
|
34
|
-
## If it is a decision
|
|
35
|
-
|
|
36
|
-
Additionally: 추천이 단정형인가 · 명시적 ask 가 있는가 · gap 이 정량화됐는가 ·
|
|
37
|
-
추천안의 단점이 표에 있는가. 네 개 중 하나라도 없으면 Part 2 를 다시 읽어라.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# 왜 통하나 (근거, 선택적)
|
|
2
|
-
|
|
3
|
-
Light support if you want to defend the format — not part of the body. Reason with
|
|
4
|
-
each, don't just cite it.
|
|
5
|
-
|
|
6
|
-
- **Lead with the recommendation**: BLUF (Bottom Line Up Front) — readers decide off
|
|
7
|
-
the conclusion, so the ask goes first even though it's item 2 in the four-part rule.
|
|
8
|
-
- **Keep supporting reasons few (~3), one scannable table**: executive-decision-slide
|
|
9
|
-
and working-memory (~7±2) guidance — more dilutes and pushes the reader back into
|
|
10
|
-
analysis-mode. The same limit is why a referent collision has to be *drawn* rather
|
|
11
|
-
than narrated: prose makes the reader hold both objects in working memory while you
|
|
12
|
-
keep talking.
|
|
13
|
-
- **Quantify the gap, list all consequences**: As-Is/To-Be gap analysis + ADR
|
|
14
|
-
(Nygard) — an unquantified or one-sided gap isn't a basis for deciding. ADR's
|
|
15
|
-
Consequences section is explicitly two-sided for the same reason.
|
|
16
|
-
- **Pre-answer the objection inline**: Amazon Working Backwards PR/FAQ — collapses
|
|
17
|
-
the back-and-forth into one round. "왜 B가 아닌가" belongs in the first message,
|
|
18
|
-
not the second.
|
|
19
|
-
- **Contested call? score on explicit criteria**: RICE (Intercom) — a small scoring
|
|
20
|
-
table is more defensible than prose advocacy, and it makes the override visible
|
|
21
|
-
when judgment beats the score.
|
|
22
|
-
|
|
23
|
-
None of these outrank Step 1. A perfectly BLUF-formatted message about an ambiguous
|
|
24
|
-
referent still fails — that is the observed case this skill was built from.
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Worked examples
|
|
2
|
-
|
|
3
|
-
Two complete walkthroughs. The first repairs a failing *explanation* (Part 1);
|
|
4
|
-
the second renders a *decision* (Part 2). Read the one that matches the message
|
|
5
|
-
you are about to send.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 1. Explain — a failing draft, diagnosed and repaired
|
|
10
|
-
|
|
11
|
-
**Input** (the failing draft): *"`update-mode.ts:53-78` の targets array lists
|
|
12
|
-
rules/agents/commands/hooks. `skills` is absent, and `install-render.ts:431`
|
|
13
|
-
iterates `updated`, so no row renders."*
|
|
14
|
-
|
|
15
|
-
Every clause is true, and it does not land.
|
|
16
|
-
|
|
17
|
-
**Diagnosis, in the order of Steps 1–4**
|
|
18
|
-
|
|
19
|
-
| Step | Question | Verdict on this draft |
|
|
20
|
-
|---|---|---|
|
|
21
|
-
| 1 | Does a name point at two things? | Yes — `.claude/` means *this repo* and *the installed project*. The writer holds both; the reader cannot tell which is broken. |
|
|
22
|
-
| 2 | Does it lead with who + what changes? | No — it opens with a coordinate (`update-mode.ts:53-78`). |
|
|
23
|
-
| 3 | Is the evidence before or after the claim? | Before. There is no claim yet. |
|
|
24
|
-
| 4 | What did the reader actually ask? | *"is this about installing, or about the project directory?"* → symptom row 1 = referent collision. |
|
|
25
|
-
|
|
26
|
-
**Output** (after the diagnostic):
|
|
27
|
-
|
|
28
|
-
> There are two `.claude/` directories, and I mixed them:
|
|
29
|
-
>
|
|
30
|
-
> ```
|
|
31
|
-
> ① this repo (we build here) ② someone's project (installed here)
|
|
32
|
-
> templates/skills/ ──npm──▶ .claude/skills/
|
|
33
|
-
> ```
|
|
34
|
-
>
|
|
35
|
-
> **The problem, in one sentence:** in ②, skills installed once never change
|
|
36
|
-
> again, no matter how many times the user runs update.
|
|
37
|
-
>
|
|
38
|
-
> Update refreshes rules, agents, commands, and hooks — but skills were left out
|
|
39
|
-
> of that list, and the summary screen only prints directories that were
|
|
40
|
-
> touched. So nothing on screen said anything was skipped.
|
|
41
|
-
>
|
|
42
|
-
> Evidence: `update-mode.ts:53-78` (the target list), `install-render.ts:431`
|
|
43
|
-
> (the render loop).
|
|
44
|
-
|
|
45
|
-
Same facts, same precision, three lines to comprehension. Note what did **not**
|
|
46
|
-
change: no softer tone, no shorter sentences, no "user perspective" rewrite. The
|
|
47
|
-
repair was separating one name into two named things and putting the claim first.
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 2. Decide — the four slots with a quantified gap
|
|
52
|
-
|
|
53
|
-
**Input** (what you're tempted to send): *"The compat checker re-validates every
|
|
54
|
-
asset on each run and it's gotten slow. I could cache results. Want me to?"*
|
|
55
|
-
|
|
56
|
-
That is a decision hidden inside a status update. The reader has to reconstruct
|
|
57
|
-
the options, the cost, and the ask.
|
|
58
|
-
|
|
59
|
-
**Output** (the format):
|
|
60
|
-
|
|
61
|
-
> **추천 + 이유:** `gen-compatibility` 의 검증 결과를 콘텐츠 해시 기준으로 캐싱하도록
|
|
62
|
-
> 바꾸겠습니다 — 변경분만 재검증해 시간을 가장 크게 줄이고 CI 코어 변동에도 안정적이라.
|
|
63
|
-
> **승인해 주세요 — 아니면 B(캐시 없이 병렬화만)도 가능합니다.**
|
|
64
|
-
>
|
|
65
|
-
> **전후맥락:** 자산이 52개로 늘면서 매 실행마다 전 자산 재검증 → CI `gen-compat`
|
|
66
|
-
> 스텝이 느려짐. 자산 내용은 거의 안 바뀌는데 매번 풀 재검증하는 게 병목.
|
|
67
|
-
>
|
|
68
|
-
> | 항목 | ASIS (현재) | TOBE (제안: 해시 캐싱) | Gap |
|
|
69
|
-
> |------|-------------|------------------------|-----|
|
|
70
|
-
> | 전체 검증 시간 | ~140s (52자산 전수) | ~12s (변경분만) | **-128s / 실행** |
|
|
71
|
-
> | 캐시 미스 시 | — | 풀 재검증 폴백 | 정확성 손실 0 |
|
|
72
|
-
> | 추가 코드 | 없음 | 캐시 read/write + 무효화 (~40줄) | 유지보수 +α |
|
|
73
|
-
> | 트레이드오프 | — | 해시 충돌 시 stale 위험 | 무효화 키 = 파일내용 해시로 차단 |
|
|
74
|
-
>
|
|
75
|
-
> *왜 B(병렬화만)가 아닌가:* 병렬화는 시간을 ~3배만 줄이고(약 45s) 코어 수에 의존 —
|
|
76
|
-
> 캐싱이 변경분만 검증해 더 크게(11배) 줄이고 CI 코어 변동에도 안정적이라 A 추천.
|
|
77
|
-
>
|
|
78
|
-
> 승인 시 → feature 브랜치에서 캐시 레이어 + 무효화 테스트 추가 → 로컬 `npm run ci`
|
|
79
|
-
> 통과 → PR.
|
|
80
|
-
|
|
81
|
-
Notice: the user can say "go" after the first two lines, or push back on exactly
|
|
82
|
-
one cell of the table. No essay, no buried recommendation, no hidden downside —
|
|
83
|
-
the stale-cache risk is in the table, not omitted to make the proposal look
|
|
84
|
-
cleaner.
|
|
85
|
-
|
|
86
|
-
**The numbers are the point.** "느려짐 → 빨라짐" would have carried the same
|
|
87
|
-
argument with none of the basis for deciding: ~140s → ~12s, -128s per run, 11×,
|
|
88
|
-
and the rejected alternative's own number (~45s) are what let the reader judge
|
|
89
|
-
the trade instead of trusting the recommender.
|