# AI Writing Assistant **Status:** Implemented **Last Updated:** 2026-01-03 --- ## Overview The AI Writing Assistant provides intelligent content rewriting and feedback across all text fields in Facet's admin interface. It helps users craft professional, impactful portfolio content with multiple tone options and inline critique functionality. ## Features ### 1. **Multi-Tone Rewriting** Transform your content with five distinct professional tones: #### 👔 Executive - **Best for:** C-suite resumes, leadership roles, strategic positions - **Style:** Formal, authoritative, business-outcome focused - **Example:** - Before: "Worked on improving team processes" - After: "Directed cross-functional initiative to streamline operations, resulting in 30% reduction in cycle time and $2M annual savings" #### 💼 Professional (Default) - **Best for:** Standard resumes, LinkedIn profiles, general portfolios - **Style:** Balanced, achievement-focused, industry-appropriate - **Example:** - Before: "Built some features for the app" - After: "Developed core product features including real-time notifications and advanced search, improving user engagement by 45%" #### ⚙️ Technical - **Best for:** Developer portfolios, engineering roles, technical blogs - **Style:** Technology-focused, precise, methodology-driven - **Example:** - Before: "Made the app faster" - After: "Implemented distributed caching using Redis and optimized database queries with indexed column strategies, reducing API latency from 800ms to 120ms" #### 💬 Conversational - **Best for:** Personal websites, creative portfolios, about pages - **Style:** Approachable, human, first-person friendly - **Example:** - Before: "Responsible for UI development" - After: "I designed and built the entire user interface using React and Tailwind, focusing on accessibility and mobile-first design" #### 🎨 Creative - **Best for:** Design portfolios, agencies, storytelling projects - **Style:** Engaging, descriptive, impact-focused - **Example:** - Before: "Created a new dashboard" - After: "Transformed a complex data landscape into an intuitive visual story, helping users discover insights 3x faster through thoughtful information architecture" ### 2. **AI Critique Mode** 💭 Get constructive inline feedback without rewriting: ``` Original Input: "Worked on improving the application's performance using various techniques" AI Feedback: "Worked on [Weak verb - try 'optimized' or 'redesigned'] improving the application's performance [By how much? 2x? 50% faster?] using various techniques [Too vague - name specific techniques like caching, query optimization, etc.]" ``` **Critique focuses on:** - Identifying vague language - Requesting quantification - Flagging buzzwords and AI-sounding phrases - Suggesting stronger verbs - Noting missing context ### 3. **Anti-AI Writing Rules** All tones enforce strict "don't sound like AI" guidelines: **Banned Words/Phrases:** - ❌ delve, leverage, utilize, spearheaded - ❌ synergy, cutting-edge, comprehensive, robust - ❌ streamline, optimize, revolutionize, game-changing - ❌ state-of-the-art, paradigm, holistic, seamless **Banned Punctuation:** - ❌ Em dashes (—) → Use commas, periods, or "and" **Enforced Best Practices:** - ✅ Active voice over passive - ✅ Specific verbs over generic ones - ✅ Quantified achievements - ✅ Varied sentence structure - ✅ Concrete details over abstractions --- ## Where to Use The AI Writing Assistant appears on these admin pages: ### High-Value Fields 1. **Experience** (`/admin/experience`) - Description field - Key achievements/bullets 2. **Projects** (`/admin/projects`) - Summary field - Full description 3. **Profile** (`/admin/profile`) - Headline - Professional summary 4. **Education** (`/admin/education`) - Description field 5. **View Editors** (`/admin/views/[id]`) - Item override descriptions ### Medium-Value Fields 6. **Posts** (`/admin/posts`) - Excerpt - Content (for blog posts) 7. **Talks** (`/admin/talks`) - Description --- ## How to Use ### Basic Workflow 1. **Enter or paste your content** into any text field 2. **Click the "AI Assistant" button** (appears to the right of field labels) 3. **Choose your action:** - **Rewrite tab:** Select a tone (Executive, Professional, Technical, etc.) - **Get Feedback tab:** Click to receive inline critique 4. **Review the preview:** - For rewrites: See side-by-side comparison - For critiques: See original with [bracketed feedback] 5. **Apply or cancel:** - Click "Apply Changes" to replace your content - Click "Cancel" to keep the original ### Context-Aware Prompts The AI automatically uses context from other fields: **Example: Experience Description** - Uses: Job title, company name, location - Prompt includes: "Context: role: Senior Engineer, company: Acme Inc, location: SF" **Example: Project Description** - Uses: Project title, tech stack, categories - Helps AI understand domain and technical level ### Tips for Best Results 1. **Provide some starting content** - AI rewrites work better with a base to improve 2. **Fill in context fields first** - Job title, company, etc. help AI understand the domain 3. **Try different tones** - See which voice fits your target audience 4. **Use critique for learning** - Understand what makes content stronger 5. **Iterate** - You can rewrite multiple times with different tones 6. **Edit AI output** - Always review and personalize AI suggestions --- ## Configuration ### Setup AI Writing Assistant requires an active AI provider configured in Settings. Facet is bring-your-own-key: you supply your own provider credentials, and there are no managed AI credits or token quotas. 1. Go to **Settings > Integrations** (`/admin/settings/integrations`) 2. Add a provider with your own credentials: - **OpenAI:** Requires API key, uses `gpt-4o` or `gpt-4o-mini` - **Anthropic:** Requires API key, uses `claude-sonnet-4-20250514` - **Ollama:** Local installation, no API key needed 3. Mark one provider as **default** 4. Test the connection **Environment Auto-Configuration:** Set environment variables to auto-configure providers: ```bash # Anthropic (recommended) ANTHROPIC_API_KEY=sk-ant-... # OpenAI OPENAI_API_KEY=sk-... # Ollama (local) OLLAMA_BASE_URL=http://localhost:11434 OLLAMA_MODEL=llama3.2 ``` ### Cost Considerations **Typical Usage Costs (per rewrite):** - OpenAI GPT-4o-mini: ~$0.001-0.003 - Anthropic Claude Sonnet: ~$0.003-0.008 - Ollama (local): Free (uses local compute) **Recommendations:** - **Budget-conscious:** Use GPT-4o-mini or local Ollama - **Best quality:** Claude Sonnet 4 or GPT-4o - **Privacy-focused:** Run Ollama locally --- ## API Reference ### POST `/api/ai/rewrite` Rewrite content with a specific tone. **Request:** ```json { "content": "Your original text here", "field_type": "description", "context": { "role": "Software Engineer", "company": "Acme Inc", "location": "San Francisco" }, "tone": "professional" } ``` **Response:** ```json { "content": "Rewritten professional content...", "tone": "professional", "provider": "Claude (Auto)" } ``` **Tones:** `executive`, `professional`, `technical`, `conversational`, `creative` --- ### POST `/api/ai/critique` Get inline feedback on content. **Request:** ```json { "content": "Your text to critique", "field_type": "description", "context": { "role": "Product Manager", "company": "TechCorp" } } ``` **Response:** ```json { "content": "Your text [with inline feedback in brackets]", "provider": "Claude (Auto)" } ``` --- ## Component Usage ### AIContentHelper Component ```svelte