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.
Files changed (99) hide show
  1. package/CONTEXT.md +9 -0
  2. package/ETHOS.md +6 -3
  3. package/LICENSE +21 -21
  4. package/README.md +120 -79
  5. package/bootstrap.ts +284 -41
  6. package/harness/agents/oh-browser.md +97 -0
  7. package/harness/agents/oh-builder.md +78 -0
  8. package/harness/agents/oh-facade.md +75 -0
  9. package/harness/agents/oh-fusion.md +45 -0
  10. package/harness/agents/oh-gauntlet.md +71 -0
  11. package/harness/agents/oh-grill.md +71 -0
  12. package/harness/agents/oh-investigate.md +60 -0
  13. package/harness/agents/oh-manifest.md +95 -0
  14. package/harness/agents/oh-plan-review.md +40 -0
  15. package/harness/agents/oh-planner.md +50 -0
  16. package/harness/agents/oh-refactor.md +37 -0
  17. package/harness/agents/oh-retro.md +46 -0
  18. package/harness/agents/oh-review.md +85 -0
  19. package/harness/agents/oh-security.md +83 -0
  20. package/harness/agents/oh-ship.md +76 -0
  21. package/harness/agents/oh-skill-craft.md +38 -0
  22. package/harness/agents/openhermes.md +106 -62
  23. package/harness/codex/AUTOPILOT.md +178 -0
  24. package/harness/codex/CHARTER.md +81 -0
  25. package/harness/commands/oh-doctor.md +193 -14
  26. package/harness/commands/oh-log.md +18 -0
  27. package/harness/instructions/SHELL.md +76 -0
  28. package/harness/skills/oh-ascii/DEEP.md +292 -0
  29. package/harness/skills/oh-ascii/SKILL.md +31 -0
  30. package/harness/skills/oh-ascii/scripts/check_ascii_alignment.py +596 -0
  31. package/harness/skills/oh-browser/DEEP.md +54 -0
  32. package/harness/skills/oh-browser/SKILL.md +30 -0
  33. package/harness/skills/oh-builder/DEEP.md +63 -0
  34. package/harness/skills/oh-builder/SKILL.md +16 -89
  35. package/harness/skills/oh-expert/DEEP.md +85 -0
  36. package/harness/skills/oh-expert/SKILL.md +19 -106
  37. package/harness/skills/oh-facade/DEEP.md +182 -0
  38. package/harness/skills/oh-facade/SKILL.md +34 -0
  39. package/harness/skills/oh-freeze/DEEP.md +18 -0
  40. package/harness/skills/oh-freeze/SKILL.md +15 -15
  41. package/harness/skills/oh-full-output/DEEP.md +25 -0
  42. package/harness/skills/oh-full-output/SKILL.md +28 -0
  43. package/harness/skills/oh-fusion/DEEP.md +120 -0
  44. package/harness/skills/oh-fusion/SKILL.md +36 -0
  45. package/harness/skills/oh-gauntlet/DEEP.md +77 -0
  46. package/harness/skills/oh-gauntlet/SKILL.md +17 -105
  47. package/harness/skills/oh-grill/DEEP.md +51 -0
  48. package/harness/skills/oh-grill/SKILL.md +16 -63
  49. package/harness/skills/oh-guard/DEEP.md +19 -0
  50. package/harness/skills/oh-guard/SKILL.md +15 -20
  51. package/harness/skills/oh-handoff/DEEP.md +48 -0
  52. package/harness/skills/oh-handoff/SKILL.md +18 -19
  53. package/harness/skills/oh-health/DEEP.md +74 -0
  54. package/harness/skills/oh-health/SKILL.md +17 -76
  55. package/harness/skills/oh-init/DEEP.md +85 -0
  56. package/harness/skills/oh-init/SKILL.md +17 -197
  57. package/harness/skills/oh-investigate/DEEP.md +171 -0
  58. package/harness/skills/oh-investigate/SKILL.md +18 -61
  59. package/harness/skills/oh-issue/DEEP.md +21 -0
  60. package/harness/skills/oh-issue/SKILL.md +16 -23
  61. package/harness/skills/oh-learn/DEEP.md +44 -0
  62. package/harness/skills/oh-learn/SKILL.md +17 -79
  63. package/harness/skills/oh-manifest/DEEP.md +92 -0
  64. package/harness/skills/oh-manifest/SKILL.md +15 -107
  65. package/harness/skills/oh-plan-review/DEEP.md +90 -0
  66. package/harness/skills/oh-plan-review/SKILL.md +19 -114
  67. package/harness/skills/oh-planner/DEEP.md +172 -0
  68. package/harness/skills/oh-planner/SKILL.md +16 -143
  69. package/harness/skills/oh-prd/DEEP.md +45 -0
  70. package/harness/skills/oh-prd/SKILL.md +15 -22
  71. package/harness/skills/oh-refactor/DEEP.md +122 -0
  72. package/harness/skills/oh-refactor/SKILL.md +33 -0
  73. package/harness/skills/oh-retro/DEEP.md +26 -0
  74. package/harness/skills/oh-retro/SKILL.md +17 -20
  75. package/harness/skills/oh-review/DEEP.md +87 -0
  76. package/harness/skills/oh-review/SKILL.md +17 -96
  77. package/harness/skills/oh-security/DEEP.md +83 -0
  78. package/harness/skills/oh-security/SKILL.md +18 -96
  79. package/harness/skills/oh-ship/DEEP.md +141 -0
  80. package/harness/skills/oh-ship/SKILL.md +18 -26
  81. package/harness/skills/oh-skill-craft/DEEP.md +369 -0
  82. package/harness/skills/oh-skill-craft/SKILL.md +20 -93
  83. package/harness/skills/oh-skills-link/DEEP.md +16 -0
  84. package/harness/skills/oh-skills-link/SKILL.md +15 -16
  85. package/harness/skills/oh-skills-list/DEEP.md +20 -0
  86. package/harness/skills/oh-skills-list/SKILL.md +14 -18
  87. package/harness/skills/oh-triage/DEEP.md +23 -0
  88. package/harness/skills/oh-triage/SKILL.md +15 -20
  89. package/harness/skills/oh-worktree/DEEP.md +169 -0
  90. package/harness/skills/oh-worktree/SKILL.md +32 -0
  91. package/lib/harness-resolver.ts +10 -12
  92. package/package.json +9 -4
  93. package/scripts/count-tokens.mjs +158 -0
  94. package/scripts/oh-doctor.ps1 +342 -0
  95. package/harness/codex/CONSTITUTION.md +0 -70
  96. package/harness/codex/ROUTING.md +0 -127
  97. package/harness/instructions/RUNTIME.md +0 -55
  98. package/harness/skills/oh-caveman/SKILL.md +0 -33
  99. package/lib/logger.ts +0 -69
@@ -1,33 +1,28 @@
1
1
  ---
2
2
  name: oh-guard
3
- description: "Safety confirmation mode warn before destructive operations"
3
+ description: "Safety confirmation mode that warns before destructive operations."
4
+ tier: 2
5
+ route:
6
+ pass: mode
7
+ fail: mode
8
+ blocker: surface
4
9
  ---
5
10
 
6
11
  # oh-guard
7
12
 
8
- ## When to Use
9
- 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.
10
14
 
11
- ## Workflow
12
- 1. **Enable guard mode** — set safety level (careful / freeze / full guard)
13
- 2. **Destructive command warnings** — intercept rm -rf, DROP TABLE, force-push, git reset --hard, kubectl delete
14
- 3. **Directory scope lock** — restrict file edits to specified directory (freeze)
15
- 4. **User override** — user can approve or deny each operation
15
+ ## Steps
16
16
 
17
- ## Modes
18
- - **Careful** warn before destructive commands
19
- - **Freeze** restrict edits to one directory
20
- - **Guard** both careful + freeze
21
-
22
- ## Anti-patterns
23
- - Disabling guard because "I know what I'm doing" (narrator: they didn't)
24
- - Running prod commands outside guard mode
25
- - 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
26
21
 
27
22
  ## Routing
28
23
 
29
24
  | Outcome | Route |
30
25
  |---------|-------|
31
- | pass | → [return to prior skill — guard mode active] |
32
- | fail | → [surface warning — operation denied] |
33
- | blocker | → surface to user |
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,33 +1,32 @@
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
+ tier: 2
5
+ route:
6
+ pass: done
7
+ fail: surface
8
+ blocker: surface
4
9
  ---
5
10
 
6
11
  # oh-handoff
7
12
 
8
- ## When to Use
9
- 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.
10
14
 
11
- ## Handoff Document Structure
12
- - **Context** — what were we doing?
13
- - **State** — what's done, what's pending, what's blocked?
14
- - **Decisions** — key decisions made this session
15
- - **Artifacts** — files changed, created, or referenced
16
- - **Next steps** — ordered list of what to do next
17
- - **Risks** — things to be aware of
15
+ ## Steps
18
16
 
19
- ## Output
20
- A `HANDOFF.md` or structured text block with all resume-relevant information.
21
-
22
- ## Anti-patterns
23
- - Writing a novel (handoff should be scannable in 30 seconds)
24
- - Omitting decisions (why we chose X over Y is critical context)
25
- - No next steps ("figure it out" is not a handoff)
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
26
25
 
27
26
  ## Routing
28
27
 
29
28
  | Outcome | Route |
30
29
  |---------|-------|
31
- | pass | → [end of session intentional terminal] |
32
- | fail | → [surface blocker handoff incomplete] |
30
+ | pass | → done session end |
31
+ | fail | → surface gaps to user |
33
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,90 +1,31 @@
1
1
  ---
2
2
  name: oh-health
3
- description: "Code quality dashboard: runs project tools (typecheck, lint, test, dead code detection), computes weighted composite 0-10 score, persists history, shows trend. Read-only — no fixes."
3
+ description: "Code quality health check — runs all project tools, scores 0-10, shows trends"
4
4
  tier: 2
5
- triggers:
6
- - "health check"
7
- - "code quality"
8
- - "quality dashboard"
9
- - "how healthy is the codebase"
10
- - "run all checks"
11
- - "health"
5
+ route:
6
+ pass: surface
7
+ fail: oh-investigate
8
+ blocker: surface
12
9
  ---
13
10
 
14
11
  # oh-health
15
12
 
16
- Staff Engineer who owns the CI dashboard. Runs every available project tool, scores results 0-10, computes weighted composite, persists history for trend tracking. Read-only — the user decides what to act on.
13
+ Run all available project tools, score 0-10, and surface a composite dashboard with trend history.
17
14
 
18
- ## Process
15
+ ## Steps
19
16
 
20
- ### Step 1: Detect Health Stack
21
- Auto-detect available tools:
22
- - **Type checker** `tsc --noEmit` (tsconfig.json present), `mypy` (pyproject.toml), or none
23
- - **Linter** biome, eslint, ruff/pylint, or none
24
- - **Test runner** from package.json scripts, pytest, cargo test, go test
25
- - **Dead code** knip, or none
26
- - **Shell lint** shellcheck for .sh files
27
-
28
- Present detected tools. Optionally persist to CLAUDE.md as `## Health Stack` section for future runs.
29
-
30
- ### Step 2: Run Tools
31
- Run each tool sequentially (some share resources). Capture exit code + output summary for each.
32
-
33
- ### Step 3: Score Each Category
34
-
35
- | Category | Weight | 10 | 7 | 4 | 0 |
36
- |---|---|---|---|---|---|
37
- | Type check | 22% | Clean | <10 errors | <50 errors | 50+ |
38
- | Lint | 18% | Clean | <5 warnings | <20 warnings | 20+ |
39
- | Tests | 28% | All pass | >95% pass | >80% pass | <=80% |
40
- | Dead code | 13% | Clean | <5 unused | <20 unused | 20+ |
41
- | Shell lint | 9% | Clean | <5 issues | 5+ issues | N/A |
42
- | Framework | 10% | Native default | Config override | Manual | Unmanaged |
43
-
44
- Skip unavailable categories and redistribute weight proportionally among remaining.
45
-
46
- ### Step 4: Present Dashboard
47
-
48
- ```
49
- CODE HEALTH DASHBOARD
50
- ═════════════════════
51
- Project: <name>
52
- Branch: <branch>
53
- Date: <date>
54
-
55
- Category Score Status Details
56
- ────────── ───── ──────── ───────
57
- Type check 10/10 CLEAN 0 errors
58
- Lint 8/10 WARNING 3 warnings
59
- Tests 10/10 CLEAN 47/47 passed
60
- Dead code 7/10 WARNING 4 unused exports
61
-
62
- COMPOSITE: 9.1 / 10
63
- ```
64
-
65
- Status labels: 10=CLEAN, 7-9=WARNING, 4-6=NEEDS WORK, 0-3=CRITICAL.
66
-
67
- ### Step 5: Persist History
68
- Append one JSONL line to `.opencode/health-history.jsonl`:
69
- ```json
70
- {"ts":"2026-05-14T14:30:00Z","branch":"main","score":9.1,"typecheck":10,"lint":8,"test":10,"deadcode":7,"duration_s":23}
71
- ```
72
-
73
- ### Step 6: Trend Analysis + Recommendations
74
- Read last 10 history entries. Show trend table. For regressions, identify declining categories and specific errors. Rank improvement suggestions by impact (weight × score deficit).
75
-
76
- ## Rules
77
-
78
- - **Read-only.** No fixes. Dashboard and recommendations only.
79
- - **Wrap, don't replace.** Run the project's own tools. Never substitute your own analysis.
80
- - **Skipped is not failed.** Tool not installed → skip gracefully, redistribute weight.
81
- - **Show raw output for failures.** Include tool output so user can act without re-running.
82
- - **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
83
24
 
84
25
  ## Routing
85
26
 
86
27
  | Outcome | Route |
87
28
  |---------|-------|
88
- | pass | → [report score to user] |
89
- | fail | → oh-investigate (deepen on degraded metrics) |
90
- | blocker | → surface to user |
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/opencode/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/opencode/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)
@@ -1,211 +1,31 @@
1
1
  ---
2
2
  name: oh-init
3
- description: "Initialize project for OpenHermes takeover: scaffold .opencode/ runtime skeleton, wire AGENTS.md, configure domain docs, issue tracker, and triage labels."
3
+ description: "Sets up AGENTS.md, domain docs, issue tracker, and triage labels"
4
4
  tier: 2
5
- triggers:
6
- - "init project"
7
- - "setup project"
8
- - "initialize"
9
- - "onboard"
10
- - "scaffold"
11
- - "takeover"
5
+ route:
6
+ pass: done
7
+ fail: oh-init
8
+ blocker: surface
12
9
  ---
13
10
 
14
11
  # oh-init
15
12
 
16
- Per-repo setup for OpenHermes-assisted development. Run once per repo. Wires the `.opencode/` runtime skeleton, connects `AGENTS.md` to the orchestrator, then walks through domain/issue configuration decisions one at a time.
13
+ Wire AGENTS.md, domain docs, issue tracker, and triage labels for a new OpenHermes project.
17
14
 
18
- Complements OpenCode's built-in `/init` command (which creates `AGENTS.md` with project build/test/architecture notes). Run oh-init after or instead — they serve different layers.
15
+ ## Steps
19
16
 
20
- ## Process
21
-
22
- ### Phase 0: Check Existing State
23
- Before writing anything, detect what already exists:
24
-
25
- - `.opencode/` directory present?
26
- - `.opencode/plan.md` exists?
27
- - ☐ `.opencode/todo.md` exists?
28
- - ☐ `.opencode/work-log.md` exists?
29
- - ☐ `.opencode/instincts.jsonl` exists?
30
- - ☐ `AGENTS.md` exists? (If yes, was it created by OpenCode `/init` or manually?)
31
- - ☐ `opencode.json` / `opencode.jsonc` present?
32
-
33
- Report findings. If everything exists, offer to skip or verify and exit.
34
-
35
- ### Phase 1: .opencode/ Runtime Skeleton
36
- Create `.opencode/` directory if missing. Scaffold shared state files:
37
-
38
- **`.opencode/plan.md`** — working plan for the current session. Uses the same format as the global permanent plan directory (`%USERPROFILE%/.config/opencode/task/<project>-plan-<nnn>.md`). When a plan is completed, copy to the global directory with sequenced naming for permanent archive.
39
-
40
- ```markdown
41
- # PLAN: <project-name>
42
-
43
- Plan ID: <project-name>-plan-<nnn>
44
- Project: <project-name>
45
- Status: active
46
- Created: <local-date-time>
47
- Updated: <local-date-time>
48
- Project Path: <absolute-project-path>
49
- Plan Path: .opencode/plan.md
50
- Objective: <short objective>
51
-
52
- ## Current State
53
-
54
- ## Assumptions
55
-
56
- ## Tasks
57
-
58
- - [ ] Task 1
59
- - [ ] Subtask 1.1
60
-
61
- ## Active Task
62
-
63
- ## Subagents
64
-
65
- | Agent | Purpose | Status | Findings |
66
- |---|---|---|---|
67
-
68
- ## Completed
69
-
70
- ## Blockers
71
-
72
- - None
73
-
74
- ## Validation
75
-
76
- - [ ] Static checks
77
- - [ ] Formatting checks
78
- - [ ] Type checks
79
- - [ ] Unit tests
80
- - [ ] Integration checks
81
- - [ ] Manual verification
82
-
83
- ## Decisions
84
-
85
- ## Notes
86
- ```
87
-
88
- **`.opencode/todo.md`** — task tracking for multi-step work (start empty).
89
-
90
- **`.opencode/work-log.md`** — progress tracking across subagent delegations:
91
- ```markdown
92
- # Work Log
93
-
94
- ## <date> — <description>
95
- - Started: <time>
96
- - Completed: <task>
97
- - Next: <next task>
98
- ```
99
-
100
- **`.opencode/instincts.jsonl`** — behavioral pattern store for oh-learn (start as empty file). Will grow organically as the agent extracts patterns from sessions.
101
-
102
- ### Phase 2: AGENTS.md Wiring
103
-
104
- Check if AGENTS.md exists:
105
-
106
- **If AGENTS.md does not exist:**
107
- Create it with OpenHermes orchestrator header + prompts for project info:
108
-
109
- ```markdown
110
- # <project-name>
111
-
112
- OpenHermes is the primary orchestrator. All routing, planning, and delegation flows through oh-* skills.
113
-
114
- ## Project Context
115
-
116
- - **Language**: <fill in>
117
- - **Package manager**: <fill in>
118
- - **Build command**: <fill in>
119
- - **Test command**: <fill in>
120
- - **Lint/type check**: <fill in>
121
-
122
- ## Key Directives
123
-
124
- - Plan first. Write to `.opencode/plan.md` before multi-file changes.
125
- - Verify before claiming success. Read files, run commands, confirm output.
126
- - Delegate substantive work to subagents — main context orchestrates.
127
- - Use oh-* skills on demand. Load via OpenCode's skill tool when relevant.
128
- - Shared state lives in `.opencode/` (plan.md, todo.md, work-log.md, instincts.jsonl).
129
- ```
130
-
131
- Then ask the user to fill in the Project Context fields. Offer to auto-detect from package manifests.
132
-
133
- **If AGENTS.md exists** (e.g., created by OpenCode `/init`):
134
- Append an `## OpenHermes Orchestrator` section to the end:
135
-
136
- ```markdown
137
- ## OpenHermes Orchestrator
138
-
139
- OpenHermes is the primary orchestrator for this session.
140
-
141
- - **Orchestrator**: OpenHermes — hub-and-spoke routing through oh-* skills
142
- - **Plan**: `.opencode/plan.md` — always check before starting work
143
- - **Shared state**: `.opencode/todo.md`, `.opencode/work-log.md`, `.opencode/instincts.jsonl`
144
- - **Verify before claim**: read files, run commands, confirm output
145
- - **Delegate**: subagents for implementation, main context orchestrates
146
- ```
147
-
148
- ### Phase 3: Issue Tracker
149
- Detect the git hosting platform:
150
- - **GitHub** — `gh` CLI
151
- - **GitLab** — `glab` CLI
152
- - **Local markdown** — files under `.scratch/<feature>/`
153
- - **Other** — freeform workflow description
154
-
155
- Confirm with the user. Write the result to `docs/agents/issue-tracker.md`.
156
-
157
- ### Phase 4: Triage Labels
158
- The `triage` skill uses these label strings to move issues through a state machine:
159
- - `needs-triage` — maintainer needs to evaluate
160
- - `needs-info` — waiting on reporter
161
- - `ready-for-agent` — fully specified, AFK-ready
162
- - `ready-for-human` — needs human implementation
163
- - `wontfix` — will not be actioned
164
-
165
- If the repo already has different label names, map them. Write to `docs/agents/triage-labels.md`.
166
-
167
- ### Phase 5: Domain Docs
168
- Configure how the project organizes domain language:
169
- - **Single-context** — one `CONTEXT.md` + `docs/adr/` at repo root
170
- - **Multi-context** — `CONTEXT-MAP.md` pointing to per-context files
171
-
172
- Scaffold `CONTEXT.md` with project name, domain description, and placeholder glossary terms. Create `docs/adr/` directory with ADR template.
173
-
174
- Write to `docs/agents/domain.md`.
175
-
176
- ### Phase 6: Agent Skills Block
177
- Add a `## Agent skills` section to `AGENTS.md` (or `CLAUDE.md` if it exists):
178
-
179
- ```markdown
180
- ## Agent skills
181
-
182
- ### Issue tracker
183
- <summary>. See docs/agents/issue-tracker.md.
184
-
185
- ### Triage labels
186
- <summary>. See docs/agents/triage-labels.md.
187
-
188
- ### Domain docs
189
- <summary>. See docs/agents/domain.md.
190
- ```
191
-
192
- ### Phase 7: Decision Record
193
- Record: "oh-init completed for project <name> on <date>."
194
-
195
- ## Anti-patterns
196
- - Running init without understanding the project domain
197
- - Scaffolding CONTEXT.md without populating any terms
198
- - Creating ADR directory but never writing ADRs
199
- - Creating both AGENTS.md and CLAUDE.md — edit the one that exists
200
- - Overwriting an existing AGENTS.md created by OpenCode `/init` (append instead)
201
- - Scaffolding `.opencode/` files that already exist (check first, skip duplicates)
202
- - Empty instinct file never getting populated (run oh-learn extract periodically)
203
- - Never archiving completed plans to the global task directory (completed plans rot in `.opencode/` instead of becoming permanent records)
17
+ 1. Check existing state (AGENTS.md, opencode.json, plan files, CONTEXT.md, docs/agents/)
18
+ 2. Create AGENTS.md with OH orchestrator header or append OH section to existing
19
+ 3. Detect issue tracker platform, confirm with user, write to docs/agents/issue-tracker.md
20
+ 4. Define triage labels (needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix), write to docs/agents/triage-labels.md
21
+ 5. Scaffold CONTEXT.md with project name, domain, glossary placeholders; create docs/adr/ with ADR template; write to docs/agents/domain.md
22
+ 6. Append Agent skills block referencing tracker, triage, and domain docs
23
+ 7. Record decision artifact
204
24
 
205
25
  ## Routing
206
26
 
207
27
  | Outcome | Route |
208
28
  |---------|-------|
209
- | pass | → [done — one-time project setup] |
210
- | fail | → [retry with user corrections] |
211
- | blocker | → surface to user |
29
+ | pass | → done |
30
+ | fail | → oh-init |
31
+ | blocker | → surface |