quality-guard

A universal toolkit for improving the quality and stability of AI outputs. Used as a dependency by other skills to ensure more rigorous, robust, and adversarially-tested deliverables, embedding first-principles thinking and adversarial review into workflows.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "quality-guard" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d1cce5f1417cf5a42327096701279daabf811a123be1253e73f9f1c9851ad5f5. Verify the upstream source and version against https://skillhub.cn/skills/user_5735bd90/quality-guard before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A universal toolkit for improving the quality and stability of AI outputs. Used as a dependency by other skills to ensure more rigorous, robust, and adversarially-tested deliverables, embedding first-principles thinking and adversarial review into workflows.

0 Downloads

Introduction source: third_party · user_5735bd90 · 1.0.0 Reference

SkillPi interpretation

Tasks
A meta-skill that enhances output quality through four structured gates: first-principles decomposition, explicit contracts, controlled execution, and adversarial verification.
Audience
As a dependency in complex skills (data analysis, report generation, code output) When output correctness is critical When the task has ambiguity or multiple valid interpretations When the output will be used for decision-making When consistency across multiple runs matters
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: quality-guard
description: |
  Universal quality and stability enhancement for AI outputs. 
  Use as a dependency by other skills to ensure rigorous, robust, 
  and adversarially-tested deliverables. Embeds first-principles 
  thinking and adversarial review into any workflow.

Quality Guard

A meta-skill that enhances output quality through four structured gates: first-principles decomposition, explicit contracts, controlled execution, and adversarial verification.

When to Use

  • As a dependency in complex skills (data analysis, report generation, code output)
  • When output correctness is critical
  • When the task has ambiguity or multiple valid interpretations
  • When the output will be used for decision-making
  • When consistency across multiple runs matters

The Four Gates

┌─────────────┐    ┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│   本质解构   │ → │   契约定义   │ → │   受控执行   │ → │  对抗验证   │
│ (Deconstruct)│    │  (Contract) │    │  (Execute)  │    │ (Adversarial)│
└─────────────┘    └─────────────┘    └─────────────┘    └─────────────┘
       ↑                                                      │
       └────────────── 验证失败则回溯修正 ←─────────────────────┘

Gate 1: Deconstruct (本质解构)

Before executing, strip the request to its essential problem.

Why: Most quality failures start with solving the wrong problem. A perfectly executed analysis of the wrong metric is worthless.

Method:

  1. Surface request — What was literally asked? (quote it)
  2. 5-Why analysis — Why is this needed? Keep asking until you hit a decision, action, or state change.
  3. Essential problem — Restate in one sentence: "The real problem is..."
  4. Assumptions — List everything you're taking for granted

Output format:

Surface: [original request]
Why chain: [why1] → [why2] → [why3]...
Essential: [one-sentence problem statement]
Assumptions: [list with confidence levels]

Red flags that require deeper deconstruction:

  • The request contains jargon or domain terms you don't fully understand
  • Multiple stakeholders with potentially conflicting goals
  • The "obvious" interpretation seems too simple for the context
  • The requester seems uncertain about what they want

Gate 2: Contract (契约定义)

Define what "good" looks like before producing it.

Why: Explicit contracts prevent scope creep, format drift, and the "I thought you meant X" problem. They also give you a checklist for self-verification.

Contract elements:

Element Question to answer Example
Structure What sections/fields must exist? "Executive summary, 3 KPIs, 2 trends, 1 recommendation"
Content What must be included/excluded? "Include YoY, exclude MTD; include data source, exclude raw data"
Format File type, styling, length limits? "Markdown table, <500 words, Chinese labels"
Quality bar Precision, completeness, actionability? "Numbers rounded to 1 decimal, all claims sourced, next steps clear"
Edge cases How to handle missing/invalid data? "If data <7 days, state 'insufficient sample' instead of trend"

Output: Written contract — can be 3 bullet points for simple tasks, full table for complex ones.

When to get user sign-off:

  • Output format matters (client deliverable, presentation, etc.)
  • Ambiguity in scope or depth
  • Trade-offs exist (speed vs completeness, detail vs clarity)

Gate 3: Execute (受控执行)

Produce output while maintaining process discipline.

Why: Discipline during execution prevents silent errors, unverified assumptions, and "confidence inflation."

Rules:

  1. Contract visible — Keep the contract in context; check against it as you work, not just at the end.

  2. Mark uncertainty — Distinguish between:

    • [VERIFIED] — directly from data/source
    • [INFERRED] — logically derived, assumptions stated
    • [ESTIMATED] — guessed/extrapolated, confidence level noted
    • [UNKNOWN] — couldn't determine, flagged for user
  3. Document deviations — If you must deviate from the contract, note: what changed, why, and impact on output.

  4. Trace decisions — For complex reasoning, show key decision points. Not full chain-of-thought, but enough for audit.

Output: Draft deliverable + Process notes (brief)


Gate 4: Adversarial (对抗验证)

Attack your own output before delivering.

Why: Self-criticism is hard. Structured adversarial review forces you to find problems before the user does.

Three lenses — run each explicitly:

Lens 1: The Skeptic (怀疑论者)

Goal: Find logical and evidential weaknesses

  • Is every claim supported? By what specifically?
  • Are there alternative explanations for the patterns observed?
  • What would make this conclusion wrong?
  • Is the sample/method representative, or biased?

Lens 2: The Adversary (恶意用户)

Goal: Find misuse and misinterpretation risks

  • How could this be quoted out of context?
  • What decision could someone wrongly make based on this?
  • Is any phrasing ambiguous enough to be misleading?
  • What's the worst-case interpretation of this output?

Lens 3: The Edge-Tester (边界测试员)

Goal: Find boundary and exception failures

  • Does this work with empty/null/minimal data?
  • What about extreme values (0, negative, very large)?
  • Timezone/currency/locale edge cases?
  • Concurrent modification/version conflicts?

Output format:

Adversarial review:
- Skeptic: [findings or "no issues"]
- Adversary: [findings or "no issues"]  
- Edge-tester: [findings or "no issues"]
Confidence: [HIGH/MEDIUM/LOW with rationale]
Revisions needed: [list, or "none"]

Confidence levels:

  • HIGH — All lenses passed, verified data, no assumptions
  • MEDIUM — Minor caveats, some inferred data, assumptions stated
  • LOW — Significant unknowns, unverified assumptions, or edge case risks

Integration Pattern

When used as a dependency in another skill:

# In the consuming skill's workflow

1. LOAD quality-guard at task start

2. RUN Deconstruct:
   - If essential problem differs from surface request → confirm with user
   - If assumptions >3 or any low-confidence → flag explicitly

3. DEFINE Contract:
   - Simple task: 3-bullet contract inline
   - Complex task: full contract table, user sign-off if stakes high

4. EXECUTE with contract in context:
   - Tag all uncertainty markers
   - Note any forced deviations

5. RUN Adversarial review:
   - All three lenses, explicit output
   - If confidence LOW → consider revision or user check-in

6. DELIVER:
   - Final output (clean, no meta-commentary unless requested)
   - Confidence label if MEDIUM or LOW
   - Brief process notes if user asked for transparency

Quick Reference by Task Type

Task Type Gate Priority Key Risk Extra Attention
Data analysis Contract + Adversarial Wrong metric, survivorship bias Verify data source, check confounders
Report writing Deconstruct + Contract Misaligned audience, missing context Confirm reader, check jargon level
Code generation Execute + Adversarial Security holes, edge case crashes Input validation, error handling
Strategic recommendation All four Solving wrong problem, unintended consequences Second-order effects, stakeholder alignment
Content creation Deconstruct + Adversarial Tone mismatch, factual drift Brand voice check, source verification

Failure Modes to Watch

See references/failure-modes.md for full catalog. Most common:

  1. Solving the wrong problem well — Gate 1 failure
  2. Format drift — Contract not enforced during execution
  3. Silent assumption failure — Unverified guess presented as fact
  4. Edge case crash — Adversarial review skipped or superficial
  5. Confidence inflation — MEDIUM work delivered as HIGH confidence

References

  • references/first-principles.md — Detailed decomposition methods
  • references/adversarial-review.md — Attack vectors and review checklists
  • references/failure-modes.md — Catalog of common AI output failures

Scripts

  • scripts/validate_structure.py — Programmatic structure/format validation
  • scripts/adversarial_probe.py — Generate adversarial test cases

Agents

  • agents/reviewer.md — Sub-agent instructions for independent adversarial review

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 作为通用质量增强元技能,直接解决AI输出质量的核心痛点
  • 适用于多种复杂场景,显著提升输出可靠性
  • 提供结构化四重关卡流程,确保输出严谨性
Trigger Precision90/100

Highlights

  • 触发词精准完整,覆盖多种变体,边界清晰
  • When to Use 章节明确列出了适用场景
  • Quick Reference by Task Type 提供了具体任务类型的优先级指导
Structure and Standards95/100

Highlights

  • Phase/步骤清晰,有出口条件,含端到端示例
  • frontmatter完整,单文件≤500行
  • 结构完整,包含When to Use、The Four Gates、Integration Pattern等必要章节
Execution Reliability90/100

Highlights

  • 工具来源明确,参数正确,覆盖主要异常
  • 不可逆操作有确认机制
  • Adversarial review 提供了三种不同的验证视角,确保输出质量
Evidence Verifiability (mean of the first four)93/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.