adding-api-versions
Skill544 starsChanged 7 months agoMITView on GitHub
Use when adding a new API version to the shopify-api package, creating REST resource files for a new version, updating API version constants, or handling breaking changes like removed or modified resources between versions.
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 77
Import all resources (except removed ones)
- Very specific: line 92
Delete the resource file from rest/admin/{NEW_VERSION}/
- Very specific: line 93
Delete the test file from rest/admin/__tests__/{NEW_VERSION}/
- Very specific: line 94
Remove imports/exports from index.ts
- Distinctive: line 99
Update method signatures if parameters changed
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Adding a New API Version
Step-by-step process for adding a new API version to packages/apps/shopify-api. Uses 2025-07 as a reference example.
Prerequisites
- Know which resources are removed or modified in the new version
Step 1: Update API Version Constants
Edit packages/apps/shopify-api/lib/types.ts:
export enum ApiVersion {
// ... existing versions ...
April25 = '2025-04',
July25 = '2025-07', // New version
October25 = '2025-10', // Release candidate (next version)
}Naming convention: {Month}{YY} (e.g., April25, July25). Value format: YYYY-MM.
Also add the next quarterly version as a release candidate enum value (no REST resources needed yet).
Step 2: Create Directory Structure
mkdir packages/apps/shopify-api/rest/admin/{YYYY-MM}/
mkdir packages/apps/shopify-api/rest/admin/__tests__/{YYYY-MM}/Step 3: Copy and Update Resource Files
Copy from the most recent version:
cp -r packages/apps/shopify-api/rest/admin/{PREVIOUS_VERSION}/* \
packages/apps/shopify-api/rest/admin/{NEW_VERSION}/
cp -r packages/apps/shopify-api/rest/admin/__tests__/{PREVIOUS_VERSION}/* \
packages/apps/shopify-api/rest/admin/__tests__/{NEW_VERSION}/In every resource file, update the apiVersion property:
// From
public static apiVersion = ApiVersion.April25;
// To
public static apiVersion = ApiVersion.July25;Step 4: Update Test Files
Two changes in every test file:
- testConfig calls:
testConfig({apiVersion: ApiVersion.July25, restResources}) - URL paths in expectations:
`https://test-shop.myshopify.com/admin/api/2025-07/...`
Step 5: Update Index File
Edit packages/apps/shopify-api/rest/admin/{NEW_VERSION}/index.ts:
- Import all resources (except removed ones)
- Update
RestResourcesinterface - Update
restResourcesexport
For removed resources, delete their imports and exports:
// Remove from interface and export
export interface RestResources extends ShopifyRestResources {
// CustomerAddress: typeof CustomerAddress; // Removed in 2025-07
}Step 6: Handle Breaking Changes
For removed resources (e.g., CustomerAddress in 2025-07):
- Delete the resource file from
rest/admin/{NEW_VERSION}/ - Delete the test file from
rest/admin/__tests__/{NEW_VERSION}/ - Remove imports/exports from
index.ts
For modified resources:
- Update class properties
- Modify
pathsarray if endpoints changed - Update method signatures if parameters changed
- Adjust tests accordingly
Step 7: Run Tests and Build
# Test the new version
pnpm test -- packages/apps/shopify-api/rest/admin/__tests__/{NEW_VERSION}
# Run all tests
pnpm testChecklist
- New enum value in
ApiVersion(packages/apps/shopify-api/lib/types.ts) - Next quarterly release candidate enum value added (no REST resources needed)
- Source directory created:
rest/admin/{NEW_VERSION}/ - Test directory created:
rest/admin/__tests__/{NEW_VERSION}/ - All resource files copied and
apiVersionupdated - All test files updated (testConfig + URL paths)
index.tsupdated with correct imports/exports- Removed resources and their tests deleted
- Modified resources updated
- All tests pass
- Package builds without errors
In this repository5 other files it gives its agents.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

