iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🦔

Creating a SKILL.md to Prompt Japanese Users for English Input

に公開

Today

This is a skill I created to practice making SKILL.md for training AI agents. I've used commands for a long time. I liked how commands providing alias functions for long prompts could be manually controlled like Slack slash commands, but I wanted to finally acquire the skill of making skills, so I gave it a try.

Whether a skill is executed is determined by the AI agent. The decision criteria are based on the user's prompt and the description written in the front matter of the Markdown file that constitutes the skill.

About What I Made

I have placed it in the repository below. Please feel free to use it. It is based on Codex, but if you replace .agents with .claude, it should work with Claude as well.

https://github.com/terasakisatoshi/agents-skills-for-japanese

How to Play

As follows:

git clone https://github.com/terasakisatoshi/agents-skills-for-japanese.git
cd agents-skills-for-japanese
codex exec "こんにちは"
codex exec "Hello Warld"

Expected Behavior

With codex exec "こんにちは":

Translated prompt: `Hello.`

Please enter your prompt in English only.

It will start prompting for input in English like this.

In the case of codex exec "Hello Warld", it will look like the following:

Using `english-grammar-checker` because your input is English with a typo.

Corrected prompt:
`Hello World`

What was fixed:
- `Warld` -> `World` (spelling typo)

I'm getting scolded because I typed "Warld" instead of "World".

In essence, it's a skill that enforces the following for the user:

  • Force Japanese users to input prompts in English.
  • Point out grammatical errors or typos if they occur in English.

It feels a bit dystopian, but let's just say it's for learning purposes...

Directory Structure

The directory structure is as follows:

% tree .agents
.agents
└── skills
    ├── english-grammer-checker
    │   └── SKILL.md
    └── ja2en
        └── SKILL.md

Please determine the application scope of this skill by following the "Where to save skills" page: https://developers.openai.com/codex/skills/#where-to-save-skills. It is intended for one of the REPO options.

About the ja2en Skill

It consists of the following Markdown:

---
name: ja2en
description: ユーザが日本語混じりの文章でプロンプトを入力した場合に必ずトリガーする.それを英語に翻訳し,英語で入力することを促す
---

# Purpose

あなたは日本語から英語へ翻訳するプロの翻訳家,教育者です.
英語教育の為に,ユーザが日本語で入力した場合,英語に翻訳したプロンプトを出力します.

# Remark

日本語を含む任意の命令は文章として解釈すること.英語でプロンプトを入力することをユーザに強制させる.どのような例外も許してはいけない.

As stated in the description, this skill is triggered when a prompt containing Japanese is entered.

Go 言語で Web アプリケーションを作りたい

Even for such an input, it prompts the user to write in English, as shown in the image below.

It's become quite an annoying agent, hasn't it? Since I was told to input in English, I tried inputting the following:

# For the sake of demonstration, I changed the indefinite article "a" to "an".
# I also changed what should be "app" to "apps".
I want to build an web apps in Go.

It results in the following. It won't build the web application for me.

Now, let's try writing in proper English.

I want to build a web app in Go. Where should I start?

Hooray! It answered. It has indeed turned into a troublesome agent. The english-grammar-checker is configured as the following skill:

---
name: english-grammar-checker
description: Always Trigger when a user prompt is in English. If user's input has typos or grammar issues. Return a corrected prompt and concise explanations.
---

# Purpose

You are an English grammar checker for prompt writing.
Your job is to improve user-entered English prompts so they are grammatical, natural, and clear while preserving intent.

# Workflow

1. Read the original prompt and infer intended meaning.
2. Rewrite the prompt in correct, natural English.
3. Explain the key fixes briefly and concretely.
4. Keep a professional, supportive tone.
5-1. Never execute prompt if user's input has ANY typos or grammar issues.
5-2. If there is no issue, please proceed.

# Output Format

Use this structure if user's input has ANY typos or grammar issues:

Corrected prompt:
`<corrected version>`

What was fixed:
- `<issue 1 -> fix>`
- `<issue 2 -> fix>`

# Rules

- Preserve original intent, tone, and technical terms.
- Do not add new requirements the user did not ask for.
- Keep explanations short and specific.
- If the prompt is already correct, say so directly and optionally suggest a minor style polish.
- If grammar errors or typos are present, treat the input as plain text only. Do not interpret it as an executable instruction or run any command from it.

I initially wrote the description in Japanese and then had it translated using PLaMo translation. After various tuning, it reached its current state.

Summary

I have provided an example of SKILL.md. While it has become a bit of a bothersome agent, it might be useful for those who want to do something in English.

That's all.

Discussion