GOTCHA Framework Deep Dive

GOTCHA Framework — Complete Reference

Last Verified: 2026-02-17 | Owner: John

GOTCHA is the 6-layer architecture for agentic systems. This is the FOUNDATION of how John operates.


Overview

GOTCHA is a 6-layer framework that separates concerns between what needs to happen (Goals), who coordinates it (Orchestration), what executes it (Tools), what informs decisions (Context), what guides behavior (Hard prompts), and what shapes responses (Args).

GOT (Engine):

CHA (Context):


Principle: 90%^5 = 59%

AI greši kumulativno. Ako je svaki korak 90% tačan:

Zato:


Layer 1: GOALS (specs/ + rules/)

Purpose: Define WHAT needs to happen, not HOW.

Components:

John's role: Read specs before implementing. Follow rules during execution. Check MC for priorities.


Layer 2: ORCHESTRATION (John)

Purpose: AI manager that coordinates execution.

Responsibilities:

Key principle: John sits between "what" (goals) and "how" (tools). Reads instructions, applies context, delegates well, handles failures.


Layer 3: TOOLS (tools/)

Purpose: Deterministic execution. Do ONE thing reliably.

Components:

Rules:

  1. ALWAYS check manifest before creating new tool
  2. One tool = one responsibility
  3. Zero deps when possible
  4. Exit codes: 0=success, 1=error, 2=retry
  5. JSON output for programmatic use

Example tools:


Layer 4: CONTEXT (context/ + memory/)

Purpose: Domain knowledge and reference material.

Components:

Usage:


Layer 5: HARD PROMPTS (prompts/)

Purpose: Reusable instruction templates.

Components:

Use cases:


Layer 6: ARGS (config/)

Purpose: Behavior settings and configurations.

Components:


Boot Sequence

Every session MUST start with:

bash ~/system/boot.sh

Boot verificira svih 6 GOTCHA layera:

  1. GOALS — specs/ + rules/ exist
  2. ORCHESTRATION — agents defined
  3. TOOLS — manifest.md accessible
  4. CONTEXT — context/ + HiveMind operational
  5. HARD PROMPTS — prompts/ available
  6. ARGS — config/ accessible

Output: Status report + recent changelog + task summary + email briefing + checklist reminders


Enforcement: Hooks

GOTCHA is enforced via ~/.claude/hooks/ (Python scripts):

Hook Layer What It Blocks
gotcha-enforcer.py GOALS Write/Edit without GOTCHA checklist
security-guard.py TOOLS Access to forbidden paths
hallucination-detector.py CONTEXT Phantom dependencies, fabricated APIs
plan-enforcer.py ORCHESTRATION Implementation without approved plan
agent-protocol-enforcer.py ORCHESTRATION Agent spawns without CORE PROTOCOL

GOTCHA vs AIOS

History: System was originally called AIOS (AI Operating System). On 2026-02-06, all AIOS references were removed from active files. Only GOTCHA remains.

Why: GOTCHA is the framework. AIOS was branding. System needs framework, not branding.

Backup: Original working system preserved at ~/clawd/ as reference.


Tool-First Protocol

GOTCHA Layer 3 (Tools) has a search order:

  1. Naši alati (~/system/tools/manifest.md) — CHECK FIRST
  2. Naši skillovi (~/.claude/skills/) — Use existing skills
  3. Naša baza (HiveMind) — Query for past solutions
  4. Internet (WebSearch/WebFetch) — Research if no internal solution
  5. Ažuriraj bazu — Post new learnings to HiveMind

Rule: NEVER write new code before checking manifest. NEVER research externally before checking HiveMind.


For full system handbook, see ~/system/CLAUDE.md


Revision #3
Created 2026-02-17 22:27:01 UTC by John
Updated 2026-05-31 20:01:13 UTC by John