Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guidelines for creating, migrating, and registering models in front_end/models/. Covers BUILD.gn, devtools_grd_files.gni, and entrypoints.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -25% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -26% | 0% |
This guide outlines the standard procedure for creating a new model or migrating an existing one to front_end/models/.
npm run test -- front_end/<old_location>grep -r "ClassName" front_end/front_end/models/<model_name>/ (must be lowercase).front_end/models/<model_name>/<model_name>.ts that exports the model's public API.<ClassName>.ts.<ClassName>.test.ts alongside the implementation.BUILD.gn)Every model requires a BUILD.gn file in its directory with three specific targets:
devtools_module("<model_name>"): Lists implementation source files (sources) and dependencies (deps).<model_name>.ts) in sources.devtools_entrypoint("bundle"): Defines the barrel file (entrypoint = "<model_name>.ts").deps = [ ":<model_name>" ].ts_library("unittests"): Lists test files and test-only dependencies.deps = [ ":bundle" ].The build system does not auto-detect new modules. You must manually register them in config/gni/devtools_grd_files.gni:
front_end/models/<model_name>/<model_name>.js) to the grd_files_bundled_sources list.front_end/models/<model_name>/<ClassName>.js) to the grd_files_unbundled_sources list.models/<model_name>:unittests) to the deps list in front_end/BUILD.gn.import * as ModelName from '../../models/<model_name>/<model_name>.js';
front_end/panels/elements/elements.ts)../OtherClass.js), never via the model's own barrel file.autoninja -C out/Default (Ensures BUILD.gn and GRD files are correct).npm run lint (Checks style and formatting).npm run test -- front_end/models/<model_name> (New tests).npm run test -- front_end/<old_location> (Regression check for previous owner).front_end/BUILD.gn means tests exist but never run.files or exports allows old patterns to persist.devtools_module sources causes duplicate definition errors.Other measured skills in the registry, with their headline benchmark lift.