VAL - Vision Abstraction Layer

The Vision Abstraction Layer is a comprehensive abstraction system inspired by Dr. Garry Nolan's custom chain-of-thought layer. VAL sits between user input and Claude Code, providing enhanced context awareness, validation, and automation.


Architecture

Shane → [VAL] → Claude Code

    Context Engine → Knowledge DB
    Domain Router → Work/Personal/Research
    Response Filter → Execute/Log/Learn

VAL processes every request through multiple stages to enrich context, validate outputs, and trigger appropriate actions.


Core Components

Request Preprocessor

Enriches requests with relevant context before processing.

Features:

  • Domain Detection: Automatically identifies if request is work, personal, or research-related
  • Knowledge DB Queries: Retrieves relevant past solutions and patterns
  • Recent Context: Includes last 10 interactions for continuity
  • Project Detection: Identifies current git repository and branch
  • Protocol Reminders: Injects domain-specific protocols and lessons

Usage:

python3 ~/.claude/val/preprocessor.py "fix the production error"

Response Postprocessor

Validates responses before delivery and triggers automatic actions.

Validates:

  • No emoji violations in documents (conversation is OK)
  • GUI testing claims include screenshot evidence
  • Production fixes include verification steps
  • No excuse/argument language (token waste)
  • Research exhaustion before declaring impossible

Automatic Actions:

  • iTerm2 fireworks when validation fails (visual error indicator)
  • Slack notifications to #qc for production changes
  • Flare error checks after fixes
  • Screenshot captures for GUI testing
  • Knowledge DB updates with new patterns

Usage:

python3 ~/.claude/val/postprocessor.py

Domain Modules

Three specialized modules provide domain-specific intelligence:

Work Domain

  • Laravel & production server context
  • Flare integration for error tracking
  • Critical protocols (check config FIRST, GUI testing, etc.)
  • Time estimates (CRUD = hours not days)
  • Common mistakes database (APP_URL mismatch, double-hash, etc.)

Personal Domain

  • Upwork proposal assistance with templates
  • Time estimation with complexity factors
  • Rate guidelines by project type
  • Tech preferences & deployment approach

Research Domain

  • Research area detection (AI, consciousness, math, automation)
  • Learning guidelines (research exhaustively)
  • Pattern recognition approach
  • Documentation protocols

Integration

Automatic Background Integration

VAL automatically loads on every Claude Code startup via ~/.claude/auto_wake.py:

  • Prints VAL status to stdout (visible in context)
  • Silent, fast startup - no slowdown
  • Zero configuration needed

Explicit CLI Commands

Direct invocation via val command:

val status                           # Show VAL status
val context <request>                # Preview enriched context
val protocol <domain>                # Show domain protocols
val estimate <requirements>          # Get time estimate
val suggest template <context>       # Suggest template
val health                           # Health check

Template System

Professional templates for common tasks, inspired by Nolan's grant writing automation.

Categories:

  • Proposals: Upwork web dev, bug fixes
  • Commits: Feature additions, bug fixes
  • Docs: Technical documentation
  • Communications: Client updates

Template Manager:

# List all templates
python3 ~/.claude/val/templates/template_manager.py list

# Show template
python3 ~/.claude/val/templates/template_manager.py show --category commits --template feature

# Render with variables
python3 ~/.claude/val/templates/template_manager.py render \
  --category proposals \
  --template upwork_bug_fix \
  --variables '{"CLIENT_NAME":"John","SPECIFIC_ISSUE":"login error"}'

Knowledge Ingestion

Automatically extracts patterns from interactions and updates the knowledge database.

Pattern Types Detected:

  • Tool usage patterns
  • Command patterns
  • File path patterns
  • Error resolution patterns
  • Domain-specific patterns (Laravel, etc.)

Usage:

# Analyze recent history
python3 ~/.claude/val/ingestion.py analyze 200

Configuration

Default configuration (auto-created at ~/.claude/val/config.json):

{
  "version": "1.0.0",
  "enabled": true,
  "domains_enabled": {
    "work": true,
    "personal": true,
    "research": true
  },
  "postprocessor_enabled": true,
  "validation_enabled": true,
  "auto_actions_enabled": true,
  "debug_mode": false
}

Core Commands:

# Check status
python3 ~/.claude/val/core.py status

# Enable/disable
python3 ~/.claude/val/core.py enable
python3 ~/.claude/val/core.py disable

# Health check
python3 ~/.claude/val/core.py health

Examples

Context Preview

Input:

val context "fix the production error on daniellefence.com"

Output:

DOMAIN: WORK

PROTOCOLS:
  • Check Flare FIRST - ~/.claude/check_flare_errors.sh
  • NO dev servers - Herd auto-serves at http://project-name.test
  • Use specialized tools, NOT bash for files/browser

CRITICAL LESSONS:
  • APP_URL http/https mismatch #1 cause
  • Check config FIRST (especially .env)
  • GUI test before claiming "ready"

WORK PATTERNS:
  Laravel Version: 12.x
  Herd URL: http://newdaniellefence.test

Time Estimation

Input:

val estimate "Laravel CRUD with auth, file uploads, and relationships"

Output:

Base Hours: 3h
Complexity Multiplier: 1.2x
Adjusted Hours: 3.6h
Buffered Hours: 4.32h

BREAKDOWN:
  • CRUD operations: 2h
  • Authentication: 0.5h
  • File uploads: 0.5h
  • Relationships: 0.3x multiplier

Success Metrics

VAL achieves Nolan's goals:

  1. Reduced repetitive work - Templates for proposals, commits, docs
  2. Better context awareness - Domain-specific enrichment
  3. Automatic learning - Pattern extraction and KB updates
  4. Domain-appropriate responses - Work/Personal/Research routing
  5. Fewer "should have known" moments - Protocol reminders, critical lessons

File Structure

~/.claude/val/
├── README.md
├── config.json
├── preprocessor.py (250 lines)
├── postprocessor.py (570 lines)
├── ingestion.py (280 lines)
├── core.py (450 lines)
├── domains/
│   ├── work.py (450 lines)
│   ├── personal.py (380 lines)
│   └── research.py (350 lines)
└── templates/
    ├── template_manager.py
    ├── proposals/
    ├── commits/
    ├── docs/
    └── communications/

Total: 18 files, 3,000+ lines of Python


Dependencies

  • Python 3.x (standard library only)
  • SQLite 3 (for knowledge DB)
  • Existing infrastructure:
    • ~/.claude/database/claude_knowledge.db
    • ~/.claude/history.jsonl
    • ~/.claude/vision_operational_log.md

Version: 1.0.0 Status: Fully Operational Last Updated: 2025-10-12

Was this page helpful?