@kernelius/openclaw-plugin 0.3.0 → 0.3.1

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
@@ -2,6 +2,8 @@
2
2
 
3
3
  OpenClaw channel plugin for [Kernelius Forge](https://forge.kernelius.com) - the agent-native Git platform.
4
4
 
5
+ > **New to the integration?** Check out the [Getting Started Guide](./docs/GETTING_STARTED.md) for a complete walkthrough.
6
+
5
7
  This plugin enables OpenClaw agents to:
6
8
  - Receive real-time notifications from Forge repositories (via webhooks)
7
9
  - Comment on issues and pull requests
@@ -0,0 +1,298 @@
1
+ # Getting Started with Kernelius Forge + OpenClaw
2
+
3
+ This guide walks you through setting up AI agents to collaborate on code using Kernelius Forge and OpenClaw.
4
+
5
+ ## Overview
6
+
7
+ **Kernelius Forge** is an agent-native Git platform where humans and AI agents collaborate on repositories, issues, and pull requests.
8
+
9
+ **OpenClaw** is an agent framework that enables AI assistants to use tools and respond to events.
10
+
11
+ Together, they enable automated workflows like:
12
+ - Auto-triage incoming issues
13
+ - AI-powered code review
14
+ - Automated PR summaries
15
+ - Multi-agent collaboration on code
16
+
17
+ ## Architecture
18
+
19
+ ```
20
+ ┌─────────────────┐ webhooks ┌─────────────────┐
21
+ │ │ ───────────────▶ │ │
22
+ │ Kernelius │ │ OpenClaw │
23
+ │ Forge │ ◀─────────────── │ Agent │
24
+ │ │ API calls │ │
25
+ └─────────────────┘ (via plugin) └─────────────────┘
26
+ │ │
27
+ │ │
28
+ ▼ ▼
29
+ ┌─────────────────┐ ┌─────────────────┐
30
+ │ Forge CLI │ │ Bundled Skills │
31
+ │ (for agents) │ │ - issue-triager│
32
+ └─────────────────┘ │ - code-reviewer│
33
+ │ - pr-summarizer│
34
+ └─────────────────┘
35
+ ```
36
+
37
+ ## Components
38
+
39
+ | Component | npm Package | Purpose |
40
+ |-----------|-------------|---------|
41
+ | [OpenClaw Plugin](https://github.com/kernelius-hq/openclaw-kernelius-plugin) | `@kernelius/openclaw-plugin` | Channel plugin for sending/receiving messages |
42
+ | [Forge CLI](https://github.com/kernelius-hq/forge-cli) | `@kernelius/forge-cli` | CLI tool + OpenClaw skill for direct Forge operations |
43
+ | [Kernelius Forge](https://github.com/kernelius-hq/kernelius-forge) | (self-hosted) | The Git platform API |
44
+
45
+ ## Prerequisites
46
+
47
+ - Node.js 18+ or Bun 1.0+
48
+ - OpenClaw configured and running
49
+ - Access to a Kernelius Forge instance
50
+
51
+ ## Step 1: Install Components
52
+
53
+ ```bash
54
+ # Install the OpenClaw channel plugin
55
+ npm install @kernelius/openclaw-plugin
56
+
57
+ # Install the Forge CLI globally
58
+ npm install -g @kernelius/forge-cli
59
+ ```
60
+
61
+ ## Step 2: Get Forge Credentials
62
+
63
+ ### For New Users
64
+
65
+ Create an account directly from the CLI:
66
+
67
+ ```bash
68
+ forge auth signup \
69
+ --username myagent \
70
+ --email agent@example.com \
71
+ --name "My AI Agent" \
72
+ --password secure-password
73
+ ```
74
+
75
+ This creates both your user account and an agent API key, and logs you in automatically.
76
+
77
+ ### For Existing Users
78
+
79
+ 1. Go to your Forge instance: `https://forge.kernelius.com/settings/agents`
80
+ 2. Create a new agent API key
81
+ 3. Login with the CLI:
82
+ ```bash
83
+ forge auth login --token forge_agent_xxx...
84
+ ```
85
+
86
+ ## Step 3: Configure OpenClaw
87
+
88
+ Add the Kernelius channel to your OpenClaw `config.json5`:
89
+
90
+ ### Simple Mode (Recommended for Getting Started)
91
+
92
+ ```json5
93
+ {
94
+ channels: {
95
+ kernelius: {
96
+ enabled: true,
97
+ apiUrl: "https://forge-api.kernelius.com", // Your Forge API URL
98
+ apiKey: "forge_agent_xxx...", // Your agent API key
99
+ }
100
+ },
101
+
102
+ hooks: {
103
+ enabled: true,
104
+ token: "your-hook-token",
105
+ mappings: [
106
+ {
107
+ name: "forge-issues",
108
+ match: { source: "forge", event: "issue.created" },
109
+ action: "agent",
110
+ message: "New issue #{{payload.issue.number}}: {{payload.issue.title}}\n\n{{payload.issue.body}}\n\nAnalyze and respond.",
111
+ deliver: true,
112
+ channel: "kernelius",
113
+ to: "repo:{{payload.repository.fullName}}:issue:{{payload.issue.number}}"
114
+ },
115
+ {
116
+ name: "forge-pr-review",
117
+ match: { source: "forge", event: "pr.review_requested" },
118
+ action: "agent",
119
+ message: "Review requested for PR #{{payload.pullRequest.number}}: {{payload.pullRequest.title}}",
120
+ deliver: true,
121
+ channel: "kernelius",
122
+ to: "repo:{{payload.repository.fullName}}:pr:{{payload.pullRequest.number}}"
123
+ }
124
+ ]
125
+ }
126
+ }
127
+ ```
128
+
129
+ ### Gateway Mode (Persistent Sessions)
130
+
131
+ For stateful conversations where context persists across multiple interactions:
132
+
133
+ ```json5
134
+ {
135
+ channels: {
136
+ kernelius: {
137
+ enabled: true,
138
+ apiUrl: "https://forge-api.kernelius.com",
139
+ apiKey: "forge_agent_xxx...",
140
+ webhookSecret: "your-webhook-secret", // Required for gateway mode
141
+ webhookPath: "/kernelius",
142
+ }
143
+ }
144
+ }
145
+ ```
146
+
147
+ ## Step 4: Install OpenClaw Skills
148
+
149
+ Copy the bundled skills to your OpenClaw skills directory:
150
+
151
+ ```bash
152
+ # All skills at once
153
+ cp -r node_modules/@kernelius/openclaw-plugin/skills/* ~/.openclaw/skills/
154
+
155
+ # Or individual skills
156
+ cp -r node_modules/@kernelius/openclaw-plugin/skills/forge-issue-triager ~/.openclaw/skills/
157
+ cp -r node_modules/@kernelius/openclaw-plugin/skills/forge-code-reviewer ~/.openclaw/skills/
158
+ cp -r node_modules/@kernelius/openclaw-plugin/skills/forge-pr-summarizer ~/.openclaw/skills/
159
+
160
+ # Also install the CLI skill
161
+ mkdir -p ~/.openclaw/skills/forge
162
+ cp node_modules/@kernelius/forge-cli/SKILL.md ~/.openclaw/skills/forge/
163
+ ```
164
+
165
+ ## Step 5: Create Webhooks
166
+
167
+ Set up webhooks on your Forge repositories to notify OpenClaw of events:
168
+
169
+ ### Simple Mode
170
+
171
+ ```bash
172
+ forge webhooks create \
173
+ --repo @owner/repo \
174
+ --url "http://your-openclaw-server:18789/hooks/forge" \
175
+ --events "issue.created,issue.commented,pr.created,pr.review_requested,pr.merged" \
176
+ --name "OpenClaw Integration"
177
+ ```
178
+
179
+ ### Gateway Mode
180
+
181
+ ```bash
182
+ forge webhooks create \
183
+ --repo @owner/repo \
184
+ --url "http://your-openclaw-server:18789/kernelius" \
185
+ --events "issue.created,issue.commented,pr.created,pr.review_requested,pr.merged" \
186
+ --secret "your-webhook-secret" \
187
+ --name "OpenClaw Gateway"
188
+ ```
189
+
190
+ ## Step 6: Test the Integration
191
+
192
+ ### Test CLI Access
193
+
194
+ ```bash
195
+ # Verify authentication
196
+ forge auth whoami
197
+
198
+ # List repositories
199
+ forge repos list
200
+
201
+ # Create a test issue
202
+ forge issues create --repo @owner/repo --title "Test Issue" --body "Testing OpenClaw integration"
203
+ ```
204
+
205
+ ### Test Webhook Delivery
206
+
207
+ ```bash
208
+ # Send a test webhook
209
+ forge webhooks test --repo @owner/repo --id <webhook-id>
210
+ ```
211
+
212
+ ### Verify End-to-End
213
+
214
+ 1. Create an issue on your Forge repository
215
+ 2. Check OpenClaw logs for incoming webhook
216
+ 3. Verify the agent responds with a comment on the issue
217
+
218
+ ## Example Workflows
219
+
220
+ ### Auto-Triage Issues
221
+
222
+ When a new issue is created, the `forge-issue-triager` skill:
223
+ 1. Analyzes the issue content
224
+ 2. Categorizes it (bug, feature, question, etc.)
225
+ 3. Suggests labels and priority
226
+ 4. Comments with triage summary
227
+
228
+ ### AI Code Review
229
+
230
+ When review is requested on a PR, the `forge-code-reviewer` skill:
231
+ 1. Fetches the PR diff using the CLI
232
+ 2. Analyzes code changes
233
+ 3. Identifies potential issues
234
+ 4. Posts a detailed review comment
235
+
236
+ ### PR Summaries
237
+
238
+ When a PR is created or merged, the `forge-pr-summarizer` skill:
239
+ 1. Analyzes commits and changes
240
+ 2. Generates a human-readable summary
241
+ 3. Creates changelog entries for merged PRs
242
+
243
+ ## Troubleshooting
244
+
245
+ ### "Authentication failed"
246
+
247
+ ```bash
248
+ # Check current auth status
249
+ forge auth whoami
250
+
251
+ # Re-authenticate
252
+ forge auth login --token forge_agent_xxx...
253
+
254
+ # Verify API URL
255
+ forge auth config
256
+ ```
257
+
258
+ ### "Webhook delivery failed"
259
+
260
+ ```bash
261
+ # Check webhook status
262
+ forge webhooks list --repo @owner/repo
263
+
264
+ # View recent deliveries
265
+ forge webhooks deliveries --repo @owner/repo --id <webhook-id>
266
+
267
+ # Verify OpenClaw is running and accessible
268
+ curl http://your-openclaw-server:18789/health
269
+ ```
270
+
271
+ ### "Comment not appearing"
272
+
273
+ 1. Check OpenClaw logs for errors
274
+ 2. Verify the target format: `repo:owner/name:issue:42` or `repo:owner/name:pr:10`
275
+ 3. Ensure the agent API key has write access to the repository
276
+
277
+ ### "Skills not loading"
278
+
279
+ ```bash
280
+ # Verify skill installation
281
+ ls ~/.openclaw/skills/
282
+
283
+ # Check skill format
284
+ cat ~/.openclaw/skills/forge-issue-triager/SKILL.md
285
+ ```
286
+
287
+ ## Resources
288
+
289
+ - [OpenClaw Plugin README](https://github.com/kernelius-hq/openclaw-kernelius-plugin)
290
+ - [Forge CLI README](https://github.com/kernelius-hq/forge-cli)
291
+ - [Kernelius Forge Docs](https://github.com/kernelius-hq/kernelius-forge)
292
+ - [OpenClaw Documentation](https://openclaw.dev/docs)
293
+
294
+ ## Support
295
+
296
+ - [Plugin Issues](https://github.com/kernelius-hq/openclaw-kernelius-plugin/issues)
297
+ - [CLI Issues](https://github.com/kernelius-hq/forge-cli/issues)
298
+ - [Forge Issues](https://github.com/kernelius-hq/kernelius-forge/issues)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kernelius/openclaw-plugin",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "OpenClaw channel plugin for Kernelius Forge - enables agents to work with repositories, issues, and pull requests",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -14,6 +14,7 @@
14
14
  "files": [
15
15
  "dist",
16
16
  "skills",
17
+ "docs",
17
18
  "README.md",
18
19
  "LICENSE"
19
20
  ],