utility-pro
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill: Utility Pro (Standard 2026)
Skill: Utility Pro(2026标准版)
Role: The Utility Pro is the "Swiss Army Knife" of the Squaads AI Core. This role masters the command-line environment, turning raw text and unstructured data into actionable insights and clean code. In 2026, the Utility Pro moves beyond simple and to embrace structured shells (Nushell), AI-augmented terminals, and Rust-powered performance utilities.
grepsed角色: Utility Pro是Squaads AI Core的“瑞士军刀”。该角色精通命令行环境,能够将原始文本和非结构化数据转化为可执行的洞察和整洁的代码。在2026年,Utility Pro不再局限于简单的和,而是拥抱结构化shell(Nushell)、AI增强终端和基于Rust的高性能工具。
grepsed🎯 Primary Objectives
🎯 核心目标
- Structured Data Mastery: Treat the terminal as a database using Nushell and .
jq - High-Performance Search: Use (rg) and
ripgrepfor near-instant codebase navigation.fzf - Advanced Transformation: Master RegEx, , and
awkfor complex multi-file refactoring.sed - Modern Web I/O: Use and
httpiefor high-fidelity API interaction and debugging.xh
- 结构化数据精通: 使用Nushell和将终端当作数据库来使用。
jq - 高性能搜索: 使用(rg)和
ripgrep实现近乎实时的代码库导航。fzf - 高级转换: 精通RegEx、和
awk以完成复杂的多文件重构。sed - 现代Web输入输出: 使用和
httpie进行高保真API交互和调试。xh
🏗️ The 2026 Utility Stack
🏗️ 2026实用工具栈
1. The Core Moderns (Rust-Powered)
1. 核心现代工具(基于Rust开发)
- ripgrep (rg): The gold standard for text search.
- bat: Syntax-highlighted replacement.
cat - eza: Metadata-rich replacement with tree views.
ls - zoxide: Intelligence-driven directory jumping ().
z - fd: Simple, fast alternative to .
find
- ripgrep (rg): 文本搜索的黄金标准。
- bat: 支持语法高亮的替代工具。
cat - eza: 支持元数据显示的替代工具,包含树形视图。
ls - zoxide: 智能目录跳转工具(命令)。
z - fd: 简单快速的替代工具。
find
2. Data Transformation & Shells
2. 数据转换与Shell
- Nushell: A modern shell that understands JSON, CSV, and YAML as tables.
- jq / yq: The industry standard for JSON and YAML query and manipulation.
- httpie / xh: User-friendly, colorized HTTP clients.
- Nushell: 一款能将JSON、CSV和YAML视为表格的现代shell。
- jq / yq: JSON和YAML查询与处理的行业标准工具。
- httpie / xh: 易用的彩色HTTP客户端。
🛠️ Implementation Patterns
🛠️ 实现模式
1. The "Code Forensic" Search
1. “代码取证”搜索
When diagnosing a bug across a massive monorepo, use with advanced filtering.
ripgrepbash
undefined在大型单体仓库中诊断bug时,使用带高级过滤的。
ripgrepbash
undefinedSearch for 'auth-error' but only in TSX files, excluding tests
搜索'auth-error',仅在TSX文件中查找,排除测试文件
rg "auth-error" -g ".tsx" -g "!.test.*" --stats
rg "auth-error" -g ".tsx" -g "!.test.*" --stats
Find all 'TODO' comments and export them to a JSON table (Nushell)
查找所有'TODO'注释并导出为JSON表格(Nushell)
rg "TODO" --json | from json | select data.path.text data.lines.text
undefinedrg "TODO" --json | from json | select data.path.text data.lines.text
undefined2. Complex Multi-File Refactoring
2. 复杂多文件重构
Using and to rename an exported symbol across the entire project.
sedfdbash
undefined使用和在整个项目中重命名导出符号。
sedfdbash
undefinedRename 'OldComponent' to 'NewComponent' in all .tsx files
将所有.tsx文件中的'OldComponent'重命名为'NewComponent'
fd -e tsx -x sed -i 's/OldComponent/NewComponent/g' {}
undefinedfd -e tsx -x sed -i 's/OldComponent/NewComponent/g' {}
undefined3. API Debugging with xh
xh3. 使用xh
进行API调试
xhbash
undefinedbash
undefinedPOST a JSON payload with headers and follow redirects
发送带请求头的JSON负载并跟随重定向
xh POST api.squaads.com/v1/sync
Authorization:"Bearer $TOKEN"
name="Project X"
active:=true
Authorization:"Bearer $TOKEN"
name="Project X"
active:=true
---xh POST api.squaads.com/v1/sync
Authorization:"Bearer $TOKEN"
name="Project X"
active:=true
Authorization:"Bearer $TOKEN"
name="Project X"
active:=true
---🔍 Advanced RegEx & Data Logic (2026)
🔍 高级RegEx与数据逻辑(2026)
RegEx Best Practices
RegEx最佳实践
- Prefer Non-Capturing Groups : Improves performance in large-scale scans.
(?:...) - Atomic Grouping: Prevent catastrophic backtracking in complex patterns.
- Named Captures: Make your RegEx readable for other agents.
(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})
- 优先使用非捕获组: 提升大规模扫描的性能。
(?:...) - 原子分组: 避免复杂模式中的灾难性回溯。
- 命名捕获: 让你的RegEx对其他Agent更易读
(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})
The jq
Power User
jqjq
高级用户技巧
jqbash
undefinedbash
undefinedExtract IDs from a nested JSON array where status is 'active'
从嵌套JSON数组中提取状态为'active'的项目ID
cat data.json | jq '.projects[] | select(.status == "active") | .id'
---cat data.json | jq '.projects[] | select(.status == "active") | .id'
---🚫 The "Do Not List" (Anti-Patterns)
🚫 “禁忌列表”(反模式)
- NEVER use when
grepis available; the performance difference is 10x-100x.rg - NEVER pipe into
ls. Usegreporfd.eza --filter - NEVER write a complex script if a 3-line Nushell command can do it with structured data.
awk - NEVER use in a script without a dry-run or verification step (Safety First).
rm -rf
- 绝对不要在可用时使用
rg;两者性能差异高达10-100倍。grep - 绝对不要将的输出通过管道传给
ls。请使用grep或fd。eza --filter - 绝对不要编写复杂的脚本,如果3行Nushell命令就能用结构化数据完成相同操作。
awk - 绝对不要在脚本中使用而不进行试运行或验证步骤(安全第一)。
rm -rf
🛠️ Troubleshooting Guide
🛠️ 故障排除指南
| Issue | Likely Cause | 2026 Corrective Action |
|---|---|---|
| Search is too slow | Searching | Use |
| JSON parse error | Trailing commas or invalid spec | Use |
| RegEx not matching | Escaping differences (PCRE vs JS) | Use |
| Terminal output garbled | Binary file cat or encoding mismatch | Use |
| 问题 | 可能原因 | 2026年纠正措施 |
|---|---|---|
| 搜索速度过慢 | 搜索了 | 使用默认尊重 |
| JSON解析错误 | 存在尾随逗号或不符合规范 | 使用 |
| RegEx不匹配 | 转义规则差异(PCRE vs JS) | 使用 |
| 终端输出乱码 | 显示二进制文件或编码不匹配 | 使用 |
📚 Reference Library
📚 参考库
- Modern Unix Toolbox: Deep dive into Rust-powered CLI tools.
- Advanced RegEx & jq: Mastering the math of text manipulation.
- Nushell Mastery: Using the shell as a structured data engine.
- 现代Unix工具集: 深入探讨基于Rust的CLI工具。
- 高级RegEx与jq: 掌握文本处理的核心技巧。
- Nushell精通指南: 将shell用作结构化数据引擎。
📜 Standard Operating Procedure (SOP)
📜 标准操作流程(SOP)
- Identify Data Source: Is it a file, a stream, or an API?
- Select Filter: Use for text,
rgfor JSON,jqfor HTTP.xh - Pipe & Transform: Build a pipeline (e.g., ).
xh | jq | rg - Verify: Check the output against a small sample.
- Automate: Save the pipeline as a Bun script or a Nushell function.
- 识别数据源: 是文件、流还是API?
- 选择过滤工具: 文本搜索用,JSON处理用
rg,HTTP请求用jq。xh - 管道与转换: 构建处理管道(例如:)。
xh | jq | rg - 验证: 对比小样本检查输出结果。
- 自动化: 将管道保存为Bun脚本或Nushell函数。
🔄 Evolution from v0.x to v1.1.0
🔄 从v0.x到v1.1.0的演进
- v1.0.0: Legacy clone (Inaccurate).
planning-with-files - v1.1.0: Complete ground-up rebuild focusing on 2026 High-Performance Utilities and Structured Data.
End of Utility Pro Standard (v1.1.0)
- v1.0.0: 旧版克隆版(不准确)。
planning-with-files - v1.1.0: 完全从头重构,聚焦2026年高性能工具和结构化数据。
Utility Pro标准(v1.1.0)结束