Skip to content
Back to skills

Model Validation

ASecurity

glTF model validation and reporting features. Use when: modifying validation logic, customizing validation reports, changing severity handling, adding new validation checks, fixing validator UI, or working with gltf-validator integration.

  • 7 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 7, 2026
toolstestinggit

Works with

  • cli

Security analysis

A100/100

Scanned June 7, 2026

npx -y skills add nirholas/three-ui --skill model-validation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Model Validation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Model Validation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nirholas-model-validation/badge)](https://www.skillsdirectory.com/skills/nirholas-model-validation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: model-validation
description: 'glTF model validation and reporting features. Use when: modifying validation logic, customizing validation reports, changing severity handling, adding new validation checks, fixing validator UI, or working with gltf-validator integration.'
argument-hint: 'Describe the validation change or feature'
---

# Model Validation

## When to Use

- Modifying how glTF models are validated
- Changing validation report display or formatting
- Adding/removing severity levels or message grouping
- Fixing validator toggle or report lightbox UI
- Extending metadata extraction from validated models
- Working with the `gltf-validator` library

## Architecture

```
src/validator.js                    → Validator class: runs validation, processes reports
src/components/validator-toggle.jsx → Status badge (error/warning/info/hint counts)
src/components/validator-report.jsx → Full report lightbox with metadata + issue tables
src/components/validator-table.jsx  → Individual issue severity table rendering
```

## Validation Flow

1. **App** calls `validator.validate(rootFile, rootPath, assetMap, response)` after model loads
2. **Validator** fetches the model bytes via `fetch()` → `ArrayBuffer`
3. Calls `validateBytes()` from `gltf-validator` with external resource resolver
4. Processes the report: groups messages, extracts metadata, computes max severity
5. Renders `ValidatorToggle` — a clickable badge showing issue counts
6. On click → renders `ValidatorReport` in a lightbox overlay

## Severity Levels

| Index | Level    | CSS Class                 |
| ----- | -------- | ------------------------- |
| 0     | Errors   | `report-toggle--errors`   |
| 1     | Warnings | `report-toggle--warnings` |
| 2     | Infos    | `report-toggle--infos`    |
| 3     | Hints    | `report-toggle--hints`    |

Messages are grouped by `code` and `message` text. Grouped messages show a count badge.

## Key Methods

| Method                          | Purpose                                                              |
| ------------------------------- | -------------------------------------------------------------------- |
| `validate()`                    | Entry point — fetches model, runs validator, sets report             |
| `resolveExternalResource()`     | Resolves URIs for multi-file glTF validation                         |
| `setReport()`                   | Processes raw validator output, groups messages, updates UI          |
| `setResponse()`                 | Extracts metadata (generator, title, author, license) from glTF JSON |
| `showToggle()` / `hideToggle()` | Controls visibility of the validation badge                          |

## Components (vhtml JSX)

Components are **pure functions** returning HTML strings via `vhtml`:

- **ValidatorToggle(report)** — Badge with severity icon + counts
- **ValidatorReport(report)** — Full report: metadata table + issue tables per severity
- **ValidatorTable(messages)** — Table rows for a single severity group

## Procedure

1. Validation logic changes → edit `src/validator.js`
2. Report display changes → edit the relevant component in `src/components/`
3. Styling → edit `.report-toggle`, `.report` classes in `style.css`
4. Test by dropping a glTF/GLB file and clicking the validation badge
5. Use [glTF Sample Models](https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/) for testing

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.