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
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oh-guard
|
|
3
|
-
description: "Safety confirmation mode
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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 | →
|
|
32
|
-
| fail | →
|
|
33
|
-
| 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,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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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 | →
|
|
32
|
-
| fail | →
|
|
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
|
|
3
|
+
description: "Code quality health check — runs all project tools, scores 0-10, shows trends"
|
|
4
4
|
tier: 2
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
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
|
-
|
|
13
|
+
Run all available project tools, score 0-10, and surface a composite dashboard with trend history.
|
|
17
14
|
|
|
18
|
-
##
|
|
15
|
+
## Steps
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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 | →
|
|
89
|
-
| fail | → oh-investigate
|
|
90
|
-
| 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/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: "
|
|
3
|
+
description: "Sets up AGENTS.md, domain docs, issue tracker, and triage labels"
|
|
4
4
|
tier: 2
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
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
|
-
|
|
13
|
+
Wire AGENTS.md, domain docs, issue tracker, and triage labels for a new OpenHermes project.
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
## Steps
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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 | →
|
|
210
|
-
| fail | →
|
|
211
|
-
| blocker | → surface
|
|
29
|
+
| pass | → done |
|
|
30
|
+
| fail | → oh-init |
|
|
31
|
+
| blocker | → surface |
|