shell-agent-file-ops
Skill này làm gì
Skill này giúp AI agent dùng shell agent cho công việc file, như tạo tài liệu hoặc cập nhật file cấu hình. Nó dành cho những người muốn nói rõ kết quả cần có thay vì chỉ cách làm.
Khi nào nên dùng
- ✓Khi bạn cần tạo hoặc thay đổi file mà cách làm tốt nhất chưa rõ.
- ✓Khi bạn muốn xử lý lỗi tự động và thử lại cho một công việc file.
- ✓Khi bạn muốn mô tả kết quả thay vì chọn các công cụ cụ thể.
Liên kết skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/shell-agent-file-ops/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Cập nhật mọi file cấu hình trong thư mục config của tôi để thêm timeout 300. Hãy để shell agent tự tìm cách làm.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đưa cho shell agent một nhiệm vụ bằng ngôn ngữ thường. Shell agent chọn Python hoặc Bash, viết và chạy mã, xử lý lỗi qua nhiều vòng thử lại rồi trả về kết quả.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Shell Agent File Operations
Purpose
Use shell_agent for file operations when you want the tool to autonomously decide how to accomplish the task (Python vs Bash, which commands to use, error recovery) rather than manually selecting specific tools like write_file or run_shell.
When to Use
Use this pattern when:
- You need to create, modify, or organize files
- The optimal approach (Python script, Bash commands, direct file write) is unclear
- You want automatic error handling and retry logic
- You prefer to describe what to accomplish rather than how
How to Use
Basic Pattern
Delegate to shell_agent with a clear natural-language task description.
Example: Create a Document File
Task description to shell_agent:
Create a comprehensive SOAP note file containing four sections:
Subjective, Objective, Assessment, and Plan. Include all relevant
patient visit details in a professional medical format.
The shell_agent will:
- Decide whether to use Python or Bash
- Write and execute the appropriate code
- Handle any errors automatically (up to several retry rounds)
- Return the result
Example: Modify Existing Files
Task description to shell_agent:
Update all configuration files in the config/ directory to add
a new setting "timeout: 300" under the general section.
Example: Complex File Operations
Task description to shell_agent:
Create a project structure with README.md, src/main.py, and
tests/test_main.py. Include appropriate content in each file
based on a Python data processing project template.
Best Practices
Be specific about content requirements - Describe what should be in the file(s), not just that files should be created.
Include format specifications - Mention desired formats (markdown, JSON, CSV, etc.) when relevant.
Specify file locations - Include paths when files should be in specific directories.
Let shell_agent handle complexity - Don't pre-decide the implementation approach; trust the autonomous selection.
Check the output - Review what shell_agent created to ensure it meets requirements.
Comparison: When NOT to Use This Pattern
Use direct tools instead when:
- You already know the exact command/script to run → use
run_shell - You have the exact file content ready → use
write_filedirectly - The operation is trivial (single-line file write) → use
write_file - You need fine-grained control over the implementation
Anti-Patterns to Avoid
❌ Don't over-specify the implementation:
Use Python to write a file called notes.md with this content...
✅ Do describe the desired outcome:
Create a notes.md file with comprehensive documentation about...
❌ Don't use shell_agent for simple direct operations:
Write "hello" to hello.txt
✅ Do use write_file directly for simple cases:
write_file(path="hello.txt", content="hello")
Summary
This pattern shifts focus from implementation mechanics to task intent, leveraging shell_agent's autonomous decision-making for file operations that benefit from intelligent tool selection and automatic error recovery.
Câu hỏi thường gặp
Nó có sửa được nhiều file cùng lúc không?
Có, ví dụ của skill cập nhật mọi file cấu hình trong một thư mục cùng lúc.
Nó xử lý những loại file nào?
Skill đưa ra ví dụ về tài liệu, ghi chú và file cấu hình.
Tôi có cần biết các lệnh không?
Không, bạn mô tả nhiệm vụ và shell agent sẽ xử lý các lệnh.
Chi tiết
Mô tả gốc của tác giả
Leverage shell_agent for autonomous file creation and modification with automatic tool selection and error recovery
repo: HKUDS/AgentPilot
Độ phổ biến
- Sao GitHub
- 7.8k
- Vị trí xếp hạng
- #12997
- Giấy phép
- MIT
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agentpilot
7.8kGiúp agent của bạn cải thiện dự án từng bước bằng cách chuẩn bị tác vụ và chạy vòng lặp AgentPilot, gồm đề xuất, kiểm thử và chấm điểm thay đổi.
openspace
7.8kGiúp agent của bạn thiết lập OpenSpace, công cụ lưu và lấy lại skill của agent, rồi kết nối nó với ứng dụng AI của bạn qua MCP.
rsi-arena
7.8kGiúp agent của bạn thiết lập và chạy các bài kiểm thử benchmark AI chuẩn, như AIME và Terminal-Bench, để so sánh các phương pháp cải tiến khác nhau.
experiment-guide
7.8kGiúp agent của bạn lên kế hoạch các thí nghiệm nhỏ, đọc kết quả và ghi lại phát hiện khi tìm cách cải thiện một chương trình.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.