# Skill Examples

Three complete skills you can copy and adapt: one written only in words, one that works on a website, and one that runs a script. To use one, ask the AI to "create this skill" and paste it, or save the folder into your workspace's `.agents/skills/`.

## Check invoices against a price list

A method in words, with a reference file. Good for any check you do by comparing documents with a list.

```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.
```

## Export this month's orders from a website

A method that works on a website you are signed in to. Good for any regular export from a system that has no export button.

```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.
```

If you run this every month and the list is long, ask the AI to "write a crawl script for this" instead. It is faster and resumes where it stopped. See [Crawl Scripts](https://docs.micromeet.ai/capture/crawl-scripts.md).

## Count files by type (a command)

A skill that runs a script directly when you type `/count-files`, without the AI. Good for quick, exact jobs that need no judgement.

```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 is 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}`);
}
```

More on scripts in [How a Skill Is Written](https://docs.micromeet.ai/skills/skill-anatomy.md#scripts).

## Next steps

- [What Makes a Good Skill](https://docs.micromeet.ai/skills/good-skills.md): The checklist to run before you share a skill
- [Scheduled Tasks](https://docs.micromeet.ai/skills/scheduled-tasks.md): Run a skill at set times
