{"id":"29144110-b514-4375-864d-bb6a6ac066da","shortId":"GVGKBD","kind":"skill","title":"code-perf","tagline":"Performance profiling and optimization. Use when code is slow, has memory issues, or needs optimization. Triggers on \"slow\", \"performance\", \"optimize\", \"memory leak\", \"profiling\", \"bottleneck\", or any performance-related concern.","description":"# Code Perf\n\nPerformance profiling and optimization workflow.\n\n## The Golden Rule\n\n**Never optimize without profiling.**\n\nYou don't know where the bottleneck is until you measure. Making changes without\nprofiling wastes time and often makes things worse.\n\n---\n\n## Workflow\n\n### 1. Profile\n\nMeasure the current performance.\n\n**Questions:**\n- What's slow? (endpoint, operation, page load)\n- How slow? (latency, throughput)\n- Under what conditions? (load, data size)\n\n**Tools:**\n- Browser DevTools (Performance tab)\n- Node clinic.js\n- Python cProfile\n- Go pprof\n\n### 2. Identify\n\nFind the hot paths.\n\n**Look for:**\n- Functions called many times\n- Large memory allocations\n- Blocking I/O\n- Unnecessary computations\n\n### 3. Optimize\n\nApply the right optimization pattern.\n\n### 4. Verify\n\nRe-profile to confirm improvement.\n\n---\n\n## Common Bottlenecks\n\nSee references/common-bottlenecks.md for detailed patterns:\n\n| Pattern | Symptom | Solution |\n|---------|---------|----------|\n| N+1 | Multiple DB queries | Eager load, batch |\n| Memory leak | Growing RSS | Clear caches, weak refs |\n| Blocking I/O | Thread blocked | Async, worker pool |\n| Unnecessary work | CPU high | Skip redundant calc |\n| Large data | Slow serialization | Pagination, streams |\n\n---\n\n## Optimization Patterns\n\nSee references/optimization-patterns.md for:\n\n### Caching\n\n```javascript\n// Before: every call hits DB\nconst user = await db.users.find(id);\n\n// After: cache\nconst cacheKey = `user:${id}`;\nlet user = await redis.get(cacheKey);\nif (!user) {\n  user = await db.users.find(id);\n  await redis.set(cacheKey, user, 'EX', 300);\n}\n```\n\n### Lazy Loading\n\n```javascript\n// Before: load everything\nconst allUsers = await db.users.findMany();\n\n// After: paginate\nconst users = await db.users.findMany({\n  take: 20,\n  skip: page * 20\n});\n```\n\n### Connection Pooling\n\n```javascript\n// Before: new connection each time\nconst client = new Client();\nawait client.connect();\n\n// After: pool\nconst pool = new Pool({ max: 20 });\n// Use pool.query() throughout\n```\n\n---\n\n## Profiling Tools\n\nSee references/profiling-tools.md for:\n\n### Node.js\n\n```bash\n# CPU profiling\nnode --prof app.js\n\n# Memory\nnode --inspect app.js  # Chrome DevTools\n\n# clinic.js\nnpx clinic doctor -- node app.js\n```\n\n### Python\n\n```bash\n# cProfile\npython -m cProfile -o profile.prof app.py\n\n# view with: python -m cProfile -s cumulative app.py\n```\n\n### Go\n\n```bash\n# pprof\ngo test -cpuprofile=cpu.prof\ngo tool pprof cpu.prof\n\n# Web interface\ngo tool pprof -http=:8080 cpu.prof\n```\n\n---\n\n## Skill Loading\n\n- If optimization involves queries → load python-sqlalchemy or typescript-drizzle-orm\n- If memory issues → load for heap snapshots\n- If database → load appropriate database skill","tags":["code","perf","atelier","martinffx","agent-skills","agentic-coding","anthropic","claude-code","claude-skills","code-review","codex","codex-skill"],"capabilities":["skill","source-martinffx","skill-code-perf","topic-agent-skills","topic-agentic-coding","topic-anthropic","topic-claude-code","topic-claude-skills","topic-code-review","topic-codex","topic-codex-skill","topic-opencode","topic-prompt-engineering","topic-sdd","topic-spec-driven-development"],"categories":["atelier"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/martinffx/atelier/code-perf","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add martinffx/atelier","source_repo":"https://github.com/martinffx/atelier","install_from":"skills.sh"}},"qualityScore":"0.461","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 23 github stars · SKILL.md body (2,712 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:05:22.188Z","embedding":null,"createdAt":"2026-05-10T07:03:11.152Z","updatedAt":"2026-05-18T19:05:22.188Z","lastSeenAt":"2026-05-18T19:05:22.188Z","tsv":"'+1':151 '1':71 '2':106 '20':243,246,268 '3':125 '300':225 '4':132 '8080':330 'alloc':120 'allus':233 'app.js':283,287,295 'app.py':304,312 'appli':127 'appropri':357 'async':170 'await':200,211,217,220,234,240,259 'bash':278,297,314 'batch':157 'block':121,166,169 'bottleneck':27,54,141 'browser':96 'cach':163,191,204 'cachekey':206,213,222 'calc':179 'call':115,195 'chang':60 'chrome':288 'clear':162 'client':256,258 'client.connect':260 'clinic':292 'clinic.js':101,290 'code':2,10,34 'code-perf':1 'common':140 'comput':124 'concern':33 'condit':91 'confirm':138 'connect':247,252 'const':198,205,232,238,255,263 'cprofil':103,298,301,309 'cpu':175,279 'cpu.prof':319,323,331 'cpuprofil':318 'cumul':311 'current':75 'data':93,181 'databas':355,358 'db':153,197 'db.users.find':201,218 'db.users.findmany':235,241 'detail':145 'devtool':97,289 'doctor':293 'drizzl':345 'eager':155 'endpoint':81 'everi':194 'everyth':231 'ex':224 'find':108 'function':114 'go':104,313,316,320,326 'golden':42 'grow':160 'heap':352 'high':176 'hit':196 'hot':110 'http':329 'i/o':122,167 'id':202,208,219 'identifi':107 'improv':139 'inspect':286 'interfac':325 'involv':336 'issu':15,349 'javascript':192,228,249 'know':51 'larg':118,180 'latenc':87 'lazi':226 'leak':25,159 'let':209 'load':84,92,156,227,230,333,338,350,356 'look':112 'm':300,308 'make':59,67 'mani':116 'max':267 'measur':58,73 'memori':14,24,119,158,284,348 'multipl':152 'n':150 'need':17 'never':44 'new':251,257,265 'node':100,281,285,294 'node.js':277 'npx':291 'o':302 'often':66 'oper':82 'optim':7,18,23,39,45,126,130,186,335 'orm':346 'page':83,245 'pagin':184,237 'path':111 'pattern':131,146,147,187 'perf':3,35 'perform':4,22,31,36,76,98 'performance-rel':30 'pool':172,248,262,264,266 'pool.query':270 'pprof':105,315,322,328 'prof':282 'profil':5,26,37,47,62,72,136,272,280 'profile.prof':303 'python':102,296,299,307,340 'python-sqlalchemi':339 'queri':154,337 'question':77 're':135 're-profil':134 'redis.get':212 'redis.set':221 'redund':178 'ref':165 'references/common-bottlenecks.md':143 'references/optimization-patterns.md':189 'references/profiling-tools.md':275 'relat':32 'right':129 'rss':161 'rule':43 'see':142,188,274 'serial':183 'size':94 'skill':332,359 'skill-code-perf' 'skip':177,244 'slow':12,21,80,86,182 'snapshot':353 'solut':149 'source-martinffx' 'sqlalchemi':341 'stream':185 'symptom':148 'tab':99 'take':242 'test':317 'thing':68 'thread':168 'throughout':271 'throughput':88 'time':64,117,254 'tool':95,273,321,327 'topic-agent-skills' 'topic-agentic-coding' 'topic-anthropic' 'topic-claude-code' 'topic-claude-skills' 'topic-code-review' 'topic-codex' 'topic-codex-skill' 'topic-opencode' 'topic-prompt-engineering' 'topic-sdd' 'topic-spec-driven-development' 'trigger':19 'typescript':344 'typescript-drizzle-orm':343 'unnecessari':123,173 'use':8,269 'user':199,207,210,215,216,223,239 'verifi':133 'view':305 'wast':63 'weak':164 'web':324 'without':46,61 'work':174 'worker':171 'workflow':40,70 'wors':69","prices":[{"id":"c8c43611-0113-409e-8666-19f9b37f760f","listingId":"29144110-b514-4375-864d-bb6a6ac066da","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"martinffx","category":"atelier","install_from":"skills.sh"},"createdAt":"2026-05-10T07:03:11.152Z"}],"sources":[{"listingId":"29144110-b514-4375-864d-bb6a6ac066da","source":"github","sourceId":"martinffx/atelier/code-perf","sourceUrl":"https://github.com/martinffx/atelier/tree/main/skills/code-perf","isPrimary":false,"firstSeenAt":"2026-05-10T07:03:11.152Z","lastSeenAt":"2026-05-18T19:05:22.188Z"}],"details":{"listingId":"29144110-b514-4375-864d-bb6a6ac066da","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"martinffx","slug":"code-perf","github":{"repo":"martinffx/atelier","stars":23,"topics":["agent-skills","agentic-coding","anthropic","claude-code","claude-skills","code-review","codex","codex-skill","opencode","prompt-engineering","sdd","spec-driven-development"],"license":"mit","html_url":"https://github.com/martinffx/atelier","pushed_at":"2026-05-18T06:56:45Z","description":"An atelier for Opencode, Claude Code, and other coding agents: spec-driven workflows, deep thinking, and code quality.","skill_md_sha":"c602019372b6eb76267859350ba0ca37d47c4fb9","skill_md_path":"skills/code-perf/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/martinffx/atelier/tree/main/skills/code-perf"},"layout":"multi","source":"github","category":"atelier","frontmatter":{"name":"code-perf","description":"Performance profiling and optimization. Use when code is slow, has memory issues, or needs optimization. Triggers on \"slow\", \"performance\", \"optimize\", \"memory leak\", \"profiling\", \"bottleneck\", or any performance-related concern."},"skills_sh_url":"https://skills.sh/martinffx/atelier/code-perf"},"updatedAt":"2026-05-18T19:05:22.188Z"}}