Agent诊断
- 作者仓库星标 209
- 作者更新于 实时读取
- 作者仓库 ai-coding-project-boilerplate
- 领域
- 安全
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @shinpr · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skill-optimization
description: Evaluates and optimizes skill file quality using 8 content patterns and 9 editing principles. Us…
category: 安全
runtime: 无特殊运行时
---
# skill-optimization 输出预览
## PART A: 任务判断
- 适用问题:安全审计、密钥扫描、权限检查或风险分析。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Core Philosophy / Content Optimization Patterns / P1: Critical (Must Fix)”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于安全审计、密钥扫描、权限检查或风险分析,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Core Philosophy / Content Optimization Patterns / P1: Critical (Must Fix)”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Core Philosophy / Content Optimization Patterns / P1: Critical (Must Fix)”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: skill-optimization
description: Evaluates and optimizes skill file quality using 8 content patterns and 9 editing principles. Us…
category: 安全
source: shinpr/ai-coding-project-boilerplate
---
# skill-optimization
## 什么时候使用
- 把安全方向的常用动作沉淀成 Agent 可调用的技能 适合处理安全审计、密钥扫描、权限检查和风险分析,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不…
- 面向安全审计、密钥扫描、权限检查或风险分析,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Core Philosophy / Content Optimization Patterns / P1: Critical (Must Fix)」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "skill-optimization" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Core Philosophy / Content Optimization Patterns / P1: Critical (Must Fix)
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Skill Content Optimization
Core Philosophy
- Evidence-Based: Grounded in prompt engineering research, applied to skill authoring
- Concrete: Each pattern provides detection criteria and transform methods
- Structure-Focused: Optimizes expression and organization; domain knowledge remains unchanged
Content Optimization Patterns
P1: Critical (Must Fix)
Issues that directly reduce LLM execution accuracy when consuming the skill.
BP-001: Negative Instructions → Positive Form
| Detection | Transform |
|---|---|
| "don't", "do not", "never", "avoid" in skill instructions | Reframe as positive directive with equivalent constraint. Exception: Negative form is permitted only when ALL 4 conditions are met: (1) violation destroys state in a single step, (2) caller or subsequent steps cannot normally recover, (3) the constraint is operational/procedural, not a quality policy or role boundary, (4) positive rewording would expand or blur the target scope. If any condition is not met, rewrite in positive form. |
Exception boundary examples:
- Permitted: "Do not modify the command", "Do not add flags", "Do not execute destructive operations"
- Rewrite in positive form: "Do not invent issues" → "Base every issue on BP patterns or 9 principles", "Do not skip P1 issues" → "Evaluate all P1 issues in every review mode", "Do not give grade A when P1 exists" → "Assign grade A only when P1 count is zero"
Quality policies, role boundaries, scoring criteria, and general work rules always use positive form. Outputs that the caller validates, overwrites, or discards are never irreversible.
Skill example:
- Before: "Don't use generic variable names"
- After: "Use descriptive variable names that reflect purpose (e.g.,
userIdnotx)"
Why critical for skills: LLM attention mechanisms focus on negated content. Skill instructions with "don't" increase probability of the forbidden behavior.
BP-002: Vague Instructions → Specific Criteria
| Detection | Transform |
|---|---|
| "appropriate", "good", "proper", "best", "should be clear" | Replace with measurable if-then criteria or concrete thresholds. Skill exception: Expressions that the LLM can resolve unambiguously from input context (e.g., "where the user left gaps" when the user's prompt is available for comparison) are not vague — they describe a deterministic operation, not a subjective judgment. |
| Missing output format, scope, or success criteria | Add explicit constraints |
Skill example:
- Before: "Handle errors appropriately"
- After: "Error handling criteria: 1. try-catch for external API calls, file I/O, JSON.parse 2. Log: error.name, error.stack, timestamp 3. Re-throw with context if caller needs to handle"
Why critical for skills: Accounts for ~40% of execution variance. Every vague instruction forces LLM to guess.
BP-003: Missing Output Format → Structured Output
| Detection | Transform |
|---|---|
| Skill describes what to do but not the expected deliverable format | Add output section with structure, fields, and example |
Skill example:
- Before: "Analyze the code for issues"
- After: "Output format:
## Issues Foundwith table: | Severity | Location | Description | Suggested Fix |"
Why critical for skills: Structured output constraints reduce hallucination and make skill results consistent.
P2: High Impact (Should Fix)
Issues that reduce skill effectiveness when addressed.
BP-004: Unstructured Content → Organized Format
| Detection | Transform |
|---|---|
| Wall of text without headings | Apply standard section order (see below) |
| Multiple topics mixed in one section | Split into distinct headed sections |
| No tables for reference data | Convert lists of criteria/patterns to tables |
Standard skill section order:
- Context/Prerequisites
- Core concepts (definitions, patterns)
- Process/Methodology (step-by-step)
- Output format/Examples
- Quality checklist
- References
Conditional: Skip restructuring if skill is under 30 lines and covers a single topic.
BP-005: Missing Context → Explicit Prerequisites
| Detection | Transform |
|---|---|
| Skill assumes knowledge not stated | Add Prerequisites section listing required context |
| Domain terms used without definition | Add definitions inline or in a glossary table. Skill exception: Terms within the LLM's baseline knowledge (widely-used technical terminology, standard domain vocabulary) require no definition. Only project-specific terms, internal naming conventions, or domain jargon outside common LLM training data need explicit definition. |
| No "when to use" guidance | Add trigger conditions with concrete scenarios |
Skill example:
- Before: "Apply the strangler pattern for migration"
- After: "Prerequisite: Existing monolith with identifiable module boundaries. When to use: Replacing legacy module while maintaining production traffic."
BP-006: Complex Content → Decomposed Steps
| Detection | Transform |
|---|---|
| 3+ objectives in one instruction | Break into numbered steps with checkpoints |
| Sequential dependencies not explicit | Add dependency markers between steps |
| No intermediate verification | Insert checkpoint after each step |
Conditional: Skip decomposition for simple reference tables or single-criteria rules.
Key insight: Goal is evaluable granularity with quality checkpoints, not decomposition for its own sake.
P3: Enhancement (Could Fix)
Incremental improvements for specific contexts.
BP-007: Biased Examples → Diverse Coverage
| Detection | Transform |
|---|---|
| All examples share same pattern/structure | Add edge cases and exceptions |
| Only happy-path examples | Add error cases, boundary conditions |
| Examples all same complexity | Include simple, moderate, and complex |
BP-008: No Uncertainty Permission → Explicit Escalation
| Detection | Transform |
|---|---|
| Skill demands definitive answers always | Add escalation criteria for ambiguous cases |
| No "when to stop" guidance | Add explicit stopping conditions |
Skill example:
- Before: "Determine the root cause"
- After: "Determine the root cause. If root cause is uncertain after 3 investigation cycles, report top 3 hypotheses with confidence levels and evidence for each."
9 Skill Editing Principles
Measurable quality criteria for skill content. Each principle includes a pass/fail test.
| # | Principle | Pass Criteria | Fail Example |
|---|---|---|---|
| 1 | Context efficiency | Every sentence contributes to LLM decision-making. No filler. | "This is an important skill that helps with..." |
| 2 | Deduplication | No concept explained twice at the same abstraction level within the skill or across skills. Mentions at different structural roles (e.g., classification framework vs execution detail) are not duplicates, provided the re-mention adds new constraints or criteria | Same error handling rules restated at the same abstraction level in multiple related skills |
| 3 | Grouping | Related criteria in single section (minimize read operations) | Scattered error handling rules across 4 sections |
| 4 | Measurability | All criteria use if-then format or concrete thresholds | "Write clean code" without definition of clean |
| 5 | Positive form | Instructions state what to do (BP-001 applied) | "Don't use any" instead of "Use only X" |
| 6 | Consistent notation | Uniform heading levels, list styles, table formats | Mix of -, *, 1. in same context |
| 7 | Explicit prerequisites | All assumed knowledge stated | Uses "DI" without defining Dependency Injection |
| 8 | Priority ordering | Most important items first, exceptions last | Edge cases before common patterns |
| 9 | Scope boundaries | Explicit coverage: what this skill addresses vs references to other skills | Overlapping guidance with no cross-reference |
References
- Creating skills: See references/creation-guide.md for generation flow and description guidelines
- Reviewing skills: See references/review-criteria.md for evaluation flow and grading
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核