openhermes 4.1.0 → 4.9.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.
- package/CONTEXT.md +9 -0
- package/ETHOS.md +6 -3
- package/LICENSE +21 -21
- package/README.md +120 -79
- package/bootstrap.ts +284 -41
- package/harness/agents/oh-browser.md +97 -0
- package/harness/agents/oh-builder.md +78 -0
- package/harness/agents/oh-facade.md +75 -0
- package/harness/agents/oh-fusion.md +45 -0
- package/harness/agents/oh-gauntlet.md +71 -0
- package/harness/agents/oh-grill.md +71 -0
- package/harness/agents/oh-investigate.md +60 -0
- package/harness/agents/oh-manifest.md +95 -0
- package/harness/agents/oh-plan-review.md +40 -0
- package/harness/agents/oh-planner.md +50 -0
- package/harness/agents/oh-refactor.md +37 -0
- package/harness/agents/oh-retro.md +46 -0
- package/harness/agents/oh-review.md +85 -0
- package/harness/agents/oh-security.md +83 -0
- package/harness/agents/oh-ship.md +76 -0
- package/harness/agents/oh-skill-craft.md +38 -0
- package/harness/agents/openhermes.md +106 -62
- package/harness/codex/AUTOPILOT.md +178 -0
- package/harness/codex/CHARTER.md +81 -0
- package/harness/commands/oh-doctor.md +193 -14
- package/harness/commands/oh-log.md +18 -0
- package/harness/instructions/SHELL.md +76 -0
- package/harness/skills/oh-ascii/DEEP.md +292 -0
- package/harness/skills/oh-ascii/SKILL.md +31 -0
- package/harness/skills/oh-ascii/scripts/check_ascii_alignment.py +596 -0
- package/harness/skills/oh-browser/DEEP.md +54 -0
- package/harness/skills/oh-browser/SKILL.md +30 -0
- package/harness/skills/oh-builder/DEEP.md +63 -0
- package/harness/skills/oh-builder/SKILL.md +16 -89
- package/harness/skills/oh-expert/DEEP.md +85 -0
- package/harness/skills/oh-expert/SKILL.md +19 -106
- package/harness/skills/oh-facade/DEEP.md +182 -0
- package/harness/skills/oh-facade/SKILL.md +34 -0
- package/harness/skills/oh-freeze/DEEP.md +18 -0
- package/harness/skills/oh-freeze/SKILL.md +15 -15
- package/harness/skills/oh-full-output/DEEP.md +25 -0
- package/harness/skills/oh-full-output/SKILL.md +28 -0
- package/harness/skills/oh-fusion/DEEP.md +120 -0
- package/harness/skills/oh-fusion/SKILL.md +36 -0
- package/harness/skills/oh-gauntlet/DEEP.md +77 -0
- package/harness/skills/oh-gauntlet/SKILL.md +17 -105
- package/harness/skills/oh-grill/DEEP.md +51 -0
- package/harness/skills/oh-grill/SKILL.md +16 -63
- package/harness/skills/oh-guard/DEEP.md +19 -0
- package/harness/skills/oh-guard/SKILL.md +15 -20
- package/harness/skills/oh-handoff/DEEP.md +48 -0
- package/harness/skills/oh-handoff/SKILL.md +18 -19
- package/harness/skills/oh-health/DEEP.md +74 -0
- package/harness/skills/oh-health/SKILL.md +17 -76
- package/harness/skills/oh-init/DEEP.md +85 -0
- package/harness/skills/oh-init/SKILL.md +17 -197
- package/harness/skills/oh-investigate/DEEP.md +171 -0
- package/harness/skills/oh-investigate/SKILL.md +18 -61
- package/harness/skills/oh-issue/DEEP.md +21 -0
- package/harness/skills/oh-issue/SKILL.md +16 -23
- package/harness/skills/oh-learn/DEEP.md +44 -0
- package/harness/skills/oh-learn/SKILL.md +17 -79
- package/harness/skills/oh-manifest/DEEP.md +92 -0
- package/harness/skills/oh-manifest/SKILL.md +15 -107
- package/harness/skills/oh-plan-review/DEEP.md +90 -0
- package/harness/skills/oh-plan-review/SKILL.md +19 -114
- package/harness/skills/oh-planner/DEEP.md +172 -0
- package/harness/skills/oh-planner/SKILL.md +16 -143
- package/harness/skills/oh-prd/DEEP.md +45 -0
- package/harness/skills/oh-prd/SKILL.md +15 -22
- package/harness/skills/oh-refactor/DEEP.md +122 -0
- package/harness/skills/oh-refactor/SKILL.md +33 -0
- package/harness/skills/oh-retro/DEEP.md +26 -0
- package/harness/skills/oh-retro/SKILL.md +17 -20
- package/harness/skills/oh-review/DEEP.md +87 -0
- package/harness/skills/oh-review/SKILL.md +17 -96
- package/harness/skills/oh-security/DEEP.md +83 -0
- package/harness/skills/oh-security/SKILL.md +18 -96
- package/harness/skills/oh-ship/DEEP.md +141 -0
- package/harness/skills/oh-ship/SKILL.md +18 -26
- package/harness/skills/oh-skill-craft/DEEP.md +369 -0
- package/harness/skills/oh-skill-craft/SKILL.md +20 -93
- package/harness/skills/oh-skills-link/DEEP.md +16 -0
- package/harness/skills/oh-skills-link/SKILL.md +15 -16
- package/harness/skills/oh-skills-list/DEEP.md +20 -0
- package/harness/skills/oh-skills-list/SKILL.md +14 -18
- package/harness/skills/oh-triage/DEEP.md +23 -0
- package/harness/skills/oh-triage/SKILL.md +15 -20
- package/harness/skills/oh-worktree/DEEP.md +169 -0
- package/harness/skills/oh-worktree/SKILL.md +32 -0
- package/lib/harness-resolver.ts +10 -12
- package/package.json +9 -4
- package/scripts/count-tokens.mjs +158 -0
- package/scripts/oh-doctor.ps1 +342 -0
- package/harness/codex/CONSTITUTION.md +0 -70
- package/harness/codex/ROUTING.md +0 -127
- package/harness/instructions/RUNTIME.md +0 -55
- package/harness/skills/oh-caveman/SKILL.md +0 -33
- package/lib/logger.ts +0 -69
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: OpenHermes Charter — non-negotiable operating core. Constitution + Runtime condensed.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# OpenHermes Charter
|
|
6
|
+
|
|
7
|
+
Non-negotiable operating core. All skills, commands, and agents follow these principles.
|
|
8
|
+
|
|
9
|
+
## Operating Doctrine (15 Articles)
|
|
10
|
+
|
|
11
|
+
1. **OpenCode-native first** — Register via the package, do not copy content into global config.
|
|
12
|
+
|
|
13
|
+
2. **Pragmatic over performative** — Working code beats elegant theory. Fix the bug, not the vibe.
|
|
14
|
+
|
|
15
|
+
3. **Concise over verbose** — Every token costs context. Prefer short, direct output.
|
|
16
|
+
|
|
17
|
+
4. **Task-focused** — Stay on mission. No drift. No unsolicited education.
|
|
18
|
+
|
|
19
|
+
5. **Always delegate — never execute** — OpenHermes reports to the user and delegates to sub-agents. No direct code, tests, or edits.
|
|
20
|
+
|
|
21
|
+
6. **Skills on demand** — Do not preload all skills. Invoke when relevant.
|
|
22
|
+
|
|
23
|
+
7. **Verify before claim** — Read files, run commands, confirm output before declaring done.
|
|
24
|
+
|
|
25
|
+
8. **Rules over hidden state** — Prefer AGENTS.md, instructions, and manifests over implicit state.
|
|
26
|
+
|
|
27
|
+
9. **Memory deferred** — Intentional absence for this pass.
|
|
28
|
+
|
|
29
|
+
10. **Closed-loop autonomy** — Auto-classify, auto-route after every skill. Only stop for blockers and major decisions.
|
|
30
|
+
|
|
31
|
+
11. **Push back when needed** — Say so when requests are wrong, risky, or underspecified. Classify and fire the matching skill — do not block on ambiguity.
|
|
32
|
+
|
|
33
|
+
12. **Recover by narrowing** — When blocked, reduce scope, add constraints, retry with evidence. Diagnose and propose — do not ask the user to solve it.
|
|
34
|
+
|
|
35
|
+
13. **Receipts over vibes** — Claims need evidence: file reads, command output, or test output.
|
|
36
|
+
|
|
37
|
+
14. **Know your shell before you speak** — Detect runtime shell via `$PSVersionTable`, `%CMDCMDLINE%`, or `$0` before every subagent spawn. Never guess. SHELL.md defines detection and switching.
|
|
38
|
+
|
|
39
|
+
15. **Talk before delegate** — Calibrate confidence before classifying. HIGH = proceed silently. MEDIUM = echo then confirm. LOW = one question then classify. Bounded to 1 exchange. Default to delegate, not ask. When uncertain, choose lower confidence.
|
|
40
|
+
|
|
41
|
+
## Safety & Escalation
|
|
42
|
+
|
|
43
|
+
User config, plugins, MCP, permissions, TUI, local skills, overlays — locked unless the task targets them.
|
|
44
|
+
|
|
45
|
+
**Escalation ladder:**
|
|
46
|
+
- **T0**: Check confidence → auto-classify → auto-route → execute
|
|
47
|
+
- **T1**: Check result → route next by outcome
|
|
48
|
+
- **T2**: If blocked → diagnose → retry with narrower scope
|
|
49
|
+
- **T3**: If still blocked → surface with findings, options, what is needed
|
|
50
|
+
|
|
51
|
+
## Self-Diagnosis
|
|
52
|
+
|
|
53
|
+
Before every substantive response, ask:
|
|
54
|
+
1. **Sycophancy?** — Would I say this without the user's steer?
|
|
55
|
+
2. **Factuality or faithfulness?** — Inventing or drifting from loaded docs?
|
|
56
|
+
3. **In the smart zone?** — Getting sloppy? Compact and reload.
|
|
57
|
+
4. **Repeating user mistakes?** — Mimicry is a sycophancy signal.
|
|
58
|
+
5. **Knowledge-cutoff trap?** — Past-cutoff versions/APIs? Load current docs.
|
|
59
|
+
|
|
60
|
+
## Shell Pre-Flight
|
|
61
|
+
|
|
62
|
+
Detect shell before spawning subagents. PowerShell (`powershell`/`pwsh`), CMD (`cmd`), Git Bash (`bash`). Document in plan's state section. SHELL.md provides full detection and switching reference. Never guess — guessing causes silent failures.
|
|
63
|
+
|
|
64
|
+
## Plan Lifecycle
|
|
65
|
+
|
|
66
|
+
Plans at `~/.local/share/opencode/openhermes/plans/<project-name>-plan-<nnn>.md`.
|
|
67
|
+
- **Keep**: `active`, `in-progress`, `blocked`
|
|
68
|
+
- **Delete**: `complete`, `abandoned`
|
|
69
|
+
- Cleanup is direct filesystem operation — AI knows project name, derives path, keeps by status. Surface summary only.
|
|
70
|
+
|
|
71
|
+
## Orchestration Discipline
|
|
72
|
+
|
|
73
|
+
- **Concurrency**: Parallelize independent sub-tasks. Sequentialize dependent ones.
|
|
74
|
+
- **Circuit breaker**: 5 subagent failures on the same task → surface BLOCKER.
|
|
75
|
+
- **Pipelined verification**: Every phase self-verifies before declaring success.
|
|
76
|
+
- **Background vs sync**: Independent work fires and forgets. Dependent work awaits.
|
|
77
|
+
|
|
78
|
+
## Shared State
|
|
79
|
+
|
|
80
|
+
- **Plans**: `~/.local/share/opencode/openhermes/plans/<project-name>-plan-<nnn>.md`
|
|
81
|
+
- **Instincts**: `~/.local/share/opencode/openhermes/plans/<project-name>-instincts.jsonl`
|
|
@@ -1,26 +1,205 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Diagnose OpenHermes + OpenCode health
|
|
2
|
+
description: Diagnose OpenHermes + OpenCode health with concrete file-level checks
|
|
3
3
|
agent: OpenHermes
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Run a structured 8-category diagnostic. For each check, inspect the actual files on disk and report PASS/FAIL/WARN with evidence.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## 1. Plugin load path
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- instruction injection
|
|
15
|
-
- package integrity
|
|
16
|
-
- auth and config safety
|
|
10
|
+
**What to check:**
|
|
11
|
+
- Read `%USERPROFILE%\.config\opencode\opencode.jsonc` — verify the `plugin` array contains `"openhermes@git+https://github.com/nathwn12/openhermes.git#dev"`.
|
|
12
|
+
- Check for trailing commas: line 23 has a known trailing `,` after the single plugin entry. The parser may fail on this.
|
|
13
|
+
- Check the resolved install path: `%USERPROFILE%\.cache\opencode\packages\openhermes@git+https_/github.com/nathwn12/openhermes.git#dev/node_modules/openhermes/` — does it exist? Does `harness/` and `index.ts` resolve?
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
**Troubleshooting:**
|
|
16
|
+
- Trailing comma fix: remove `,` from end of line 23 in opencode.jsonc.
|
|
17
|
+
- If the plugin path doesn't match, update opencode.jsonc to point to the correct git ref.
|
|
18
|
+
- If the package directory is missing, OpenCode reinstalls on next launch. Restart and check again.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 2. Skills discovery
|
|
23
|
+
|
|
24
|
+
**What to check:**
|
|
25
|
+
- Count directories in `harness/skills/` — expect exactly 31.
|
|
26
|
+
- Spot-check 3 SKILL.md files for valid YAML frontmatter (must have `name`, `description`, `route`, `tier`, `triggers`).
|
|
27
|
+
- Verify bootstrap.ts injects `config.skills.paths` with two sources: the built-in skills dir AND user skill dirs (`~/.agents/skills/`, `~/.config/opencode/skills/`, `~/.claude/skills/`).
|
|
28
|
+
- Verify NO symlinks are required — discovery uses the plugin API `config.skills.paths` mechanism.
|
|
29
|
+
|
|
30
|
+
**Expected current count:** 31 (confirmed directories match filesystem)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 3. Command registration
|
|
35
|
+
|
|
36
|
+
**What to check:**
|
|
37
|
+
- List `harness/commands/` — expect exactly 2 `.md` files: `oh-doctor.md` and `oh-log.md`.
|
|
38
|
+
- Read each file's frontmatter — both must have `description` + `agent: OpenHermes`.
|
|
39
|
+
- Verify bootstrap.ts `commandDefinitions()` reads this directory and merges into `config.command`.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 4. Agent registration
|
|
44
|
+
|
|
45
|
+
**What to check:**
|
|
46
|
+
- List `harness/agents/` — expect exactly 17 `.md` files (1 primary + 16 subagents).
|
|
47
|
+
- Read `openhermes.md` frontmatter — must have `mode: primary`.
|
|
48
|
+
- Verify primary agent permissions in bootstrap.ts (lines 370-391): `bash: deny`, `edit: deny`, `task: allow`.
|
|
49
|
+
- Verify 16 subagents have explicit permissions in `SUBAGENT_PERMISSIONS` (lines 335-350): `bash: allow`, `edit: allow`, `task: { "oh-*": "deny" }`.
|
|
50
|
+
- Verify delegation loop guard (line 424): max depth = 10.
|
|
51
|
+
- Verify `oh-planner` + `oh-grill` + `oh-skill-craft` are hidden from @-menu (line 366).
|
|
52
|
+
|
|
53
|
+
**Expected:** 17 entries, no missing agent definitions, all permissions assigned.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 5. Instruction injection
|
|
58
|
+
|
|
59
|
+
**What to check:**
|
|
60
|
+
- Verify all 3 files exist:
|
|
61
|
+
- `harness/codex/CHARTER.md` (target: ~80 lines)
|
|
62
|
+
- `harness/codex/AUTOPILOT.md` (target: ~200 lines)
|
|
63
|
+
- `harness/instructions/SHELL.md` (76 lines)
|
|
64
|
+
- Each file must be > 0 bytes and not a placeholder/stub.
|
|
65
|
+
- Verify bootstrap.ts injects both `harness/codex/` and `harness/instructions/` directories via `config.instructions`.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 6. Package integrity
|
|
70
|
+
|
|
71
|
+
**What to check:**
|
|
72
|
+
- Read `package.json` — verify these fields:
|
|
73
|
+
- `name: "openhermes"`
|
|
74
|
+
- `version` — note current version
|
|
75
|
+
- `exports: { ".": "./index.ts", "./bootstrap": "./bootstrap.ts" }`
|
|
76
|
+
- `files` — all 11 entries must resolve to real files/dirs on disk
|
|
77
|
+
- Read `tsconfig.json` — must have: `strict: true`, `target: ESNext`, `module: ESNext`, `moduleResolution: bundler`.
|
|
78
|
+
- Verify `lib/harness-resolver.ts` — check its `REQUIRED_HARNESS_FILES` (CHARTER.md, AUTOPILOT.md, oh-planner/SKILL.md) all resolve from the harness root.
|
|
79
|
+
- Check `scripts/` directory — no `.ps1` files exist. This is the current state. If some are expected, note absence.
|
|
80
|
+
- Run `bun test` if available — note any failures.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 7. Auth & config safety
|
|
85
|
+
|
|
86
|
+
**What to check (grep entire project dir):**
|
|
87
|
+
- `.env*` — expect 0 matches
|
|
88
|
+
- `*.key` — expect 0 matches
|
|
89
|
+
- `*secret*` — expect 0 matches
|
|
90
|
+
- `credentials*` — expect 0 matches
|
|
91
|
+
- `auth.json` — expect 0 matches (should be at `%USERPROFILE%\.local\share\opencode\auth.json`, outside the project)
|
|
92
|
+
- Read `.gitignore` — must cover: `node_modules/`, `.config/`, `.opencode/`, `PLAN.d/`, `coverage/`, `*.tgz`
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 8. Documentation accuracy
|
|
97
|
+
|
|
98
|
+
**What to check:**
|
|
99
|
+
Read `AGENTS.md` and compare its claims against the actual filesystem. Known discrepancies to flag:
|
|
100
|
+
|
|
101
|
+
| Claim | Actual | Status |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| Line 22: "31 skills (see below)" | Directory has 31 skills | Up to date |
|
|
104
|
+
| Line 19: \`harness/instructions/ — SHELL.md\` | Directory only has SHELL.md | Up to date |
|
|
105
|
+
| Line 23: `lib/ — harness-resolver.ts, logger.ts` | Only `harness-resolver.ts` exists | `logger.ts` removed |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Quick-wins (automated)
|
|
110
|
+
|
|
111
|
+
For instant automated checks, run the companion PowerShell script which outputs JSON-Lines diagnostics consumable by the OpenHermes orchestrator:
|
|
112
|
+
|
|
113
|
+
```powershell
|
|
114
|
+
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/oh-doctor.ps1
|
|
115
|
+
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/oh-doctor.ps1 -SkipOCChecks
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
This script checks:
|
|
119
|
+
|
|
120
|
+
1. **AGENTS.md accuracy** — skill count (expects 31) and file references
|
|
121
|
+
2. **Package files field** — all `package.json` `files` entries exist on disk
|
|
122
|
+
3. **Harness prerequisites** — CHARTER.md, AUTOPILOT.md, oh-planner/SKILL.md resolve
|
|
123
|
+
4. **Test health** — `bun test` pass/fail counts
|
|
124
|
+
5. **TypeScript compilation** — `bunx tsc --noEmit` clean check
|
|
125
|
+
6. **Secrets scan** — .env, *.key, credentials, auth.json in repo
|
|
126
|
+
7. **.gitignore coverage** — expected entries present
|
|
127
|
+
8. **Runtime checks** — opencode CLI paths, plugin load, skills discovery (skippable)
|
|
128
|
+
|
|
129
|
+
Each check reports PASS/FAIL/WARN with evidence and a suggested fix.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Troubleshooting reference
|
|
134
|
+
|
|
135
|
+
Use these when a check fails.
|
|
136
|
+
|
|
137
|
+
### Config won't parse
|
|
138
|
+
```
|
|
139
|
+
%USERPROFILE%\.config\opencode\opencode.jsonc
|
|
140
|
+
```
|
|
141
|
+
- Trailing commas: JSONC tolerates them in some parsers but OpenCode's validator rejects them.
|
|
142
|
+
- Fix: open the file and remove any trailing `,` after the last array/object element.
|
|
143
|
+
- Test: run `opencode --print-logs` — parser errors appear in the first few lines.
|
|
144
|
+
|
|
145
|
+
### Plugin won't load
|
|
146
|
+
- Temporarily disable all plugins by setting `"plugin": []` in opencode.jsonc.
|
|
147
|
+
- Restart. If OpenCode works, re-enable plugins one at a time.
|
|
148
|
+
- If the app crashes on launch, check `%USERPROFILE%\.config\opencode\plugins\` directory and move it aside.
|
|
149
|
+
|
|
150
|
+
### Stuck or corrupted cache
|
|
151
|
+
- Clear the full cache: `rm -rf %USERPROFILE%\.cache\opencode` (Windows: delete `%USERPROFILE%\.cache\opencode`).
|
|
152
|
+
- This forces OpenCode to reinstall provider packages on next launch.
|
|
153
|
+
- This resolves `AI_APICallError` and stale provider package issues.
|
|
154
|
+
|
|
155
|
+
### Authentication failures
|
|
156
|
+
- Run `/connect` in the TUI to re-authenticate.
|
|
157
|
+
- Check auth file: `%USERPROFILE%\.local\share\opencode\auth.json` — should be >0 bytes and valid JSON.
|
|
158
|
+
- If corrupted: delete the file, then re-run `/connect`.
|
|
159
|
+
|
|
160
|
+
### Model not found / ProviderModelNotFoundError
|
|
161
|
+
- Run `opencode models` to see available models.
|
|
162
|
+
- Model format: `<providerId>/<modelId>` (e.g. `openai/gpt-4.1`).
|
|
163
|
+
- Verify the provider is authenticated and has access to the requested model.
|
|
164
|
+
|
|
165
|
+
### Log inspection
|
|
166
|
+
- Logs at `%USERPROFILE%\.local\share\opencode\log\` — newest file first.
|
|
167
|
+
- Run `opencode --log-level DEBUG` for verbose output.
|
|
168
|
+
- Run `/oh-log` in OpenCode to read OpenHermes-specific session logs.
|
|
169
|
+
|
|
170
|
+
### ProviderInitError
|
|
171
|
+
- Corrupted or invalid configuration in `~/.local/share/opencode`.
|
|
172
|
+
- Last resort: delete `~/.local/share/opencode` and re-authenticate with `/connect`.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Report format
|
|
177
|
+
|
|
178
|
+
Summarize diagnostics as:
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
## Diagnosis
|
|
182
|
+
|
|
183
|
+
### PASS items
|
|
184
|
+
- check name — evidence
|
|
185
|
+
|
|
186
|
+
### FAIL / WARN items
|
|
187
|
+
- ❌ FAIL: check name — evidence — fix
|
|
188
|
+
- ⚠️ WARN: check name — evidence — suggestion
|
|
189
|
+
|
|
190
|
+
### Issues table
|
|
191
|
+
| # | Severity | Check | File | Fix |
|
|
192
|
+
|---|----------|-------|------|-----|
|
|
193
|
+
|
|
194
|
+
### Next actions
|
|
195
|
+
1. Priority action — command or manual step
|
|
196
|
+
2. ...
|
|
197
|
+
```
|
|
19
198
|
|
|
20
199
|
## Routing
|
|
21
200
|
|
|
22
201
|
| Outcome | Route |
|
|
23
202
|
|---------|-------|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
203
|
+
| All PASS or WARN only | → surface report to user |
|
|
204
|
+
| Any FAIL | → oh-investigate (diagnose issues found) |
|
|
205
|
+
| Unrecoverable (env broken) | → surface to user with findings |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Read and summarize the OpenHermes session log
|
|
3
|
+
agent: OpenHermes
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Inspect the OpenHermes session log at `~/.local/share/opencode/log/openhermes.log`.
|
|
7
|
+
|
|
8
|
+
Return a structured summary grouped by session ID.
|
|
9
|
+
|
|
10
|
+
Focus on:
|
|
11
|
+
|
|
12
|
+
- `session.created`
|
|
13
|
+
- `session.compacted`
|
|
14
|
+
- `session.error`
|
|
15
|
+
|
|
16
|
+
For each session, show the timeline in order and highlight any error details.
|
|
17
|
+
|
|
18
|
+
Do not dump the whole log verbatim unless explicitly asked.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# OpenHermes Shell Discipline
|
|
2
|
+
|
|
3
|
+
Windows-native shell detection and switching protocol. Always KNOW your shell before executing.
|
|
4
|
+
|
|
5
|
+
## Detection (run this first)
|
|
6
|
+
|
|
7
|
+
```powershell
|
|
8
|
+
# Returns one of: powershell, pwsh, cmd, bash
|
|
9
|
+
$__ohShell = if ($PSVersionTable) {
|
|
10
|
+
if ($PSVersionTable.PSEdition -eq 'Core') { 'pwsh' } else { 'powershell' }
|
|
11
|
+
} elseif ($env:CMDCMDLINE) { 'cmd' }
|
|
12
|
+
elseif (Get-Variable -Name 'BASH' -ErrorAction SilentlyContinue) { 'bash' }
|
|
13
|
+
else { 'unknown' }
|
|
14
|
+
Write-Output "[OH-SHELL] $__ohShell"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
CMD detection alternative: `echo %CMDCMDLINE%`
|
|
18
|
+
Bash detection alternative: `echo $0` or `echo $BASH`
|
|
19
|
+
|
|
20
|
+
## Operation → Required Shell
|
|
21
|
+
|
|
22
|
+
| If you need to... | Use this shell | Because |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `scoop install/update/status` | PowerShell | Scoop is a PowerShell module |
|
|
25
|
+
| `Remove-Item` / `New-Item` / file ops | PowerShell | Native cmdlets, handles paths |
|
|
26
|
+
| Run `.ps1` / `-NoProfile -Command` | PowerShell | Execution policy, module loading |
|
|
27
|
+
| Read/set env vars | PowerShell | `$env:VAR` syntax |
|
|
28
|
+
| `git *` | Any | Works in all 3 |
|
|
29
|
+
| `bun *` / `npm *` / `node *` | Any | Works in all 3 |
|
|
30
|
+
| `rm -rf` / `chmod` / unix tools | Bash (Git Bash) | Unix-only commands |
|
|
31
|
+
| `make` / `sh` scripts | Bash (Git Bash) | Unix-only |
|
|
32
|
+
| `.bat` / `.cmd` scripts | CMD | Native interpreter |
|
|
33
|
+
| `del /s` / `dir` / `copy` | CMD | CMD built-ins |
|
|
34
|
+
| Test exit code | PowerShell = `$LASTEXITCODE` | Cross-shell differences |
|
|
35
|
+
| Use `%USERPROFILE%` | CMD | CMD env syntax |
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## Switching Shells
|
|
40
|
+
|
|
41
|
+
```powershell
|
|
42
|
+
# From CMD/Bash → PowerShell:
|
|
43
|
+
powershell.exe -NoProfile -Command "your-command"
|
|
44
|
+
|
|
45
|
+
# From CMD/Bash → pwsh (PowerShell 7+):
|
|
46
|
+
pwsh.exe -NoProfile -Command "your-command"
|
|
47
|
+
|
|
48
|
+
# From PowerShell/CMD → Git Bash:
|
|
49
|
+
& "C:\Program Files\Git\bin\bash.exe" -c "your-command"
|
|
50
|
+
|
|
51
|
+
# From PowerShell/Bash → CMD:
|
|
52
|
+
cmd.exe /c "your-command"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Standardized Invocation
|
|
56
|
+
|
|
57
|
+
**Default to PowerShell** for all new operations. Switch only when the tool requires it.
|
|
58
|
+
|
|
59
|
+
PowerShell handles:
|
|
60
|
+
- File system ops: `Remove-Item -Recurse -Force`, `New-Item`, `Copy-Item`, `Move-Item`
|
|
61
|
+
- Environment: `$env:VAR`
|
|
62
|
+
- Package mgmt: `scoop`, `bun`, `npm`
|
|
63
|
+
- Git: `git` (works natively in PowerShell)
|
|
64
|
+
- Paths: both `/` and `\` work
|
|
65
|
+
|
|
66
|
+
## Edge Cases
|
|
67
|
+
|
|
68
|
+
| Situation | Handling |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `bun` in PowerShell | Works natively |
|
|
71
|
+
| Long paths (>260 chars) | PowerShell handles them; CMD may truncate |
|
|
72
|
+
| UNC paths | PowerShell handles; CMD limited |
|
|
73
|
+
| Exit codes | PowerShell: `$LASTEXITCODE`; CMD: `%errorlevel%`; Bash: `$?` |
|
|
74
|
+
| Path separators | PowerShell: both; CMD: `\`; Bash: `/` |
|
|
75
|
+
| Execution policy | If .ps1 won't run: `powershell.exe -ExecutionPolicy Bypass -File script.ps1` |
|
|
76
|
+
| Admin checks | PowerShell: `[Security.Principal.WindowsPrincipal]::new(...)` |
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# oh-ascii — Deep Reference
|
|
2
|
+
|
|
3
|
+
## When to Use
|
|
4
|
+
|
|
5
|
+
Creating architecture diagrams, file trees, flowcharts, sequence diagrams, box-drawing layouts, blast radius visualizations, swimlane diagrams, or validating ASCII art alignment in documentation. All output renders in monospace terminals.
|
|
6
|
+
|
|
7
|
+
## Phases
|
|
8
|
+
|
|
9
|
+
Complete ASCII diagramming — three phases: **Design** (patterns & layout rules), **Generate** (PlantUML workflow), **Validate** (structural alignment checking).
|
|
10
|
+
|
|
11
|
+
### Phase A: Design Patterns
|
|
12
|
+
|
|
13
|
+
#### Box-Drawing Characters
|
|
14
|
+
|
|
15
|
+
Use ONE set per diagram. Never mix.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
default: ┌─┐ │ └─┘ ├─┤ ┬ ┴ ┼
|
|
19
|
+
emphasis: ┏━┓ ┃ ┗━┛ ┣━┫ ┳ ┻ ╋
|
|
20
|
+
title: ╔═╗ ║ ╚═╝ ╠═╣ ╦ ╩ ╬
|
|
21
|
+
soft: ╭─╮ │ ╰─╯
|
|
22
|
+
portable: +-+ | +-+ +-+ + + +
|
|
23
|
+
arrows: → ← ↑ ↓ ─> <─ ──> <──
|
|
24
|
+
blocks: █ ▓ ░ ▏▎▍▌▋▊▉
|
|
25
|
+
status: ● ○ ✓ ✗ ⚠ ◆ ◇ ▶ ▷ ↑↓→ ▓▒░
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| Set | Use |
|
|
29
|
+
|-----|-----|
|
|
30
|
+
| `default` ─│ | Most diagrams |
|
|
31
|
+
| `emphasis` ━┃ | Headers, focus elements |
|
|
32
|
+
| `title` ═║ | Section banners only |
|
|
33
|
+
| `soft` ╭╮╰╯ ─│ | Status cards, ambient UI |
|
|
34
|
+
| `portable` +-\| | CI/TTY fallback |
|
|
35
|
+
|
|
36
|
+
Status glyphs (closed set): `● ○ ✓ ✗ ⚠ ◆ ◇ ▶ ▷ ↑ ↓ → ▓ ░ ▒`
|
|
37
|
+
|
|
38
|
+
#### Diagram Patterns
|
|
39
|
+
|
|
40
|
+
##### Architecture
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
┌──────────────┐ ┌──────────────┐
|
|
44
|
+
│ Frontend │─────>│ Backend │
|
|
45
|
+
│ React 19 │ │ FastAPI │
|
|
46
|
+
└──────────────┘ └───────┬──────┘
|
|
47
|
+
v
|
|
48
|
+
┌──────────────┐
|
|
49
|
+
│ PostgreSQL │
|
|
50
|
+
└──────────────┘
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
##### File Trees with Annotations
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
src/
|
|
57
|
+
├── api/
|
|
58
|
+
│ ├── routes.py [M] +45 -12 !! high-traffic
|
|
59
|
+
│ └── schemas.py [M] +20 -5
|
|
60
|
+
├── services/
|
|
61
|
+
│ └── billing.py [A] +180 ** new
|
|
62
|
+
└── tests/
|
|
63
|
+
└── test_billing.py [A] +120 ** new
|
|
64
|
+
|
|
65
|
+
Legend: [A]dd [M]odify [D]elete !! Risk ** New
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
##### Progress Bars, Swimlanes, Blast Radius, Comparisons, Reversibility
|
|
69
|
+
|
|
70
|
+
**Progress**
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
[████████░░] 80% Complete
|
|
74
|
+
+ Design (2d) + Backend (5d)
|
|
75
|
+
~ Frontend (3d) - Testing (pending)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Swimlane**
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Backend ===[Schema]======[API]===========================[Deploy]====>
|
|
82
|
+
| | ^
|
|
83
|
+
| +------blocks------+ |
|
|
84
|
+
Frontend -------[Wait]--------[Components]=======[Integration]=+
|
|
85
|
+
|
|
86
|
+
=== active --- blocked/waiting | dependency
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Blast Radius (Concentric Rings)**
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Ring 3: Tests (8 files)
|
|
93
|
+
+-----------------------------------+
|
|
94
|
+
| Ring 2: Transitive (5) |
|
|
95
|
+
| +----------------------------+ |
|
|
96
|
+
| | Ring 1: Direct (3) | |
|
|
97
|
+
| | +------------------+ | |
|
|
98
|
+
| | | CHANGED FILE | | |
|
|
99
|
+
| | +------------------+ | |
|
|
100
|
+
| +----------------------------+ |
|
|
101
|
+
+-----------------------------------+
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Comparison (Before/After)**
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
BEFORE AFTER
|
|
108
|
+
┌────────────────┐ ┌────────────────┐
|
|
109
|
+
│ Monolith │ │ Service A │──┐
|
|
110
|
+
│ (all-in-1) │ └────────────────┘ │ ┌──────────┐
|
|
111
|
+
└────────────────┘ ┌────────────────┐ ├─>│ Shared │
|
|
112
|
+
│ Service B │──┘ │ Queue │
|
|
113
|
+
└────────────────┘ └──────────┘
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Reversibility Timeline**
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
Phase 1 [================] FULLY REVERSIBLE (add column)
|
|
120
|
+
Phase 2 [================] FULLY REVERSIBLE (new endpoint)
|
|
121
|
+
Phase 3 [============....] PARTIALLY (backfill)
|
|
122
|
+
--- POINT OF NO RETURN ---
|
|
123
|
+
Phase 4 [........????????] IRREVERSIBLE (drop column)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
##### Key Rules
|
|
127
|
+
|
|
128
|
+
- **Font**: Monospace only — box-drawing requires fixed-width
|
|
129
|
+
- **Arrows**: `->`, `-->`, or `|` with `v`/`^`
|
|
130
|
+
- **Width**: Under 80 cols for terminal compat
|
|
131
|
+
- **Nesting**: Max 3 levels
|
|
132
|
+
- **Labels**: Short — long text breaks alignment
|
|
133
|
+
- **Set consistency**: One set per diagram, never mixed
|
|
134
|
+
|
|
135
|
+
### Phase B: Generation (PlantUML)
|
|
136
|
+
|
|
137
|
+
Generate ASCII from `.puml` files. Requires PlantUML installed (`brew install plantuml`, `apt install plantuml`, or `java -jar plantuml.jar`).
|
|
138
|
+
|
|
139
|
+
#### Workflow
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
plantuml -utxt diagram.puml # Unicode (preferred)
|
|
143
|
+
plantuml -txt diagram.puml # Standard ASCII
|
|
144
|
+
# Output: diagram.utxt or diagram.atxt
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### Templates (7 types)
|
|
148
|
+
|
|
149
|
+
| Type | Description |
|
|
150
|
+
|------|------------|
|
|
151
|
+
| **Sequence** | Actor → System → DB interactions |
|
|
152
|
+
| **Class** | Types, fields, methods, relationships |
|
|
153
|
+
| **Activity** | Workflow branches, decision nodes |
|
|
154
|
+
| **State** | State transitions, entry/exit, events |
|
|
155
|
+
| **Component** | Service boundaries, dependencies |
|
|
156
|
+
| **Use Case** | Actors, system boundary, use cases |
|
|
157
|
+
| **Deployment** | Nodes, servers, databases, replicas |
|
|
158
|
+
|
|
159
|
+
**Sequence Example**
|
|
160
|
+
|
|
161
|
+
```plantuml
|
|
162
|
+
@startuml
|
|
163
|
+
actor User
|
|
164
|
+
participant "Web App" as App
|
|
165
|
+
database "Database" as DB
|
|
166
|
+
|
|
167
|
+
User -> App : Login Request
|
|
168
|
+
App -> DB : Validate Credentials
|
|
169
|
+
DB --> App : User Data
|
|
170
|
+
App --> User : Auth Token
|
|
171
|
+
@enduml
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Component Example**
|
|
175
|
+
|
|
176
|
+
```plantuml
|
|
177
|
+
@startuml
|
|
178
|
+
[Client] as client
|
|
179
|
+
[API Gateway] as gateway
|
|
180
|
+
[Service A] as svcA
|
|
181
|
+
[Database] as db
|
|
182
|
+
|
|
183
|
+
client --> gateway
|
|
184
|
+
gateway --> svcA
|
|
185
|
+
svcA --> db
|
|
186
|
+
@enduml
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Activity Example (branching workflows)**
|
|
190
|
+
|
|
191
|
+
```plantuml
|
|
192
|
+
@startuml
|
|
193
|
+
start
|
|
194
|
+
:Initialize;
|
|
195
|
+
if (Is Valid?) then (yes)
|
|
196
|
+
:Process Data;
|
|
197
|
+
:Save Result;
|
|
198
|
+
else (no)
|
|
199
|
+
:Log Error;
|
|
200
|
+
stop
|
|
201
|
+
endif
|
|
202
|
+
:Complete;
|
|
203
|
+
stop
|
|
204
|
+
@enduml
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**State Example (state transitions)**
|
|
208
|
+
|
|
209
|
+
```plantuml
|
|
210
|
+
@startuml
|
|
211
|
+
[*] --> Idle
|
|
212
|
+
Idle --> Processing : start
|
|
213
|
+
Processing --> Success : complete
|
|
214
|
+
Processing --> Error : fail
|
|
215
|
+
Success --> [*]
|
|
216
|
+
Error --> Idle : retry
|
|
217
|
+
@enduml
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
#### CLI Options
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
plantuml -utxt -o ./output diagram.puml # output dir
|
|
224
|
+
plantuml -utxt ./diagrams/ # batch dir
|
|
225
|
+
plantuml -utxt -charset UTF-8 diagram.puml # charset
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Phase C: Validation
|
|
229
|
+
|
|
230
|
+
Validates structural alignment of box-drawing characters in markdown code blocks. Script bundled at `scripts/check_ascii_alignment.py`.
|
|
231
|
+
|
|
232
|
+
#### Usage
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
python3 scripts/check_ascii_alignment.py docs/ARCHITECTURE.md # single file
|
|
236
|
+
python3 scripts/check_ascii_alignment.py docs/ # batch dir
|
|
237
|
+
python3 scripts/check_ascii_alignment.py docs/ --verbose # show skipped blocks
|
|
238
|
+
python3 scripts/check_ascii_alignment.py docs/ --warn-only # warnings exit 0
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
#### Checks
|
|
242
|
+
|
|
243
|
+
- **Vertical alignment** — connectors must match above/below
|
|
244
|
+
- **Corner connections** — corners connect to adjacent lines
|
|
245
|
+
- **Junction validity** — T-joins/crosses have correct connections
|
|
246
|
+
- **Line continuity** — horizontals terminate at valid endpoints
|
|
247
|
+
- **Box closure** — no dangling edges
|
|
248
|
+
|
|
249
|
+
#### Output
|
|
250
|
+
|
|
251
|
+
Compiler-like format:
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
file.md:45:12: error: vertical connector '|' at col 12 has no match above
|
|
255
|
+
-> Suggestion: Add '|', '├', '┤', '┬', or '┼' at line 44, col 12
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
| Level | Exit |
|
|
259
|
+
|-------|------|
|
|
260
|
+
| error | 1 |
|
|
261
|
+
| warning | 2 (or 0 with --warn-only) |
|
|
262
|
+
| info / clean | 0 |
|
|
263
|
+
|
|
264
|
+
Validation scope: enclosed box diagrams in fenced code blocks. Skips file trees (`├──`). Detects all line weights (light, double, heavy, rounded).
|
|
265
|
+
|
|
266
|
+
#### Integration
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
# Create → validate → fix → re-validate until clean
|
|
270
|
+
python3 scripts/check_ascii_alignment.py docs/ARCHITECTURE.md
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Anti-patterns
|
|
274
|
+
|
|
275
|
+
- Mixing character sets in one diagram
|
|
276
|
+
- Tabs in diagrams — use spaces; tabs cause false positives
|
|
277
|
+
- Deep nesting (4+ levels) — readability degrades past 3
|
|
278
|
+
- Over-80-col diagrams — break into sections
|
|
279
|
+
- Inline ASCII outside code blocks — always fence
|
|
280
|
+
- PlantUML for one-off simple diagrams — manual ASCII is faster for <5 boxes
|
|
281
|
+
|
|
282
|
+
## Troubleshooting
|
|
283
|
+
|
|
284
|
+
| Issue | Cause | Fix |
|
|
285
|
+
|-------|-------|-----|
|
|
286
|
+
| Garbled Unicode | Terminal lacks UTF-8 support | Ensure UTF-8 locale and monospace font |
|
|
287
|
+
| Misaligned diagram | Wrong font or tab characters | Fixed-width font (Consolas, Courier, Monaco); convert tabs to spaces |
|
|
288
|
+
| PlantUML command not found | Not installed | `java -jar plantuml.jar -txt` as fallback |
|
|
289
|
+
| False positives from tabs | Tab characters misalign columns | Convert tabs to spaces before validation |
|
|
290
|
+
| Diagram wrong but validator passes | Aesthetic spacing not structural | Validator checks structure, not visual alignment — review manually |
|
|
291
|
+
| Validator skipping diagram | Not an enclosed box diagram | Ensure all 4 corners present (`┌┐└┘` or equivalent) |
|
|
292
|
+
| Unicode chars not rendering | Terminal font missing glyphs | Use font with full box-drawing support (Cascadia Code, JetBrains Mono) |
|