@jakevin7: 今天偶然间又翻到了@yetone 之前的 构建 typeless 的 prompt, 真的是很精髓。 细细品味了下,有一点提示词即是 harness 的感觉。 里面包含了个人对于项目边界的约束和对项目整个的设计。没有多余的废话,但是把该约…

X AI KOLs Timeline 工具

摘要

分享了一个基于Claude生成的macOS菜单栏语音输入应用的源码Prompt,该Prompt详细描述了应用的功能需求,体现了高效的Prompt设计。

今天偶然间又翻到了@yetone 之前的 构建 typeless 的 prompt, 真的是很精髓。 细细品味了下,有一点提示词即是 harness 的感觉。 里面包含了个人对于项目边界的约束和对项目整个的设计。没有多余的废话,但是把该约束的细节都约束到了。 https://github.com/yetone/voice-input-src/blob/master/README_CN.md…
查看原文
查看缓存全文

缓存时间: 2026/06/26 08:07

今天偶然间又翻到了@yetone 之前的 构建 typeless 的 prompt, 真的是很精髓。 细细品味了下,有一点提示词即是 harness 的感觉。 里面包含了个人对于项目边界的约束和对项目整个的设计。没有多余的废话,但是把该约束的细节都约束到了。

https://github.com/yetone/voice-input-src/blob/master/README_CN.md…


yetone/voice-input-src

Source: https://github.com/yetone/voice-input-src

中文 | English

Source Code

claude \
  --dangerously-skip-permissions \
  --output-format=stream-json \
  --verbose \
  -p "Please implement a macOS menu-bar voice input app (Swift, macOS 14+) with the following requirements:

1. Hold the Fn key to record, release to inject the transcribed text into the currently focused input field. Use streaming transcription (Apple Speech Recognition framework) as preferred approach. Monitor Fn key globally via CGEvent tap, suppressing the Fn event to prevent triggering the emoji picker.
2. Default language must be Simplified Chinese (zh-CN), ensuring Chinese input recognition works out of the box. Also provide language switching options in the menu bar (English, Simplified Chinese, Traditional Chinese, Japanese, Korean). Language selection is stored in UserDefaults.
3. While recording, display an elegant frameless capsule-shaped floating window centered at the bottom of the screen — no traffic lights or titlebar. Use NSPanel (nonactivatingPanel) + NSVisualEffectView (.hudWindow material), sufficient height (56px, corner radius 28px), containing:
   - 5 vertical bar waveform animation on the left (44×32px), driven by real-time audio RMS levels (no hardcoded fake animations) — louder speech produces larger waveforms, quiet moments produce smaller ones. Bar weights are [0.5, 0.8, 1.0, 0.75, 0.55] creating a natural center-high, sides-low effect. Smooth envelope (attack 40%, release 15%), add ±4% random jitter per bar for organic feel. Waveforms should be large enough to be clearly visible.
   - Text label on the right (elastic width 160-560px) showing real-time transcription, capsule elastically widens as text grows
   - Entry spring animation (0.35s), text width smooth transition (0.25s), exit scale animation (0.22s)
4. Text injection uses clipboard + simulated Cmd+V paste. Before injection, detect the current input method: if it is a CJK input method, temporarily switch to an ASCII input source (ABC/US keyboard) before pasting, then restore the original input method after paste completes — this prevents CJK input methods from intercepting Cmd+V. Restore original clipboard contents after injection.
5. Integrate LLM to improve speech recognition accuracy, especially for mixed Chinese-English scenarios. Use an OpenAI-compatible API (configurable API Base URL, API Key, Model) to refine transcribed text. The LLM system prompt must be very conservative in corrections: only fix obvious speech recognition errors (e.g., Chinese homophone errors, English technical terms mistakenly converted to Chinese like 配森→Python, 杰森→JSON). Never rewrite, polish, or remove any content that appears correct — if the input looks correct, return it as-is.
6. Provide an LLM Refinement submenu in the menu bar with an enable/disable toggle and a Settings entry. The Settings window contains three input fields: API Base URL, API Key, Model — the API Key field must support being fully cleared — plus Test and Save buttons. After releasing Fn, if LLM is enabled and configured, the floating window shows a Refining... status, waiting for the LLM response before injecting the final text.
7. The app runs in LSUIElement mode (menu bar icon only, no Dock icon). Build with Swift Package Manager, provide a Makefile (build/run/install/clean), build output is a signed .app bundle."

Dist

https://github.com/yetone/voice-input-dist

相似文章

@RealCodedAlpha: 看完这张疑似 Anthropic 内部优化的 Fable 5 Prompt 结构,我才意识到:大多数人写 Prompt,其实一开始方向就错了! 很多人以为好 Prompt = 更长、更复杂、更多技巧、更多角色设定。 但这张图给出的结构非常…

X AI KOLs Timeline

这篇推文介绍了一种源自Anthropic内部优化的Fable 5 Prompt结构,强调写提示词时应聚焦于目标、边界和验收标准,而不是冗长的指令,尤其对于更强的模型(如Claude、Codex)应避免教模型如何思考。