Learn the writing style from the user's conversations and text samples, and reuse it in subsequent writing tasks.
Use Cases
- The user says "Remember my writing style" or "Write an XXX in my style"
- The user provides several of their own articles as samples
- Xiaodazi proactively identifies that the user has stable writing preferences
Workflow
Stage 1: Collect Samples
When the user provides text samples, extract style features:
输入:用户的 1-3 篇文本样本
↓
分析维度:
- 语气:正式/半正式/口语/学术
- 句式:长句偏好/短句偏好/混合
- 用词:书面/通俗/专业术语密度
- 结构:段落长度/转折词/列表偏好
- 特殊习惯:口头禅/常用表达/标点习惯
↓
输出:风格画像(结构化 JSON)
Stage 2: Save the Style Profile
Save the style profile as a local file for reference in subsequent writing.
# 风格画像存储路径
~/.xiaodazi/styles/
# 文件格式
~/.xiaodazi/styles/{用户名}_default.json
~/.xiaodazi/styles/{用户名}_{场景名}.json # 可按场景保存多套风格
Style Profile Structure:
{
"name": "默认风格",
"created_at": "2025-01-15",
"updated_at": "2025-02-07",
"sample_count": 3,
"profile": {
"tone": "半正式,亲切但不随意",
"sentence_style": "短句为主,偶尔用长句做总结",
"vocabulary": "通俗用词,避免学术术语,喜欢用比喻",
"structure": "开头直入主题,段落短(3-5句),善用列表",
"special_habits": [
"喜欢用破折号做补充说明",
"段尾常用反问句引发思考",
"数字用阿拉伯数字不用中文"
]
},
"few_shot_examples": [
{
"context": "写产品介绍",
"sample": "(截取的 200 字典型片段)"
}
]
}
Stage 3: Apply the Style
During writing tasks, read the style profile and inject it into the prompt:
用户请求:「帮我写一篇关于 AI 的文章」
↓
读取风格画像 → 提取关键约束
↓
生成时遵循:
- 语气:半正式,亲切
- 句式:短句为主
- 用词:通俗,多用比喻
- 结构:开头直入主题,段落 3-5 句
↓
输出:符合用户风格的文章
Stage 4: Continuous Learning
Each time the user modifies the output or gives feedback, update the style profile:
- The user says "Too formal" → adjust tone to be more colloquial
- The user manually modifies the output → compare the differences and update preferences
- Automatically update the profile after accumulating 5+ instances of feedback
Command Reference
Save the style profile
mkdir -p ~/.xiaodazi/styles
cat > ~/.xiaodazi/styles/default.json << 'EOF'
{
"name": "默认风格",
...
}
EOF
Read the style profile
cat ~/.xiaodazi/styles/default.json
List existing styles
ls ~/.xiaodazi/styles/
Output Specifications
- When analyzing style, use plain language (avoid linguistic terminology)
- After saving successfully, tell the user "I've remembered your writing style"
- When writing, do not mention "I'm using your style profile"; write naturally
- The user can say "switch to a formal style" to temporarily switch without affecting the saved profile