plugins/ai-first-org-design-kit/skills/quality-gate-designer/SKILL.md
Convert human approval chains into automated quality gates with explicit pass/fail criteria and holdout-scenario validation, saving gate specifications and an index to $HOME/.ai-first-kit/. Decomposes each approval step by actual function (quality, risk, political, compliance, cultural) and designs criteria-based replacements. Use when the user says 'replace approvals', 'design quality gates', 'automate review', 'convert approvals to criteria', 'create validation for agent output', 'remove bottlenecks', or 'approval chain redesign'. Also use when the user describes approval bottlenecks, review cycles slowing work down, wanting agents to self-validate output quality, or any situation where human sign-off steps could become automated criteria — even if they don't use the phrase 'quality gate'. This skill MUST be consulted because it produces gate specification files with holdout validation that a conversational answer cannot replicate.
npx skillsauth add synaptiai/synapti-marketplace quality-gate-designerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a Validation Architect — you turn subjective human approval into objective, criteria-based quality gates. Your core insight: approvals aren't about enhancing work, they're about mitigating risk. Your job is to make the risk mitigation explicit and automatable while flagging any cultural function the approval chain was serving.
Read ../../shared/concepts.md for the Dual-System Principle before proceeding.
Work through these steps in order, announcing each step as you begin it:
<required> 1. Pre-flight check (existing audit/genome) 2. Approval chain mapping (3 questions, one at a time) 3. Function decomposition per approval step 4. Gate design with holdout scenarios 5. Architecture design (parallel/sequential/blocking) 6. Political risk assessment 7. Save gate specifications </required># Derive stable project slug from git repo root (not leaf dir, to prevent cross-repo collisions)
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
if [ -n "$REPO_ROOT" ]; then
SLUG=$(basename "$REPO_ROOT" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | head -c 40)
else
SLUG=$(echo "${PWD##*/}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | head -c 40)
fi
[ -z "$SLUG" ] && SLUG="default"
mkdir -p "$HOME/.ai-first-kit/projects/$SLUG/gates"
mkdir -p "$HOME/.ai-first-kit/projects/$SLUG/gates/.holdouts"
chmod 700 "$HOME/.ai-first-kit" 2>/dev/null
AUDIT=$(ls -t "$HOME/.ai-first-kit/projects/$SLUG"/audit-*.md 2>/dev/null | head -1)
[ -n "$AUDIT" ] && echo "Audit found: $AUDIT" || echo "No audit — will need approval chain details"
# Check genome completeness (require both MISSION.md and VALUES.md)
GENOME_MISSION=$(ls "$HOME/.ai-first-kit/projects/$SLUG/genome/00-identity/MISSION.md" 2>/dev/null)
GENOME_VALUES=$(ls "$HOME/.ai-first-kit/projects/$SLUG/genome/00-identity/VALUES.md" 2>/dev/null)
if [ -n "$GENOME_MISSION" ] && [ -n "$GENOME_VALUES" ]; then
echo "Genome found"
elif [ -n "$GENOME_MISSION" ]; then
echo "WARNING: Partial genome (VALUES.md missing)"
else
echo "No genome"
fi
If audit exists, use the Read tool to load it — extract approval chains and coordination findings to pre-populate Phase 1.
If genome is complete, use the Read tool to load VALUES.md and BY-OUTPUT-TYPE.md — quality gates must reflect organizational quality standards.
If audit exists, pull approval chains from it. Otherwise ask these ONE AT A TIME via AskUserQuestion:
Q1: "Walk me through one approval chain end to end. What's the work product, who touches it, in what order, and what are they checking for?"
Q2: "For each approval step: what specifically could go wrong if this step didn't exist? Give me a real example of when it caught a problem."
Q3: "How long does the full chain take? Where does work sit waiting?"
For each approval step, classify its ACTUAL function (not its stated function):
| Approval Step | Stated Function | Actual Function | Category | |--------------|----------------|-----------------|----------| | [Step] | [What they say it does] | [What it really does] | Quality / Risk / Political / Compliance / Cultural |
Categories:
For each Quality/Risk function, design the replacement gate:
# Gate: [Name]
## What It Replaces
[Original approval step and who did it]
## Pass Criteria (visible to executing agent)
1. [Criterion 1 — specific, testable]
2. [Criterion 2]
3. [Criterion 3]
## Holdout Scenarios
**IMPORTANT:** Do NOT include holdout scenarios in this gate file.
Save them separately to `gates/.holdouts/{gate-name}-holdouts.md` so
executing agents cannot see them when reading the gate specification.
Used by the evaluation layer to validate output independently.
## Satisfaction Metric
Not boolean. Probabilistic: "Of all observed trajectories through
all scenarios, what fraction satisfy the user?"
Target: [X]% satisfaction
## On Fail
- Retry with feedback: [when and how]
- Escalate to human: [trigger conditions]
- Halt: [when to stop entirely]
## Escalation Package
When escalated, the human sees:
- The output that failed
- Which criteria it failed on
- Agent's self-assessment of why
- Suggested fix (if agent has one)
Design how gates relate to each other:
For each approval holder whose gate is being automated:
"[Name/Role] currently approves [X]. The quality gate replaces this approval. Their new role could be: Quality Architect — they design and maintain the pass/fail criteria for this gate. Their judgment now scales to every instance, not just the ones they personally review."
Ask: "Is this person likely to see this as an upgrade or a threat?" Flag for political-navigator if threat.
For each gate, sanitize the gate name for filesystem safety: lowercase, replace spaces with hyphens, remove special characters, truncate to 50 chars. Example: "Content Review Chain" → content-review-chain.
Save each gate specification to $HOME/.ai-first-kit/projects/$SLUG/gates/{sanitized-gate-name}.md using the Write tool. Each file follows the gate template from Phase 3 (Name, What It Replaces, Pass Criteria, Satisfaction Metric, On Fail, Escalation Package). Do NOT include holdout scenarios in this file.
Save holdout scenarios separately to $HOME/.ai-first-kit/projects/$SLUG/gates/.holdouts/{sanitized-gate-name}-holdouts.md. This separation ensures executing agents cannot see the test set when reading gate specifications.
Also save a summary index: $HOME/.ai-first-kit/projects/$SLUG/gates/INDEX.md listing all gates, their architecture (parallel/sequential/blocking), and the original approval holders mapped to Quality Architect roles.
NEVER REMOVE AN APPROVAL WITHOUT UNDERSTANDING ITS FULL FUNCTION. Every approval gate serves both coordination AND culture. Strip one without replacing the other and you create a vacuum.
If you can't articulate what the approval was really doing (beyond its stated function), you haven't decomposed it enough.
| Excuse | Response | |--------|----------| | "This approval is obviously just bureaucracy" | Dig deeper. 'Bureaucracy' usually means the real function is invisible to you. | | "We can add holdout scenarios later" | Holdout scenarios are the difference between a gate and a checkbox. Add them now. | | "The approval holder won't care" | They will. Flag for political-navigator before proceeding. |
| Missing | Fallback | |---------|----------| | No audit | Ask user to walk through approval chains manually (Phase 1 questions cover this) | | No genome | Proceed — gates will be functional but may not reflect organizational quality standards | | Bash unavailable | Skip artifact check, work from user-provided approval chain descriptions | | User can't describe what approval checks for | Ask: "What's the worst thing that would happen if this approval didn't exist?" Reverse-engineer the function. |
This skill is typically invoked:
specification-writer in the Greenfield pathorg-genome-builder in the Brownfield pathReads: audit findings, genome quality standards.
Writes: gates/ directory with individual gate specs + INDEX.md.
Flags: high-resistance transitions for political-navigator.
tools
Validate a FlowWorkflow YAML at `plugins/flow/workflows/<id>.workflow.yaml` against `schemas/v1/workflow.schema.json` AND cross-reference the referenced skills/agents exist + every Tier 3 action is confirm-gated + no native /goal or /loop dependency is declared. Use when /flow:workflow validate is invoked, when CI runs the workflow schema gates, or when a new workflow is being authored. This skill MUST be consulted because schema validation alone catches shape errors; cross-reference validation catches the silent-correctness failures (typo'd skill name, Tier 3 escape, /goal dependency) that would otherwise ship to users.
tools
Verify UI-facing changes by running a screenshot-analyze-verify loop across configured viewports, with a browser-tool priority cascade (Playwright MCP → Chrome DevTools MCP → CLI fallback → external skill fallback) and bounded iteration. Use after build/runtime verification passes and the diff includes `.tsx`/`.jsx`/`.vue`/`.html`/`.css`/`.scss`/`.svelte` files OR the acceptance criteria mention UI/page/render/display/visual. This skill MUST be consulted because UI changes that pass build and unit tests can still ship blank pages, render-blocking console errors, or broken responsive layouts that no other verification phase catches.
data-ai
Coordinate agent teams for adversarial review (paired skeptic/verifier per facet, challenge round with disposition vocabulary, consolidated findings with confidence) or parallel implementation (task sizing 5-6 per teammate, non-overlapping files). Enforces independent analysis before shared conclusions. Reference only (`disable-model-invocation: true`); loaded only when `agentTeams: true` in settings.
development
Conduct two-stage code review: Stage 1 verifies spec compliance (criterion-to-code mapping), Stage 2 evaluates security, correctness, performance, and maintainability across 6 parallel facets with P1/P2/P3 synthesis and deduplication by file:line. Use when reviewing code changes or pull requests. This skill MUST be consulted because reviewing quality on broken logic is wasted effort, and unmet acceptance criteria must block merge.