Skip to content

whchi/prompt2eng

Repository files navigation

prompt2eng

CLI tool to generate customized prompt2eng skills for AI agents.

Installation

Global installation

bun install -g prompt2eng

Using bunx (no install)

bunx prompt2eng

Usage

Run the CLI without any arguments to start the interactive installer:

prompt2eng

Interactive Flow

  1. Select AI Tool

    • opencode — for OpenCode CLI
    • claude code — for claude.ai / Claude Code
    • other — support .agents and AGENTS.md, like Codex, Gemini...
  2. Select Language (BCP-47 tag)

    • Choose from supported languages: zh, ja, ko, es, ru, fr, de, pt, it
  3. Select Region (if multiple options)

    • For languages with multiple regions, select the appropriate one
    • Single-region languages (ja, ko, ru, pt) are auto-selected
  4. Select CEFR Level

    • A1–C2 (default: B2)
  5. Confirm — Review and generate

Example Session

$ prompt2eng

Prompt To english Skill Generator

? Which AI tool are you using? OpenCode
  → config: ~/.config/opencode/AGENTS.md  skills: ~/.config/opencode/skills/prompt2eng

? Your language tag (type to search): zh
? Region for zh? TW

  ✓ BCP-47 tag: zh-TW

? Target English level (CEFR): B2 — Upper Intermediate (recommended)

  Tool:     opencode
  Language: zh-TW
  CEFR:     B2
  Skills:   ~/.config/opencode/skills/prompt2eng

? Generate skill with these settings? Yes

Installation Paths

OpenCode

  • Skills directory: ~/.config/opencode/skills/prompt2eng/
  • Config file: ~/.config/opencode/AGENTS.md

Claude

  • Skills directory: ~/.claude/skills/prompt2eng/
  • Config file: ~/.claude/CLAUDE.md

Other (Codex, Gemini, etc.)

  • Skills directory: ~/.agents/skills/prompt2eng/
  • Config file: ~/.agents/AGENTS.md

Configuration File Update

The CLI will:

  1. Scan for existing CLAUDE.md or AGENTS.md
  2. If found: Ask whether to add the skill to ## Required Skills
  3. If not found: Print a snippet for you to add manually

Manual Snippet

If no config file exists, add this to your AGENTS.md or CLAUDE.md:

## Required Skills

- **prompt2eng**: Use when the user's prompt contains [Language] text that needs translation to English before processing. Translates [Language] to CEFR [Level] English while preserving existing English, technical terms, and proper nouns.

CEFR Levels

Level Name Description
A1 Beginner Basic phrases and familiar everyday expressions
A2 Elementary Simple sentences and frequently used expressions
B1 Intermediate Clear standard communication on familiar matters
B2 Upper Intermediate Complex texts and technical discussion (default)
C1 Advanced Fluent expression without much searching
C2 Proficient Near-native precision and nuance

Supported Languages

Language BCP-47 Tag Description
Chinese zh-TW Traditional Chinese (Taiwan)
Chinese zh-HK Traditional Chinese (Hong Kong)
Chinese zh-CN Simplified Chinese (China)
Japanese ja-JP Japanese (Japan)
Korean ko-KR Korean (South Korea)
Spanish es-ES Spanish (Spain)
Spanish es-MX Spanish (Mexico)
Russian ru-RU Russian (Russia)
French fr-FR French (France)
French fr-CA French (Canada)
German de-DE German (Germany)
German de-CH German (Switzerland)
Portuguese pt-BR Portuguese (Brazil)
Italian it-IT Italian (Italy)
Italian it-CH Italian (Switzerland)

Development

Setup

bun install

Build

bun run build

Test

bun run test

Adding/Modifying Examples

Edit templates/languages.json to add or modify translation examples. Each language key contains an array of {input, output} pairs:

{
  "zh": [
    { "input": "請幫我寫一個 Python script", "output": "Please help me write a Python script" },
    ...
  ],
  "ja": [...],
  ...
}

Template Customization

Edit templates/SKILL.md.hbs to modify the skill structure:

  • {{skillName}} — Name of the skill
  • {{languageName}} — Human-readable language name
  • {{cefrLevel}} — CEFR level (A1–C2)
  • {{cefrDescription}} — Description of the level
  • {{#each examples}} — Loop through examples

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors