Edit Mode: Transform What Exists

Edit Mode is about transformation. You have something—code, text, data—and you want it different. Better. Cleaner. Reformatted. Translated. Improved.

While Ask Mode seeks information, Edit Mode produces modified output from your input.

What Edit Mode Is For

Edit Mode excels at:

  • Refactoring code: “Convert this to use async/await”
  • Improving writing: “Make this email more concise”
  • Reformatting: “Convert this JSON to a markdown table”
  • Translating: “Translate to Spanish, maintaining technical terms”
  • Fixing: “Correct the grammar and spelling”
  • Enhancing: “Add error handling to this function”
  • Simplifying: “Rewrite this for a non-technical audience”
  • Expanding: “Add more detail to this documentation”

The common thread: input goes in, transformed output comes out.

The Edit Mode Formula

flowchart LR
    A[Input Content] --> B[Transformation Intent]
    B --> C[Constraints/Style]
    C --> D[Transformed Output]

1. Input Content

The raw material—what you’re starting with. Be explicit about what you’re providing.

2. Transformation Intent

What change do you want? Be specific about the goal.

3. Constraints/Style

Any rules or preferences for how the transformation should happen.

Edit Mode Patterns

The Improve Pattern

Make something better while keeping its essence.

Template:

Improve this [type of content] to be more [quality].
Keep [what to preserve].
[Input content]

Example:

Improve this product description to be more compelling and benefit-focused.
Keep the technical specifications accurate.

"Our wireless headphones feature 40mm drivers, Bluetooth 5.0, 
and 30-hour battery life. Available in black and white."

The Convert Pattern

Transform content from one format to another.

Template:

Convert this [source format] to [target format].
[Additional requirements]
[Input content]

Example:

Convert this JavaScript function to TypeScript.
Add appropriate type annotations and handle null cases.

function getUserName(user) {
  return user.profile.name;
}

The Refactor Pattern

Restructure code without changing functionality.

Template:

Refactor this code to [goal: use pattern X / improve readability / reduce complexity].
Preserve the existing behavior.
[Code]

Example:

Refactor this code to use early returns instead of nested conditionals.
Preserve the existing behavior.

function processOrder(order) {
  if (order) {
    if (order.items.length > 0) {
      if (order.customer) {
        return calculateTotal(order);
      } else {
        return { error: 'No customer' };
      }
    } else {
      return { error: 'No items' };
    }
  } else {
    return { error: 'No order' };
  }
}

The Tone Shift Pattern

Change the voice or style while keeping the message.

Template:

Rewrite this [content type] to be more [target tone].
Audience: [who will read this]
[Content]

Example:

Rewrite this error message to be more friendly and helpful.
Audience: Non-technical end users

"Error 500: Internal server exception in module auth.handler. 
Stack trace: NullReferenceException at line 47."

The Expand Pattern

Add detail, explanation, or depth to existing content.

Template:

Expand this [content] with [what to add].
Target length: [approximate length]
[Content]

Example:

Expand this function documentation with:
- Parameter descriptions
- Return value explanation
- Usage example
- Edge case notes

/**
 * Validates user input
 */
function validateInput(data, schema) { ... }

The Reduce Pattern

Condense content while preserving key information.

Template:

Condense this [content] to [target length/format].
Preserve [essential elements].
[Content]

Example:

Condense this meeting transcript to 5 bullet points.
Preserve action items and decisions made.

[Full meeting transcript...]

Edit Mode for Code

Adding Features

Add input validation to this function.
- Validate that email is a valid email format
- Validate that age is a positive integer
- Throw descriptive errors for invalid input

function createUser(email, age) {
  return { email, age, createdAt: new Date() };
}

Modernizing Code

Modernize this JavaScript code to use ES6+ features:
- Arrow functions where appropriate
- Destructuring
- Template literals
- const/let instead of var

var self = this;
var items = data.items;
var name = data.name;
var message = 'Hello, ' + name + '! You have ' + items.length + ' items.';
data.items.forEach(function(item) {
  self.processItem(item);
});

Adding Error Handling

Add comprehensive error handling to this async function.
- Handle network failures
- Handle invalid responses
- Add retry logic for transient failures
- Log errors appropriately

async function fetchUserData(userId) {
  const response = await fetch(`/api/users/${userId}`);
  const data = await response.json();
  return data;
}

Writing Tests

Write unit tests for this function using Jest.
Cover:
- Normal operation
- Edge cases (empty array, single item)
- Error conditions

function findMax(numbers) {
  if (!numbers || numbers.length === 0) {
    throw new Error('Array cannot be empty');
  }
  return Math.max(...numbers);
}

Edit Mode for Writing

Email Improvement

Make this email more professional and concise.
Keep the core request clear.
Remove unnecessary phrases.

Hey! So I was wondering if maybe you might have some time 
possibly next week or whenever works for you really to 
discuss the project stuff we talked about before? 
Let me know what you think! Thanks so much!!

Documentation Enhancement

Improve this API documentation:
- Add a clear description
- Include request/response examples
- Document error codes
- Add authentication requirements

## Get User

GET /api/users/:id

Returns a user.

Blog Post Editing

Edit this blog post introduction to:
- Hook the reader in the first sentence
- Clearly state what they'll learn
- Be more conversational

In this article, we will discuss the importance of testing 
in software development. Testing is important because it 
helps find bugs. We will cover different types of testing.

Edit Mode Best Practices

Be Specific About What to Change

Vague: “Make this better” Specific: “Make this more concise, remove jargon, and add a clear call-to-action”

Specify What to Preserve

Without preservation: “Rewrite this code” With preservation: “Rewrite this code to use async/await but keep the error handling logic intact”

Provide Examples When Possible

Rewrite these function names to follow our naming convention.
Convention: verbNoun in camelCase (e.g., getUserData, validateInput)

- get_user()
- SAVE_DATA()
- Check_Email()

Iterate on Results

First pass rarely perfect. Common follow-ups:

  • “Keep the changes but make it shorter”
  • “Good, but restore the original second paragraph”
  • “Apply the same transformation to this additional content”

Common Edit Mode Mistakes

1. No Input Provided

Broken: “Improve my code” Fixed: “Improve this code: [actual code]”

Edit Mode requires input. Always include what you’re transforming.

2. Conflicting Instructions

Conflicting: “Make this more detailed and also make it shorter” Clear: “Make the technical explanation more detailed, but remove the background section to keep overall length similar”

3. Missing Context

Without context: “Fix this code” With context: “Fix this TypeScript code—it should validate email addresses and return a boolean”

4. Wrong Mode

If you’re asking “how should I improve this?” you’re in Ask Mode. If you’re saying “improve this” you’re in Edit Mode. Know which you need.

Practice Exercise

Create three Edit Mode prompts:

1. Code Transformation Take a piece of code you’ve written and craft a prompt to refactor or improve it. Specify exactly what transformation you want and what to preserve.

2. Writing Improvement Take an email, document, or message you’ve written. Craft a prompt to improve it with specific targets (tone, length, clarity).

3. Format Conversion Take content in one format (e.g., bullet points, raw data) and craft a prompt to convert it to another format (table, prose, different structure).

Evaluate: Did you provide clear input? Specific transformation intent? Constraints on how to do it?

Key Takeaways

  • Edit Mode transforms existing content—input in, modified output out
  • Always include: the content, what transformation, and constraints
  • Use patterns: Improve, Convert, Refactor, Tone Shift, Expand, Reduce
  • Be specific about what to change AND what to preserve
  • Iterate—first pass rarely perfect

Next lesson: Agent Mode—delegating complex, multi-step tasks.

What distinguishes Edit Mode from Ask Mode?

Edit Mode is for questions, Ask Mode is for commands
Edit Mode transforms existing content, Ask Mode seeks information
Edit Mode is faster than Ask Mode
Edit Mode only works with code

What three elements should an Edit Mode prompt include?

Input content, transformation intent, constraints/style
Question, context, format
Problem, solution, implementation
Goal, timeline, budget

When using the Refactor pattern, what's essential to specify?

The programming language
The file name
That existing behavior should be preserved
The deployment environment

What's a common Edit Mode mistake?

Providing too much context
Not including the input content to transform
Using too many constraints
Being too specific about the transformation