Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"name": "Chargebee",
"email": "dx@chargebee.com"
},
"keywords": ["chargebee", "billing", "subscription", "webhooks", "api"],
"keywords": ["chargebee", "billing", "subscription", "webhooks", "api", "migration", "upgrade"],
"homepage": "https://chargebee.com",
"repository": "https://github.com/chargebee/ai"
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ Official [Agent Skills](https://agentskills.io/) for integrating Chargebee into
| Skill | Description |
| --- | --- |
| `chargebee-integration` | Integrate Chargebee billing into your app — covers API patterns, webhook handling, SDK usage, subscription lifecycle, payment processing etc. |
| `chargebee-upgrade` | Migrate Chargebee SDKs to the latest version — detects legacy patterns and applies version-specific transformation rules. |

## Installation

```bash
# Integration skill
npx skills add chargebee/ai --skill chargebee-integration

# Upgrade/migration skill
npx skills add chargebee/ai --skill chargebee-upgrade
```

## Feedback
Expand Down
44 changes: 44 additions & 0 deletions skills/chargebee-upgrade/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: chargebee-upgrade
description: Migration guide for upgrading Chargebee SDKs to the latest version. Use when (1) migrating or upgrading a Chargebee SDK to a newer major version, (2) modernizing legacy Chargebee SDK usage patterns, (3) updating Chargebee SDK dependencies. Activates when deprecated or legacy Chargebee SDK patterns are detected in any supported language.
---

# Chargebee SDK Upgrade

This skill helps you migrate Chargebee SDK code to the latest version. It detects legacy patterns, suggests migration, and applies transformation rules.

IMPORTANT: Do not auto-apply changes. Always suggest migration first and let the user decide.

## Supported Migrations

| Language | From | To | Min. Runtime | Guide |
|----------|------|----|-------------|-------|
| Java | V3 (3.x.x) | V4 (4.x.x) | Java 11+ | `references/java/v3-to-v4.md` |

## Detection

Scan the codebase for legacy SDK patterns. When detected, inform the user that a migration guide is available.

### Java V3

Look for any of:
- Imports from `com.chargebee.models.*` or `com.chargebee.Environment`
- `Environment.configure(...)` calls
- Static resource method chains ending in `.request()` (e.g., `Customer.create().firstName("x").request()`)
- `Result` or `ListResult` types from `com.chargebee`
- Dependency `com.chargebee:chargebee-java` with version `3.x.x` in pom.xml or build.gradle

When detected, read **references/java/v3-to-v4.md** for the complete migration rules (17 transformation rules), code examples, and verification checklist. Apply the rules precisely, preserving all business logic, comments, and code structure.

## Workflow

1. Detect legacy SDK patterns in the project
2. Inform the user and suggest migration
3. On approval, read the relevant migration guide
4. Apply transformations file-by-file, explaining each change
5. Flag manual review items (e.g., where to create/inject the client instance)
6. Run through the post-migration checklist

## References

- **references/java/v3-to-v4.md** - Complete Java SDK V3 to V4 migration guide with 17 transformation rules, import mappings, code examples, and verification checklist
Loading