Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Handsontable Validator Dev?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/handsontable-handsontable-validator-dev)
---
name: handsontable-validator-dev
path: handsontable/src/validators/**
description: Use when creating or modifying a Handsontable cell validator - async callback-based validation functions that determine if cell values are valid
---
# Handsontable Validator Development
## Signature
```js
function myValidator(value, callback) {
// `this` is bound to the cell's cellProperties object
if (this.allowEmpty && (value === null || value === undefined || value === '')) {
return callback(true);
}
callback(isValid(value)); // true = valid, false = invalid
}
```
## Rules
- Call the callback on every path; a missed call hangs the validation pipeline and silently blocks editing.
- `this` is `cellProperties`: use `this.allowEmpty`, `this.instance`, other cell meta. Use a `function` body, not an arrow function (arrows break the `this` binding).
- Validators only determine validity; data, DOM, and cell state stay untouched.
- The callback may run after async work; the editor stays in WAITING state until it resolves.
## Files
```
src/validators/{validatorName}/
{validatorName}.ts # Validator function
index.ts # Re-exports
```
Registry: `src/validators/registry.ts`.
```js
import { registerValidator } from '../../validators/registry';
registerValidator('myValidator', myValidator);
```
A new built-in validator also needs its entry in `src/validators/features.json` (`validator:<name_in_snake_case>`, `licensing: "none"`; copy a neighbor), and a cell type that uses it lists it in its `requires.allOf`. The unit suite fails until both exist. A validator folder that is never registered under a name (`maxLengthValidator`, `regExpValidator`) goes in the skip list of `scripts/utils/feature-manifest.js` instead, with the reason. Run `npm run generate:feature-manifest --prefix handsontable` and commit what it writes. Rules: `src/featureManifest/AGENTS.md`.
## Triggers
- The editor system during `finishEditing()`.
- `validateCells()`, `validateRows()`, `validateColumns()`.
- Invalid cells get the `htInvalid` class from the renderer pipeline, not the validator.
## Reference implementations
- `src/validators/numericValidator/numericValidator.ts` - `allowEmpty` support.
- `src/validators/dateValidator/dateValidator.ts`
- `src/validators/autocompleteValidator/autocompleteValidator.ts` - list of allowed values.
## Correcting cell values inside a validator
When a validator writes a corrected value with `setDataAtCell`, pass a source string ending in `'Validator'`:
```js
this.instance.setDataAtCell(row, col, correctedValue, 'myCustomValidator');
```
`validateChanges()` in `core.ts` uses the suffix to fold the correction into the change that triggered it, so that change still applies with the corrected value and fires `afterChange`. Without it, the correction is a separate write that wins over the triggering change (the last write to a cell wins), and the triggering change is dropped with no `afterChange`.
## Common mistakes
- Reading a meta flag that an editor forces in `prepare()`. `DropdownEditor.prepare()` writes `strict = true` onto the one cell it prepares, only while selected. A validator reading `this.strict` sees the column's own `strict: false` on every cell never clicked (paste, `setDataAtCell()`, `validateCells()`, any `updateSettings()` that rebuilds cell meta), which made a `strict: false` dropdown strict only in clicked cells (DEV-2911). For fixed cell-type behavior, pass it to the shared logic explicitly: `dropdownValidator` calls `validateAgainstSource(this, value, callback, true)`. Test by writing to a cell that was never selected; selecting it first hides the bug.