ai-code-cleanup
清理 AI 生成的代码
AI 编码会话可能会留下冗余注释、防御性检查、类型转换和不一致的代码风格。此技能会指导有针对性的清理,在保留行为的同时验证更改。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "ai-code-cleanup" from https://skillstore.io/skills/89jobrien-ai-code-cleanup.md and its manifest at https://skillstore.io/api/skills/89jobrien-ai-code-cleanup/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“ai-code-cleanup”。 从身份验证工具中移除不必要的注释。
预期结果:
- 报告已移除冗余注释,同时保留有用的上下文。
- 显示行数减少且行为保持不变。
- 说明清理后通过了哪些测试或检查。
正在使用“ai-code-cleanup”。 清理用户 API 辅助函数中的防御性臃肿代码。
预期结果:
- 识别调用方已经处理的冗余验证。
- 保留针对数据库故障和不受信任输入的合法错误处理。
- 总结缩减后的代码路径以及仍需审查的风险。
正在使用“ai-code-cleanup”。 准备一个 AI 生成的 pull request 以供审查。
预期结果:
- 按注释、类型变通方案、风格偏移和防御性检查对清理项进行分组。
- 列出已更改文件,并解释每项编辑为什么安全。
- 标记任何需要审查者判断、而不是直接应用的清理项。
安全审计
安全The static findings are false positives caused by Markdown fences, inline code examples, a read-only Git diff example, and regex syntax. I found no prompt injection, data exfiltration intent, network activity, credential access, or malicious command execution in the reviewed skill files.
风险因素
⚙️ 外部命令 (31)
📁 文件系统访问 (2)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/89jobrien-ai-code-cleanup/audits/7?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/89jobrien-ai-code-cleanup?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/89jobrien-ai-code-cleanup?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/89jobrien-ai-code-cleanup/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/89jobrien-ai-code-cleanup.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
Joseph OBrien. (2026). ai-code-cleanup security audit report (audit version 7) [Author version 1.0.1]. Skillstore. https://skillstore.io/skills/89jobrien-ai-code-cleanup/audits/7BibTeX 引用
@techreport{joseph-obrien-89jobrien-ai-code-cleanup-2026,
author = {Joseph OBrien},
title = {ai-code-cleanup security audit report (audit version 7)},
institution = {Skillstore},
year = {2026},
number = {7},
url = {https://skillstore.io/skills/89jobrien-ai-code-cleanup/audits/7},
note = {Author version 1.0.1}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "ai-code-cleanup security audit report (audit version 7)"
version: "1.0.1"
type: report
authors:
- name: "Joseph OBrien"
date-released: "2026-07-05"
url: "https://skillstore.io/skills/89jobrien-ai-code-cleanup/audits/7"
identifiers:
- type: other
value: "skillstore:89jobrien-ai-code-cleanup:audit:7"
description: "Skillstore immutable audit report identifier"
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
准备 AI 辅助的分支
在打开 pull request 之前,检查已更改文件中的冗余注释、类型变通方案和防御性臃肿代码。
减少审查噪音
清理风格偏移和明显的生成式痕迹,让审查者可以专注于行为和架构。
标准化生成式贡献
在合并到 main 分支之前,将项目清理规则应用于不同助手生成的代码。
试试这些提示
Review this branch for AI-generated code artifacts. Remove redundant comments, unnecessary defensive checks, type workarounds, and style inconsistencies. Preserve behavior and tell me what changed.
Clean the files I changed in src/. Match the existing project style, keep useful comments, and remove only code that does not affect behavior. Run available checks when finished.
Compare this branch with main and identify AI-generated artifacts in the changed files. Make small cleanup edits, list removed patterns, and confirm the tests or checks you ran.
Create a cleanup plan for generated code in this module before editing. Separate safe removals from changes that need tests or reviewer approval. Then apply only the safe edits first.
最佳实践
- 在小范围 diff 上运行此技能,并在合并前审查每项编辑。
- 保留针对不受信任输入、外部数据和安全边界的防御性检查。
- 在可用时,使用项目格式化工具、类型检查器和测试套件验证清理结果。
避免
- 不要移除解释业务规则、安全决策或非显而易见行为的注释。
- 不要仅仅因为代码看起来冗长就在未检查调用方和测试的情况下简化代码。
- 不要在一次大型更改中跨不相关文件应用清理。
常见问题
此技能会自动更改代码吗?
它会误删真正的错误处理吗?
它适用于 TypeScript 项目吗?
清理后我应该运行测试吗?
Claude、Codex 和 Claude Code 可以使用它吗?
这可以替代代码审查吗?
开发者详情
许可证
MIT
作者版本
v1.0.1
Skillstore 修订
r1
引用
c4037264bbd363c572662d6154a3ab28f5ca4f53
维护新鲜度
2026/7/18
使用量
27 次下载 · 261 次浏览
文件结构