openwriter 0.3.1 → 0.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/dist/bin/pad.js +3 -0
- package/dist/client/apple-touch-icon.png +0 -0
- package/dist/client/assets/index-Be3gaGeo.css +1 -0
- package/dist/client/assets/index-BwT1KW6a.js +207 -0
- package/dist/client/favicon-16.png +0 -0
- package/dist/client/favicon-32.png +0 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/icon-192.png +0 -0
- package/dist/client/icon-512.png +0 -0
- package/dist/client/index.html +5 -2
- package/dist/server/documents.js +81 -7
- package/dist/server/git-sync.js +3 -2
- package/dist/server/helpers.js +17 -4
- package/dist/server/index.js +141 -8
- package/dist/server/markdown-parse.js +12 -0
- package/dist/server/markdown-serialize.js +12 -0
- package/dist/server/mcp.js +9 -9
- package/dist/server/plugin-discovery.js +102 -10
- package/dist/server/plugin-install.js +119 -0
- package/dist/server/plugin-manager.js +8 -3
- package/dist/server/prompt-debug.js +58 -0
- package/dist/server/state.js +22 -9
- package/dist/server/ws.js +36 -9
- package/package.json +5 -1
- package/skill/SKILL.md +101 -17
- package/dist/client/assets/index-BTxdHrWL.js +0 -209
- package/dist/client/assets/index-C9E86o6p.css +0 -1
package/skill/SKILL.md
CHANGED
|
@@ -3,16 +3,18 @@ name: openwriter
|
|
|
3
3
|
description: |
|
|
4
4
|
OpenWriter — the writing surface for AI agents. A markdown-native rich text
|
|
5
5
|
editor where agents write via MCP tools and users accept or reject changes
|
|
6
|
-
in-browser.
|
|
7
|
-
organization.
|
|
6
|
+
in-browser. 30 MCP tools for document editing, multi-doc workspaces, and
|
|
7
|
+
organization. Tweet compose mode for drafting replies/QTs with pixel-accurate
|
|
8
|
+
X/Twitter UI. Plain .md files on disk — no database, no lock-in.
|
|
8
9
|
|
|
9
10
|
Use when user says: "open writer", "openwriter", "write in openwriter",
|
|
10
|
-
"edit my document", "review my writing", "check the pad", "write me a doc"
|
|
11
|
+
"edit my document", "review my writing", "check the pad", "write me a doc",
|
|
12
|
+
"compose tweet", "reply to tweet", "quote tweet".
|
|
11
13
|
|
|
12
14
|
Requires: OpenWriter MCP server configured. Browser UI at localhost:5050.
|
|
13
15
|
metadata:
|
|
14
16
|
author: travsteward
|
|
15
|
-
version: "0.
|
|
17
|
+
version: "0.4.0"
|
|
16
18
|
repository: https://github.com/travsteward/openwriter
|
|
17
19
|
license: MIT
|
|
18
20
|
---
|
|
@@ -36,7 +38,7 @@ Skip to [Writing Strategy](#writing-strategy) below.
|
|
|
36
38
|
|
|
37
39
|
### MCP tools are NOT available (skill-first install)
|
|
38
40
|
|
|
39
|
-
The user installed this skill from a directory but hasn't set up the MCP server yet. OpenWriter needs an MCP server to provide the
|
|
41
|
+
The user installed this skill from a directory but hasn't set up the MCP server yet. OpenWriter needs an MCP server to provide the 30 editing tools.
|
|
40
42
|
|
|
41
43
|
**Step 1:** Tell the user to install globally and add the MCP server:
|
|
42
44
|
|
|
@@ -50,16 +52,7 @@ claude mcp add -s user openwriter -- openwriter --no-open
|
|
|
50
52
|
|
|
51
53
|
Then restart the Claude Code session. The MCP tools become available on next launch.
|
|
52
54
|
|
|
53
|
-
**Step 2 (if the user can't run the command above):** Edit `~/.claude.json` directly. Add
|
|
54
|
-
|
|
55
|
-
```json
|
|
56
|
-
"openwriter": {
|
|
57
|
-
"command": "openwriter",
|
|
58
|
-
"args": ["--no-open"]
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
The `mcpServers` key is at the top level of `~/.claude.json`. If it doesn't exist, create it:
|
|
55
|
+
**Step 2 (if the user can't run the command above):** Edit `~/.claude.json` directly. Add `openwriter` as the **first entry** in the `mcpServers` object — MCP servers load sequentially, so first in config = first to load:
|
|
63
56
|
|
|
64
57
|
```json
|
|
65
58
|
{
|
|
@@ -72,13 +65,15 @@ The `mcpServers` key is at the top level of `~/.claude.json`. If it doesn't exis
|
|
|
72
65
|
}
|
|
73
66
|
```
|
|
74
67
|
|
|
68
|
+
**Why first?** Claude Code loads MCP servers sequentially in config order. If `openwriter` is last, it waits for every other server to finish connecting first. Putting it first makes it available instantly.
|
|
69
|
+
|
|
75
70
|
After editing, tell the user:
|
|
76
71
|
1. Restart your Claude Code session (MCP servers load on startup)
|
|
77
72
|
2. Open http://localhost:5050 in your browser
|
|
78
73
|
|
|
79
|
-
**Note:** You cannot run `claude mcp add` from inside a session (nested session error). That's why we edit the JSON directly when configuring from within Claude Code.
|
|
74
|
+
**Note:** You cannot run `claude mcp add` from inside a session (nested session error). That's why we edit the JSON directly when configuring from within Claude Code. Also, `claude mcp add` appends to the end — always verify the entry is first after adding.
|
|
80
75
|
|
|
81
|
-
## MCP Tools Reference (
|
|
76
|
+
## MCP Tools Reference (30 tools)
|
|
82
77
|
|
|
83
78
|
### Document Operations
|
|
84
79
|
|
|
@@ -135,6 +130,21 @@ After editing, tell the user:
|
|
|
135
130
|
|------|-------------|
|
|
136
131
|
| `edit_text` | Fine-grained text edits within a node (find/replace, add/remove marks) |
|
|
137
132
|
|
|
133
|
+
### Image Generation
|
|
134
|
+
|
|
135
|
+
| Tool | Description |
|
|
136
|
+
|------|-------------|
|
|
137
|
+
| `generate_image` | Generate an image via Gemini Nano Banana 2 — optionally set as article cover (requires GEMINI_API_KEY) |
|
|
138
|
+
|
|
139
|
+
### Version Management
|
|
140
|
+
|
|
141
|
+
| Tool | Description |
|
|
142
|
+
|------|-------------|
|
|
143
|
+
| `list_versions` | List version history for the active document (timestamps, word counts, sizes) |
|
|
144
|
+
| `create_checkpoint` | Force a version snapshot right now — use before risky operations |
|
|
145
|
+
| `restore_version` | Restore to a previous version by timestamp (auto-creates safety checkpoint first) |
|
|
146
|
+
| `reload_from_disk` | Re-read the active document from its file on disk (for external modifications) |
|
|
147
|
+
|
|
138
148
|
## Writing Strategy
|
|
139
149
|
|
|
140
150
|
OpenWriter has two distinct modes: **editing** existing documents and **creating** new content. Use the right approach for each.
|
|
@@ -238,6 +248,78 @@ When importing or organizing book-length projects, read the source material firs
|
|
|
238
248
|
- **Synthesize, don't just copy.** Reorganize messy notes into clean, scannable docs (headers, bullets, sections) while keeping the author's voice and prose verbatim.
|
|
239
249
|
- **Surface open threads.** Unanswered questions, brainstorm lists, and loose ideas get their own doc — don't bury them inside reference material.
|
|
240
250
|
|
|
251
|
+
## Tweet Compose Mode
|
|
252
|
+
|
|
253
|
+
OpenWriter doubles as a tweet compose surface. When `tweetContext` is set in a document's metadata, the editor switches to a pixel-accurate X/Twitter compose view — reply thread or quote tweet layout with embedded parent tweet, character counter, and action bar.
|
|
254
|
+
|
|
255
|
+
### Setting up a tweet document
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
1. create_document({ title: "Reply to @username" })
|
|
259
|
+
2. populate_document({ content: " " }) ← empty content, compose area
|
|
260
|
+
3. set_metadata({ tweetContext: { url: "https://x.com/user/status/123", mode: "reply" } })
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
- **`url`** — the tweet URL to reply to or quote
|
|
264
|
+
- **`mode`** — `"reply"` (thread layout with parent above) or `"quote"` (compose above, quoted card below)
|
|
265
|
+
|
|
266
|
+
The view activates automatically when `tweetContext` is present — no manual toggle needed. Documents are auto-tagged `"x"` in the sidebar for discoverability.
|
|
267
|
+
|
|
268
|
+
### Reading the parent tweet
|
|
269
|
+
|
|
270
|
+
Use the x-reader skill or fxtwitter API to fetch tweet data before setting up:
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
WebFetch: https://api.fxtwitter.com/{username}/status/{tweet_id}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
The compose view fetches and renders the parent tweet (text, author, avatar, media, metrics) automatically from the URL.
|
|
277
|
+
|
|
278
|
+
### Template Documents
|
|
279
|
+
|
|
280
|
+
Users can also create tweet and article templates directly from the browser UI using the **Templates** dropdown in the titlebar. For agent-initiated template creation, use the standard two-step flow:
|
|
281
|
+
|
|
282
|
+
**Tweet template:**
|
|
283
|
+
```
|
|
284
|
+
1. create_document({ empty: true })
|
|
285
|
+
2. set_metadata({ tweetContext: { mode: "tweet" }, title: "Tweet" })
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Reply template (with parent URL):**
|
|
289
|
+
```
|
|
290
|
+
1. create_document({ empty: true })
|
|
291
|
+
2. set_metadata({ tweetContext: { url: "https://x.com/user/status/123", mode: "reply" }, title: "Reply" })
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Quote tweet template:**
|
|
295
|
+
```
|
|
296
|
+
1. create_document({ empty: true })
|
|
297
|
+
2. set_metadata({ tweetContext: { url: "https://x.com/user/status/123", mode: "quote" }, title: "Quote Tweet" })
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Article template:**
|
|
301
|
+
```
|
|
302
|
+
1. create_document({ empty: true })
|
|
303
|
+
2. set_metadata({ articleContext: { active: true }, title: "Article" })
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Removing tweet mode
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
set_metadata({ tweetContext: null })
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
This restores the normal editor view and removes the "x" tag.
|
|
313
|
+
|
|
314
|
+
### Placeholder text
|
|
315
|
+
|
|
316
|
+
- Quote mode: "Add a comment"
|
|
317
|
+
- Reply mode: "What is happening?!"
|
|
318
|
+
|
|
319
|
+
### Compose avatar
|
|
320
|
+
|
|
321
|
+
Users set their X handle by clicking the avatar circle in the compose area. The handle is saved to localStorage and the pfp loads from `unavatar.io/twitter/{handle}`.
|
|
322
|
+
|
|
241
323
|
## Review Etiquette
|
|
242
324
|
|
|
243
325
|
1. **Share the URL.** Always tell the user: http://localhost:5050
|
|
@@ -258,3 +340,5 @@ When importing or organizing book-length projects, read the source material firs
|
|
|
258
340
|
**"pendingChanges" never clears** — User needs to accept/reject changes in the browser at http://localhost:5050.
|
|
259
341
|
|
|
260
342
|
**Server not starting** — Ensure `openwriter` works from your terminal (`npm install -g openwriter` first). If on Windows and the global command isn't found, the MCP config may need `"command": "cmd"` with `"args": ["/c", "openwriter", "--no-open"]`.
|
|
343
|
+
|
|
344
|
+
**Slow to load / loads last** — MCP servers load sequentially in config order. Move `openwriter` to the first position in `mcpServers` in `~/.claude.json`. See setup instructions above.
|