Guidelines for creating, migrating, and registering models in front_end/models/. Covers BUILD.gn, devtools_grd_files.gni, and entrypoints.
66
78%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/devtools-model-management/SKILL.mdThis 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.184a74d
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.