with one click
sync-to-ts-sdk
Sync Python SDK changes to TypeScript SDK and create a PR.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Sync Python SDK changes to TypeScript SDK and create a PR.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | sync-to-ts-sdk |
| description | Sync Python SDK changes to TypeScript SDK and create a PR. |
| argument-hint | [PR_URL] [--no-commit] |
| disable-model-invocation | true |
| allowed-tools | Bash, Read, Write, Edit, Glob, Grep, Task |
This skill analyzes changes from the Python SDK (twilio-agent-connect-python) and generates corresponding changes for the TypeScript SDK (twilio-agent-connect-typescript), then creates a PR.
The skill accepts the following arguments (can be combined):
https://github.com/twilio/twilio-agent-connect-python/pull/123--no-commit (makes and stages changes, but skips commit/push/PR)Examples:
/sync-to-ts-sdk - Current branch, creates PR/sync-to-ts-sdk --no-commit - Current branch, stages changes only/sync-to-ts-sdk https://github.com/.../pull/123 - From PR URL, creates PR/sync-to-ts-sdk https://github.com/.../pull/123 --no-commit - From PR URL, stages changes onlyRepositories:
~/.claude/cache/sync-to-ts-sdk/twilio-agent-connect-typescript (user's home directory)twilioParse arguments to determine the source of changes and mode:
Arguments: $ARGUMENTS (the full argument string)
1. Check for NO_COMMIT flag:
If arguments contain "--no-commit":
-> NO_COMMIT: true
Else:
-> NO_COMMIT: false
2. Check for PR URL:
If arguments contain a URL matching "github.com" and "/pull/":
-> PR URL MODE: Fetch changes from the specified PR
-> Extract: org, repo, PR number from URL
Else:
-> CURRENT BRANCH MODE: Use current branch in local repo
Parsing Examples:
"" → Current branch, NO_COMMIT=false"--no-commit" → Current branch, NO_COMMIT=true"https://github.com/.../pull/123" → PR URL mode, NO_COMMIT=false"https://github.com/.../pull/123 --no-commit" → PR URL mode, NO_COMMIT=true"--no-commit https://github.com/.../pull/123" → PR URL mode, NO_COMMIT=trueBefore doing anything else, verify that the gh CLI is installed and authenticated with access to the target repo:
gh repo view twilio/twilio-agent-connect-typescript --json name --jq '.name'
twilio-agent-connect-typescript), proceed to Phase 1.This skill requires the GitHub CLI (
gh) to be installed and authenticated with access totwilio/twilio-agent-connect-typescript.Run
gh auth statusto check your authentication, orgh auth loginto authenticate.
Do not continue to any subsequent phase if this check fails.
Clone or update the TypeScript SDK in the user's cache directory. Always hard reset to remote main to ensure a clean state, but warn the user first if there are uncommitted changes.
Step 1a: Define the cache directory and check if repo exists
TS_SDK_DIR="$HOME/.claude/cache/sync-to-ts-sdk/twilio-agent-connect-typescript"
echo "TS_SDK_DIR=$TS_SDK_DIR"
[ -d "$TS_SDK_DIR" ] && echo "REPO_EXISTS=true" || echo "REPO_EXISTS=false"
Step 1b: If repo exists, check for uncommitted changes
cd "$TS_SDK_DIR" && git status --porcelain
If the output is non-empty (there are uncommitted changes):
AskUserQuestion to ask:
<path> has uncommitted changes (shown above). Continuing will discard them. Do you want to proceed?"Step 1c: Update or clone the repository
Only proceed with this step if either:
If repo exists (update and reset):
cd "$TS_SDK_DIR"
git fetch origin
git checkout main
git reset --hard origin/main
git clean -fd
If repo doesn't exist (clone fresh):
mkdir -p "$HOME/.claude/cache/sync-to-ts-sdk"
gh repo clone twilio/twilio-agent-connect-typescript "$TS_SDK_DIR"
If PR URL MODE:
Fetch PR details and diff using GitHub CLI:
# Get PR metadata
gh pr view <PR_NUMBER> --repo twilio/twilio-agent-connect-python --json title,body,headRefName,baseRefName,files,url
# Get the diff
gh pr diff <PR_NUMBER> --repo twilio/twilio-agent-connect-python
# Get list of changed files
gh pr view <PR_NUMBER> --repo twilio/twilio-agent-connect-python --json files --jq '.files[].path'
Store:
SOURCE_BRANCH: PR head branch nameSOURCE_PR_URL: The PR URLSOURCE_PR_TITLE: PR titleSOURCE_PR_NUMBER: PR numberIf CURRENT BRANCH MODE:
Get the current branch name and changes vs main:
# Navigate to git root first
cd "$(git rev-parse --show-toplevel)"
# Get current branch
git rev-parse --abbrev-ref HEAD
# Get list of changed files
git diff --name-only main...HEAD
# Get detailed diff
git diff main...HEAD
Store:
SOURCE_BRANCH: Current branch nameSOURCE_PR_URL: Check if PR exists with gh pr view --json url (may be empty)SOURCE_PR_TITLE: Empty or from existing PRSOURCE_PR_NUMBER: Empty or from existing PRFirst, explore the TypeScript SDK to understand its structure:
$TS_SDK_DIR/.claude/CLAUDE.md for project-specific guidanceThen, for each changed Python file, determine:
IMPORTANT: Before making any changes to the TypeScript SDK, present a detailed plan to the user and wait for approval.
Present the plan in this format:
# Sync Plan: Python → TypeScript SDK
## Source
- Branch: `<branch-name>`
- PR: <url or N/A>
- Changed files: <count>
## Proposed Changes
### 1. <Python File Path>
- **Change type:** <new file | modified | deleted>
- **TypeScript target:** `<typescript file path>`
- **What will change:**
- <bullet point description of each change>
- <e.g., "Add new `getProfile` method with `traitGroups` parameter">
- <e.g., "Add `ProfileResponse` type with `id`, `createdAt`, `traits` fields">
### 2. <Next Python File>
...
## Files to Create/Modify in TypeScript SDK
| Action | File |
| ------ | ------------------------------- |
| Modify | `<path discovered via explore>` |
| Create | `<path discovered via explore>` |
## Ready to proceed?
Reply **yes** to implement these changes, or provide feedback to adjust the plan.
Wait for the user to reply with approval before proceeding to Phase 5.
If the user provides feedback or requests changes to the plan, incorporate their feedback and present an updated plan.
Only proceed with this phase after user approval.
cd "$TS_SDK_DIR"
# Create branch based on source
TS_BRANCH="sync/${SOURCE_BRANCH}"
git checkout -b "$TS_BRANCH"
For each Python change, generate the equivalent TypeScript code following the conventions and patterns discovered in Phase 3.
Create or update tests to cover the new/changed functionality.
Run verification checks using sub-agents to preserve context. First read $TS_SDK_DIR/.claude/CLAUDE.md for the correct commands, then launch each check in a sub-agent:
Review the results from each sub-agent and fix any issues found before proceeding to Phase 7.
git add .
If NO_COMMIT is true: Stop here. Output a message noting:
sync/${SOURCE_BRANCH}~/.claude/cache/sync-to-ts-sdk/twilio-agent-connect-typescriptgit status and git diff --stagedIf NO_COMMIT is false: Continue with commit and PR creation:
git commit -m "$(cat <<'EOF'
Sync: <summary of Python changes>
Synced from Python SDK branch: ${SOURCE_BRANCH}
Python PR: ${SOURCE_PR_URL}
EOF
)"
git push -u origin "$TS_BRANCH"
IMPORTANT: Before creating the PR, read the PR template file at:
~/.claude/cache/sync-to-ts-sdk/twilio-agent-connect-typescript/.github/PULL_REQUEST_TEMPLATE.md
Use the template structure to create the PR body:
/sync-to-ts-sdk skillgh pr create \
--draft \
--title "Synced from Python: <summary>" \
--body "<PR body following the template format>"
Generate a summary report with the following structure:
Report Template:
# SDK Sync Report
## Source (Python SDK)
- Mode: <PR URL | Current Branch>
- Branch: `<branch-name>`
- PR: <url or N/A>
- Changed files: <count>
## Changes Detected
| Python File | Change Type | TypeScript Target | Status |
| ------------------ | ----------- | ----------------- | ------ |
| <python file path> | Modified | <ts file path> | Synced |
## Detailed Changes
### 1. <File Name>
**Python change:**
(show diff)
**TypeScript equivalent:**
(show diff)
## Target (TypeScript SDK)
- Branch: `sync/<branch-name>`
- PR: <url or N/A (N/A if NO COMMIT mode)>
Now proceed through each phase:
gh CLI access to target repo; STOP if it fails