Audit Python-to-JavaScript UI bindings for Gradio _js calls, global window exposure, and ui/globals.d.ts registration.
64
76%
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 ./.github/skills/check-ui/SKILL.mdAudit SD.Next UI integration points where Python uses Gradio _js=... bindings to call JavaScript. Verify each JavaScript callback is exposed on the global window object and included in ui/globals.d.ts.
modules/, scripts/, or extensions/ with _js= callbacks.extensions/*/javascript..github/instructions/core.instructions.md for relevant core runtime guidance before proceeding.ui/globals.d.tswiki/Dev-UI.mdmodules/** and scripts/** Python files that declare _js= valuesextensions/*/javascript/** TypeScript/JavaScript source filesui/**/*.tsextensions-builtin/sdnext-modernui/src/**/*.tsextensions-builtin/sdnext-kanvas/src/**/*.tsextensions-builtin/sdnext-kanvas/javascript/kanvas.mjsFor every Python _js usage, confirm:
window.<name> or otherwise accessible as a global function.ui/globals.d.ts.For all extension JavaScript code under extensions/*/javascript, confirm:
ui/globals.d.ts remains the source of truth for Python-visible UI globals._js= Bindingsmodules/, scripts/, and extensions/ for _js= occurrences.This is the most complex part as _js can be assigned a direct string, a formatted string, or an inline function. Focus on extracting the intended callback name(s) for verification in the next steps.
Examples:
_js="send_to_kanvas"
_js=f"switch_to_{binding.tabname}"
_js=f'(x, y, i, j) => [x, y, ...selected_gallery_files("{tabname}")]'
_js='() => gallerySort("name")'extensions/*/javascript, extensions-builtin/*/src, and the specific entry point extensions-builtin/sdnext-kanvas/javascript/kanvas.mjs for functions that attach to window.ui/, extensions-builtin/sdnext-modernui/src/, extensions-builtin/sdnext-kanvas/src/, and extensions/*/javascript/ for each callback name.window as window.<name> = ... or equivalent.() => quickSaveStyle(), ensure the referenced helper exists and any helper used for Python integration is also globally available if needed.ui/globals.d.ts and verify each Python-visible global callback name is declared.window.<name> = <function> in the appropriate JavaScript source file.ui/globals.d.ts entries, add a declaration like declare global { function <name>(...args: any[]): any; } with appropriate types if possible.pnpm eslint to ensure there are no linting errors.pnpm tsc to ensure there are no type errors, which can catch missing or mismatched declarations.pnpm build to ensure the extension builds correctly with the new or updated JavaScript code.And fix any issues that arise from these checks.
Report findings with:
_js referenceui/globals.d.ts declaration statusIf no issues are found, state that the Python/JS UI binding audit is clear and mention whether any dynamic _js strings remain unresolved.
When this skill is used, return:
_js bindings inspectedui/globals.d.ts entries_js cases that require manual review058a7f0
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.