用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/IBM/smith --skill smith命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | smith |
| description | Responsible for creating policies, generating and evaluating test cases, testing policies, and automatically improving them. |
This skill is responsible for creating policies, generating and evaluating test cases, testing, and automatically improving the policy. The target policy file is ./assets/policy.rego.
Before running any smith commands, activate the project virtual environment:
source .venv/bin/activate
If the user asks to create an OPA policy, you should strictly follow instructions in ./opa_policy/policy_creation/opa_policy_creation.md in the skill directory to create the policy without asking any additional questions.
After completion, remind the user: “The policy has been created. Next steps you can take: (1) generate test cases, (2) if you already have test cases, you can ask me to test the policy.”
If the user asks to generate test cases, you should strictly follow instructions in ./test_generation/test_generation.md in the skill directory.
After completion, remind the user: “Test cases have been generated. Note that some generated cases may have incorrect labels (allow vs disallow). Next steps: If you already have a policy, run policy testing.”
Adversarial (red-team) coverage depends on the ATTACK_TOOLS env var (ARES and/or Promptfoo; may be none). The CLI prints which tools were enabled vs skipped. If any attack tool was skipped, tell the user that adversarial coverage is reduced or absent, so “all tests passed” later reflects the legitimate cases only and not resistance to red-teaming.
If the user asks to test an existing policy, you should run smith --flag policy_testing.
After reporting results, remind the user of next steps based on the outcome:
./opa_policy/policy_cross_validation/policy_cross_validation.md to diagnose and fix structural/syntax issues before proceeding.If the user asks to cross-validate failed test cases, follow the instructions in ./test_generation/cross_validate.md in the skill directory.
After completion, remind the user: “Cross-validation is complete.
When the user asks to update or improve their policy, or you identify failed test cases, you should follow the workflow below strictly:
Run smith --flag policy_testing to identify FP/FN cases. Report the results clearly to the human.
After reporting, remind the user: “Next step: I will patch the policy to fix failed cases. Shall I proceed?”
If any false positives or false negatives are detected, read and follow ./opa_policy/policy_patch/policy_patch.md to fix the failed cases. Remember, policy_patch needs to fix all clusters before you move to the next step.
After patching, remind the user: “All failed cases have been patched. Next step: format the policy with Regal to fix style issues. Shall I proceed?”
After all clusters and failed cases are fixed, read and follow ./opa_policy/policy_regal/policy_regal.md to format your policy.
After formatting, remind the user: “Policy has been formatted. Next step: check for and remove duplicate rules. Shall I proceed?”
Read and follow ./opa_policy/policy_duplication/policy_duplication.md to reduce duplication in your policy.
After deduplication, remind the user: “Duplication check complete. The policy enhancement workflow is finished. You can re-run smith --flag policy_testing to confirm all tests still pass.”
If users ask to translate policy to cpex format, run smith --flag cpex_translate.
If the user asks to save, snapshot, back up, or archive their results, run smith --flag save_snapshot --dest <directory>, where <directory> is the destination the user wants the copies written to. If the user does not specify a destination, ask them for one.