Anthropic AI Note Writer
Server-side Claude call generates a tone-conditioned note from a manager's description of what happened
Overview
The "Help me write this" button on the Send form calls the Anthropic API to turn a short description of what happened into a polished 2–4 sentence note. The goal — per the brief — is that notes feel like coaching, not warnings, which is critical for adoption.
Model
const MODEL = "claude-sonnet-4-20250514";Where it runs
The brief recommends the Anthropic API key be server-side. The Anthropic call should be made from a server route, with the manager's input and tone passed in from the browser, and the generated note returned as plain text.
ANTHROPIC_API_KEY=sk-ant-your-key-hereTones
Corrections
- Gentle nudge
- Direct
- Firm
Recognition
- Warm
- Enthusiastic
- Professional
Output target
2–4 sentences, written in the selected tone, framed around the specific process and what happened.
Prompts
The canonical prompts live in the prototype source. When that source becomes available, replicate them verbatim.
Until then, ship with derived placeholder prompts and leave a clear TODO to swap them in once the prototype source is on hand. The placeholder prompts should:
- Take the manager's description, the process name, the type (correction or recognition), and the selected tone.
- Instruct Claude to produce a 2–4 sentence note in the selected tone.
- Reference the process by name so the output feels specific.
Input pathway
The AI input field accepts both typed text and voice (the same microphone control documented under Web Speech API). Managers can describe what happened by speaking, then let Claude clean it up.