A/B test comparing prompt-over-code vs old script approaches for quote extraction in translation notes. Use when asked to run the test-poc or compare quote extraction methods.
Compare Claude's semantic Hebrew quote selection against old fuzzy-matching scripts, and validate AT fit on existing notes output.
/test-poc -- run both tests on default chapter (PSA 128)
/test-poc quote 125 -- Hebrew quote test only, on PSA 125
/test-poc at-fit -- AT fit test only on existing output
/test-poc at-fit 130 -- AT fit test on PSA 130
Parse arguments from the skill invocation:
quote, at-fit, or omitted for both)data/hebrew_bible/ in this repo. If missing, try sibling cSkillBP repo ().../cSkillBP/output/AI-ULT/ in this repo. If missing, try sibling cSkillBP repo.{ch} is the zero-padded chapter, e.g. 128):
ALIGNED = {output_root}/output/AI-ULT/PSA/PSA-{ch}-aligned.usfmISSUES = {output_root}/output/issues/PSA/PSA-{ch}.tsvHEBREW = {data_root}/data/hebrew_bible/19-PSA.usfm/tmp/claude/ exists:
mkdir -p /tmp/claude
This is the main comparison. The old script uses fuzzy sliding-window matching to find Hebrew words. Claude uses semantic understanding of the English-to-Hebrew alignment data.
node .claude/skills/tn-writer/scripts/.old/extract_quotes_from_alignment.js \
{ALIGNED} {ISSUES} --output /tmp/claude/test_old_quotes.json
If no JS equivalent exists, skip this step and note that old-script baseline is unavailable.
This produces a JSON array where each item has: reference, gl_quote, orig_quote (Hebrew), gl_quote_roundtripped.
Use mcp__workspace-tools__extract_alignment_data with alignedUsfm="{ALIGNED}", output="/tmp/claude/test_alignment.json".
This produces a JSON object keyed by "chapter:verse", where each value is an array of alignment records: {eng, heb, heb_pos, strong}.
Read three files:
/tmp/claude/test_old_quotes.json)/tmp/claude/test_alignment.json){ISSUES}) -- 7-column format: Book, Ref, SRef, GLQuote, Go?, AT, Explanation{HEBREW}) -- extract verses for this chapter by finding \c {chapter} then reading \v markers. Each \w surface|attrs\w* token is a Hebrew word.For each issue item (skipping :intro and :front references):
gl_quote (the English phrase to match)eng (English word), heb (Hebrew word), heb_pos (position), strong (Strong's number)gl_quote words:
gl_quote to the eng fields in the alignment records{like this} that have no Hebrew alignment -- skip thoseheb values from the matched alignment records\w token in it\w token. Copy text exactly from the source -- do not generate Hebrew from memory.Record the result as new_hebrew for this item.
For each item, collect:
ref -- the verse reference (e.g. 128:1)gl_quote -- the English phraseold_hebrew -- from old script results (orig_quote field)new_hebrew -- from Claude's work in Step 4old_valid -- is each word in old_hebrew a substring of the Hebrew source verse?new_valid -- is each word in new_hebrew a substring of the Hebrew source verse?old_order -- do the words in old_hebrew appear in left-to-right order in the source verse?new_order -- do the words in new_hebrew appear in left-to-right order in the source verse?old_dupes -- does old_hebrew contain duplicate Hebrew words?new_dupes -- does new_hebrew contain duplicate Hebrew words?agree -- do old and new produce the same Hebrew quote?Compute summary counts:
Write results to /tmp/claude/poc_ab_report.md (created or overwritten). Print a brief summary to the conversation.
Validation-only: checks substitution quality of existing notes output. No note generation.
Check these locations in order:
/tmp/claude/prepared_notes.json AND /tmp/claude/generated_notes.json (both must exist){output_root}/output/notes/PSA/PSA-{ch}.tsv{output_root}/output/notes/PSA/PSA-{ch}.tsv (same as #2)If none found, report clearly and skip this test.
Use mcp__workspace-tools__verify_at_fit with:
preparedJson="/tmp/claude/prepared_notes.json" and generatedJson="/tmp/claude/generated_notes.json" if those files existnotesTsv="{path_to_notes_tsv}" if a notes TSV was found insteadWrite results to /tmp/claude/poc_atfit.json.
Read /tmp/claude/poc_atfit.json and extract the at_fit test results. Append findings to the report.
Write /tmp/claude/poc_ab_report.md:
# Prompt-Over-Code A/B Results
## Hebrew Quote Selection (PSA {chapter})
Items tested: N
| Metric | Old Script | Claude |
|--------|-----------|--------|
| Valid Hebrew quotes | X/N | Y/N |
| Correct word order | X/N | Y/N |
| Duplicate words | X | Y |
Agreement: Z/N items produced identical Hebrew quotes.
### Disagreements
| Ref | GL Quote | Old Hebrew | New Hebrew | Notes |
|-----|----------|-----------|-----------|-------|
| ... | ... | ... | ... | which is valid, order issues, etc. |
(Only rows where old != new)
## AT Fit (PSA {chapter})
Items checked: N
Orphaned conjunctions: X
Orphaned prepositions: Y
Capitalization errors: Z
### Flagged Items
| Ref | Issue | AT | Substitution |
|-----|-------|-----|-------------|
| ... | conj/prep/cap | ... | ... |
After writing the report, print a short summary to the conversation with the key numbers and the path to the full report.