一键导入
linux
Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS, Linux, or any system with Bash/Zsh.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS, Linux, or any system with Bash/Zsh.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Use when writing Result-driven error handling in TypeScript — converting try/catch to typed Results, chaining fallible operations, recovering from errors without throwing, or wrapping throwing functions. Activates when the user mentions lib-result, Result/Ok/Err types, error handling patterns, or any TypeScript code that throws and would benefit from type-safe error handling, even if they don't name the library.
Node.js package manager with strict dependency resolution. Use when running pnpm specific commands, configuring workspaces via pnpm-workspace.yaml, or managing dependencies with catalogs, patches, overrides, config dependencies, or the global virtual store.
Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for "shadcn init", "create an app with --preset", or "switch to --preset".
Remove AI writing patterns from prose. Use when drafting, editing, summarizing, or reviewing text to eliminate predictable AI tells.
| name | linux |
| description | Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS, Linux, or any system with Bash/Zsh. |
Essential patterns for Bash on Linux/macOS. Load shell-strategy.md file before execution.
| Operator | Meaning | Example |
|---|---|---|
; | Run sequentially | cmd1; cmd2 |
&& | Run if previous succeeded | pnpm install && pnpm run dev |
|| | Run if previous failed | pnpm test || echo "Tests failed" |
| | Pipe output | ls | rg ".js" |
| Task | Command |
|---|---|
| List all | eza --all --color=never --icons=never --long --no-time --no-user --group-directories-first |
| Find files | fd . -e log ~/.local/share/opencode |
| File content | cat file.txt |
| First N lines | head -n 20 file.txt |
| Last N lines | tail -n 20 file.txt |
| Follow log | tail -f log.txt |
| Search in files | rg -iL "regex" *.js |
| File size | du -sh * |
| Disk usage | df -h |
| Task | Command |
|---|---|
| List processes | ps aux |
| Find by name | ps aux | rg -iN node |
| Kill by PID | kill -9 <PID> |
| Find port user | lsof -i :3000 |
| Kill port | kill -9 $(lsof -t -i :3000) |
| Background | pnpm dev & |
| Jobs | jobs -l |
| Bring to front | fg %1 |
| Tool | Purpose | Example |
|---|---|---|
rg | Search | rg "TODO" src/ |
sed | Replace | sed -i 's|old|new|g' file.txt |
awk | Extract columns | awk -F ' ' '{print $1}' file.txt |
cut | Cut fields | cut -d',' -f1 data.csv |
sort | Sort lines | sort -u file.txt |
uniq | Unique lines | sort file.txt | uniq -c |
wc | Count | wc -l file.txt |
| Task | Command |
|---|---|
| View all (not secure) | env or printenv |
| View all (secure) | env | rg -v 'api|key|secret' or printenv | rg -v 'api|key|secret' |
| View one | echo $PATH |
| Set temporary | export VAR="value" |
| Set in script | VAR="value" command |
| Add to PATH | export PATH="$PATH:/new/path" |
| Task | Command |
|---|---|
| Download | wget https://example.com/file |
| API request | curl -X GET https://api.example.com |
| POST JSON | curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' URL |
| Check port | nc -zv localhost 3000 |
| Network info | ip addr or ifconfig |
Use mkscript -f script.sh for a standard bash script in the selected path, mkscript -t to make a temporary script (lives in /tmp)
if command -v node &> /dev/null; then
echo "Node is installed"
fi
NAME="${1:-"default_value"}"
while IFS= read -r line; do
echo "${line}"
done < file.txt
for file in *.js; do
echo "Processing ${file}"
done
| Task | PowerShell | Bash |
|---|---|---|
| List files | Get-ChildItem | ls -la |
| Find files | Get-ChildItem -Recurse | find . -type f |
| Environment | $env:VAR | $VAR |
| String concat | "$a$b" | "$a$b" (same) |
| Null check | if ($x) | if [[ -n "${x}" ]] |
| Pipeline | Object-based | Text-based |
set -e # Exit on error
set -u # Exit on undefined variable
set -o pipefail # Exit on pipe failure
set -x # Debug: print commands
set +x # Unset debug mode
cleanup() {
echo "Cleaning up..."
rm -f '/tmp/tempfile'
}
trap cleanup EXIT
Remember: Bash is text-based. Use
&&for success chains,set -efor safety, and quote your variables!
This skill is applicable to execute the workflow or actions described in the overview.