Commit graph

105 commits

Author SHA1 Message Date
wangzhuc
ae37aa49e1 fix(ci): use full clone to prevent history loss on amend + force push
actions/checkout@v4 defaults to depth=1. When the CI amends the
triggering commit and force-pushes, the shallow history replaces
the full history on the remote — wiping all prior commits.

Fix: set fetch-depth: 0 for full clone.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 00:00:40 +08:00
wangzhuc
0871162634 feat: visual AI overhaul — style anchoring, typed illustrations, 9-provider fallback
- Add visual anchor extraction after cover confirmation for consistent inline images
- Introduce 6 illustration types (infographic/scene/flowchart/comparison/framework/timeline) with structured prompt templates
- Expand image providers from 3 to 9: add DashScope, MiniMax, Replicate, Azure OpenAI, OpenRouter, Jimeng
- Support multi-provider auto-fallback via `image.providers` config (backward-compatible)
- Update SKILL.md Step 6 and environment check for new capabilities

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:51:53 +08:00
wangzhuc
a92f96a320 ci: amend openclaw build into trigger commit instead of separate commit
Avoids extra bot commits that cause push rejections. Uses --amend
and --force-with-lease so dist/openclaw changes fold into the
original commit cleanly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 14:06:21 +08:00
github-actions[bot]
290c3ee55b chore: rebuild dist/openclaw from source 2026-04-01 06:03:43 +00:00
wangzhuc
5ed39b4e44 feat: improve image relevance — entity anchoring + cover-first flow
SKILL.md Step 6 restructured:
- 6.1: extract 3-5 concrete entities from article before prompting
- 6.2: generate cover only (1 API call, test direction early)
- 6.3: validate cover (interactive: ask user; auto: self-check entities)
- 6.4: batch inline images using cover's style for consistency

visual-prompts.md:
- Add "entity anchoring" hard rule: every prompt must include ≥2 article
  entities; ban vague terms as sole subject ("科技感", "未来感")
- Add anti-pattern → good-pattern examples
- Inline images must reuse cover's style description for consistency

Addresses #9

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 14:03:33 +08:00
github-actions[bot]
e11666c364 chore: rebuild dist/openclaw from source 2026-04-01 05:37:36 +00:00
wangzhuc
c133234dc8 fix: publish 命令支持 --digest 覆盖自动摘要
- cli.py publish 新增 --digest 参数,优先使用传入值,否则回退自动截取
- SKILL.md Step 5 摘要限制从 ≤54 字改为 ≤40 字(对齐微信 120 UTF-8 字节限制)
- SKILL.md Step 7 publish 命令模板补上 --digest

Closes #8

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 13:37:23 +08:00
github-actions[bot]
579b8d04ed chore: rebuild dist/openclaw from source 2026-04-01 05:32:44 +00:00
Ray Wang
c2e0256a4f
Merge pull request #10 from ystyleb/feat/gemini-image
Reviewed and improved: added per-provider API key support, moved key to header, fixed size param, improved error handling.
2026-04-01 13:32:35 +08:00
wangzhuc
eb3115d537 fix: improve GeminiProvider — size hint, API key in header, error handling
- Append size instruction to prompt (Gemini has no native size param)
- Move API key from URL query string to x-goog-api-key header
- Check status_code before parsing JSON to handle non-JSON error responses
- Remove unnecessary Session with trust_env=False
- Remove f-prefix from strings with no interpolation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 13:13:22 +08:00
ystyleb
6e0ff85f30 feat: add Gemini image generation support 2026-04-01 13:05:13 +08:00
github-actions[bot]
8db2c1994a chore: rebuild dist/openclaw from source 2026-04-01 04:38:01 +00:00
wangzhuc
36920125c8 docs: add learn-theme command to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
wangzhuc
62d7af9d7c docs: add learn-theme to README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
wangzhuc
3be092c0ae feat(learn-theme): add SKILL.md trigger words and finalize
- Add "学习排版"/"学排版" to auxiliary functions and Step 8.3 trigger table
- Complete learn-theme feature: URL → extract styles → generate theme YAML

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
wangzhuc
d6900fe85d feat(learn-theme): add CLI with argparse and terminal report
Replace the smoke-test main() with a proper argparse CLI that accepts
a URL and --name, validates the name, fetches + extracts + analyzes the
article, calls generate_theme_yaml(), and writes the YAML to
toolkit/themes/. Prints a human-readable theme report with color values
and typography. Adds `learn-theme` subcommand to toolkit/cli.py
(delegates to subprocess call of scripts/learn_theme.py).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
wangzhuc
1cd9b4409f feat(learn-theme): add theme YAML generation from analyzed styles
Add `generate_theme_yaml()` that builds a complete theme YAML by loading
the professional-clean template CSS, substituting extracted colors and
typography, and deriving a dark-mode palette via `derive_darkmode()`.
Adds `import yaml`, `import argparse`, `from pathlib import Path`, and
module-level constants `TEMPLATE_THEME` / `THEMES_DIR`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
wangzhuc
77e76077d8 fix(learn-theme): HTTP error handling, DRY title extraction, text_light fix
- fetch_article: catch RequestException, add raise_for_status()
- Extract _attach_title() shared by fetch_article and _load_from_file
- text_light: only search foreground colors, not background values

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
wangzhuc
95ba69fd5a feat: learn_theme — add analyze_styles, DEFAULTS, most_common_value, derive_darkmode integration
Excludes dominant text color from accent candidates; blockquote-first
quote_bg heuristic avoids picking up decorative divider colors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
wangzhuc
e457b4463b feat: learn_theme — add HTML fetch/extract layer (fetch_article, extract_styles, parse_inline_style)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
wangzhuc
1168768618 feat: add learn_theme.py — color utilities (rgb_to_hex, lightness, is_gray, adjust_lightness, derive_darkmode)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
wangzhuc
5043173169 docs: add learn-theme implementation plan
7 tasks: color utils, fetch/extract, analysis, YAML gen, CLI, e2e test, SKILL.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
wangzhuc
2b8404c027 docs: add learn-theme design spec
New feature to extract formatting themes from WeChat article URLs.
Covers color extraction, typography analysis, and theme YAML generation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:37:47 +08:00
github-actions[bot]
a349dea556 chore: rebuild dist/openclaw from source 2026-03-31 08:20:36 +00:00
wangzhuc
e0a71be396 chore: bump VERSION to 1.3.4
Content enhancement strategies, new frameworks (opinion/retro),
evergreen topics, effect feedback loop, merged search, content quality
checks, article self-check, WeChat draft box sync for learn-edits,
pipeline reframed from anti-detection to content quality.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:20:17 +08:00
wangzhuc
7f0aff1738 fix: force UTF-8 encoding for WeChat draft/get response
WeChat API returns Content-Type without charset, causing requests to
default to ISO-8859-1. Chinese content was decoded as mojibake.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:20:17 +08:00
wangzhuc
73a67fffc7 fix: improve local file matching for WeChat draft sync
- learn_edits.py: prioritize output_file field from history.yaml,
  fall back to title slug matching, then largest file
- SKILL.md: add output_file field to history.yaml schema
- Fixes wrong file match when multiple articles share the same date

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:20:17 +08:00
wangzhuc
2773a8bb9b feat: sync edits from WeChat draft box for learn-edits
- publisher.py: add get_draft() to fetch draft content by media_id,
  add html_to_plaintext() for HTML→text conversion
- learn_edits.py: add --from-wechat flag that auto-fetches latest draft
  from WeChat, converts both sides to plaintext, and diffs
- learn_edits.py: add markdown_to_plaintext() for local file conversion
- SKILL.md: update edit workflow — both local and WeChat edits supported

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:20:17 +08:00
wangzhuc
973aad5951 docs: clarify edit workflow — local markdown first, then re-publish
- Add Step 8.2 guidance: edits must be in output/ markdown, not WeChat
  draft box, for learn-edits to work
- Update 8.3 "学习我的修改" entry with same note
- Renumber 8.2→8.2 (edit advice) + 8.3→8.3 (reply) for clarity

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:20:17 +08:00
wangzhuc
96f6df6209 refactor: reframe Step 5.3 from anti-detection to quality assessment
- Rename "Tier 3 评估" to "综合评估", describe dimensions directly
  (tone variance, density rhythm, pacing, readability) without
  referencing anti-detection framework
- Reframe composite_score from "0=human, 100=AI" to "0=high quality,
  100=issues found"
- Change 5.3 role from "gate control" to "supplementary verification"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:20:17 +08:00
wangzhuc
7988bb4e99 refactor: streamline Step 4 — remove param reference, add content quality checks
- Remove 4.1 historical param reference (vestige of removed optimization loop)
- Renumber 4.2→4.1 (dimensions), 4.3→4.2 (persona), 4.4→4.3 (exemplars),
  4.5→4.4 (writing), 4.6→4.5 (self-check)
- Exemplar sorting: remove humanness_score ranking, use top 3 by category match
- Writing step: replace "3-layer anti-detection" with "writing-guide basics"
- Quick self-check: expand from 3 anti-AI items to 5 items (2 writing + 3 content:
  opening hook, enhancement throughline, quotable sentence)
- Remove writing-config.yaml from Step 4 required reads

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:20:17 +08:00
wangzhuc
87c4a7d293 feat: effect feedback loop, evergreen topics, merged search, content quality checks
- Topic selection: add historical effect analysis (framework/strategy/title
  performance weighting when stats available), add 2-3 evergreen topics
  alongside trending ones
- Step 3: merge material collection and content enhancement into single
  search pass, with framework-specific search strategies
- Step 5: split verification into writing quality (A) and content quality (B),
  add checks for hook strength, quote density, angle sharpness per framework
- Fix exemplar category mapping for new frameworks (opinion → hot-take,
  retrospective → story-emotional)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:20:17 +08:00
wangzhuc
09f7034794 refactor: align README and SKILL.md, add self-check feature
- Add article self-check ("检查一下"): generation report + quality advice
- Record enhance_strategy in history.yaml
- Replace Zhuque test data with persona style descriptions in README
- Update descriptions: anti-AI focus → content quality focus
- Remove stale parameter optimization references
- Sync all trigger words across README, auxiliary functions, and Step 8.3

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:20:17 +08:00
wangzhuc
45c020727b feat: add content enhancement strategies and 2 new frameworks
- Add content-enhance.md with 4 strategies matched by framework type:
  angle discovery (hot-take/opinion), density boost (pain-point/list),
  detail anchoring (story/retro), real-feel injection (comparison)
- Add 2 new frameworks: pure-opinion (F) and retrospective (G), now 7 total
- Integrate Step 3.3 content enhancement into SKILL.md pipeline
- Remove parameter optimization loop (low ROI, deprioritized)
- Update README: reframe from anti-AI detection to content quality

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 16:20:17 +08:00
github-actions[bot]
f9722fb93b chore: rebuild dist/openclaw from source 2026-03-30 16:55:01 +00:00
wangzhuc
a92d453856 chore: bump VERSION to 1.3.3
Session summary (12 commits):
- SICO exemplar extraction system with seeds fallback
- Closing diversity (content-driven, not persona-fixed)
- Pipeline performance (Step 4.6 self-check, Step 5 tighter rewrites)
- Scoring calibration (bell-curve + over-optimization penalty)
- Word list expansion (neg 26→51, temp bands 29→76)
- 朱雀 A/B validation (exemplar injection: 100% AI → 59% AI)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 00:54:40 +08:00
wangzhuc
85efd10fa8 fix: sync README and SKILL.md after session changes
- README: remove hardcoded line count, add Step 4.6 快速自检 to workflow,
  update humanness_score description with calibration layer
- SKILL.md: fix closing_style → closing_tendency in diagnostic check,
  fix error handling table to match Step 5's 2-round limit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 00:14:31 +08:00
wangzhuc
02f5e6d93b fix: calibrate humanness_score with bell-curve and over-optimization penalty
Problem: AI articles scored MORE human (avg 26.2) than actual human
articles (avg 44.0) — opposite of 朱雀's judgment. AI was gaming the
linear scoring by over-optimizing broken sentences, self-correction,
paragraph variance, etc.

Fix: Two calibration layers added after raw scoring:

1. Bell-curve scoring for 5 over-optimizable dimensions (broken_sentences,
   self_correction, sentence_length_range, paragraph_length_variance,
   banned_words). Score peaks at human article average, penalizes both
   too-low AND too-high values.

2. Over-optimization penalty: 15% global penalty when 60%+ of checks
   score above 0.8, indicating suspiciously "perfect" articles.

Results:
  Before: Human avg=44.0, AI avg=26.2 (WRONG direction)
  After:  Human avg=42.5, AI avg=44.0 (CORRECT direction)
  A/B test now agrees with 朱雀 (exemplar version scores better)

Baselines derived from 15 human articles tested on 2026-03-30.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 00:09:14 +08:00
wangzhuc
792aec4101 refine: optimize exemplar seeds with data-driven segment selection
Replace 5 seed segments sourced from weaker articles (score 47-57)
with segments from the highest-scoring articles (score 32-37):

- Opening: add 国内+日本留学 label-contrast opening (stddev 45.7)
- Opening: add 长期主义骗局 belief-then-shatter opening
- Emotional: add 国内+日本留学 温水煮青蛙 stagnation segment
- Closing: replace 人夫约会指南 (57.1) with 庞氏骗局 (36.7)
- Closing: replace 天才在左 (51.7) with 穷人没教育 (33.0)

All replacements maintain pattern diversity while upgrading to
segments from data-proven most-human articles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 23:32:10 +08:00
wangzhuc
f7fe44c152 fix: expand negative markers and vocabulary temperature word lists
NEGATIVE_MARKERS: 26 → 51 words
  Added: despair (绝望/迷茫/心累), deception (骗/忽悠/割韭菜/套路),
  failure (白费/黄了/凉了), self-deprecation (傻/天真/自嗨),
  sarcasm (呵呵/行吧/真服了), complaint (受够了/苦哈哈)

COLD_WORDS: 7 → 25 (技术栈/标准化/护城河/飞轮/底层逻辑/PMF/ROI...)
WARM_WORDS: 7 → 15 (老实说/这么说吧/你想啊/有意思的是...)
HOT_WORDS: 8 → 19 (凡尔赛/标题党/躺平/摆烂/破防/上头/内耗...)
WILD_WORDS: 7 → 17 (苦哈哈/傻乎乎/交学费/踩坑/翻车...)

Impact on 15 exemplar articles:
  neg score avg: 0.15 → 0.27 (+80%)
  temp_mix: still low on short segments, but full articles now
  score 0.33-1.00 vs previously 0.00

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 23:23:51 +08:00
wangzhuc
d9b87f806f perf: reduce pipeline latency with pre-check and tighter rewrite loops
- Step 4.6: add quick self-check after writing (banned words, sentence
  variance, negative emotion) to fix obvious issues before Step 5
- Step 5.2: tighten rewrite scope to specific sentences only, max 3
  fixes per round, reduce max rounds from 3 to 2
- Step 5.3: reduce scoring rewrite from 3 rounds to 2, mark
  DONE_WITH_CONCERNS instead of infinite loops when score stays >50

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 23:14:24 +08:00
wangzhuc
79edadd72e fix: make closing style content-driven instead of persona-fixed
- Rename closing_style → closing_tendency in all 5 personas, making it
  a soft preference rather than a hard constraint
- Add closing variation rule + 6 closing patterns table to writing-guide.md
- Step 4.5: LLM judges best closing from content; checks history.yaml
  last 3 articles to avoid repeating the same closing_type
- Step 8.1: record closing_type in history.yaml for dedup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 23:07:09 +08:00
wangzhuc
15a5adbd48 chore: update README with exemplar system docs, bump VERSION to 1.3.2
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 22:59:14 +08:00
wangzhuc
7a4f345bb1 fix: align exemplar injection across user/seed paths, clarify priority
- Add transition segment to user exemplar injection (was 3 segments,
  now 4 to match seeds path)
- Clarify priority chain: playbook > persona > exemplar > writing-guide
- Add exemplar fallback row to error handling table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 22:57:19 +08:00
wangzhuc
d2b87c489c feat: add universal exemplar seeds for users without articles
Seeds demonstrate anti-AI structural patterns (sentence variance, real
negative emotion, self-correction, abrupt closings) without imposing a
specific writing style. Step 4.4 falls back to seeds when the user's
exemplar library is empty.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 22:53:37 +08:00
wangzhuc
fbe2709bb5 feat: add exemplar library check to Step 1 environment scan
Prompts users to import articles when exemplar library is empty,
without blocking the pipeline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 22:49:57 +08:00
wangzhuc
83c963527c fix: use filename as fallback source when article has no H1 title
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 22:42:23 +08:00
wangzhuc
885cae8e7d feat: add SICO-style exemplar extraction system for few-shot writing
- New script: scripts/extract_exemplar.py
  Extracts style fingerprints from human-written articles (opening hook,
  emotional peak, transition/self-correction, closing) with statistical
  analysis (sentence stddev, vocab temperature, negative ratio, paragraph CV).
  Auto-detects category, supports batch import.

- SKILL.md: Add Step 4.4 exemplar injection
  Loads matching exemplars by category before writing, injects segments
  as few-shot style examples in the prompt.

- learn_edits.py: Auto-grow exemplar library
  After user edits, auto-extracts the final version into the exemplar
  library if humanness_score <= 50.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 22:32:02 +08:00
wangzhuc
e54137ce3e chore: bump VERSION to 1.3.1
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 20:53:33 +08:00
wangzhuc
4c09df31b3 chore: gitignore CLAUDE.md, remove from tracking
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 20:51:25 +08:00