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>
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>
- 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>
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>
- 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>
- 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>
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>
- 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>
learn_edits.py: patterns now have type/key/description/rule fields,
confidence auto-computed from occurrences + recency with 30-day decay.
--summarize --json outputs aggregated patterns sorted by confidence.
learn-edits.md: playbook.md format changed from free text to structured
YAML rules with confidence levels. Rules with confidence ≥ 5 become
hard constraints in Step 4, < 5 are soft references, < 2 get pruned.
SKILL.md Step 4: playbook priority now confidence-gated.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
optimize_loop.py was framework-only (needed external LLM API). The
optimization is now an auxiliary function in SKILL.md driven by the
already-running agent. All references updated across README, CLAUDE.md,
diagnose.py, and writing-config.example.yaml.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 11 checks across 2 tiers (6 statistical + 5 pattern), up from 6
- Continuous 0-1 scores instead of pass/fail booleans
- Each check maps to a writing-config parameter via param field
- New checks: negative emotion ratio, adverb density, vocabulary richness,
sentence length range, self-correction patterns
- New --tier3 flag for agent to pass LLM structural analysis score
- param_scores in JSON output: flat param→score map for optimization
- Standalone mode redistributes weights (T1=62.5%, T2=37.5%)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add VERSION file (1.2.0)
- SKILL.md Step 1: auto-check for updates on each run
- SKILL.md: add "更新" auxiliary function (git pull)
- README: install via git clone instead of cp/ln
- build_openclaw.py: include VERSION in dist
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- scripts/build_openclaw.py:SKILL.md 转换({skill_dir}→{baseDir}、WebSearch→web_search、移除 allowed-tools)
- .github/workflows/build-openclaw.yml:push to main 时自动构建 dist/openclaw/
- dist/openclaw/:首次构建产物入库,OpenClaw 用户可直接使用
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously, hotspots were sorted by raw hot values directly, but different
platforms use vastly different scales (Toutiao ~10M, Weibo ~1M, Baidu ~100K),
causing Toutiao to dominate all results while Weibo and Baidu entries were
always truncated.
Now uses rank-based normalization (0-100) within each source before merging,
so cross-platform sorting gives equal weight to each platform's top stories.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>