hive.terminal-tools-foundations
Skill này làm gì
Skill này giải thích cách AI chạy lệnh, đọc và chỉnh sửa file, và tìm kiếm thư mục trên máy tính của bạn. Skill dành cho người muốn AI làm việc trực tiếp trong một thư mục dự án.
Khi nào nên dùng
- ✓Khi AI cần chạy một lệnh, như build hoặc test, trên máy tính của bạn.
- ✓Khi bạn muốn AI tìm trong một dự án theo văn bản hoặc tên file.
- ✓Khi một tác vụ cần chỉnh sửa file trong thư mục dự án.
Liên kết skill
https://github.com/aden-hive/hive/blob/main/core/framework/skills/_preset_skills/terminal-tools-foundations/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
“Chạy các bài test trong thư mục dự án của tôi và cho tôi biết bài nào bị lỗi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI chạy lệnh trong một shell phù hợp với hệ thống của bạn, như Git Bash hoặc PowerShell, rồi đọc kết quả. AI cũng có thể tìm kiếm file và chỉnh sửa trong thư mục bạn đang làm việc.
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.
terminal-tools — foundations
These tools provide command execution, background jobs, log streaming, filesystem search, and optional PTY sessions. POSIX uses bash for shell commands; Windows selects Git Bash, PowerShell, then cmd. Inspect shell_kind in results.
Tool preference (read first)
Use search_tools(query="inventory") before describing capabilities. It reports this session's loaded, searchable, disabled, and configured-but-unavailable tools. Load searchable tools by exact name. An absent schema alone does not prove a capability is missing; configuration does not prove credentials or connectivity work. Terminal tools and coding file tools default to the injected session workdir; an explicit absolute path overrides it.
- Reading files → use
read_filebeforeedit_filewhen the coding tools are enabled; it records file state for the stale-edit guard. Otherwise use a command appropriate toshell_kind. - Editing files → prefer
edit_filewhen enabled. Replacement mode requires a unique match unlessreplace_all=true; patch mode validates all operations before writing. Inspect its changed-file summary and diff. Re-read files after external changes. Terminal editing remains available when coding tools are disabled. - Writing files → heredoc:
terminal_exec("cat > PATH <<'EOF' ... EOF") - Searching →
terminal_rg(content / regex grep) andterminal_glob(find files by name) - Browser / web pages → call
browser_setup, read the browser skill, then runhive-browser <command> --jsonthroughterminal_exec. - Web search → check the inventory for
web_searchand load it if available; verify required credentials. Do not invent a callable tool name. - System operations (process exec, jobs, PTYs) → terminal-tools. This is its territory.
The standard envelope
Every spawn-style call (terminal_exec, the auto-promoted job state) returns this shape:
{
"exit_code": 0, // null when auto-backgrounded or pre-spawn error
"stdout": "...", // decoded, truncated to max_output_kb (default 256 KB)
"stderr": "...",
"stdout_truncated_bytes": 0, // > 0 means more is in output_handle
"stderr_truncated_bytes": 0,
"runtime_ms": 42,
"pid": 12345,
"output_handle": null, // "out_<hex>" when truncated — paginate with terminal_output_get
"timed_out": false,
"semantic_status": "ok", // "ok" | "signal" | "error" — read THIS, not just exit_code
"semantic_message": null, // e.g. "No matches found" for grep exit 1
"warning": null, // e.g. "may force-remove files" for rm -rf
"auto_backgrounded": false,
"job_id": null, // set when auto_backgrounded=true
"shell_kind": "bash" // interpreter that ran it: "bash" | "powershell" | "cmd" | "direct"
}
Auto-promotion (the core mental model)
The agent loop first waits up to five seconds for terminal_exec. A slower call returns a bg_* handle; redeem it with collect_result. The terminal's own promotion threshold defaults to 30 seconds. Past that threshold it transfers the process to its job manager and returns:
{ "auto_backgrounded": true, "exit_code": null, "job_id": "job_<hex>", ... }
When you see auto_backgrounded: true, pivot to polling. The job is still running:
terminal_job_logs(job_id, since_offset=0, wait_until_exit=true, wait_timeout_sec=30)
→ blocks server-side until the job exits or the timeout, returns logs + status
You're not failing — you're freed up to do other work while the long task runs.
collect_result does not redeem job_id: after collecting a promoted call, use terminal_job_logs until status is exited. Track separate stdout/stderr offsets; use terminal_job_manage(action="signal_term", job_id=...) to cancel. Poll waits are capped at 45 seconds and do not extend execution deadlines. Job retrieval/management ship with basic exec; explicit job creation and PTYs require the advanced category.
timeout_sec defaults to 60 seconds from command start, including time after promotion. Expiry terminates the owned process tree; final logs report timed_out=true. A deadline at or before promotion kills inline. Set timeout_sec=0 for unlimited execution with promotion enabled. To keep execution foreground, set auto_background_after_sec=0 and a finite timeout of at most 220 seconds (or less if the caller has a smaller b
Câu hỏi thường gặp
Trên Windows, skill dùng shell nào?
Skill chọn Git Bash trước, sau đó đến PowerShell, rồi cmd, và kiểm tra loại shell trong mỗi kết quả.
AI có làm việc ngoài thư mục dự án của tôi được không?
Có. Một đường dẫn tuyệt đối rõ ràng sẽ ghi đè thư mục dự án mặc định.
AI có kiểm tra file trước khi sửa không?
Có. AI đọc file trước và dùng bước chỉnh sửa yêu cầu khớp duy nhất, trừ khi được yêu cầu khác.
Chi tiết
Mô tả gốc của tác giả
Required when terminal_* tools are available. Explains foreground execution, outer collect_result handles, promoted job IDs and their retrieval/cancellation, deadlines, output retention, platform shell selection, and structured editing when enabled.
repo: aden-hive/hive
Độ phổ biến
- Sao GitHub
- 11k
- Vị trí xếp hạng
- #11812
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
browser-edge-cases
11kGiúp agent của bạn sửa tự động hóa trình duyệt bị lỗi trên các trang khó như LinkedIn, X hoặc trang có nhiều script nặng.
hive.browser-automation
11kDạy agent của bạn điều khiển trình Chrome của chính bạn bằng công cụ hive-browser, dùng ảnh chụp màn hình và các thao tác nhấp chuột.
hive.colony-progress-tracker
11kGiúp agent của bạn nhận tác vụ và ghi lại các bước cùng kiểm tra của nó vào một cơ sở dữ liệu dùng chung, để công việc được theo dõi khi tiến hành.
hive.context-preservation
11kGiúp agent của bạn lưu các dữ kiện quan trọng từ kết quả công cụ dài vào ghi chú trước khi những chi tiết cũ bị xóa khỏi bộ nhớ.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.