# Contoh Skill

Tiga skill lengkap yang bisa Anda salin dan sesuaikan: satu ditulis hanya dengan kata-kata, satu bekerja di situs web, dan satu menjalankan skrip. Untuk memakainya, minta AI untuk "buat skill ini" lalu tempelkan isinya, atau simpan foldernya ke `.agents/skills/` di ruang kerja Anda.

## Memeriksa faktur terhadap daftar harga

Metode dalam kata-kata, dengan satu file rujukan. Cocok untuk pemeriksaan apa pun yang dilakukan dengan membandingkan dokumen dengan sebuah daftar.

```text
check-invoices/
├── SKILL.md
└── references/
    └── prices.csv
```

```markdown
---
name: check-invoices
description: Check supplier invoices against the agreed price list and list
  every line that does not match. Use when asked to check, verify or reconcile
  invoices or supplier bills.
---

# Check invoices

## Inputs and outcome
- Input: invoices (PDF or Excel) attached or in the workspace.
- Price list: references/prices.csv (columns: item_code, item_name, unit_price).
- Outcome: mismatches.csv in the workspace with columns
  invoice_file, item_code, invoiced_price, agreed_price, difference.

## Procedure
1. Read each invoice and take every line: item code, quantity, unit price.
2. Look up each item code in references/prices.csv.
3. A line is a mismatch when the unit price differs by more than 0.01, or the
   item code is not in the price list (agreed_price empty).
4. Write mismatches.csv. In the chat, give the number of invoices checked,
   lines checked and mismatches found.
5. Read only. Do not change or move the invoices.

## Representative check
An invoice line for item A-100 at 12.50, with A-100 at 12.00 in the price
list, appears in mismatches.csv with difference 0.50. The count of lines
checked equals the sum of lines across all invoices.
```

## Mengekspor pesanan bulan ini dari situs web

Metode yang bekerja di situs web tempat Anda sudah masuk. Cocok untuk ekspor rutin apa pun dari sistem yang tidak punya tombol ekspor.

```markdown
---
name: export-orders
description: Export this month's orders from the orders website into a CSV.
  Use when asked for this month's orders, an order export or an order list.
---

# Export orders

## Inputs and outcome
- Input: the orders website, open and signed in, in a Cowork tab.
- Outcome: orders-YYYY-MM.csv in the workspace with columns
  order_no, date, customer, total, status.

## Procedure
1. Go to the orders list and filter to the current month.
2. Read every page of results, not only the first.
3. Write the CSV. Dates as YYYY-MM-DD, totals as plain numbers.
4. Read only: never click Save, Delete, Submit or change any field.
5. If a sign-in or verification page appears, stop and tell me which page.

## Representative check
The number of rows in the CSV equals the result count the website shows for
the month.
```

Jika Anda menjalankannya setiap bulan dan daftarnya panjang, minta AI untuk "tulis skrip crawl untuk ini". Cara itu lebih cepat dan bisa dilanjutkan dari titik terakhir berhenti. Lihat [Skrip Crawl](https://docs.micromeet.ai/id/capture/crawl-scripts.md).

## Menghitung file menurut jenisnya (sebuah perintah)

Skill yang langsung menjalankan skrip saat Anda mengetik `/count-files`, tanpa AI. Cocok untuk tugas cepat yang harus persis dan tidak butuh penilaian.

```text
count-files/
├── SKILL.md
└── scripts/
    └── run.mjs
```

```markdown
---
name: count-files
description: Count the files in the workspace by file type.
entry: scripts/run.mjs
x-shortcut:
  run: scripts/run.mjs
---

# Count files

Typing /count-files runs scripts/run.mjs on this computer. It prints how many
files of each type are in the workspace.
```

```js
// scripts/run.mjs: stdin berupa JSON { args, sessionId, workspace }.
import { readdirSync } from 'node:fs';
import { extname, join } from 'node:path';

let raw = '';
for await (const chunk of process.stdin) raw += chunk;
const { workspace } = raw ? JSON.parse(raw) : {};
if (!workspace) throw new Error('Choose a workspace first.');

const counts = {};
const walk = (dir) => {
  for (const entry of readdirSync(dir, { withFileTypes: true })) {
    if (entry.name.startsWith('.')) continue;
    const path = join(dir, entry.name);
    if (entry.isDirectory()) walk(path);
    else {
      const type = extname(entry.name).toLowerCase() || '(none)';
      counts[type] = (counts[type] ?? 0) + 1;
    }
  }
};
walk(workspace);

for (const [type, count] of Object.entries(counts).sort((a, b) => b[1] - a[1])) {
  console.log(`${type}\t${count}`);
}
```

Selengkapnya tentang skrip ada di [Cara Menulis Skill](https://docs.micromeet.ai/id/skills/skill-anatomy.md#scripts).

## Langkah berikutnya

- [Ciri Skill yang Baik](https://docs.micromeet.ai/id/skills/good-skills.md): Daftar periksa sebelum Anda membagikan skill
- [Tugas Terjadwal](https://docs.micromeet.ai/id/skills/scheduled-tasks.md): Jalankan skill pada waktu yang ditentukan
