quality-gates by yonatangross/orchestkit
npx skills add https://github.com/yonatangross/orchestkit --skill quality-gates包含钩子
此技能使用 Claude 钩子,可以自动执行代码以响应事件。安装前请仔细审查。
此技能教导智能体如何评估任务复杂度、执行质量门,并防止在不完整或定义不清的任务上浪费工作。
核心原则: 在信息不完整时,先停下来澄清。提出问题总比在错误的解决方案上浪费精力要好。
| 等级 | 文件数 | 代码行数 | 时间 | 特征 |
|---|---|---|---|---|
| 1 - 简单 | 1 | < 50 | < 30 分钟 | 无依赖,无未知因素 |
| 2 - 较简单 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 1-3 |
| 50-200 |
| 30 分钟 - 2 小时 |
| 0-1 个依赖,极少未知因素 |
| 3 - 中等 | 3-10 | 200-500 | 2-8 小时 | 2-3 个依赖,一些未知因素 |
| 4 - 复杂 | 10-25 | 500-1500 | 8-24 小时 | 4-6 个依赖,显著未知因素 |
| 5 - 非常复杂 | 25+ | 1500+ | 24+ 小时 | 7+ 个依赖,许多未知因素 |
加载:Read("${CLAUDE_SKILL_DIR}/references/complexity-scoring.md") 以获取详细示例和评估公式。
| 条件 | 阈值 | 操作 |
|---|---|---|
| YAGNI 门 | 合理比率 > 2.0 | 使用更简单的替代方案进行 BLOCK |
| YAGNI 警告 | 合理比率 1.5-2.0 | 使用更简单的替代方案进行 WARN |
| 关键问题 | > 3 个未回答 | BLOCK |
| 缺失依赖项 | 任何阻塞性依赖 | BLOCK |
| 失败尝试 | >= 3 | BLOCK & ESCALATE |
| 证据失败 | 2 次修复尝试 | BLOCK |
| 复杂度溢出 | 等级 4-5 无计划 | BLOCK |
警告条件(谨慎进行):
加载:Read("${CLAUDE_SKILL_DIR}/references/blocking-thresholds.md") 以获取升级协议和决策逻辑。
使用 Read("${CLAUDE_SKILL_DIR}/references/<file>") 按需加载:
| 文件 | 内容 |
|---|---|
complexity-scoring.md | 详细的 1-5 级特征、快速评估公式、检查清单 |
blocking-thresholds.md | BLOCKING 与 WARNING 条件、升级协议、门决策逻辑、尝试跟踪 |
workflows.md | 任务前门验证、卡住检测、复杂度分解(等级 4-5)、需求完整性 |
gate-patterns.md | 门验证流程模板、上下文系统集成、常见陷阱 |
llm-quality-validation.md | LLM 作为评判者的模式、质量方面、故障开放/关闭策略、优雅降级、三重消费者工件 |
0. YAGNI 检查(首先运行 — 在任何实施规划之前)
→ 从 scope-appropriate-architecture 读取项目层级
→ 计算 justified_complexity = planned_LOC / tier_appropriate_LOC
→ 如果比率 > 2.0: BLOCK(必须简化)
→ 如果比率 1.5-2.0: WARN(提供更简单的替代方案)
→ 安全模式免于 YAGNI 门检查
1. 评估复杂度 (1-5)
2. 统计未回答的关键问题数量
3. 检查依赖项是否被阻塞
4. 检查尝试次数
if (yagni_ratio > 2.0) -> BLOCK with simpler alternatives
else if (questions > 3 || deps blocked || attempts >= 3) -> BLOCK
else if (complexity >= 4 && no plan) -> BLOCK
else if (yagni_ratio > 1.5 || complexity == 3 || questions 1-2) -> WARNING
else -> PASS
## 质量门: [任务名称]
**复杂度:** 等级 [1-5]
**未回答的关键问题:** [数量]
**阻塞的依赖项:** [列表或无]
**失败尝试:** [次数]
**状态:** PASS / WARNING / BLOCKED
**可以继续:** 是 / 否
## 升级: 任务被阻塞
**任务:** [描述]
**阻塞类型:** [关键问题 / 依赖项 / 卡住 / 证据]
**尝试次数:** [次数]
### 已尝试的方法
1. [方法 1] - 失败: [原因]
2. [方法 2] - 失败: [原因]
### 需要指导
- [具体问题]
**建议:** [建议的操作]
// 将门检查添加到上下文
context.quality_gates = context.quality_gates || [];
context.quality_gates.push({
task_id: taskId,
timestamp: new Date().toISOString(),
complexity_score: 3,
gate_status: 'pass', // pass, warning, blocked
critical_questions_count: 1,
unanswered_questions: 1,
dependencies_blocked: 0,
attempt_count: 0,
can_proceed: true
});
// 在标记任务完成之前
const evidence = context.quality_evidence;
const hasPassingEvidence = (
evidence?.tests?.exit_code === 0 ||
evidence?.build?.exit_code === 0
);
if (!hasPassingEvidence) {
return { gate_status: 'blocked', reason: 'no_passing_evidence' };
}
跨项目跟踪成功/失败模式,以防止重复错误,并在代码审查期间主动发出警告。
| 规则 | 文件 | 关键模式 |
|---|---|---|
| YAGNI 门 | rules/yagni-gate.md | 实施前范围检查、合理复杂度比率、更简单的替代方案 |
| 模式库 | rules/practices-code-standards.md | 成功/失败跟踪、置信度评分、内存集成 |
| 审查清单 | rules/practices-review-checklist.md | 基于类别的审查、主动反模式检测 |
| 级别 | 含义 | 操作 |
|---|---|---|
| 强成功 | 3+ 个项目,100% 成功 | 总是推荐 |
| 混合结果 | 既有成功也有失败 | 视上下文而定 |
| 强反模式 | 3+ 个项目,全部失败 | 阻止并解释原因 |
| 陷阱 | 问题 | 解决方案 |
|---|---|---|
| 为“简单”任务跳过门检查 | 稍后卡住 | 始终运行门检查 |
| 忽略 WARNING 状态 | 未记录的假设导致问题 | 记录每个假设 |
| 不跟踪尝试次数 | 在同一方法上浪费精力 | 跟踪每次尝试,在 3 次后升级 |
| 在 BLOCKED 时继续 | 构建错误的解决方案 | 切勿绕过 BLOCKED 的门 |
ork:scope-appropriate-architecture - 为 YAGNI 门提供信息的项目层级检测ork:architecture-patterns - 作为质量门一部分强制执行测试标准llm-evaluation - 用于质量验证的 LLM 作为评判者模式ork:golden-dataset - 验证数据集满足质量阈值| 决策 | 选择 | 理由 |
|---|---|---|
| 复杂度等级 | 1-5 级 | 足够精细以进行估算,足够简单以进行快速评估 |
| 阻塞阈值 | 3 个关键问题 | 防止在太多未知因素的情况下继续 |
| 升级触发 | 3 次失败尝试 | 在坚持和避免浪费精力之间取得平衡 |
| 等级 4-5 要求 | 需要计划 | 复杂任务需要预先分解 |
关键词: complexity, score, difficulty, estimate, sizing, 1-5 scale 解决的问题: 这个任务有多复杂?在 1-5 级上评分任务复杂度,评估实施难度
关键词: blocking, threshold, gate, stop, escalate, cannot proceed 解决的问题: 我应该在什么时候阻止进展?>3 个关键问题 = BLOCK,缺失依赖项 = BLOCK
关键词: critical questions, unanswered, unknowns, clarify 解决的问题: 什么是关键问题?统计未回答的数量,如果 >3 则阻止
关键词: stuck, failed attempts, retry, 3 attempts, escalate 解决的问题: 如何检测何时卡住?在 3 次失败尝试后,升级
关键词: validate, gate check, pass, fail, gate status 解决的问题: 如何验证质量门?运行任务前门验证
关键词: pre-task, before starting, can proceed 解决的问题: 如何在开始前检查门?评估复杂度,识别阻塞因素
关键词: breakdown, decompose, subtasks, split task 解决的问题: 如何分解复杂任务?将等级 4-5 拆分为等级 1-3 的子任务
关键词: requirements, incomplete, acceptance criteria 解决的问题: 需求是否足够完整?检查功能/技术要求
关键词: escalate, ask user, need help, human guidance 解决的问题: 何时以及如何升级?在 3 次失败尝试后升级
关键词: llm as judge, g-eval, aspect scoring, quality validation 解决的问题: 如何使用 LLM 作为评判者?评估相关性、深度、连贯性及阈值
关键词: yagni, over-engineering, justified complexity, scope check, too complex, simplify 解决的问题: 这个复杂度合理吗?根据项目层级计算 justified_complexity 比率,如果 > 2.0 则 BLOCK,提供更简单的替代方案
每周安装数
109
代码仓库
GitHub 星标数
132
首次出现
2026 年 1 月 22 日
安全审计
安装于
opencode100
gemini-cli95
codex93
github-copilot93
cursor87
claude-code87
Contains Hooks
This skill uses Claude hooks which can execute code automatically in response to events. Review carefully before installing.
This skill teaches agents how to assess task complexity, enforce quality gates, and prevent wasted work on incomplete or poorly-defined tasks.
Key Principle: Stop and clarify before proceeding with incomplete information. Better to ask questions than to waste cycles on the wrong solution.
| Level | Files | Lines | Time | Characteristics |
|---|---|---|---|---|
| 1 - Trivial | 1 | < 50 | < 30 min | No deps, no unknowns |
| 2 - Simple | 1-3 | 50-200 | 30 min - 2 hr | 0-1 deps, minimal unknowns |
| 3 - Moderate | 3-10 | 200-500 | 2-8 hr | 2-3 deps, some unknowns |
| 4 - Complex | 10-25 | 500-1500 | 8-24 hr | 4-6 deps, significant unknowns |
| 5 - Very Complex | 25+ | 1500+ | 24+ hr | 7+ deps, many unknowns |
Load: Read("${CLAUDE_SKILL_DIR}/references/complexity-scoring.md") for detailed examples and assessment formulas.
| Condition | Threshold | Action |
|---|---|---|
| YAGNI Gate | Justified ratio > 2.0 | BLOCK with simpler alternatives |
| YAGNI Warning | Justified ratio 1.5-2.0 | WARN with simpler alternatives |
| Critical Questions | > 3 unanswered | BLOCK |
| Missing Dependencies | Any blocking | BLOCK |
| Failed Attempts | >= 3 | BLOCK & ESCALATE |
| Evidence Failure | 2 fix attempts | BLOCK |
| Complexity Overflow | Level 4-5 no plan | BLOCK |
WARNING Conditions (proceed with caution):
Load: Read("${CLAUDE_SKILL_DIR}/references/blocking-thresholds.md") for escalation protocols and decision logic.
Load on demand with Read("${CLAUDE_SKILL_DIR}/references/<file>"):
| File | Content |
|---|---|
complexity-scoring.md | Detailed Level 1-5 characteristics, quick assessment formula, checklist |
blocking-thresholds.md | BLOCKING vs WARNING conditions, escalation protocol, gate decision logic, attempt tracking |
workflows.md | Pre-task gate validation, stuck detection, complexity breakdown (Level 4-5), requirements completeness |
gate-patterns.md | Gate validation process templates, context system integration, common pitfalls |
llm-quality-validation.md | LLM-as-judge patterns, quality aspects, fail-open/closed strategies, graceful degradation, triple-consumer artifacts |
0. YAGNI check (runs FIRST — before any implementation planning)
→ Read project tier from scope-appropriate-architecture
→ Calculate justified_complexity = planned_LOC / tier_appropriate_LOC
→ If ratio > 2.0: BLOCK (must simplify)
→ If ratio 1.5-2.0: WARN (present simpler alternative)
→ Security patterns exempt from YAGNI gate
1. Assess complexity (1-5)
2. Count critical questions unanswered
3. Check dependencies blocked
4. Check attempt count
if (yagni_ratio > 2.0) -> BLOCK with simpler alternatives
else if (questions > 3 || deps blocked || attempts >= 3) -> BLOCK
else if (complexity >= 4 && no plan) -> BLOCK
else if (yagni_ratio > 1.5 || complexity == 3 || questions 1-2) -> WARNING
else -> PASS
## Quality Gate: [Task Name]
**Complexity:** Level [1-5]
**Unanswered Critical Questions:** [Count]
**Blocked Dependencies:** [List or None]
**Failed Attempts:** [Count]
**Status:** PASS / WARNING / BLOCKED
**Can Proceed:** Yes / No
## Escalation: Task Blocked
**Task:** [Description]
**Block Type:** [Critical Questions / Dependencies / Stuck / Evidence]
**Attempts:** [Count]
### What Was Tried
1. [Approach 1] - Failed: [Reason]
2. [Approach 2] - Failed: [Reason]
### Need Guidance On
- [Specific question]
**Recommendation:** [Suggested action]
// Add gate check to context
context.quality_gates = context.quality_gates || [];
context.quality_gates.push({
task_id: taskId,
timestamp: new Date().toISOString(),
complexity_score: 3,
gate_status: 'pass', // pass, warning, blocked
critical_questions_count: 1,
unanswered_questions: 1,
dependencies_blocked: 0,
attempt_count: 0,
can_proceed: true
});
// Before marking task complete
const evidence = context.quality_evidence;
const hasPassingEvidence = (
evidence?.tests?.exit_code === 0 ||
evidence?.build?.exit_code === 0
);
if (!hasPassingEvidence) {
return { gate_status: 'blocked', reason: 'no_passing_evidence' };
}
Track success/failure patterns across projects to prevent repeating mistakes and proactively warn during code reviews.
| Rule | File | Key Pattern |
|---|---|---|
| YAGNI Gate | rules/yagni-gate.md | Pre-implementation scope check, justified complexity ratio, simpler alternatives |
| Pattern Library | rules/practices-code-standards.md | Success/failure tracking, confidence scoring, memory integration |
| Review Checklist | rules/practices-review-checklist.md | Category-based review, proactive anti-pattern detection |
| Level | Meaning | Action |
|---|---|---|
| Strong success | 3+ projects, 100% success | Always recommend |
| Mixed results | Both successes and failures | Context-dependent |
| Strong anti-pattern | 3+ projects, all failed | Block with explanation |
| Pitfall | Problem | Solution |
|---|---|---|
| Skip gates for "simple" tasks | Get stuck later | Always run gate check |
| Ignore WARNING status | Undocumented assumptions cause issues | Document every assumption |
| Not tracking attempts | Waste cycles on same approach | Track every attempt, escalate at 3 |
| Proceed when BLOCKED | Build wrong solution | NEVER bypass BLOCKED gates |
ork:scope-appropriate-architecture - Project tier detection that feeds YAGNI gateork:architecture-patterns - Enforce testing standards as part of quality gatesllm-evaluation - LLM-as-judge patterns for quality validationork:golden-dataset - Validate datasets meet quality thresholds| Decision | Choice | Rationale |
|---|---|---|
| Complexity Scale | 1-5 levels | Granular enough for estimation, simple enough for quick assessment |
| Block Threshold | 3 critical questions | Prevents proceeding with too many unknowns |
| Escalation Trigger | 3 failed attempts | Balances persistence with avoiding wasted cycles |
| Level 4-5 Requirement | Plan required | Complex tasks need upfront decomposition |
Keywords: complexity, score, difficulty, estimate, sizing, 1-5 scale Solves: How complex is this task? Score task complexity on 1-5 scale, assess implementation difficulty
Keywords: blocking, threshold, gate, stop, escalate, cannot proceed Solves: When should I block progress? >3 critical questions = BLOCK, Missing dependencies = BLOCK
Keywords: critical questions, unanswered, unknowns, clarify Solves: What are critical questions? Count unanswered, block if >3
Keywords: stuck, failed attempts, retry, 3 attempts, escalate Solves: How do I detect when stuck? After 3 failed attempts, escalate
Keywords: validate, gate check, pass, fail, gate status Solves: How do I validate quality gates? Run pre-task gate validation
Keywords: pre-task, before starting, can proceed Solves: How do I check gates before starting? Assess complexity, identify blockers
Keywords: breakdown, decompose, subtasks, split task Solves: How do I break down complex tasks? Split Level 4-5 into Level 1-3 subtasks
Keywords: requirements, incomplete, acceptance criteria Solves: Are requirements complete enough? Check functional/technical requirements
Keywords: escalate, ask user, need help, human guidance Solves: When and how to escalate? Escalate after 3 failed attempts
Keywords: llm as judge, g-eval, aspect scoring, quality validation Solves: How do I use LLM-as-judge? Evaluate relevance, depth, coherence with thresholds
Keywords: yagni, over-engineering, justified complexity, scope check, too complex, simplify Solves: Is this complexity justified? Calculate justified_complexity ratio against project tier, BLOCK if > 2.0, surface simpler alternatives
Weekly Installs
109
Repository
GitHub Stars
132
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
opencode100
gemini-cli95
codex93
github-copilot93
cursor87
claude-code87
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
43,100 周安装