Skip to content

Add offensive engine with formations, routes, and play concepts#28

Open
DigitalBlueprint239 wants to merge 1 commit into
masterfrom
claude/restore-offense-engine-ATRIn
Open

Add offensive engine with formations, routes, and play concepts#28
DigitalBlueprint239 wants to merge 1 commit into
masterfrom
claude/restore-offense-engine-ATRIn

Conversation

@DigitalBlueprint239

Copy link
Copy Markdown
Owner

Summary

This PR introduces a comprehensive offensive engine system for managing football play design, including formations, routes, concepts, and spacing/timing rules. The system provides data validation, concept detection, and spacing analysis capabilities.

Key Changes

  • Schema Definition (schema.ts): Defined TypeScript interfaces for formations, routes, concepts, spacing rules, timing rules, and motions with proper type safety
  • Data Layer (data.moderate.ts): Added curated offensive playbook data including:
    • 3 formations (Trips Left, Doubles Right, Empty Right)
    • 5 core routes (Slant, Hitch, Go, Corner, Shallow Cross)
    • 3 play concepts (Mesh, Smash, Four Verticals)
    • Spacing and timing rules for play execution
  • Engine Loader (engine.ts): Implemented loadOffensiveEngineData() with validation and caching to safely load and validate all offensive data
  • Validators (validators.ts): Created validation functions for each data type to ensure data integrity (IDs, ranges, required fields)
  • Concept Detection (conceptDetection.ts): Implemented pattern matching to automatically identify play concepts from route combinations (e.g., Mesh from 2+ shallow routes, Smash from hitch+corner)
  • Spacing Engine (spacingEngine.ts): Added vertical spacing analysis to detect route convergence violations and provide coaching corrections
  • Comprehensive Tests (offenseEngine.test.ts): Added 25+ test cases covering validation, data loading, concept detection, and spacing analysis

Notable Implementation Details

  • Safe Loading: The engine validates all data on load and logs warnings for invalid entries while continuing with valid data
  • Caching: loadOffensiveEngineData() caches results to avoid repeated validation
  • Flexible Concept Detection: Pattern matching uses route name matching (case-insensitive) to identify concepts, allowing for variations in naming
  • Spacing Analysis: Checks both vertical and horizontal separation to flag convergence issues only when routes are close in both dimensions
  • Type Safety: Full TypeScript typing throughout with specific union types for enums (e.g., formation strength, break directions)

https://claude.ai/code/session_01LLsNLiVF7gAHcyx2LEpi1a

@netlify

netlify Bot commented Mar 5, 2026

Copy link
Copy Markdown

Deploy Preview for magical-starlight-0c1207 failed.

Name Link
🔨 Latest commit f4bbb86
🔍 Latest deploy log https://app.netlify.com/projects/magical-starlight-0c1207/deploys/69a8d948ee8b5d0008423c0a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants