pressclaw 0.2.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 Niklas Babel
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,394 @@
1
+ # PressClaw
2
+
3
+ **Turn conversations into published content.**
4
+
5
+ An [OpenClaw](https://github.com/openclaw/openclaw) plugin that gives your AI agent a complete writing pipeline — from rough idea to published blog post, with style learning, audience testing, and platform adaptation along the way.
6
+
7
+ You think. Your agent writes. You decide what goes public.
8
+
9
+ ---
10
+
11
+ ## How It Works
12
+
13
+ PressClaw is built on a few beliefs:
14
+
15
+ 1. **Private first.** Every note starts private. Nothing goes public until you explicitly say so. Your agent can draft, transform, and refine all day — the world sees nothing until you run `publish`.
16
+
17
+ 2. **Agent-native.** This isn't a text editor with AI sprinkled on top. Your AI agent does the heavy lifting — drafting, transforming structure, adapting tone, testing against audience personas. The plugin provides the pipeline and guardrails.
18
+
19
+ 3. **Style learning.** As you publish more, PressClaw builds a Style DNA profile from your writing. Sentence length patterns, perspective preferences, vocabulary level, readability scores. Your agent uses this to maintain your voice across everything it writes.
20
+
21
+ 4. **Explicit publish only.** The publish command requires confirmation and an optional reason. There's a clear boundary between "drafting space" and "public output." Your agent can't accidentally publish something.
22
+
23
+ The flow: **idea → draft → transform → refine → test → publish**. Skip steps as needed. The pipeline is there when you want it.
24
+
25
+ ---
26
+
27
+ ## What You Get
28
+
29
+ - **Markdown notes** with YAML frontmatter as the source of truth
30
+ - **Static HTML site** with clean typography and an RSS feed
31
+ - **Dashboard** (CLI and web) showing your entire pipeline at a glance
32
+ - **Style DNA** that learns your writing voice over time
33
+ - **7 structure templates** (structured, list, chunky, minimal, storytelling, thread, TL;DR)
34
+ - **Tone control** (authentic, professional, casual, humorous — or custom personas)
35
+ - **Variation generation** — produce multiple versions and pick the best one
36
+ - **Audience testing** against configurable personas (technical builder, founder, learner, brand strategist)
37
+ - **Platform adaptation** — reshape posts for LinkedIn, Twitter/X, or threads
38
+ - **Topic backlog** with workspace scanning to surface publishable ideas
39
+ - **Daily prompt cron** that asks your agent to review conversations and draft content
40
+ - **HTTP serving** through OpenClaw's built-in server
41
+
42
+ ---
43
+
44
+ ## Installation
45
+
46
+ 1. Copy the plugin into your OpenClaw extensions directory:
47
+
48
+ ```bash
49
+ cp -r pressclaw/ ~/.openclaw/extensions/public-thinking/
50
+ ```
51
+
52
+ Or clone it directly:
53
+
54
+ ```bash
55
+ git clone https://github.com/niklasbabel/pressclaw.git ~/.openclaw/extensions/public-thinking
56
+ ```
57
+
58
+ 2. Enable it in your `openclaw.json`:
59
+
60
+ ```json
61
+ {
62
+ "plugins": {
63
+ "entries": {
64
+ "public-thinking": {
65
+ "enabled": true,
66
+ "config": {
67
+ "siteTitle": "My Thinking",
68
+ "authorName": "Your Name"
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ > **Note:** The plugin ID is `public-thinking` for backward compatibility. The name in the UI shows as "PressClaw."
77
+
78
+ 3. Initialize:
79
+
80
+ ```bash
81
+ openclaw notes init
82
+ ```
83
+
84
+ 4. (Optional) Set up the daily content prompt:
85
+
86
+ ```bash
87
+ openclaw notes setup
88
+ ```
89
+
90
+ ---
91
+
92
+ ## Configuration
93
+
94
+ All settings live under `plugins.entries.public-thinking.config` in your `openclaw.json`:
95
+
96
+ | Key | Type | Default | Description |
97
+ |-----|------|---------|-------------|
98
+ | `baseUrl` | string | `""` | Public URL for absolute links in RSS |
99
+ | `publicPath` | string | `"/public"` | URL path prefix for the HTTP server |
100
+ | `notesDir` | string | `""` | Notes directory (default: `{workspace}/notes`) |
101
+ | `outputDir` | string | `""` | Output directory (default: `{workspace}/public`) |
102
+ | `siteTitle` | string | `"Your Thinking"` | Site and RSS feed title |
103
+ | `authorName` | string | `""` | Author name in post footers |
104
+ | `dailyPrompt.enabled` | boolean | `true` | Enable the daily content cron job |
105
+ | `dailyPrompt.schedule` | string | `"0 10 * * *"` | Cron expression (default: 10 AM daily) |
106
+ | `dailyPrompt.timezone` | string | `"UTC"` | Timezone for the schedule |
107
+ | `dailyPrompt.prompt` | string | *(see below)* | The prompt sent to the agent |
108
+
109
+ ### Default Daily Prompt
110
+
111
+ > Review yesterday's conversations and daily notes. Identify any interesting ideas, insights, or learnings worth sharing publicly. If you find something compelling, draft a short note (3-8 paragraphs) that distills the idea for a general audience. Use `openclaw notes new "<title>"` to create it, then write the content. Don't publish yet — just draft. If nothing stands out, that's fine — skip today.
112
+
113
+ ---
114
+
115
+ ## Command Reference
116
+
117
+ ### Dashboard
118
+
119
+ ```bash
120
+ openclaw notes
121
+ ```
122
+
123
+ Shows the full pipeline at a glance: published, refined, drafted, ideas, untracked files, style profile status, and confidence scores.
124
+
125
+ ### Creating & Managing Notes
126
+
127
+ ```bash
128
+ openclaw notes new "Title of your note"
129
+ ```
130
+
131
+ Creates a private markdown file with frontmatter pre-filled. Ready to write.
132
+
133
+ ```bash
134
+ openclaw notes list
135
+ ```
136
+
137
+ Lists all notes with status indicators (🔒 private, ✨ refined, 📢 public) plus any untracked topic ideas.
138
+
139
+ ```bash
140
+ openclaw notes preview <slug>
141
+ ```
142
+
143
+ Shows a note's full content, metadata, word count, tone, structure, and confidence score.
144
+
145
+ ```bash
146
+ openclaw notes voice "Title"
147
+ ```
148
+
149
+ Creates a note marked as voice input. Use for transcribed audio — creates both the note file and a topic entry.
150
+
151
+ ### The Pipeline
152
+
153
+ ```bash
154
+ openclaw notes transform <slug> [--tone <tone>] [--structure <structure>]
155
+ ```
156
+
157
+ Outputs detailed transform instructions for your agent. Injects the style profile, structure template, and tone guidelines. Your agent rewrites the note following these constraints.
158
+
159
+ **Tones:** `authentic` | `professional` | `casual` | `humorous`
160
+ **Structures:** `structured` | `list` | `chunky` | `minimal` | `storytelling` | `thread` | `tldr`
161
+
162
+ ```bash
163
+ openclaw notes refine <slug>
164
+ ```
165
+
166
+ Marks a note as refined (ready for review). Extracts style markers, updates the aggregate style profile, and syncs topic status.
167
+
168
+ ```bash
169
+ openclaw notes test <slug>
170
+ ```
171
+
172
+ Runs audience testing against multiple personas. Each persona evaluates the content from their perspective and provides a score, sentiment, and specific feedback. Results are saved for comparison.
173
+
174
+ ```bash
175
+ openclaw notes publish <slug> [--yes] [--reason <text>]
176
+ ```
177
+
178
+ Publishes a note: sets status to public, rebuilds the HTML site and RSS feed, extracts style markers, updates the style profile. Requires confirmation unless `--yes` is passed.
179
+
180
+ ```bash
181
+ openclaw notes unpublish <slug>
182
+ ```
183
+
184
+ Reverts a note to private and removes it from the public site.
185
+
186
+ ```bash
187
+ openclaw notes build
188
+ ```
189
+
190
+ Regenerates all HTML pages and the RSS feed from published notes. Run after manual edits.
191
+
192
+ ### Branding OS
193
+
194
+ ```bash
195
+ openclaw notes style [--from <slugs>]
196
+ ```
197
+
198
+ Analyzes your writing across refined/published notes and generates a style profile. Extracts voice description, markers (sentence length, perspective, emoji usage, vocabulary), anti-patterns to avoid, and example openers/closers. Use `--from` with comma-separated slugs to analyze specific notes.
199
+
200
+ ```bash
201
+ openclaw notes analyze <slug>
202
+ ```
203
+
204
+ Extracts per-note style markers (sentence count, paragraph count, word count, avg sentence length, perspective, emoji usage, Flesch-Kincaid readability) and saves them to the note's frontmatter.
205
+
206
+ ```bash
207
+ openclaw notes vary <slug> [--tones <tones>] [--structures <structures>]
208
+ ```
209
+
210
+ Generates multiple variations of a note across tone × structure combinations. Default: 4 tones × 1 structure = 4 variations. All saved to `.variations/<slug>/` with a manifest for tracking.
211
+
212
+ ```bash
213
+ openclaw notes variations <slug>
214
+ ```
215
+
216
+ Shows all generated variations for a note with their tone, structure, word count, test status, confidence, and selection state.
217
+
218
+ ```bash
219
+ openclaw notes pick <slug> <variation>
220
+ ```
221
+
222
+ Selects a variation and copies its content into the main note file. Updates frontmatter with the variation's tone and structure.
223
+
224
+ ### Platform Adaptation
225
+
226
+ ```bash
227
+ openclaw notes adapt <slug> --platform <platform>
228
+ ```
229
+
230
+ Reshapes a blog post for a specific platform with detailed format rules, character limits, structure guidance, and examples of good native content.
231
+
232
+ **Platforms:**
233
+ - `linkedin` — Long-form post (3000 chars), hook-first, no markdown, hashtags at end
234
+ - `twitter` — Single tweet (280 chars), punchy take, no hashtags
235
+ - `thread` — Numbered thread (5-10 tweets), hook in tweet 1, recap + CTA at end
236
+
237
+ ### Topic Backlog
238
+
239
+ ```bash
240
+ openclaw notes topics
241
+ ```
242
+
243
+ Shows the full topic backlog organized by status: ideas, drafted, refined, published.
244
+
245
+ ```bash
246
+ openclaw notes topics add "Title" [--source <text>] [--tags <tags>]
247
+ ```
248
+
249
+ Adds a new topic idea. Source tracks where the idea came from. Tags are comma-separated.
250
+
251
+ ```bash
252
+ openclaw notes topics draft <id-or-title>
253
+ ```
254
+
255
+ Creates a note file from a topic idea, links them, and updates the topic status to "drafted."
256
+
257
+ ```bash
258
+ openclaw notes topics remove <id-or-title>
259
+ ```
260
+
261
+ Removes a topic from the backlog.
262
+
263
+ ```bash
264
+ openclaw notes topics scan [--suggest]
265
+ ```
266
+
267
+ Scans your entire workspace for markdown files not yet linked to any topic. With `--suggest`, outputs a prompt for your agent to evaluate which files contain publishable ideas.
268
+
269
+ ### Setup
270
+
271
+ ```bash
272
+ openclaw notes init
273
+ ```
274
+
275
+ Creates notes and output directories, copies a starter template. Run once.
276
+
277
+ ```bash
278
+ openclaw notes setup
279
+ ```
280
+
281
+ Creates the daily prompt cron job (`public-thinking-daily`) using your configured schedule and prompt.
282
+
283
+ ---
284
+
285
+ ## Branding OS
286
+
287
+ PressClaw includes a style system that learns and maintains your writing voice.
288
+
289
+ ### Style DNA
290
+
291
+ Every time you publish or refine a note, PressClaw extracts style markers:
292
+ - Average sentence length and paragraph density
293
+ - Perspective patterns (first-person, second-person, mixed)
294
+ - Emoji usage frequency
295
+ - Flesch-Kincaid readability score
296
+
297
+ These aggregate into a `.style-profile.json` that your agent references when writing new content. The profile evolves over time — recent notes are weighted more heavily, and evolution snapshots track how your style changes.
298
+
299
+ ### Structure Templates
300
+
301
+ Seven built-in structures control how content is organized:
302
+
303
+ | Template | Best For |
304
+ |----------|----------|
305
+ | `structured` | Technical explanations — headers + sections |
306
+ | `list` | Actionable advice — numbered points with sub-details |
307
+ | `chunky` | Mobile/scrollable — short paragraphs, rhythm-based |
308
+ | `minimal` | Expert audiences — dense prose, no decoration |
309
+ | `storytelling` | Experience-based — narrative arc with hook → tension → insight |
310
+ | `thread` | Twitter/X — hook-first numbered segments |
311
+ | `tldr` | Busy readers — conclusion first, then expand |
312
+
313
+ ### Voice Personas
314
+
315
+ Create named style profiles in `.style-profiles/` for different writing voices. Each persona carries its own voice description, vocabulary patterns, and anti-patterns. Reference them by name in the tone field.
316
+
317
+ ### Variations & Testing
318
+
319
+ The `vary` → `test` → `pick` workflow lets you:
320
+ 1. Generate multiple versions across tone/structure combinations
321
+ 2. Test each against audience personas for engagement prediction
322
+ 3. Pick the winner and promote it to the main note
323
+
324
+ ### Platform Adaptation
325
+
326
+ Transform blog posts into platform-native content. Each platform adapter carries detailed conventions, character limits, structure rules, and real examples — so the output feels native, not copy-pasted.
327
+
328
+ ### Style Evolution
329
+
330
+ The dashboard tracks your style over time with evolution snapshots: sentence length trends, word count changes, readability shifts. See how your writing develops as you publish more.
331
+
332
+ ---
333
+
334
+ ## Note Format
335
+
336
+ Notes are markdown files with YAML frontmatter:
337
+
338
+ ```markdown
339
+ ---
340
+ title: "My Note Title"
341
+ slug: "my-note-title"
342
+ status: private
343
+ published_at: null
344
+ tone: null
345
+ structure: null
346
+ confidence: null
347
+ tags: [ideas, tech]
348
+ ---
349
+
350
+ # My Note Title
351
+
352
+ Your content here...
353
+ ```
354
+
355
+ ### Frontmatter Fields
356
+
357
+ | Field | Description |
358
+ |-------|-------------|
359
+ | `title` | Display title |
360
+ | `slug` | URL-safe identifier (auto-generated) |
361
+ | `status` | `private`, `refined`, or `public` |
362
+ | `published_at` | Timestamp set on publish |
363
+ | `publish_reason` | Why you published this (optional) |
364
+ | `topic_id` | Link to topic backlog entry |
365
+ | `input_type` | How the note was created (`voice`, etc.) |
366
+ | `tone` | Applied tone (authentic, professional, casual, humorous, or persona name) |
367
+ | `structure` | Applied structure template |
368
+ | `confidence` | Audience test score (0-10) |
369
+ | `tags` | Array of tags |
370
+ | `style_markers` | Auto-extracted style analysis (JSON) |
371
+
372
+ ---
373
+
374
+ ## Architecture
375
+
376
+ PressClaw runs as an OpenClaw plugin. It registers:
377
+
378
+ - **CLI commands** under `openclaw notes` — the primary interface
379
+ - **HTTP handler** serving the public blog at your configured path, plus a private `/dashboard` view
380
+ - **Cron job** (optional) for daily content prompting
381
+
382
+ All data lives in your workspace as markdown files and JSON. No database, no external services. The style system uses weighted averages with recency decay — recent notes influence the profile more than older ones.
383
+
384
+ The HTML site is regenerated on every publish/unpublish/build. Clean, minimal CSS. No JavaScript. RSS feed included.
385
+
386
+ ---
387
+
388
+ ## License
389
+
390
+ MIT — see [LICENSE](LICENSE).
391
+
392
+ ---
393
+
394
+ Built for [OpenClaw](https://openclaw.ai). Docs at [docs.openclaw.ai](https://docs.openclaw.ai).