重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
npx skills add https://github.com/luongnv89/skills --skill code-optimizer按照以下优先级顺序分析代码中的性能问题:
在现有仓库中创建/更新/删除文件之前,请将当前分支与远程同步:
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"
如果工作树不干净,请先储藏,同步,然后恢复:
git stash push -u -m "pre-sync"
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
git stash pop
如果缺少 origin、无法拉取或发生变基/储藏冲突,请停止并在继续之前询问用户。
在进行任何更改之前:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
feat/feature/feat/optimize-<target>
feat/optimize-api-handlers对于发现的每个问题:
### [严重程度] 问题标题
**位置**: 文件:行号
**类别**: 性能 | 内存 | 算法 | 缓存 | 并发
**问题**: 问题的简要说明
**影响**: 为什么这很重要(性能成本、资源使用等)
**修复**:
[显示优化版本的代码示例]
完成每个主要步骤后,按以下格式输出状态报告:
◆ [步骤名称] ([步骤 N / M] — [上下文])
··································································
[检查项 1]: √ 通过
[检查项 2]: √ 通过(如有相关说明)
[检查项 3]: × 失败 — [原因]
[检查项 4]: √ 通过
[标准]: √ 满足 N/M
____________________________
结果: 通过 | 失败 | 部分通过
调整检查项名称以匹配步骤实际验证的内容。使用 √ 表示通过,× 表示失败,— 添加简要上下文。“标准”行总结了满足了多少验收标准。“结果”行给出总体结论。
阶段:先决条件 — 检查项:分支设置、检测到命名约定、功能分支已创建
阶段:分析 — 检查项:问题检测、优先级类别覆盖、影响已估算、发现的问题按严重程度排序
阶段:应用修复 — 检查项:修复应用、已获得用户批准、现有测试已运行、未引入回归
阶段:验证 — 检查项:性能已验证、测试套件通过、严重问题已解决、警告已记录
go func())sync.Pool,预分配切片)strings.Builder)deferCow<> 代替)RwLock 足够时使用 Mutex 导致的锁争用Vec 增长而未使用 with_capacity+ 进行字符串连接(使用 StringBuilder)解决方案: 报告代码已经过良好优化。建议使用运行时工具(例如 perf、Chrome DevTools、py-spy)进行分析,以查找运行时特定的瓶颈。
解决方案: 要求用户指定要关注哪些函数或部分。首先分析最关键的性能路径。
解决方案: 立即撤销更改。重新检查优化方法,并调整方法以保留现有行为。
每周安装量
50
仓库
GitHub 星标数
18
首次出现
2026年2月4日
安全审计
安装于
codex49
opencode49
gemini-cli46
github-copilot46
amp46
kimi-cli46
Analyze code for performance issues following this priority order:
Before creating/updating/deleting files in an existing repository, sync the current branch with remote:
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"
If the working tree is not clean, stash first, sync, then restore:
git stash push -u -m "pre-sync"
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
git stash pop
If origin is missing, pull is unavailable, or rebase/stash conflicts occur, stop and ask the user before continuing.
Before making any changes:
feat/, feature/, etc.)feat/optimize-<target>
feat/optimize-api-handlersFor each issue found:
### [Severity] Issue Title
**Location**: file:line_number
**Category**: Performance | Memory | Algorithm | Caching | Concurrency
**Problem**: Brief explanation of the issue
**Impact**: Why this matters (performance cost, resource usage, etc.)
**Fix**:
[Code example showing the optimized version]
After completing each major step, output a status report in this format:
◆ [Step Name] ([step N of M] — [context])
··································································
[Check 1]: √ pass
[Check 2]: √ pass (note if relevant)
[Check 3]: × fail — [reason]
[Check 4]: √ pass
[Criteria]: √ N/M met
____________________________
Result: PASS | FAIL | PARTIAL
Adapt the check names to match what the step actually validates. Use √ for pass, × for fail, and — to add brief context. The "Criteria" line summarizes how many acceptance criteria were met. The "Result" line gives the overall verdict.
Phase: Prerequisites — checks: Branch setup, Naming convention detected, Feature branch created
Phase: Analysis — checks: Issue detection, Priority categories covered, Impact estimated, Findings sorted by severity
Phase: Apply Fixes — checks: Fix application, User approval obtained, Existing tests run, No regressions introduced
Phase: Verify — checks: Performance verified, Test suite passes, Critical issues resolved, Warnings documented
go func() without context cancellation)sync.Pool, pre-allocate slices)strings.Builder)defer for resource cleanupCow<> instead)Mutex when RwLock would sufficeVec growth without with_capacity+ in loops (use StringBuilder)Solution: Report that the code is already well-optimized. Suggest profiling with runtime tools (e.g., perf, Chrome DevTools, py-spy) to find runtime-specific bottlenecks.
Solution: Ask the user to specify which functions or sections to focus on. Analyze the most performance-critical paths first.
Solution: Revert the change immediately. Re-examine the optimization and adjust the approach to preserve existing behavior.
Weekly Installs
50
Repository
GitHub Stars
18
First Seen
Feb 4, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex49
opencode49
gemini-cli46
github-copilot46
amp46
kimi-cli46
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
127,000 周安装