Nano Banana Pro
Agent skill for nano-banana-pro
Purpose: help agents and contributors write tests, propose and implement changes, plan new features, and execute them safely for this repository.
Sign in to like and favorite skills
Purpose: help agents and contributors write tests, propose and implement changes, plan new features, and execute them safely for this repository.
This file applies to the entire repository.
src/log_converter.py:1 converts incoming CAN logs to MF4, merges continuations, and updates DB state.src/helpers.py:1 parses CSV/DAT logs and builds MF4 signals.src/database/ models and CRUD using SQLAlchemy; SQLite by default, Postgres supported via Alembic.src/webserver.py:1 Flask app for browsing logs and metadata.src/config.py:1 sets DATA_FOLDER, DB backend, and timing.src/tests/ uses Python unittest with fixtures in src/tests/test_data/.Keep changes minimal, targeted, and consistent with existing patterns (unittest, no new dependencies without discussion).
.devcontainer/, docker-compose.yml).pip install -r processor/requirements.txt -r webserver/requirements.txtDATA_FOLDER (default ./can_data/, created if missing). Override via env when running if needed.DATA_FOLDER. Set DB_BACKEND=postgres to use Postgres (see src/config.py:24).unittest.python -m unittest discover -s src -p "test_*.py" -v.vscode/settings.json:1).src/tests/test_crud.py:139). If a test needs the DB schema, call init_and_upgrade_db() (src/database/upgrade.py:11).Guidelines for writing tests:
src/tests/ with filenames test_*.py.unittest.TestCase like existing tests (e.g., src/tests/test_log_converter.py:13).src/tests/test_data/; keep them tiny and deterministic.config.DATA_FOLDER in test modules; prefer temporary directories you pass into helpers where available or add parameters to functions to inject paths.tearDown like src/tests/test_crud.py:139.asammdf in small cases; for heavy paths, you may stub or mock as needed (see patterns in src/tests/test_log_converter.py).DATA_FOLDER and do not hardcode paths. New functionality should accept injectable paths or read from config.src/log_converter_logger.py:12, src/webserver_logger.py:8). Avoid adding duplicate handlers.Base.metadata.create_all() when init_and_upgrade_db() runs.src/database/migrations/ and ensure Alembic config stays valid.When you change behavior:
readme.md or inline docstrings when behavior is externally visible.Use this lightweight plan structure before major work:
Keep the plan in the PR description or a short
docs/ note.
processing_status and centralize transitions.readme.md note).process-new-files, backfill, reindex.src/database/ and helpers; enable static checks in devcontainer.unittest and building images.If implementing any of these, slice work into small, testable increments.
python -m unittest discover -s src -p "test_*.py" -v.src/ with focused functions. Keep public APIs stable; prefer optional params over breaking changes.src/tests/ and fixtures under src/tests/test_data/.config.DATA_FOLDER.export DATA_FOLDER=$(pwd)/can_data (or a temp dir)python src/log_converter.py and drop a tiny sample log into can_data/in_logs/.run-docker-compose.md).process_log_file), nouns for structures (LogFile).src/helpers.py or a new focused module.config.py for constants and environment overrides; do not hardcode file system paths.pip install -r processor/requirements.txt -r webserver/requirements.txtpython -m unittest discover -s src -p "test_*.py" -vpython src/log_converter.pypython src/webserver.py then open http://localhost:5000docker compose up (see run-docker-compose.md)readme.md: the web interface has no auth; do not expose it publicly.If anything here conflicts with direct instructions from the task/request, follow the direct instructions.