OpenCode Agent Skills: SKILL.md
·Yudha Arief Wijaya
Apa Itu Agent Skills?
Agent Skills adalah cara untuk mendefinisikan perilaku reusable untuk OpenCode agent. Dengan SKILL.md, kamu bisa ngasih instruksi spesifik yang bisa dipanggil kapan saja.
Struktur SKILL.md
Buat file SKILL.md di folder project atau di direktori skills:
---
name: code-review
description: Melakukan code review dengan standar tim
---
# Code Review Skill
## Checklist
1. Cek error handling
2. Validasi input
3. Cek performance
4. Pastikan testing coverage
Cara Pakai
Panggil skill dengan command di TUI:
/skill code-review
Skill Categories
| Tipe | Contoh |
|---|---|
| Review | Code review, PR check |
| Generate | Boilerplate, component |
| Refactor | Rename, restructure |
| Debug | Error analysis, log check |
Best Practices
- Satu skill per concern — jangan campur aduk
- Beri contoh yang jelas di deskripsi
- Include checklist yang actionable
- Simpan di repository tim biar bisa dipakai bareng
Contoh: React Component Generator
---
name: react-component
description: Generate React component dengan TypeScript
---
Buat React component dengan:
1. TypeScript interface untuk props
2. Default export
3. Tailwind CSS classes
4. Unit test file