Borrowing it
Nothing to install: this file belongs to AI-agents-incubator/n8n-pilot. 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/AI-agents-incubator/n8n-pilot/main/.claude/commands/optimize.mdgit clone --depth 1 https://github.com/AI-agents-incubator/n8n-pilotWrote 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/ai-agents-incubator/n8n-pilot/optimize)<a href="https://agentmods.dev/commands/ai-agents-incubator/n8n-pilot/optimize"><img src="https://agentmods.dev/badge/commands/ai-agents-incubator/n8n-pilot/optimize.svg" alt="Measured on agentmods" 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.00008 | $0.00846 |
| Opus 5 | $0.00004 | $0.00423 |
| Sonnet 5 | $0.00002 | $0.00169 |
| Haiku 4.5 | $0.00001 | $0.00085 |
Grade A, and why
optimize 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Помоги оптимизировать производительность указанного кода.
Области оптимизации:
1. React Performance
Проверь:
- Нет ли лишних ре-рендеров
- Используется ли мемоизация (
useMemo,useCallback) - Правильно ли используются keys в списках
- Можно ли использовать React.memo
- Нет ли создания объектов/функций в рендере
Оптимизации:
// ❌ Плохо
function Component() {
return <Child onClick={() => {}} data={{}} />
}
// ✅ Хорошо
const EMPTY_DATA = {}
function Component() {
const handleClick = useCallback(() => {}, [])
return <Child onClick={handleClick} data={EMPTY_DATA} />
}
2. Database Queries
Проверь:
- Запрашиваются только нужные поля
- Используются индексы
- Нет N+1 проблем
- Используется pagination
- Есть ли лимиты на выборку
Оптимизации:
// ❌ Плохо
const { data } = await supabase.from('chats').select('*')
// ✅ Хорошо
const { data } = await supabase
.from('chats')
.select('id, title, created_at')
.limit(20)
.order('created_at', { ascending: false })
3. Bundle Size
Проверь:
- Используются ли dynamic imports
- Нет ли лишних зависимостей
- Оптимизированы ли изображения
- Используется ли tree shaking
Оптимизации:
// ❌ Плохо
import HeavyLibrary from 'heavy-library'
// ✅ Хорошо
const HeavyLibrary = dynamic(() => import('heavy-library'), {
loading: () => <Spinner />
})
4. Caching
Проверь:
- Используется ли React cache
- Правильно ли работает revalidation
- Используется ли SWR/React Query
- Кэшируются ли статические данные
5. Network
Проверь:
- Объединены ли похожие запросы
- Используется ли параллельная загрузка
- Есть ли prefetching
- Оптимизирован ли размер ответов
6. Images & Media
Проверь:
- Используется ли next/image
- Правильные ли размеры изображений
- Используется ли lazy loading
- Форматы оптимизированы (WebP)
Процесс оптимизации:
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.
- 2d ago First seen · 133 lines · 8 tokens per session scan A 8b26d33b6044
optimize is a command published in the GitHub repository AI-agents-incubator/n8n-pilot (29 stars, last pushed 5mo ago), licensed MIT. It adds 8 tokens to every session and 846 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.
Other commands, from other repositories
react-build
Fix React build failures (Vite, webpack, Next.js, CRA, Parcel, esbuild, Bun) incrementally — JSX/TSX compile errors, hydration mismatches, server/client component boundary failures, missing types. Invokes the react-build-resolver agent for minimal, surgical fixes.
debug-react
Inspect a live React runtime with React-Sentinel before editing source code.
validate-fix
Validate a proposed React fix with React-Sentinel assertions or replay checks.
optimize-performance
Analyze and optimize React component performance with memoization, code splitting, and lazy loading.
add-error-boundary
Implement React error boundaries throughout the application. Create error boundary component with componentDidCatch lifecycle. Add fallback UI with friendly error message and retry button. Log errors to monitoring service (Sentry, Azure Monitor) with stack traces. Implement granular boundaries for different sections…
nextjs-fix
Find and fix all Next.js errors automatically.