Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Force LF for shell scripts so `tools/*` work in WSL / Git Bash on Windows.
# Without this, Windows clones with core.autocrlf=true rewrite to CRLF and bash
# fails with `$'\r': command not found` and `set: invalid option`.
tools/install text eol=lf
tools/sync text eol=lf
tools/deploy text eol=lf
*.sh text eol=lf
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ logs/
.env.local
.env.*.local
secrets.json

# Maintainer-local config for tools/deploy
.targets.local
17 changes: 17 additions & 0 deletions .targets.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# tools/deploy reads this file (after you copy it to `.targets.local`).
# Format: <consumer-repo-name>=<path-or-glob>
#
# - LHS is the value passed to `tools/install --repo`. Must match a name
# the install CLI knows (e.g. metamask-extension, metamask-mobile).
# - RHS is a path to the consumer checkout. Globs are expanded, so one
# line can hit many worktrees at once.
# - $HOME and ~ are expanded.
# - Lines starting with `#` are ignored. Repeated LHS is fine.

# Worktree fan-out (one line, matches all checkouts of that repo):
metamask-extension=$HOME/dev/metamask/metamask-extension*
metamask-mobile=$HOME/dev/metamask/metamask-mobile*

# Or list individual paths explicitly (e.g. only one worktree, or non-default name):
# metamask-extension=$HOME/dev/metamask/metamask-extension-4
# metamask-mobile=$HOME/work/mobile
279 changes: 229 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,258 @@
# MetaMask OpenClaw Skills
# MetaMask/skills

A curated library of [OpenClaw](https://github.com/BankrBot/openclaw-skills) skills approved and recommended by MetaMask developers. This repository serves as a trusted collection of AI agent skills for building, testing, and interacting with MetaMask and the broader Ethereum ecosystem.
Agent skills, rules, and domain knowledge for the MetaMask ecosystem.

## What are OpenClaw Skills?
Two audiences share this repo:

OpenClaw skills are modular instruction sets that enable AI coding agents to perform specialized tasks. Each skill contains a `SKILL.md` file with structured guidance that AI agents can follow to accomplish specific goals—from deploying smart contracts to interacting with DeFi protocols.
1. **dApp / Web3 developers** — skills under `domains/web3-tools/` teach AI
agents how to use MetaMask developer libraries (`gator-cli`,
`smart-accounts-kit`, OpenCode plugin, etc.). Drop them into your
editor/agent and it will operate the tooling correctly.
2. **MetaMask product engineers** — skills under `domains/perps/`,
`domains/testing/`, `domains/pr-workflow/`, etc. carry the conventions
and review heuristics for `metamask-extension` and `metamask-mobile`.
These install into consumer repos via a small CLI.

## Repository Structure
Single source of truth, multi-operator output (Claude Code, Cursor,
Codex/OpenAI), public canonical, private overlay optional.

> **Private overlay:** internal-only skills (Consensys-wide tooling,
> in-progress experiments, non-public products) live in a separate
> private repo, [`Consensys/skills`](https://github.com/Consensys/skills).
> Engineers with access can layer those skills on top of the public set.
> See [Federation](#federation-public--private).

## Quickstart

### For dApp / Web3 developers (use a single skill)

Point your agent at this repo and load the skill that matches your
tooling. For example, to use the `gator-cli` skill in Claude Code:

```bash
# One-time clone:
git clone https://github.com/MetaMask/skills ~/dev/metamask/skills

# Copy or symlink the skill you want into your project (or ~/.claude/skills):
cp -r ~/dev/metamask/skills/domains/web3-tools/skills/gator-cli/* \
~/.claude/skills/gator-cli/
```

Or use the installer to drop all `web3-tools/` skills at once:

```bash
~/dev/metamask/skills/tools/install \
--repo metamask-extension --target . --domain web3-tools
```

### For engineers in `metamask-extension` / `metamask-mobile`

```bash
# One time:
git clone https://github.com/MetaMask/skills ~/dev/metamask/skills
export METAMASK_SKILLS_DIR=~/dev/metamask/skills

# Then, from inside the consumer repo:
yarn skills
```

`yarn skills` runs `tools/sync`, which pulls the latest skills and writes
them into `.claude/skills/`, `.cursor/rules/`, and `.agents/skills/`.

### For cloud agents (Cursor cloud, Codex cloud, etc.)

No SSH key, no env var — one curl pipe to bash inside the consumer repo:

```bash
curl -fsSL https://raw.githubusercontent.com/MetaMask/skills/main/tools/bootstrap | \
bash -s -- --repo metamask-extension
```

The bootstrap script clones this repo into a cache dir under
`$HOME/.cache/metamask-skills` and runs the installer against the current
directory.

## Repo structure

```
metamask-openclaw-skills/
├── provider-name/
│ ├── skill-name/
│ │ ├── SKILL.md # Main skill definition (required)
│ │ ├── references/ # Supporting documentation (optional)
│ │ └── scripts/ # Helper scripts (optional)
│ └── another-skill/
│ └── SKILL.md
├── CONTRIBUTING.md
└── README.md
domains/<area>/
skills/<skill-name>/
skill.md # base skill
references/ # optional supporting docs
scripts/ # optional helper scripts
repos/<consuming-repo>.md # optional repo-specific overlay
knowledge/ # optional shared domain reference
tools/
install # core writer (mms- prefix, multi-operator output)
sync # Flow 2: `yarn skills` wrapper for engineers
deploy # Flow 1: maintainer push to multiple targets
bootstrap # zero-config installer for cloud agents
.targets.local.example # template for maintainer config
```

## Available Skills
## Domains today

| Domain | Audience | Examples |
| -------------- | ----------------- | ------------------------------------------- |
| `web3-tools` | dApp builders | `gator-cli`, `smart-accounts-kit`, `oh-my-opencode` |
| `coding` | MM product eng | Coding guidelines, controller patterns |
| `general` | All agents | `codex`, `gemini` CLI usage guides |
| `performance` | MM product eng | React rendering, hooks, state perf |
| `perps` | MM product eng | Perps feature dev + review |
| `pr-workflow` | MM product eng | PR title, description, changelog |
| `swaps` | MM product eng | Non-EVM swap integration |
| `testing` | MM product eng | E2E, unit, visual, perf testing |
| `ui` | MM product eng | Component development |

## Two distribution flows

| Provider | Skill | Description |
|----------|-------|-------------|
| *Coming soon* | — | Skills will be added via community PRs |
### Flow 1 — Push (maintainer)

## Installation
From inside `MetaMask/skills`, push the current state to one or more
consumer checkouts.

Point your AI agent to this repository URL:
**One target:**

```bash
tools/install --repo metamask-extension --target ~/dev/metamask/metamask-extension
```
https://github.com/MetaMask/openclaw-skills

**All configured targets:**

```bash
cp .targets.local.example .targets.local # one-time
# edit paths
tools/deploy
tools/deploy --domain perps --dry-run # forwarded to install
```

The agent will present available skills for installation.
`.targets.local` is gitignored.

## Adding a New Skill
### Flow 2 — Pull (engineer)

We welcome contributions from the community! To add a new skill:
From inside a consumer repo:

1. **Fork this repository** and create a new branch
2. **Create your provider directory** (if it doesn't exist):
```bash
mkdir -p your-provider-name/your-skill-name/
```
3. **Add the required `SKILL.md`** following our [skill template](.github/SKILL_TEMPLATE.md)
4. **Add optional supporting files**:
- `references/` — Additional documentation
- `scripts/` — Helper scripts
5. **Submit a Pull Request** with a clear description
```bash
yarn skills # interactive prompt
SKILLS_DOMAINS=perps,testing yarn skills # non-interactive
METAMASK_SKILLS_DIR=/some/path yarn skills # override location
```

See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
`yarn skills` calls `tools/sync`, which pulls the source repos, then
execs `tools/install` with each as `--source`.

## Skill Guidelines
If neither env var is set, the script prints setup instructions and exits.
**No silent auto-clone** — engineers see the path they're opting into.

Skills included in this repository should:
## Manual install (the primitive)

- ✅ Be relevant to MetaMask users and Ethereum developers
- ✅ Follow security best practices
- ✅ Include clear documentation and examples
- ✅ Be tested before submission
- ✅ Not include malicious code or instructions
Both flows ultimately invoke `tools/install`:

## Security
```bash
tools/install \
--repo metamask-mobile \
--target ~/dev/metamask/metamask-mobile \
--domain perps \
--dry-run
```

### Flags

| Flag | Default | Purpose |
| ------------ | -------- | -------------------------------------------------------------------------------- |
| `--repo` | required | Consuming repo name (`metamask-extension`, `metamask-mobile`) |
| `--target` | required | Path to consuming repo |
| `--source` | this repo | Skill source dir (repeatable, ordered; later overrides earlier on name collision) |
| `--domain` | all | Comma-separated domain filter (e.g., `perps,testing`) |
| `--maturity` | `stable` | Min maturity: `experimental`, `stable`, `deprecated` |
| `--dry-run` | off | Preview without writing |

If you discover a security vulnerability in any skill, please report it responsibly. Do not open a public issue. Instead, follow MetaMask's [security policy](https://github.com/MetaMask/metamask-extension/security/policy).
### Output

Per consuming repo, the CLI writes:

- `.claude/skills/mms-<name>/SKILL.md` — Claude Code, OpenCode
- `.cursor/rules/mms-<name>/RULE.md` — Cursor
- `.agents/skills/mms-<name>/SKILL.md` + `agents/openai.yaml` — Codex, OpenCode

All output names are prefixed `mms-` (managed metamask skill). Source
frontmatter `name:` stays unprefixed; the prefix is applied at install time.

Each output file carries a `<!-- DO NOT EDIT -->` banner. Synced content
is additive and intended to be `.gitignore`'d in consuming repos.

## Federation (public + private)

When both env vars are set, `tools/sync` walks both sources and the
private overlay overrides the public skill on name conflict. This matches
the "most-local wins" priority below.

```bash
export METAMASK_SKILLS_DIR=~/dev/metamask/skills # public, this repo
export CONSENSYS_SKILLS_DIR=~/dev/Consensys/skills # private overlay
yarn skills
```

Engineers without access to the private repo simply don't set
`CONSENSYS_SKILLS_DIR` — the public set installs cleanly on its own.

## Authoring a skill

```
domains/<area>/
skills/<skill-name>/
skill.md
references/ # optional supporting docs
scripts/ # optional helper scripts
repos/metamask-extension.md # optional repo overlay
repos/metamask-mobile.md # optional repo overlay
```

### `skill.md` frontmatter

```yaml
---
name: <slash-command-name>
description: <≤1,536 chars including when_to_use cues>
maturity: stable # experimental | stable | deprecated (default stable)
---
```

Extra metadata blocks (e.g. OpenClaw-style `metadata:` with emoji and
homepage) are preserved through install — only `name`, `description`,
`maturity`, `mandatory`, and `scope` are read by the CLI.

### Overlay frontmatter

```yaml
---
repo: metamask-extension
parent: <skill-name>
---
```

Overlays merge into the base body at install time. Skills with a `repos/`
subdir but no overlay matching `--repo` are skipped for that target.
Skills with no `repos/` subdir at all install for any target.

## Multi-operator priority

```
Enterprise > User (~/.claude/skills/) > Project (.claude/skills/)
```

Most-local wins on name conflict. The `mms-` prefix on output names
prevents collision with personal skills.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
MIT see [LICENSE](LICENSE).

## Links
## Security

- [MetaMask Extension](https://github.com/MetaMask/metamask-extension)
- [MetaMask Developer Docs](https://docs.metamask.io/)
- [OpenClaw Skills (Original)](https://github.com/BankrBot/openclaw-skills)
See [SECURITY.md](SECURITY.md) for how to report issues with skills or
the installer.
25 changes: 25 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Security policy

This repo contains agent instructions and prompt templates only — no
runtime code that ships in MetaMask products. Reports about the **content**
of a skill (e.g., guidance that could lead to insecure code) are welcome.

For vulnerabilities in shipped MetaMask products, follow the disclosure
flow at https://metamask.io/security/.

## Reporting an issue with a skill

- Open a public issue on https://github.com/MetaMask/skills/issues if the
problem is non-sensitive (typo, outdated reference, broken link).
- Email `security@metamask.io` if the skill instructs an agent to perform
an action with safety implications (e.g., bypassing review controls,
leaking secrets, weakening test coverage), so a maintainer can patch
before discussion is public.

## Out of scope

- The installer scripts (`tools/install`, `tools/sync`, `tools/deploy`,
`tools/bootstrap`) run locally on engineer machines or cloud agents and
do not handle credentials. Treat bugs as ordinary issues.
- Skills are advisory — agents and reviewers are expected to apply
judgment. A skill recommendation is not a security guarantee.
17 changes: 0 additions & 17 deletions _example/README.md

This file was deleted.

Loading