Testing, Evals & Skill Supply Chain
Kiểm thử routing và behavior bằng baseline/pressure scenarios, rồi phân phối skill như executable dependency có version và trust boundary.
Một skill chưa được test chỉ là giả thuyết về hành vi; một skill bên thứ ba chưa được review là dependency có quyền tác động tới agent.
Những điều cần nắm chắc
Routing eval và execution eval phải tách riêng.
RED baseline chứng minh failure thực sự tồn tại trước khi thêm instruction.
Pressure scenario tìm rationalization mà happy-path prompt không lộ ra.
Pin version, review diff và giới hạn quyền khi cài skill bên thứ ba.
Case study trực quan
Visual được lưu local để GitHub Pages tải ổn định; mỗi case đều giữ link nguồn và chỉ ra cách biến pattern thành implementation.

Từ SKILL.md đến public release: quality gate thay vì upload thủ công
Google mô tả một pipeline nơi skill đi qua kiểm tra cấu trúc và link, sau đó so sánh agent-only với agent-plus-skill trên accuracy lẫn efficiency trước khi public export. Điểm đáng học không phải công cụ cụ thể mà là skill được release giống software dependency.
Vì sao pattern này hiệu quả?
- Baseline without-skill chứng minh skill tạo uplift thay vì chỉ tạo output trông thuyết phục.
- Static checks bắt lỗi rẻ như frontmatter, naming và dead link trước khi tốn model calls.
- Public export tách internal data, owner metadata và eval fixtures khỏi artifact phân phối.
Triển khai tối thiểu
- 1Validate schema, path, frontmatter và mọi URL trong pull request.
- 2Chạy positive, near-miss và failure prompts nhiều lần ở baseline và candidate.
- 3Chấm outcome bằng rubric; ghi tokens, latency, tool calls và completion rate.
- 4Chỉ publish version mới khi quality tăng mà permission surface không mở rộng ngoài dự kiến.
Caveat: Một lần eval pass không chứng minh skill bền vững. Model, API, reference và harness đều thay đổi nên cần scheduled regression run và owner xử lý failure.

Đừng chỉ đo câu trả lời hay hơn—hãy đo cả token và thời gian
Ma trận tách accuracy khỏi efficiency. Một skill có thể tăng task completion nhưng nạp quá nhiều context hoặc gọi tool dư thừa; ngược lại, giảm token mà làm mất evidence cũng không phải cải tiến. Candidate tốt phải được so trên cùng workload và cùng success rubric.
Vì sao pattern này hiệu quả?
- Outcome metric ngăn tối ưu exact wording thay vì task success.
- Efficiency metric phát hiện context bloat và workflow lặp dù output cuối vẫn đúng.
- Cùng một rubric cho baseline/candidate giúp attribution rõ hơn.
Triển khai tối thiểu
- 1Định nghĩa task success và evidence bắt buộc trước khi chạy model.
- 2Ghi total tokens, wall-clock time, số turn, tool call, retry và side effect.
- 3Chạy nhiều trial để variance của model không quyết định kết luận.
- 4Review riêng các regression: route sai, tool denial, timeout và partial artifact.
Caveat: Không cộng accuracy và efficiency thành một điểm số tùy ý quá sớm. Giữ hai trục riêng để team nhìn thấy trade-off và đặt threshold phù hợp với workload.
Nội dung bài viết
Superpowers: TDD cho process documentation
Superpowers áp RED–GREEN–REFACTOR cho skill: chạy scenario không có skill và ghi lại failure; viết instruction tối thiểu xử lý failure đó; chạy lại với skill; sau đó thêm pressure để tìm loophole mới. Giá trị lớn nhất của RED là ngăn tác giả viết theo intuition thay vì failure quan sát được.
Pressure scenario kết hợp deadline, sunk cost, authority hoặc exhaustion để buộc agent lựa chọn. Nó phù hợp với skill kỷ luật như TDD hay verification; reference skill thuần kiến thức không nhất thiết cần kiểu test compliance này.
Eval matrix: trigger đúng, trigger sai, chạy đúng
Positive routing prompt kiểm tra task rõ ràng phải kích hoạt. Near-miss prompt kiểm tra task gần giống nhưng ngoài scope không được kích hoạt. Execution eval kiểm tra artifact, step order, tool call, refusal và done-condition sau khi skill đã được load.
Đo outcome thay vì exact prose: file hợp lệ, test thực sự chạy, side effect nằm trong scope, finding có evidence. Exact-string assertion thường khiến eval giòn mà không đo chất lượng.
Skill là một phần của software supply chain
SKILL.md là operational text: nó có thể hướng agent đọc file, chạy script và gọi tool. Cài repository lạ tương đương thêm dependency có khả năng định hướng hành động. Cần review instruction, executable, hook, network target, license và update channel.
Matt Pocock phân biệt plugin managed/read-only với bản copy qua skills installer mà team sở hữu và chỉnh sửa. Hai mô hình có trade-off khác nhau: subscription dễ cập nhật; vendoring dễ audit và pin nhưng team phải tự merge bản vá.
Definition of Done cho một skill production
Một skill sẵn sàng khi schema validate, routing suite qua, execution suite qua, failure mode có recovery, permission được ghi rõ, reference không chết và versioning policy tồn tại. Số sao GitHub hay output demo đẹp không thay thế các bằng chứng này.
- Ít nhất: positive, near-miss và explicit invocation cases.
- Có baseline chứng minh skill thay đổi hành vi mong muốn.
- Có test cho missing input, tool denial và script failure.
- Có owner, version và cách rollback/update.
Code & cấu trúc tham khảo
Eval cases tập trung vào boundary
1const cases = [2 { prompt: 'Audit this existing checkout UI', shouldActivate: true },3 { prompt: 'Build a new checkout page', shouldActivate: false },4 { prompt: 'Use frontend-production-review on this diff', shouldActivate: true },5];67for (const testCase of cases) {8 const result = await runAgent(testCase.prompt);9 expect(result.activatedSkills.includes('frontend-production-review'))10 .toBe(testCase.shouldActivate);11}Takeaway: Near-miss case bảo vệ precision; explicit case bảo vệ invocation contract; positive case bảo vệ recall.
Tài liệu đọc thêm
Repo, đặc tả và bài viết gốc để đi sâu sau bài học.
Superpowers — testing skills with subagents
RED–GREEN–REFACTOR và pressure testing cho skill behavior.
Matt Pocock Skills installation models
Managed plugin so với editable vendored skills.
Anthropic — Demystifying evals for AI agents
Outcome-oriented evaluation cho agent nhiều turn.
Google — Continuous evals for Agent Skills
Case study thực tế về baseline, CI gates, accuracy và efficiency.
OpenAI — Evaluate agent workflows
Trace grading và evaluation workflow cho agent production.
Promptfoo
Open-source eval harness để chạy dataset, assertions và regression suite.
Inspect AI
Framework open source cho model evaluation, task, scorer và sandbox.