openhermes 4.3.0 → 4.11.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 +10 -1
- package/README.md +54 -42
- package/bootstrap.ts +396 -142
- 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 +28 -73
- package/harness/codex/AUTOPILOT.md +235 -87
- package/harness/codex/CHARTER.md +80 -0
- package/harness/instructions/SHELL.md +76 -0
- package/harness/lib/background/background.test.ts +197 -0
- package/harness/lib/background/index.ts +7 -0
- package/harness/lib/background/interfaces.ts +31 -0
- package/harness/lib/background/manager.ts +320 -0
- package/harness/lib/composer/compose.test.ts +168 -0
- package/harness/lib/composer/compose.ts +65 -0
- package/harness/lib/composer/fragments/01-identity.md +1 -0
- package/harness/lib/composer/fragments/02-delegation.md +6 -0
- package/harness/lib/composer/fragments/03-permissions.md +13 -0
- package/harness/lib/composer/fragments/04-task-flow.md +15 -0
- package/harness/lib/composer/fragments/05-confidence.md +5 -0
- package/harness/lib/composer/fragments/06-parallelization.md +17 -0
- package/harness/lib/composer/fragments/07-shell.md +41 -0
- package/harness/lib/composer/fragments/08-routing.md +8 -0
- package/harness/lib/composer/fragments/09-guardrails.md +12 -0
- package/harness/lib/composer/index.ts +1 -0
- package/harness/lib/hooks/builtins/confidence-gate-hook.ts +70 -0
- package/harness/lib/hooks/builtins/delegation-depth-hook.ts +59 -0
- package/harness/lib/hooks/builtins/error-recovery-hook.ts +107 -0
- package/harness/lib/hooks/builtins/memory-sync-hook.ts +73 -0
- package/harness/lib/hooks/builtins/plan-check-hook.ts +43 -0
- package/harness/lib/hooks/builtins/route-tracking-hook.ts +147 -0
- package/harness/lib/hooks/builtins/sanity-check-hook.ts +52 -0
- package/harness/lib/hooks/builtins/shell-detect-hook.ts +96 -0
- package/harness/lib/hooks/hooks.test.ts +1016 -0
- package/harness/lib/hooks/index.ts +30 -0
- package/harness/lib/hooks/registry.ts +416 -0
- package/harness/lib/hooks/types.ts +71 -0
- package/harness/lib/memory/index.ts +18 -0
- package/harness/lib/memory/interfaces.ts +53 -0
- package/harness/lib/memory/memory-manager.ts +205 -0
- package/harness/lib/memory/memory.test.ts +491 -0
- package/harness/lib/memory/plan-store.ts +366 -0
- package/harness/lib/recovery/handler.ts +243 -0
- package/harness/lib/recovery/index.ts +14 -0
- package/harness/lib/recovery/interfaces.ts +48 -0
- package/harness/lib/recovery/patterns.ts +149 -0
- package/harness/lib/recovery/recovery.test.ts +312 -0
- package/harness/lib/sanity/anomaly-tracker.ts +127 -0
- package/harness/lib/sanity/checker.ts +178 -0
- package/harness/lib/sanity/index.ts +13 -0
- package/harness/lib/sanity/interfaces.ts +24 -0
- package/harness/lib/sanity/sanity.test.ts +472 -0
- package/harness/lib/sync/file-watcher.ts +174 -0
- package/harness/lib/sync/index.ts +11 -0
- package/harness/lib/sync/interfaces.ts +27 -0
- package/harness/lib/sync/plan-sync.ts +536 -0
- package/harness/lib/sync/sync.test.ts +832 -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 +12 -90
- package/harness/skills/oh-expert/DEEP.md +85 -0
- package/harness/skills/oh-expert/SKILL.md +13 -106
- package/harness/skills/oh-facade/DEEP.md +182 -0
- package/harness/skills/oh-facade/SKILL.md +15 -279
- package/harness/skills/oh-freeze/DEEP.md +18 -0
- package/harness/skills/oh-freeze/SKILL.md +10 -19
- package/harness/skills/oh-full-output/DEEP.md +25 -0
- package/harness/skills/oh-full-output/SKILL.md +12 -65
- package/harness/skills/oh-fusion/DEEP.md +120 -0
- package/harness/skills/oh-fusion/SKILL.md +17 -295
- package/harness/skills/oh-gauntlet/DEEP.md +77 -0
- package/harness/skills/oh-gauntlet/SKILL.md +13 -105
- package/harness/skills/oh-grill/DEEP.md +51 -0
- package/harness/skills/oh-grill/SKILL.md +12 -63
- package/harness/skills/oh-guard/DEEP.md +19 -0
- package/harness/skills/oh-guard/SKILL.md +10 -24
- package/harness/skills/oh-handoff/DEEP.md +48 -0
- package/harness/skills/oh-handoff/SKILL.md +13 -23
- package/harness/skills/oh-health/DEEP.md +74 -0
- package/harness/skills/oh-health/SKILL.md +13 -76
- package/harness/skills/oh-init/DEEP.md +85 -0
- package/harness/skills/oh-init/SKILL.md +13 -127
- package/harness/skills/oh-investigate/DEEP.md +171 -0
- package/harness/skills/oh-investigate/SKILL.md +13 -66
- package/harness/skills/oh-issue/DEEP.md +21 -0
- package/harness/skills/oh-issue/SKILL.md +11 -27
- package/harness/skills/oh-manifest/DEEP.md +92 -0
- package/harness/skills/oh-manifest/SKILL.md +12 -109
- package/harness/skills/oh-plan-review/DEEP.md +90 -0
- package/harness/skills/oh-plan-review/SKILL.md +13 -115
- package/harness/skills/oh-planner/DEEP.md +172 -0
- package/harness/skills/oh-planner/SKILL.md +12 -149
- package/harness/skills/oh-prd/DEEP.md +45 -0
- package/harness/skills/oh-prd/SKILL.md +10 -26
- package/harness/skills/oh-refactor/DEEP.md +122 -0
- package/harness/skills/oh-refactor/SKILL.md +17 -410
- package/harness/skills/oh-retro/DEEP.md +26 -0
- package/harness/skills/oh-retro/SKILL.md +12 -24
- package/harness/skills/oh-review/DEEP.md +87 -0
- package/harness/skills/oh-review/SKILL.md +11 -97
- package/harness/skills/oh-security/DEEP.md +83 -0
- package/harness/skills/oh-security/SKILL.md +14 -96
- package/harness/skills/oh-ship/DEEP.md +141 -0
- package/harness/skills/oh-ship/SKILL.md +14 -32
- package/harness/skills/oh-skill-craft/DEEP.md +369 -0
- package/harness/skills/oh-skill-craft/SKILL.md +13 -177
- package/harness/skills/oh-skills-link/DEEP.md +16 -0
- package/harness/skills/oh-skills-link/SKILL.md +10 -20
- package/harness/skills/oh-skills-list/DEEP.md +20 -0
- package/harness/skills/oh-skills-list/SKILL.md +9 -22
- package/harness/skills/oh-triage/DEEP.md +23 -0
- package/harness/skills/oh-triage/SKILL.md +8 -24
- package/harness/skills/oh-worktree/DEEP.md +169 -0
- package/harness/skills/oh-worktree/SKILL.md +32 -0
- package/lib/harness-resolver.ts +8 -10
- package/package.json +7 -5
- package/tsconfig.json +1 -1
- package/harness/codex/CONSTITUTION.md +0 -73
- package/harness/codex/ROUTING.md +0 -92
- package/harness/commands/oh-doctor.md +0 -26
- package/harness/commands/oh-log.md +0 -18
- package/harness/instructions/RUNTIME.md +0 -30
- package/harness/skills/oh-caveman/SKILL.md +0 -42
- package/harness/skills/oh-learn/SKILL.md +0 -101
- package/lib/logger.ts +0 -75
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oh-grill
|
|
3
|
-
description: "Stress-
|
|
3
|
+
description: "Stress-tests plans through Socratic questioning to surface assumptions and blind spots"
|
|
4
4
|
tier: 3
|
|
5
|
-
benefits-from: [oh-expert, oh-planner]
|
|
6
|
-
triggers:
|
|
7
|
-
- "stress test this plan"
|
|
8
|
-
- "challenge this plan"
|
|
9
|
-
- "grill me on this"
|
|
10
|
-
- "poke holes in this plan"
|
|
11
|
-
- "interrogate this plan"
|
|
12
|
-
- "stress test this design"
|
|
13
5
|
route:
|
|
14
6
|
pass: oh-planner
|
|
15
7
|
fail: oh-expert
|
|
@@ -18,64 +10,21 @@ route:
|
|
|
18
10
|
|
|
19
11
|
# oh-grill
|
|
20
12
|
|
|
21
|
-
Stress-tests plans
|
|
13
|
+
Stress-tests plans through relentless Socratic questioning. Two modes.
|
|
22
14
|
|
|
23
|
-
##
|
|
24
|
-
Before committing to a plan or design. When the user says "it is writing exactly what I asked for and it is still wrong" — the design concept is not shared yet. Cheaper to resolve in conversation than in code.
|
|
15
|
+
## Steps
|
|
25
16
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
2. Interview the user one decision at a time — each answer reveals new branches
|
|
33
|
-
3. Resolve each branch before moving on
|
|
34
|
-
4. Surface: contradictions, blind spots, unstated assumptions, ambiguous terms
|
|
35
|
-
5. Propose a recommended answer for each decision
|
|
36
|
-
6. Output: verified, stress-tested plan with flagged ambiguities
|
|
37
|
-
|
|
38
|
-
### Mode B: Grill with Docs (thorough)
|
|
39
|
-
Same as Mode A, but persists decisions to CONTEXT.md and ADRs, and extracts a DDD ubiquitous-language glossary.
|
|
40
|
-
|
|
41
|
-
1. Load existing CONTEXT.md and ADRs
|
|
42
|
-
2. Grill through the decision tree — each resolved decision may:
|
|
43
|
-
- Update CONTEXT.md domain terms (sharpen fuzzy language)
|
|
44
|
-
- Create a new ADR for architectural decisions
|
|
45
|
-
- Flag an ambiguity in the domain glossary
|
|
46
|
-
3. **Ubiquitous Language extraction** — after the decision tree resolves, scan the conversation for domain-relevant nouns, verbs, and concepts:
|
|
47
|
-
- Identify problems: same word for different concepts (ambiguity), different words for same concept (synonyms), vague or overloaded terms
|
|
48
|
-
- Propose a canonical glossary with grouped tables (by subdomain, lifecycle, or actor)
|
|
49
|
-
- Write an example dialogue (3-5 exchanges) between dev and domain expert showing natural term usage
|
|
50
|
-
- Write flagged ambiguities section
|
|
51
|
-
4. Persist changes to CONTEXT.md immediately as language firms up
|
|
52
|
-
5. Output: updated CONTEXT.md + new ADRs + UBIQUITOUS_LANGUAGE.md (if significant terms emerged) + verified plan with resolution trail
|
|
53
|
-
|
|
54
|
-
## Technique
|
|
55
|
-
|
|
56
|
-
- Ask one question at a time
|
|
57
|
-
- Propose a recommended answer for each decision
|
|
58
|
-
- Walk the full decision tree before accepting the design
|
|
59
|
-
- Reference domain glossary from CONTEXT.md when terms are ambiguous
|
|
60
|
-
- Cross-reference with existing ADRs when architecture is at stake
|
|
61
|
-
|
|
62
|
-
## When NOT to Use
|
|
63
|
-
- When you already have a clear, vetted plan and need execution
|
|
64
|
-
- When the user needs a builder, not a critic
|
|
65
|
-
- For trivial decisions that don't change the design's shape
|
|
66
|
-
|
|
67
|
-
## Anti-patterns
|
|
68
|
-
- Grilling for the sake of grilling (redundant with existing reviews)
|
|
69
|
-
- Asking questions you could answer by reading the plan or codebase
|
|
70
|
-
- Creating ADRs for trivial decisions (not every choice is architecture)
|
|
71
|
-
- Polishing CONTEXT.md prose before concepts are settled
|
|
72
|
-
- Updating domain terms mid-discussion — let the conversation resolve first
|
|
73
|
-
- Not distinguishing between "must resolve now" vs "figure out later"
|
|
17
|
+
1. Read the plan or design document fully
|
|
18
|
+
2. Interview decisions one at a time — each answer reveals new branches
|
|
19
|
+
3. Resolve each branch before moving to the next decision
|
|
20
|
+
4. Surface contradictions, blind spots, unstated assumptions, ambiguous terms
|
|
21
|
+
5. Propose recommended answer per decision
|
|
22
|
+
6. Output verified plan with flagged ambiguities
|
|
74
23
|
|
|
75
24
|
## Routing
|
|
76
25
|
|
|
77
26
|
| Outcome | Route |
|
|
78
27
|
|---------|-------|
|
|
79
|
-
| pass | → oh-planner
|
|
80
|
-
| fail | → oh-expert
|
|
81
|
-
| blocker | → surface
|
|
28
|
+
| pass | → oh-planner |
|
|
29
|
+
| fail | → oh-expert |
|
|
30
|
+
| blocker | → surface |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# oh-guard — Deep Reference
|
|
2
|
+
|
|
3
|
+
## When to Use
|
|
4
|
+
|
|
5
|
+
When user says "be careful," "don't break anything," or context involves production, destructive changes, or irreversible actions.
|
|
6
|
+
|
|
7
|
+
## What Triggers a Guard Check
|
|
8
|
+
|
|
9
|
+
- File deletion or rename
|
|
10
|
+
- Git destructive operations (reset, rebase, force push)
|
|
11
|
+
- Dependency changes (add/remove/upgrade)
|
|
12
|
+
- Configuration changes affecting auth, network, data
|
|
13
|
+
- Any command with `--force`, `-f`, `--hard`, or destructive flags
|
|
14
|
+
|
|
15
|
+
## Anti-patterns
|
|
16
|
+
|
|
17
|
+
- Guarding trivial operations (wastes time)
|
|
18
|
+
- Forgetting to ask on genuinely destructive operations
|
|
19
|
+
- Asking for confirmation on reads or analysis steps
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oh-guard
|
|
3
|
-
description: "Safety confirmation mode
|
|
3
|
+
description: "Safety confirmation mode that warns before destructive operations."
|
|
4
4
|
tier: 2
|
|
5
|
-
triggers:
|
|
6
|
-
- "confirm before"
|
|
7
|
-
- "safety confirmation"
|
|
8
|
-
- "guard mode"
|
|
9
5
|
route:
|
|
10
6
|
pass: mode
|
|
11
7
|
fail: mode
|
|
@@ -14,29 +10,19 @@ route:
|
|
|
14
10
|
|
|
15
11
|
# oh-guard
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
When touching production, running destructive commands, or working in shared environments. Combines warning prompts with directory-scoped edit locks.
|
|
13
|
+
Require confirmation before destructive operations.
|
|
19
14
|
|
|
20
|
-
##
|
|
21
|
-
1. **Enable guard mode** — set safety level (careful / freeze / full guard)
|
|
22
|
-
2. **Destructive command warnings** — intercept rm -rf, DROP TABLE, force-push, git reset --hard, kubectl delete
|
|
23
|
-
3. **Directory scope lock** — restrict file edits to specified directory (freeze)
|
|
24
|
-
4. **User override** — user can approve or deny each operation
|
|
15
|
+
## Steps
|
|
25
16
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Anti-patterns
|
|
32
|
-
- Disabling guard because "I know what I'm doing" (narrator: they didn't)
|
|
33
|
-
- Running prod commands outside guard mode
|
|
34
|
-
- Ignoring warnings about irreversible operations
|
|
17
|
+
1. Identify the planned write/edit/delete operation
|
|
18
|
+
2. State the planned operation to the user
|
|
19
|
+
3. Ask for explicit confirmation
|
|
20
|
+
4. Proceed only on receiving explicit approval
|
|
35
21
|
|
|
36
22
|
## Routing
|
|
37
23
|
|
|
38
24
|
| Outcome | Route |
|
|
39
25
|
|---------|-------|
|
|
40
|
-
| pass | →
|
|
41
|
-
| fail | →
|
|
42
|
-
| blocker | → surface
|
|
26
|
+
| pass | → mode |
|
|
27
|
+
| fail | → mode |
|
|
28
|
+
| blocker | → surface |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# oh-handoff — Deep Reference
|
|
2
|
+
|
|
3
|
+
## When to Use
|
|
4
|
+
|
|
5
|
+
Session ending, context switch, passing work to another agent, or user says "handoff." Produces a structured document the next session/agent can consume without re-reading the conversation.
|
|
6
|
+
|
|
7
|
+
## Anti-patterns
|
|
8
|
+
|
|
9
|
+
- Writing a transcript instead of a structured summary
|
|
10
|
+
- Including irrelevant context or raw logs
|
|
11
|
+
- Omitting key decisions or blockers
|
|
12
|
+
- Over 500 tokens (handoff must be compact)
|
|
13
|
+
|
|
14
|
+
## Output Template
|
|
15
|
+
|
|
16
|
+
```markdown
|
|
17
|
+
## Goal
|
|
18
|
+
<what this session was trying to achieve>
|
|
19
|
+
|
|
20
|
+
## Progress
|
|
21
|
+
### Done
|
|
22
|
+
- <completed items>
|
|
23
|
+
|
|
24
|
+
### In Progress
|
|
25
|
+
- <current work>
|
|
26
|
+
|
|
27
|
+
### Blocked
|
|
28
|
+
- <blockers>
|
|
29
|
+
|
|
30
|
+
## Key Decisions
|
|
31
|
+
- <decision> — <rationale>
|
|
32
|
+
|
|
33
|
+
## Critical Context
|
|
34
|
+
<bare essentials the next session MUST know>
|
|
35
|
+
|
|
36
|
+
## Relevant Files
|
|
37
|
+
- <file> — <why it matters>
|
|
38
|
+
|
|
39
|
+
## Next Steps
|
|
40
|
+
- <immediate next action>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Rules
|
|
44
|
+
|
|
45
|
+
- Keep under 500 tokens if possible
|
|
46
|
+
- Only what the next session needs to continue — not a transcript
|
|
47
|
+
- Reference plan files by path, don't duplicate content
|
|
48
|
+
- If blockers exist, state what's needed to resolve
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oh-handoff
|
|
3
|
-
description: "Compact session state into a structured handoff document"
|
|
3
|
+
description: "Compact session state into a structured handoff document for transfer"
|
|
4
4
|
tier: 2
|
|
5
|
-
triggers:
|
|
6
|
-
- "session handoff"
|
|
7
|
-
- "handoff to another agent"
|
|
8
|
-
- "handoff the session"
|
|
9
5
|
route:
|
|
10
6
|
pass: done
|
|
11
7
|
fail: surface
|
|
@@ -14,29 +10,23 @@ route:
|
|
|
14
10
|
|
|
15
11
|
# oh-handoff
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
When switching contexts, ending a session, or passing work to another agent or developer. Produces a compact summary that captures everything needed to resume.
|
|
13
|
+
Compact session state into a structured handoff document the next agent can consume without replay.
|
|
19
14
|
|
|
20
|
-
##
|
|
21
|
-
- **Context** — what were we doing?
|
|
22
|
-
- **State** — what's done, what's pending, what's blocked?
|
|
23
|
-
- **Decisions** — key decisions made this session
|
|
24
|
-
- **Artifacts** — files changed, created, or referenced
|
|
25
|
-
- **Next steps** — ordered list of what to do next
|
|
26
|
-
- **Risks** — things to be aware of
|
|
15
|
+
## Steps
|
|
27
16
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
1. Identify session goal and current progress
|
|
18
|
+
2. List completed items
|
|
19
|
+
3. List in-progress items
|
|
20
|
+
4. List blockers with what's needed to resolve
|
|
21
|
+
5. Document key decisions with rationale
|
|
22
|
+
6. Extract critical context — bare essentials only
|
|
23
|
+
7. List relevant files with why they matter
|
|
24
|
+
8. Write immediate next steps
|
|
35
25
|
|
|
36
26
|
## Routing
|
|
37
27
|
|
|
38
28
|
| Outcome | Route |
|
|
39
29
|
|---------|-------|
|
|
40
|
-
| pass | →
|
|
41
|
-
| fail | →
|
|
30
|
+
| pass | → done — session end |
|
|
31
|
+
| fail | → surface gaps to user |
|
|
42
32
|
| blocker | → surface to user |
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# oh-health — Deep Reference
|
|
2
|
+
|
|
3
|
+
## When to Use
|
|
4
|
+
|
|
5
|
+
Use when you need a code quality health check. Read-only dashboard — no fixes.
|
|
6
|
+
|
|
7
|
+
## Verification Discipline
|
|
8
|
+
|
|
9
|
+
Before making any completion claim based on health results, run the Gate:
|
|
10
|
+
|
|
11
|
+
1. **IDENTIFY** — What specific command/check proves this claim?
|
|
12
|
+
2. **RUN** — Execute the full command fresh
|
|
13
|
+
3. **READ** — Full output, exit code, failure count
|
|
14
|
+
4. **VERIFY** — Does output confirm the claim?
|
|
15
|
+
5. **CLAIM** — Only after verification
|
|
16
|
+
|
|
17
|
+
No completion claims without fresh verification evidence.
|
|
18
|
+
|
|
19
|
+
| Claim | Requires | Not Sufficient |
|
|
20
|
+
|-------|----------|----------------|
|
|
21
|
+
| Tests pass | Test command output: 0 failures | Previous run, "should pass" |
|
|
22
|
+
| Linter clean | Linter output: 0 errors | Partial check |
|
|
23
|
+
| Build succeeds | Build command: exit 0 | Linter passing |
|
|
24
|
+
| All checks pass | Each tool run fresh | Aggregated from memory |
|
|
25
|
+
|
|
26
|
+
## Scoring Table
|
|
27
|
+
|
|
28
|
+
| Category | Weight | 10 | 7 | 4 | 0 |
|
|
29
|
+
|----------|--------|----|----|----|----|
|
|
30
|
+
| Type check | 22% | Clean | <10 err | <50 err | 50+ |
|
|
31
|
+
| Lint | 18% | Clean | <5 warn | <20 warn | 20+ |
|
|
32
|
+
| Tests | 28% | All pass | >95% | >80% | <=80% |
|
|
33
|
+
| Dead code | 13% | Clean | <5 items | <20 items | 20+ |
|
|
34
|
+
| Shell lint | 9% | Clean | <5 | 5+ | N/A |
|
|
35
|
+
| Framework | 10% | Native | Config override | Manual | Unmanaged |
|
|
36
|
+
|
|
37
|
+
Skip unavailable → redistribute weight proportionally.
|
|
38
|
+
|
|
39
|
+
## Dashboard Template
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Category Score Status Details
|
|
43
|
+
Type check 10/10 CLEAN 0 errors
|
|
44
|
+
Lint 8/10 WARNING 3 warnings
|
|
45
|
+
Tests 10/10 CLEAN 47/47 pass
|
|
46
|
+
Dead code 7/10 WARNING 4 unused
|
|
47
|
+
|
|
48
|
+
COMPOSITE: 9.1 / 10
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Status: 10=CLEAN, 7-9=WARNING, 4-6=NEEDS WORK, 0-3=CRITICAL.
|
|
52
|
+
|
|
53
|
+
## History Persistence
|
|
54
|
+
|
|
55
|
+
Append JSONL to `.opencode/health-history.jsonl`:
|
|
56
|
+
```json
|
|
57
|
+
{"ts":"...","branch":"main","score":9.1,"typecheck":10,"lint":8,"test":10,"deadcode":7,"duration_s":23}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Trend Analysis
|
|
61
|
+
|
|
62
|
+
Read last 10 entries. Trend table. Identify declining categories. Rank improvements by impact (weight × score deficit).
|
|
63
|
+
|
|
64
|
+
## Rules
|
|
65
|
+
|
|
66
|
+
- Read-only. No fixes. Wrap, don't replace (run project's tools).
|
|
67
|
+
- Skipped ≠ failed (tool not installed → redistribute weight).
|
|
68
|
+
- Show raw output for failures.
|
|
69
|
+
- First run: "No trend data yet."
|
|
70
|
+
|
|
71
|
+
## Anti-patterns
|
|
72
|
+
|
|
73
|
+
- Claiming results without re-running checks.
|
|
74
|
+
- Aggregating from memory instead of running fresh.
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oh-health
|
|
3
|
-
description: "Code quality
|
|
3
|
+
description: "Code quality health check — runs all project tools, scores 0-10, shows trends"
|
|
4
4
|
tier: 2
|
|
5
|
-
triggers:
|
|
6
|
-
- "health check the codebase"
|
|
7
|
-
- "code quality check"
|
|
8
|
-
- "quality dashboard"
|
|
9
|
-
- "how healthy is the codebase"
|
|
10
|
-
- "run all project checks"
|
|
11
|
-
- "code health"
|
|
12
5
|
route:
|
|
13
6
|
pass: surface
|
|
14
7
|
fail: oh-investigate
|
|
@@ -17,78 +10,22 @@ route:
|
|
|
17
10
|
|
|
18
11
|
# oh-health
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
Run all available project tools, score 0-10, and surface a composite dashboard with trend history.
|
|
21
14
|
|
|
22
|
-
##
|
|
15
|
+
## Steps
|
|
23
16
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Present detected tools. Optionally persist to CLAUDE.md as `## Health Stack` section for future runs.
|
|
33
|
-
|
|
34
|
-
### Step 2: Run Tools
|
|
35
|
-
Run each tool sequentially (some share resources). Capture exit code + output summary for each.
|
|
36
|
-
|
|
37
|
-
### Step 3: Score Each Category
|
|
38
|
-
|
|
39
|
-
| Category | Weight | 10 | 7 | 4 | 0 |
|
|
40
|
-
|---|---|---|---|---|---|
|
|
41
|
-
| Type check | 22% | Clean | <10 errors | <50 errors | 50+ |
|
|
42
|
-
| Lint | 18% | Clean | <5 warnings | <20 warnings | 20+ |
|
|
43
|
-
| Tests | 28% | All pass | >95% pass | >80% pass | <=80% |
|
|
44
|
-
| Dead code | 13% | Clean | <5 unused | <20 unused | 20+ |
|
|
45
|
-
| Shell lint | 9% | Clean | <5 issues | 5+ issues | N/A |
|
|
46
|
-
| Framework | 10% | Native default | Config override | Manual | Unmanaged |
|
|
47
|
-
|
|
48
|
-
Skip unavailable categories and redistribute weight proportionally among remaining.
|
|
49
|
-
|
|
50
|
-
### Step 4: Present Dashboard
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
CODE HEALTH DASHBOARD
|
|
54
|
-
═════════════════════
|
|
55
|
-
Project: <name>
|
|
56
|
-
Branch: <branch>
|
|
57
|
-
Date: <date>
|
|
58
|
-
|
|
59
|
-
Category Score Status Details
|
|
60
|
-
────────── ───── ──────── ───────
|
|
61
|
-
Type check 10/10 CLEAN 0 errors
|
|
62
|
-
Lint 8/10 WARNING 3 warnings
|
|
63
|
-
Tests 10/10 CLEAN 47/47 passed
|
|
64
|
-
Dead code 7/10 WARNING 4 unused exports
|
|
65
|
-
|
|
66
|
-
COMPOSITE: 9.1 / 10
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Status labels: 10=CLEAN, 7-9=WARNING, 4-6=NEEDS WORK, 0-3=CRITICAL.
|
|
70
|
-
|
|
71
|
-
### Step 5: Persist History
|
|
72
|
-
Append one JSONL line to `.opencode/health-history.jsonl`:
|
|
73
|
-
```json
|
|
74
|
-
{"ts":"2026-05-14T14:30:00Z","branch":"main","score":9.1,"typecheck":10,"lint":8,"test":10,"deadcode":7,"duration_s":23}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Step 6: Trend Analysis + Recommendations
|
|
78
|
-
Read last 10 history entries. Show trend table. For regressions, identify declining categories and specific errors. Rank improvement suggestions by impact (weight × score deficit).
|
|
79
|
-
|
|
80
|
-
## Rules
|
|
81
|
-
|
|
82
|
-
- **Read-only.** No fixes. Dashboard and recommendations only.
|
|
83
|
-
- **Wrap, don't replace.** Run the project's own tools. Never substitute your own analysis.
|
|
84
|
-
- **Skipped is not failed.** Tool not installed → skip gracefully, redistribute weight.
|
|
85
|
-
- **Show raw output for failures.** Include tool output so user can act without re-running.
|
|
86
|
-
- **Trends require history.** First run: "No trend data yet. Run again after changes to track progress."
|
|
17
|
+
1. Detect available health tools (typecheck, lint, test runner, dead code, shell lint, framework)
|
|
18
|
+
2. Run each detected tool sequentially, capture exit code and output summary
|
|
19
|
+
3. Score each category using the weighted table (Type check 22%, Lint 18%, Tests 28%, Dead code 13%, Shell lint 9%, Framework 10%)
|
|
20
|
+
4. Build composite score with status bands: 10=CLEAN, 7-9=WARNING, 4-6=NEEDS WORK, 0-3=CRITICAL
|
|
21
|
+
5. Persist result to `.opencode/health-history.jsonl`
|
|
22
|
+
6. Read last 10 entries and produce trend analysis
|
|
23
|
+
7. Surface the dashboard with per-category scores, composite score, and trend
|
|
87
24
|
|
|
88
25
|
## Routing
|
|
89
26
|
|
|
90
27
|
| Outcome | Route |
|
|
91
28
|
|---------|-------|
|
|
92
|
-
| pass | →
|
|
93
|
-
| fail | → oh-investigate
|
|
94
|
-
| blocker | → surface
|
|
29
|
+
| pass | → surface |
|
|
30
|
+
| fail | → oh-investigate |
|
|
31
|
+
| blocker | → surface |
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# oh-init — Deep Reference
|
|
2
|
+
|
|
3
|
+
## When to Use
|
|
4
|
+
|
|
5
|
+
Per-repo OpenHermes setup. One-time. Complements OpenCode's `/init` (run after or instead).
|
|
6
|
+
|
|
7
|
+
## Workflow / Phases
|
|
8
|
+
|
|
9
|
+
### Phase 0: Check Existing State
|
|
10
|
+
|
|
11
|
+
Detect: AGENTS.md, opencode.json, plan files, CONTEXT.md, `docs/agents/`. Report findings. All exist → offer skip/verify.
|
|
12
|
+
|
|
13
|
+
### Phase 1: AGENTS.md
|
|
14
|
+
|
|
15
|
+
**Not exists:** Create with OH orchestrator header + project context prompts:
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
# <project>
|
|
19
|
+
|
|
20
|
+
OpenHermes is the primary orchestrator. All routing, planning, and delegation flows through oh-* skills.
|
|
21
|
+
|
|
22
|
+
## Project Context
|
|
23
|
+
- **Language**: <fill or auto-detect>
|
|
24
|
+
- **Package manager**: <fill or auto-detect>
|
|
25
|
+
- **Build command**: <fill or auto-detect>
|
|
26
|
+
- **Test command**: <fill or auto-detect>
|
|
27
|
+
|
|
28
|
+
## Key Directives
|
|
29
|
+
- Plan first. Write to `~/.local/share/openhermes/plans/<project>/plan-<nnn>.md` before multi-file changes.
|
|
30
|
+
- OpenHermes delegates everything to sub-agents — never executes directly.
|
|
31
|
+
- Verify before claiming success. Read files, run commands, confirm output.
|
|
32
|
+
- Use oh-* skills on demand via the skill tool.
|
|
33
|
+
- Plan file is self-contained (Tasks, Completed, Work Log sections).
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Ask user to fill or auto-detect from manifests.
|
|
37
|
+
|
|
38
|
+
**Exists:** Append this `## OpenHermes Orchestrator` section:
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
## OpenHermes Orchestrator
|
|
42
|
+
OpenHermes is the primary orchestrator.
|
|
43
|
+
- **Plan**: `~/.local/share/openhermes/plans/<project>/plan-<nnn>.md`
|
|
44
|
+
- **Never execute**: delegates everything to sub-agents
|
|
45
|
+
- **Verify before claim**: read files, run commands, confirm output
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Phase 2: Issue Tracker
|
|
49
|
+
|
|
50
|
+
Detect platform (GitHub → gh, GitLab → glab, local markdown, other). Confirm with user. Write to `docs/agents/issue-tracker.md`.
|
|
51
|
+
|
|
52
|
+
### Phase 3: Triage Labels
|
|
53
|
+
|
|
54
|
+
States: `needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix`. Map to existing labels. Write to `docs/agents/triage-labels.md`.
|
|
55
|
+
|
|
56
|
+
### Phase 4: Domain Docs
|
|
57
|
+
|
|
58
|
+
Single-context (CONTEXT.md + docs/adr/) or multi-context (CONTEXT-MAP.md). Scaffold CONTEXT.md with project name, domain, glossary placeholders. Create `docs/adr/` with ADR template. Write to `docs/agents/domain.md`.
|
|
59
|
+
|
|
60
|
+
### Phase 5: Agent Skills Block
|
|
61
|
+
|
|
62
|
+
Append to AGENTS.md:
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
## Agent skills
|
|
66
|
+
### Issue tracker
|
|
67
|
+
See `docs/agents/issue-tracker.md`.
|
|
68
|
+
### Triage labels
|
|
69
|
+
See `docs/agents/triage-labels.md`.
|
|
70
|
+
### Domain docs
|
|
71
|
+
See `docs/agents/domain.md`.
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Phase 6: Decision Record
|
|
75
|
+
|
|
76
|
+
"oh-init completed for project <name> on <date>."
|
|
77
|
+
|
|
78
|
+
## Anti-patterns
|
|
79
|
+
|
|
80
|
+
- Running without understanding domain
|
|
81
|
+
- Empty CONTEXT.md (populate terms)
|
|
82
|
+
- ADR dir without ADRs
|
|
83
|
+
- Both AGENTS.md and CLAUDE.md (edit the one that exists)
|
|
84
|
+
- Overwriting existing AGENTS.md (append)
|
|
85
|
+
- Creating .opencode/ dir (plan files go to canonical storage)
|