From all-skills
Defines typed configuration schemas using Nickel language with gradual typing and contracts. Validates YAML/JSON/TOML inputs, merges configurations, and exports to JSON/YAML/TOML formats.
npx claudepluginhub vinnie357/claude-skills --plugin alliumThis skill uses the workspace's default tool permissions.
Nickel is a configuration language designed to automate generation of static configuration files (JSON, YAML, TOML, XML). It combines gradual typing with runtime contracts to provide both static checking for complex logic and flexible validation for configuration data.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Nickel is a configuration language designed to automate generation of static configuration files (JSON, YAML, TOML, XML). It combines gradual typing with runtime contracts to provide both static checking for complex logic and flexible validation for configuration data.
Activate this skill when:
Nickel supports both static and dynamic typing. Mix typed and untyped code within the same configuration:
Contracts are runtime assertions that validate values satisfy specific properties. They act as schemas:
Number, String, Bool, Dyn, Array, record contractsstd.contract.one_of, std.contract.all_of)| operatorThe & operator merges records with symmetric semantics:
Add to mise.toml:
[tools]
nickel = "latest"
[tasks.validate-config]
script = "nickel eval config.ncl"
[tasks.export-config]
script = "nickel export --format json config.ncl"
cargo install nickel-lang-cli
nickel eval config.ncl
nickel eval config.ncl --output result.json
# Export to JSON
nickel export config.ncl --format json
# Export to YAML
nickel export config.ncl --format yaml
# Export to TOML
nickel export config.ncl --format toml
# Merge and export
nickel export base.json overrides.ncl --format yaml
nickel format config.ncl
nickel format --check config.ncl # Check without modifying
nickel repl
{
field1 = "value",
field2 = 42,
nested = {
key = "data",
}
}
let name = "app" in
let port = 8080 in
"Starting %{name} on port %{port}"
let ports = [8000, 8001, 8002] in
ports
let add = fun x y => x + y in
let result = add 2 3 in
result
let base_port = 8000 in
let debug = true in
{
port = base_port,
debug = debug,
}
Attach contracts to fields using |:
{
port | Number = 8080,
name | String = "my-service",
debug | Bool = false,
}
Nickel provides contracts for basic types:
# Number contract
value | Number
# String contract
value | String
# Boolean contract
value | Bool
# Dyn (dynamic) contract - never fails
value | Dyn
# Array contract
items | Array Number # Array of numbers
# Record contract
config | {port: Number, host: String}
Define contracts as functions that validate and return values:
# Port number validation (1-65535)
let Port = std.contract.from_predicate (
fun x => x >= 1 && x <= 65535
) in
{
port | Port = 8080,
}
let LogLevel =
fun label value =>
if std.array.elem value ["debug", "info", "warn", "error"]
then value
else std.contract.blame label
in
{
log_level | LogLevel = "info",
}
Use boolean contract combinators from std.contract:
# One of multiple contracts must match
value | std.contract.one_of [Contract1, Contract2]
# All contracts must match
value | std.contract.all_of [Contract1, Contract2]
# Negation
value | std.contract.not SomeContract
let config = import "config.yaml" in
config
let data = import "data.json" in
data
let settings = import "settings.toml" in
settings
let AppConfig = {
port | Number,
name | String,
debug | Bool,
} in
(import "app.yaml") | AppConfig
# Define schema
let ConfigSchema = {
app_name | String,
port | Number,
log_level | String,
database = {
host | String,
port | Number,
}
} in
# Import and validate
let imported = import "config.yaml" in
let validated = imported | ConfigSchema in
# Export as JSON
validated
let base = {
app_name = "service",
port = 8080,
} in
let overrides = {
port = 443,
} in
# Result: port = 443 (overrides takes precedence)
base & overrides
let base = {
database = {
host = "localhost",
port = 5432,
}
} in
let env_overrides = {
database = {
host = "prod.example.com",
}
} in
# Nested database.host overridden, port preserved
base & env_overrides
let defaults = {
port | default = 8080,
log_level | default = "info",
} in
let user_config = {
port = 3000,
} in
defaults & user_config # port = 3000, log_level = "info"
When using Nickel configurations:
nickel eval file.ncl to confirm validation works as expectednickel eval with actual data files to ensure format imports succeednickel export --format json to confirm merge semanticsConvert JSON Schema specifications to Nickel contracts:
# Generates Nickel contract from JSON Schema
json-schema-to-nickel schema.json > schema.ncl
Nickel is Topiary's configuration language. Topiary's language configuration uses languages.ncl:
# Topiary language configuration with Nickel
{
language = "rust",
formatting_rules = {
indent = 2,
}
}
Define validation and export tasks in mise.toml:
[tasks.config:validate]
description = "Validate configuration against schema"
script = "nickel eval config.ncl --output /dev/null && echo 'Valid'"
[tasks.config:export-json]
description = "Export configuration as JSON"
script = "nickel export config.ncl --format json --output config.json"
[tasks.config:export-all]
description = "Export in all formats"
script = """
nickel export config.ncl --format json --output config.json
nickel export config.ncl --format yaml --output config.yaml
nickel export config.ncl --format toml --output config.toml
"""