- Skill ID
- hustcer/nushell-pro/nushell-pro
- Publisher
- hustcer
- Repository
- nushell-pro
- Installs
- 0
- Files
- 22
- Synced
- Sep 23, 2026
Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.
hustcer/nushell-pro/nushell-proInstalls these files- .claude/skills/darwin-skill/results.tsv
- .gitignore
- README.md
- SKILL.md
- docs/nushell-0.114-fact-check-independent.md
- docs/scripting-validation-evidence.md
- references/advanced-patterns.md
- references/anti-patterns.md
- references/bash-to-nushell.md
- references/daemon-and-e2e-smoke-tests.md
- references/data-and-types.md
- references/dataframes.md
- references/modules-and-scripts.md
- references/nu-0.114-migration.md
- references/nu-0.115-migration.md
- references/script-review.md
- references/security.md
- references/string-formats.md
- test-prompts.json
- tests/nu-0.115-smoke.nu
- tests/strings-and-validation-smoke.nu
- tests/validation-and-daemon-smoke.nu
What this skill tells the agent
Nushell Pro
Write secure, idiomatic, portable, and testable Nushell. Keep the main workflow in this file; load detailed references only when the task needs them.
Operating Workflow
- Identify the task: new script, debugging, review, refactor, module design, migration, performance work, security audit, or Bash conversion.
- Read the target
.nufiles, nearby tests,AGENTS.md, and existing project conventions before changing code. - Establish both the project's supported Nu range (from CI, documentation, or project configuration) and the active local version. Do not assume the local binary defines the compatibility target. Prefer the official English docs; translations can lag. When local docs/source checkouts are available, inspect them and record their revision separately from the installed Nu version. From any shell, prefer:
nu --versionWhen already inside Nushell or when structured version data is needed, use:
version | get version- Load the smallest relevant reference set:
| Task | Reference |
|---|---|
| Nu 0.115 migration, YAML, CLI args, command changes | Nu 0.115 Migration |
| Nu 0.114 migration and version compatibility | Nu 0.114 Migration |
| Strings, regex/globs, generated JS/JSON | String Formats |
| Security, paths, credentials, destructive operations | Security |
| Script/code review | Script Review and Anti-Patterns |
| Bash/POSIX conversion | Bash to Nushell |
| Modules, exports, scripts, tests | Modules & Scripts |
| Daemons, background jobs, E2E smoke tests | Daemon & E2E Smoke Tests |
| Types, records, lists, conversions | Data & Type System |
| Streaming, closures, performance, diagnostics | Advanced Patterns |
| Large columnar data | Dataframes |
| Common mistakes | Anti-Patterns |
- Apply the cross-cutting guardrails below before style or performance cleanup.
- Before a generated script's first real run, use
nu-check --debugin the intended scope. Assert exact output for tricky strings/serialized payloads, then run the relevant tests; parsing alone cannot detect unintended but valid interpolation. Use--ide-checkwhen structured diagnostics are needed. - Report security/correctness findings before style and performance notes.
If a referenced file is unavailable, say so and continue with this file rather than inventing its contents.
Cross-Cutting Guardrails
These rules apply across task types. Load the routed reference before relying on syntax or behavior that changed between Nushell releases.
Types and pipeline contracts
- Declare pipeline input in the I/O signature rather than as a positional parameter. Capture
$inonce when it must be reused because streams can be single-pass. - Type exported command parameters and input/output signatures.
- Treat external/config records as untrusted; use optional access such as
$record.field?and validate the resulting type/value. - Remember that
defaultevaluates its fallback argument eagerly. Make the fallback null-safe or branch explicitly when it can fail or is expensive. - Keep return types consistent. Avoid
anyunless the function is genuinely polymorphic. - Use
external_argonmainparameters only when the CLI must preserve the caller's token spelling instead of applying Nushell literal coercion. It producesglob/list<glob>values in Nu 0.115, so validate or convert them before treating them as structured application data. - Prefer
matchfor several branches on one value; useiffor one-off boolean predicates.
External commands and errors
- Pass external arguments as separate values, never as an interpolated command string. Use
completeand checkexit_codewhen status matters. - Prefer
try/catchand$err.detailsfor structured in-process errors. - On Nu 0.115, a spanned
error makelabel has the shape{text: ..., span: {start: ..., end: ...}}. Do not use the obsolete flat{text, start, end}form. - On Nu 0.115.0, a
try/finallynested directly inside an outertrywhose handler iscatchsilently skips the innerfinally. Give the outer block afinally, or put the inner one behind ado/command boundary, and assert that the owned state is gone. - Treat rendered nested-Nu diagnostics as presentation text, not a stable protocol. For CLI tests, normalize ANSI styling, gutters, and PTY wrapping before matching a long, domain-specific phrase.
Security stop checkpoint
Before approving code that executes commands, deletes files, reads credentials, or accepts paths/patterns, confirm these boundaries:
- Never pass untrusted strings to
nu -c,source,run,^sh -c,^bash -c, or^cmd.exe /C. - Pass external command arguments as separate values, not an interpolated shell command string.
- For existing paths restricted to a base directory, expand both paths and use
path relative-toto prove containment. A stringstarts-withcheck is unsafe because/safe/base2starts with/safe/base. - Prefer Nu's built-in
mktemp/mktemp --directory; it is portable and returns a path directly. Do not use predictable temp names. - Scope secrets with
with-env; do not log them or pass them in argv when a stdin/config-file mechanism exists. - Guard destructive paths against root,
$nu.home-dir, unexpected types, and untrusted globs. Consider TOCTOU and partial-success behavior.
For output paths that do not exist yet, validate the existing parent directory with the same containment rule, then join only a validated leaf name.
Strings and formatting
- Prefer simple literals and raw regex strings; use double quotes only when actual escapes are required.
- Remember that
$'...'interpolates but does not process escape sequences. - A literal `(` directly inside interpolation requires `$"..."`. Since
$'...'does no escape processing, every(inside it opens an interpolation expression and\(cannot prevent that. Write$"\(abc)($var)", never$'\(abc)($var)'. The failure is often silent rather than an error:$'(1 + 1) items'evaluates to2 items. See String Formats. For generated code with many delimiters, join plain literal fragments and serialized data instead. - Keep code and data separate across interpreters: pass argv/stdin/JSON to a fixed program. If an API only accepts source, use a fixed, trusted template with target-language serialization; a single argv string is still code when
Use this skill in a project
Open any RiverX project, search the Skills panel for hustcer/nushell-pro/nushell-pro, and install it in one click.
