Harness Kit cung cấp quy tắc rõ ràng, state có thể restart, và verification gate — cho mọi ngôn ngữ và stack. Tích hợp với Claude Code, Cursor, Codex, Windsurf. Harness Kit gives your AI agents clear rules, tracked state, and a verification gate — for any language and stack. Works with Claude Code, Cursor, Codex, Windsurf.
Lắp ráp prompt động thân thiện với prompt cache. Tự động quét tìm file chỉ dẫn (CLAUDE.md, AGENTS.md) từ thư mục dự án và cha để nạp luật cho AI. Caching-friendly dynamic guidelines aggregator. Walks ancestor directories to find instruction files (CLAUDE.md, AGENTS.md) and injects them under the static prompt.
Ghi log trạng thái append-only JSONL bền bỉ và tự động nén token thông minh (Context Compaction) khi đạt 80% ngưỡng nhằm chống bùng nổ ngữ cảnh. Manages token budget with reactive context compaction when exceeding 80% limit. Preserves durability via append-only JSONL event logs flushed instantly.
Tích hợp sẵn các primitives để chạy tự động kiểm tra biên dịch cú pháp hoặc các suite thử nghiệm (init.sh / init.bat) để bảo đảm an toàn. Standard primitives to execute syntax compilation checks (py_compile) and auto-test commands (init.sh, init.bat) to verify code health before exit.
Bộ quản trị quyền lực: phân quyền đọc/ghi, phân loại câu lệnh shell động để cảnh báo trước mã nguy hại, cô lập và quản lý tác nhân con. Enforces permission boundaries (read-only, write, full), dynamically classifies shell commands to prevent dangerous execution, and runs isolated sub-agents.
Điều phối vòng lặp execution loop chính, hỗ trợ đăng ký pre-tool hook (để chặn/sửa đổi đối số) và post-tool hook (để audit telemetry) an toàn. Orchestrates the outer while execution loop, triggering customizable pre-tool hooks (for security filtering) and post-tool hooks (for auditing).
Sau khi cài, có hai cách làm việc: prompt AI bằng ngôn ngữ tự nhiên — agent tự đọc AGENTS.md — hoặc dùng hk.py từ terminal bất kỳ. Không cần plugin hay extension.
After install, two ways to work: prompt your AI in natural language — the agent reads AGENTS.md automatically — or use hk.py from any terminal. No plugin or extension needed.
hk.py từ terminal, CI, hay script
Or use hk.py from any terminal, CI, or script
Loading...
Mỗi lượt hành động của AI Agent được kiểm soát thông qua một cơ chế gá lái chặt chẽ: Every action in the execution loop is controlled by a secure gating harness:
Chạy từ thư mục gốc dự án của bạn. Tương thích với Claude Code, Cursor, Codex, Windsurf — mọi AI đọc instruction file. Run from your project root. Works with Claude Code, Cursor, Codex, Windsurf — any AI that reads an instruction file.
Mặc định — Governance only (mọi ngôn ngữ, mọi stack) Default — Governance only (any language, any stack)
curl -fsSL https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.sh | sh
irm https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.ps1 | iex
Full harness — Thêm Python runtime (vòng lặp agent, subagent, hooks) Full harness — adds Python runtime (agent loop, subagents, hooks)
curl -fsSL https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.sh | sh -s -- --full
& ([ScriptBlock]::Create((irm https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.ps1))) --full
Yêu cầu: Python 3.8+, git Requirements: Python 3.8+, git
| File | Mục đíchPurpose |
|---|---|
| AGENTS.md | Quy tắc AI đọc khi bắt đầu mỗi phiên làm việcRules your AI reads on every session start |
| feature_list.json | Tính năng đang thực hiện, trạng thái, phụ thuộcActive feature, status, dependencies |
| progress.md | AI ghi tiến độ vào đây sau mỗi phiênAI writes progress here after each session |
| init.sh / init.ps1 | Script kiểm tra xác thực (tests, lint, build)Verification script (tests, lint, build) |
| session-handoff.md | Ngữ cảnh bàn giao cho phiên AI tiếp theoContext for the next session |
| harness/ (--full) | 7 Python module: vòng lặp agent, tool registry, subagent, hooks, context, persistence, prompt7 Python modules: agent loop, tool registry, subagent, hooks, context, persistence, prompt |
Dùng --agent-file CLAUDE.md nếu tool đọc CLAUDE.md thay vì AGENTS.md. Dùng --full để thêm Python runtime.
Use --agent-file CLAUDE.md if your tool reads CLAUDE.md instead of AGENTS.md. Use --full to add the Python runtime.
Nếu bạn muốn chỉnh sửa, đóng góp hoặc kiểm tra harness-kit: To edit, contribute, or test harness-kit locally:
git clone https://github.com/nguyenanh92/harness-kit.git cd harness-kit py skills/scripts/scaffold_harness.py --target test_run py skills/scripts/validate_harness.py --target test_run
Chạy lệnh cài một lần để tạo governance files, rồi mở AI tool và bắt đầu. Muốn cài harness-kit như một skill tích hợp sâu, xem trang Cài Skill → Run the one-liner to create governance files, then open your AI tool and start. For deep skill integration see the Install Skill guide →
npm install -g @anthropic-ai/claude-code) và đã đăng nhập bằng claude. Xem docs.claude.com.
Claude Code installed (npm install -g @anthropic-ai/claude-code) and authenticated via claude. See docs.claude.com.
Chạy lệnh này ở thư mục gốc dự án — tạo AGENTS.md, feature_list.json, progress.md, hk.py, và init scripts:
Run this at your project root — creates AGENTS.md, feature_list.json, progress.md, hk.py, and the init scripts:
# Windows (PowerShell) irm https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.ps1 | iex # macOS / Linux curl -fsSL https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.sh | sh
Claude Code tự phát hiện skill ngay trong phiên hiện tại — không cần restart. Gõ trigger như "use harness-kit to scaffold a Python agent harness". Claude Code auto-discovers the skill within the current session — no restart needed. Trigger with a prompt like "use harness-kit to scaffold a Python agent harness".
Muốn Claude tự biết dùng harness-kit trong mọi dự án (không cần giải thích mỗi lần), hãy cài như một skill user-level. Xem hướng dẫn đầy đủ tại: To let Claude invoke harness-kit by name across all projects without explaining it each time, install it as a user-level skill. Full instructions at:
winget install Cursor.Cursor) và đã đăng nhập.
Cursor IDE installed (cursor.com/download, or winget install Cursor.Cursor) and signed in.
Chạy lệnh này ở thư mục gốc dự án — Cursor agent sẽ đọc AGENTS.md được tạo ra để biết quy trình làm việc:
Run this at your project root — Cursor's agent will pick up the generated AGENTS.md to understand the workflow:
# Windows (PowerShell) irm https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.ps1 | iex # macOS / Linux curl -fsSL https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.sh | sh
Cursor tự đọc AGENTS.md ở gốc dự án. Gõ vào Composer/Chat:
Cursor picks up AGENTS.md from the project root automatically. Type in Composer/Chat:
> "Read AGENTS.md and implement the active feature in feature_list.json." > "Add a new feature for the Settings screen and start working on it." > "Run hk.py status and tell me what to do next."
Muốn Cursor tự biết quy trình harness-kit mà không cần nhắc lại — cài SKILL.md thành một .cursor/rules/*.mdc. Xem hướng dẫn đầy đủ tại:
To have Cursor understand the harness-kit workflow without prompting each time, install SKILL.md as a .cursor/rules/*.mdc. Full guide at:
Antigravity (Google, convention 2026) đọc AGENTS.md ở gốc dự án (chuẩn cross-tool). Lệnh cài tạo sẵn AGENTS.md, feature_list.json, progress.md, init.sh/init.ps1:
Antigravity (Google, 2026 convention) reads AGENTS.md at the project root as the cross-tool standard. The one-liner drops all key governance files:
# Windows (PowerShell) irm https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.ps1 | iex # macOS / Linux curl -fsSL https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.sh | sh
.agents/skills/
Enable native skills via .agents/skills/
Antigravity còn hỗ trợ thư mục native .agents/skills/. Muốn cài harness-kit như một Antigravity native skill, cần clone repo trước. Xem hướng dẫn đầy đủ:
Antigravity also supports a native .agents/skills/ folder. To install harness-kit as a native Antigravity skill (requires cloning the repo), see the full guide:
Mở project trong Antigravity, yêu cầu agent: "Đọc AGENTS.md và thực thi feature đang in_progress trong feature_list.json". Agent sẽ chạy init.ps1/init.sh để verify trước khi đánh dấu done.
Open the project in Antigravity and prompt: "Read AGENTS.md and execute the in_progress feature from feature_list.json". It will run init.ps1/init.sh for verification before flipping the status to done.
OpenAI Codex đọc AGENTS.md ở gốc dự án và merge cascade từ các thư mục cha. Extension chính thức hỗ trợ VS Code, Cursor, và Windsurf.
OpenAI Codex reads AGENTS.md at the project root (cascading from parent dirs). OpenAI's official IDE extension supports VS Code, Cursor, and Windsurf.
npm install -g @openai/codex # Khởi động và đăng nhập bằng ChatGPT Plus / Pro / API key codex login
Tham khảo thêm tại developers.openai.com/codex/cli. See developers.openai.com/codex/cli for full setup details.
Giống Antigravity, Codex bắt AGENTS.md ở gốc dự án. Lệnh cài tạo luôn governance docs cần cho validator chấm 100/100.
Like Antigravity, Codex picks up AGENTS.md from the project root. The one-liner drops all governance docs needed for the validator to score 100/100.
# Windows (PowerShell) irm https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.ps1 | iex # macOS / Linux curl -fsSL https://raw.githubusercontent.com/nguyenanh92/harness-kit/main/install.sh | sh
Mở terminal tại root dự án, gọi codex. Agent sẽ đọc AGENTS.md và làm theo Definition of Done. Trong VS Code, mở Codex side panel — extension đọc cùng file.
Open a terminal at the project root and run codex. The agent reads AGENTS.md and follows the Definition of Done. In VS Code, open the Codex side panel — the extension reads the same file.
codex # CLI mode