Mission Gate
ถ้า request กว้างเกินไป Kiyo จะบังคับให้ตีกรอบก่อน เช่นไฟล์ไหน อาการอะไร และไม่ควรแตะส่วนไหน
AI Coding Framework สำหรับงานจริง
Kiyo ช่วยให้ Claude Code, GitHub Copilot และ Codex ทำงานกับ .NET 8/.NET 10, Angular และ agentic workflows ด้วยกฎที่ชัดเจน checklist ที่ตรวจซ้ำได้ และหลักฐานก่อนความมั่นใจ
ทำไมต้อง Kiyo
Kiyo ไม่ได้พยายามทำให้ AI พูดสวยขึ้น แต่ทำให้ AI ทำงานปลอดภัยขึ้น: อ่านไฟล์จริงก่อน สรุปพร้อมหลักฐาน แก้เฉพาะ scope ที่ตกลง และตรวจผลก่อนบอกว่างานเสร็จ
ฟีเจอร์ที่น่าใช้
ถ้า request กว้างเกินไป Kiyo จะบังคับให้ตีกรอบก่อน เช่นไฟล์ไหน อาการอะไร และไม่ควรแตะส่วนไหน
ทุก finding ต้องมี [high], [medium], [low] หรือ [unsure] เพื่อแยกหลักฐานจริงออกจากการคาดเดา
มี checklist สำหรับ .NET, Angular, performance, security และ agentic safety ทำให้ review ซ้ำได้ ไม่ใช่อ่านผ่าน ๆ
งานใหญ่ถูกแยกให้ specialist ตรวจคนละด้าน แล้วค่อยรวมผล ลด context ล้นและ finding ซ้ำ
รองรับ ASP.NET Core Web API + EF Core โดยยึด Clean Architecture แบบ Monolith ทั้ง net8.0 และ net10.0
มี Claude plugin, GitHub Copilot instructions และ Codex AGENTS/plugin metadata เพื่อใช้กฎเดียวกันข้ามเครื่องมือ
หลักการทำงาน
router ดูว่าเป็น bug, review, security, UI, API หรือ agentic
kiyo-core โหลดก่อน แล้วตามด้วย .NET, Angular หรือ agentic skill
ก่อนแก้ ต้องรู้ว่าแตะไฟล์ไหนและไม่แตะไฟล์ไหน
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 เฉพาะทีม
อ่าน .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 ก่อน
เลือก 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 แบบเล็กที่สุด
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 จะเห็นรายการระดับกลางด้วย
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
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
อ่านครบก่อน → 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()
ใช้ได้กับเครื่องมือไหน
Claude Code ใช้ plugin และ hooks ได้เต็มที่สุด ส่วน GitHub Copilot และ Codex ใช้ Kiyo ผ่าน repository instructions, AGENTS.md และ plugin metadata เพื่อให้ AI อ่านกฎเดียวกัน
ข้อดีและข้อจำกัด
เริ่มใน 3 คำสั่ง
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 ที่ใช้