What problem does it solve?
PostHog's frontend code is split between two trees — products/<name>/frontend/ and frontend/src/scenes/<name>/ — and about 18 products still have UI in both. Adding a file to the wrong tree widens merge-queue lanes and slows every frontend PR, but the correct placement is not obvious from the directory listing alone.
Core Features & Use Cases
- Placement decision rules: A decision table maps each situation (migration under way, no scenes directory, app-level scene) to the correct tree, including when to bootstrap a new product with
bin/hogli product:bootstrap.
- Migration progress reporting: The
scene_product_split.py script counts hand-written .ts/.tsx files on each side of the split (skipping orval-generated code) and reports how far each product's move has gone.
- Technical rationale: Explains why path-based merge-queue lanes are the only working signal, backed by a measured dependency-graph analysis (2226 modules in one strongly connected component).
- Use Case: Before adding a new component for the data-warehouse product, run the script to see that
products/data-warehouse/frontend/ already holds more files than scenes/data-warehouse/, then place the new file in the products tree.
Quick Start
Ask the assistant to run the scene_product_split.py script for your product name and tell you which frontend tree your new file belongs in.