@buildlog/openclaw-skill 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 buildlogai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,282 @@
1
+ # @buildlog/openclaw-skill
2
+
3
+ Record, export, and share your AI coding sessions as replayable buildlogs.
4
+
5
+ [![npm version](https://badge.fury.io/js/@buildlog%2Fopenclaw-skill.svg)](https://www.npmjs.com/package/@buildlog/openclaw-skill)
6
+ [![ClawHub](https://img.shields.io/badge/ClawHub-buildlog-blue)](https://clawhub.io/skills/buildlog)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ ## Overview
10
+
11
+ The buildlog skill captures your OpenClaw AI-assisted coding sessions in real-time, creating replayable recordings that can be shared on [buildlog.ai](https://buildlog.ai).
12
+
13
+ Perfect for:
14
+ - 📚 **Tutorials** — Share how you built something step-by-step
15
+ - 📝 **Documentation** — Create living documentation of complex implementations
16
+ - 🐛 **Debugging** — Review sessions to understand what went wrong
17
+ - 🎓 **Learning** — Study how others approach problems
18
+
19
+ ## Installation
20
+
21
+ ### From ClawHub (Recommended)
22
+
23
+ ```bash
24
+ openclaw skill install buildlog
25
+ ```
26
+
27
+ ### From npm
28
+
29
+ ```bash
30
+ npm install @buildlog/openclaw-skill
31
+ ```
32
+
33
+ ## Quick Start
34
+
35
+ Once installed, just talk to OpenClaw:
36
+
37
+ ```
38
+ You: Start a buildlog "Building a REST API"
39
+ 🔴 Recording started: "Building a REST API"
40
+
41
+ You: Create an Express server with TypeScript
42
+ [OpenClaw creates files...]
43
+
44
+ You: Stop the buildlog
45
+ ✅ Recording stopped. 12 exchanges captured.
46
+ Would you like to upload to buildlog.ai?
47
+
48
+ You: Yes
49
+ ✅ Uploaded to buildlog.ai!
50
+ 🔗 https://buildlog.ai/b/abc123
51
+ ```
52
+
53
+ ## Commands
54
+
55
+ ### Recording
56
+
57
+ | Command | Description |
58
+ |---------|-------------|
59
+ | `Start a buildlog [title]` | Begin recording a new session |
60
+ | `Stop the buildlog` | End recording and optionally upload |
61
+ | `Pause the buildlog` | Temporarily pause recording |
62
+ | `Resume the buildlog` | Continue a paused recording |
63
+
64
+ ### Exporting
65
+
66
+ | Command | Description |
67
+ |---------|-------------|
68
+ | `Export this session as a buildlog` | Convert current session to buildlog format |
69
+ | `Export the last [N] messages` | Export a portion of the session |
70
+
71
+ ### Uploading
72
+
73
+ | Command | Description |
74
+ |---------|-------------|
75
+ | `Upload the buildlog` | Push to buildlog.ai |
76
+ | `Share the buildlog` | Upload and get a shareable link |
77
+
78
+ ### Annotations
79
+
80
+ | Command | Description |
81
+ |---------|-------------|
82
+ | `Add a note: [text]` | Add commentary to the current point |
83
+ | `Mark this as important` | Flag the current exchange |
84
+ | `Add chapter: [title]` | Create a chapter marker |
85
+
86
+ ### Status
87
+
88
+ | Command | Description |
89
+ |---------|-------------|
90
+ | `Buildlog status` | Check recording state |
91
+ | `Show buildlog info` | Display current recording details |
92
+
93
+ ## Configuration
94
+
95
+ Add to your OpenClaw configuration file (`~/.openclaw/config.json`):
96
+
97
+ ```json
98
+ {
99
+ "skills": {
100
+ "buildlog": {
101
+ "apiKey": "your-api-key",
102
+ "autoUpload": false,
103
+ "defaultPublic": true,
104
+ "includeFileContents": true,
105
+ "maxFileSizeKb": 100
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ ### Options
112
+
113
+ | Option | Type | Default | Description |
114
+ |--------|------|---------|-------------|
115
+ | `apiKey` | string | — | Your buildlog.ai API key (optional for public uploads) |
116
+ | `autoUpload` | boolean | `false` | Automatically upload when recording stops |
117
+ | `defaultPublic` | boolean | `true` | Make buildlogs public by default |
118
+ | `includeFileContents` | boolean | `true` | Include file content snapshots |
119
+ | `maxFileSizeKb` | number | `100` | Maximum file size to include in buildlog |
120
+
121
+ ## Programmatic Usage
122
+
123
+ You can also use the skill programmatically:
124
+
125
+ ```typescript
126
+ import {
127
+ BuildlogRecorder,
128
+ BuildlogExporter,
129
+ BuildlogUploader
130
+ } from '@buildlog/openclaw-skill';
131
+
132
+ // Create a recorder
133
+ const recorder = new BuildlogRecorder({
134
+ includeFileContents: true,
135
+ maxFileSizeKb: 100,
136
+ });
137
+
138
+ // Start recording
139
+ recorder.start('My Session');
140
+
141
+ // Handle events
142
+ recorder.handleEvent({
143
+ type: 'user_message',
144
+ timestamp: Date.now(),
145
+ data: { content: 'Create a function...' },
146
+ });
147
+
148
+ // Stop and get buildlog
149
+ const session = recorder.stop();
150
+ const buildlog = recorder.toBuildlog();
151
+
152
+ // Upload
153
+ const uploader = new BuildlogUploader({ apiKey: 'your-key' });
154
+ const result = await uploader.upload(buildlog);
155
+
156
+ console.log('Uploaded:', result.url);
157
+ ```
158
+
159
+ ### Retroactive Export
160
+
161
+ Export an existing session history:
162
+
163
+ ```typescript
164
+ import { BuildlogExporter } from '@buildlog/openclaw-skill';
165
+
166
+ const exporter = new BuildlogExporter({
167
+ title: 'My Coding Session',
168
+ tags: ['typescript', 'api'],
169
+ });
170
+
171
+ const buildlog = exporter.export(sessionHistory);
172
+ ```
173
+
174
+ ## Events
175
+
176
+ The skill emits the following events that you can subscribe to:
177
+
178
+ ```typescript
179
+ skill.recorder.on('started', (event) => {
180
+ console.log('Recording started:', event.data.title);
181
+ });
182
+
183
+ skill.recorder.on('stopped', (event) => {
184
+ console.log('Recording stopped:', event.data.session);
185
+ });
186
+ ```
187
+
188
+ | Event | Description |
189
+ |-------|-------------|
190
+ | `buildlog:started` | Recording began |
191
+ | `buildlog:stopped` | Recording ended |
192
+ | `buildlog:paused` | Recording paused |
193
+ | `buildlog:resumed` | Recording resumed |
194
+ | `buildlog:uploaded` | Buildlog uploaded successfully |
195
+ | `buildlog:error` | An error occurred |
196
+
197
+ ## API Reference
198
+
199
+ ### BuildlogSkill
200
+
201
+ Main skill class for OpenClaw integration.
202
+
203
+ ```typescript
204
+ const skill = createBuildlogSkill(config);
205
+ await skill.initialize(openClawContext);
206
+ const handled = await skill.handleMessage(ctx, 'start a buildlog');
207
+ skill.dispose();
208
+ ```
209
+
210
+ ### BuildlogRecorder
211
+
212
+ State machine for recording sessions.
213
+
214
+ ```typescript
215
+ const recorder = new BuildlogRecorder(config);
216
+ recorder.start('Title');
217
+ recorder.handleEvent(event);
218
+ recorder.addNote('Important point');
219
+ recorder.addChapter('Setup');
220
+ recorder.pause();
221
+ recorder.resume();
222
+ const session = recorder.stop();
223
+ ```
224
+
225
+ ### BuildlogExporter
226
+
227
+ Convert session history to buildlog format.
228
+
229
+ ```typescript
230
+ const exporter = new BuildlogExporter(options);
231
+ const buildlog = exporter.export(sessionHistory);
232
+ const partial = exporter.exportLastN(sessionHistory, 10);
233
+ ```
234
+
235
+ ### BuildlogUploader
236
+
237
+ Upload buildlogs to buildlog.ai.
238
+
239
+ ```typescript
240
+ const uploader = new BuildlogUploader({ apiKey });
241
+ const result = await uploader.upload(buildlog, options);
242
+ const info = await uploader.getInfo(id);
243
+ await uploader.delete(id);
244
+ ```
245
+
246
+ ## Privacy
247
+
248
+ - 🔒 Buildlogs can be public or private
249
+ - 🔑 API keys are never included in exports
250
+ - 🎛️ You control what gets shared
251
+ - 🗑️ Delete buildlogs anytime at buildlog.ai
252
+
253
+ ## Development
254
+
255
+ ```bash
256
+ # Install dependencies
257
+ npm install
258
+
259
+ # Build
260
+ npm run build
261
+
262
+ # Run tests
263
+ npm test
264
+
265
+ # Watch mode
266
+ npm run dev
267
+ ```
268
+
269
+ ## Contributing
270
+
271
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
272
+
273
+ ## License
274
+
275
+ MIT © [buildlog.ai](https://buildlog.ai)
276
+
277
+ ## Links
278
+
279
+ - [buildlog.ai](https://buildlog.ai) — View and share buildlogs
280
+ - [Documentation](https://docs.buildlog.ai) — Full documentation
281
+ - [ClawHub](https://clawhub.io/skills/buildlog) — Skill registry listing
282
+ - [GitHub](https://github.com/buildlog/openclaw-skill) — Source code
package/SKILL.md ADDED
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: buildlog
3
+ description: Record, export, and share your AI coding sessions as replayable buildlogs
4
+ version: 1.0.0
5
+ author: buildlog.ai
6
+ repository: https://github.com/buildlog/openclaw-skill
7
+ homepage: https://buildlog.ai
8
+ ---
9
+
10
+ # Buildlog Skill
11
+
12
+ Record your OpenClaw coding sessions and share them on buildlog.ai.
13
+
14
+ ## Overview
15
+
16
+ The buildlog skill captures your AI-assisted coding sessions in real-time, creating replayable recordings that can be shared with others. Perfect for:
17
+
18
+ - **Tutorials**: Share how you built something step-by-step
19
+ - **Documentation**: Create living documentation of complex implementations
20
+ - **Debugging**: Review sessions to understand what went wrong
21
+ - **Learning**: Study how others approach problems
22
+
23
+ ## Commands
24
+
25
+ ### Recording
26
+
27
+ - **"Start a buildlog [title]"** — Begin recording a new session
28
+ - **"Stop the buildlog"** — End recording and optionally upload
29
+ - **"Pause the buildlog"** — Temporarily pause recording
30
+ - **"Resume the buildlog"** — Continue a paused recording
31
+
32
+ ### Exporting
33
+
34
+ - **"Export this session as a buildlog"** — Convert current session to buildlog format
35
+ - **"Export the last [N] messages"** — Export a portion of the session
36
+
37
+ ### Uploading
38
+
39
+ - **"Upload the buildlog"** — Push to buildlog.ai
40
+ - **"Share the buildlog"** — Upload and get a shareable link
41
+
42
+ ### Annotations
43
+
44
+ - **"Add a note: [text]"** — Add commentary to the current point
45
+ - **"Mark this as important"** — Flag the current exchange
46
+ - **"Add chapter: [title]"** — Create a chapter marker
47
+
48
+ ### Status
49
+
50
+ - **"Buildlog status"** — Check recording state
51
+ - **"Show buildlog info"** — Display current recording details
52
+
53
+ ## Configuration
54
+
55
+ Add to your OpenClaw configuration:
56
+
57
+ ```json
58
+ {
59
+ "skills": {
60
+ "buildlog": {
61
+ "apiKey": "your-api-key",
62
+ "autoUpload": false,
63
+ "defaultPublic": true,
64
+ "includeFileContents": true,
65
+ "maxFileSizeKb": 100
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ ### Options
72
+
73
+ | Option | Type | Default | Description |
74
+ |--------|------|---------|-------------|
75
+ | `apiKey` | string | — | Your buildlog.ai API key (optional for public uploads) |
76
+ | `autoUpload` | boolean | `false` | Automatically upload when recording stops |
77
+ | `defaultPublic` | boolean | `true` | Make buildlogs public by default |
78
+ | `includeFileContents` | boolean | `true` | Include file content snapshots |
79
+ | `maxFileSizeKb` | number | `100` | Maximum file size to include |
80
+
81
+ ## Events
82
+
83
+ The skill emits the following events:
84
+
85
+ - `buildlog:started` — Recording began
86
+ - `buildlog:stopped` — Recording ended
87
+ - `buildlog:paused` — Recording paused
88
+ - `buildlog:resumed` — Recording resumed
89
+ - `buildlog:uploaded` — Buildlog uploaded successfully
90
+ - `buildlog:error` — An error occurred
91
+
92
+ ## Examples
93
+
94
+ ### Basic Recording
95
+
96
+ ```
97
+ You: Start a buildlog "Building a REST API"
98
+ Assistant: 🔴 Recording started: "Building a REST API"
99
+
100
+ You: Create an Express server with TypeScript
101
+ Assistant: [creates files...]
102
+
103
+ You: Stop the buildlog
104
+ Assistant: Recording stopped. 12 exchanges captured.
105
+ Would you like to upload to buildlog.ai?
106
+ ```
107
+
108
+ ### Retroactive Export
109
+
110
+ ```
111
+ You: Export this session as a buildlog
112
+ Assistant: Exported 24 exchanges as buildlog.
113
+ Title: "Untitled Session"
114
+ Ready to upload?
115
+ ```
116
+
117
+ ## Privacy
118
+
119
+ - Buildlogs can be public or private
120
+ - API keys are never included in exports
121
+ - You control what gets shared
122
+ - Delete buildlogs anytime at buildlog.ai
@@ -0,0 +1,110 @@
1
+ import type { Buildlog, BuildlogMetadata, FileChange, TerminalCommand } from './types.js';
2
+ export interface SessionMessage {
3
+ role: 'user' | 'assistant' | 'system';
4
+ content: string;
5
+ timestamp?: number;
6
+ toolCalls?: Array<{
7
+ name: string;
8
+ arguments: Record<string, unknown>;
9
+ result?: unknown;
10
+ }>;
11
+ attachments?: Array<{
12
+ name: string;
13
+ content: string;
14
+ type?: string;
15
+ }>;
16
+ }
17
+ export interface SessionHistory {
18
+ messages: SessionMessage[];
19
+ fileChanges?: FileChange[];
20
+ terminalCommands?: TerminalCommand[];
21
+ metadata?: Partial<BuildlogMetadata>;
22
+ }
23
+ export interface ExportOptions {
24
+ title?: string;
25
+ description?: string;
26
+ tags?: string[];
27
+ includeSystemMessages?: boolean;
28
+ includeFileContents?: boolean;
29
+ maxFileSizeKb?: number;
30
+ lastN?: number;
31
+ author?: string;
32
+ }
33
+ /**
34
+ * BuildlogExporter - Convert session history to buildlog format
35
+ *
36
+ * Supports retroactive export from session_history
37
+ */
38
+ export declare class BuildlogExporter {
39
+ private options;
40
+ constructor(options?: Partial<ExportOptions>);
41
+ /**
42
+ * Export a session history to buildlog format
43
+ */
44
+ export(history: SessionHistory): Buildlog;
45
+ /**
46
+ * Export only the last N messages
47
+ */
48
+ exportLastN(history: SessionHistory, n: number): Buildlog;
49
+ /**
50
+ * Export a range of messages
51
+ */
52
+ exportRange(history: SessionHistory, start: number, end: number): Buildlog;
53
+ /**
54
+ * Merge file changes and terminal commands into the timeline
55
+ */
56
+ private convertToEntries;
57
+ /**
58
+ * Convert a session message to a buildlog entry
59
+ */
60
+ private messageToEntry;
61
+ /**
62
+ * Convert a file change to a buildlog entry
63
+ */
64
+ private fileChangeToEntry;
65
+ /**
66
+ * Convert a terminal command to a buildlog entry
67
+ */
68
+ private terminalToEntry;
69
+ /**
70
+ * Filter messages based on options
71
+ */
72
+ private filterMessages;
73
+ /**
74
+ * Build metadata for the buildlog
75
+ */
76
+ private buildMetadata;
77
+ /**
78
+ * Try to infer a title from the session content
79
+ */
80
+ private inferTitle;
81
+ /**
82
+ * Try to infer a description from the session
83
+ */
84
+ private inferDescription;
85
+ /**
86
+ * Try to infer tags from file extensions and content
87
+ */
88
+ private inferTags;
89
+ /**
90
+ * Detect natural chapter breaks in the content
91
+ */
92
+ private detectChapters;
93
+ /**
94
+ * Extract a chapter title from a message
95
+ */
96
+ private extractChapterTitle;
97
+ /**
98
+ * Truncate content to max size
99
+ */
100
+ private truncateContent;
101
+ /**
102
+ * Generate a unique ID
103
+ */
104
+ private generateId;
105
+ }
106
+ /**
107
+ * Convenience function to export a session
108
+ */
109
+ export declare function exportSession(history: SessionHistory, options?: ExportOptions): Buildlog;
110
+ //# sourceMappingURL=exporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../src/exporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EAER,gBAAgB,EAChB,UAAU,EACV,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CA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