set-validation-code

Set JavaScript validation code on attribute definitions via novadb_cms_update_objects.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/novadb/claude-plugins --skill set-validation-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: set-validation-code
Source: https://github.com/novadb/claude-plugins/tree/main/consulting/skills/set-validation-code
Command: npx skills add https://github.com/novadb/claude-plugins --skill set-validation-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Setting validation logic directly on attribute definitions can be error-prone and inconsistent when done manually or across environments. This Skill centralizes the process of applying JavaScript validation code (attribute 1008) to attribute definitions so input is validated server-side and consistent across branches.

Core Features & Use Cases

  • Apply Validation Code: Update an existing attribute's validation script to enforce input rules at the server level.
  • Structured API Usage: Uses novadb_cms_update_objects format with branch, object meta, and CmsValue entries (attribute 1008, language 0, variant 0).
  • Use Case: Enforce country code formats or non-negative numeric constraints by placing concise JavaScript checks on attribute definitions.

Quick Start

Set the JavaScript validation code on the target attribute by calling novadb_cms_update_objects with the branch ID, the attribute meta.id and typeRef 10, and a values array containing attribute 1008 with the validation script.

Frequently Asked Questions about set-validation-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add server-side JavaScript validation to an attribute definition?

You add server-side JavaScript validation by updating an existing attribute definition via the novadb_cms_update_objects tool, setting a JavaScript validation string as the value for attribute 1008 on a specific branch.

What is server-side attribute validation used for in a CMS?

Server-side attribute validation enforces consistent input checks, such as country code formats or non-negative numeric constraints, by placing concise JavaScript validation code directly on attribute definitions across environments.

What parameters are required to set validation code on an attribute?

Setting validation code requires a branch ID, the attribute meta.id with typeRef 10, and CmsValue entries with language 0 and variant 0. The JavaScript validation string is provided as the value for attribute 1008.

Can I set validation code on a newly created attribute definition?

No, this server-side JavaScript validation applies only to existing attribute definitions. You must update values on an already defined attribute with typeRef 10 via the novadb_cms_update_objects tool on a specific branch.

Why does my attribute validation code not work across different branches?

Attribute validation code applies per branch because the update call requires a specific branch ID. You must individually target each branch using the novadb_cms_update_objects tool to apply the JavaScript validation string consistently.