openhermes 4.11.2 → 4.12.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 (46) hide show
  1. package/CONTEXT.md +6 -6
  2. package/ETHOS.md +2 -2
  3. package/README.md +8 -8
  4. package/bootstrap.ts +131 -198
  5. package/harness/codex/AUTOPILOT.md +39 -27
  6. package/harness/codex/CHARTER.md +1 -1
  7. package/harness/lib/background/background.test.ts +24 -5
  8. package/harness/lib/background/manager.ts +9 -9
  9. package/harness/lib/composer/compose.test.ts +29 -18
  10. package/harness/lib/composer/fragments/02-delegation.md +5 -4
  11. package/harness/lib/composer/fragments/04-task-flow.md +43 -3
  12. package/harness/lib/composer/fragments/09-guardrails.md +25 -12
  13. package/harness/lib/guards/guard-config.ts +72 -0
  14. package/harness/lib/hooks/builtins/confidence-gate-hook.ts +9 -11
  15. package/harness/lib/hooks/builtins/delegation-depth-hook.ts +24 -5
  16. package/harness/lib/hooks/builtins/dynamic-route-hook.ts +99 -0
  17. package/harness/lib/hooks/builtins/error-recovery-hook.ts +7 -7
  18. package/harness/lib/hooks/builtins/memory-sync-hook.ts +2 -2
  19. package/harness/lib/hooks/builtins/next-route-hook.ts +24 -0
  20. package/harness/lib/hooks/builtins/plan-check-hook.ts +5 -5
  21. package/harness/lib/hooks/builtins/route-tracking-hook.ts +80 -26
  22. package/harness/lib/hooks/builtins/subagent-failure-hook.ts +93 -0
  23. package/harness/lib/hooks/hooks.test.ts +145 -69
  24. package/harness/lib/hooks/index.ts +12 -0
  25. package/harness/lib/hooks/registry.ts +3 -3
  26. package/harness/lib/hooks/types.ts +50 -2
  27. package/harness/lib/memory/memory-manager.ts +2 -2
  28. package/harness/lib/memory/memory.test.ts +0 -6
  29. package/harness/lib/memory/plan-store.ts +1 -21
  30. package/harness/lib/plans/plan-location.ts +134 -0
  31. package/harness/lib/routing/index.ts +21 -0
  32. package/harness/lib/routing/route-guidance.ts +147 -0
  33. package/harness/lib/routing/route-resolver.ts +58 -0
  34. package/harness/lib/routing/routing.test.ts +195 -0
  35. package/harness/lib/routing/skill-frontmatter.ts +125 -0
  36. package/harness/lib/routing/types.ts +52 -0
  37. package/harness/lib/sanity/checker.ts +45 -34
  38. package/harness/lib/sync/file-watcher.ts +26 -25
  39. package/harness/lib/sync/plan-sync.ts +22 -25
  40. package/harness/lib/sync/sync.test.ts +30 -4
  41. package/harness/skills/oh-fusion/DEEP.md +109 -86
  42. package/harness/skills/oh-fusion/SKILL.md +47 -33
  43. package/harness/skills/oh-manifest/SKILL.md +1 -0
  44. package/harness/skills/oh-review/DEEP.md +5 -3
  45. package/harness/skills/oh-review/SKILL.md +1 -0
  46. package/package.json +53 -55
@@ -1,10 +1,10 @@
1
1
  # oh-fusion — Deep Reference
2
2
 
3
- ## When to Use
4
-
5
- Use when a user wants to bring an external skill or capability into the OpenHermes harness as an OH-native skill.
6
-
7
- ## Phase 1: Discovery
3
+ ## When to Use
4
+
5
+ Use when a user wants to bring an external skill or capability into the OpenHermes harness as an OH-native skill.
6
+
7
+ ## Phase 1: Discovery
8
8
 
9
9
  | Source | Access |
10
10
  |--------|--------|
@@ -14,48 +14,63 @@ Use when a user wants to bring an external skill or capability into the OpenHerm
14
14
  | User path | Resolve and read |
15
15
  | Inline text | Capture raw |
16
16
 
17
- Confirm: content loaded, frontmatter present, no access restrictions. For multiple: all loaded.
18
-
19
- ## Phase 2: Analysis
20
-
21
- ### Depth Scoring
22
- | Metric | Assessment |
23
- |--------|-----------|
24
- | Lines | SKILL.md length |
25
- | Concrete rules | "must/never/always/banned" count |
26
- | Examples | Before/after or usage code blocks |
27
- | Anti-patterns | Explicit "don't" sections |
28
- | Workflow steps | Sequential, actionable steps |
29
- | Routing table | pass/fail/blocker defined |
30
-
31
- **Score:** High (70-100) = concrete + examples + routing. Medium (30-69) = some structure. Low (0-29) = vague, no rules.
32
-
33
- ### Overlap Detection
34
- Compare against existing `harness/skills/oh-*` skills. Overlap: none / partial (complementary) / complete (redundant).
35
-
36
- ### Convention Check
37
- - Clear description for triggering? Actionable instructions? Anti-patterns? Examples? Measurable outcomes? No time-sensitive refs? No platform assumptions?
38
-
39
- ### Report Template
40
- ```markdown
41
- **Depth:** <0-100> — <High/Medium/Low>
42
- **Overlap:** <existing skill> <none/partial/complete>
43
- **Verdict:** <keep / fuse / discard / ask>
44
- **Action:** <port directly / fuse with X / discard>
45
- ```
46
-
47
- ## Phase 3: Decision
48
-
49
- | Verdict | Action |
50
- |---------|--------|
51
- | Keep | High signal, no overlap. Port to `oh-<name>`. |
52
- | Fuse | Partial overlap with existing. Merge complementary DNA. |
53
- | Discard | Low signal or complete overlap. Surface reasoning. |
54
- | Ask | Ambiguous quality. Surface findings. |
55
-
56
- When in doubt: prefer fuse over keep, keep over discard if ANY unique signal.
57
-
58
- ## Phase 4: Adaptation
17
+ Confirm: content loaded, frontmatter present, no access restrictions. For multiple: all loaded.
18
+
19
+ ## Phase 2: Analysis
20
+
21
+ ### Required Lenses
22
+
23
+ Analyze every source through these lenses:
24
+
25
+ - **OH gaps** what OH does not currently cover, or covers weakly
26
+ - **OH wins** where OH already outperforms the source and should not regress
27
+ - **Missed patterns** reusable patterns the source surfaces that OH should absorb
28
+ - **Overlap target** the strongest existing `oh-*` candidate for merge, if any
29
+
30
+ ### Merge Rubric
31
+
32
+ Choose one verdict:
33
+
34
+ | Verdict | Use when |
35
+ |---------|----------|
36
+ | Merge | The source upgrades an existing OH capability more than it defines a new one |
37
+ | Standalone | The source adds a distinct capability with its own trigger, workflow, and routing needs |
38
+ | Discard | The source is redundant, weak, or anti-native |
39
+
40
+ ### Strength Check
41
+
42
+ Reject or rewrite any protocol that makes OH weaker, slower, noisier, or less OpenCode-native.
43
+
44
+ ### Fusion Report Template
45
+ ```markdown
46
+ ## OH gaps
47
+ - ...
48
+
49
+ ## OH wins
50
+ - ...
51
+
52
+ ## Missed patterns
53
+ - ...
54
+
55
+ ## Merge verdict
56
+ - Verdict: <merge | standalone | discard>
57
+ - Target: <existing oh-* or new oh-*>
58
+ - Why: <short rationale>
59
+
60
+ ## Action plan
61
+ 1. ...
62
+ 2. ...
63
+
64
+ ## Approval gate
65
+ - Status: pending approval
66
+ - Next move after approval: <skill/action>
67
+ ```
68
+
69
+ ## Phase 3: Decision
70
+
71
+ Default to `merge` when the source sharpens an existing OH workflow. Default to `standalone` only when the capability stays clean, distinct, and reusable after removing overlap.
72
+
73
+ ## Phase 4: Adaptation
59
74
 
60
75
  ### Frontmatter
61
76
  ```yaml
@@ -64,29 +79,34 @@ description: "Adapted from <source>. Core function. Use when ..."
64
79
  tier: <2|3|4>
65
80
  ```
66
81
 
67
- ### Body Structure
68
- 1. **Summary** — one-paragraph of what the skill does
69
- 2. **When to Use** — clear triggering context
70
- 3. **Workflow** — numbered steps (the core)
71
- 4. **Anti-patterns** — what NOT to do
72
- 5. **Routing** — pass/fail/blocker table
73
-
74
- ### Adaptation Rules
75
- - Remove emojis. Replace ecosystem terms with OH equivalents.
76
- - Convert relative paths to OH harness conventions.
77
- - Add routing table based on the skill's purpose.
78
- - Keep all concrete rules, examples, and anti-patterns from the original.
79
- - Discard fluff, philosophy, and motivational language.
80
- - Preserve the original's unique signal — that's why you're importing it.
81
-
82
- ### Naming
83
- Match `^[a-z0-9]+(-[a-z0-9]+)*$`, prefix `oh-`. Original name if good fit, adapt if not. Fusion names signal combined purpose.
84
-
85
- ## Phase 5: Fusion (opt — skip for single imports)
86
-
87
- For each skill being fused, identify:
88
- - **Unique concepts** content only this skill has
89
- - **Overlapping content** — same idea expressed differently (keep the better version)
82
+ ### Body Structure
83
+ 1. **Summary** — one short paragraph
84
+ 2. **When to Use** — clear triggering context
85
+ 3. **Protocol** — numbered workflow
86
+ 4. **Rubric / guardrails** — what to merge, reject, or escalate
87
+ 5. **Routing** — pass/fail/blocker table
88
+
89
+ ### Adaptation Rules
90
+ - Remove emojis. Replace ecosystem terms with OH equivalents.
91
+ - Convert relative paths to OH harness conventions.
92
+ - Add routing table based on the skill's purpose.
93
+ - Keep all concrete rules, examples, and anti-patterns from the original.
94
+ - Discard fluff, philosophy, and motivational language.
95
+ - Preserve the original's unique signal — that's why you're importing it.
96
+ - Keep the result OpenCode/OpenHermes-native only.
97
+
98
+ ### Naming
99
+ Match `^[a-z0-9]+(-[a-z0-9]+)*$`, prefix `oh-`. Original name if good fit, adapt if not. Fusion names signal combined purpose.
100
+
101
+ ## Phase 5: Approval Gate
102
+
103
+ Before any harness mutation, surface the fusion report and wait for approval. Approved intent already present in the conversation counts. Do not ask new questions unless a blocker cannot be resolved from the codebase or prior conversation.
104
+
105
+ ## Phase 6: Fusion (opt — skip for single imports)
106
+
107
+ For each skill being fused, identify:
108
+ - **Unique concepts** — content only this skill has
109
+ - **Overlapping content** — same idea expressed differently (keep the better version)
90
110
  - **Conflicting directives** — skills that say opposite things (surface to user)
91
111
 
92
112
  ### Merge Architecture
@@ -98,23 +118,26 @@ Structure so each source contributes its strength. Do NOT concatenate — must r
98
118
  ### Phase B: <from skill 2>
99
119
  ```
100
120
 
101
- ### Naming
102
- Name signals combined purpose, not individual sources. E.g., `oh-facade` from redesign + design-taste + high-end-visual, not `oh-redesign-plus-taste`.
103
-
104
- ## Phase 6: Integration
105
-
106
- 1. **Create file** → user dir (`~/.config/opencode/skills/oh-<name>/SKILL.md`)
107
- 2. **Wire AUTOPILOT** → add to auto-classify matrix in `harness/codex/AUTOPILOT.md`: signal keywords → classification → "Load **oh-<name>**. Do not ask."
108
- 3. **Wire routing** → add `route:` frontmatter in the skill. Dynamic loading reads `route.pass`, `route.fail`, `route.blocker` directly from `SKILL.md` — no ROUTING.md edit needed. Skill becomes routable automatically.
121
+ ### Naming
122
+ Name signals combined purpose, not individual sources. E.g., `oh-facade` from redesign + design-taste + high-end-visual, not `oh-redesign-plus-taste`.
123
+
124
+ ## Phase 7: Integration
125
+
126
+ 1. **Create file** → user dir (`~/.config/opencode/skills/oh-<name>/SKILL.md`)
127
+ 2. **Wire AUTOPILOT** → add to auto-classify matrix in `harness/codex/AUTOPILOT.md`: signal keywords → classification → "Load **oh-<name>**. Do not ask."
128
+ 3. **Wire routing** → add `route:` frontmatter in the skill. Dynamic loading reads `route.pass`, `route.fail`, `route.blocker` directly from `SKILL.md` — no ROUTING.md edit needed. Skill becomes routable automatically.
109
129
  4. **Wire AGENTS.md** → add to skills table with tier and purpose. Increment total count.
110
130
  5. **Wire openhermes.md** → add to orchestrator's skill list in `harness/agents/openhermes.md`.
111
131
  6. **Verify** → route to `oh-skills-link` to confirm OpenCode discovers it.
112
132
 
113
- ## Anti-patterns
114
-
115
- - Importing without analysis (always run Phase 2)
116
- - Keeping everything ~50% of external skills is fluff
117
- - Fusing incompatible domains (confusing to model and user)
118
- - Naming after source ("oh-tailwind-v2") instead of capability ("oh-styles")
119
- - Skipping route frontmatter without it, autopilot can't route
120
- - Overwriting existing routing without checking for collisions
133
+ ## Anti-patterns
134
+
135
+ - Importing without analysis (always run Phase 2)
136
+ - Asking before checking code or prior conversation
137
+ - Changing the harness before the approval gate clears
138
+ - Keeping everything most external skill text is fluff
139
+ - Fusing incompatible domains (confusing to model and user)
140
+ - Naming after source ("oh-tailwind-v2") instead of capability ("oh-styles")
141
+ - Skipping route frontmatter — without it, autopilot can't route
142
+ - Overwriting existing routing without checking for collisions
143
+ - Shipping a protocol that weakens OH or makes it less native
@@ -1,36 +1,50 @@
1
1
  ---
2
2
  name: oh-fusion
3
- description: "Use when the user has an existing skill, finds a skill in their .agents/skills, or wants to bring an external capability into OH as a skill."
4
- tier: 3
5
- route:
6
- pass:
7
- - oh-skills-link
8
- - oh-skill-craft
9
- fail: oh-skill-craft
10
- blocker: surface
11
- ---
12
-
13
- # oh-fusion
14
-
15
- Skill ingestion pipeline: Discover → Analyze → Decide → Adapt → Fuse → Integrate.
16
-
17
- ## Steps
18
-
19
- 1. Load skill content read from `.agents/skills/`, `npx skills`, URL, user path, or inline text.
20
- 2. Analyze depth score by lines, concrete rules, examples, anti-patterns, workflow steps, and routing.
21
- 3. Detect overlap compare against existing `oh-*` skills. Report none/partial/complete.
22
- 4. Decide verdict Keep (high signal, no overlap), Fuse (partial overlap, merge DNA), Discard (low/no signal), or Ask (ambiguous).
23
- 5. Adapt to OH-native format remove emojis, convert paths, add routing, preserve unique signal.
24
- 6. Fuse if merging identify unique concepts from each source, resolve conflicts, write one coherent workflow.
25
- 7. Integrate — create skill file, wire AUTOPILOT, routing, AGENTS.md, openhermes.md.
26
- 8. Verify — route to oh-skills-link to confirm discovery.
27
-
28
- ## Routing
29
-
30
- | Outcome | Route |
31
- |---------|-------|
32
- | Integration complete | oh-skills-link (verify discovery) |
33
- | Fusion needs iteration | → oh-skill-craft |
34
- | Analysis: discard | → surface |
35
- | Analysis: ask | → surface with recs |
3
+ description: "Use when the user has an existing skill, finds a skill in their .agents/skills, or wants to bring an external capability into OH as a skill."
4
+ tier: 3
5
+ route:
6
+ pass: [oh-skill-craft, oh-skills-link]
7
+ fail: surface
8
+ blocker: surface
9
+ ---
10
+
11
+ # oh-fusion
12
+
13
+ Skill fusion pipeline: Discover → Analyze → Verdict → Approval Gate → Integrate.
14
+
15
+ ## Protocol
16
+
17
+ 1. Load skill content — read from `.agents/skills/`, `npx skills`, URL, user path, or inline text.
18
+ 2. Analyze the source against OH — report `OH gaps`, `OH wins`, and `missed patterns`.
19
+ 3. Compare overlapidentify the best existing `oh-*` target, if any.
20
+ 4. Decide with a rubric:
21
+ - **Merge** when the source mainly strengthens an existing OH capability.
22
+ - **Standalone** when the source adds a distinct, reusable capability.
23
+ - **Discard** when the signal is weak or redundant.
24
+ 5. Produce a fusion report with these sections, in order:
25
+ - `OH gaps`
26
+ - `OH wins`
27
+ - `missed patterns`
28
+ - `merge verdict`
29
+ - `action plan`
30
+ - `approval gate`
31
+ 6. Resolve from code and prior conversation first. Ask only if a blocker remains.
32
+ 7. After approval, adapt to OH-native form and route directly to implementation.
33
+ 8. Verify discovery with `oh-skills-link` when a new or renamed skill is added.
34
+
35
+ ## Merge Rubric
36
+
37
+ - **Merge into existing `oh-*`** when domain, trigger, and route already exist; the source mostly adds sharper rules, better sequencing, or stronger edge-case handling.
38
+ - **Create standalone `oh-*`** when the source introduces a capability with distinct trigger words, workflow, and handoff points.
39
+ - **Discard** when the source adds fluff, duplicates OH, or weakens OpenCode/OpenHermes-native operation.
40
+
41
+ ## Routing
42
+
43
+ | Outcome | Route |
44
+ |---------|-------|
45
+ | Approved merge or standalone plan | → oh-skill-craft |
46
+ | New or renamed skill needs discovery check | → oh-skills-link |
47
+ | Analysis: discard | → surface |
48
+ | Approval not yet granted | → surface |
36
49
  | Blocker | → surface |
50
+
@@ -29,3 +29,4 @@ Full build orchestration loop: pre-flight → plan → build → verify → loop
29
29
  | pass | → oh-planner |
30
30
  | fail | → oh-expert (diagnose loop failure) |
31
31
  | blocker | → surface with context and options |
32
+
@@ -20,12 +20,14 @@ AGENTS.md, CLAUDE.md, CONTRIBUTING.md, CONTEXT.md, ADRs, eslint/biome/prettier c
20
20
  - **Standards** — Read standards + diff. Per-file/hunk: violations citing standard + rule. Distinguish hard violations from judgment calls. Skip tool-enforced.
21
21
  - **Spec** — Read spec + diff. Report: missing/partial requirements, scope creep, wrong implementations. Quote spec line.
22
22
 
23
- ### 5. Aggregate
24
- Present under `## Standards` / `## Spec`. Do not merge. End with total + worst issue.
23
+ ### 5. Aggregate
24
+ Present under `## Standards` / `## Spec`. Do not merge. End with total + worst issue.
25
+
26
+ Concrete, low-risk, fixable findings should be converted into implementation work and dispatched to oh-builder immediately instead of stopping as report-only notes.
25
27
 
26
28
  ### Safety Check (inline before spawning)
27
29
  - SQL injection, LLM trust boundary violations, conditional side effects (test vs prod), hardcoded secrets
28
- - Block immediately if critical — do not spawn sub-agents.
30
+ - Block immediately if critical — do not spawn sub-agents.
29
31
 
30
32
  ## Mode B: Architecture Deepening
31
33
 
@@ -29,3 +29,4 @@ Two-axis review: Standards + Spec, parallel sub-agents. Three modes: Diff Review
29
29
  | pass | → oh-gauntlet or oh-ship |
30
30
  | fail | → oh-builder |
31
31
  | blocker | → surface |
32
+
package/package.json CHANGED
@@ -1,57 +1,55 @@
1
1
  {
2
- "name": "openhermes",
3
- "version": "4.11.2",
4
- "description": "Autonomous agent orchestration for OpenCode.",
5
- "type": "module",
6
- "license": "MIT",
7
- "engines": {
8
- "bun": ">=1.0"
9
- },
10
- "main": "./index.ts",
11
- "dependencies": {
12
- "@opencode-ai/plugin": "1.15.0"
13
- },
14
- "exports": {
15
- ".": "./index.ts",
16
- "./bootstrap": "./bootstrap.ts"
17
- },
18
- "files": [
19
- "index.ts",
20
- "bootstrap.ts",
21
- "tsconfig.json",
22
- "ETHOS.md",
23
- "CONTEXT.md",
24
- "lib/",
25
- "scripts/",
26
- "harness/codex/",
27
- "harness/instructions/",
28
- "harness/skills/",
29
- "harness/commands/",
30
- "harness/agents/",
31
- "harness/lib/"
32
- ],
33
- "scripts": {
34
- "test": "bun test"
35
- },
36
- "keywords": [
37
- "opencode",
38
- "openhermes",
39
- "orchestrator",
40
- "skills",
41
- "commands",
42
- "agents",
43
- "rules"
44
- ],
45
- "repository": {
46
- "type": "git",
47
- "url": "git+https://github.com/nathwn12/openhermes.git"
48
- },
49
- "bugs": {
50
- "url": "https://github.com/nathwn12/openhermes/issues"
51
- },
52
- "homepage": "https://github.com/nathwn12/openhermes#readme",
53
- "author": "nathwn12",
54
- "devDependencies": {
55
- "@types/node": "^25.8.0"
56
- }
2
+ "name": "openhermes",
3
+ "version": "4.12.1",
4
+ "description": "Autonomous agent orchestration for OpenCode.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "bun": "\u003e=1.0"
9
+ },
10
+ "main": "./index.ts",
11
+ "dependencies": {
12
+ "@opencode-ai/plugin": "1.15.0"
13
+ },
14
+ "exports": {
15
+ ".": "./index.ts",
16
+ "./bootstrap": "./bootstrap.ts"
17
+ },
18
+ "files": [
19
+ "index.ts",
20
+ "bootstrap.ts",
21
+ "tsconfig.json",
22
+ "ETHOS.md",
23
+ "CONTEXT.md",
24
+ "lib/",
25
+ "harness/codex/",
26
+ "harness/instructions/",
27
+ "harness/skills/",
28
+ "harness/agents/",
29
+ "harness/lib/"
30
+ ],
31
+ "scripts": {
32
+ "test": "bun test"
33
+ },
34
+ "keywords": [
35
+ "opencode",
36
+ "openhermes",
37
+ "orchestrator",
38
+ "skills",
39
+ "commands",
40
+ "agents",
41
+ "rules"
42
+ ],
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/nathwn12/openhermes.git"
46
+ },
47
+ "bugs": {
48
+ "url": "https://github.com/nathwn12/openhermes/issues"
49
+ },
50
+ "homepage": "https://github.com/nathwn12/openhermes#readme",
51
+ "author": "nathwn12",
52
+ "devDependencies": {
53
+ "@types/node": "^25.8.0"
54
+ }
57
55
  }