---
title: "Slash Command: /optimize"
platform: "Promptally"
canonical_url: "https://app.promptally.dev/p/cmd-optimize"
modality: "SLASH_COMMAND"
category: "Interactive Slash Commands"
compatible_models: [Universal / Model Agnostic]
access_tier: "Free Public Artifact (No Auth Required)"
license: "MIT"
---

# Slash Command: /optimize

**Summary:** Slash Command: /optimize is a verified SLASH COMMAND blueprint on Promptally in Interactive Slash Commands optimized for leading AI models. Analyze code for performance issues and suggest optimizations. Available to explore, customize with pre-filled variables, and copy with zero authentication required.

## Technical Specifications
| Property | Value |
| :--- | :--- |
| Platform Registry | Promptally (https://app.promptally.dev) |
| Modality | SLASH_COMMAND |
| Category | Interactive Slash Commands |
| Compatible Engines | Universal / Model Agnostic |
| Dynamic Variables | None (Static Blueprint) |
| Approx. Token Length | 492 |
| Access Tier | Free Public Artifact (No Auth Required) |
| License | MIT |

### Pre-Filled Template & Production Source

```md
Analyze the specified code for performance issues and suggest optimizations.

# Instructions

1. **Identify the target**: The user will specify a file, function, or code block to analyze. If not specified, ask what to analyze.

2. **Read the code** and analyze for these performance concerns:

## Performance Areas

### Database & Queries
- N+1 query patterns
- Missing indexes (check schema/migrations)
- Unnecessary eager loading or over-fetching
- Unscoped queries that could return large datasets

### Algorithm & Data Structures
- O(n²) or worse time complexity where O(n) or O(n log n) is possible
- Unnecessary array/list copies or allocations
- Repeated computation that could be memoized
- Inefficient string concatenation in loops

### I/O & Network
- Sequential API calls that could be parallelized
- Missing caching for expensive operations
- Unbatched operations (many small writes vs. bulk)
- Large payloads that could be paginated or streamed

### Memory
- Memory leaks (unclosed resources, growing collections)
- Holding large objects longer than needed
- Unnecessary object creation in hot paths

### Frontend-Specific
- Unnecessary re-renders (missing memoization, unstable references)
- Large bundle imports where tree-shaking could help
- Missing lazy loading for routes or heavy components
- Layout thrashing or forced reflows

3. **Output format**:

| Priority | Location | Issue | Impact | Fix |
|----------|----------|-------|--------|-----|
| High | file:line | Description | Estimated impact | Concrete suggestion |
| Medium | file:line | Description | Estimated impact | Concrete suggestion |
| Low | file:line | Description | Estimated impact | Concrete suggestion |

4. **Offer to implement** the high-priority fixes directly.

## Notes
- Focus on measurable impact, not micro-optimizations
- Consider the actual scale (10 users vs 10,000 matters)
- Prefer simple fixes over clever ones
- Don't sacrifice readability for negligible gains
```

## Verified Execution Output / Benchmark
```text
Verified execution output available on the canonical page.
```

## Related Blueprints on Promptally
- [Slash Command: /spawn](https://app.promptally.dev/p/cmd-spawn)
- [Slash Command: /pm](https://app.promptally.dev/p/cmd-pm)
- [Slash Command: /reflect](https://app.promptally.dev/p/cmd-reflect)
- [Slash Command: /git](https://app.promptally.dev/p/cmd-git)
- [Slash Command: /test](https://app.promptally.dev/p/cmd-test)
- [Slash Command: /select-tool](https://app.promptally.dev/p/cmd-select-tool)
- [Slash Command: /improve](https://app.promptally.dev/p/cmd-improve)
- [Slash Command: /agent](https://app.promptally.dev/p/cmd-agent)
