Synced from
references/voice-safety-gates.mdinscript-poolskill on 2026-05-18. Edit upstream in the skill; this file is overwritten on next sync.
Voice-Safety Gates Spec (10 gates + Gate 0 cognitive-depth meta-check)
Run in modes/draft-script.md Step 5 after draft composition, before showing to Daniel. Audit trail written into voice_safety frontmatter block of script.md.
Canon sources
Voice-safety reads from TWO canonical locations:
| Source | Owner | Used by |
|---|---|---|
/Users/mikroverse/Projects/afriend-business/content-extraction/_brand/voice-preservation.md | A Friend brand | Gates 1-7 (brand-level voice rules: verbatim, two-beat, promise-close, ban-list, tool-naming-Pillar-7, anti-brain-rot, credibility-skin-in-game) |
/Users/mikroverse/Projects/onari-intelligence/_canon/voice-deseltrus/ | Daniel-personal cognitive depth + style | Gate 0 + Gates 9-10 (cognitive-depth, AI-style ANTI-PATTERNS L1 BLOCKING, ANTI-PATTERNS L2 WARNING) |
The compose-deseltrus skill (also reads from _canon/voice-deseltrus/) is the canon-owner; afriend-script-pool consumes the same canon for cross-skill voice consistency.
Execution split
- Gate 0 (meta — Cognitive Depth) is LLM-judgment. Pre-flight check before numbered gates. Read VOICE.md Level 0 spec. If draft fails Level 0 (no multi-layer thinking, oversimplified, glossing complexity), skill regenerates BEFORE running numbered gates.
- Deterministic gates (1, 2, 4, 5, 9) run via
scripts/voice-safety-check-deterministic.mjs. Pure JS regex + string-match. Fast. Reproducible. - LLM-judgment gates (3, 6, 7, 8, 10) run as a structured-prompt step inside Mode C. The skill prompts itself to evaluate the draft against the gate’s source-of-truth and emit JSON. Slower but handles semantic checks regex can’t.
Gate 0 — Cognitive Depth (meta-check, pre-flight, added 2026-05-06)
Type: LLM-judgment. Runs BEFORE numbered gates. If fails, draft regenerated with explicit Level-0 guidance — numbered gates not even attempted on a Level-0-failed draft.
Rule: Voice canon VOICE.md Level 0 specifies four cognitive-depth markers (structural, ABOVE all stylistic markers):
- Multi-Layer Thinking: practical observation → metakognitive insight → visionary implication, all in same stream
- Willingness to Sit in Difficulty: if the input thought is hard to articulate, the draft must also be hard. Not flattened to easy understandability
- Beyond-clip thesis (where applicable): use the cite as evidence for Daniel’s-deeper-claim, not as standalone summary
- Register-preservation: practical / meta-cognitive / visionary registers all preserved (NOT all flattened to one register)
LLM prompt:
Read the script body. Verify against
/Users/mikroverse/Projects/onari-intelligence/_canon/voice-deseltrus/VOICE.mdLevel 0 markers (Multi-Layer Thinking, Willingness to Sit in Difficulty, Bridge-not-substitution, Register-preservation). Return JSON: {“multi_layer”: bool, “sits_in_difficulty”: bool, “registers_preserved”: bool, “evidence”: "", “pass”: (all true), “if_fail_advice”: " "}.
Failure surface: “Gate 0 (cognitive depth) failed:
Behavior on failure: unlike other gates, Gate 0 failure auto-triggers regeneration (not Daniel-confirm). The skill silently re-prompts itself with explicit Level-0 guidance and re-runs Gate 0. Max 2 retries before surfacing to Daniel for manual override.
Gate 1 — Banned vocab scan
Type: Deterministic regex.
Rule: No instance of these words in Daniel-voice spans (verbatim-quote spans are exempt):
revolutionize/revolutionary/revolutionizingseamless/seamlesslyAI-poweredgame-changer/game-changingleverage/leveraging/leveraged(verb form, not noun “leverage” in finance sense)disruptive/disrupt(in marketing-speak sense)!(exclamation marks anywhere — inline punctuation OR end-of-sentence)
Implementation:
const banned = /\b(revolutioniz(e|ing|ed|er|ation)|seamless(ly)?|AI-powered|game-?changer?|game-changing|leverag(e|ing|ed)|disrupt(ive|ing|ed)?)\b/gi;
const exclamations = /!/g;
// Run only on Daniel-voice spans. Verbatim-quote spans (marked by italic *"..."* with citation context) are skipped.Source-of-truth: _brand/voice-preservation.md §5.
Failure surface: “Gate 1 failed: '
Gate 2 — Verbatim-quote preservation
Type: Deterministic string-match.
Rule: Every sources[].text_excerpt from frontmatter MUST appear verbatim (byte-for-byte after whitespace normalization) in the script body.
Implementation:
for (const src of frontmatter.sources) {
const quote = src.text_excerpt.trim();
const bodyNormalized = body.replace(/\s+/g, ' ').trim();
const quoteNormalized = quote.replace(/\s+/g, ' ');
if (!bodyNormalized.includes(quoteNormalized)) {
return { pass: false, details: `Source ${src.readwise_id} not found verbatim in body. Drift detected.` };
}
}Source-of-truth: _brand/voice-preservation.md §1 (verbatim contract).
Failure surface: “Gate 2 failed: source <readwise_id> '
Gate 3 — Two-beat cadence
Type: LLM-judgment.
Rule: Script body contains at least 1 period/en-dash separated 2-clause structure with cadence balance.
Pattern examples:
- “Tools end conversations. Companions hold them.”
- “Private by design — your data, your rules.”
- “State and relationship. Same thing.”
LLM prompt (skill-internal):
Read the script body below. Identify all instances of period-or-en-dash-separated 2-clause structures where the two clauses have rhythmic parity (similar syllable count or grammatical mirror). Return JSON: {“two_beat_count”: N, “examples”: […], “pass”: (N >= 1)}.
Source-of-truth: _brand/voice-preservation.md §3 (two-beat cadence).
Failure surface: “Gate 3 failed: no two-beat cadence detected. Voice loses signature rhythm. Suggest adding one in the close beat.”
Gate 4 — Promise-not-sell close
Type: Deterministic regex.
Rule: The last beat (final ~5-15s of script body) MUST NOT match sell vocab.
Banned in close:
preorder/pre-orderbuy now/purchaselink in bio/bio linkindiegogo(the platform name in close)sign up/sign-up/signupjoin the waitlist/waitlistclick(as CTA)discount/early-bird(in close context)
Implementation:
const lastBeat = extractLastBeat(body); // last ## Beat block
const sellVocab = /\b(pre-?order|buy now|purchase|link in bio|bio link|indiegogo|sign-?up|waitlist|click|discount|early-?bird)\b/gi;
return { pass: !sellVocab.test(lastBeat), details: ... };Source-of-truth: _brand/voice-preservation.md §4 (promise-close).
Failure surface: “Gate 4 failed: '
Gate 5 — Pillar declared
Type: Deterministic enum check.
Rule: Frontmatter pillar_primary is in {1, 2, 3, 4, 5, 6, 7}.
Implementation:
const valid = [1, 2, 3, 4, 5, 6, 7];
return { pass: valid.includes(frontmatter.pillar_primary), details: ... };Source-of-truth: _brand/pillars.md defines pillars 1-7.
Failure surface: “Gate 5 failed: pillar_primary missing or out of range. Skill-suggest pillar from clip + reflection content.”
Gate 6 — Tool-naming combination (Pillar-7-conditional)
Type: LLM-judgment. Only runs if pillar_primary == 7 OR pillar_secondary == 7.
Rule: Script body must contain (a) named concrete tools, (b) a “combination doing one job” sentence, (c) low-stakes verbs.
LLM prompt:
The script’s pillar is 7 (Process Transparency). Verify the body contains:
- At least 2 concrete tools named (e.g., “Claude”, “Figma”, “the skill”, “Higgsfield”, “ffmpeg”, “Whisper”, “the device”, “Nano Banana Pro”, “Cursor”, “Patchright”, etc. — not vague “AI” or “my workflow”).
- A sentence describing a combination of tools doing one specific job (e.g., “Claude reasons, the skill orchestrates, the device holds the memory” = combination doing job “continuous companionship across sessions”).
- Low-stakes verbs (open, set up, try, check, grab, paste, show, name) — NOT high-stakes performative ones (deploy, ship, launch, implement, architect, engineer, optimize).
Return JSON: {“tools_named”: […], “combination_present”: bool, “low_stakes_verbs”: […], “high_stakes_verbs_found”: […], “pass”: (all three conditions met)}.
Source-of-truth: _brand/voice-preservation.md §6 + ~/.claude/skills/afriend-content-extraction/priming/tool-naming-checklist.md (4-question drill).
Failure surface: “Gate 6 failed:
If pillar 7 is NOT in primary/secondary: gate is skipped, frontmatter records tools_named_when_pillar_7: "n/a".
Gate 7 — Anti-brain-rot
Type: LLM-judgment. Always runs.
Rule: Script must NOT use:
- Cliffhanger-without-payoff (a hook that promises a reveal but never delivers — “wait until you see what happened next” without the payoff in the clip)
- Performative vulnerability (vulnerability-as-hook with no real stake or insight, just emotional bait)
- Engagement-bait patterns (over-promising, manufactured controversy, fake-urgency, “you won’t believe”, etc.)
LLM prompt:
Read the script body. Per
~/.claude/skills/afriend-content-extraction/references/attention-preservation.mdlines 176-192, identify any:
- Cliffhanger-without-payoff: does the hook promise a reveal/answer/conclusion that the clip body doesn’t deliver?
- Performative vulnerability: does the vulnerability beat read as honest stake-revelation OR as emotion-bait performance?
- Engagement-bait: any “you won’t believe”, “this changed everything”, “the secret to”, manufactured-urgency, or click-bait patterns?
Return JSON: {“violations”: [{“type”: …, “location”: “Beat N”, “evidence”: ”…”}], “pass”: (violations.length == 0)}.
Source-of-truth: ~/.claude/skills/afriend-content-extraction/references/attention-preservation.md lines 176-192.
Failure surface: “Gate 7 failed:
Gate 9 — AI-style ANTI-PATTERNS L1 BLOCKING (added 2026-05-06, compose canon integration)
Type: Deterministic regex. Runs over Daniel-voice spans (verbatim quotes excepted).
Rule: Script body must NOT contain any of the 13 L1 BLOCKING patterns from /Users/mikroverse/Projects/onari-intelligence/_canon/voice-deseltrus/ANTI-PATTERNS.md. These are AI-jargon markers that destroy authenticity.
Patterns (regex/match):
| # | Pattern | Detection |
|---|---|---|
| L1.1 | ”It’s not X. It’s Y.” family | `\b(?:it’?s |
| L1.2 | ”Not because X. But because Y.” | \bnot because\b.*?\.\s*but because\b |
| L1.3 | ”Not that X. But that Y.” | \bnot that\b.*?\.\s*but that\b |
| L1.4 | ”That’s [Name].” punchy intro | `(?:^ |
| L1.5 | ”Here’s the thing:” / “Here’s how” filler | `\bhere’?s (?:the thing |
| L1.6 | ”Let me break this down” | `\blet me break (?:this |
| L1.7 | Em-dash — or -- | `(?:— |
| L1.8 | ”In der heutigen schnelllebigen Welt” | \bin der heutigen schnelllebigen\b |
| L1.9 | ”Game-changer” / “Next level” | `\b(?:game[- ]?changers? |
| L1.10 | ”Unlock your potential” | `\bunlock (?:your |
| L1.11 | ”5 Tipps für mehr…” listicle | `\b\d+\s+(?:tipps? |
| L1.12 | ”Kennst du das auch?” pseudo-question | `\bkennst du (?:das |
| L1.13 | ”Navigating our AI-infused…” buzzword | `\bnavigating\s+(?:our |
Implementation: scripts/voice-safety-check-deterministic.mjs exports gate9AntiPatternsL1(body, sources). Excludes verbatim-quote spans (sources[].text_excerpt — those are sacred even if a foreign speaker uses banned vocab).
Source-of-truth: /Users/mikroverse/Projects/onari-intelligence/_canon/voice-deseltrus/ANTI-PATTERNS.md Level 1 BLOCKING table.
Failure surface: “Gate 9 failed: _canon/voice-deseltrus/ANTI-PATTERNS.md for the principle.”
Critical implication for educational format: my own S02 smoke-test draft (“Conversation as Company Architecture”) FAILED 3 instances of these — “Conversation is not a feature. It’s the architecture.” (L1.1), “That’s Jack Dorsey…” (L1.4), em-dash usage throughout (L1.7). Gate 9 enforces these now.
Gate 10 — AI-style ANTI-PATTERNS L2 WARNING (added 2026-05-06, compose canon integration)
Type: LLM-judgment. Format-conditional (always runs for scripts).
Rule: Script body should not exhibit L2 WARNING patterns from _canon/voice-deseltrus/ANTI-PATTERNS.md. These are quality issues — corrigible, not blocking.
Patterns to detect:
| # | Pattern | Description |
|---|---|---|
| L2.1 | Difficulty Flattening | Heavy thought translated to easy language. “Compounds in ways I’m only starting to see” instead of executing the visionary thought-stream. |
| L2.2 | Bridge Substitution | Daniel’s unique bridge replaced with external enrichment. Brooks’ Law displaces Daniel’s user-bridge. |
| L2.3 | Vision Gesture | Pointing AT the vision instead of executing it. “That compounds in ways…” is a gesture, not a thought. |
| L2.4 | Accessibility Override | Every paragraph optimized for max comprehensibility. ALL flattened to one register (practical-reflective LinkedIn). Visionary + meta-cognitive registers disappear. |
| L2.5 | Announcer-Colon Setup | ”What’s emerging is an evolution: [concept].” Build-up + colon + reveal = AI-typical pattern. |
| L2.6 | Hook → Problem → Solution → CTA | Too formulaic. Organic thought-flow preferred. |
| L2.7 | Each sentence as own paragraph | LinkedIn-cringe. Normal paragraphs where sensible. |
| L2.8 | Übertriebene Begeisterung / Pseudo-Verletzlichkeit / Prediger-Ton / False Humility | Inauthentic emotional registers. |
LLM prompt:
Read the script body. Per
_canon/voice-deseltrus/ANTI-PATTERNS.mdLevel 2 WARNING patterns, identify any matches. Return JSON: {“violations”: [{“pattern”: “L2.N”, “evidence”: "", “fix_advice”: " "}], “pass”: (violations.length == 0)}.
Source-of-truth: _canon/voice-deseltrus/ANTI-PATTERNS.md Level 2 WARNING.
Failure surface (warning only): “Gate 10 (L2 WARNING):
Gate 8 — Credibility / skin-in-game (added 2026-05-06)
Type: LLM-judgment. Format-conditional — only runs if format ∈ {educational-talkinghead, educational-greenscreen}. Runs in advisory-only mode if reflection’s daniel_stake_optout: true.
Rule: Educational/thought-leadership scripts MUST demonstrate Daniel-skin-in-game, not just summarize the source clip. The brand-pillar promise of educational format = “credibility + social validation through the founder’s stake in the field.” Without this, the clip reads as expert-summary and loses A Friend’s unique-positioning value.
Three sub-checks:
- Daniel-stake explicit: at least one beat names a specific stake/build/decision/number from Daniel’s own founder context (A Friend, Onari Intelligence Bridge, the Indiegogo campaign, named milestones, real numbers, real architectural choices). Vague “we’re building” without specifics doesn’t count.
- Beyond-clip insight: the script contains a claim or framing that wouldn’t exist if Daniel weren’t shipping A Friend himself. The cite is evidence FOR Daniel’s thesis, not summary of the speaker’s thesis.
- Cite-not-endorsement: no implicit “this expert validates A Friend.” The speaker spoke about something else (Block restructuring, AI memory, etc.); Daniel uses architectural framing only. Banned phrasings: “validates what we’re doing”, “proves that”, “confirms our approach.”
LLM prompt (skill-internal):
Read the script body and the
daniel-reflection.mdDaniel-Stake section. Verify all three sub-checks above. Return JSON: {“daniel_stake_present”: bool, “stake_evidence”: "", “beyond_clip_insight”: bool, “insight_evidence”: " ", “cite_as_evidence_not_endorsement”: bool, “endorsement_violations”: […], “pass”: (all three true)}.
Source-of-truth: Daniel’s locked decision 2026-05-06 — “diese Credibility und Social Validation auch in einer Form abbilden… Skin in dem Game.” Plus brand pillar definitions in _brand/pillars.md Pillars 5 (Startup Realness), 6 (Co-Founder Bridge), 7 (Process Transparency).
Failure surface: “Gate 8 failed:
Advisory mode: if reflection has daniel_stake_optout: true, Gate 8 runs but only WARNS instead of failing. Frontmatter records credibility_skin_in_game: "advisory-warn". Daniel can ship a pure-summary clip if he explicitly chose that path; the advisory-warn value flags it for downstream auditing (e.g., M114 refinement may surface it for re-draft).
Skip mode: if format is NOT educational, Gate 8 doesn’t run at all. Frontmatter records credibility_skin_in_game: "n/a".
Frontmatter audit format
After all 10 gates + Gate 0 meta-check run, write into script.md frontmatter:
voice_safety:
cognitive_depth: true | false # Gate 0 (auto-regen if false; final value reflects last attempt)
banned_vocab_check: clean | violations # Gate 1
verbatim_quotes_unchanged: true | false # Gate 2
ends_on_promise: true | false # Gate 4
two_beat_present: true | false # Gate 3
pillar_declared: true | false # Gate 5
tools_named_when_pillar_7: true | false | "n/a" # Gate 6
credibility_skin_in_game: true | false | "n/a" | "advisory-warn" # Gate 8
anti_patterns_l1_blocking: clean | violations # Gate 9 (deterministic, BLOCKING)
anti_patterns_l2_warning: clean | violations # Gate 10 (LLM-judgment, WARNING only)If gate 7 fails, also surface in body as inline comment block above the affected beat. Gate 7 audit doesn’t have a frontmatter field by default — could add anti_brain_rot_check: clean | violations if Daniel wants persistent tracking. Default for now: surface inline only.
Failure handling
Per modes/commit-or-discard.md: any gate failure surfaces in Mode D as a ⚠ warning, but doesn’t block commit (Daniel can accept-anyway). Audit trail preserves the failure for downstream consumers (M114 refinement skill, eval pipeline, etc.).