Skip to content

v0.11.0 — Prompt Engineer mode

Pre-release
Pre-release

Choose a tag to compare

@hoangperry hoangperry released this 26 May 21:03

Prompt Engineer mode

Type a minimal Vietnamese keyword sketch of a coding task. Press a hotkey. The app pastes back a complete, well-structured English prompt ready for Claude Code, Codex, ChatGPT, or Claude Desktop.

Same hotkey machinery as translate/rewrite — different system prompt, different temperature, different intent. This release makes the use case documented at contextmt.dev/recipes/prompt-expander first-class shipping infrastructure.

Added

  • TranslationDirection.expand enum case + new PromptBinding data type (id, name, hotkey, targetLanguage default en, styleInstruction defaults to shared template when blank).
  • Settings → Prompt Engineer section parallel to Contextual rewrite. Per-binding rows: name, target language, optional custom expansion guidelines, hotkey recorder, delete. Gated on rewriteAvailable.
  • TranslationWorkflow.expandAndSend(binding:) — capture selection → translate with direction = .expand → always preview (output is N× longer than input) → paste on confirm.
  • AppDelegate registers settings.promptBindings on the same gate as rewrite bindings.
  • PromptBuilder.expandSystemPrompt mirrors the Supabase EXPAND_SYSTEM_PROMPT so direct-API providers (Gemini direct, OpenAI direct) get the same expansion quality without a backend round-trip.

Server side (already deployed)

  • Supabase translate Edge Function accepts direction: "expand", swaps to EXPAND_SYSTEM_PROMPT, bumps temperature 0.3 → 0.6, and drops the Source language line from the user prompt. Cache key includes direction so expand / rewrite / translate of the same input get separate slots.

Tests

  • +10 new testsPromptBindingTests (7: Codable, default fallback, custom precedence, style() pinning, persistence, conflict detection), ExpandDirectionWireFormatTests (2: raw value + JSON shape), BackendStreamingTests (1: end-to-end direction=expand reaches wire body).
  • 400 tests pass (was 390).

Risk-free upgrade

UserDefaults adds one new key (translator.promptBindings) defaulting to empty array. Users opt in by adding a binding in Settings → Prompt Engineer. No migration needed.

Install

  • Recommended: download the DMG below — open, drag the app into Applications, launch.
  • Sparkle auto-updates from v0.10.3+ work.

Both DMG and ZIP are signed (Developer ID JP4XV8A9JF), notarized by Apple, and stapled. Apple Silicon only. macOS 14 or later.

How to use

  1. Settings → Prompt Engineer → Add binding. A default hotkey (⌥P) is suggested; change with the recorder if it collides.
  2. Optionally open Custom expansion guidelines to override the default template (e.g. pin a specific tech stack: "I work in Swift 6 + SwiftUI on macOS 14+").
  3. From any chat input field (Claude Code, Codex web UI, ChatGPT, etc.), type a minimal sketch in Vietnamese — fix bug login keychain swift, prompt password lặp — then press ⌥P. The PreviewHUD shows the expanded prompt; confirm to paste.