home / skills / philipp-spiess / ai / tweak

tweak skill

/skills/tweak

This skill opens your default editor at a targeted file and line to manually tweak code or styles after edits.

npx playbooks add skill philipp-spiess/ai --skill tweak

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.2 KB
---
name: tweak
description: Open the user's default editor at a specific line to manually tweak styles or code. Use when the user wants to make manual adjustments after you've made changes.
---

# Tweak

Opens the user's default editor at a specific file and line number, allowing them to manually tweak the code.

## Usage

After making changes to a file, if the user invokes `/tweak`, run the `open-editor.sh` script from this skill directory:

```bash
~/.claude/skills/tweak/open-editor.sh <file_path> <start_line> [end_line]
```

## Instructions

1. When the user says `/tweak`, identify the **last file and line range you edited** in the conversation
2. Run the script with the file path, start line, and end line (for multi-line edits)
3. The script auto-detects which GUI editor is running (Cursor, VS Code, Zed, etc.) and opens the file with the range selected

## Example

Single line edit at line 42:
```bash
~/.claude/skills/tweak/open-editor.sh /Users/philipp/dev/app/src/Button.tsx 42
```

Multi-line edit from line 42 to 58 (opens at start line; range selection only works in Zed):
```bash
~/.claude/skills/tweak/open-editor.sh /Users/philipp/dev/app/src/Button.tsx 42 58
```

Overview

This skill opens your default GUI editor at a specific file and line to let you manually tweak code or styles. It is designed to be invoked after automated edits so you can make precise manual changes. The skill calls a local script that detects the active editor and navigates to the requested location.

How this skill works

When you invoke the tweak command, the skill identifies the last file and line range you edited in the conversation. It runs a small local script with the file path and start (and optional end) line. The script detects common GUI editors (VS Code, Zed, Cursor, etc.) and opens the file with the cursor positioned at the requested line, optionally selecting a range.

When to use it

  • After an automated change when you want to make a manual adjustment in the same file.
  • To quickly jump to a specific line reported in an error or code review comment.
  • When fine-tuning styles or layout that need eyeballing and manual edits.
  • To inspect or tweak a returned diff without copying paths and line numbers manually.
  • When collaborating and you need to open a precise context the assistant referenced.

Best practices

  • Invoke tweak immediately after the assistant makes an edit so the last-edited context is clear.
  • Use absolute file paths to avoid ambiguity when multiple files share a name.
  • Provide an end line only for ranges that benefit from selection; some editors only support cursor positioning.
  • Ensure your preferred GUI editor is running; the script auto-detects common editors but needs them available.
  • Keep the project workspace open in the editor for faster navigation and correct file resolution.

Example use cases

  • Open Button.tsx at line 42 after the assistant applied a layout tweak so you can adjust padding manually.
  • Jump to a CSS file and line range after the assistant suggested changes to color tokens.
  • Navigate to a failing test location cited by the assistant to inspect the assertion and update it.
  • Open a newly created file at the function you want to review and refine.
  • Quickly go to a log line reported by the assistant while debugging an exception.

FAQ

What if my editor is not detected?

Make sure the editor is running. If detection still fails, open the file manually or configure your editor to be the system default editor.

Does the script change files?

No. The script only opens the file in your editor at the specified line. Manual edits are still performed by you.