Review input

From Fr-e-d/GAAI-framework · View interactive version

Review input is an AI agent skill from the GitHub repository Fr-e-d/GAAI-framework. Adversarial review of any input (human idea, agent analysis, research report, feedback, observation) BEFORE it mutates persistent project state. Universal interceptor with domain auto-detection, 2-phase classification + evaluation, and triple-verdict output (veracity / fit / actionability). Anti-gir

How to use this skill

Skill file

Review Input — Universal Anti-Girouette Reviewer (SKILL-RIN-001)

Purpose

Intercept ANY input — human or agent — that may mutate persistent project state, BEFORE it becomes a DEC, an OT amendment, a strategic-frame edit, an architectural pattern, or a backlog story scope change. Produce a structured 3-verdict report that eclaire the human decision without replacing it.

This skill is anti-girouette, not anti-pivot. It distinguishes :

The human is always the final decider. The skill produces recommendation + traceability ; override is first-class and structurally low-friction.


When to Activate

Manual invocation only — no hooks, no automatic enforcement. The agent (typically Discovery Agent) invokes this skill when :

Do NOT activate for :

If unsure → run Phase 1 only ; the classifier will return out_of_scope if appropriate.


Architecture — Two Phases

Phase 1 — Classification (always runs, deterministic, ~30 seconds)

Phase 1 is lightweight pattern-matching. It produces no LLM-generated verdicts ; it identifies what kind of input this is and whether Phase 2 evaluation is warranted.

Phase 2 — Evaluation (conditional on Phase 1 verdict)

Phase 2 loads domain-specific governance, applies Decision Filters, and produces the triple-verdict report. Skipped if Phase 1 returns out_of_scope.


Phase 1 — Classification

For the input received, deterministically identify :

A. Type of input

human_idea | human_directive | agent_analysis | agent_proposal
research_report | feedback_user | bug_report | observation
external_signal (competitor launch, blog post, paper)
todo | cleanup | housekeeping

B. Potential targets (state mutation candidates)

Inspect the input for references to :

If no target identified → input is purely conversational (no mutation candidate).

C. Domain auto-detection

strategy | architecture | patterns | governance | security
product_ux | pricing | content_marketing | data_model
ops_infra | tooling | bug_fix | refactor | docs

If multiple domains → list them all ; primary = the one most affected by mutation.

If none clear → ask the human, do not guess.

D. Intent declaration (input or inferred)

drift_check  : default. Standard adversarial review against current state.
pivot        : input EXPLICITLY proposes changing direction. Reviewer mode shifts —
               Non-Goals become artefacts to interrogate, not constraints to enforce.
               Question = "is the pivot WELL-FORMED ?" (not "does it violate Non-Goals ?").
refinement   : input refines a previously-reviewed insight in same session — light review.
exploration  : input is exploratory, not yet engaging persistent state.
               Output max = DOCUMENT_ONLY or EXPERIMENT, never REJECT.

If intent not declared → default to drift_check.

E. Phase 1 verdict

out_of_scope    → Pass-through. No mutation candidate, or mutation purely mechanical
                  (typo, lint, dep bump, mechanical refactor). Stop here.
lightweight     → Local + reversible mutation, 1 file, no DEC amendment, no Non-Goal
                  touched. Continue Phase 2 in light mode (compress §3 + §6 in 1 line).
full_review     → Touches DEC / OT / Non-Goal / strategic-frame / pattern transverse /
                  scope V1 / pricing / wedge / ICP / agent definition. Continue Phase 2.
escalate_now    → Input demands an irréversible / destructive action (drop table, delete
                  branch, force push, supersede active DEC without formal amendment).
                  STOP. Demand written human confirmation before any further processing.

Phase 2 — Evaluation (when lightweight or full_review)

Step 2.1 — Load domain governance

Always load :

Then load domain-specific anchors per Phase 1 detection :

| Detected domain | Mandatory reads |

|---|---|

| strategy | your project's strategy docs (mission / wedge / product philosophy) |

| architecture | architecture/<relevant>.md + cited DECs (read DEC files, check status field) |

| patterns | patterns/conventions.md + the existing pattern being amended |

| governance | orchestration.rules.md + the DECs that codify your governance rules |

| security | the DECs that codify your security/compliance posture |

| product_ux | your project's positioning + brand-identity docs + patterns/conventions.md |

| pricing | the DEC(s) that codify your pricing model (active + any candidate) |

| content_marketing | your project's competitor analysis + brand-identity + voice guide |

| data_model | architecture/<storage-bindings>.md + the DECs that codify your data layer |

| ops_infra | the DECs that codify your ops/infra/runtime choices |

| tooling | the DEC(s) that codify your tooling stack + dependency analyses |

If domain unknown → ask the human, do not invent governance docs.

Transitive reads — follow linked_research AND lifecycle fields on every cited DEC :

When loading any cited DEC, the skill MUST :

  1. Read the DEC body in full.
  2. Check the DEC's status field — if superseded, follow the superseded_by field and read the superseding DEC. The verdict must apply against the currently-active DEC, not the superseded one.
  3. Check the DEC's linked_research frontmatter field (if present). For each path listed, read the research doc in full — paying particular attention to any ADDENDUM section, which by GAAI convention may post-date the DEC body and contain empirical evidence that invalidates, qualifies, or amends the DEC's original conclusions. ADDENDUMs are appended after a DEC is active, NOT promoted into the DEC body, so they would otherwise be missed by readers who only follow the DEC reference.
  4. Check the DEC's amends field — read the amended DEC for context.

Rationale : a past incident saw a DEC reversal proposal REJECTed by a review-input invocation that read the cited DEC but did not follow the DEC's linked_research field. The linked research doc contained an ADDENDUM that empirically invalidated the DEC's foundational assumption. The verdict was therefore based on stale evidence the skill did not have access to. The override path corrected the outcome, but the false REJECT consumed reviewer cycles that the transitive-read discipline above prevents.

Step 2.2 — Veracity Gate (skip if zero factual claim detected)

Detect factual claims in the input — pattern-match on : product/competitor names, version numbers, dates, citations of standards (RFC/ISO/NIST/OWASP), technical capability assertions, regulatory facts, market data, benchmarks.

If zero factual claim → skip this step. This is the Pareto hot path — the majority of inputs (refactor, design choice between existing patterns, internal scope decisions) have no external claim and avoid verification cost entirely.

If claims present → for each claim, run graduated verification :

  1. Memory check — internal_project claim → grep .gaai/project/contexts/memory/. Cite DEC/pattern + status (active / superseded / draft / candidate).
  2. Code + git — technical claim on GAAI codebase → grep code + git log. Read DEC files cited.
  3. MCP docs tools — claim on lib/framework → context7 (resolve-library-id + query-docs). For Cloudflare specifics → cloudflare MCP. For analytics → posthog MCP. Prefer these over WebSearch when domain matches (per MCP server instructions : "fetch current documentation … even well-known ones … your training data may not reflect recent changes").
  4. WebFetch primary — known canonical URL (RFC, MDN, vendor doc, OWASP, NIST, regulator). Cite document date.
  5. WebSearch cross-ref — last resort. Minimum 2 independent sources (not syndicated). Reject : forums as primary, marketing pages, undated blogs, AI-generated content.

If all 5 steps fail → mark claim UNVERIFIED. Do not hallucinate URLs, quotes, or dates.

For each claim, output :

{
  "claim": "<neutral reformulation>",
  "type": "factual_external | technical | regulatory | benchmark | historical | internal_project | opinion",
  "criticality": "load_bearing | supporting | flavor",
  "verdict": "VERIFIED | PARTIALLY_VERIFIED | UNVERIFIED | CONTRADICTED | NEEDS_NUANCE | OUT_OF_SCOPE",
  "confidence": "high | medium | low",
  "sources": [{"url": "...", "type": "primary|secondary", "date": "YYYY-MM-DD or undated", "quote": "<literal>", "tool_call_id": "<id>"}],
  "verification_method": "memory | code | docs_tool | webfetch_primary | websearch_crossref | not_attempted"
}

Anti-hallucination rules (strict) :

Step 2.3 — Decision Filters check (universal, all domains)

For each filter from strategic-frame.md §5, output PASS / FAIL / N/A + 1-line justification :

If intent = pivot, treat Non-Goals as artefacts to interrogate, not constraints to enforce. The question shifts from "violates ?" to "does the pivot WARRANT amending the Non-Goal ?".

Step 2.4 — Triple verdict (the core output — replaces single ACCEPT/REJECT)

Produce 3 INDEPENDENT verdicts. Do not collapse into one. The human combines them.

veracity_verdict     : VERIFIED | NEEDS_NUANCE | CONTRADICTED | UNVERIFIABLE | NOT_APPLICABLE
fit_verdict          : ALIGNED | TENSION | VIOLATES_NON_GOAL
actionability_verdict: READY | NEEDS_REFINEMENT | TOO_VAGUE

Mapping to recommendation (advisory) :

| Combination | Recommendation |

|---|---|

| All 3 positive (VERIFIED + ALIGNED + READY) | ACCEPT |

| Veracity OK + fit TENSION + actionability READY | EXPERIMENT (limited, measurable, reversible) |

| Veracity NEEDS_NUANCE + fit ALIGNED + actionability NEEDS_REFINEMENT | DEFER (refine then re-review) |

| Veracity UNVERIFIABLE + fit unknown | DEFER until verifiable, OR DOCUMENT_ONLY |

| Veracity CONTRADICTED on load_bearing claim | REJECT (epistemic, not governance) |

| Fit VIOLATES_NON_GOAL without override declaration | REJECT (governance) |

| Intent = exploration | max = DOCUMENT_ONLY or EXPERIMENT, never REJECT |

| Intent = pivot AND well-formed (rationale + falsifiability + DECs touched) | ACCEPT even if Non-Goals touched (override is structural) |

Step 2.5 — Past↔Present symmetry (mandatory question)

Always answer this mirror question BEFORE producing recommendation :

"If this input became ground truth, which active DECs / Non-Goals / OTs would become obsolete or need revision ? What is the COST of NOT pivoting if the input is true ?"

Without this question, the reviewer is structurally biased toward status quo (confirmation bias on the corpus of past decisions). With it, both sides of the trade are visible.

Step 2.6 — Falsifiability check

Can you write : "This input is wrong if <signal> measured < Y within delay Z" ?


Output Format (always JSON-compatible)

{
  "skill_invocation": {
    "skill_id": "SKILL-RIN-001",
    "invoked_at": "<ISO 8601 timestamp>",
    "session_id": "<if available>",
    "input_hash": "<sha256 of input text, for idempotence within session>"
  },
  "phase_1": {
    "type": "<see §A>",
    "targets": ["<DEC-ID | path | OT-ID>"],
    "domain_primary": "<see §C>",
    "domains_secondary": ["..."],
    "intent": "drift_check | pivot | refinement | exploration",
    "classification": "out_of_scope | lightweight | full_review | escalate_now"
  },
  "phase_2": {
    "governance_loaded": ["<doc1>", "<doc2>"],
    "veracity_report": {
      "claims": [/* per Step 2.2 */],
      "load_bearing_status": "all_verified | some_unverified | some_contradicted | not_applicable",
      "summary": "<1 line>"
    },
    "decision_filters": {
      "5.1_pareto":            "PASS | FAIL | N/A",
      "5.2_non_goal":          "PASS | FAIL | N/A",
      "5.3_complexity_budget": "PASS | FAIL | N/A",
      "5.4_icp_alignment":     "PASS | FAIL | N/A",
      "5.5_assumption":        "PASS | FAIL | N/A",
      "5.6_differentiation":   "PASS | FAIL | N/A",
      "rationale": "<1 line per filter>"
    },
    "triple_verdict": {
      "veracity":      "VERIFIED | NEEDS_NUANCE | CONTRADICTED | UNVERIFIABLE | NOT_APPLICABLE",
      "fit":           "ALIGNED | TENSION | VIOLATES_NON_GOAL",
      "actionability": "READY | NEEDS_REFINEMENT | TOO_VAGUE"
    },
    "mirror_question": {
      "if_input_true_what_becomes_obsolete": ["<DEC-X>", "<Non-Goal §3.Y>"],
      "cost_of_not_pivoting": "<1 paragraph>"
    },
    "falsifiability": {
      "can_be_falsified": true,
      "condition": "<input wrong if X < Y within Z>"
    }
  },
  "recommendation": {
    "verdict": "ACCEPT | EXPERIMENT | DEFER | DOCUMENT_ONLY | REJECT",
    "confidence": "high | medium | low",
    "rationale": "<2-3 sentences>",
    "scope_minimum": "<smallest testable version, if EXPERIMENT or ACCEPT>",
    "rollback_plan": "<how to undo, if EXPERIMENT or ACCEPT>",
    "success_metrics": "<chiffrés, if EXPERIMENT or ACCEPT>",
    "dec_proposed": "<next DEC ID + level + status, if formalization needed — ID obtained via `allocate-id.sh dec` (serialised allocator); note if fallback scan-verify was used instead>"
  },
  "override": {
    "available": true,
    "instructions": "Human may proceed by adding `override: { reason: \"<rationale>\", acknowledged_verdict: \"<this verdict>\", proceeds_anyway: true, logged_at: \"<timestamp>\" }` to the artefact frontmatter. Override is logged but not blocked. Pattern of overrides is reviewed quarterly per §5 self-calibration."
  },
  "self_calibration_signals": {
    "skill_invocation_count_this_session": <int>,
    "verdict_distribution_session": {"ACCEPT": 0, "EXPERIMENT": 0, "DEFER": 0, "DOCUMENT_ONLY": 0, "REJECT": 0},
    "note": "Track empirically. Healthy bands: ACCEPT 30-60%, override 5-15%, time-to-verdict P50 < 5 min, veracity_check fresh rate > 80%."
  }
}

Anti-Patterns (the reviewer must avoid these in itself)


Iteration & Caching (Pareto-aware)


Self-Calibration (V1+8w decision-gate per OT-15)

Track these metrics across sessions :

| Metric | Healthy band | Anomaly action |

|---|---|---|

| ACCEPT rate / full_review inputs | 30-60 % | < 20 % over-restrictive ; > 70 % rubber-stamp. Recalibrate. |

| Override rate executed | 5-15 % | > 25 % skill miscalibrated, freezing legitimate inputs. |

| Override → outcome positive (rétro) | > 50 % | Skill too conservative if overrides systematically succeed. |

| Time-to-verdict P50 | < 5 min | Friction kills usage beyond. |

| Veracity report fresh rate | > 80 % | Stale sources = epistemic decay. |

| Skill invocations / 30 days | > 5 | Real usage signal for OT-15 escalation to Phase 2. |

These metrics inform the decision-gate at V1+8 weeks (per OT-15 + §3.4 chiffré Non-Goal) on whether to escalate to Phase 2 enforcement (max 5 stories cap) or archive Prompts A/B as research preserved.


Reference Artefacts (deferred, do not invoke unless decision-gate triggered)

Deferred enforcement-design research, if any, lives under the project's own contexts/artefacts/research/ and is not invoked unless the decision gate above triggers.

These are NOT part of V1 scope. They are research preserved against the case where empirical data at V1+8w justifies escalation.


Final Rule

The reviewer eclaire the human ; it does not decide. Three verdicts independent, never one. Sources real, never hallucinated. Override is first-class, traced not gated. Pivot well-formed > status quo by inertia.

→ Back to discovery skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.