Guidelines for safely deleting dictionary entries while properly updating indexes and cross-references.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Guidelines for safely deleting dictionary entries while properly updating indexes and cross-references.
Safely Deleting Dictionary Entries
Use this skill when you need to remove an entry from the dictionary. This ensures all indexes and cross-references are properly updated.
When to Delete an Entry
Valid reasons for deletion:
Duplicate entry - Another entry exists for the same word (see resolve-duplicates skill)
Erroneous entry - Entry contains fundamental errors that cannot be corrected
Out of scope - Word doesn't belong in a learner's dictionary (too obscure, offensive, etc.)
Merged into another entry - Content has been incorporated elsewhere
Do NOT delete entries just because they need improvement - use revise-entries skill instead.
Pre-Deletion Checklist
Before deleting any entry:
Confirm deletion is necessary - Can the entry be fixed instead?
Note the entry details for later reference:
Entry ID (e.g., 00123_taberu)
Reading (e.g., たべる)
Headword (e.g., {食べる|たべる})
File path (e.g., entries/00000/00123_taberu.json)
Check for cross-references to this entry from other entries
Decide if word should return to candidates (if it still needs an entry later)
Step 1: Find Cross-References to This Entry
Search for other entries that reference the entry you're deleting:
# Search by reading
grep -r '"reading": "たべる"' entries/ --include="*.json" -l
# Search by headword text (without furigana)
grep -r '食べる' entries/ --include="*.json" -l
# Search in cross_references arrays specifically
grep -r '"cross_references"' entries/ -A 20 | grep -B 5 '"reading": "たべる"'
Step 2: Update Cross-References in Other Entries
For each entry that references the one being deleted:
Option A: Remove the cross-reference
If the reference is no longer relevant:
// Before"cross_references":[{"type":"related","reading":"たべる","headword":"{食べる|たべる}","label":"to eat"}]// After (remove the reference)"cross_references":[]
Option B: Update to point to replacement entry
If a better entry exists (e.g., after merging duplicates):
// Update the reading/headword/label to match the kept entry"cross_references":[{"type":"related","reading":"たべる","headword":"{食べる|たべる}","label":"to eat"}]
Option C: Keep as informational reference
If the cross-reference is still useful even without a target entry, you may keep it. The reference will simply not link to anything.
Step 3: Delete the Entry File
# Remove the entry filerm entries/{range}/{entry_id}.json
# Example:rm entries/04500/04567_taberu.json
Verify deletion:
ls entries/04500/04567_taberu.json # Should return "No such file"
Step 4: Update Indexes
Run the index update script:
python3 build/update_indexes.py
This script automatically:
Removes the entry from entries_index.json
Updates entry counts
Syncs with candidate_words.json
Step 5: Optionally Re-add to Candidates
If the word should eventually have an entry (just not this flawed one):
Check if update_indexes.py already re-added it to candidates
If not, manually add to candidate_words.json:
{"reading":"たべる","headword":"食べる","english":"to eat","notes":"Previous entry deleted due to [reason]. Needs new entry."}
Step 6: Rebuild the Flat File
python3 build/build_flat.py
This updates the website data. Without this step, the deleted entry may still appear on the live site.