用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/coreindustries/core-ai-template --skill perf命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Write a structured handoff at session end. Preserves context so the next agent can resume without human briefing. Invoke before ending any feature session longer than 30 minutes.
Multi-perspective code review against project standards with P1/P2/P3 severity classification. Works in Claude Code (Agent + optional GitHub MCP) and Cursor (Task subagents + gh/git). Use when the user invokes /review, asks for a PR or diff review, or wants a standards-aligned review with severity tags.
Multi-perspective code review (P1/P2/P3) for Cursor: inline checklists plus three parallel Task subagents (perf-auditor, security-reviewer, simplicity-reviewer with combined data-integrity prompt). Use when the user invokes /review, asks for a PR review, or wants repo-standard findings with severity.
正在显示 SKILL.md
基于 SOC 职业分类
| name | perf |
| description | Profile, benchmark, and optimize application performance. |
Profile, benchmark, and optimize application performance.
/perf [target] [--profile] [--benchmark] [--lighthouse]
target: File, endpoint, component, or area to analyze--profile: Run profiler and identify bottlenecks--benchmark: Run benchmarks and compare--lighthouse: Run Lighthouse audit (web only)When this skill is invoked:
Autonomy:
Safety:
Establish current performance metrics before changing anything.
Web (Next.js / React):
# Lighthouse CI
npx lighthouse http://localhost:3000 --output json --output-path ./perf-baseline.json
# Bundle analysis
npx @next/bundle-analyzer
# or
npx webpack-bundle-analyzer stats.json
Python (FastAPI):
# Endpoint profiling
uv run python -m cProfile -o profile.out src/{project}/main.py
uv run py-spy record -o profile.svg -- python src/{project}/main.py
# Load testing
uv run locust -f tests/load/locustfile.py
iOS:
Instruments → Time Profiler, Allocations, Network
Xcode → Debug Navigator → CPU / Memory / Network gauges
Android:
Android Studio → Profiler → CPU / Memory / Network
./gradlew benchmark
Analyze profiling results and categorize:
| Category | Symptoms | Common Causes |
|---|---|---|
| Slow queries | High DB time, N+1 | Missing indexes, unoptimized joins |
| Memory leaks | Growing memory, OOM | Unclosed connections, retained references |
| Bundle size | Slow page load | Large dependencies, no tree-shaking |
| Render perf | Janky UI, low FPS | Unnecessary re-renders, large lists |
| Network | Slow API calls | No caching, large payloads, no compression |
Apply targeted fixes based on findings:
Database:
API:
Frontend:
Mobile:
FlatList / LazyColumn / LazyVStack for listsMeasure again and compare:
## Performance Comparison
| Metric | Before | After | Change |
|--------|--------|-------|--------|
| API Response (p95) | 450ms | 120ms | -73% |
| Bundle Size | 1.2MB | 680KB | -43% |
| Lighthouse Score | 62 | 94 | +52% |
| Memory Usage | 256MB | 180MB | -30% |
| DB Query Count | 47 | 12 | -74% |
Run full test suite to confirm no regressions:
{test_all_command}
## Performance Report
**Target:** {what was analyzed}
**Date:** {date}
### Baseline Metrics
{metrics before optimization}
### Bottlenecks Found
1. {bottleneck}: {impact}
2. {bottleneck}: {impact}
### Optimizations Applied
1. {change}: {expected improvement}
2. {change}: {expected improvement}
### Results
{metrics after optimization with comparison}
### Recommendations
- {further optimizations not yet applied}
$ /perf /api/users --profile
Profiling /api/users endpoint...
Baseline (10 requests, p95):
Response time: 450ms
DB queries: 47
Memory: 45MB
Bottlenecks found:
1. N+1 query on user.posts (38 extra queries)
2. No index on users.email (full table scan)
3. Serializing unused fields (posts.body)
Applying fixes...
Added eager loading for user.posts
Created index on users.email
Added field selection to query
Results:
Response time: 120ms (-73%)
DB queries: 3 (-94%)
Memory: 38MB (-16%)
All tests passing (142/142).