GrepBoard/Manuals
605 manuals ·

Get Language Corrections in One Table After ChatGPT Role-Play

·Tested on Claude Sonnet 5.5 · 2026-10·Test scope ↓·5 steps

Keep the AI in character during role-play, get your mistakes in one table at the end, and check by script that each planted error appears once, quoted exactly.

Practicing conversation with an AI partner breaks down when grammar feedback intrudes after every sentence. Turning feedback off entirely leaves repeated mistakes unnoticed. Separate the conversation from the review: keep the AI strictly in character during the dialogue, and collect all corrections in a Markdown table with | Original | Revised | Reason | once the session finishes. A similar verification workflow appears in getting proofreading changes as a table.

[1] Test the limitation of an unsegmented role-play prompt.

Mixing character instructions and error correction into a single conversational prompt makes the model correct speech immediately after each user reply.

run/short-en.prompt.txt
You are a server at a bistro. I want to practice conversational English.Correct my grammatical mistakes after each turn and continue the dialogue. Customer: Hello! Can you recommend me the chef's special?

Running this prompt yields mid-dialogue grammar commentary. The runs were made from an empty folder outside the repository, because instruction files in parent folders are read when you run inside a project.

console
$ claude -p --model claude-sonnet-5-5 --max-turns 1 --tools "" --setting-sources "" --strict-mcp-config < run/short-en.prompt.txt > run/short-en.out.txt$ cat run/short-en.out.txtGood evening, and welcome to our bistro! Tonight's chef's special is pan-seared salmon with lemon butter sauce……--- **Grammar correction:**- Your sentence: "Can you recommend me the chef's special?"- Corrected: "Can you **recommend the chef's special to me**?" or simply "Can you **tell me about** the chef's special?"…

The model appends grammar lectures after the server's response. Interrupting after each turn fractures conversational immersion.

[2] Separate system instructions from the completion trigger.

OpenAI's Prompt Engineering Guide advises placing persistent rules in a developer message and dividing prompt sections with Markdown headers. The system prompt in this post follows that layout.

Define a system prompt (roleplay-en.system.txt) that enforces role-play silence during dialogue and generates feedback only upon receiving an explicit completion token. The prompt below is a finished version with fixed values. To adapt it, change the character and place (Jordan, bistro) and the end signal (END_ROLEPLAY).

text
# Role and GoalYou are Jordan, a friendly and attentive server at a bistro.The user is a diner practicing conversational English. # Interaction Rules1. Stay in character: During the conversation, respond naturally to the guest's orders and inquiries. Do NOT interrupt, comment on, or correct any language errors while the role-play is ongoing.2. End Trigger: When the user enters "END_ROLEPLAY", the role-play session ends immediately.3. Feedback Output: After the role-play ends, output ONLY a Markdown table summarizing errors found in the user's utterances. Do not output conversational filler, greetings, or sign-offs. # Table Specifications- Output columns must be exactly: | Original | Revised | Reason |- Include ONLY user utterances that contain genuine grammatical, lexical, or phrasing errors.- Do NOT rewrite or include sentences that are already grammatically acceptable (strictly avoid over-correction).- In the "Original" column, copy the exact phrase character-for-character from the user's utterance.- In the "Reason" column, write a concise explanation in English.- If no errors are found, output exactly: None

[3] Pass the dialogue transcript to trigger the correction table.

Submit a conversation log (roleplay-en.prompt.txt) containing six user turns, three of which carry intentional mistakes:

  • Turn 2: recommend me the chef's special (indirect object error)
  • Turn 3: one sandwichs (plural ending on singular count)
  • Turn 4: if we adds extra cheese (subject-verb disagreement)
  • Turns 1, 5, 6: Acceptable phrases without structural errors
run/roleplay-en.prompt.txt
# Conversation TranscriptCustomer: Hello, could we get a table for two near the window?Jordan: Welcome to Bistro Lumiere! Yes, we have a lovely table by the window right this way. Here are your menus.Customer: Thank you. Can you recommend me the chef's special?Jordan: Certainly! Tonight's special is grilled salmon served with asparagus and roasted potatoes.Customer: That sounds delicious. I would like to order two coffees and one sandwichs.Jordan: Excellent choices. One salmon special, two coffees, and a sandwich. Would you like any extra cheese or toppings?Customer: How much does it cost if we adds extra cheese?Jordan: Extra cheddar or mozzarella is just one dollar additional.Customer: Perfect, please add extra cheese. Could you bring the check whenever you have a moment?Jordan: Right away. I'll get your drinks started first and bring everything out shortly.Customer: Thank you for the excellent service. END_ROLEPLAY

Execute the prompt with the system instructions attached.

console
$ claude -p --model claude-sonnet-5-5 --max-turns 1 --tools "" --setting-sources "" --strict-mcp-config --system-prompt "$(cat run/roleplay-en.system.txt)" < run/roleplay-en.prompt.txt > run/roleplay-en.1.out.txt$ cat run/roleplay-en.1.out.txt| Original | Revised | Reason ||---|---|---|| Can you recommend me the chef's special? | Can you recommend the chef's special? | "Recommend" does not take an indirect object directly. Use "recommend something (to me)" or drop "me". || one sandwichs | one sandwich | "One" needs a singular noun. "Sandwich" is already singular, so the "-s" is wrong. || if we adds extra cheese | if we add extra cheese | The subject "we" needs the base form "add", not the third-person singular "adds". |

The output contains solely the Markdown table with the three planted errors. Acceptable turns were excluded.

A second execution (roleplay-en.2.out.txt) named the same three phrases. The Reason column was worded differently in all three rows.

[4] Validate verbatim matches with a Python check script.

check_corrections.py checks that each string in the Original column appears exactly once in the user's lines and that no row repeats. Pass the planted error phrases (recommend me, one sandwichs, we adds) as arguments and it also checks that each one sits in exactly one row and that no other row is present (EXTRA). It does not judge the Revised or Reason columns.

run/check_corrections.py
#!/usr/bin/env python3"""usage: check_corrections.py prompt.txt out.txt frag [frag ...]frag = a planted-error phrase that must be covered by exactly one table row."""import sys prompt = open(sys.argv[1], encoding="utf-8").read()out = open(sys.argv[2], encoding="utf-8").read().strip()planted = sys.argv[3:] users = [l.split(":", 1)[1].strip() for l in prompt.splitlines() if any(l.startswith(p) for p in ("Guest:", "Customer:", "User:"))]text = " ".join(" ".join(users).split())rows = [l.strip()[1:-1].split("|") for l in out.splitlines() if l.strip().startswith("|")]rows = [[c.strip().strip("`") for c in r] for r in rows if len(r) >= 3 and not set("".join(r[:2])) <= set("-: ")][1:] bad, seen = 0, set()for i, (orig, rev, *_) in enumerate(rows, 1):    n = text.count(orig)    dup = orig in seen    seen.add(orig)    if dup:        flag = "DUP "    elif n == 0:        flag = "MISS"    elif n > 1:        flag = "AMBG"    elif planted and not any(p in orig for p in planted):        flag = "EXTRA"    else:        flag = "OK"    if flag != "OK": bad += 1    print(f"{flag:5} {i}: {orig!r} -> {rev!r}")for p in planted:    hits = sum(1 for r in rows if p in r[0])    if hits != 1:        print(f"GAP   planted {p!r} covered by {hits} rows")        bad += 1if not rows and not planted:    print("no rows found"); bad += 1print(f"{len(rows)} rows, {bad} problem(s)")sys.exit(1 if bad else 0)

Run it on both outputs.

console
$ python run/check_corrections.py run/roleplay-en.prompt.txt run/roleplay-en.1.out.txt "recommend me" "one sandwichs" "we adds"OK    1: "Can you recommend me the chef's special?" -> "Can you recommend the chef's special?"OK    2: 'one sandwichs' -> 'one sandwich'OK    3: 'if we adds extra cheese' -> 'if we add extra cheese'3 rows, 0 problem(s)$ python run/check_corrections.py run/roleplay-en.prompt.txt run/roleplay-en.2.out.txt "recommend me" "one sandwichs" "we adds"OK    1: "Can you recommend me the chef's special?" -> "Can you recommend the chef's special?"OK    2: 'one sandwichs' -> 'one sandwich'OK    3: 'if we adds extra cheese' -> 'if we add extra cheese'3 rows, 0 problem(s)

Both runs: every row OK, no problems.

Hand-made bad inputs test the script (not model output). The English set is an altered phrase (test-bad-orig-en.txt), an added row for a correct sentence (test-extra-en.txt) and a dropped error row (test-missing-en.txt); each exits with code 1. The added correct sentence looks like this:

console
$ python run/check_corrections.py run/roleplay-en.prompt.txt run/test-extra-en.txt "recommend me" "one sandwichs" "we adds"OK    1: "Can you recommend me the chef's special?" -> "Can you recommend the chef's special?"OK    2: 'one sandwichs' -> 'one sandwich'OK    3: 'if we adds extra cheese' -> 'if we add extra cheese'EXTRA 4: 'Could you bring the check whenever you have a moment?' -> 'Would you mind bringing the check when convenient?'4 rows, 1 problem(s)

What it cannot catch: you must supply the planted phrases yourself, a real error outside that list shows up as EXTRA, and whether the revision or the reason is right still needs a human reading.

[5] Where it can go wrong.

  • On the hotel check-in transcript used for the Korean edition, run 1 also changed an article that was not part of the planted error, and run 2 on the same input left it alone. The English runs here showed no extra change, and one repeat cannot say which behavior is typical, so judge any article edit yourself.
  • The three correct customer turns did not appear in the table in either English run. The prompt was not compared against a version without the strictly avoid over-correction line, so whether that line is what kept them out was not tested in this run.
  • One transcript with three planted errors was run. A transcript with no errors (does it print None?) and a long transcript (does it miss errors?) were not tested in this run.

#roleplay#prompt#language-learning#english-practice