docs/agi/skills/jsgui3-control-creation/SKILL.md
# Skill: jsgui3-control-creation ## Scope Create new UI controls following jsgui3 patterns, conventions, and theme system integration. **Does:** - Scaffold new control class files. - Apply correct naming conventions (Camel_Case for classes, snake_case for methods). - Set up SSR-safe guards. - Integrate with theme system using `themeable` mixin. - Create accompanying SASS/CSS with CSS variable hooks. - Generate TypeScript declaration files (.d.ts). **Does Not:** - Handle complex data binding (
npx skillsauth add metabench/jsgui3-html docs/agi/skills/jsgui3-control-creationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create new UI controls following jsgui3 patterns, conventions, and theme system integration.
Does:
themeable mixin.Does Not:
Matrix, Color_Picker).Control).controls/organised/).Review: controls/organised/ for similar controls
Review: AGENTS.md for naming conventions
Review: themes/variants.js for variant patterns
Before creating the control, define what params it accepts:
// In themes/variants.js, add to param_schemas:
const <control>_schema = {
size: ['small', 'medium', 'large'],
variant: ['primary', 'secondary', ...],
// ... control-specific params
};
Add built-in variants to themes/variants.js:
const <control>_variants = {
'default': {
size: 'medium',
// ... default param values
},
'<variant_name>': {
// ... variant-specific values
}
};
// Add to variants object:
const variants = {
// ... existing
<control>: <control>_variants
};
controls/organised/<category>/<control_name>.js<Control_Name> (Camel_Case)snake_case (e.g., get_value, set_value)const Control = require('<path>/html-core/control');
const { themeable } = require('<path>/control_mixins/themeable');
class <Control_Name> extends Control {
constructor(spec) {
super(spec);
this.__type_name = '<control_name>';
this.add_class('<control-name>');
// Theme integration
const params = themeable(this, '<control_name>', spec);
// Compose using params
if (!spec.abstract && !spec.el) {
this._compose(params);
}
}
_compose(params) {
const { context } = this;
// Use params.size, params.variant, etc.
// Apply CSS variable hooks from token maps
}
}
// Static CSS (optional)
<Control_Name>.css = `
.<control-name> {
/* Use CSS variables for theming */
height: var(--<control>-height);
padding: var(--<control>-padding);
}
/* Variant-specific styles via data attributes */
.<control-name>[data-variant="primary"] {
/* ... */
}
`;
module.exports = <Control_Name>;
activate() {
if (typeof window === 'undefined') return;
super.activate();
// DOM-dependent code here
}
controls/organised/<category>/<control_name>.d.tsimport { Control } from '<path>/html-core/control';
import { ControlSpec } from '<path>/types/control-spec';
export interface <Control_Name>Params {
size?: 'small' | 'medium' | 'large';
variant?: 'primary' | 'secondary';
// ... param types
}
export interface <Control_Name>Spec extends ControlSpec<<Control_Name>Params> {
// Control-specific spec properties
}
export declare class <Control_Name> extends Control {
constructor(spec?: <Control_Name>Spec);
// Public methods
}
If the control uses size/spacing tokens, add to themes/token_maps.js:
const SIZE_TOKENS = {
// ... existing
<control>: {
small: { '--<control>-height': '28px', ... },
medium: { '--<control>-height': '36px', ... },
large: { '--<control>-height': '44px', ... }
}
};
controls/organised/<category>/<control_name>.scss.<control-name> {
height: var(--<control>-height, 36px);
&[data-size="small"] { ... }
&[data-size="large"] { ... }
&[data-variant="primary"] { ... }
}
Add export to the appropriate controls index file.
// test/controls/<control_name>.test.js
require('../setup');
describe('<Control_Name>', () => {
it('creates with default variant', () => { ... });
it('respects variant param', () => { ... });
it('applies theme context params', () => { ... });
});
themeable mixin called in constructorthemes/variants.jstools
# Skill: ui-pick-prompting ## Scope Use the ui-pick tool to present structured choices to the user. **Does:** - Show GUI picker with options. - Wait for user selection. - Return structured result (selection, cancelled, etc.). **Does Not:** - Handle complex multi-step wizards. - Manage state between prompts. ## Inputs - Options array (strings or objects with label/value/description). - Theme (optional): `wlilo` (dark) or `bright` (light). ## Procedure ### Via HTTP (Current Session) ```power
development
# Skill: typescript-types ## Scope Create and maintain TypeScript declaration files (.d.ts) for jsgui3-html components. **Does:** - Generate .d.ts files for controls and modules - Define interfaces for specs, params, and return types - Update package.json exports for TypeScript consumers - Maintain backward compatibility with JavaScript users **Does Not:** - Convert source files to TypeScript - Add runtime type checking - Handle complex generic patterns ## Inputs - File or module to type (e.
development
# Skill: theme-system-integration ## Scope Add theme support to existing controls or integrate theming into new features. **Does:** - Define params schemas for controls - Register variants in the variant registry - Integrate `resolve_params` for merge priority - Add CSS variable hooks and data attributes - Test theme inheritance and override behavior **Does Not:** - Create controls from scratch (see jsgui3-control-creation skill) - Handle runtime theme switching animations ## Inputs - Contro
testing
# Skill: session-discipline ## Scope Maintain structured notes across agent sessions to ensure continuity and knowledge transfer. **Does:** - Initialize session folders with standard structure. - Track active work, findings, and follow-ups. - Enable future agents to resume work seamlessly. **Does Not:** - Persist state between AI context windows (that's the purpose of the docs). - Replace version control (still commit changes). ## Session Structure Each session lives in `docs/sessions/<date