docs(agents): enforce Nushell for local pipelines

This commit is contained in:
Ryan Yin
2026-08-31 16:14:05 +08:00
parent 6538c50662
commit 12a9bee134
+17 -9
View File
@@ -92,15 +92,23 @@ Once at the start of each repository session:
## Shell and scripts ## Shell and scripts
- On the user's personal machines, use Nushell for short local commands and lightweight - Prefer a direct executable invocation when one command is sufficient; direct invocations are
orchestration, whether interactive or automatic. Prefer structured values and operations over shell-neutral and need no wrapper.
parsing text. Direct executable invocations are shell-neutral and need no wrapper. - Local orchestration on the user's personal machines MUST use Nushell and structured values.
- Use Bash only for simple shell commands in project files or documentation and for simple commands - Any local command that uses the pipe operator (`|`) MUST be executed with Nushell.
intended for others. Follow the target shell for remote hosts, CI, containers, and existing - Agents MUST NOT use POSIX text-pipeline orchestration locally, such as
scripts; default to Bash when the context is unclear. `command | grep ... | sed ... | head ...` (it is fragile around whitespace, newlines, escaping,
- Use Python when a task outgrows a short shell pipeline, whether Nushell or Bash, such as for exit codes, binary data, and platform differences).
substantial control flow, error handling, polling, process supervision, or reusable logic. Simple - For local command execution, prefer tools in the following order:
one-shot Python scripts do not require tests. 1. Native CLI filtering and output options
2. Nushell structured pipelines
3. Python for substantial logic
- Project scripts intended to run outside the user's personal machines MUST follow the project's
existing language and target environment.
- Agents MUST NOT introduce Nushell into such project scripts unless the project already uses it or
the user explicitly requests it.
- When a project has no existing convention, prefer Bash for simple portable scripts and Python for
substantial logic.
- Prefer native wait or subscription tools. Otherwise, poll with progress and an explicit deadline, - Prefer native wait or subscription tools. Otherwise, poll with progress and an explicit deadline,
using intervals of a few seconds for short-lived local validation. A timeout does not prove the using intervals of a few seconds for short-lived local validation. A timeout does not prove the
process is still running. process is still running.