openhermes 2.8.0 → 4.0.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.
Files changed (158) hide show
  1. package/CONTEXT.md +18 -0
  2. package/ETHOS.md +15 -0
  3. package/README.md +135 -292
  4. package/bootstrap.mjs +174 -512
  5. package/harness/agents/openhermes.md +87 -0
  6. package/harness/codex/CONSTITUTION.md +70 -148
  7. package/harness/codex/ROUTING.md +126 -0
  8. package/harness/commands/oh-doctor.md +26 -0
  9. package/harness/instructions/CONVENTIONS.md +206 -206
  10. package/harness/instructions/RUNTIME.md +54 -31
  11. package/harness/skills/oh-builder/SKILL.md +98 -0
  12. package/harness/skills/oh-caveman/SKILL.md +33 -0
  13. package/harness/skills/oh-expert/SKILL.md +121 -0
  14. package/harness/skills/oh-freeze/SKILL.md +28 -0
  15. package/harness/skills/oh-gauntlet/SKILL.md +119 -0
  16. package/harness/skills/oh-grill/SKILL.md +77 -0
  17. package/harness/skills/oh-guard/SKILL.md +33 -0
  18. package/harness/skills/oh-handoff/SKILL.md +33 -0
  19. package/harness/skills/oh-health/SKILL.md +90 -0
  20. package/harness/skills/oh-init/SKILL.md +78 -0
  21. package/harness/skills/oh-investigate/SKILL.md +35 -0
  22. package/harness/skills/oh-issue/SKILL.md +36 -0
  23. package/harness/skills/oh-learn/SKILL.md +28 -0
  24. package/harness/skills/oh-manifest/SKILL.md +84 -0
  25. package/harness/skills/oh-plan-review/SKILL.md +128 -0
  26. package/harness/skills/oh-planner/SKILL.md +159 -0
  27. package/harness/skills/oh-prd/SKILL.md +35 -0
  28. package/harness/skills/oh-retro/SKILL.md +33 -0
  29. package/harness/skills/oh-review/SKILL.md +110 -0
  30. package/harness/skills/oh-security/SKILL.md +110 -0
  31. package/harness/skills/oh-ship/SKILL.md +39 -0
  32. package/harness/skills/oh-skill-craft/SKILL.md +107 -0
  33. package/harness/skills/oh-skills-link/SKILL.md +29 -0
  34. package/harness/skills/oh-skills-list/SKILL.md +31 -0
  35. package/harness/skills/oh-triage/SKILL.md +36 -0
  36. package/index.mjs +3 -60
  37. package/lib/harness-resolver.mjs +77 -0
  38. package/lib/logger.mjs +62 -0
  39. package/package.json +49 -53
  40. package/test/plugins-behavioral.test.mjs +64 -0
  41. package/test/plugins.test.mjs +62 -0
  42. package/autorecall.mjs +0 -237
  43. package/curator.mjs +0 -482
  44. package/harness/commands/build-fix.md +0 -60
  45. package/harness/commands/checkpoint.md +0 -68
  46. package/harness/commands/code-review.md +0 -71
  47. package/harness/commands/doctor.md +0 -42
  48. package/harness/commands/eval.md +0 -89
  49. package/harness/commands/go-build.md +0 -87
  50. package/harness/commands/go-review.md +0 -71
  51. package/harness/commands/harness-audit.md +0 -90
  52. package/harness/commands/learn.md +0 -37
  53. package/harness/commands/loop-start.md +0 -38
  54. package/harness/commands/loop-status.md +0 -30
  55. package/harness/commands/memory-search.md +0 -37
  56. package/harness/commands/model-route.md +0 -32
  57. package/harness/commands/ohc.md +0 -13
  58. package/harness/commands/orchestrate.md +0 -88
  59. package/harness/commands/plan.md +0 -53
  60. package/harness/commands/quality-gate.md +0 -35
  61. package/harness/commands/refactor-clean.md +0 -102
  62. package/harness/commands/rust-build.md +0 -78
  63. package/harness/commands/rust-review.md +0 -65
  64. package/harness/commands/security.md +0 -93
  65. package/harness/commands/setup-pm.md +0 -65
  66. package/harness/commands/skill-create.md +0 -99
  67. package/harness/commands/test-coverage.md +0 -80
  68. package/harness/commands/update-codemaps.md +0 -81
  69. package/harness/commands/update-docs.md +0 -67
  70. package/harness/commands/verify.md +0 -68
  71. package/harness/prompts/architect.txt +0 -189
  72. package/harness/prompts/build-cpp.md +0 -98
  73. package/harness/prompts/build-error-resolver.md +0 -44
  74. package/harness/prompts/build-go.md +0 -340
  75. package/harness/prompts/build-java.md +0 -140
  76. package/harness/prompts/build-kotlin.md +0 -137
  77. package/harness/prompts/build-rust.md +0 -108
  78. package/harness/prompts/code-reviewer.md +0 -40
  79. package/harness/prompts/doc-updater.md +0 -206
  80. package/harness/prompts/docs-lookup.md +0 -71
  81. package/harness/prompts/e2e-runner.txt +0 -317
  82. package/harness/prompts/explore.md +0 -42
  83. package/harness/prompts/harness-optimizer.md +0 -42
  84. package/harness/prompts/loop-operator.md +0 -53
  85. package/harness/prompts/planner.md +0 -37
  86. package/harness/prompts/refactor-cleaner.md +0 -256
  87. package/harness/prompts/review-cpp.md +0 -81
  88. package/harness/prompts/review-database.md +0 -261
  89. package/harness/prompts/review-go.md +0 -257
  90. package/harness/prompts/review-java.md +0 -113
  91. package/harness/prompts/review-kotlin.md +0 -143
  92. package/harness/prompts/review-python.md +0 -101
  93. package/harness/prompts/review-rust.md +0 -77
  94. package/harness/prompts/security-reviewer.md +0 -42
  95. package/harness/prompts/tdd-guide.md +0 -228
  96. package/harness/rules/audit.md +0 -84
  97. package/harness/rules/checkpointing.md +0 -75
  98. package/harness/rules/context-loading.md +0 -33
  99. package/harness/rules/credential-exposure.md +0 -0
  100. package/harness/rules/delegation.md +0 -80
  101. package/harness/rules/handoff.md +0 -267
  102. package/harness/rules/memory-management.md +0 -28
  103. package/harness/rules/precedence.md +0 -52
  104. package/harness/rules/promotion.md +0 -46
  105. package/harness/rules/ranking.md +0 -64
  106. package/harness/rules/retrieval.md +0 -94
  107. package/harness/rules/runtime-guards.md +0 -196
  108. package/harness/rules/self-heal.md +0 -79
  109. package/harness/rules/session-start.md +0 -34
  110. package/harness/rules/skills-management.md +0 -165
  111. package/harness/rules/state-drift.md +0 -192
  112. package/harness/rules/verification.md +0 -88
  113. package/harness/scripts/sync-commands.mjs +0 -259
  114. package/harness/skills/.bundled_manifest +0 -17
  115. package/harness/skills/.usage.json +0 -6
  116. package/harness/skills/api-design/SKILL.md +0 -523
  117. package/harness/skills/backend-patterns/SKILL.md +0 -598
  118. package/harness/skills/coding-standards/SKILL.md +0 -549
  119. package/harness/skills/e2e-testing/SKILL.md +0 -326
  120. package/harness/skills/frontend-patterns/SKILL.md +0 -642
  121. package/harness/skills/frontend-slides/SKILL.md +0 -184
  122. package/harness/skills/security-review/SKILL.md +0 -495
  123. package/harness/skills/strategic-compact/SKILL.md +0 -131
  124. package/harness/skills/tdd-workflow/SKILL.md +0 -463
  125. package/harness/skills/verification-loop/SKILL.md +0 -126
  126. package/lib/ambient-memory.mjs +0 -167
  127. package/lib/handoff.mjs +0 -171
  128. package/lib/hardening.mjs +0 -146
  129. package/lib/memory-tools-plugin.mjs +0 -368
  130. package/lib/ohc/block-sync.mjs +0 -69
  131. package/lib/ohc/compress/search.mjs +0 -152
  132. package/lib/ohc/compress/state.mjs +0 -76
  133. package/lib/ohc/config.mjs +0 -185
  134. package/lib/ohc/message-ids.mjs +0 -178
  135. package/lib/ohc/notify.mjs +0 -135
  136. package/lib/ohc/protected-patterns.mjs +0 -55
  137. package/lib/ohc/prune-apply.mjs +0 -134
  138. package/lib/ohc/pruner.mjs +0 -608
  139. package/lib/ohc/reaper.mjs +0 -70
  140. package/lib/ohc/state.mjs +0 -265
  141. package/lib/ohc/strategies/deduplication.mjs +0 -72
  142. package/lib/ohc/strategies/index.mjs +0 -2
  143. package/lib/ohc/strategies/purge-errors.mjs +0 -43
  144. package/lib/ohc/token-utils.mjs +0 -26
  145. package/lib/ohc/updater.mjs +0 -132
  146. package/lib/paths.mjs +0 -49
  147. package/lib/schema-validator.mjs +0 -79
  148. package/lib/search.mjs +0 -48
  149. package/schemas/audit.schema.json +0 -82
  150. package/schemas/backlog.schema.json +0 -63
  151. package/schemas/checkpoint.schema.json +0 -65
  152. package/schemas/constraint.schema.json +0 -62
  153. package/schemas/decision.schema.json +0 -63
  154. package/schemas/instinct.schema.json +0 -63
  155. package/schemas/loop-state.schema.json +0 -33
  156. package/schemas/mistake.schema.json +0 -64
  157. package/schemas/verification_receipt.schema.json +0 -88
  158. package/skill-builder.mjs +0 -88
package/CONTEXT.md ADDED
@@ -0,0 +1,18 @@
1
+ # OpenHermes — Shared Language
2
+
3
+ ## Terms
4
+ **OpenHermes** — OpenCode-native orchestration layer for this package.
5
+ **Skill** — A `SKILL.md` loaded on demand through OpenCode's skill tool.
6
+ **Command** — A slash command backed by package-local markdown in `harness/commands/`.
7
+ **Agent** — A primary or subagent definition loaded through OpenCode config.
8
+ **Instruction** — Markdown loaded through `AGENTS.md` or `opencode.json` instructions.
9
+ **Bootstrap** — The first-message context injected by the OpenHermes plugin.
10
+
11
+ ## Relationships
12
+ - OpenHermes contains many Skills, Commands, Agents, and Instructions.
13
+ - Skills are invoked on demand.
14
+ - Commands are entry points.
15
+ - OpenHermes is the default primary Agent.
16
+
17
+ ## Flagged Ambiguities
18
+ - Durable state is deferred for now and not a domain term for this pass.
package/ETHOS.md ADDED
@@ -0,0 +1,15 @@
1
+ # OpenHermes Ethos
2
+
3
+ Four immutable principles. Every skill, every command, every session.
4
+
5
+ ## Native First
6
+ OpenCode-native loading over manual copying or hidden state.
7
+
8
+ ## Small Surface
9
+ Every file earns its keep. Prefer markdown when behavior is declarative.
10
+
11
+ ## Skills Over Glue
12
+ Behavior lives in `SKILL.md`, `commands/*.md`, and `agents/*.md`.
13
+
14
+ ## Delegate Hard Work
15
+ Subagents for substantive work. Main context orchestrates and verifies.
package/README.md CHANGED
@@ -1,292 +1,135 @@
1
- <p align="center">
2
- <h1 align="center">&#9764; OpenHermes</h1>
3
- <p align="center"><i>The Constitutional Router for <a href="https://opencode.ai">OpenCode</a></i></p>
4
- </p>
5
-
6
- <p align="center">
7
- <a href="https://www.npmjs.com/package/openhermes"><img src="https://img.shields.io/npm/v/openhermes?style=for-the-badge&label=version&color=FFD700" alt="npm version"></a>
8
- <a href="https://github.com/nathwn12/openhermes/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="License: MIT"></a>
9
- <a href="https://opencode.ai"><img src="https://img.shields.io/badge/runs%20on-OpenCode-6366f1?style=for-the-badge" alt="Runs on OpenCode"></a>
10
- <a href="https://github.com/nathwn12/openhermes/issues"><img src="https://img.shields.io/badge/issues-welcome-orange?style=for-the-badge" alt="Issues welcome"></a>
11
- </p>
12
-
13
- ---
14
-
15
- ```json
16
- { "plugin": ["openhermes"] }
17
- ```
18
-
19
- **One line. Your agent gains a personality, memory, 25 specialist subagents, 28 commands, structured handoff protocol, and the discipline to self-improve.**
20
-
21
- No Python. No Docker. No cron. No database. Just Node.js and your existing OpenCode runtime.
22
-
23
- ---
24
-
25
- ## What OpenHermes Does For Your Agent
26
-
27
- <table>
28
- <tr><td width="180"><b>&#129302; Constitutional Spine</b></td><td>A 14-principle constitution (<code>CONSTITUTION.md</code>) injected into every session — pragmatic, concise, subagent-first, verify-don't-claim, adaptive. Your agent stops rambling and starts delivering.</td></tr>
29
- <tr><td><b>&#128204; Structured Handoff Protocol</b></td><td>Every agent knows its permission tier and handoff triggers. Review agents never edit. Builders never approve their own work. Security reports only. Tasks are complexity-graded (easy → very-large) and routed to the right specialist automatically.</td></tr>
30
- <tr><td><b>&#128190; 9-Class Durable Memory</b></td><td>Checkpoints, decisions, constraints, instincts, mistakes, backlog items, audit reports, verification receipts, and session recall all schema-validated, fingerprint-aware, persisted to disk. Retrieval is gated and precision-first.</td></tr>
31
- <tr><td><b>&#128260; Closed Learning Loop</b></td><td>Mistakes are logged with root cause + prevention rule. Complex sessions auto-generate skill-candidate backlogs. Strike tracking escalates repeat failures into structural fixes. The agent gets better you don't teach it twice.</td></tr>
32
- <tr><td><b>&#128736; 10 Bundled Procedural Skills</b></td><td>Pre-built skills for API design, backend patterns, coding standards, E2E testing, frontend patterns, frontend slides, security reviews, strategic compaction, TDD workflow, and verification loops. Auto-discovered use <code>skill</code> to list and load.</td></tr>
33
- <tr><td><b>&#128270; Context Pruner</b></td><td>Agent-controlled compression via <code>ohc.json</code> + <code>compress</code> tool. Progressive nudges at 70/85/95%. No token claims reports message count only.</td></tr>
34
- <tr><td><b>&#129513; Zero Infrastructure</b></td><td>No Python. No uv. No Docker. No PostgreSQL. No gateway. No cron daemon. No MCP server. Just Node.js and your existing OpenCode runtime.</td></tr>
35
- </table>
36
-
37
- ---
38
-
39
- ## Agent Handoff Protocol
40
-
41
- The reason most agent sessions descend into chaos: every agent thinks it can do everything. OpenHermes fixes that with a **structured handoff system** baked into every subagent prompt.
42
-
43
- **Coverage:** All 25 subagents now include standard Permissions and Handoff sections. Each agent knows its tier (1/2/3), what actions it can take, when to delegate, and how to format a handoff request.
44
-
45
- **Complexity-gated routing:**
46
-
47
- | Level | Criteria | Strategy |
48
- |-------|----------|----------|
49
- | **Easy** | 1-2 files, well-known pattern, single change | Handle directly |
50
- | **Medium** | 3-10 files, new feature, needs exploration | 2-5 subagents, sequential or fan-out |
51
- | **Hard** | 10+ files, cross-cutting change | Sequential: planner executor → reviewers |
52
- | **Very Large** | 50+ files, massive refactor | Fan-out: split into chunks, parallel, consolidate |
53
-
54
- **Permission tiers:**
55
-
56
- | Tier | Agents | Can edit? | Can exec? | Can review? |
57
- |------|--------|-----------|-----------|-------------|
58
- | 1 | planners, architects, reviewers, explore | ❌ | ❌ | ✅ |
59
- | 2 | builders, doc-updaters, refactor-cleaners | | | (own work) |
60
- | 3 | primary agent, loop-operator, e2e-runner | | | |
61
-
62
- **Built library** `lib/handoff.mjs` (136 lines, 5 exports): `handoffRequest`, `parseHandoffResult`, `assessComplexity`, `suggestAgent`, `canAgent`. Simple enough to audit. Sophisticated enough to govern 25 agents.
63
-
64
- ---
65
-
66
- ## Setup
67
-
68
- Add one line to your `opencode.json`:
69
-
70
- ### Published Release (stable)
71
- ```json
72
- { "plugin": ["openhermes"] }
73
- ```
74
-
75
- ### Git-Backed (latest pushed changes)
76
- ```json
77
- { "plugin": ["openhermes@git+https://github.com/nathwn12/openhermes.git"] }
78
- ```
79
-
80
- Either way, **no other config needed.** The plugin auto-registers:
81
-
82
- | What | Details |
83
- |------|---------|
84
- | **25 subagents** | 7 core (architect, planner, build-error-resolver, code-reviewer, security-reviewer, e2e-runner, explore) + 18 specialist (tdd-guide, docs-lookup, doc-updater, refactor-cleaner, loop-operator, harness-optimizer, 9 language-specific build/review pairs, review-database) |
85
- | **28 slash commands** | `/build-fix`, `/checkpoint`, `/code-review`, `/doctor`, `/eval`, `/go-build`, `/go-review`, `/harness-audit`, `/learn`, `/loop-start`, `/loop-status`, `/memory-search`, `/model-route`, `/ohc`, `/orchestrate`, `/plan`, `/quality-gate`, `/refactor-clean`, `/rust-build`, `/rust-review`, `/security`, `/setup-pm`, `/skill-create`, `/test-coverage`, `/update-codemaps`, `/update-docs`, `/update-me`, `/verify` |
86
- | **6 native memory tools** | `ohc_save`, `ohc_get`, `ohc_list`, `ohc_latest`, `ohc_search`, `ohc_archive` — in-process, no MCP server |
87
- | **10 procedural skills** | API design, backend patterns, coding standards, E2E testing, frontend patterns, frontend slides, security review, strategic compaction, TDD workflow, verification loop |
88
- | **6 lifecycle plugins** | bootstrap, curator, autorecall, skill-builder, memory-tools, ohc |
89
-
90
- > **&#128260; Force update:** Run `/update-me` anytime to clear stale cache and reload from source. Works with both git-backed and npm installs.
91
-
92
- <details>
93
- <summary><b>What happens on your next session</b></summary>
94
-
95
- 1. **Config hook**BootstrapPlugin registers 25 subagents, 28 commands, 10 skill paths
96
- 2. **Chat transform** — Constitution + Runtime + Router injected into first user message
97
- 3. **Session created** — AutorecallPlugin builds recall cache from prior session memory
98
- 4. **Tools execute** SkillBuilderPlugin watches calls; MemoryToolsPlugin provides 6 native tools immediately
99
- 5. **Session idle** CuratorPlugin snapshots checkpoint + verification receipt
100
- 6. **Session error** — CuratorPlugin logs mistake with root cause + prevention rule
101
- 7. **Compaction** — CuratorPlugin force-writes pre-compaction checkpoint and injects state into compaction buffer
102
-
103
- No polling. No cron. Six plugins, 20+ hooks, one runtime.
104
- </details>
105
-
106
- ---
107
-
108
- ## Memory Architecture
109
-
110
- Nine schema-validated classes. All scrubbed of proto-poison, secrets, and overflow before hitting disk.
111
-
112
- | Class | Format | Layer | Purpose |
113
- |-------|--------|-------|---------|
114
- | `checkpoint` | JSON | 🧠 State | Pre-compaction snapshots: mission, state, next actions, blockers |
115
- | `constraint` | JSON | 🧠 State | Hard limits, env realities, safety rules |
116
- | `decision` | JSON | 🧠 State | Durable project choices shaping all future behavior |
117
- | `instinct` | JSON | 📈 Learning | Reusable trigger→action patterns with hit tracking |
118
- | `backlog` | JSON | 📈 Learning | Evidence-backed self-improvement items with acceptance criteria |
119
- | `mistake` | JSONL | 📈 Learning | Failure registry: type, root cause, fix, prevention, strike count |
120
- | `audit` | JSON | ✅ Integrity | Structured quality evaluations with health scores |
121
- | `verification_receipt` | JSON | ✅ Integrity | Cached verification results keyed by artifact fingerprint |
122
- | `recall` | JSON | ✅ Integrity | Session-start cache for compaction buffer injection |
123
-
124
- **Storage:** `~/.local/share/opencode/openhermes/` for durable memory, `~/.cache/opencode/openhermes/recall/` for derived cache, `~/.config/opencode/ohc.json` for pruner config.
125
-
126
- **Retrieval ladder:** `ohc_latest` → `ohc_search` → `ohc_get` → `ohc_list`. Anti-spam: no obvious facts, no one-off prefs, no low-risk mistakes. Memory stays lean or it gets archived.
127
-
128
- **Hardening:** Every record is sanitized, redacted, truncated, and validated before write. Proto-poison (`__proto__`, `constructor`, `prototype`) stripped. Bearer tokens / API keys / passwords redacted. Fields capped by schema limits.
129
-
130
- ---
131
-
132
- ## Self-Healing Escalation
133
-
134
- A mistake is not a failure it's a signal. OpenHermes escalates through four tiers before it ever reaches you.
135
-
136
- ```
137
- T0 ── Any mistake
138
- Observe → log mistake record → smallest safe correction → verify
139
-
140
- T1 ── Same mistake repeats within 7 days
141
- Add prevention rule → targeted verification
142
-
143
- T2 ── Prevention failed / systemic issue
144
- Delegate to specialist → deep audit → backlog item → structural fix
145
-
146
- T3 ── Cascading failures
147
- Constrained safe mode: narrow claims, preserve receipts, produce handoff
148
- ```
149
-
150
- No self-termination. No grandstanding. The agent gets better — you don't teach it twice.
151
-
152
- ---
153
-
154
- ## Session Lifecycle
155
-
156
- Three phases. Six plugins coordinate across 20+ OpenCode hooks.
157
-
158
- ```
159
- ▶️ Warmup
160
- config hook BootstrapPlugin registers harness/skills/, skills auto-discover
161
- session.created BootstrapPlugin injects constitution → router → runtime
162
- AutorecallPlugin loads disk memory → writes recall cache
163
- SkillBuilderPlugin resets counters
164
-
165
- ⚙️ Execution
166
- tool.execute.* SkillBuilderPlugin counts calls + spawns
167
-
168
- ⏹️ Cooldown
169
- session.idle CuratorPlugin: checkpoint snapshot + verification receipt
170
- SkillBuilderPlugin: complexity check → backlog candidate
171
- session.compacting CuratorPlugin: force-writes pre-compaction checkpoint
172
- Injects harness state + recall context → compaction buffer
173
- session.compacted CuratorPlugin: updates loop-state to "compacted"
174
- session.error CuratorPlugin: logs mistake (type, root cause, fix, prevention)
175
- permission.replied CuratorPlugin: writes audit record for every permission decision
176
- ```
177
-
178
- ---
179
-
180
- ## Verification Discipline
181
-
182
- One core habit — **verify before claiming success.**
183
-
184
- | Rule | Why |
185
- |------|-----|
186
- | 🕵️ Read before editing | Don't fix what you haven't seen |
187
- | 🧪 Run before announcing | Don't claim what you haven't tested |
188
- | 🧬 Cache by fingerprint | Same file, same receipt — skip re-verify |
189
- | 🔄 Re-verify on change | Stale receipt is worse than no receipt |
190
- | 🚩 Flag contradictions | Silence is consent to bugs |
191
-
192
- Verification receipts are a first-class memory type — keyed by artifact identity + fingerprint (path, mtime, hash). This is not an afterthought. It's the difference between "I think it works" and "I know it works."
193
-
194
- ---
195
-
196
- ## Bundled Harness
197
-
198
- The full operational doctrine ships inside the package. Six directories, zero dependencies outside Node.js.
199
-
200
- | Directory | Contents | Purpose |
201
- |-----------|----------|---------|
202
- | `codex/` | `CONSTITUTION.md` — 14 immutable principles | Your agent's behavior, frozen per session |
203
- | `instructions/` | Runtime workflow + coding conventions | The playbook every session runs on |
204
- | `rules/` | 17 files: retrieval, verification, audit, self-heal, delegation, handoff | The legal framework — no ambiguity |
205
- | `skills/` | 10 procedural SKILL.md files | Domain expertise discovered automatically |
206
- | `prompts/` | 25 subagent prompt templates | Language specialists, docs lookup, loop drivers — all on tap |
207
- | `commands/` | 26 slash command templates | From `/verify` to `/review-go` — full toolbelt |
208
-
209
- OpenHermes is not a runtime shim. The doctrine ships with the package — every subagent and every command follows the same constitution, rules, and conventions.
210
-
211
- ---
212
-
213
- ## The Six Plugins
214
-
215
- | Plugin | Hook Points | Job |
216
- |--------|-------------|-----|
217
- | **Bootstrap** | `config`, `chat.transform` | Registers agents/commands/skills; injects constitution + router + runtime |
218
- | **MemoryTools** | (tool registration) | Provides 6 `ohc_*` tools — no MCP server, no network |
219
- | **Curator** | `session.idle`, `.error`, `.compacted`, `.compacting`, `permission.replied` | Snapshots state, logs mistakes, records decisions, injects into compaction |
220
- | **Autorecall** | `session.created` | Loads prior session memory into recall cache at startup |
221
- | **SkillBuilder** | `session.created`, `.idle`, `tool.execute.after` | Auto-detects complex sessions (8+ calls or 2+ spawns) → backlog candidates |
222
- | **OhcPlugin** | `config`, all transform/command hooks | Silent context pruner; injects budget; progressive nudges; `/ohc` command + `compress` tool |
223
-
224
- ---
225
-
226
- ## Architecture — Three Layers, One Dependency
227
-
228
- ```
229
- openhermes/
230
-
231
- ├── ⚡ index.mjs # Plugin exports (all 5)
232
- ├── ⚡ bootstrap.mjs # Config hook + chat.transform
233
- ├── ⚡ autorecall.mjs # Memory → recall cache
234
- ├── ⚡ curator.mjs # Lifecycle hooks engine
235
- ├── ⚡ skill-builder.mjs # Complexity detection
236
-
237
- ├── ⚡ lib/
238
- │ ├── memory-tools-plugin.mjs # 5 hm_* tools
239
- │ ├── handoff.mjs # Structured delegation protocol
240
- │ ├── hardening.mjs # sanitize, redact, atomic write
241
- │ ├── paths.mjs # storage root resolver
242
- │ ├── schema-validator.mjs # Draft-07 validation
243
- │ └── ohc/ # context pruner
244
-
245
- ├── ⚡ schemas/ # 9 Draft-07 memory schemas
246
-
247
- ├── 📦 harness/
248
- │ ├── codex/ # CONSTITUTION.md — 14 principles
249
- │ ├── instructions/ # runtime + conventions
250
- │ ├── rules/ # 17 files (handoff.md + 16 existing)
251
- │ ├── skills/ # 10 procedural skills
252
- │ ├── prompts/ # 25 subagent templates
253
- │ └── commands/ # 26 slash command templates
254
-
255
- └── 📦 package.json # one dependency: @opencode-ai/plugin
256
- ```
257
-
258
- **Dependency footprint:** `@opencode-ai/plugin` only. No postinstall scripts. No native compilation. No Docker. No Python. Your entire agent OS in a single `npm install`.
259
-
260
- ---
261
-
262
- ## Why OpenHermes ≠ Hermes Agent
263
-
264
- Same messenger emoji. Entirely different mediums.
265
-
266
- | | Hermes Agent | OpenHermes |
267
- |-|------------|------------|
268
- | Platform | Standalone agent — TUI + gateway + cron | OpenCode-native plugin — lives *inside* your editor |
269
- | Installation | Python 3.11 + uv + 30+ deps — 5-15 min | `npm i` — 3 seconds |
270
- | Infrastructure | Long-running gateway, cron daemon, 20 platform adapters, 7 terminal backends, SQLite+FTS5 | Zero sidecars — everything is a plugin hook |
271
- | Memory | MEMORY.md + USER.md files + optional Honcho | 9-class schema-validated, fingerprint-aware, in-process tools |
272
- | Skills | agentskills.io standard, auto-creation + self-improvement | SKILL.md progressive disclosure, auto-detected |
273
- | Subagents | N/A | 25 specialists with handoff protocol, permission tiers, phase management |
274
- | Philosophy | "The self-improving agent" — feature-rich, platform-expansive | **"The constitutional router"** — discipline-first, precision-only |
275
-
276
- Both are &#9764; messengers. Different mediums.
277
-
278
- ---
279
-
280
- ## Contributing
281
-
282
- Problems, ideas, improvements? [Open an issue](https://github.com/nathwn12/openhermes/issues). PRs welcome.
283
-
284
- ---
285
-
286
- ## License
287
-
288
- MIT — see [LICENSE](LICENSE). All credited inspirations are independent implementations — no code copied. ECC and Hermes Agent are MIT. DCP is AGPL-3.0 but shared concepts (compress, dedup, purge) are uncopyrightable ideas (17 U.S.C. § 102(b); *Computer Assocs. v. Altai*, 982 F.2d 693). AGPL copyleft requires copying or adapting the work (§ 0) — independent implementation does not trigger it.
289
-
290
- <p align="center">
291
- <sub><b>&#9764;</b> Built with discipline. Inspired by <a href="https://github.com/NousResearch/hermes-agent">Hermes Agent</a> (MIT), <a href="https://github.com/affaan-m/everything-claude-code">ECC</a> (MIT), and <a href="https://github.com/Opencode-DCP/opencode-dynamic-context-pruning">DCP</a> (AGPL-3.0). Built for <a href="https://opencode.ai">OpenCode</a>.</sub>
292
- </p>
1
+ <p align="center">
2
+ <h1 align="center">&#9764; OpenHermes</h1>
3
+ <p align="center"><i>Plan. Build. Ship. One plugin.</i></p>
4
+ </p>
5
+
6
+ <p align="center">
7
+ <a href="https://www.npmjs.com/package/openhermes"><img src="https://img.shields.io/npm/v/openhermes?style=for-the-badge&label=version&color=FFD700" alt="npm version"></a>
8
+ <a href="https://github.com/nathwn12/openhermes/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="License: MIT"></a>
9
+ <a href="https://opencode.ai"><img src="https://img.shields.io/badge/runs%20on-OpenCode-6366f1?style=for-the-badge" alt="Runs on OpenCode"></a>
10
+ </p>
11
+
12
+ ---
13
+
14
+ OpenHermes is an OpenCode plugin that gives your agent a complete skill system out of the box. Add one line to `opencode.json`, get 25 skills, a primary orchestrator, and a shared operating model.
15
+
16
+ ```json
17
+ { "plugin": ["openhermes@git+https://github.com/nathwn12/openhermes.git"] }
18
+ ```
19
+
20
+ No setup. No file copying. No extra dependencies.
21
+
22
+ ---
23
+
24
+ ## What you get
25
+
26
+ ### Seven core skills
27
+
28
+ | Skill | What it does |
29
+ |---|---|
30
+ | **oh-planner** | Brainstorm, analyze architecture, run strategy reviews, auto-decide 90% of questions with gstack decision principles. Produces a consumable plan artifact. |
31
+ | **oh-builder** | Prototype, TDD red-green-refactor, design interfaces in parallel sub-agents, implement from plan. Vertical tracer bullets, one test at a time. |
32
+ | **oh-manifest** | Full build loop: planner builder verify loop until done or a real blocker is surfaced. Auto-resolves intermediate questions; only interrupts you for genuine blockers. |
33
+ | **oh-gauntlet** | Multi-axis testing gauntlet: unit tests, dual-axis review (Standards + Spec in parallel sub-agents), edge case sweep, QA tier, canary post-deploy. |
34
+
35
+ These seven form a pipeline: **think → plan → build → test → ship → secure → monitor**. Each produces artifacts the next consumes.
36
+
37
+ ### Twenty-five skills total
38
+
39
+ | Skill | Purpose |
40
+ |---|---|
41
+ | oh-planner, oh-builder, oh-manifest, oh-gauntlet | Core pipeline (above) |
42
+ | oh-expert | AI self-diagnosis vocabulary — sycophancy, hallucination type, attention degradation |
43
+ | oh-grill | Stress-test plans through Socratic questioning; optionally updates CONTEXT.md, ADRs, and extracts ubiquitous language |
44
+ | oh-plan-review | Multi-lens plan review: Engineering, Design, DX, Strategy |
45
+ | oh-security | Security audit: secrets archaeology, supply chain, CI/CD, OWASP, STRIDE, LLM security |
46
+ | oh-health | Code quality dashboard: wraps tools, composite score, trend tracking |
47
+ | oh-investigate | Systematic bug diagnosis |
48
+ | oh-handoff | Compact session into structured handoff artifact for another agent |
49
+ | oh-skill-craft | Create new skills for the harness (meta-skill) |
50
+ | oh-init | Initialize project: scaffold CONTEXT.md, AGENTS.md, ADRs, issue tracker config, triage labels |
51
+ | oh-retro | Retrospective after shipping |
52
+ | oh-review | Two-axis review (Standards + Spec) in parallel sub-agents + architecture deepening |
53
+ | oh-ship | PR, version bump, changelog, post-ship docs sync |
54
+ | oh-triage | Issue triage state machine |
55
+ | oh-issue | Break plans into vertical-slice issues |
56
+ | oh-prd | Write structured PRDs |
57
+ | oh-caveman | Ultra-compressed response mode |
58
+ | oh-freeze | Freeze dependencies |
59
+ | oh-learn | Learn patterns from the codebase |
60
+ | oh-guard | Safety confirmations for destructive operations |
61
+ | oh-skills-link | Verify skills discovery |
62
+ | oh-skills-list | List available skills |
63
+
64
+ ### One orchestrator agent
65
+
66
+ OpenHermes is the default primary agent — a hub-and-spoke commander that delegates to skills, spawns sub-agents for isolated context, and surfaces blockers instead of silently retrying.
67
+
68
+ ### One diagnostic command
69
+
70
+ `/oh-doctor` inspect plugin load, skills discovery, command/agent registration, and config safety.
71
+
72
+ ---
73
+
74
+ ## How it works
75
+
76
+ OpenHermes loads through OpenCode's native plugin system. On install:
77
+
78
+ 1. `config.skills.paths` is pointed at the package-local `harness/skills/` — skills load on demand through the `skill` tool, no preloading
79
+ 2. Commands from `harness/commands/` register as slash commands
80
+ 3. The agent manifest in `harness/agents/` sets OpenHermes as the primary orchestrator
81
+ 4. Instructions from `CONSTITUTION.md`, `RUNTIME.md`, `CONTEXT.md`, and `ETHOS.md` are injected into every session
82
+
83
+ Everything is package-local. Nothing is copied into your global config.
84
+
85
+ ---
86
+
87
+ ## OptiRoute: Smart Auto-Routing Protocol
88
+
89
+ Every skill routes to the next based on outcome — pass, fail, or blocker. OptiRoute is a guard layer on top of that graph. Three rules:
90
+
91
+ **Loop guard.** Tracks routing depth. If the same skill is visited 3+ times in one chain, or 5+ hops pass without measurable progress (new artifact, changed target), routing stops. No infinite loops.
92
+
93
+ **Question gate.** Before each routing hop, the protocol checks whether the next skill's inputs are satisfied. If the task is underspecified or information is missing, it asks the user instead of routing into uncertainty.
94
+
95
+ **Auto-handoff.** When the loop guard triggers, it writes an OptiRoute report into `plan.md` the routing chain, the trigger threshold, current state, and the blocker. Then it surfaces the blocker and awaits direction.
96
+
97
+ ```md
98
+ OPTIROUTE STOP: 5-hop ceiling reached, no progress
99
+ Chain: planner grill planner builder gauntlet → planner
100
+ See .opencode/plan.md for full report
101
+ ```
102
+
103
+ No loops. No guessing. No silent death.
104
+
105
+ ---
106
+
107
+ ## Layout
108
+
109
+ ```
110
+ openhermes-pkg/
111
+ ├── AGENTS.md # Skill/command/agent inventory
112
+ ├── CONTEXT.md # Shared language
113
+ ├── ETHOS.md # Operating principles
114
+ ├── bootstrap.mjs # Plugin loader registers everything
115
+ ├── index.mjs # Package entrypoint
116
+ ├── harness/
117
+ │ ├── agents/ # Agent manifests (OpenHermes)
118
+ │ ├── codex/ # CONSTITUTION.md
119
+ │ ├── commands/ # Slash command manifests (/oh-doctor)
120
+ │ ├── instructions/ # RUNTIME.md, CONVENTIONS.md
121
+ │ └── skills/ # 25 skill SKILL.md files
122
+ └── test/
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Inspiration
128
+
129
+ OpenHermes merges high-signal patterns from:
130
+
131
+ - **superpowers** — skill loading model (config.skills.paths + bootstrap injection)
132
+ - **dictionary-of-ai-coding** — shared vocabulary for agent self-diagnosis
133
+ - **skills (mattpocock)** — TDD discipline, write-a-skill meta, design-an-interface parallel sub-agents, dual-axis review
134
+ - **gstack**preamble-tier seniority, artifact-chain pipeline, decision principles
135
+ - **opencode-orchestrator** — hub-and-spoke delegation, session pool discipline, pipelined verification