character-merge
Skill1 starsChanged 13 days agoMITView on GitHub
Use when the user wants to merge, deduplicate, consolidate, or clean up duplicate CHARACTERS specifically. Triggers on "merge characters", "dedupe characters", "I have two records for [name]", "consolidate Drake and Drake Kingston", "find duplicate characters", "clean up my characters". If the user mentions locations or lore in the same breath, use `worldbuilding-merge` instead, it covers all three kinds with the same workflow.
In this repository29 other files it gives its agents.
- ads-studioSkill
- blog-post-and-newsletterSkill
- calendarSkill
- chapter-draftingSkill
- financeSkill
- getting-startedSkill
- manuscript-importSkill
- manuscript-revisionsSkill
- markersSkill
- marketing-studioSkill
- mentionsSkill
- pen-namesSkill
- quick-task-captureSkill
- sales-studioSkill
- social-handoffSkill
- story-bibleSkill
- stos-setupSkill
- tasksSkill
- timelineSkill
- time-trackingSkill
- wordpress-connectSkill
- wordpress-llm-optimizationSkill
- wordpress-mediaSkill
- wordpress-pagesSkill
- wordpress-postsSkill
- wordpress-productsSkill
- wordpress-seoSkill
- worldbuilding-mergeSkill
- worldbuildingSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
Default is 0.7. Lower it to catch more candidates (more false positives, more user review).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Character merge — cheap, server-side first
Why this skill exists
A naive merge flow ("list all characters, get each one, compare in conversation") loads the full text of every character into the chat window. With ~50 characters at ~4 KB each, that's 200 KB of context PLUS the full MCP tool schema replayed on every turn. One author burned ~90% of his Claude Pro budget in a single merge pass before this skill existed.
Two server-side tools do the expensive work for you. Use them.
The cheap workflow
stos_characters_find_duplicates({ penNameId?, seriesId?, minScore? })— call this FIRST. The server normalizes names, intersects aliases, and clusters candidates with similarity scores. Returns onlyid,name,aliases,score,matchedOnper candidate — small enough to display dozens of groups in one turn.- Show the candidate groups to the user. Let them confirm which groups to merge. They may want to merge some pairs but not others (e.g. "Drake" and "Drake Kingston" are the same person, but "Drake" and "Drake Senior" are father and son).
stos_characters_get_many({ ids: [...] })— for the candidates the user confirmed, bulk-fetch full records in ONE call. Cap is 100 ids per call. This is the only point where heavy character text enters the conversation.- Pick a "winner" record. Usually the one with the most complete fields (longest background, most aliases, has an image). Show the user your pick and let them override.
- Consolidate fields onto the winner. Combine
aliasesinto a single deduplicated array. Pick the best version of each text field (or concatenate if both have unique content). Callstos_characters_update({ id: winnerId, fields: { ... } }). - Preserve the loser's links before deleting. The duplicate may be referenced by other records — chapters, scenes, events, lore. Before deleting, you can:
- Call
stos_worldbuilding_link({ targetType: 'character', targetId: winnerId, ... })for each link the loser had — but the API doesn't currently expose a "list all links for character X" endpoint, so this step is limited. Tell the user: "I'll delete the duplicate, but any chapter/scene that was linked to it specifically will lose that link. Worth re-running the codex auto-detector after." (Seeworldbuildingskill for re-detection.)
- Call
stos_characters_delete({ id: loserId })— drop the duplicate.
What NOT to do
- ❌ Do not call
stos_characters_getin a loop. That's the expensive pattern this skill exists to replace. If you find yourself writingfor (id of ids) get(id), stop and usestos_characters_get_manyinstead. - ❌ Do not call
stos_characters_listand thengeton every result.find_duplicatesalready returns only the slim fields you need to start. - ❌ Do not skip the user-confirm step. Auto-merging without showing the candidate groups is dangerous — false positives (parent/child, mentor/protégé with similar names) will destroy real records.
- ❌ Do not delete the loser without consolidating fields first. Once it's gone, any unique text it had (an aliasing pattern, a backstory paragraph) is gone with it.
Tuning minScore
Default is 0.7. Lower it to catch more candidates (more false positives, more user review). Raise it to be conservative (may miss subtle dupes).
1.0— exact-name matches only0.95— exact name OR shared alias0.85— substring overlap ("Drake" ∈ "Drake Kingston")0.7(default) — token overlap on full name + aliases0.5— very permissive; expect many false positives
Example dialogue
User: I have duplicates in my characters. Can you clean them up?
You: I'll look for candidates first. (call
stos_characters_find_duplicates({ penNameId: 'xyz' }))Found 4 candidate groups:
- Drake + Drake Kingston (one is listed as the other's nickname)
- Sasha + Sasha M. (one name contains the other)
- Kat + Kat Pierson + Katherine Pierson (one is listed as the other's nickname)
- Eric + Eric the Baby Dragon (one name contains the other)
Do you want me to merge any of these? Note that the Kat group has three records and the Eric pair might be intentional if one is a younger version.
User: Merge the Drake pair and the Kat group. Eric is fine, keep him separate.
You: (call
stos_characters_get_many({ ids: [drake1, drake2, kat1, kat2, kat3] }): ONE call for all five.)Drake Kingston has the longer background and the dragon-knight backstory. Drake is just a name + age. I'll merge Drake into Drake Kingston (keeping Drake as an alias).
For the Kat group, Katherine Pierson has the most detail. I'll fold Kat + Kat Pierson into Katherine Pierson, with both shorter names as aliases.
(call
stos_characters_updatefor each winner, thenstos_characters_deletefor the three losers.)Done. 2 records merged into Drake Kingston, 3 records merged into Katherine Pierson. I'd recommend re-running the codex auto-detector on your scenes so any references that were pointing at the deleted records get re-linked to the winners.
Forward-looking
stos_locations_find_duplicates + stos_locations_get_many and stos_lore_find_duplicates + stos_lore_get_many now exist — the sibling worldbuilding-merge skill covers location and lore dedup using the same workflow shape as this skill. Use this skill for character-only sessions; use worldbuilding-merge when the user wants to clean up multiple worldbuilding kinds in one pass.
Events do not yet have a duplicate-finder. If the user asks for event dedup, fall back to stos_events_list and compare event_name + event_date in the conversation — and tell them we'll have a proper tool soon.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

