> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Skills

> Enhance your AI coding assistants with official Dodo Payments skills for seamless payment integrations, webhook handling, and billing flows.

## Overview

Agent Skills are reusable capabilities that enhance what AI coding assistants can do when working with Dodo Payments. They provide procedural knowledge and best practices that help agents accomplish specific tasks more effectively - from integrating checkout flows to setting up usage-based billing.

<Info>
  **Think of skills as plugins for your AI assistant.** They teach your agent how to implement Dodo Payments features correctly, following our recommended patterns and best practices.
</Info>

Skills work with any MCP-compatible AI agent, including:

* **Claude Code** - Anthropic's CLI coding assistant
* **OpenCode** - Open source AI coding agent
* **Cursor** - AI-first code editor
* **Other MCP clients** - Any agent supporting the skills protocol

## Available Skills

| Skill                                                                                                               | Description                                                              |
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [dodo-best-practices](https://github.com/dodopayments/skills/tree/main/dodo-payments/best-practices)                | Comprehensive guide to integrating Dodo Payments with best practices     |
| [webhook-integration](https://github.com/dodopayments/skills/tree/main/dodo-payments/webhook-integration)           | Setting up and handling webhooks for payment events                      |
| [subscription-integration](https://github.com/dodopayments/skills/tree/main/dodo-payments/subscription-integration) | Implementing subscription billing flows                                  |
| [checkout-integration](https://github.com/dodopayments/skills/tree/main/dodo-payments/checkout-integration)         | Creating checkout sessions and payment flows                             |
| [usage-based-billing](https://github.com/dodopayments/skills/tree/main/dodo-payments/usage-based-billing)           | Implementing metered billing with events and meters                      |
| [billing-sdk](https://github.com/dodopayments/skills/tree/main/dodo-payments/billing-sdk)                           | Using BillingSDK React components                                        |
| [license-keys](https://github.com/dodopayments/skills/tree/main/dodo-payments/license-keys)                         | Managing license keys for digital products                               |
| [credit-based-billing](https://github.com/dodopayments/skills/tree/main/dodo-payments/credit-based-billing)         | Implementing credit entitlements, balances, and metered credit deduction |

## Installation

Choose your preferred installation method based on your AI coding assistant.

<Tabs>
  <Tab title="Agent Plugin (recommended)">
    Nếu bạn đang sử dụng Claude Code, Codex CLI, Cursor, hoặc OpenCode, [Dodo Agent Plugin](/developer-resources/build-with-ai-coding-agents) cài đặt tất cả tám kỹ năng cộng với hai máy chủ MCP chỉ trong một bước. Kỹ năng sẽ được tải tự động khi tác nhân của bạn phát hiện một nhiệm vụ liên quan.

    Xem [hướng dẫn AI Coding Agents](/developer-resources/build-with-ai-coding-agents) để biết lệnh cài đặt từng tác nhân.
  </Tab>

  <Tab title="Skills CLI">
    Cài đặt kỹ năng bằng cách sử dụng universal skills CLI hoạt động với bất kỳ tác nhân tương thích MCP nào:

    ```bash theme={null}
    # Install all Dodo Payments skills
    npx skills add dodopayments/skills
    ```

    Hoặc cài đặt các kỹ năng riêng lẻ theo nhu cầu:

    ```bash theme={null}
    # Best practices guide
    npx skills add dodopayments/skills/dodo-payments/best-practices

    # Webhook integration
    npx skills add dodopayments/skills/dodo-payments/webhook-integration

    # Subscription billing
    npx skills add dodopayments/skills/dodo-payments/subscription-integration

    # Checkout flows
    npx skills add dodopayments/skills/dodo-payments/checkout-integration

    # Usage-based billing
    npx skills add dodopayments/skills/dodo-payments/usage-based-billing

    # BillingSDK components
    npx skills add dodopayments/skills/dodo-payments/billing-sdk

    # License key management
    npx skills add dodopayments/skills/dodo-payments/license-keys

    # Credit-based billing
    npx skills add dodopayments/skills/dodo-payments/credit-based-billing
    ```

    <Tip>
      Chỉ cài đặt các kỹ năng bạn cần để giữ cho tác nhân của bạn tập trung và giảm chi phí ngữ cảnh.
    </Tip>
  </Tab>

  <Tab title="Claude Code">
    Thêm chợ kỹ năng Dodo Payments vào Claude Code:

    ```bash theme={null}
    /plugin marketplace add dodopayments/skills
    ```

    Sau đó cài đặt các plugin riêng lẻ:

    ```bash theme={null}
    # Install best practices
    /plugin install dodo-best-practices

    # Install webhook integration
    /plugin install webhook-integration

    # Install subscription integration
    /plugin install subscription-integration

    # Install checkout integration
    /plugin install checkout-integration

    # Install usage-based billing
    /plugin install usage-based-billing

    # Install BillingSDK
    /plugin install billing-sdk

    # Install license keys
    /plugin install license-keys

    # Install credit-based billing
    /plugin install credit-based-billing
    ```
  </Tab>

  <Tab title="OpenCode">
    Các kỹ năng có sẵn tự động khi được cấu hình trong cài đặt OpenCode của bạn. Thêm kho kỹ năng Dodo Payments vào cấu hình của bạn:

    ```json theme={null}
    {
      "skills": {
        "repositories": [
          "dodopayments/skills"
        ]
      }
    }
    ```
  </Tab>
</Tabs>

## Sử dụng Kỹ năng

Khi đã cài đặt, trợ lý AI của bạn có thể sử dụng những kỹ năng này khi bạn yêu cầu nó thực hiện các tính năng Dodo Payments. Sau đây là một số gợi ý ví dụ:

### Thực tiễn Tốt nhất

```
Help me integrate Dodo Payments into my Next.js app following best practices
```

### Webhooks

```
Set up webhook handlers for payment and subscription events
```

### Đăng ký

```
Implement a subscription flow with free trial and multiple pricing tiers
```

### Thanh toán

```
Create a checkout session for my SaaS product
```

### Tính phí dựa trên sử dụng

```
Add usage-based billing to track API calls for my AI product
```

### BillingSDK

```
Add a pricing page using BillingSDK components
```

### Khóa Giấy phép

```
Implement license key validation for my desktop app
```

### Tính phí dựa trên tín dụng

```
Set up credit entitlements and metered credit deduction for my AI product
```

## Cách Kỹ năng Hoạt động

Kỹ năng cung cấp cho trợ lý AI của bạn:

1. **Kiến thức Thủ tục** - Hướng dẫn theo từng bước cho việc thực hiện các tính năng
2. **Mẫu Mã** - Mẫu và đoạn mã sản xuất sẵn sàng
3. **Thực tiễn Tốt nhất** - Phương pháp đề xuất cho bảo mật, xử lý lỗi, và UX
4. **Nhận thức Ngữ cảnh** - Sự hiểu biết về cách hoạt động của các tính năng Dodo Payments khác nhau

Khi bạn yêu cầu trợ lý AI thực hiện một tính năng, nó sử dụng kỹ năng liên quan để:

* Hiểu cách tiếp cận thực hiện đúng
* Tạo mã chính xác, hoạt động
* Tuân thủ các quy ước của Dodo Payments
* Xử lý các trường hợp và lỗi biên một cách chính xác

<Note>
  Kỹ năng bổ sung cho [MCP Server](/developer-resources/mcp-server) và [Sentra](/developer-resources/sentra). Sử dụng MCP cho các thao tác API, Sentra cho tích hợp có hướng dẫn, và Kỹ năng cho khả năng trợ lý AI nâng cao.
</Note>

## So sánh với Công cụ Khác

| Công cụ              | Mục đích                     | Tốt nhất cho                                   |
| -------------------- | ---------------------------- | ---------------------------------------------- |
| **Kỹ năng Tác nhân** | Nâng cao kiến thức trợ lý AI | Phát triển hỗ trợ AI với bất kỳ MCP client nào |
| **MCP Server**       | Thực hiện các thao tác API   | Truy cập API trực tiếp từ trợ lý AI            |
| **Sentra**           | Trợ lý tích hợp có hướng dẫn | Tích hợp thanh toán tương tác trong IDE        |

## Tài nguyên

<CardGroup cols={2}>
  <Card title="Skills Repository" icon="github" href="https://github.com/dodopayments/skills">
    Duyệt mã nguồn và đóng góp vào các kỹ năng Dodo Payments
  </Card>

  <Card title="MCP Server" icon="server" href="/developer-resources/mcp-server">
    Kích hoạt trợ lý AI để thực hiện các thao tác API của Dodo Payments
  </Card>

  <Card title="Sentra" icon="wand-magic-sparkles" href="/developer-resources/sentra">
    Trợ lý thanh toán AI cho IDE của bạn
  </Card>

  <Card title="Discord Community" icon="discord" href="https://discord.gg/bYqAp4ayYh">
    Nhận trợ giúp và chia sẻ phản hồi với cộng đồng
  </Card>
</CardGroup>
