基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/oyi77/1ai-skills --skill perf-agent命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Android and mobile application security testing — emulators, rooting, traffic interception, dynamic instrumentation. Use when testing mobile apps for vulnerabilities, reversing APKs, or bypassing security controls on Android.
Self-reflection + Self-criticism + Auto-learning from corrections + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when working with self improving.
Plan and execute a comprehensive red team engagement covering reconnaissance through post-exploitation using MITRE ATT&CK-aligned TTPs to evaluate an organization's detection and response capabilities. Use when working with conducting full scope red team engagement.
| name | perf-agent |
| description | Use when measure before optimizing, target actual bottlenecks proven by profiling, verify with benchmarks. |
| domain | agents |
| author | oyi77 |
| license | Apache-2.0 |
| subdomain | ai-agents |
| tags | ["agent","ai-agent","automation","perf","coding"] |
| version | 1.0.0 |
Quick Reference — see parent for full agent ecosystem.
The Perf Agent identifies and fixes performance bottlenecks using systematic profiling, benchmarking, and capacity analysis. Its first principle is measure before optimize — it never guesses at bottlenecks. It profiles CPU, memory, I/O, and network; identifies root causes (N+1 queries, memory leaks, unnecessary allocations, sync I/O); and validates every optimization with before/after benchmarks. The perf agent also projects cost impact so teams prioritize by ROI.
# Refer to the skill's usage section for specific commands
# Adapt these to your workflow
"""Minimal perf agent pattern — profile and optimize."""
import json, sys, time, statistics
from pathlib import Path
def profile_endpoint(endpoint: str, samples: int = 100) -> dict:
"""Simple latency profiling for a given operation."""
import requests # simulated dependency
latencies = []
for _ in range(samples):
start = time.perf_counter()
# In practice: call the actual endpoint
time.sleep(0.01) # simulated work
latencies.append((time.perf_counter() - start) * 1000)
p50 = statistics.median(latencies)
p95 = sorted(latencies)[int(samples * 0.95)]
p99 = sorted(latencies)[int(samples * 0.99)]
return {
"endpoint": endpoint,
"samples": samples,
"p50_ms": round(p50, 1),
"p95_ms": round(p95, 1),
"p99_ms": round(p99, 1),
"assessment": "healthy" if p95 < 200 else "needs_attention" if p95 < 500
}
() -> []:
suggestions = []
profile[] > :
suggestions.append({
: ,
: ,
: ,
:
})
profile[] > :
suggestions.append({
: ,
: ,
: ,
:
})
suggestions
__name__ == :
endpoint = sys.argv[]
profile = profile_endpoint(endpoint)
profile[] = suggest_optimizations(profile)
(json.dumps(profile, indent=))
| Rationalization | Reality |
|---|---|
| "This query looks slow, I will add a cache" | Adding cache before profiling the actual query often masks N+1 patterns that caching alone cannot fix |
| "Micro-optimizations always help" | Micro-optimizations without profiler data routinely make code harder to read without measurable impact |
| "Production is too complex to profile" | Distributed profiling (e2e traces, sampled CPU profiles) pinpoints bottlenecks more precisely than staging benchmarks |
Use when the application is measurably slow, memory usage grows over time, database queries lag, infrastructure costs are too high, or capacity planning requires baseline numbers. Do NOT use for speculative "premature optimization," one-line utilities where the overhead is dwarfed by I/O, or code paths with zero evidence of being hot.