一键导入
safeguarding-ai-generated-code
Use when AI-generated or AI-modified changes need a Code Health gate before commit, handoff, or pull request.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when AI-generated or AI-modified changes need a Code Health gate before commit, handoff, or pull request.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when a user asks what Code Health means, how to interpret scores, or why Code Health matters in daily development.
Use when refactoring unhealthy code and needing Code Health findings to choose small safe steps and verify improvement.
Use when a user asks for ROI, stakeholder justification, delivery impact, or defect-risk reduction from improving Code Health in a file.
Run linting and unit tests against the current repository, auto-discovering the correct commands from Justfile, Makefile, pyproject.toml, or package.json.
Create a conventional commit from staged changes, with a diff-derived description body.
Reliably obtain a non-empty unified git diff for the current branch using safe fallbacks (origin/HEAD...HEAD, origin/main...HEAD, origin/master...HEAD) and return structured JSON containing the diff and the command used.
| name | safeguarding-ai-generated-code |
| description | Use when AI-generated or AI-modified changes need a Code Health gate before commit, handoff, or pull request. |
Use Code Health safeguards before declaring AI-touched code ready. The goal is to catch maintainability regressions early and prevent agents from normalizing technical debt.
Do not use this skill for broad refactoring discovery or project-level prioritization.
code_health_review: Review each AI-modified file immediately after the change.pre_commit_code_health_safeguard: Check staged or modified files before commit.analyze_change_set: Check a branch or PR-style change set against a base ref.code_health_review on that file.pre_commit_code_health_safeguard before commit-oriented recommendations as a broader gate across staged or modified files.analyze_change_set before PR-oriented recommendations as a final branch-level gate.code_health_review and keep iterating until the issue is removed or the user explicitly accepts the risk.