### Verify jta installation and install if necessary Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md Checks if the 'jta' command-line tool is installed by running 'jta --version'. If it's not found, it provides instructions to install it using Homebrew on macOS. This ensures the translation tool is available. ```bash # Verify jta is installed jta --version # Install via Homebrew (macOS) brew tap hikanner/jta && brew install jta ``` -------------------------------- ### Install Jta (Bash) Source: https://github.com/ckanner/agent-skills/blob/main/jta/SKILL.md This script handles the installation of the Jta tool by detecting the operating system and architecture. It attempts to use Homebrew on macOS or downloads the appropriate binary for macOS and Linux, then makes it executable and moves it to a common binary directory. Finally, it verifies the installation by checking the version. ```bash # Detect OS and install jta OS="$(uname -s)" ARCH="$(uname -m)" if [[ "$OS" == "Darwin"* ]] then # macOS - try Homebrew first if command -v brew &> /dev/null then brew tap hikanner/jta brew install jta else # Download binary if [[ "$ARCH" == "arm64" ]] then curl -L https://github.com/hikanner/jta/releases/latest/download/jta-darwin-arm64 -o jta else curl -L https://github.com/hikanner/jta/releases/latest/download/jta-darwin-amd64 -o jta fi chmod +x jta sudo mv jta /usr/local/bin/ fi elif [[ "$OS" == "Linux"* ]] then # Linux curl -L https://github.com/hikanner/jta/releases/latest/download/jta-linux-amd64 -o jta chmod +x jta sudo mv jta /usr/local/bin/ fi # Verify installation jta --version ``` -------------------------------- ### Install Agent Skills via Command Line Source: https://github.com/ckanner/agent-skills/blob/main/README.md Instructions for installing agent skills from the marketplace using Claude Code's command-line interface. This involves adding the marketplace and then installing specific skills. ```bash # Step 1: Add the marketplace /plugin marketplace add hikanner/agent-skills # Step 2: Install the skills you need /plugin install prompt-optimizer@kanner-agent-skills /plugin install jta@kanner-agent-skills # Step 3: Restart Claude Code to activate the skills ``` -------------------------------- ### Sample JSON Translations (Before and After) Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/incremental-mode.md Illustrates the structure of a JSON translation file before and after changes, highlighting new, modified, and deleted keys. ```json { "app": { "welcome": "Welcome to {appName}!", "deprecated": "Old feature (no longer used)" }, "user": { "credits": "You have {count} credits" } } ``` ```json { "app": { "welcome": "Welcome to {appName}! Start your journey", "features": { "newFeature": "New Feature" } }, "user": { "credits": "Your account has {count} credits", "preferences": { "theme": "Theme", "language": "Language" } }, "settings": { "notification": { "email": "Email notifications", "push": "Push notifications" } } } ``` -------------------------------- ### Manage Skills in Claude Code (Bash) Source: https://github.com/ckanner/agent-skills/blob/main/README.md This bash snippet outlines common commands for managing installed skills directly within the Claude Code environment using the `/plugin` command. It includes examples for getting help, listing, installing, and uninstalling plugins. Note that commands may vary by version. ```bash # Get help on available plugin commands /plugin help # Common operations (verify with /plugin help for your version) /plugin list # List installed plugins /plugin install # Install a plugin /plugin uninstall # Uninstall a plugin ``` -------------------------------- ### Data Analysis Prompt Optimization Example (Text) Source: https://context7.com/ckanner/agent-skills/llms.txt Demonstrates the conversion of an unclear data analysis request into a more structured prompt. While the example is truncated, it implies the process involves specifying the type of analysis, desired output, and potentially the data context. ```text # Original Prompt: "Analyze this sales data" ``` -------------------------------- ### Preview JSON file structure with jq Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md Uses the 'jq' command-line JSON processor to display the first 20 lines of the 'locales/en.json' file. This helps in quickly inspecting the structure and content of the source translation file before proceeding with the translation. ```bash # Show file structure jq '.' locales/en.json | head -20 ``` -------------------------------- ### Install Agent Skills via Plugin Marketplace (Bash) Source: https://context7.com/ckanner/agent-skills/llms.txt Installs Kanner's Agent Skills from the marketplace using Claude Code's plugin command system. This method requires adding the marketplace and then installing specific skills, followed by a restart to activate them. ```bash # Add the marketplace /plugin marketplace add hikanner/agent-skills # Install the prompt optimizer skill /plugin install prompt-optimizer@kanner-agent-skills # Install the JSON translation agent skill /plugin install jta@kanner-agent-skills # Restart Claude Code to activate the skills # Then verify installed skills /plugin list ``` -------------------------------- ### Jta CLI: CI/CD Integration for Multiple Languages Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/incremental-mode.md Example of integrating Jta into a CI pipeline to update multiple languages incrementally, using the '-y' flag for non-interactive execution. ```bash # In your CI pipeline jta locales/en.json --to zh,ja,ko --incremental -y ``` -------------------------------- ### Install Agent Skills for Local Development Source: https://github.com/ckanner/agent-skills/blob/main/README.md Steps to set up agent skills for local development, including cloning the repository and adding it as a local marketplace. This allows for testing local changes before publishing. ```bash # Step 1: Clone the repository git clone https://github.com/hikanner/agent-skills.git cd agent-skills # Step 2: Add as local marketplace /plugin marketplace add ./ # Step 3: Install plugins /plugin install prompt-optimizer@kanner-agent-skills /plugin install jta@kanner-agent-skills ``` -------------------------------- ### Jta Installation and Basic Usage (Bash) Source: https://context7.com/ckanner/agent-skills/llms.txt Provides bash commands for installing the Jta (JSON Translation Agent) on macOS and Linux, and demonstrates basic translation of an i18n JSON file to multiple languages. ```bash # Check if jta is installed jta --version # Install on macOS via Homebrew brew tap hikanner/jta && brew install jta # Install on Linux curl -L https://github.com/hikanner/jta/releases/latest/download/jta-linux-amd64 -o jta chmod +x jta sudo mv jta /usr/local/bin/ # Check for API key if [[ -n "$ANTHROPIC_API_KEY" ]]; then echo "Using Anthropic" PROVIDER_FLAG="--provider anthropic" elif [[ -n "$OPENAI_API_KEY" ]]; then echo "Using OpenAI" PROVIDER_FLAG="" fi # Translate to multiple languages jta locales/en.json --to zh,ja,ko -y $PROVIDER_FLAG # Expected Output: # Saved to locales/zh.json (Chinese) # Saved to locales/ja.json (Japanese) # Saved to locales/ko.json (Korean) # Statistics: 100 keys, 45 API calls, ~$0.90 cost ``` -------------------------------- ### Japanese Localization (JSON) Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md JSON file containing Japanese translations for agent skills. It includes greetings, workspace descriptions, and user credit information, preserving placeholders like {appName} and {count}, as well as HTML tags. ```json { "app": { "welcome": "{appName}へようこそ!", "description": "ワークスペースの設定を管理" }, "user": { "credits": "残り {count} クレジットがあります" } } ``` -------------------------------- ### Jta CLI: Enable Incremental Mode Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/incremental-mode.md Command-line interface usage for Jta to perform incremental translation updates, specifying source and target languages. ```bash jta en.json --to zh --incremental ``` -------------------------------- ### Basic Prompt Optimization Example (Text) Source: https://context7.com/ckanner/agent-skills/llms.txt Illustrates the transformation of a vague user request and an original poor-quality prompt into a structured, effective instruction for an AI model. It highlights the key improvements made to enhance clarity and specificity. ```text # User Request: "Can you help optimize this prompt for better results?" # Original Prompt (Poor Quality): "Review my code" # Optimized Prompt (After using Prompt Optimizer): """ Review this Python authentication module for a web application. Focus on: 1. Security vulnerabilities (SQL injection, XSS, improper session handling) 2. Code organization and maintainability 3. Error handling completeness 4. Performance considerations for high-traffic scenarios The code will be used in production serving 100k+ daily users. Prioritize security issues over style concerns. If any security issue is found, explain the potential impact and provide a secure alternative implementation. """ # Key Improvements Made: # - Specifies code type and purpose # - Lists explicit review criteria # - Provides usage context # - Sets clear priorities # - Defines expected output detail ``` -------------------------------- ### Verify Translation Files Exist Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/incremental-mode.md This command checks the existence and details of the source and target translation files before proceeding with the translation process. It helps ensure that the necessary files are in place and provides basic information about them. ```bash ls -lh locales/en.json locales/zh.json ``` -------------------------------- ### Check Jta Installation (Bash) Source: https://github.com/ckanner/agent-skills/blob/main/jta/SKILL.md This script checks if the 'jta' command-line tool is available in the system's PATH. If not found, it indicates that installation is required. ```bash # Check if jta exists if ! command -v jta &> /dev/null; then echo "jta not found, will install" fi ``` -------------------------------- ### Perform Full Translation (for comparison) Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/incremental-mode.md This command performs a full translation of the source file to the target language without using incremental mode. It's used here as a baseline to compare the efficiency and cost against the incremental approach. ```bash jta en.json --to zh ``` -------------------------------- ### Korean Localization (JSON) Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md JSON file containing Korean translations for agent skills. It includes greetings, workspace descriptions, and user credit information, preserving placeholders like {appName} and {count}, as well as HTML tags. ```json { "app": { "welcome": "{appName}에 오신 것을 환영합니다!", "description": "워크스페이스 설정 관리" }, "user": { "credits": "{count}개의 크레딧이 남아 있습니다" } } ``` -------------------------------- ### Content Creation Prompt Optimization Example (Text) Source: https://context7.com/ckanner/agent-skills/llms.txt Shows how a generic content request like 'Write a blog post about AI' is transformed into a detailed, structured prompt with specific requirements for audience, tone, structure, and content length. This ensures the AI generates a more targeted and effective blog post. ```text # Original Prompt (Vague): "Write a blog post about AI" # Optimized Prompt: """ Write a 1,200-word blog post about practical applications of AI in small business operations. Target audience: Small business owners (10-50 employees) with limited technical background who are curious about AI but skeptical about ROI. Tone: Encouraging but realistic, conversational, no hype Structure: 1. Opening hook: Common small business challenge 2. 3-4 specific AI use cases with real cost/time savings 3. "Getting started" section with concrete first steps 4. Address common concerns (cost, complexity, data privacy) 5. Closing: Balanced perspective on AI adoption Include at least one concrete example with specific numbers. Avoid overly technical jargon. If technical terms are necessary, explain them simply. """ ``` -------------------------------- ### Jta CLI: Update All Languages Incrementally Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/incremental-mode.md Command to update all specified target languages incrementally from a single source file, suitable for broad localization efforts. ```bash # Update all languages incrementally jta en.json --to zh,ja,ko,es,fr --incremental -y ``` -------------------------------- ### Install Agent Skills Globally (Individual Users) Source: https://github.com/ckanner/agent-skills/blob/main/README.md Instructions for copying agent skills to the global Claude skills directory for individual users. This makes the skills available across all projects on the user's machine. ```bash # Clone the repository git clone https://github.com/hikanner/agent-skills.git # Copy specific skills cp -r agent-skills/prompt-optimizer ~/.claude/skills/ cp -r agent-skills/jta ~/.claude/skills/ # Or use symbolic links (recommended for development) ln -s $(pwd)/agent-skills/prompt-optimizer ~/.claude/skills/prompt-optimizer ln -s $(pwd)/agent-skills/jta ~/.claude/skills/jta ``` -------------------------------- ### Chain of Thought Reasoning Examples Source: https://context7.com/ckanner/agent-skills/llms.txt Demonstrates structured reasoning techniques for complex tasks. Includes examples for complex problem-solving, structured output with reasoning, and prefilling JSON. ```text # For Complex Problem Solving: """ Analyze this contract clause. Follow these reasoning stages: 1. Identify the key obligations 2. Note any ambiguous language 3. Assess potential risks 4. Provide final interpretation """ # For Structured Output with Reasoning: """ Solve this problem. Use this format: [Your step-by-step thinking] [Your final answer] """ # For Prefilling (JSON Output): # User: Extract the name and price from this product description into JSON. # Assistant: { # Result: The AI continues directly with JSON, no preamble. ``` -------------------------------- ### Updated Translation (zh.json) Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/incremental-mode.md Shows the corresponding updated Chinese translation file after incremental changes have been detected and applied. ```json { "app": { "welcome": "欢迎来到 {appName}!开始您的旅程", "features": { "newFeature": "新功能" } }, "user": { "credits": "您的账户有 {count} 积分", "preferences": { "theme": "主题偏好", "language": "语言偏好" } }, "settings": { "notification": { "email": "电子邮件通知", "push": "推送通知" } } } ``` -------------------------------- ### Execute Incremental Translation Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/incremental-mode.md This command initiates an incremental translation process. It specifies the source file ('locales/en.json'), the target language ('zh' for Chinese), and enables incremental mode to only translate changed or new keys. ```bash jta locales/en.json --to zh --incremental ``` -------------------------------- ### Execute Jta Translation (Bash) Source: https://github.com/ckanner/agent-skills/blob/main/jta/SKILL.md This section provides various examples of how to use the 'jta' command for translating JSON files. It demonstrates basic translation to single or multiple languages, incremental updates, specifying output files, non-interactive mode, overriding the AI model, and translating specific keys while excluding others. It emphasizes the use of the `$PROVIDER_FLAG` determined in a previous step. ```bash # Basic translation with detected provider jta --to $PROVIDER_FLAG # Examples: # Single language jta en.json --to zh $PROVIDER_FLAG # Multiple languages jta en.json --to zh,ja,ko $PROVIDER_FLAG # Incremental mode (for updates) jta en.json --to zh --incremental $PROVIDER_FLAG # With custom output jta en.json --to zh --output ./locales/zh.json $PROVIDER_FLAG # Non-interactive mode (for multiple languages) jta en.json --to zh,ja,ko,es,fr -y $PROVIDER_FLAG # Override with specific model for quality jta en.json --to zh --provider anthropic --model claude-sonnet-4-5 # Translate specific keys only jta en.json --to zh --keys "settings.*,user.*" $PROVIDER_FLAG # Exclude certain keys jta en.json --to zh --exclude-keys "admin.*,internal.*" $PROVIDER_FLAG ``` -------------------------------- ### Jta CLI: Full Re-translation Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/incremental-mode.md Command-line interface usage for Jta to perform a full re-translation without incremental mode, useful for major changes or quality checks. ```bash jta en.json --to zh # without --incremental ``` -------------------------------- ### Incremental Detection Logic Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/incremental-mode.md The core logic for incremental detection in Jta, outlining the steps from loading source and existing translations to identifying changes and performing translation. ```text 1. Load source (en.json) 2. Load existing translation (zh.json) 3. For each key in source: - Calculate content hash of source value - Compare with hash stored in previous translation - If different → mark as "modified" - If not in previous → mark as "new" 4. For each key in previous translation: - If not in source → mark as "deleted" 5. Translate only "new" + "modified" 6. Merge with "unchanged" 7. Remove "deleted" ``` -------------------------------- ### Check for OPENAI_API_KEY environment variable Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md This bash snippet verifies if the 'OPENAI_API_KEY' environment variable is set, which is necessary for the 'jta' tool to authenticate with the AI provider for translation services. It prints a success message if the key is found. ```bash # Check if API key exists if [[ -n "$OPENAI_API_KEY" ]]; then echo "✓ API key found" fi ``` -------------------------------- ### List translated JSON files Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md This bash command lists the details (permissions, owner, size, name) of all JSON files within the 'locales/' directory, including the newly created Chinese, Japanese, and Korean translation files. It's used to verify that the translation process created the expected output files. ```bash # Check created files ls -lh locales/*.json ``` -------------------------------- ### Sample English JSON translation source Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md Provides a sample JSON object representing English translations for an application. It includes keys for app name, welcome message, description with HTML tags, and user credits with a placeholder. This serves as the input for the translation process. ```json { "app": { "welcome": "Welcome to {appName}!", "description": "Manage your workspace settings" }, "user": { "credits": "You have {count} credits remaining" } } ``` -------------------------------- ### Install Agent Skills for Project Teams (Project Skills) Source: https://github.com/ckanner/agent-skills/blob/main/README.md Method for adding agent skills to a project's `.claude/skills/` directory for team collaboration. Skills added this way are automatically available to team members who clone the repository. ```bash # In your project root mkdir -p .claude/skills # Copy the skills you need cp -r /path/to/agent-skills/prompt-optimizer .claude/skills/ cp -r /path/to/agent-skills/jta .claude/skills/ # Commit to version control git add .claude/skills git commit -m "feat: add agent skills for team" ``` -------------------------------- ### Find JSON files in locale directories Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md This bash command searches the current directory and its subdirectories for files named 'en.json' within common locale directory patterns ('locales/', 'locale/', 'i18n/'). It's used to locate the source internationalization file. ```bash find . -type f -name "en.json" ( -path "*/locales/*" -o -path "*/locale/*" -o -path "*/i18n/*" ) ``` -------------------------------- ### Configure Agent Skills via Team Settings Source: https://github.com/ckanner/agent-skills/blob/main/README.md Configuration for automatic installation of agent skills within a team project using the `.claude/settings.json` file. This method ensures all team members have the same skills enabled. ```json { "extraKnownMarketplaces": { "kanner-agent-skills": { "source": { "source": "github", "repo": "hikanner/agent-skills" } } }, "enabledPlugins": { "prompt-optimizer@kanner-agent-skills": true, "jta@kanner-agent-skills": true } } ``` -------------------------------- ### Sample Chinese JSON translation output Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md Presents the Chinese translation of the sample English JSON. It demonstrates how placeholders like '{appName}' and HTML tags like '' are preserved, and the text content is accurately translated into Simplified Chinese. ```json { "app": { "welcome": "欢迎来到 {appName}!", "description": "管理您的工作空间设置" }, "user": { "credits": "您还有 {count} 积分" } } ``` -------------------------------- ### Upload Skill via Anthropic API (Python) Source: https://github.com/ckanner/agent-skills/blob/main/README.md This Python code uses the `anthropic` library to upload a skill ZIP file to your workspace via the API. It requires the `anthropic` package to be installed and an API key configured. The output includes the ID of the uploaded skill. ```python from anthropic import Anthropic client = Anthropic() # Upload skill with open("prompt-optimizer.zip", "rb") as f: skill = client.beta.skills.create( skill_file=f, betas=["skills-2025-10-02"] ) print(f"Skill ID: {skill.id}") ``` -------------------------------- ### Jta JSON Translation Examples Source: https://context7.com/ckanner/agent-skills/llms.txt Illustrates the input and output format for the Jta translation skill, including source JSON and translated JSON for Chinese and Japanese. It shows how placeholders and HTML tags are preserved. ```json // Source: locales/en.json { "app": { "welcome": "Welcome to {appName}!", "description": "Manage your workspace settings" }, "user": { "credits": "You have {count} credits remaining" } } // Output: locales/zh.json (Chinese) { "app": { "welcome": "欢迎来到 {appName}!", "description": "管理您的工作空间设置" }, "user": { "credits": "您还有 {count} 积分" } } // Output: locales/ja.json (Japanese) { "app": { "welcome": "{appName}へようこそ!", "description": "ワークスペースの設定を管理" }, "user": { "credits": "残り {count} クレジットがあります" } } ``` -------------------------------- ### Validate JSON structure of translated files Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md This loop iterates through the translated JSON files ('zh.json', 'ja.json', 'ko.json') in the 'locales/' directory and uses 'jq empty' to validate their JSON structure. It prints a success message for each valid JSON file, ensuring data integrity. ```bash for file in locales/{zh,ja,ko}.json; do if jq empty "$file" 2>/dev/null; echo "✓ $file is valid JSON" fi done ``` -------------------------------- ### Execute translation to multiple languages with jta Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/basic-translation.md This command uses 'jta' to translate the 'locales/en.json' file to Chinese ('zh'), Japanese ('ja'), and Korean ('ko'). The '-y' flag likely confirms any prompts automatically. The tool handles terminology detection, batch processing, AI translation, and output file generation. ```bash # Translate to Chinese, Japanese, and Korean jta locales/en.json --to zh,ja,ko -y ``` -------------------------------- ### Optimized Prompt for Sales Data Analysis Source: https://context7.com/ckanner/agent-skills/llms.txt An example of an optimized prompt designed to analyze Q4 sales data. It specifies key questions, context, desired output format, and handling for insufficient data. This prompt is intended for AI analysis. ```text Analyze the attached Q4 sales data to identify growth opportunities for Q1 planning. Key questions to answer: 1. Which product categories showed strongest/weakest growth? 2. Are there regional performance patterns? 3. What seasonal trends are evident? 4. Which customer segments are growing/shrinking? Context: This analysis will inform Q1 budget allocation across product lines and regions. Output format: - Executive summary (3-4 key findings) - Detailed findings for each question with supporting data - 3-5 actionable recommendations prioritized by potential impact If the data is insufficient to answer any question confidently, state what additional data would be needed. ``` -------------------------------- ### Download Skills as ZIP Archives (Bash) Source: https://github.com/ckanner/agent-skills/blob/main/README.md This snippet demonstrates how to package agent skills into ZIP archives using the `zip` command in a bash environment. It's a prerequisite for uploading skills to the Claude.ai web interface. ```bash cd agent-skills zip -r prompt-optimizer.zip prompt-optimizer/ zip -r jta.zip jta/ ``` -------------------------------- ### Testing i18n Translation Workflow: Add New Keys Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/ci-cd-integration.md This section provides bash commands to test the i18n translation workflow by adding new keys to the `locales/en.json` file. It includes steps to modify the file, commit the changes, and push them to the repository, outlining the expected outcome of the GitHub Actions trigger and subsequent translation process. ```bash # Add new keys to en.json vim locales/en.json # Add: # { # "new": { # "feature": "New Feature", # "description": "This is a new feature" # } # } # Commit and push: git add locales/en.json git commit -m "feat: add new feature translations" git push ``` -------------------------------- ### Set Up GitHub Repository Secret for API Key Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/ci-cd-integration.md Instructions to add the 'OPENAI_API_KEY' as a secret in GitHub repository settings. This is crucial for the CI/CD workflow to authenticate with the OpenAI API for translation services. The secret should be stored securely and accessed within the GitHub Actions environment. ```bash # In GitHub repository settings: # 1. Go to Settings → Secrets and variables → Actions # 2. Click "New repository secret" # 3. Name: OPENAI_API_KEY # 4. Value: your OpenAI API key (sk-...) # 5. Click "Add secret" ``` -------------------------------- ### Jta CI/CD Integration with GitHub Actions (YAML) Source: https://context7.com/ckanner/agent-skills/llms.txt An example GitHub Actions workflow in YAML format that automates the Jta translation process. This workflow is triggered when source files change, ensuring translations are kept up-to-date. ```yaml name: Jta Translation on: push: branches: - main paths: - 'locales/**.json' jobs: translate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Jta uses: hikanner/setup-jta@v1 with: version: 'latest' # Optional: Specify provider and API key # provider: 'openai' # api-key: ${{ secrets.OPENAI_API_KEY }} - name: Translate locales run: | jta locales/en.json --to zh,ja,ko --incremental - name: Commit and push translations uses: EndBug/add-and-commit@v9 with: message: "chore: update translations" default_author: name: 'GitHub Actions' email: 'actions@github.com' ``` -------------------------------- ### Upload and Use Agent Skill via Anthropic API (Python) Source: https://context7.com/ckanner/agent-skills/llms.txt Demonstrates uploading an agent skill from a ZIP file and then using it in an API call to Anthropic's Claude models. This requires the `anthropic` Python library and specifies beta features for skill usage. ```python from anthropic import Anthropic client = Anthropic() # Upload skill from ZIP file with open("prompt-optimizer.zip", "rb") as f: skill = client.beta.skills.create( skill_file=f, betas=["skills-2025-10-02"] ) print(f"Skill ID: {skill.id}") # Use the skill in API calls response = client.beta.messages.create( model="claude-sonnet-4-5-20250929", max_tokens=4096, betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [ {"type": "workspace", "skill_id": skill.id, "version": "latest"} ] }, tools=[{"type": "code_execution_20250825", "name": "code_execution"}], messages=[{"role": "user", "content": "Optimize this prompt: Write about marketing"}] ) print(response.content) ``` -------------------------------- ### Use Uploaded Skill in API Messages (Python) Source: https://github.com/ckanner/agent-skills/blob/main/README.md This Python snippet shows how to integrate an uploaded skill into an API call to Claude. It specifies the skill ID in the `container` configuration and enables necessary betas for skill execution. Ensure the `anthropic` library is installed and configured. ```python response = client.beta.messages.create( model="claude-sonnet-4-5-20250929", max_tokens=4096, betas=["code-execution-2025-08-25", "skills-2025-10-02"], container={ "skills": [ {"type": "workspace", "skill_id": skill.id, "version": "latest"} ] }, tools=[{"type": "code_execution_20250825", "name": "code_execution"}], messages=[{"role": "user", "content": "Your request"}] ) ``` -------------------------------- ### Create Workflow Directory Source: https://github.com/ckanner/agent-skills/blob/main/jta/examples/ci-cd-integration.md This bash command ensures that the necessary directory structure for GitHub Actions workflows exists within the repository. It creates the '.github/workflows' directory if it does not already exist, preparing the environment for the workflow file. ```bash # Create workflow directory if it doesn't exist mkdir -p .github/workflows ``` -------------------------------- ### Automate i18n Translation with GitHub Actions and Jta Source: https://context7.com/ckanner/agent-skills/llms.txt This workflow automates the translation of i18n files using Jta. It checks out the repository, installs Jta, translates specified languages, checks for changes, and commits/pushes translations if modifications are detected. Requires OPENAI_API_KEY secret. ```yaml name: Auto-translate i18n files on: push: branches: - main - develop paths: - 'locales/en.json' jobs: translate: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Jta run: | curl -L https://github.com/hikanner/jta/releases/latest/download/jta-linux-amd64 -o jta chmod +x jta sudo mv jta /usr/local/bin/ jta --version - name: Translate to all languages env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} run: | jta locales/en.json --to zh,ja,ko,es,fr --incremental -y - name: Check for translation changes id: check_changes run: | if [[ -n $(git status -s locales/*.json) ]]; then echo "changes=true" >> $GITHUB_OUTPUT else echo "changes=false" >> $GITHUB_OUTPUT fi - name: Commit and push translations if: steps.check_changes.outputs.changes == 'true' run: | git config user.name "Translation Bot" git config user.email "bot@example.com" git add locales/*.json .jta/ git commit -m "chore: auto-translate i18n files" git push ``` -------------------------------- ### Jta: Set API Keys for Translation Providers Source: https://github.com/ckanner/agent-skills/blob/main/jta/SKILL.md This section provides instructions on how to set environment variables for API keys required by different translation providers like OpenAI, Anthropic, and Google Gemini. Correctly setting these keys is essential for authentication. ```bash Jta requires an AI provider API key. Please set one of: For OpenAI (recommended): export OPENAI_API_KEY=sk-... Get key at: https://platform.openai.com/api-keys For Anthropic: export ANTHROPIC_API_KEY=sk-ant-... Get key at: https://console.anthropic.com/ For Google Gemini: export GEMINI_API_KEY=... Get key at: https://aistudio.google.com/app/apikey ```