{"slug": "building-verification-loops-in-claude-code-with-skills", "title": "Building Verification Loops in Claude Code with Skills", "summary": "Anthropic published a guide on building verification loops in Claude Code with skills, enabling AI agents to automatically check and fix their own work using tests, linters, and custom checks. The approach encodes manual review patterns into reusable skills that run across sessions, reducing the need for human oversight.", "body_md": "*โดย Nokka (นก-กา) | 25 กรกฎาคม 2026*\n\n*บทความนี้เขียนโดย AI (DeepSeek V4 Pro) ผ่าน Hermes Agent ภายใต้การควบคุมของ Nokka (นก-กา)*\n\nคุณเคยเจอ pattern นี้ไหม — สั่ง Claude Code แก้โค้ด → มันทำงานเสร็จ → คุณตรวจ → เจอจุดเล็กๆ ที่ต้องแก้ → แก้เอง → สั่งใหม่ → วนซ้ำ\n\nAnthropic เพิ่งเผยแพร่บทความ \"Building verification loops in Claude Code with skills\" [1] — อธิบายวิธีเปลี่ยน manual checks พวกนี้ให้เป็นระบบอัตโนมัติที่ Claude ตรวจสอบและแก้ไขงานตัวเองได้ โดยคุณไม่ต้องนั่งเฝ้า\n\nVerification loop คือวงจรที่ AI agent ตรวจสอบงานตัวเอง — รัน tests, linters, หรือ custom checks — แล้วแก้ไขสิ่งที่ fail ก่อนส่งมอบ\n\nแนวคิดนี้ไม่ใหม่ — แต่สิ่งที่ Anthropic ทำคือการทำให้มัน **encode เป็น skill** ได้ — เพื่อให้ทุก session ใช้ checks ชุดเดียวกันโดยอัตโนมัติ แทนที่จะต้องให้คนจำว่าต้องตรวจอะไรบ้าง\n\n\"A verification loop is a repeating cycle where an AI agent checks its own work — running tests, linters, or custom checks — and fixes what fails before moving on.\" [1]\n\nก่อนจะสร้าง custom loop — Anthropic แนะนำให้เข้าใจสิ่งที่ Claude Code มีในตัวก่อน [1]:\n\n| ฟีเจอร์ | ทำงานยังไง |\n|---|---|\n`/verify` skill |\nbuild, run, และ observe การเปลี่ยนแปลงในแอปพลิเคชัน |\nToolchain |\nClaude จับ error codes และ warnings จาก linter, type checker, test runner — แนะนำให้ใส่ build/test commands ใน CLAUDE.md |\nCode Review (research preview) |\nmulti-agent service ที่รัน automated review บน PR — แก้เองหรือ comment `@claude` เพื่อให้ agent แก้ |\nGitHub Actions |\nใช้ verification skill เดียวกันรันบนทุก push หรือ PR |\nSpec validation |\nskill ที่ตรวจสอบทุก change เทียบกับ markdown spec ใน repo |\nRubrics (Claude Managed Agents, beta) |\ngrader agent ตรวจผลลัพธ์เทียบกับ rubric — ถ้า fail → loop กลับไปแก้ใหม่ |\n\nAnthropic แนะนำ 3 ขั้นตอน [1]:\n\nถามตัวเองว่า — ทุกครั้งที่ Claude ส่งงานมา คุณตรวจอะไรซ้ำๆ?\n\n`error`\n\nเมื่อ status ไม่ใช่ 200\"เขียนเป็น plain English — เหมือนอธิบายให้เพื่อนร่วมทีมใหม่ฟัง\n\nถ้ายังนึกไม่ออกว่าจะเขียน check ยังไง — ถาม Claude:\n\n\"What are the best practices for verifying frontend changes in this project?\"\n\nClaude จะเสนอ checks มาให้ — คุณแก้เฉพาะจุดที่ต่างจาก standard — เพราะจุดที่ต่างนั่นแหละคือสิ่งที่คุณต้อง capture\n\nใช้ skill-creator plugin ให้ Claude สัมภาษณ์คุณ:\n\n```\n/skill-creator Create a skill for verifying frontend changes end-to-end. Interview me about my workflow.\n```\n\nClaude จะถามคำถามเพื่อเข้าใจ workflow ของคุณ — แล้วสร้าง SKILL.md ให้\n\nAnthropic แชร์ 3 verification loops ที่ทีมภายในใช้ [1]:\n\n```\n# SKILL.md — Frontend Verification\n\n## Verification Loop\n1. Run `npm run build` — fail if build errors\n2. Run `npm run lint` — fail if lint errors\n3. Run `npm run test` — fail if test failures\n4. Start dev server and check:\n   - No console errors in browser\n   - All new routes render without crash\n   - Responsive at 3 breakpoints (mobile, tablet, desktop)\n5. If any check fails → fix → re-run from step 1\n# SKILL.md — Migration Safety\n\n## Verification Loop\n1. Check every migration file:\n   - No `DROP COLUMN` without a prior backfill migration\n   - No `DROP TABLE` without a deprecation notice in CHANGELOG\n   - All `ADD COLUMN` have DEFAULT or are nullable\n2. Run `rails db:migrate:down VERSION=...` — verify reversible\n3. If any check fails → reject the migration → ask developer to fix\n# SKILL.md — Docs Sync\n\n## Verification Loop\n1. For every changed API endpoint:\n   - Check that OpenAPI spec is updated\n   - Check that README example matches new behavior\n   - Check that CHANGELOG has an entry\n2. If any check fails → update the docs → re-check\n```\n\nVerification loop ไม่ใช่แค่ automation — มันคือการเปลี่ยน **tacit knowledge** (สิ่งที่คุณรู้ว่าต้องตรวจ แต่ไม่ได้เขียนไว้) ให้เป็น **explicit system** (สิ่งที่ Claude ทำได้เอง)\n\nAnthropic บอกว่า:\n\n\"Anything you keep having to enforce by hand as a manual check qualifies for capture as a loop.\" [1]\n\nนี่คือหลักการเดียวกับที่ Nokka ใช้กับ Veritas — Nokka Loop คือ verification loop สำหรับบทความ — NCQS คือ automated check, Veritas คือ grader agent, และการวน 3 รอบคือ feedback loop\n\n`/skill-creator`\n\nในมุมมองของผม — verification loop คือสิ่งที่แยก \"AI ที่ช่วยเขียนโค้ด\" ออกจาก \"AI ที่ทำงานแทนคุณได้จริง\" — เพราะการเขียนโค้ดเป็นแค่ครึ่งเดียวของงาน — การตรวจสอบว่ามันถูกต้องคืออีกครึ่ง\n\n*ติดตามบทความเกี่ยวกับ AI, Claude Code, และเครื่องมือสำหรับนักพัฒนาได้ที่ Nokka on dev.to — กด Follow ที่โปรไฟล์เพื่อรับอัปเดตทุกครั้งที่มีบทความใหม่*\n\n[1] Anthropic, \"Building verification loops in Claude Code with skills,\" Claude Blog, 22 กรกฎาคม 2026. [https://claude.com/blog/building-verification-loops-in-claude-code-with-skills](https://claude.com/blog/building-verification-loops-in-claude-code-with-skills)", "url": "https://wpnews.pro/news/building-verification-loops-in-claude-code-with-skills", "canonical_source": "https://dev.to/sarantoon/building-verification-loops-in-claude-code-with-skills-2a60", "published_at": "2026-07-25 05:35:57+00:00", "updated_at": "2026-07-25 06:01:16.763083+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools", "large-language-models", "mlops"], "entities": ["Anthropic", "Claude Code", "Nokka", "DeepSeek V4 Pro", "Hermes Agent", "Veritas"], "alternates": {"html": "https://wpnews.pro/news/building-verification-loops-in-claude-code-with-skills", "markdown": "https://wpnews.pro/news/building-verification-loops-in-claude-code-with-skills.md", "text": "https://wpnews.pro/news/building-verification-loops-in-claude-code-with-skills.txt", "jsonld": "https://wpnews.pro/news/building-verification-loops-in-claude-code-with-skills.jsonld"}}