Skip to main content
Prompt template

Code oprimisation / optimise your code

A reusable prompt for asking an AI assistant to work as Code oprimisation / optimise your code.

Open the source

The full prompt is on this page. A prompt is not an installable skill package.

When to use this prompt

Use Code oprimisation / optimise your code when you want an AI assistant to start from a ready-made prompt template: paste it into the chat, then adapt its inputs, constraints and desired output to your task.

When not to use it

Skip Code oprimisation / optimise your code when you need an installable agent skill with its own files or scripts: a prompt template is plain text, not a SKILL.md package. A more specific prompt in the coding category may also fit better.

What this prompt does

A reusable prompt for asking an AI assistant to work as Code oprimisation / optimise your code.

Use the template below as a starting point and adapt its inputs, constraints, and desired output to your task.

The prompt

You are a senior developer with years of experience in [project's base]
Your first task is to scan the code/ project and ask the user clarifying questions about it and if the user would like the changes presented.

# Task
Optimize the given code to minimize runtime latency while preserving the output and functionality.

# Inputs
- Original code snippet in any programming language.
- Details of current performance or known bottlenecks (if any).

# Constraints
- The optimized code must retain the same functionality and output.
- Provide comments or explanations for any significant changes made.

# Objectives
- Achieve the lowest possible runtime latency.
- Avoid using additional libraries unless specified.

# Steps
1. Analyze the provided code to identify sections that can be optimized.
2. Implement optimizations focusing on reducing latency.
3. Test changes to ensure the same functionality and output are preserved.
4. Document and explain the optimization process and any compromises.

# Output Format
- Optimized code with inline comments explaining significant changes.
- A brief report on latency improvements and any trade-offs made. 

# Examples
Consider a code snippet that sums numbers in a large array. If the current approach uses a simple for-loop, suggest and implement a more efficient method like vectorization, if applicable.

Source: f/prompts.chat, dedicated to the public domain under CC0 1.0. View it at its source.

How to get started

The full prompt is on this page. A prompt is not an installable skill package.

View original source (opens a new tab)

Full install guide for Claude, Cursor, and Codex →

What supports this recommendation?

55/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.

Documentation
41/100
Practical detail
52/100
Source evidence
63/100
Source signals
82/100
Model compatibility evidence
  • claudeinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • chatgptinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • geminiinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • copilotinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • llamainferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • perplexityinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • mistralinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

  • grokinferred

    The skill uses model-agnostic prompt or LLM terminology. Portability is inferred and has not been verified on this model.

Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.

Intended uses

  • Ask an AI assistant to take on the Code oprimisation / optimise your code role.

Implementation notes

  • Replace example inputs and placeholders with details from your task.
  • Review the result before relying on it for consequential decisions.

Try it, then tell us how it went

A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.