Skip to content

docs(nushell): address review findings on the conventions - #22

Merged
hakula139 merged 1 commit into
mainfrom
docs/nushell-skill-review
Nov 10, 2026
Merged

hakula139 merged 1 commit into
mainfrom
docs/nushell-skill-review

Conversation

@hakula139

@hakula139 hakula139 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

The nushell skill's stream trap now states the general pattern behind it, the traps gain a top-level syntax section and a separate environment section, and several examples and labels match the skill's own rules.

  • Stream errors: the trap now covers any command that pulls a stream item and discards it, which drops that item's exit or error make, with get <n>, last, skip, drop, and select as examples. It keeps the nushell/nushell#19463 link, points to nushell/nushell#19467 for the full list of affected commands, and adds collect before the command as the way to surface the error, while first stays the way to take a single match.
  • Quoting example: into datetime --format "%s" uses double quotes, as the skill's quoting rule asks. The remaining single-quoted examples hold a backslash (the regex piece), name the $'...' syntax, or show script arguments as shell input.
  • Trap sections: ### Syntax now opens the traps, ### Parsing and data becomes ### Data and types with its #### Streams and commands renamed to #### Commands, and the $nu.home-dir trap moves into its own ### Environment after External commands.
  • Test files: the Layout bullet becomes Location and names the file <name>.test.nu, matching the runner's <name>.stub.nu, and its subsection becomes "Files and assertions".
  • Module order: sections follow the order the entry first calls them, and the sentence on test-file order is gone, since the code-layout skill already orders tests by the code's order.
  • Imports example: the listed commands use invented names, use ./paths.nu [path-split path-label].
  • Timestamps: the bullet now gives the reason a test sets TZ for the child process, since the running Nushell reads its zone only at startup.

Bump hakula-languages to 1.0.7.

Test plan

  • Commit and push hooks, and nix develop -c run-hooks
  • nix flake check --all-systems
  • claude plugin validate .
  • On the dev shell's Nushell 0.116.1, with mk n as [1 2 3] | each {|x| if $x == n { error make {msg: boom} } else { $x } }, mk 3 | drop 1, mk 1 | select 1, mk 1 | skip 1, mk 1 | get 2, mk 1 | last, mk 1 | last 2, and mk 1 | drop nth 0 print results and exit 0, while mk 1 | collect | skip 1, mk 3 | collect | drop 1, and mk 1 | collect | last raise boom
  • With a host zone of +0800, $env.TZ = "Asia/Tokyo" and with-env {TZ: "Asia/Tokyo"} { date now | format date "%z" } still print +0800 in-process, while a child ^$nu.current-exe under the same with-env prints +0900
  • GitHub CI: Linux, macOS, and CI Result

State the stream trap as a general pattern with `collect` as the remedy,
move the syntax and environment traps into their own sections, and fix
the quoting example, test-file naming, and the timestamp rationale.
@hakula139 hakula139 added the documentation Documentation changes label Nov 10, 2026
@hakula139 hakula139 self-assigned this Nov 10, 2026
@hakula139
hakula139 merged commit 220058d into main Nov 10, 2026
3 checks passed
@hakula139
hakula139 deleted the docs/nushell-skill-review branch November 10, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant