@skyf0xx/hedgehog 6.4.3 → 6.5.0

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/README.md CHANGED
@@ -251,6 +251,12 @@ gemini extensions install https://github.com/skyf0xx/hedgehog
251
251
  git clone https://github.com/skyf0xx/hedgehog ~/.cursor/plugins/local/hedgehog
252
252
  ```
253
253
 
254
+ ### OpenCode
255
+
256
+ ``` bash
257
+ npx @skyf0xx/hedgehog init --host=opencode
258
+ ```
259
+
254
260
  Then open a project and describe what you want to build and mention `hedgehog`.
255
261
 
256
262
  On a fresh project with no warm pnpm store, that first install can take
package/bin/cli.mjs CHANGED
@@ -724,7 +724,8 @@ ${bold('Usage')}
724
724
  npx @skyf0xx/hedgehog init --cursor install for Cursor (default: Claude Code)
725
725
  npx @skyf0xx/hedgehog init --host=claude,gemini install for several coding agents at once
726
726
  npx @skyf0xx/hedgehog init --all-hosts install for every supported coding agent
727
- npx @skyf0xx/hedgehog init --force overwrite existing files
727
+ npx @skyf0xx/hedgehog init --force | -f overwrite existing files
728
+ npx @skyf0xx/hedgehog --version | -v print the installed version
728
729
  npx @skyf0xx/hedgehog update refresh the installed agents + skills
729
730
  npx @skyf0xx/hedgehog update --check report whether a newer release is published
730
731
  npx @skyf0xx/hedgehog db init create .hedgehog/hedgehog.db if absent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyf0xx/hedgehog",
3
- "version": "6.4.3",
3
+ "version": "6.5.0",
4
4
  "description": "Install the Hedgehog build discipline (agents + skills) into a repo, for Claude Code, Cursor, or Gemini CLI.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -21,3 +21,19 @@ export function emitPromptAgent(text) {
21
21
  const constraint = `**Tools for this role:** ${grant.summary}\n\n`;
22
22
  return stringify(kept, `\n${constraint}${body.replace(/^\n+/, '')}`);
23
23
  }
24
+
25
+ // OpenCode registers subagents from `.opencode/agents/` markdown files.
26
+ // Its frontmatter wants `description` and `mode`, and the file name is
27
+ // the agent name. Claude Code's `model:`/`tools:` subagent schema and
28
+ // the redundant `name:` come off; the tool grant is restated as a line
29
+ // the agent reads — `hedgehog verify` gates the commit regardless.
30
+ export function emitOpencodeAgent(text) {
31
+ const { data, body } = parse(text);
32
+ const kept = { ...data };
33
+ for (const key of [...CLAUDE_ONLY, 'name']) delete kept[key];
34
+ kept.mode = 'subagent';
35
+
36
+ const grant = grantFor(data.name);
37
+ const constraint = `**Tools for this role:** ${grant.summary}\n\n`;
38
+ return stringify(kept, `\n${constraint}${body.replace(/^\n+/, '')}`);
39
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgehog",
3
- "version": "6.4.3",
3
+ "version": "6.5.0",
4
4
  "description": "Hedgehog build discipline: ordered, tested, verified build steps.",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -8,7 +8,7 @@
8
8
  // Adding a host means adding one entry here (and a matching directory
9
9
  // under src/hosts/<name>/ for whatever templates it needs).
10
10
 
11
- import { emitPromptAgent } from './emit.mjs';
11
+ import { emitPromptAgent, emitOpencodeAgent } from './emit.mjs';
12
12
 
13
13
  // Hosts that dispatch real subagents get the full discipline: each build
14
14
  // step runs in its own context with its own role. Hosts that don't are
@@ -108,6 +108,22 @@ export const HOSTS = {
108
108
  ];
109
109
  },
110
110
  },
111
+
112
+ // OpenCode auto-loads AGENTS.md from the repo root — the same file
113
+ // every host ships as an index. The bootstrap merge carries the
114
+ // discipline shell and the dispatch into it directly, so no separate
115
+ // routing doc is generated and the file has one writer per install
116
+ // flag. Subagents register from `.opencode/agents/` (the file name is
117
+ // the agent name; Claude Code's `model:`/`tools:` subagent schema
118
+ // comes off on install), and skills load on demand from
119
+ // `.opencode/skills/`.
120
+ opencode: {
121
+ agentsDir: '.opencode/agents',
122
+ skillsDir: '.opencode/skills',
123
+ bootstrapFile: 'AGENTS.md',
124
+ label: 'OpenCode',
125
+ emitAgent: emitOpencodeAgent,
126
+ },
111
127
  };
112
128
 
113
129
  // One install flag per host, named for the tool a user is asking to use.
@@ -117,6 +133,7 @@ export const HOST_FLAGS = {
117
133
  '--claude': 'claude',
118
134
  '--cursor': 'cursor',
119
135
  '--gemini': 'gemini',
136
+ '--opencode': 'opencode',
120
137
  };
121
138
 
122
139
  export const DEFAULT_HOST = 'claude';
@@ -0,0 +1,18 @@
1
+ ## Delegating on this host
2
+
3
+ OpenCode registers subagents from `.opencode/agents/` — each file becomes
4
+ an agent named for the file. Invoke one with `@<name>` and pass it the
5
+ `hedgehog next` packet as the task: the full packet, not a step name.
6
+
7
+ Independent steps can go out as several subagent calls in one message.
8
+ Steps that depend on each other stay sequential.
9
+
10
+ Each agent file carries its tool grant as a line of its prompt, and
11
+ `hedgehog verify` checks the touched files against the packet's ALLOWED
12
+ SCOPE before any commit lands.
13
+
14
+ The skills in `.opencode/skills/` are procedures to follow — read the one
15
+ whose situation applies rather than improvising the steps.
16
+
17
+ Clear the conversation at the unit boundaries the `hedgehog-orchestrating`
18
+ skill states.