harness-engineering
Skill này làm gì
Công cụ này giúp các dự án code đáng tin cậy hơn đối với trợ lý AI. Nó biến những lỗi lặp lại thành quy tắc và kiểm tra, ngăn các vấn đề tương tự xảy ra lần nữa.
Khi nào nên dùng
- ✓Khi bạn muốn trợ lý AI mắc ít lỗi hơn trong một dự án.
- ✓Để tạo các quy tắc rõ ràng mà trợ lý AI nên tuân theo trong một dự án.
- ✓Để ghi lại những lỗi đã xảy ra và bảo đảm chúng không lặp lại.
Liên kết skill
https://github.com/github/awesome-copilot/blob/main/skills/harness-engineering/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
“Làm cho dự án này đáng tin cậy hơn đối với các trợ lý lập trình, ngăn những lỗi đã từng xảy ra.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ phân tích dự án để hiểu cách nó hoạt động và những lỗi đã xảy ra. Sau đó nó tạo các hướng dẫn và kiểm tra cụ thể cho dự án, giúp AI tránh những lỗi này trong tương lai.
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.
Harness Engineering
Harness engineering turns repeated coding-agent mistakes into durable repository artifacts:
Harness = Instructions + Constraints + Feedback + Memory + Evaluation + Governance
Use this skill when the user asks to:
- make a repository more reliable for GitHub Copilot or other coding agents
- add durable agent instructions, repository rules, or guardrails
- prevent repeated AI coding-agent mistakes
- record known failure paths and the checks that prevent recurrence
- add lightweight drift checks for project rules
- review, refresh, or update an existing agent harness
Do not use this skill for ordinary feature implementation unless the user asks to improve the repository's agent operating environment.
Core Principles
- Treat the target repository as the source of truth.
- Inspect before editing. Preserve the existing stack, package manager, CI, docs, naming, and architecture.
- Add the smallest useful harness. Prefer updating existing files over adding duplicate guidance.
- Make important rules enforceable where practical through tests, linters, type checks, CI, pre-commit hooks, or drift scripts.
- Use manual review points only when automation would be brittle or misleading.
- Record high-risk failures that should not recur, and name the check or review point that catches recurrence.
- Do not copy generic templates blindly. Adapt every artifact to real evidence in the target repository.
Discovery
Before proposing or making harness changes, inspect the repository for existing rules and evidence.
Read these files and folders when they exist:
README.mdAGENTS.md.github/copilot-instructions.md.github/instructions/.github/workflows/CONTRIBUTING.md- package manifests such as
package.json,pyproject.toml,go.mod,Cargo.toml,pom.xml, orbuild.gradle - existing docs under
docs/ - existing scripts under
scripts/ - existing tests and CI checks
Then summarize:
- stack, package manager, and entry points
- existing development and verification commands
- current agent instructions or repository conventions
- known failures, incidents, flaky paths, or repeated review comments
- gaps where project rules are not enforced
Adoption Workflow
Follow this sequence:
- Choose the harness surface that fits the target repository.
- Write target-specific agent instructions.
- Add enforceable checks for high-value rules.
- Record failure memory for high-risk or recurring failures.
- Add drift checks for guidance that can silently become stale.
- Report the adoption with evidence, assumptions, and follow-up.
1. Choose the Harness Surface
Pick only the surfaces that fit the target repository:
| Need | Preferred artifact |
|---|---|
| Always-on agent behavior | AGENTS.md or .github/copilot-instructions.md |
| File-scoped guidance | .github/instructions/*.instructions.md |
| Recurring project checks | scripts/check_*.py, shell scripts, or package scripts |
| CI enforcement | existing workflow files or a small new workflow |
| Known failures | docs/failures/*.md |
| Architecture or process decisions | docs/decisions/*.md |
| Adoption evidence | docs/harness/adoption-report.md or similar |
If the repository already has an equivalent location, update it instead of creating a parallel system.
2. Write Agent Instructions
Agent instructions should be concrete and operational. Include:
- project purpose and major ownership boundaries
- setup, test, lint, build, and verification commands
- package manager and dependency rules
- safe editing rules, generated file rules, and forbidden paths
- testing expectations for changed code
- PR and commit conventions if the repo has them
- how to record new failures or decisions
Avoid broad personality guidance, generic best practices, and rules that cannot be checked or reviewed.
3. Add Enforceable Checks
Convert high-value rules into checks. Good harness checks are:
- narrow enough to avoid false positives
- fast enough to run locally and in CI
- named clearly so agents can run them before finishing
- documented with the rule they protect
Examples:
Rule: Do not edit generated API clients.
Check: script scans diffs for generated paths and fails with a clear message.
Rule: Every failure memory note names a regression check.
Check: script validates docs/failures/*.md for a "Detection" section.
Rule: Profile docs and templates must stay aligned.
…
Câu hỏi thường gặp
“Repository artifacts” là gì?
Đó là các file và cấu hình trong dự án (như file hướng dẫn, kiểm thử hoặc script) giúp dẫn dắt và kiểm chứng hành vi của trợ lý AI.
Công cụ ngăn lỗi lặp lại bằng cách nào?
Nó biến lỗi thành “failure memory” (bộ nhớ lỗi) và tạo các kiểm tra (như kiểm thử hoặc script) để phát hiện và ngăn các lỗi này xảy ra lại.
Tôi có cần biết lập trình để dùng không?
Không. Bạn không cần là lập trình viên có kinh nghiệm. Công cụ được thiết kế để dùng ngay cả khi bạn không hiểu rõ các chi tiết kỹ thuật của code.
Chi tiết
Mô tả gốc của tác giả
Adopt repository-level harness engineering for coding agents. Use when a user wants to prevent repeated AI coding-agent mistakes by turning failures into durable instructions, drift checks, regression tests, failure memory, and adoption reports tailored to the target repository.
repo: github/awesome-copilot
Độ phổ biến
- Sao GitHub
- 40k
- Vị trí xếp hạng
- #7245
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
acquire-codebase-knowledge
40kGiúp agent của bạn hiểu và ghi tài liệu cho một dự án mã nguồn có sẵn. Hữu ích khi đón thành viên mới hoặc nắm tổng quan về kiến trúc.
acreadiness-assess
40kGiúp agent của bạn đánh giá mức độ sẵn sàng cho AI của dự án và tạo báo cáo. Hữu ích để biết dự án đã sẵn sàng dùng công cụ AI đến đâu.
acreadiness-generate-instructions
40kGiúp agent của bạn tạo hướng dẫn cho công cụ AI dựa trên kết quả đánh giá. Hữu ích để cải thiện cách AI làm việc với mã và khắc phục các khoảng trống.
acreadiness-policy
40kGiúp agent của bạn xác định hoặc áp dụng chính sách đánh giá dự án bằng AI. Hữu ích để chuẩn hóa cách đánh giá dự án và đảm bảo tuân thủ.
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á.