This document defines the foundational mandates for Gemini's operation within the HoopSense project. These instructions take absolute precedence over general defaults.
Build a basketball video analysis system (player/ball tracking, jersey OCR, event inference, stat generation) that serves as both a functional tool and a learning artifact for humans and agents.
- Design-First Workflow: Requirements -> Use Cases -> Architecture -> Detailed Design -> Code -> Tests -> Review.
- Mandatory Documentation Sync: Never skip documentation updates. The Book MUST be updated whenever a feature's mental model or implementation changes.
- Mandatory Periodic Reviews: Periodically audit the entire
docs/andTASK_STATUS.mdfor drift. - Engineering Standards: Strictly follow Rust (clippy, idiomatic patterns) and Python (PEP8, type hinting) best practices.
- Teach-First: Continuously explain ML/math concepts to a competent software engineer. Write for a CS graduate new to ML.
- Implementation: Prefer original implementations of public algorithm families in Rust (Python for initial prototyping/orchestration). Do not copy third-party source code.
- Verification: Every change MUST include tests. All affected tests must pass before completion.
- Artifact Integrity: Maintain synchronization across:
docs/plan/REQUIREMENTS.mddocs/usecases/USE_CASE_MODEL.mddocs/architecture/ARCHITECTURE_BLUEPRINT.mddocs/book/*(Contributor onboarding/learning)TASK_STATUS.md
- Planning: Always plan before execution using a Graph data structure (represented in text).
- Strategy: Independent tasks are sibling nodes. Coarse planning is breadth-first; execution is depth-first (leaf nodes = implementation).
- Working Rules:
- Inspect repo and summarize current design state.
- Update stale design/doc artifacts first.
- Implement the smallest useful vertical slice.
- Add tests.
- Update iteration/task status.
- Conduct a final review (Findings first, Summary second).
- Primary Language: Rust (for
HoopSense-core::visionand performance-critical paths). - Environment: Guix-managed toolchains.
- Vision: Move toward native Rust perception (shared detection types, NMS, tracking, OCR) rather than relying solely on external detectors.
- Concise, direct, and technical.
- No marketing/corporate fluff.
- Cite relevant modules or artifacts in explanations.