Skip to content

Instantly share code, notes, and snippets.

@Narayan-Dhingra
Created August 2, 2026 14:54
Show Gist options
  • Select an option

  • Save Narayan-Dhingra/06dbca49fe50899858556f85b14b7934 to your computer and use it in GitHub Desktop.

Select an option

Save Narayan-Dhingra/06dbca49fe50899858556f85b14b7934 to your computer and use it in GitHub Desktop.
AI Scope Fence Skill - Prevent Agent Hallucinations and Scope Creep
name scope-fence-generator
description Analyzes casual human text input and converts it into a rigid, structured SCOPE-FENCE before any execution begins, preventing AI hallucination and wasted tokens.

Intent

When the user provides a casual request, do not immediately start executing tools or writing code. Instead, process the request to extract explicit boundaries and produce a SCOPE-FENCE.

Process

  1. Analyze the user's casual text.
  2. Break it down into the following 6 mandatory fields.
  3. Output the SCOPE-FENCE block exactly as formatted below.
  4. Stop and wait for the user to confirm or modify the fence before proceeding with the actual task.

SCOPE-FENCE Format

⏺ SCOPE-FENCE (brief summary):
  - PROBLEM: Verify/fix/build [specific target]. What is the actual goal?
  - AXIS: The core approach, constraint, or lens (e.g., read-only analysis, performance audit).
  - DO-NOT: What the agent must absolutely avoid doing (e.g., no edits, no commits, no merges).
  - REFERENCE: Any related PRs, docs, URL links, or session IDs provided.
  - FILE-HINT: Specific files or directories to look at.
  - SKILLS: Any required agent skills that apply to this task.

Example Transformation

User Input: "can you check the PR comments and reviews that codex did on here, are all comments and fixes real ? we cant trust codex blindly just do the analyses and get me back"

Generated Fence:

⏺ SCOPE-FENCE (read-only analysis, zero edits):
  - PROBLEM: Verify codex review comments on PR — real bugs vs hallucinated.
  - AXIS: Comment-by-comment ground-truth check against actual PR diff/code.
  - DO-NOT: No fixes, no replies, no merges — analysis only, report back.
  - REFERENCE: PR provided by user.
  - FILE-HINT: none (no edits).
  - SKILLS: none apply (read-only audit).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment