AI Coding Framework สำหรับงานจริง

ทำให้ AI เขียนโค้ดอย่างมีวินัย ไม่เดา ไม่หลุดขอบเขต

Kiyo ช่วยให้ Claude Code, GitHub Copilot และ Codex ทำงานกับ .NET 8/.NET 10, Angular และ agentic workflows ด้วยกฎที่ชัดเจน checklist ที่ตรวจซ้ำได้ และหลักฐานก่อนความมั่นใจ

5 โหมดการทำงาน
7 checklists จริงใน repo
11 specialist roles
3 AI tool integrations

ทำไมต้อง Kiyo

เพราะ AI ที่เก่งอย่างเดียว ยังไม่พอสำหรับ production code

Kiyo ไม่ได้พยายามทำให้ AI พูดสวยขึ้น แต่ทำให้ AI ทำงานปลอดภัยขึ้น: อ่านไฟล์จริงก่อน สรุปพร้อมหลักฐาน แก้เฉพาะ scope ที่ตกลง และตรวจผลก่อนบอกว่างานเสร็จ

Kiyo framework flow diagram

ฟีเจอร์ที่น่าใช้

Guardrails ที่ทำให้ AI ทำงานเหมือนมี senior reviewer คอยจับขอบเขต

01

Mission Gate

ถ้า request กว้างเกินไป Kiyo จะบังคับให้ตีกรอบก่อน เช่นไฟล์ไหน อาการอะไร และไม่ควรแตะส่วนไหน

02

Confidence Labels

ทุก finding ต้องมี [high], [medium], [low] หรือ [unsure] เพื่อแยกหลักฐานจริงออกจากการคาดเดา

03

Checklist-driven review

มี checklist สำหรับ .NET, Angular, performance, security และ agentic safety ทำให้ review ซ้ำได้ ไม่ใช่อ่านผ่าน ๆ

04

Gravity Pattern

งานใหญ่ถูกแยกให้ specialist ตรวจคนละด้าน แล้วค่อยรวมผล ลด context ล้นและ finding ซ้ำ

05

.NET 8 / .NET 10 Clean Architecture

รองรับ ASP.NET Core Web API + EF Core โดยยึด Clean Architecture แบบ Monolith ทั้ง net8.0 และ net10.0

06

Claude, Copilot, Codex

มี Claude plugin, GitHub Copilot instructions และ Codex AGENTS/plugin metadata เพื่อใช้กฎเดียวกันข้ามเครื่องมือ

หลักการทำงาน

Kiyo เปลี่ยน prompt ธรรมดาให้กลายเป็น workflow ที่ตรวจสอบได้

1

จัดประเภทงาน

router ดูว่าเป็น bug, review, security, UI, API หรือ agentic

2

โหลดกฎที่เกี่ยวข้อง

kiyo-core โหลดก่อน แล้วตามด้วย .NET, Angular หรือ agentic skill

3

ประกาศ scope

ก่อนแก้ ต้องรู้ว่าแตะไฟล์ไหนและไม่แตะไฟล์ไหน

4

ตรวจด้วยหลักฐาน

finding ระดับสูงต้องมีหลักฐานจากไฟล์จริง และถ้าไม่ชัดต้องเป็น unsure

ใช้งานยังไง

คำสั่งจำง่าย ใช้ตามสถานการณ์

/kiyo-init

เริ่มใช้กับ project และสร้าง .kiyo/ context

/kiyo-review <file>

ตรวจ code ด้วย checklist โดยยังไม่แก้ทันที

/kiyo-fix "symptom"

แก้บัคแบบหา root cause และดู git history ก่อน

/kiyo-security

ตรวจ security ด้วย mode ultra และ OWASP mindset

/kiyo-api design

ออกแบบ REST API contract ก่อนเขียน implementation

/kiyo-ui "description"

แก้ UI/CSS ด้วยเป้าหมายภาพที่ชัดเจน

/kiyo-init

ใช้ครั้งแรกใน project เพื่อสร้าง .kiyo/ ซึ่งเป็นสมุดบันทึกของ project เช่น stack, pattern, memory ของ bug และ checklist เฉพาะทีม

ดูรายละเอียด technical ▸

อ่าน .csproj → ดึง TargetFramework + PackageReference | อ่าน angular.json + package.json → Angular version + project names | ตรวจ app.config.ts vs app.module.ts เพื่อแยก standalone/NgModule | สร้าง .kiyo/ ตาม stack ที่ detect ได้

[kiyo-dev] Detected stack:
  .NET target:     net8.0       ← MyApi.csproj
  EF Core version: 8.0.4        ← PackageReference
  Angular version: 17.3.2       ← package.json
  Solution name:   MySolution   ← .sln
  Angular mode:    standalone   ← app.config.ts found

FILES CREATED:
  .kiyo/INDEX.md      ← stack snapshot
  .kiyo/PATTERNS.md   ← team coding patterns
  .kiyo/MEMORY.md     ← bug + root cause history
  .kiyo/MISSION.md    ← active work context

/kiyo-review <file|directory>

ใช้ตรวจ code แบบ finding-only ยังไม่แก้ไฟล์ เหมาะกับก่อน merge หรือก่อนเริ่ม refactor ถ้าเป็น directory ต้อง confirm scope ก่อน

ดูรายละเอียด technical ▸

เลือก checklist ตาม extension → dispatch audit-specialist → verifier pass บังคับก่อน output

// /kiyo-review OrderController.cs

[high] OrderController.cs:42 — .Result() call blocks thread
  Evidence: "var result = _mediator.Send(query).Result;"
  Checklist: Async — no .Result or .Wait() calls
  Fix: await _mediator.Send(query, cancellationToken)

[medium] OrderController.cs:15 — Missing CancellationToken
  Inferred from: async action without cancellationToken param
  Fix: Add CancellationToken cancellationToken to signature

[unsure] Program.cs — CORS AllowAnyOrigin scope unclear
  Question: Is AllowAnyOrigin intentional for production?
  Options: A) Restrict origins  B) Add env check  C) Investigate

/kiyo-fix "symptom"

ใช้เมื่อมีอาการบัคชัดเจน Kiyo จะอ่าน memory, ดู git history, หา root cause, ประกาศไฟล์ที่จะ touch แล้วค่อยเสนอ patch แบบเล็กที่สุด

ดูรายละเอียด technical ▸

git log --grep → git log -S → ROOT CAUSE declaration → minimal patch (ข้ามไม่ได้)

ROOT CAUSE ANALYSIS
  Symptom:    NullReferenceException ใน OrderService.CreateOrder()
  Root cause: commit a3f9c21 เปลี่ยน Customer.Address เป็น nullable
              แต่ไม่ได้ null-check ก่อนใช้
  Confidence: [high]
  Evidence:   git show a3f9c21 — "-public string Address"
                                  "+public string? Address"
  Prior fix:  no

// BEFORE:
var city = customer.Address.City;  // crash ถ้า Address เป็น null

// AFTER (minimal patch):
var city = customer.Address?.City ?? string.Empty;

/kiyo-security [target] [--all]

ใช้ตรวจ security ด้วย mode ultra, checklist ตาม stack และ OWASP mapping โดย HIGH finding ต้องมีหลักฐานจริงจากไฟล์ ถ้าใส่ --all จะเห็นรายการระดับกลางด้วย

ดูรายละเอียด technical ▸

3 specialists พร้อมกัน → OWASP mapping ทุก finding → verifier pass บังคับ

// /kiyo-security ProductsController.cs

[high] A01 Broken Access Control — ProductsController.cs:55
  Evidence: confirmed — Delete action has no [Authorize] attribute
  Fix: Add [Authorize(Roles = "Admin")]

[high] A03 Injection — appsettings.json:12
  Evidence: found in — ConnectionString uses string interpolation
  "Server={host};Database={db}"
  Fix: Use SqlConnectionStringBuilder

[medium] A02 Cryptographic Failures — AuthService.cs:30
  Inferred: MD5 usage detected for password hashing
  Fix: Replace with ASP.NET Core Identity PasswordHasher<T>

/kiyo-api design <feature>

ใช้ออกแบบ REST API ก่อนเขียน code โดยเริ่มจาก route, method, auth, DTO, validation, response status และ CancellationToken

ดูรายละเอียด technical ▸

Design-first contract table → auth ทุก route → sealed record DTO → OpenAPI annotations

// DTO จาก /kiyo-api design Products
public sealed record CreateProductRequest(
    [Required][StringLength(200, MinimumLength = 1)]
    string Name,
    [Required][Range(0.01, double.MaxValue)]
    decimal Price,
    [Required][Range(0, int.MaxValue)]
    int Stock
);

// Controller action ที่ครบ
[HttpPost]
[Authorize(Roles = "Admin")]
[ProducesResponseType(typeof(ProductResponse), 201)]
[ProducesResponseType(typeof(ValidationProblemDetails), 422)]
public async Task<IActionResult> Create(
    CreateProductRequest request,
    CancellationToken cancellationToken) { ... }

/kiyo-api review <controller>

ใช้ตรวจ controller ที่มีอยู่แล้ว โดยเน้น route, HTTP verb, authorization, DTO, validation, OpenAPI annotation และ deadlock risk

ดูรายละเอียด technical ▸

อ่านครบก่อน → REST naming → 4 areas: Auth / DTOs / Async safety / OpenAPI

// /kiyo-api review UsersController.cs

[high] UsersController.cs:67 — Deadlock risk
  Evidence: "_userService.GetAllAsync().Wait();"
  Fix: await _userService.GetAllAsync(cancellationToken)

[medium] UsersController.cs:20 — Route uses verb
  Found: [Route("api/users/create")]
  Fix: POST /api/users  (verb belongs in HTTP method, not path)

[medium] UsersController.cs:33 — Missing CancellationToken
  Actions affected: GetById(), Create(), Delete()

ใช้ได้กับเครื่องมือไหน

กฎเดียว ใช้ได้หลาย AI coding tools

Claude Code ใช้ plugin และ hooks ได้เต็มที่สุด ส่วน GitHub Copilot และ Codex ใช้ Kiyo ผ่าน repository instructions, AGENTS.md และ plugin metadata เพื่อให้ AI อ่านกฎเดียวกัน

Claude Codeplugin + hooks
GitHub Copilotinstructions
CodexAGENTS + manifest

ข้อดีและข้อจำกัด

ขายความปลอดภัย ไม่ขายเวทมนตร์

ข้อดี

  • ลดการแก้เกิน scope ด้วย Mission Gate
  • Review ซ้ำได้ด้วย checklist จริงใน repo
  • Security finding ต้องมีหลักฐานก่อนขึ้น HIGH
  • รองรับ .NET 8/.NET 10 Clean Architecture และ Angular 13-18
  • ใช้ได้ทั้ง Claude Code, Copilot และ Codex

ข้อจำกัด

  • เข้มงวดกว่าการคุยกับ AI แบบปกติ จึงอาจถาม scope เพิ่ม
  • ไม่ใช่ compiler หรือ test runner ต้องรัน verification จริงเมื่อทำได้
  • Claude hooks ไม่ได้รันใน Copilot/Codex โดยตรง
  • stack หลักคือ .NET, Angular และ agentic Web API ไม่ใช่ทุกภาษาในโลก
  • ต้องเขียน prompt ให้มีอาการหรือเป้าหมายชัด จะได้ผลดีที่สุด

เริ่มใน 3 คำสั่ง

ติดตั้ง แล้วให้ AI เริ่มทำงานแบบมีวินัย

git clone https://github.com/0xPratyaDev7x/kiyo-agent-framework ~/.claude/skills/kiyo-dev
/kiyo-init
/kiyo router

ถ้าใช้ Copilot หรือ Codex ให้เปิด repo นี้แล้วอ้างอิง instructions ที่อยู่ใน .github/ หรือ AGENTS.md ตาม tool ที่ใช้