agentleFS
LouLouLibsLouLouLibs/claude-skills/skills/nclq/SKILL.md

nclq

Skill1 starsChanged 59 days agoMITView on GitHub

Query, filter, inspect, and extract data from Nickel (.ncl) files using nclq. Use when the user asks to look at, count, filter, search, or analyze data inside .ncl files, or when you encounter a .ncl file and need to understand its contents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When multiple flags are combined, they apply in this fixed order regardless of CLI position:

    line 87
  2. Very specific:

    Use --format json when piping to jq or other tools

    line 108
  3. Very specific:

    Use nclq instead of nickel export | jq — it's shorter and stays in the nickel world

    line 114
  4. Very specific:

    Check for optional fields with std.record.has_field "field_name" record

    line 121

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

nclq — Nickel Query Tool

Query nickel files using nickel expressions. Top-level fields are automatically in scope — no import boilerplate needed.

Quick Reference

# View a file (auto-detect: no expression needed)
nclq data.ncl
nclq data.ncl --compact

# Single file — fields in scope
nclq '<expr>' file.ncl

# Multi-file — named bindings
nclq '<expr>' -f name1=file1.ncl -f name2=file2.ncl

# Stdin
... | nclq '<expr>'

# Count rows
nclq 'rows' data.ncl --count

# Filter rows (type auto-detected from data)
nclq 'rows' data.ncl --where 'score>10'
nclq 'rows' data.ncl --where agg_level=1 --where 'description~Revenue'

# Sort
nclq 'rows' data.ncl --sort-by score --desc --limit 3

# Unique values of a field
nclq 'rows' data.ncl --unique category

# Inspect structure
nclq data.ncl --list-fields
nclq data.ncl --list-fields --depth 3

# Project fields
nclq 'rows' data.ncl --fields id,name

# Limit output
nclq 'rows' data.ncl --limit 5

# JSON output
nclq 'rows' data.ncl --format json

# Raw string (no quotes)
nclq 'metadata' data.ncl --raw

# Compact single-line output
nclq 'std.array.first rows' data.ncl --compact

# Combined pipeline
nclq 'rows' data.ncl --where agg_level=1 --sort-by cogcs --fields cogcs,description --limit 10

# Cross-reference two files
nclq 'a.rows |> std.array.filter (fun r =>
       std.array.elem r.id (b.codes |> std.array.map (fun c => c.id)))' \
  -f a=data.ncl -f b=codes.ncl

Flags

FlagPurpose
--format <nickel|json|yaml|toml>Output format (default: nickel)
--fields <f1,f2,...>Project only named fields from results
--limit <N>Truncate arrays to first N elements
--rawStrip quotes from string output
--compactSingle-line output
-f <NAME>=<FILE>Bind a file to a name (multi-file mode)
--where <CONDITION>Filter: field=val, field>val, field~substr (repeatable, ANDed)
--sort-by <FIELD>Sort by field (type auto-detected from data)
--descDescending sort (use with --sort-by)
--unique <FIELD>Extract unique values of a field
--countReturn count instead of data
--list-fieldsList field names of the result
--depth <N>Depth for --list-fields (default: 1)

Pipeline Order

When multiple flags are combined, they apply in this fixed order regardless of CLI position:

where → sort-by → unique → fields → limit → count

--list-fields is a separate inspection mode (only --where composes with it).

Exit Codes

CodeMeaning
0Success
1Nickel evaluation error (stderr passed through)
2Invalid arguments / usage error
127nickel not found on $PATH

Workflow

  1. Inspect file structure: nclq data.ncl --list-fields or --list-fields --depth 2
  2. Count rows: nclq 'rows' data.ncl --count
  3. Filter: nclq 'rows' data.ncl --where 'score>10'
  4. Project and limit: --fields id,name --limit 10
  5. Use --format json when piping to jq or other tools
  6. For complex queries, write the nickel expression directly

Key Notes

  • The expression is standard nickel — use std.array.filter, std.array.map, |>, etc.
  • Use nclq instead of nickel export | jq — it's shorter and stays in the nickel world
  • nclq file.ncl with no expression just dumps the file (defaults to _file)
  • In single-file mode, top-level fields are bound directly (e.g., rows, metadata)
  • In multi-file mode, access fields through the binding name (e.g., data.rows)
  • _file is always available as the raw imported record in single-file mode
  • --where auto-detects value types from data (numbers, strings, bools, enums)
  • --where operators: = != > < >= <= ~ (contains)
  • Check for optional fields with std.record.has_field "field_name" record

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.