harness-everything 0.2.1 → 0.2.2

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.
Files changed (70) hide show
  1. package/README.md +1 -1
  2. package/build-multi-agent-system/SKILL.md +68 -68
  3. package/create-agent-launcher/SKILL.md +48 -48
  4. package/docs/architecture.md +2 -2
  5. package/docs/workflows/build-multi-agent-system.md +62 -62
  6. package/docs/workflows/create-agent-launcher.md +62 -62
  7. package/docs/workflows/environment-detection.md +63 -63
  8. package/docs/workflows/eval-harness.md +57 -57
  9. package/docs/workflows/fable-discipline.md +59 -59
  10. package/docs/workflows/fable-mode.md +32 -32
  11. package/docs/workflows/git-commit.md +62 -62
  12. package/docs/workflows/grill-me.md +62 -62
  13. package/docs/workflows/grill-with-docs.md +62 -62
  14. package/docs/workflows/improve-codebase-architecture.md +60 -60
  15. package/docs/workflows/repo-docs.md +59 -59
  16. package/docs/workflows/rewrite-commits.md +60 -60
  17. package/docs/workflows/security-review.md +58 -58
  18. package/docs/workflows/self-evolve.md +59 -59
  19. package/docs/workflows/tdd.md +39 -39
  20. package/docs/workflows/todo-driven-workflow.md +36 -36
  21. package/docs/workflows/using-git-worktrees.md +63 -63
  22. package/docs/workflows/verification-loop.md +69 -69
  23. package/docs/workflows/verify-before-claim.md +60 -60
  24. package/docs/workflows/zoom-out.md +62 -62
  25. package/environment-detection/SKILL.md +77 -77
  26. package/eval-framework/behavioral-test.js +105 -105
  27. package/eval-framework/mechanism-test.js +251 -251
  28. package/eval-harness/SKILL.md +59 -59
  29. package/fable-discipline/SKILL.md +38 -38
  30. package/fable-mode/SKILL.md +51 -51
  31. package/git-commit/SKILL.md +55 -55
  32. package/grill-me/SKILL.md +36 -36
  33. package/grill-with-docs/SKILL.md +99 -99
  34. package/harness-everything/SKILL.md +141 -141
  35. package/harness-everything/examples/README.md +9 -9
  36. package/harness-everything/examples/todo-workflow.md +22 -22
  37. package/harness-everything/scripts/todo-cli.js +157 -157
  38. package/harness-everything/scripts/verify-gate.js +31 -31
  39. package/hooks/scripts/atomic-commit-check.js +68 -68
  40. package/hooks/scripts/context-compact.js +114 -114
  41. package/hooks/scripts/lib/platforms/claude.js +132 -42
  42. package/hooks/scripts/lib/platforms/codex.js +96 -46
  43. package/hooks/scripts/lib/platforms/continue.js +73 -41
  44. package/hooks/scripts/lib/platforms/copilot.js +91 -41
  45. package/hooks/scripts/lib/platforms/cursor.js +71 -41
  46. package/hooks/scripts/lib/platforms/hermes.js +25 -0
  47. package/hooks/scripts/rule-of-3.js +176 -176
  48. package/improve-codebase-architecture/SKILL.md +44 -44
  49. package/install-cognitive-os/SKILL.md +95 -95
  50. package/package.json +1 -1
  51. package/repo-docs/SKILL.md +45 -45
  52. package/rewrite-commits/SKILL.md +32 -32
  53. package/scripts/installer.js +57 -200
  54. package/scripts/lib/advisory-text.js +163 -163
  55. package/scripts/lib/claude-hooks.js +71 -71
  56. package/scripts/lib/manifest.js +82 -82
  57. package/scripts/lib/prompts.js +241 -241
  58. package/scripts/lib/skills.js +174 -172
  59. package/scripts/lib/workspace.js +28 -28
  60. package/security-review/SKILL.md +510 -510
  61. package/self-evolve/SKILL.md +54 -54
  62. package/skill-creator/SKILL.md +91 -91
  63. package/skill-creator/references/testing-workflow.md +32 -32
  64. package/skill-style/SKILL.md +48 -48
  65. package/tdd/SKILL.md +53 -53
  66. package/todo-driven-workflow/SKILL.md +54 -54
  67. package/using-git-worktrees/SKILL.md +161 -161
  68. package/verification-loop/SKILL.md +138 -138
  69. package/verify-before-claim/SKILL.md +86 -86
  70. package/zoom-out/SKILL.md +90 -90
@@ -1,138 +1,138 @@
1
- ---
2
- name: verification-loop
3
- description: "A comprehensive verification system for Claude Code sessions."
4
- author: Miya Daniel | Harness Core Team
5
- version: 0.2.0
6
- metadata:
7
- origin: ECC
8
- ---
9
-
10
- # Verification Loop Skill
11
-
12
- ## 📋 Skill Contract
13
-
14
- | Component | Specification |
15
- | :--- | :--- |
16
- | **Trigger / Input** | Approaching task completion or PR creation. Input: The modified project files. |
17
- | **Expected Output** | Terminal logs showing successful Build, Type Check, Lint, and Test execution. |
18
- | **State Mutations** | None. Pure verification. |
19
- | **Enforcement Gate** | You MUST execute `npm run build`, `npm run lint`, and `npm run test` (or equivalent). You cannot complete the task if any of these return Exit Code 1. |
20
-
21
- A comprehensive verification system for Claude Code sessions.
22
-
23
- ## When to Use
24
-
25
- Invoke this skill:
26
- - After completing a feature or significant code change
27
- - Before creating a PR
28
- - When you want to ensure quality gates pass
29
- - After refactoring
30
-
31
- ## Verification Phases
32
-
33
- ### Phase 1: Build Verification
34
- ```bash
35
- # Check if project builds
36
- npm run build 2>&1 | tail -20
37
- # OR
38
- pnpm build 2>&1 | tail -20
39
- ```
40
-
41
- If build fails, STOP and fix before continuing.
42
-
43
- ### Phase 2: Type Check
44
- ```bash
45
- # TypeScript projects
46
- npx tsc --noEmit 2>&1 | head -30
47
-
48
- # Python projects
49
- pyright . 2>&1 | head -30
50
- ```
51
-
52
- Report all type errors. Fix critical ones before continuing.
53
-
54
- ### Phase 3: Lint Check
55
- ```bash
56
- # JavaScript/TypeScript
57
- npm run lint 2>&1 | head -30
58
-
59
- # Python
60
- ruff check . 2>&1 | head -30
61
- ```
62
-
63
- ### Phase 4: Test Suite
64
- ```bash
65
- # Run tests with coverage
66
- npm run test -- --coverage 2>&1 | tail -50
67
-
68
- # Check coverage threshold
69
- # Target: 80% minimum
70
- ```
71
-
72
- Report:
73
- - Total tests: X
74
- - Passed: X
75
- - Failed: X
76
- - Coverage: X%
77
-
78
- ### Phase 5: Security Scan
79
- ```bash
80
- # Check for secrets
81
- grep -rn "sk-" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
82
- grep -rn "api_key" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
83
-
84
- # Check for console.log
85
- grep -rn "console.log" --include="*.ts" --include="*.tsx" src/ 2>/dev/null | head -10
86
- ```
87
-
88
- ### Phase 6: Diff Review
89
- ```bash
90
- # Show what changed
91
- git diff --stat
92
- git diff HEAD~1 --name-only
93
- ```
94
-
95
- Review each changed file for:
96
- - Unintended changes
97
- - Missing error handling
98
- - Potential edge cases
99
-
100
- ## Output Format
101
-
102
- After running all phases, produce a verification report:
103
-
104
- ```
105
- VERIFICATION REPORT
106
- ==================
107
-
108
- Build: [PASS/FAIL]
109
- Types: [PASS/FAIL] (X errors)
110
- Lint: [PASS/FAIL] (X warnings)
111
- Tests: [PASS/FAIL] (X/Y passed, Z% coverage)
112
- Security: [PASS/FAIL] (X issues)
113
- Diff: [X files changed]
114
-
115
- Overall: [READY/NOT READY] for PR
116
-
117
- Issues to Fix:
118
- 1. ...
119
- 2. ...
120
- ```
121
-
122
- ## Continuous Mode
123
-
124
- For long sessions, run verification every 15 minutes or after major changes:
125
-
126
- ```markdown
127
- Set a mental checkpoint:
128
- - After completing each function
129
- - After finishing a component
130
- - Before moving to next task
131
-
132
- Run: /verify
133
- ```
134
-
135
- ## Integration with Hooks
136
-
137
- This skill complements PostToolUse hooks but provides deeper verification.
138
- Hooks catch issues immediately; this skill provides comprehensive review.
1
+ ---
2
+ name: verification-loop
3
+ description: "A comprehensive verification system for Claude Code sessions."
4
+ author: Miya Daniel | Harness Core Team
5
+ version: 0.2.0
6
+ metadata:
7
+ origin: ECC
8
+ ---
9
+
10
+ # Verification Loop Skill
11
+
12
+ ## 📋 Skill Contract
13
+
14
+ | Component | Specification |
15
+ | :--- | :--- |
16
+ | **Trigger / Input** | Approaching task completion or PR creation. Input: The modified project files. |
17
+ | **Expected Output** | Terminal logs showing successful Build, Type Check, Lint, and Test execution. |
18
+ | **State Mutations** | None. Pure verification. |
19
+ | **Enforcement Gate** | You MUST execute `npm run build`, `npm run lint`, and `npm run test` (or equivalent). You cannot complete the task if any of these return Exit Code 1. |
20
+
21
+ A comprehensive verification system for Claude Code sessions.
22
+
23
+ ## When to Use
24
+
25
+ Invoke this skill:
26
+ - After completing a feature or significant code change
27
+ - Before creating a PR
28
+ - When you want to ensure quality gates pass
29
+ - After refactoring
30
+
31
+ ## Verification Phases
32
+
33
+ ### Phase 1: Build Verification
34
+ ```bash
35
+ # Check if project builds
36
+ npm run build 2>&1 | tail -20
37
+ # OR
38
+ pnpm build 2>&1 | tail -20
39
+ ```
40
+
41
+ If build fails, STOP and fix before continuing.
42
+
43
+ ### Phase 2: Type Check
44
+ ```bash
45
+ # TypeScript projects
46
+ npx tsc --noEmit 2>&1 | head -30
47
+
48
+ # Python projects
49
+ pyright . 2>&1 | head -30
50
+ ```
51
+
52
+ Report all type errors. Fix critical ones before continuing.
53
+
54
+ ### Phase 3: Lint Check
55
+ ```bash
56
+ # JavaScript/TypeScript
57
+ npm run lint 2>&1 | head -30
58
+
59
+ # Python
60
+ ruff check . 2>&1 | head -30
61
+ ```
62
+
63
+ ### Phase 4: Test Suite
64
+ ```bash
65
+ # Run tests with coverage
66
+ npm run test -- --coverage 2>&1 | tail -50
67
+
68
+ # Check coverage threshold
69
+ # Target: 80% minimum
70
+ ```
71
+
72
+ Report:
73
+ - Total tests: X
74
+ - Passed: X
75
+ - Failed: X
76
+ - Coverage: X%
77
+
78
+ ### Phase 5: Security Scan
79
+ ```bash
80
+ # Check for secrets
81
+ grep -rn "sk-" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
82
+ grep -rn "api_key" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
83
+
84
+ # Check for console.log
85
+ grep -rn "console.log" --include="*.ts" --include="*.tsx" src/ 2>/dev/null | head -10
86
+ ```
87
+
88
+ ### Phase 6: Diff Review
89
+ ```bash
90
+ # Show what changed
91
+ git diff --stat
92
+ git diff HEAD~1 --name-only
93
+ ```
94
+
95
+ Review each changed file for:
96
+ - Unintended changes
97
+ - Missing error handling
98
+ - Potential edge cases
99
+
100
+ ## Output Format
101
+
102
+ After running all phases, produce a verification report:
103
+
104
+ ```
105
+ VERIFICATION REPORT
106
+ ==================
107
+
108
+ Build: [PASS/FAIL]
109
+ Types: [PASS/FAIL] (X errors)
110
+ Lint: [PASS/FAIL] (X warnings)
111
+ Tests: [PASS/FAIL] (X/Y passed, Z% coverage)
112
+ Security: [PASS/FAIL] (X issues)
113
+ Diff: [X files changed]
114
+
115
+ Overall: [READY/NOT READY] for PR
116
+
117
+ Issues to Fix:
118
+ 1. ...
119
+ 2. ...
120
+ ```
121
+
122
+ ## Continuous Mode
123
+
124
+ For long sessions, run verification every 15 minutes or after major changes:
125
+
126
+ ```markdown
127
+ Set a mental checkpoint:
128
+ - After completing each function
129
+ - After finishing a component
130
+ - Before moving to next task
131
+
132
+ Run: /verify
133
+ ```
134
+
135
+ ## Integration with Hooks
136
+
137
+ This skill complements PostToolUse hooks but provides deeper verification.
138
+ Hooks catch issues immediately; this skill provides comprehensive review.
@@ -1,86 +1,86 @@
1
- ---
2
- name: verify-before-claim
3
- description: "Verify external framework/API claims and unmeasured perf/cost estimates against an authoritative source before asserting them, instead of answering from training memory."
4
- author: Miya Daniel | Harness Core Team
5
- version: 0.2.0
6
- metadata:
7
- type: harness-discipline
8
- ---
9
-
10
- # Verify Before Claim
11
-
12
- ## 📋 Skill Contract
13
-
14
- | Component | Specification |
15
- | :--- | :--- |
16
- | **Trigger / Input** | About to state how an external system (framework/library/SDK/API/service) currently behaves, or about to state an unmeasured performance/cost/timing number. |
17
- | **Expected Output** | The claim is backed by a `WebFetch`/`WebSearch`-sourced quote from authoritative docs, or an actual measurement — never asserted from training memory alone. |
18
- | **State Mutations** | None — this is a discipline governing what gets asserted in the response, not a file-mutating skill. |
19
- | **Enforcement Gate** | An external-behavior claim without a same-session fetch/search backing it **MUST NOT** be asserted with confidence; an unmeasured number **MUST** be explicitly labeled as an estimate, not presented as fact. |
20
-
21
- Training memory goes stale and is easy to misremember with full confidence.
22
- This skill exists because that failure mode is real and already happened in
23
- this repo: an early claim that `rule-of-3.js`'s `process.exit(1)` blocked a
24
- Claude Code `PreToolUse` hook was wrong — the official docs say only
25
- `exit(2)` blocks, `exit(1)` is a non-blocking error — and it was only caught
26
- by actually fetching `code.claude.com/docs/en/hooks` instead of trusting the
27
- assumption. The circuit breaker had never blocked anything until that got
28
- checked.
29
-
30
- `harness-everything/scripts/tier-router.js` fires a lightweight keyword-based
31
- reminder for this automatically (`UserPromptSubmit`, "FACT-AUDIT REMINDER"
32
- block) so you don't have to be manually pushed into checking every time. This
33
- file is the actual discipline behind that reminder.
34
-
35
- ## TRIGGER — verify before asserting, don't skip because the answer "feels obvious"
36
-
37
- Whenever either is true:
38
-
39
- 1. **You are about to state how an external system currently behaves** —
40
- a framework, library, SDK, CLI tool, API, or service's schema, defaults,
41
- exit codes, config flags, pricing, rate limits, version-specific behavior,
42
- or "does X support Y." This includes cases that feel like common
43
- knowledge — exit-code conventions, hook payload shapes, and default
44
- values are exactly where confident misremembering happens.
45
- 2. **You are about to state a performance, cost, or timing number that
46
- wasn't produced by an actual run in this session** — "this should take
47
- ~X," "this is O(n)," "this will cost about $Y," "this should be fast
48
- enough." An estimate rendered with confidence is still an estimate.
49
-
50
- ## Procedure
51
-
52
- - For claim (1): `WebFetch` the tool's official documentation first. If the
53
- official docs don't cover it, `WebSearch` and cite what you find. Quote the
54
- relevant part back rather than paraphrasing from memory — paraphrasing
55
- reintroduces the same risk you're trying to avoid.
56
- - For claim (2): if the stakes justify it (the number feeds a design
57
- decision, a rejection/deferral, or something the user will act on),
58
- actually run it — a real benchmark, a real timing, a real measurement —
59
- instead of reasoning about what it "should" be. If running it isn't
60
- feasible, say explicitly that the number is an unverified estimate; don't
61
- present it with the same confidence as a measured fact.
62
- - If a fetch or search comes back inconclusive or contradicts your prior
63
- assumption, say so and show the source — don't quietly reconcile it into
64
- something that sounds more confident than what you actually found.
65
-
66
- ## SKIP — don't over-trigger
67
-
68
- - **The claim is about this repository's own code**, not an external system.
69
- Reading the actual source here already is the authoritative check; no web
70
- verification needed.
71
- - **The user supplied the fact or number directly** in this conversation —
72
- trust their firsthand statement, don't second-guess it with a search.
73
- - **Already verified this session** — don't re-fetch the same source
74
- redundantly if it was already checked earlier in this conversation and
75
- nothing suggests it changed.
76
- - **Generic, non-version-specific CS/engineering knowledge** (what a hash map
77
- is, what Big-O notation means) — this isn't tied to any particular tool's
78
- current implementation, so there's nothing to go stale.
79
-
80
- ## Why this is a skill, not just a hook
81
-
82
- The `tier-router.js` reminder is a keyword net — cheap, broad, and it can
83
- only nudge, not judge whether a specific sentence you're about to write is
84
- actually an unverified claim. The judgment call is still yours: notice when
85
- you're about to assert something you haven't actually checked this session,
86
- regardless of whether a keyword happened to fire.
1
+ ---
2
+ name: verify-before-claim
3
+ description: "Verify external framework/API claims and unmeasured perf/cost estimates against an authoritative source before asserting them, instead of answering from training memory."
4
+ author: Miya Daniel | Harness Core Team
5
+ version: 0.2.0
6
+ metadata:
7
+ type: harness-discipline
8
+ ---
9
+
10
+ # Verify Before Claim
11
+
12
+ ## 📋 Skill Contract
13
+
14
+ | Component | Specification |
15
+ | :--- | :--- |
16
+ | **Trigger / Input** | About to state how an external system (framework/library/SDK/API/service) currently behaves, or about to state an unmeasured performance/cost/timing number. |
17
+ | **Expected Output** | The claim is backed by a `WebFetch`/`WebSearch`-sourced quote from authoritative docs, or an actual measurement — never asserted from training memory alone. |
18
+ | **State Mutations** | None — this is a discipline governing what gets asserted in the response, not a file-mutating skill. |
19
+ | **Enforcement Gate** | An external-behavior claim without a same-session fetch/search backing it **MUST NOT** be asserted with confidence; an unmeasured number **MUST** be explicitly labeled as an estimate, not presented as fact. |
20
+
21
+ Training memory goes stale and is easy to misremember with full confidence.
22
+ This skill exists because that failure mode is real and already happened in
23
+ this repo: an early claim that `rule-of-3.js`'s `process.exit(1)` blocked a
24
+ Claude Code `PreToolUse` hook was wrong — the official docs say only
25
+ `exit(2)` blocks, `exit(1)` is a non-blocking error — and it was only caught
26
+ by actually fetching `code.claude.com/docs/en/hooks` instead of trusting the
27
+ assumption. The circuit breaker had never blocked anything until that got
28
+ checked.
29
+
30
+ `harness-everything/scripts/tier-router.js` fires a lightweight keyword-based
31
+ reminder for this automatically (`UserPromptSubmit`, "FACT-AUDIT REMINDER"
32
+ block) so you don't have to be manually pushed into checking every time. This
33
+ file is the actual discipline behind that reminder.
34
+
35
+ ## TRIGGER — verify before asserting, don't skip because the answer "feels obvious"
36
+
37
+ Whenever either is true:
38
+
39
+ 1. **You are about to state how an external system currently behaves** —
40
+ a framework, library, SDK, CLI tool, API, or service's schema, defaults,
41
+ exit codes, config flags, pricing, rate limits, version-specific behavior,
42
+ or "does X support Y." This includes cases that feel like common
43
+ knowledge — exit-code conventions, hook payload shapes, and default
44
+ values are exactly where confident misremembering happens.
45
+ 2. **You are about to state a performance, cost, or timing number that
46
+ wasn't produced by an actual run in this session** — "this should take
47
+ ~X," "this is O(n)," "this will cost about $Y," "this should be fast
48
+ enough." An estimate rendered with confidence is still an estimate.
49
+
50
+ ## Procedure
51
+
52
+ - For claim (1): `WebFetch` the tool's official documentation first. If the
53
+ official docs don't cover it, `WebSearch` and cite what you find. Quote the
54
+ relevant part back rather than paraphrasing from memory — paraphrasing
55
+ reintroduces the same risk you're trying to avoid.
56
+ - For claim (2): if the stakes justify it (the number feeds a design
57
+ decision, a rejection/deferral, or something the user will act on),
58
+ actually run it — a real benchmark, a real timing, a real measurement —
59
+ instead of reasoning about what it "should" be. If running it isn't
60
+ feasible, say explicitly that the number is an unverified estimate; don't
61
+ present it with the same confidence as a measured fact.
62
+ - If a fetch or search comes back inconclusive or contradicts your prior
63
+ assumption, say so and show the source — don't quietly reconcile it into
64
+ something that sounds more confident than what you actually found.
65
+
66
+ ## SKIP — don't over-trigger
67
+
68
+ - **The claim is about this repository's own code**, not an external system.
69
+ Reading the actual source here already is the authoritative check; no web
70
+ verification needed.
71
+ - **The user supplied the fact or number directly** in this conversation —
72
+ trust their firsthand statement, don't second-guess it with a search.
73
+ - **Already verified this session** — don't re-fetch the same source
74
+ redundantly if it was already checked earlier in this conversation and
75
+ nothing suggests it changed.
76
+ - **Generic, non-version-specific CS/engineering knowledge** (what a hash map
77
+ is, what Big-O notation means) — this isn't tied to any particular tool's
78
+ current implementation, so there's nothing to go stale.
79
+
80
+ ## Why this is a skill, not just a hook
81
+
82
+ The `tier-router.js` reminder is a keyword net — cheap, broad, and it can
83
+ only nudge, not judge whether a specific sentence you're about to write is
84
+ actually an unverified claim. The judgment call is still yours: notice when
85
+ you're about to assert something you haven't actually checked this session,
86
+ regardless of whether a keyword happened to fire.
package/zoom-out/SKILL.md CHANGED
@@ -1,90 +1,90 @@
1
- ---
2
- name: zoom-out
3
- description: Reflect-first circuit breaker - rebuild the full picture and fact-check assumptions when stuck; escalate to the human only for genuine decisions.
4
- author: Miya Daniel | Harness Core Team
5
- version: 0.2.0
6
- ---
7
-
8
- # Zoom Out (Global Perspective & Circuit Breaker)
9
-
10
- ## 📋 Skill Contract
11
-
12
- | Component | Specification |
13
- | :--- | :--- |
14
- | **Trigger / Input** | Terminal script failures 3 times in a row, or getting stuck in an infinite loop. Input: Error logs. |
15
- | **Expected Output** | Reflection report written to disk. Terminal commands MUST STOP until the report is completed. |
16
- | **State Mutations** | MUST write `zoom-out-report.md` at the exact path the Rule of 3 breaker message gives you (session-scoped under `.claude/harness-state/sessions/<id>/`). |
17
- | **Enforcement Gate** | The `rule-of-3.js` script (if run via Hook or CLI) will block all other `Write` or `Edit` actions until that `zoom-out-report.md` exists and is formatted correctly. |
18
-
19
- This skill is the **Ultimate Circuit Breaker** in the Harness system.
20
- It MUST be forcefully triggered when the Agent falls into logic blind spots, invalid retries, or hits the Reasoning Ceiling.
21
-
22
- Its purpose is **NOT** to hand the problem to the human. The most common fatal flaw when stuck is failing to step back and rebuild a complete overview of the problem — three failures in a row almost always share one unverified assumption. This skill forces that step. The Human Partner is interrupted only when there is a genuine **decision** that belongs to them, never as a substitute for reflection you have not done yet.
23
-
24
- > **Platform note**: only Claude Code enforces this breaker physically (hooks lock mutating tools; a valid report releases them). On advisory-only platforms (Cursor, Copilot, Gemini CLI, Codex CLI...) nothing will stop you — the protocol is identical and **self-enforced**: stop at 3 failures, run Phases 1-4 exactly as written, and still write the report file as the reflection artifact.
25
-
26
- ## 1. Triggers
27
- - **Rule of 3 (Micro-error looping)**: This is the most common fatal flaw of AI. If attempting to fix the same error, same test failure, or same logic fails 3 times consecutively, or if constantly making minor invalid changes in the same place (e.g., repeatedly changing variable names or adding console.log but it's still broken).
28
- - **Divergence Phenomenon**: Fixing one Bug leads to 2 new Bugs, and fixing those triggers even more errors.
29
- - **Attention Loss**: You realize you have forgotten the initial task goal, or the files being modified deviate too far from the original goal.
30
- - **Human Intervention**: The user explicitly instructs "zoom out", "step back and look", or "stop and think".
31
-
32
- ## 2. Phase 1 — Cease Fire
33
- - **ABSOLUTELY PROHIBITED** from proposing any new code modification suggestions.
34
- - **ABSOLUTELY PROHIBITED** from saying "I understand, I will fix it using the following method..." — that sentence is the tunnel talking.
35
- - **Do NOT message the Human Partner yet.** "I failed 3 times" is not yet a report worth their time; reflection comes first.
36
-
37
- ## 3. Phase 2 — Rebuild the Full Picture (Reflect & Fact-Check)
38
- Use **READ-ONLY tools** (Read / Grep / Glob) — they remain available while the breaker is locked. No guessing in this phase; only evidence.
39
-
40
- 1. **Restate the original goal** — from the task / todo list, not from your memory of the current rabbit hole. Ask: does the thing I have been fighting even matter to this goal?
41
- 2. **List each failed attempt and extract the assumption behind it.** Every fix attempt encoded a belief about the system; name each belief explicitly.
42
- 3. **Fact-check every assumption against reality.** Open the actual file, the actual log, the actual config, the actual upstream data, the actual docs. Replace every "it should be" with "I looked, and it is".
43
- 4. **Raise the altitude.** Is this even the right layer? Is the module doing what the architecture intends? Did upstream pass wrong data? Is this a framework limitation? Do two requirements contradict each other?
44
- 5. **Form a fresh diagnosis** that explains **ALL** observed evidence — including why all previous attempts failed — not just the latest error message.
45
-
46
- ## 4. Phase 3 — Write the Reflection Report
47
- Write your findings to the exact `zoom-out-report.md` path printed in the Rule of 3 block message — the ONLY write permitted while the breaker is locked. (If the file already exists from an earlier cycle, Read it first so you do not re-propose an already-falsified diagnosis.) Required sections:
48
-
49
- ```markdown
50
- ## Goal
51
- <the original task goal, restated from source>
52
- ## Failed Attempts
53
- <attempt → the assumption it relied on → why it was wrong>
54
- ## Verified Facts
55
- <only things you actually re-checked in Phase 2, each with where you looked>
56
- ## Diagnosis
57
- <the fresh root-cause explanation covering all evidence>
58
- ## Decision
59
- RESUME: <the new approach> — or — ESCALATE: <the decision the human must make>
60
- ```
61
-
62
- A valid report automatically releases the circuit breaker. This is not paperwork — the hook checks it precisely because writing it honestly IS the reflection.
63
-
64
- ## 5. Phase 4 — Decision Gate: Resume or Escalate
65
-
66
- **RESUME (the default and expected outcome)** when the fresh diagnosis yields a genuinely NEW path — a different layer, different root cause, or different approach, not a variation of the attempts that already failed — and it is within your existing authority and task scope. Self-recovery is what zoom-out is for.
67
-
68
- **ESCALATE only when the blocker is a decision that belongs to a human**, such as:
69
- - Requirements contradict each other, or the goal itself is ambiguous.
70
- - The fix requires an architecture / scope trade-off the human has not sanctioned (rewriting a module, changing a public API, dropping a requirement).
71
- - The path forward is destructive or irreversible (data migration, force push, deleting user data).
72
- - You lack access only the human can grant (credentials, environment, third-party service).
73
- - This is the SECOND breaker trip on the same failure signature — reflection already had its shot; the hook hard-locks and the human decides.
74
-
75
- **"I am not capable of fixing this" is NOT an escalation reason** — that conclusion is usually the tunnel still talking; zoom out further instead. **"This requires a choice only you can make"** is.
76
-
77
- ## 6. Escalation Format (only when genuinely needed)
78
- Hand the human a **decision**, not a plea:
79
-
80
- > "Goal: [...]. I falsified paths X, Y, Z — verified facts: [...].
81
- > The real blocker is a [requirement conflict / architecture trade-off / destructive step / access gap], which is your call, not mine.
82
- > Option A: [...] (trade-off: ...). Option B: [...] (trade-off: ...).
83
- > I recommend A because [...]. Which direction do you choose?"
84
-
85
- Banned: "I have tried everything and failed, please help." That reports incapability, not a decision.
86
-
87
- ## 7. Recovery
88
- - **Self-recovery path**: a valid report ending in `RESUME` releases the breaker — reload the appropriate execution mode (`tdd`, `fable-mode`) and execute the new diagnosis. If the SAME failure signature accumulates 3 more failures, the breaker hard-locks and the decision goes to the human.
89
- - **Human path**: after the human answers an `ESCALATE`, or clears a hard lock (`npm run harness:reset` in their own terminal, or a new session / `/clear`), continue under their direction.
90
- - Either way, once the problem is ultimately cracked, feed the insight to `self-evolve`.
1
+ ---
2
+ name: zoom-out
3
+ description: Reflect-first circuit breaker - rebuild the full picture and fact-check assumptions when stuck; escalate to the human only for genuine decisions.
4
+ author: Miya Daniel | Harness Core Team
5
+ version: 0.2.0
6
+ ---
7
+
8
+ # Zoom Out (Global Perspective & Circuit Breaker)
9
+
10
+ ## 📋 Skill Contract
11
+
12
+ | Component | Specification |
13
+ | :--- | :--- |
14
+ | **Trigger / Input** | Terminal script failures 3 times in a row, or getting stuck in an infinite loop. Input: Error logs. |
15
+ | **Expected Output** | Reflection report written to disk. Terminal commands MUST STOP until the report is completed. |
16
+ | **State Mutations** | MUST write `zoom-out-report.md` at the exact path the Rule of 3 breaker message gives you (session-scoped under `.claude/harness-state/sessions/<id>/`). |
17
+ | **Enforcement Gate** | The `rule-of-3.js` script (if run via Hook or CLI) will block all other `Write` or `Edit` actions until that `zoom-out-report.md` exists and is formatted correctly. |
18
+
19
+ This skill is the **Ultimate Circuit Breaker** in the Harness system.
20
+ It MUST be forcefully triggered when the Agent falls into logic blind spots, invalid retries, or hits the Reasoning Ceiling.
21
+
22
+ Its purpose is **NOT** to hand the problem to the human. The most common fatal flaw when stuck is failing to step back and rebuild a complete overview of the problem — three failures in a row almost always share one unverified assumption. This skill forces that step. The Human Partner is interrupted only when there is a genuine **decision** that belongs to them, never as a substitute for reflection you have not done yet.
23
+
24
+ > **Platform note**: only Claude Code enforces this breaker physically (hooks lock mutating tools; a valid report releases them). On advisory-only platforms (Cursor, Copilot, Gemini CLI, Codex CLI...) nothing will stop you — the protocol is identical and **self-enforced**: stop at 3 failures, run Phases 1-4 exactly as written, and still write the report file as the reflection artifact.
25
+
26
+ ## 1. Triggers
27
+ - **Rule of 3 (Micro-error looping)**: This is the most common fatal flaw of AI. If attempting to fix the same error, same test failure, or same logic fails 3 times consecutively, or if constantly making minor invalid changes in the same place (e.g., repeatedly changing variable names or adding console.log but it's still broken).
28
+ - **Divergence Phenomenon**: Fixing one Bug leads to 2 new Bugs, and fixing those triggers even more errors.
29
+ - **Attention Loss**: You realize you have forgotten the initial task goal, or the files being modified deviate too far from the original goal.
30
+ - **Human Intervention**: The user explicitly instructs "zoom out", "step back and look", or "stop and think".
31
+
32
+ ## 2. Phase 1 — Cease Fire
33
+ - **ABSOLUTELY PROHIBITED** from proposing any new code modification suggestions.
34
+ - **ABSOLUTELY PROHIBITED** from saying "I understand, I will fix it using the following method..." — that sentence is the tunnel talking.
35
+ - **Do NOT message the Human Partner yet.** "I failed 3 times" is not yet a report worth their time; reflection comes first.
36
+
37
+ ## 3. Phase 2 — Rebuild the Full Picture (Reflect & Fact-Check)
38
+ Use **READ-ONLY tools** (Read / Grep / Glob) — they remain available while the breaker is locked. No guessing in this phase; only evidence.
39
+
40
+ 1. **Restate the original goal** — from the task / todo list, not from your memory of the current rabbit hole. Ask: does the thing I have been fighting even matter to this goal?
41
+ 2. **List each failed attempt and extract the assumption behind it.** Every fix attempt encoded a belief about the system; name each belief explicitly.
42
+ 3. **Fact-check every assumption against reality.** Open the actual file, the actual log, the actual config, the actual upstream data, the actual docs. Replace every "it should be" with "I looked, and it is".
43
+ 4. **Raise the altitude.** Is this even the right layer? Is the module doing what the architecture intends? Did upstream pass wrong data? Is this a framework limitation? Do two requirements contradict each other?
44
+ 5. **Form a fresh diagnosis** that explains **ALL** observed evidence — including why all previous attempts failed — not just the latest error message.
45
+
46
+ ## 4. Phase 3 — Write the Reflection Report
47
+ Write your findings to the exact `zoom-out-report.md` path printed in the Rule of 3 block message — the ONLY write permitted while the breaker is locked. (If the file already exists from an earlier cycle, Read it first so you do not re-propose an already-falsified diagnosis.) Required sections:
48
+
49
+ ```markdown
50
+ ## Goal
51
+ <the original task goal, restated from source>
52
+ ## Failed Attempts
53
+ <attempt → the assumption it relied on → why it was wrong>
54
+ ## Verified Facts
55
+ <only things you actually re-checked in Phase 2, each with where you looked>
56
+ ## Diagnosis
57
+ <the fresh root-cause explanation covering all evidence>
58
+ ## Decision
59
+ RESUME: <the new approach> — or — ESCALATE: <the decision the human must make>
60
+ ```
61
+
62
+ A valid report automatically releases the circuit breaker. This is not paperwork — the hook checks it precisely because writing it honestly IS the reflection.
63
+
64
+ ## 5. Phase 4 — Decision Gate: Resume or Escalate
65
+
66
+ **RESUME (the default and expected outcome)** when the fresh diagnosis yields a genuinely NEW path — a different layer, different root cause, or different approach, not a variation of the attempts that already failed — and it is within your existing authority and task scope. Self-recovery is what zoom-out is for.
67
+
68
+ **ESCALATE only when the blocker is a decision that belongs to a human**, such as:
69
+ - Requirements contradict each other, or the goal itself is ambiguous.
70
+ - The fix requires an architecture / scope trade-off the human has not sanctioned (rewriting a module, changing a public API, dropping a requirement).
71
+ - The path forward is destructive or irreversible (data migration, force push, deleting user data).
72
+ - You lack access only the human can grant (credentials, environment, third-party service).
73
+ - This is the SECOND breaker trip on the same failure signature — reflection already had its shot; the hook hard-locks and the human decides.
74
+
75
+ **"I am not capable of fixing this" is NOT an escalation reason** — that conclusion is usually the tunnel still talking; zoom out further instead. **"This requires a choice only you can make"** is.
76
+
77
+ ## 6. Escalation Format (only when genuinely needed)
78
+ Hand the human a **decision**, not a plea:
79
+
80
+ > "Goal: [...]. I falsified paths X, Y, Z — verified facts: [...].
81
+ > The real blocker is a [requirement conflict / architecture trade-off / destructive step / access gap], which is your call, not mine.
82
+ > Option A: [...] (trade-off: ...). Option B: [...] (trade-off: ...).
83
+ > I recommend A because [...]. Which direction do you choose?"
84
+
85
+ Banned: "I have tried everything and failed, please help." That reports incapability, not a decision.
86
+
87
+ ## 7. Recovery
88
+ - **Self-recovery path**: a valid report ending in `RESUME` releases the breaker — reload the appropriate execution mode (`tdd`, `fable-mode`) and execute the new diagnosis. If the SAME failure signature accumulates 3 more failures, the breaker hard-locks and the decision goes to the human.
89
+ - **Human path**: after the human answers an `ESCALATE`, or clears a hard lock (`npm run harness:reset` in their own terminal, or a new session / `/clear`), continue under their direction.
90
+ - Either way, once the problem is ultimately cracked, feed the insight to `self-evolve`.