# Fetch Skills

CLI installer for Fetch.ai developer skills across Cursor, Claude Code, Google Antigravity, and generic agent coding tools.

## What it does

`fetch-skills` installs curated Fetch.ai developer skills (protocol knowledge, agent patterns, best practices) into your project in the format expected by your AI coding tool. The installer is a 3-step wizard: pick a Python package setup, pick which protocol skills to install, pick the install target. The selected files are written into the correct locations with overwrite safety.

## Included skills

### Package setup skills (pick one)

The first installer step asks which Python package setup the project uses. Exactly one of these is installed alongside the protocol skills.

- `uv-package` — `uv` projects. Owns `uv add`, `uv sync`, `uv run`, `pyproject.toml` shape, `uv.lock` rules.
- `poetry-package` — Poetry projects. Owns `poetry add`, `poetry install`, `poetry run`, `pyproject.toml` shape, `poetry.lock` rules.
- `python-venv-package` — `venv` + `pip` + `requirements.txt` projects. Owns `python3.11 -m venv .venv`, `pip install`, `pip freeze`.
- `no-package` — Code-only mode. Skips install commands and lockfiles; only documents required runtime imports.

### Protocol skills (multi-select)

The second installer step shows protocol skills as a checkbox list with an explicit `All protocol skills` entry at the top. Use `Space` to toggle one, `A` to toggle all, `Enter` to confirm.

- `chat-protocol` — Protocol knowledge for building Fetch.ai uAgents that speak the official Chat Protocol (ChatMessage / ChatAcknowledgement / TextContent, session lifecycle, Agentverse manifest registration).
- `stripe-payment-protocol` — Adds Stripe Checkout-backed payment protocol support to Fetch.ai uAgents alongside Chat Protocol (RequestPayment, CommitPayment verification, idempotency, env setup).
- `fet-payment-protocol` — Adds direct on-chain FET payments (Fetch.ai mainnet `afet` or stable-testnet `atestfet`) to a uAgent alongside Chat Protocol (Funds with `fet_direct`, RequestPayment metadata, `cosmpy` ledger verification, RejectPayment / CompletePayment, idempotency on tx hash).
- `payment-protocol` — Combined recipe that adds BOTH Stripe Checkout AND direct on-chain FET payments to one chat-capable uAgent. A single `RequestPayment.accepted_funds` advertises both methods; one `on_commit` dispatches by `Funds.payment_method`. Use when the same agent should accept card OR crypto behind one chat handler.

Skills compose: the selected package skill is installed automatically with the chosen protocol skills. Each protocol skill defers to whichever package skill is present (`uv-package` / `poetry-package` / `python-venv-package` / `no-package`) for install commands, run commands, lockfile rules, and `.env.example` / `.gitignore` templates — protocol skills only define agent and protocol code.

More skills will be added over time.

## Supported tools

- Cursor
- Claude Code
- Google Antigravity
- AGENTS.md / generic agent coding tools

## Quick start

From the root of any project you want to install skills into:

```bash
npx fetch-skills
```

Use `npx fetch-skills` for setup. This runs the installer wizard directly without adding `fetch-skills` as a local project dependency.

The installer is a 3-step wizard:

```text
Step 1/3  Package manager
? Which Python package setup do you use?
  uv package
  Poetry package
  Python venv + pip package
  No package manager / code only

Step 2/3  Protocol skills
? Which Fetch.ai protocol skills do you want to install?
  ◯ All protocol skills
  ◯ chat-protocol
  ◯ fet-payment-protocol
  ◯ payment-protocol
  ◯ stripe-payment-protocol

Step 3/3  Install target
? Where should the skills be installed?
  Cursor
  Claude Code
  Google Antigravity
  AGENTS.md / generic agent tools
  All supported tools
```

Checkbox controls in step 2:

- `Space` — toggle the highlighted item
- `A` — toggle all
- `Enter` — submit selection
- Selecting `All protocol skills` is equivalent to pressing `A`

Step 1 always installs exactly one package skill. Step 2 installs one or more protocol skills.

## Install targets

| Tool | Path |
|------|------|
| Cursor | `.cursor/skills/<skill-name>/SKILL.md` |
| Claude Code | `.claude/skills/<skill-name>/SKILL.md` |
| Google Antigravity | `.agent/skills/<skill-name>/SKILL.md` |
| Generic agents | `AGENTS.md` (single generated file with one `##` section per selected skill) |

For Cursor, Claude Code, and Antigravity, the skill file is copied verbatim into the tool's skills directory, preserving the original frontmatter and content.

For the `AGENTS.md` target, the installer generates a single file from the selected skills. If `AGENTS.md` already exists, you are prompted before it is replaced — the existing file is overwritten in full, not appended to.

## Adding more skills

1. Create a new folder at:

   ```
   skills/<skill-name>/SKILL.md
   ```

2. Write the skill content. The CLI copies the file verbatim into each target's skills directory (Cursor, Claude Code, Antigravity), so include any frontmatter you need directly in `SKILL.md`.
3. Publish a new package version.

The CLI auto-discovers every folder under `skills/*/SKILL.md` — no code changes required when adding new skills.

## Local development

```bash
npm install
npm start
```

`npm start` runs the installer against the current directory (`process.cwd()`), just like `npx fetch-skills` would.

## Run tests

```bash
npm test
```

This runs the built-in `node:test` suite under `test/`, including checks for:

- skill discovery and package/protocol partitioning
- protocol multi-select normalization (including `All protocol skills`)
- `AGENTS.md` content generation
- overwrite-safe writes and install summary tracking

## Test package contents

```bash
npm run test:pack
```

This runs `npm pack --dry-run` and should show at least:

- `bin/install.js`
- `skills/chat-protocol/SKILL.md`
- `skills/fet-payment-protocol/SKILL.md`
- `skills/no-package/SKILL.md`
- `skills/payment-protocol/SKILL.md`
- `skills/poetry-package/SKILL.md`
- `skills/python-venv-package/SKILL.md`
- `skills/stripe-payment-protocol/SKILL.md`
- `skills/uv-package/SKILL.md`
- `README.md`
- `LICENSE`

## Publishing

```bash
npm login
npm pack --dry-run
npm publish --access public
```

## Updating

```bash
npm version patch
npm publish
```

## Author

[Geetanshi Goel](https://github.com/geetanshi0205)

## License

MIT &copy; [Geetanshi Goel](https://github.com/geetanshi0205)