Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Rewrites text to sound like natural, casual, everyday speech.
- `/rewrite` with highlighted text: rewrites the selected text
- `/rewrite so basically what happened was i was trying to fix the bug`: rewrites typed text in a natural, casual voice

**Behavior:** Rewrites text to sound like a fluent native speaker talking day to day: relaxed and casual by default, while keeping your meaning, personality, and point of view. Preserves expressive spellings, slang, and emoji you used, only stays formal when the original clearly is, and will not bolt a "we" voice onto an imperative or impersonal note. Outputs only the rewritten text. A Replace button on the result writes the rewritten text straight back into the app you were using, replacing your selection; turn on auto-replace in Settings to skip the button. Follow-up tweaks in the same chat, like asking for a longer or more formal version, keep the Replace button too.
**Behavior:** Rewrites text to sound like a fluent native speaker talking day to day: relaxed and casual by default, while keeping your meaning, personality, and point of view. It mirrors your original formatting instead of flattening it: Markdown headings, bold, lists, links, blockquotes, and code all stay, and only the text inside them is improved. Quoted lines, code, URLs, @mentions, #channels, and the emoji or expressive spellings you used are kept exactly as written. It fixes what reads awkwardly and leaves what already reads well alone, only stays formal when the original clearly is, and will not bolt a "we" voice onto an imperative or impersonal note. Outputs only the rewritten text. A Replace button on the result writes the rewritten text straight back into the app you were using, replacing your selection; turn on auto-replace in Settings to skip the button. Follow-up tweaks in the same chat, like asking for a longer or more formal version, keep the Replace button too.

**Composable:** `/rewrite` works with attached images or `/screen`. Vision OCR extracts the text first, then rewrites it.

Expand Down
2 changes: 1 addition & 1 deletion src-tauri/prompts/generated/slash_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If the user asks what slash commands are available, what built-in commands exist

/translate: translate selected or typed text to requested language. Also works with attached images or /screen: OCR extracts the text first, then translation runs on the result. Default: Vietnamese.

/rewrite: rewrite text so it sounds like natural, casual, everyday native English while keeping the meaning, personality, and point of view. Also works with attached images or /screen: OCR extracts the text first, then rewrites it.
/rewrite: rewrite text so it sounds like natural, casual, everyday native English while keeping the meaning, personality, formatting, and point of view. Preserves Markdown structure, quotes, code, and links; only the prose inside them is improved. Also works with attached images or /screen: OCR extracts the text first, then rewrites it.

/tldr: summarize text in 1-3 short direct sentences. Also works with attached images or /screen: OCR extracts the text first, then summarizes it.

Expand Down
21 changes: 21 additions & 0 deletions src/config/__tests__/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,27 @@ describe('buildPrompt', () => {
expect(buildPrompt('/rewrite', ' ', ' ')).toBeNull();
});

it('/rewrite prompt instructs the model to mirror the original formatting', () => {
const result = buildPrompt('/rewrite', '**Resources:**\n- one\n- two');
expect(result).toContain("Mirror the original's formatting");
expect(result).toContain('never flatten a list');
});

it('/rewrite prompt instructs the model to keep verbatim zones and handles intact', () => {
const result = buildPrompt('/rewrite', '> quoted line');
// Quotes, code, URLs, mentions, and channels are all preserved verbatim.
expect(result).toContain('blockquotes');
expect(result).toContain('fenced code and inline code');
expect(result).toContain('@mentions');
expect(result).toContain('#channels');
});

it('/rewrite prompt no longer strips Markdown', () => {
const result = buildPrompt('/rewrite', 'anything');
// Regression guard: the old rule that flattened structured input is gone.
expect(result).not.toContain('No markdown, bullets, or decorative icons');
});

it('/translate parses full language name from typed text', () => {
const result = buildPrompt('/translate', 'Vietnamese hello world');
expect(result).toContain('Target language: Vietnamese');
Expand Down
6 changes: 3 additions & 3 deletions src/config/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@ export const COMMANDS: readonly Command[] = [
'`/rewrite so basically what happened was i was trying to fix the bug`: rewrites typed text in a natural, casual voice',
],
behavior:
'Rewrites text to sound like a fluent native speaker talking day to day: relaxed and casual by default, while keeping your meaning, personality, and point of view. Preserves expressive spellings, slang, and emoji you used, only stays formal when the original clearly is, and will not bolt a "we" voice onto an imperative or impersonal note. Outputs only the rewritten text. A Replace button on the result writes the rewritten text straight back into the app you were using, replacing your selection; turn on auto-replace in Settings to skip the button. Follow-up tweaks in the same chat, like asking for a longer or more formal version, keep the Replace button too.',
'Rewrites text to sound like a fluent native speaker talking day to day: relaxed and casual by default, while keeping your meaning, personality, and point of view. It mirrors your original formatting instead of flattening it: Markdown headings, bold, lists, links, blockquotes, and code all stay, and only the text inside them is improved. Quoted lines, code, URLs, @mentions, #channels, and the emoji or expressive spellings you used are kept exactly as written. It fixes what reads awkwardly and leaves what already reads well alone, only stays formal when the original clearly is, and will not bolt a "we" voice onto an imperative or impersonal note. Outputs only the rewritten text. A Replace button on the result writes the rewritten text straight back into the app you were using, replacing your selection; turn on auto-replace in Settings to skip the button. Follow-up tweaks in the same chat, like asking for a longer or more formal version, keep the Replace button too.',
composability:
'`/rewrite` works with attached images or `/screen`. Vision OCR extracts the text first, then rewrites it.',
},
promptHelp: {
summary:
'rewrite text so it sounds like natural, casual, everyday native English while keeping the meaning, personality, and point of view. Also works with attached images or /screen: OCR extracts the text first, then rewrites it.',
'rewrite text so it sounds like natural, casual, everyday native English while keeping the meaning, personality, formatting, and point of view. Preserves Markdown structure, quotes, code, and links; only the prose inside them is improved. Also works with attached images or /screen: OCR extracts the text first, then rewrites it.',
},
promptTemplate:
'Rewrite the text below so it sounds like a fluent native English speaker saying it naturally in everyday conversation. Make it read like a real person talking, not a corporate memo.\n\nRules:\n- Default to a relaxed, casual, conversational tone. Only keep it formal if the original is clearly formal (a legal notice, an executive email). Never make the text more formal or stiffer than the original.\n- Rewrite freely. Reorder and rephrase awkward or non-native phrasing so it sounds like how a native speaker actually talks. Keep the original meaning and every key point. Do not add new ideas or drop information.\n- Keep the writer\'s personality. Preserve expressive spellings exactly ("heyyyy", "soooo", "ugh"), casual words and contractions ("gonna", "kinda", "tbh", "yeah"), and any emoji or emoticons they used.\n- Match their energy. You may add light natural touches (contractions, small connectors like "honestly", "so", "yeah") to sound human, but do not add emoji, slang, or stretched spellings they did not use. Never sound louder or more casual than they did.\n- Keep the original point of view. Do not invent a narrator. If the text has no "I" or "we" (for example, an imperative or an impersonal directive), keep it that way and do not add one. Never turn a directive into "We need to", "We should", "We have to", or "Let\'s"; rewrite each instruction as a direct command instead. An imperative stays an imperative.\n- Use normal capitalization and punctuation.\n- Do not add em dashes. If you would write one, use a comma, colon, semicolon, or period instead. If the original text already uses em dashes, keeping them is fine.\n- No markdown, bullets, or decorative icons.\n- If the text includes an "[Additional instruction]" line, follow it; it can override these defaults (for example, "make it more formal").\n- Output only the rewritten text. No preamble, no explanation, no quotes.\n\nExample 1\nInput: I very much want that we can finish this today if it possible for us.\nOutput: Honestly, I\'d love to wrap this up today if we can.\n\nExample 2\nInput: heyyyy so the build was broken but i fixed it and the tests pass now 🎉\nOutput: Heyyyy, so the build was broken but I fixed it and the tests pass now 🎉\n\nExample 3\nInput: Prioritize industry standards and best practices above all else, seeking the most performant and secure solutions while strictly eliminating over-engineering, workarounds, and unnecessary overhead; solution selection is based purely on technical superiority, independent of implementation effort.\nOutput: Put industry standards and best practices above everything else. Go for the most performant, secure option, and cut out over-engineering, workarounds, and any unnecessary overhead. Pick the solution purely on technical merit, no matter how much effort it takes to build.\n\nNow rewrite only the following text. Do not copy anything from the examples.\n\nText: $INPUT',
'Rewrite the text below so it sounds like a fluent native English speaker saying it naturally in everyday conversation. Make it read like a real person talking, not stiff or robotic.\n\nRules:\n- Tone: default to relaxed, casual, conversational English, and match the writer\'s energy. Keep it formal only if the original clearly is, and never sound more formal, stiffer, louder, or more casual than they did.\n- Change only what needs it. Rephrase awkward or non-native wording so it reads like a native speaker, and leave anything that already reads well alone. Keep every key point; do not add ideas or drop information. No edit beats a pointless edit.\n- Mirror the original\'s formatting exactly. Keep its Markdown (headings, bold, italics, bullet and numbered lists, links, blockquotes, code) along with its structure and order: rewrite the text inside each element, but never flatten a list, heading, or quote into a paragraph, and never merge separate points into one sentence. If the original is plain text with no Markdown, keep it plain and add none of your own.\n- Keep these exactly, character for character; never reword, reorder, or strip them: blockquotes (lines starting with >), fenced code and inline code, raw URLs, link targets, @mentions, #channels, and any emoji, expressive spellings, or slang the writer used ("heyyyy", "gonna", "tbh"). Do not change the wording inside a blockquote or code block at all, and do not add emoji or slang they did not use.\n- Keep the original point of view. Do not invent a narrator: if the text has no "I" or "we" (an imperative or impersonal note), keep it that way. Never turn a directive into "We need to", "We should", or "Let\'s"; an imperative stays an imperative.\n- Use normal capitalization and punctuation, and no em dashes: use a comma, colon, semicolon, or period instead. If the original already uses them, keeping them is fine.\n- If the text includes an "[Additional instruction]" line, follow it; it can override these defaults. Output only the rewritten text: no preamble, explanation, or quotes.\n\nExample 1\nInput: I very much want that we can finish this today if it possible for us.\nOutput: Honestly, I\'d love to wrap this up today if we can.\n\nExample 2\nInput: heyyyy so the build was broken but i fixed it and the tests pass now 🎉\nOutput: Heyyyy, so the build was broken but I fixed it and the tests pass now 🎉\n\nExample 3\nInput: @alex @priya hey can you two take a look at the deploy when you get a sec\nOutput: @alex @priya hey, can you two take a look at the deploy when you get a chance?\n\nExample 4\nInput: **Resources:**\n- here is the docs for schedule service [Schedule Service](https://docs.hedera.com/x)\n- this one good for begineer [Getting Started](https://docs.hedera.com/start)\nOutput: **Resources:**\n- The Schedule Service docs: [Schedule Service](https://docs.hedera.com/x)\n- Good for beginners: [Getting Started](https://docs.hedera.com/start)\n\nExample 5\nInput: Updates from the infra team:\n> The importer fix is live but grpc still has an issue. Track it at https://example.com/issues/13668. Both land in 0.156.0 with a GA soon.\nOutput: Here\'s the latest from the infra team:\n> The importer fix is live but grpc still has an issue. Track it at https://example.com/issues/13668. Both land in 0.156.0 with a GA soon.\n\nNow rewrite only the following text. Do not copy anything from the examples.\n\nText: $INPUT',
},
{
trigger: '/tldr',
Expand Down