Skip to content

docs(skill): refresh agent skill bundle for the 1.4.3 surface - #498

Merged
caomengxuan666 merged 2 commits into
masterfrom
chore/skill-refresh
Oct 22, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
chore/skill-refresh

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Summary

Full audit + refresh of the agent skill bundle (skills/niubash/). The bundle lagged master: the corpus transcript predated the GNU invocation face and the -EncodedCommand/--ec handoff (#477), and the prose still described the retired oh-my-niu stack (#145) and the managed-block rc era (#359).

Content-source layout (unchanged)

scripts/generate-skill.py owns the <!-- GENERATED --> regions in SKILL.md + references/quickref.md; everything outside markers is curated prose in the same files. Corpus = committed transcripts under crates/niubash-runtime/tests/fixtures/skill-corpus/ + the winuxcmd completion TOML inventory + Cargo.toml version. Version string was already single-sourced ([package] version) — no convergence needed there; the launcher-verb roster in the generated snapshot now also names config, migrate-rc, and the verbatim handoff.

Today's agent-facing changes — coverage check (all now documented)

Change Where it landed
-EncodedCommand/--ec verbatim handoff + v1: (#477) generated snapshot bullet, SKILL.md Validation, quickref host-verbs list
Gather wedge fix (rubash#955 + #484) SKILL.md "Behavior notes" — stray ) ends the gather, GNU diagnostic, rc 2
Bare drive D:/cd D: convergence (rubash#953; #481/#483) SKILL.md pitfalls + paths.md row
Negative-cache invalidation (rubash#951) SKILL.md notes + wpm.md
unset of inherited env names (#943) SKILL.md notes
-c marker-zone literal passthrough (rubash#952/#948) SKILL.md notes
dolbrace span (rubash#977/#979) SKILL.md notes
Ordered-fd redirect diagnostics + ! { :; } (rubash#976/#940) SKILL.md notes
Bash patch 20 / CJK readline (rubash#957) SKILL.md notes

Other stale content corrected (predates today)

  • "82 of 83 suites" → 83/83 (2026-10-12 ledger: 62 byte-identical, 20 env-attributed, nameref residual = GNU's own coproc race).
  • bash.exe/sh.exe "forwarders" → hardlinks to niu.exe with argv[0] face dispatch ([P2][perf] bin\sh.exe and bin\bash.exe cost one extra process per -c invocation (17.6 ms) #377); shim only where hardlinks are impossible.
  • NIU_THEME/NIU_PLUGINS/~/.niubash/custom/oh-my-niu packs — retired (Interactive startup hangs on host-side async git-status thread; remove built-in git prompt + theme stack (owner decision) #145); prompt-plugins.md rewritten for PS1-ownership + spec/lockfile/generated-loader model (plugins.toml → sources/registry.toml → generated/plugins.niu, sourced before the rc, NIU_PLUGIN_LOADER=off, plugin migrate-rc).
  • Corpus help text: new Usage lines, GNU long/short option face, --install-wt-shortcuts, skill install|status, plugin migrate-rc, portal lines, "primary-only; no automatic legacy migration" Configuration wording.
  • niu doctor row coverage updated (now incl. generated loader + agent-skill install).
  • check-rename-clean.baseline regenerated: drops the retired ~/.winuxshrc migration help line, records the intentional WINUXSH_SHELL mention in SKILL.md, and absorbs docs/src/*.md residue already committed on master.

Notes for reviewers

  • Corpus was recaptured from a worktree debug build whose [patch]-routed rubash resolved to the local checkout (1.4.1 @ a83a09d3 — the cargo build --locked pin 25b0850d is unreachable offline). Verified git diff a83a09d3 25b0850d -- src/usage.rs is empty and builtin-short-help.txt came out byte-identical, so the transcript matches the pinned engine's surface.
  • niubash-skill-v1.4.3.zip is packed from skills/niubash/ at release time — the published asset keeps the old content until the next release.
  • Out of scope but worth a follow-up: .niubashrc.example still documents the retired managed-block flow (plugin enable writing # >>> niu source blocks into the rc).

Test plan

  • python scripts/generate-skill.py --check → PASS
  • python scripts/test-skill-bundle.py → PASS (generated regions + embed manifest)
  • cargo test --test skill_bundle → 4/4 pass
  • sh scripts/check-rename-clean.sh → ALL CHECKS PASSED (baseline regenerated, diff reviewed)
  • git status clean of unrelated files (Cargo.lock transient downgrade from the local rubash [patch] reverted)

Generated with Devin

The corpus transcript predated the GNU invocation face and the verbatim
handoff, and the prose still described the retired oh-my-niu stack
(niubash#145) and the managed-block rc era (niubash#359).

- corpus: recapture `niu --help` (GNU long/short option face, verbatim
  handoff spellings --encoded-command/-EncodedCommand/--ec + v1:,
  --cwd-state, --install-wt-shortcuts, plugin migrate-rc, skill
  install|status, portal lines, primary-only rc wording)
- SKILL.md: 83/83 suite ledger (2026-10-12 re-run), argv[0] hardlink
  faces, generated-loader startup (before rc, NIU_PLUGIN_LOADER=off,
  migrate-rc), NIU_SHELL+SHELL exports, behavior notes for the gather
  wedge / bare-drive / negative-cache / unset-inherited / marker-zone /
  dolbrace / ordered-fd / CJK-readline fixes, verbatim handoff for hosts
  that cannot quote
- references: prompt-plugins.md rewritten for the spec+lockfile+loader
  model; paths.md gains bare drive designators; wpm.md notes same-session
  visibility of fresh installs; quickref.md gains the host-level verbs
- generate-skill.py: capability snapshot names `config`, the verbatim
  handoff, and `migrate-rc`
- check-rename-clean.baseline regenerated: drops the retired winuxshrc-
  migration help line, absorbs docs/src residue already on master, and
  records the intentional WINUXSH_SHELL mention in SKILL.md

Refs niubash#474 #477 #481 #482 #483 #484 #490 #943 #948 #952 niubash#359
Refs rubash#940 #947 #951 #952 #953 #955 #957 #976 #977 #979

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@caomengxuan666

Copy link
Copy Markdown
Member Author

Reviewed against a self-built worktree of this head (f7e009d) with rubash resolved to the lock content (worktree at 25b0850d; git diff a83a09d3 25b0850d -- src/usage.rs confirmed empty, as the PR body claims). Every claim below was executed against that build. One factual over-claim to fix before merge — everything else passes.

Blocker: SHELL export over-claim (SKILL.md, "When NIU_SHELL matters")

New wording says Niubash exports NIU_SHELL "(and SHELL, the POSIX-convention variable agents probe) with its own niu.exe path in every process it starts". Only NIU_SHELL is unconditional. SHELL is filled only when the host left it unset (crates/niubash-runtime/src/shell.rs:330-344, gated on shell_was_missing); a parent-supplied SHELL passes through untouched:

$ SHELL=/from/parent/bash.exe niu -c 'printf "%s\n" "$SHELL"'
/from/parent/bash.exe            # NOT niu.exe
$ env -u SHELL niu -c 'printf "%s\n" "$SHELL"'
D:/.../niu.exe                   # filled, as claimed

Since this is precisely "the variable agents probe", the unconditional claim will mislead in any host that pre-sets SHELL (MSYS-spawned sessions, CI images). Suggested one-clause fix: "exports NIU_SHELL with its own niu.exe path in every process it starts, and fills SHELL — the POSIX-convention variable agents probe — with the same path when the host left it unset". Outside the GENERATED markers, so no regeneration needed.

Verified PASS (built binary, niu --help + live runs)

Naming discipline — PASS

  • The refreshed bundle contains exactly one old-name spelling: SKILL.md's "WINUXSH_SHELL is a deprecated bridge the engine still reads — do not build on it." Accepted as a faithful, explicitly-demotion record of pre-existing engine behavior (src/main.rs:207-216 sets it; the rubash bash face keeps it in its fallback chain) — the same category as the excepted legacy-fallback documentation, and materially better than omitting it (agents will see the variable in env). The baseline row recording it is the gate's correct output.
  • The PR removes the old ~/.winuxshrc migration line from the help corpus — net reduction of old-name exposure; "primary-only; no automatic legacy migration" matches the built binary's help.
  • Baseline absorption reviewed: the four docs/src/*.md rows exist verbatim on master (stale-baseline residue, correctly absorbed); --regen reproduces the committed baseline byte-for-byte.

Gates / CI

  • generate-skill.py --check PASS; test-skill-bundle.py PASS; cargo test --test skill_bundle 4/4; check-rename-clean.sh ALL CHECKS PASSED.
  • build-and-test fails on console_window_gate.rs:382 (detached_builtin_only_session_allocates_zero_conhosts) — identical failure on the base commit's own run (39695757387), i.e. inherited from master, not introduced (no Rust files touched). All other lanes green.
  • Diff scope clean: skill content sources, generated regions, corpus, baseline, generator only.
  • Version is already single-sourced ([package] version → 1.4.3); the generator change correctly extends the verb roster.

Fix the SHELL clause (one line) and this is ready to merge. The .niubashrc.example managed-block staleness is filed separately as #499.

NIU_SHELL is exported unconditionally, but SHELL is backfilled with the
niu.exe path only when the host left it unset (shell.rs shell_was_missing
gate); a parent-supplied SHELL passes through. Aligns the NIU_SHELL
paragraph with the actual behavior per review on #498.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@caomengxuan666

Copy link
Copy Markdown
Member Author

Blocker fixed in ba92d92 — the SHELL clause now matches shell.rs:330-344 exactly:

Niubash exports NIU_SHELL with its own niu.exe path in every process it starts, and fills SHELL — the POSIX-convention variable agents probe — with the same path when the host left it unset

NIU_SHELL unconditional (src/main.rs:212-218), SHELL gated on shell_was_missing — parent-supplied values pass through. Verified:

  • python scripts/generate-skill.py --check — PASS
  • python scripts/test-skill-bundle.py — PASS
  • sh scripts/check-rename-clean.sh — ALL CHECKS PASSED (baseline regenerated; diff is only the re-wrapped WINUXSH_SHELL residue line)

The build-and-test console_window_gate failure is the inherited master flake noted in the review — untouched here.

@caomengxuan666
caomengxuan666 merged commit 4815207 into master Oct 22, 2026
8 of 9 checks passed
@caomengxuan666
caomengxuan666 deleted the chore/skill-refresh branch October 30, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant