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.
In this repository16 other files it gives its agents.
- debug-remote-pipelineSkill
- dictateSkill
- dtcatSkill
- dtdiffSkill
- dtfilterSkill
- dtsetSkill
- esync-setupSkill
- hathifilesSkill
- hathitrust-lookupSkill
- julia-releaseSkill
- marginSkill
- mint-gh-tokenSkill
- pr-walkthroughSkill
- rendering-spec-docsSkill
- wrds-downloadSkill
- wrds-downloadSkill
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
- Distinctive: line 87
When multiple flags are combined, they apply in this fixed order regardless of CLI position:
- Very specific: line 108
Use --format json when piping to jq or other tools
- Very specific: line 114
Use nclq instead of nickel export | jq — it's shorter and stays in the nickel world
- Very specific: line 121
Check for optional fields with std.record.has_field "field_name" record
≈ “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.
Files
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.nclFlags
| Flag | Purpose |
--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 |
--raw | Strip quotes from string output |
--compact | Single-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) |
--desc | Descending sort (use with --sort-by) |
--unique <FIELD> | Extract unique values of a field |
--count | Return count instead of data |
--list-fields | List 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
| Code | Meaning |
| 0 | Success |
| 1 | Nickel evaluation error (stderr passed through) |
| 2 | Invalid arguments / usage error |
| 127 | nickel not found on $PATH |
Workflow
- Inspect file structure:
nclq data.ncl --list-fieldsor--list-fields --depth 2 - Count rows:
nclq 'rows' data.ncl --count - Filter:
nclq 'rows' data.ncl --where 'score>10' - Project and limit:
--fields id,name --limit 10 - Use
--format jsonwhen piping tojqor other tools - For complex queries, write the nickel expression directly
Key Notes
- The expression is standard nickel — use
std.array.filter,std.array.map,|>, etc. - Use
nclqinstead ofnickel export | jq— it's shorter and stays in the nickel world nclq file.nclwith 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) _fileis always available as the raw imported record in single-file mode--whereauto-detects value types from data (numbers, strings, bools, enums)--whereoperators:=!=><>=<=~(contains)- Check for optional fields with
std.record.has_field "field_name" record
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
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.

