devtools-model-management
Installation
SKILL.md
Creating or Migrating a Model in DevTools
This guide outlines the standard procedure for creating a new model or migrating an existing one to front_end/models/.
0. Preparation (Before you start)
- Baseline: Run existing tests for the code you are moving to ensure they pass before you touch anything.
./dt test front_end/<old_location>
- Impact Analysis: Search for usages of the class/file to understand the scope of refactoring.
grep -r "ClassName" front_end/
1. File Structure
- Location:
front_end/models/<model_name>/(must be lowercase). - Entrypoint: Create a barrel file
front_end/models/<model_name>/<model_name>.tsthat exports the model's public API. - Implementation: The actual logic goes in
<ClassName>.ts. - Tests: Unit tests go in
<ClassName>.test.tsalongside the implementation.
2. Build Configuration (BUILD.gn)
Every model requires a BUILD.gn file in its directory with three specific targets: