Borrowing it
Nothing to install: this file belongs to Zenobia0000/cursor-agentic-coding-template. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Zenobia0000/cursor-agentic-coding-template/main/.cursor/commands/optimize-performance.mdgit clone --depth 1 https://github.com/Zenobia0000/cursor-agentic-coding-templateWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/zenobia0000/cursor-agentic-coding-template/optimize-performance)<a href="https://agentmods.dev/commands/zenobia0000/cursor-agentic-coding-template/optimize-performance"><img src="https://agentmods.dev/badge/commands/zenobia0000/cursor-agentic-coding-template/optimize-performance/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/zenobia0000/cursor-agentic-coding-template/optimize-performance"><img src="https://agentmods.dev/badge/commands/zenobia0000/cursor-agentic-coding-template/optimize-performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00017 | $0.01239 |
| Opus 5.5 | $0.00007 | $0.00496 |
| Sonnet 5.5 | $0.00003 | $0.00248 |
| Haiku 4.5 | $0.00002 | $0.00124 |
Grade A, and why
optimize-performance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to optimize-performance — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
⚡ OPTIMIZE MODE (v3)
像索隆的三刀流一樣,基於數據,精準、快速地斬斷效能瓶頸。
1. PLAN 🎯 (規劃)
Objective
遵循「測量-識別-優化-驗證」的循環,系統性地解決效能問題,並寫入一份包含前後對比數據的效能報告,以證明優化的有效性。
Guiding Rules
在執行此指令時,AI Agent 必須遵循以下規則:
- 主要規則:
.cursor/rules/principles/global.mdc - 架構原則:
.cursor/rules/backend/overview.mdc或.cursor/rules/frontend/overview.mdc - 測試要求:
.cursor/rules/testing/overview.mdc(確保優化不破壞功能) - 核心隔離:
.cursor/rules/isolation_rules/main.mdc
Prerequisites Check
在開始優化之前,請確保:
- ✅ 目標已量化: 有一個清晰、可量化的效能目標 (e.g., "將 P95 延遲從 800ms 降至 300ms 以下")。
- ✅ 基準已存在: 已有一份可靠的效能基準測試報告,可能儲存在
memory-bank/current/中。 - ❌ Failure Action: 如果目標模糊或沒有基準數據,AI 必須拒絕優化,並建議:「我們需要先建立效能基準。我應該先編寫一個負載測試腳本來測量當前的 API 延遲嗎?」
2. DO 実行 (執行)
Core Process
遵循一個嚴格的、數據驅動的優化循環:
Step 0: 健康檢查 (Health Check)
- 檢查目標和基準: 驗證效能目標是否具體、可衡量,且基準報告是否可信。
- 批判性思考: 優化是權衡的藝術。AI 應思考目標是否現實,並思考潛在的副作用,例如:「追求極致的低延遲可能會增加伺服器成本或降低數據一致性。我們應該在哪個指標上做權衡?」
Step 1: 記憶體互動 - 讀取 (Memory Interaction - Read)
- 讀取目標: 從
memory-bank/current/tasks.md讀取效能優化目標。 - 讀取基準報告: 從
memory-bank/current/perf-report-[baseline-date].md讀取詳細的基準數據。 - 讀取相關程式碼: 根據基準報告中指出的瓶頸,讀取相關的產品程式碼。
Step 2: 假設與實施 (Hypothesize & Implement)
- 提出假設: 針對瓶頸,提出一個具體的優化假設。
- 實施優化: 修改產品程式碼以實現該優化。
Step 3: 驗證與測量 (Verify & Measure)
- 功能驗證: 運行所有單元測試和整合測試,確保優化沒有破壞任何現有功能。
- 效能驗證: 在與基準測試完全相同的環境下,重新運行效能測試。
Step 4: 記憶體互動 - 寫入 (Memory Interaction - Write)
- 寫入效能報告: 創建一份新的效能報告
memory-bank/current/perf-report-[optimization-date].md。此報告必須包含優化目標、措施、以及優化前後的數據對比表。
3. CHECK ✓ (檢查)
Verification Checklist
- 目標是否達成: 優化後的指標是否達到了預設的目標?
- 功能無迴歸: 所有測試是否都已通過?
- 報告已生成: 是否已在
memory-bank/current中創建了包含前後對比數據的效能報告?
4. ACT 改善 (行動)
Finalization
- 向用戶確認權衡: 在提交一個涉及重要權衡的優化之前,AI 必須向用戶確認。
- 提交程式碼: 在用戶確認後,將優化程式碼和新的效能報告提交到版本控制系統。
Next Steps
效能優化是一個持續的過程。
- 👉 Primary Next Step: 如果仍有未達標的效能指標,可以執行
/task-next來建議下一個要優化的點。 - 💡 Alternative: 將新的效能測試腳本整合到 CI/CD 流程中,建立效能迴歸監控。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 72 lines · 17 tokens per session scan A 127657656c83
optimize-performance is a command published in the GitHub repository Zenobia0000/cursor-agentic-coding-template (5 stars, last pushed 6mo ago), licensed MIT. It adds 17 tokens to every session and 1,239 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to optimize-performance, differing in 0 lines, and is treated as a copy.
Other commands, from other repositories
qa-changes
This skill should be used when the user asks to "QA a pull request", "test PR changes", "verify a PR works", "functionally test changes", or when an automated workflow triggers QA validation of code changes. Provides a structured methodology for setting up the environment, exercising changed behavior, and reporting…
auditar-cascading
Invoca cascading-failures-auditor — audita serviço para 5 triggers de cascade (sem timeout, retry sem jitter, sem circuit breaker, sem deadline, queue unbounded) e gera CASCADING-AUDIT.md.
react-native
Command "react-native" from getsentry/toolkit, covering xcode build step (react-native xcode) and important notes.
http-service
Build, review or debug a Bun HTTP service. Loads the http-service skill, then works the task through its workflow.
doctor
Diagnosticar y reparar problemas del framework Don Cheli, git y entorno. Usa cuando el usuario dice "doctor", "problemas del framework", "don cheli no funciona", "repair Don Cheli", "debug setup", "setup broken", "framework broken", "reparar entorno". Detecta y repara issues de configuración, git y dependencias…
doctor
Badi configuration validation. Checks all Badi components and produces a diagnostic report.