style-learning-loop
How to learn and refine the user's writing style from their sent emails, and when to consolidate fingerprints into a tight rulebook
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
How to learn and refine the user's writing style from their sent emails, and when to consolidate fingerprints into a tight rulebook
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when the user wants to build a Google ADK agent — scaffolding a new agent, adding tools/skills/prompts to one, or asking how to structure an ADK project. Triggers on phrases like "create an ADK agent", "build a Google agent", "scaffold an agent", "make an agent that does X", "I need an ADK skeleton", or any task involving generated-agents/, LlmAgent, SkillToolset, or the ADK framework. Also use whenever the user mentions `nuvel`, the `nuvel` CLI, or asks about agent architecture patterns / callbacks / HITL / streaming / ADK prompt engineering — nuvel ships the canonical knowledge skills for those topics. Lean toward triggering — if the task touches Google ADK at all, this skill is in scope.
Delegate work to sub-agents with the ADK 2.0 Task API — `mode='task'`, `mode='single_turn'`, `mode='chat'` on `LlmAgent`, the auto-attached `finish_task` tool, and typed contracts via `input_schema` / `output_schema`. Load this skill when one agent needs to hand a bounded unit of work to another and get a validated result back, or when migrating off SequentialAgent / ParallelAgent / LoopAgent.
Creating valid SKILL.md files following the agentskills.io specification — frontmatter, instructions, references directory, progressive disclosure (L1/L2/L3), and SkillToolset wiring in agent.py. Load this skill when generating domain skills for an agent.
Build graph-based agents with ADK 2.0 `Workflow` — declare nodes and edges, route conditionally, fan-out/fan-in in parallel, run dynamic nodes at runtime, and add human-in-the-loop revision cycles. Load this skill whenever the agent needs anything beyond a strictly linear or trivially parallel pipeline.
Agent architecture patterns for Google ADK 2.0 — when to reach for a single LlmAgent, a Workflow graph (new default for multi-step orchestration), or the shortcut classes SequentialAgent / LoopAgent / ParallelAgent. Load this skill when deciding the agent's top-level shape.
Pattern for turning a brief into a coherent deck outline — intent detection, section ratios, draft headings, expansion
| name | style-learning-loop |
| description | How to learn and refine the user's writing style from their sent emails, and when to consolidate fingerprints into a tight rulebook |
| when_to_use | After the user sends an email (the taskpane will call this automatically), or when the user explicitly asks the agent to "learn from" / "study" their writing. |
The agent gets better at sounding like the user over time. The mechanism is a markdown topic called writing-style that accumulates fingerprints and gets compressed into rules.
For each sent email, call learn_style_from_sent_email(body, recipient, subject). This appends a structured note like:
## Sent sample
- to: anna@…
- subject: Q3 budget
- words/sentences: 84/6 (avg 14.0 w/s)
- opener: "Hi Anna,"
- signoff: "Thanks, J"
- punctuation: 0! / 1? / 6 contractions / 2 em-dashes / 0 bullet lines
These are raw signals, not rules. Don't show them to the user; they're working memory.
When fingerprints accumulate, read them and derive durable rules. Then call consolidate_writing_style(distilled_markdown) with a tight rulebook.
A good rulebook looks like:
# User voice — rulebook (v3)
## Opener
- Default: `Hi <name>,` on first-touch threads.
- In replies, no opener — jumps straight in.
## Sign-off
- Almost always: `Thanks, J`
- Casual / one-liner: just `J`
- Never: `Best regards`, `Sincerely`, `Kind regards`
## Sentence shape
- Average 14 words per sentence; cap at 25.
- 5–8 sentences per email is the common shape.
## Voice tics
- Uses contractions freely (~6 per email).
- Em-dashes for asides — comfortably.
- Zero exclamation marks. Convert ! → . if drafting.
- One rhetorical question per email is fine; more is rare.
## Recipient-specific overrides
- See `recipient-<email>` memories for one-off calibrations.
Keep it under ~2KB. Rules the drafting/coaching tools can apply mechanically.
If the taskpane reports an edit (sent body ≠ drafted body), the edit is the strongest learning signal. Save the delta as a memory note:
recall_memory → check for "edit-patterns" topic
save_memory(topic="edit-patterns", content="Cut 'Just wanted to check in — ' from openers. User prefers cold-start.")
These get folded into the rulebook on the next consolidation.
recall_writing_style returns to drafting/coaching; raw fingerprints should be pruned.