blog-style

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Blog Style - Writing Style Learning

博客风格 - 写作风格学习

Learn an author voice profile from existing posts, then use it as a baseline for VOICE.md, blog-persona, and blog-write. The profile captures measurable style signals so future drafts can preserve the author's cadence, vocabulary, and tone.
从现有文章中学习作者的语气配置文件,然后将其用作VOICE.md、blog-persona和blog-write的基准。该配置文件可捕捉可衡量的风格信号,以便未来的草稿能保留作者的节奏、词汇和语气。

Commands

命令

CommandPurpose
/blog style learn <paths>
Analyze sample posts and generate a voice profile
命令用途
/blog style learn <paths>
分析示例文章并生成语气配置文件

Learn Workflow

学习流程

Use 5 to 10 representative posts from the same author, brand, or editorial voice. Accept individual markdown files, MDX files, text files, or a directory containing posts.
Run the local learner:
bash
python3 scripts/style_learn.py <paths> --format markdown
For machine-readable output:
bash
python3 scripts/style_learn.py <paths> --format json --output voice-profile.json
For a VOICE.md-ready block:
bash
python3 scripts/style_learn.py <paths> --format markdown --output VOICE.md
If fewer than the requested minimum sample count is supplied, warn and continue. The default minimum is 5 posts.
使用来自同一作者、品牌或编辑语气的5到10篇代表性文章。支持单个markdown文件、MDX文件、文本文件,或包含文章的目录。
运行本地学习器:
bash
python3 scripts/style_learn.py <paths> --format markdown
如需机器可读的输出:
bash
python3 scripts/style_learn.py <paths> --format json --output voice-profile.json
如需可直接用于VOICE.md的内容块:
bash
python3 scripts/style_learn.py <paths> --format markdown --output VOICE.md
如果提供的样本数量少于要求的最低值,系统会发出警告并继续执行。默认最低样本数为5篇文章。

Profile Fields

配置文件字段

The learner aggregates the existing blog analyzer across each sample post:
  • Sentence length mean and median
  • Sentence length burstiness as corpus variance
  • Vocabulary richness as type-token ratio
  • Transition-word sentence rate
  • Passive-voice sentence rate
  • AI trigger words per 1,000 words as a baseline to preserve or avoid
  • Paragraph-length distribution
  • First-person usage rate
  • Heading-as-question ratio
  • Signature phrases from top 2-gram and 3-gram content phrases with stopwords removed
  • Tone descriptors derived from the measured metrics
学习器会汇总现有博客分析器对每篇样本文章的分析结果:
  • 句子长度的平均值和中位数
  • 句子长度的突发性(语料库方差)
  • 词汇丰富度(类型-标记比)
  • 过渡词句子占比
  • 被动语态句子占比
  • 每1000个单词中的AI触发词数量(作为保留或避免的基准)
  • 段落长度分布
  • 第一人称使用频率
  • 标题为疑问句的比例
  • 去除停用词后的热门二元组和三元组内容短语中的标志性短语
  • 基于测量指标得出的语气描述符

Consuming the Profile

配置文件的使用

Drop the markdown block into project
VOICE.md
when the goal is durable project context. Blog-write can use the style baselines as drafting targets:
  • Keep average sentence length near the learned mean.
  • Match the learned sentence variation unless the user asks for a tighter or looser cadence.
  • Preserve signature phrases only when they fit the topic naturally.
  • Treat the AI trigger baseline as a ceiling when the author rarely uses those terms.
  • Use the first-person and heading-question rates to decide how personal and question-led the draft should feel.
Feed the JSON output into blog-persona when a structured persona should be created or updated. Map the learned values to persona sentence length, passive voice, readability, vocabulary, and tone settings.
当需要持久化项目上下文时,将markdown内容块放入项目的VOICE.md中。Blog-write可将风格基准用作草稿目标:
  • 保持平均句子长度接近学习到的平均值。
  • 匹配学习到的句子变化度,除非用户要求更紧凑或更松散的节奏。
  • 仅当标志性短语自然契合主题时才保留它们。
  • 若作者很少使用AI触发词,则将AI触发词基准视为上限。
  • 根据第一人称使用频率和标题疑问句比例,决定草稿应具有的个人化程度和以问题为导向的程度。
将JSON输出导入blog-persona,以创建或更新结构化角色。将学习到的值映射到角色的句子长度、被动语态、可读性、词汇和语气设置。

Error Handling

错误处理

  • Too few posts: Continue and warn that the profile may be less stable.
  • Missing paths: Skip missing paths and include a warning in the profile.
  • Unsupported files: Skip unsupported file types and include a warning.
  • Empty samples: Return zeroed metrics rather than crashing.
  • 文章数量过少:继续执行并警告配置文件可能不够稳定。
  • 路径缺失:跳过缺失的路径并在配置文件中包含警告信息。
  • 不支持的文件类型:跳过不支持的文件类型并包含警告信息。
  • 空样本:返回零值指标而非崩溃。