Scan an entity file to identify mentions of people, places, organizations, and other entities in the text. Creates missing entities using appropriate templates and adds wikilinks...
Populate this entity: $ARGUMENTS
This skill analyzes an existing entity file to:
Required:
Optional Flags:
| Flag | Purpose | Default |
|---|---|---|
--dry-run |
Show what would be created without making changes | false |
--auto |
Skip confirmations, use best-guess entity types | false |
--limit N |
Maximum number of entities to create | 20 |
--broken-only |
Only fix broken wikilinks, skip plain text detection | false |
--links-only |
Only add wikilinks to existing entities, don't create new | false |
--world [name] |
BULK MODE: Process all entities in the specified world | - |
--category [type] |
With --world: only process entities in this category |
all |
If path provided (contains / or .md):
Worlds/[World Name]/...If name provided:
Worlds/ directories for matching entityname: fieldIf not found:
The world name is required for knowing where to save new entities.
Before analysis, create a complete index of existing entities in the world:
Worlds/[World Name]/ recursivelyname: fieldaliases: array{
"entity name": "path/to/entity.md",
"alias1": "path/to/entity.md",
...
}
This index is used to:
Read the source entity file and perform three analyses:
Use regex pattern: \[\[([^\]|]+)(?:\|[^\]]+)?\]\]
For each wikilink found:
[[Name|Display]] format)Scan the entity content (excluding YAML frontmatter, code blocks, and Image Prompts section) for proper noun patterns:
High-Confidence Patterns:
| Pattern | Entity Type | Example |
|---|---|---|
| Lord/Lady [Name] | Character | "Lord Varic", "Lady Serana" |
| King/Queen [Name] | Character | "King Aldric", "Queen Elara" |
| Prince/Princess [Name] | Character | "Prince Edric" |
| Sir/Dame [Name] | Character | "Sir Galahad" |
| Captain/Commander [Name] | Character | "Captain Alonzo" |
| High Priest/Confessor [Name] | Character | "High Confessor Maren" |
| Elder/Master [Name] | Character | "Elder Thorne" |
| House [Name] | Organization | "House Valdren" |
| Clan [Name] | Organization | "Clan Ironforge" |
| Guild/Order [Name] | Organization | "Guild of Merchants" |
| The [Name] + (River/Sea/Forest/Mountain) | Geography | "The Trader's Sea" |
| [Name] River/Stream | Geography (River) | "Valdris River" |
| [Name] Mountain(s)/Range/Peak(s) | Geography (Mountain) | "Sundered Peaks" |
| [Name] Forest/Wood(s)/Grove | Geography (Forest) | "Whisperwood Forest" |
| [Name] Sea/Ocean | Geography (Ocean) | "The Eastern Sea" |
| [Name] Lake/Pond | Geography (Lake) | "Lake Shimmer" |
| [Name] Fields/Plains | Geography (Plains) | "The Ashen Fields" |
| [Name] Pass/Gap | Geography (Pass) | "Ironhold Pass" |
| [Name] Palace/Ruins/Dungeon | Geography (Dungeon) | "The Sunken Palace" |
| [Name] City/Metropolis | Settlement (City) | "Porto Valdris" |
| [Name] Town | Settlement (Town) | "Oakhaven Town" |
| [Name] Port/Harbor | Settlement | "Porto Valdris" |
| [Name] Fortress/Castle/Keep | Settlement (Stronghold) | "Thornwall Keep" |
| [Name] Village/Hamlet | Settlement (Village) | "Millbrook Village" |
Medium-Confidence Patterns:
| Pattern | Entity Type | Context Needed |
|---|---|---|
| The [Capitalized Name] (standalone) | Geography/Organization | Check surrounding text |
| [Two-Three Capitalized Words] in People section | Character | "Marco Fortunato" |
| [Capitalized Name] near "guild/order/temple" | Organization | Check context |
| [Capitalized Name] near "river/mountain/forest" | Geography | Check context |
Detection Algorithm:
1. Split content into lines
2. Skip YAML frontmatter (between --- markers)
3. Skip Image Prompts section and below
4. Skip content inside code blocks (``` markers)
5. Skip existing wikilinks
6. For each line:
a. Find capitalized multi-word phrases (2-4 words)
b. Check against high-confidence patterns first
c. If no pattern match, check context clues
d. Skip common phrases that aren't entities:
- "The [Direction]" (The North, The East)
- Generic descriptors (The Great, The Ancient)
- Section headers
7. For each detected phrase:
a. Check if already in entity index -> mark as "needs wikilink"
b. Check if not in index -> mark as "potential new entity"
c. Record line numbers for all occurrences
d. Extract surrounding context (10 words before/after)
Sort all detected references into categories:
| Category | Description | Action |
|---|---|---|
| Existing (Unlinked) | Name matches an existing entity but isn't a wikilink | Convert to [[wikilink]] |
| Broken Link | [[wikilink]] exists but no entity file found |
Create entity |
| Inferred New | Proper noun with confident type guess | Create entity (confirm type) |
| Ambiguous New | Proper noun but type unclear | Ask user for type |
Display findings before taking action:
=== ENTITY ANALYSIS: [Source Entity Name] ===
World: [World Name]
Source Path: [path/to/source.md]
---
## EXISTING ENTITIES (Should Become Links)
Found X names matching existing entities but not wikilinked:
| # | Name | Line(s) | Matches Entity |
|---|------|---------|----------------|
| 1 | "Lady Serana Valdren" | 150 | [[Lady Serana Valdren]] |
| 2 | "Captain Alonzo" | 178, 192 | [[Captain Alonzo the Bold]] |
---
## BROKEN WIKILINKS (Need New Entities)
Found X wikilinks pointing to non-existent entities:
| # | Wikilink | Line(s) | Suggested Type | Template |
|---|----------|---------|----------------|----------|
| 1 | [[The Merchant Guilds]] | 286 | Organization | Guild.md |
| 2 | [[Marevento]] | 69, 278 | Settlement | Town.md |
| 3 | [[Serenzia]] | 72, 278 | Settlement | Town.md |
---
## DETECTED REFERENCES (Potential New Entities)
Found X capitalized names that may be entities:
| # | Name | Line(s) | Suggested Type | Context |
|---|------|---------|----------------|---------|
| 1 | "Marco Fortunato" | 171, 283 | Character | "wealthiest merchant", "key retainer" |
| 2 | "Adriano Valdren" | 165 | Character | "Varic's brother", "overseas trade" |
| 3 | "The Sunken Palace" | 166, 252 | Geography (Dungeon) | "underwater ruins", "pre-Faith secrets" |
---
## AMBIGUOUS REFERENCES (Need Confirmation)
| # | Name | Line(s) | Could Be | Please Specify |
|---|------|---------|----------|----------------|
| 1 | "The Reckoning" | 184, 253 | Event OR Tradition | history/concept? |
---
## SUMMARY
| Category | Count |
|----------|-------|
| Existing to link | X |
| Broken links to create | X |
| New entities detected | X |
| Ambiguous (need input) | X |
| **Total potential creations** | **X** |
---
**Options:**
1. Create all suggested entities (uses best-guess types)
2. Review each entity individually
3. Only fix broken wikilinks
4. Only add links to existing entities
5. Show dry-run (no changes)
If --auto flag is set, skip this step and proceed with best-guess types.
If --dry-run flag is set, show report and stop.
For each entity to create, use pattern matching to determine the template:
Template Mapping (from create-entity):
Characters:
| Pattern | Template |
|---|---|
| Lord/Lady/King/Queen/Prince/Princess + name | Support Character.md (or Antagonist.md if negative context) |
| Sir/Dame/Captain/Commander + name | Support Character.md |
| High Priest/Confessor/Elder + name | Support Character.md |
| Personal name in "Members" or "Allies" context | Support Character.md |
| Personal name with villain/enemy context | Antagonist.md |
Settlements:
| Pattern | Template |
|---|---|
| [Name] + City/Metropolis | City.md |
| [Name] + Port/Harbor (large) | City.md |
| [Name] + Town | Town.md |
| [Name] + Port/Harbor (small) | Town.md |
| [Name] + Village/Hamlet | Village.md |
| [Name] + Fortress/Castle/Keep/Stronghold | Stronghold.md |
| Context mentions "capital", "great city" | City.md |
Organizations:
| Pattern | Template |
|---|---|
| House + [Name] (noble context) | Government.md |
| Guild/Guilds + [Name] | Guild.md |
| Order + [Name] (religious context) | Religious Order.md |
| Order + [Name] (martial context) | Military.md |
| Clan/Tribe + [Name] | Organization (General).md |
| Army/Legion/Navy + [Name] | Military.md |
| Cult + [Name] | Cult.md |
| Company + [Name] (trade context) | Business.md |
| Default organization | Organization (General).md |
Geography:
| Pattern | Template |
|---|---|
| [Name] + River/Stream | River.md |
| [Name] + Mountain(s)/Range/Peak(s) | Mountain Range.md |
| [Name] + Forest/Wood(s)/Grove/Jungle | Forest.md |
| [Name] + Sea/Ocean | Ocean.md |
| [Name] + Lake/Pond | Lake.md |
| [Name] + Fields/Plains/Grassland | Plains.md |
| [Name] + Pass/Gap | Pass.md |
| [Name] + Desert/Wasteland | Desert.md |
| [Name] + Coast/Shore | Coast.md |
| [Name] + Island/Isle | Island.md |
| [Name] + Palace/Ruins/Dungeon/Tomb | Dungeon.md |
| [Name] + Cave/Cavern | Cave.md |
| The [Name] (generic geography) | Region.md |
History:
| Pattern | Template |
|---|---|
| The [Name] + War/Conflict | War.md |
| The [Name] + Battle/Siege | Battle.md |
| The [Name] (event context: "years ago", "when") | Event.md |
| [Name] + Age/Era/Epoch | Age.md |
| [Name] + Treaty/Accord | Treaty.md |
Category Folder Mappings:
| Template Category | Save to Folder |
|---|---|
| Characters | Characters/ |
| Settlements | Settlements/ |
| Organizations | Organizations/ |
| Geography | Geography/ |
| History | History/ |
| Concepts | Concepts/ |
| Items | Items/ |
| Creatures | Creatures/ |
Before creating entities, present the plan:
=== CREATION PLAN ===
Will create X new entities:
CHARACTERS (X):
| Entity | Template | Context from Source |
|--------|----------|---------------------|
| Marco Fortunato | Support Character.md | "wealthiest merchant" |
| Adriano Valdren | Support Character.md | "Varic's brother" |
SETTLEMENTS (X):
| Entity | Template | Context from Source |
|--------|----------|---------------------|
| Marevento | Town.md | "secondary port", "shipbuilding" |
| Serenzia | Town.md | "agricultural center" |
ORGANIZATIONS (X):
| Entity | Template | Context from Source |
|--------|----------|---------------------|
| The Merchant Guilds | Guild.md | "allied with House Valdren" |
GEOGRAPHY (X):
| Entity | Template | Context from Source |
|--------|----------|---------------------|
| The Sunken Palace | Dungeon.md | "underwater ruins", "pre-Faith" |
---
Proceed with creation? (yes/no/modify)
If --auto flag is set, skip confirmation and proceed.
For each confirmed entity:
Read the appropriate template from Templates/[Category]/[Template].md
Generate content based on:
Content Generation Guidelines:
Since these are auto-generated entities, create minimal but coherent content:
YAML Frontmatter:
name: to the entity namestatus: draft (marked for user review)image: emptyOverview Section:
[[wikilink]]Core Identity Sections:
<!-- TODO: Expand -->Connections Section:
[[Source Entity]] as primary connectionImage Prompts:
Naming Conventions:
Consult naming reference files when generating names:
Templates/Reference/D&D Species Naming Conventions.mdTemplates/Reference/Tolkien Naming Conventions.mdMatch naming style to the world's established conventions.
Save to: Worlds/[World Name]/[Category]/[Entity Name].md
Use Title Case with spaces for filenames.
After saving the new entity, add a connection back to the source entity:
Reciprocal Link Patterns:
| New Entity Type | Source Entity Type | New Entity Links To Source As |
|---|---|---|
| Character | Settlement | Home/Location |
| Character | Organization | Member Of |
| Character | Character | Associate/Ally |
| Settlement | Region | Part Of |
| Settlement | Organization | Headquarters |
| Organization | Settlement | Based Here |
| Organization | Character | Leadership/Members |
| Geography | Geography | Part Of/Contains |
After creating all new entities:
For each detected reference that now has an entity:
Entity Name with [[Entity Name]][[Lady Serana Valdren|Lady Serana]])Use Edit tool for precise replacements.
For each new entity created:
Connection Section Formats:
## Connections
### People
- **Family:** [[Family Member]]
- **Allies:** [[Ally 1]], [[Ally 2]]
- **Associates:** [[Associate 1]]
### Organizations
- **Member Of:** [[Organization]]
- **Allied With:** [[Allied Org]]
### Locations
- **Headquarters:** [[Settlement]]
- **Territory:** [[Region]]
### Geography
- **Contains:** [[Location 1]], [[Location 2]]
- **Borders:** [[Neighboring Region]]
After updates, verify:
=== POPULATE COMPLETE: [Source Entity Name] ===
Created X new entities:
CHARACTERS:
- [[Marco Fortunato]] - Wealthy merchant, Valdren ally (draft)
- [[Adriano Valdren]] - Varic's brother, trade manager (draft)
SETTLEMENTS:
- [[Marevento]] - Secondary port, shipbuilding center (draft)
- [[Serenzia]] - Agricultural town (draft)
ORGANIZATIONS:
- [[The Merchant Guilds]] - Allied trading organizations (draft)
GEOGRAPHY:
- [[The Sunken Palace]] - Underwater ruins with ancient secrets (draft)
---
Source Entity Updated:
- Added X wikilinks (previously plain text)
- Added X items to Connections section
Reciprocal Links Added:
- Marco Fortunato → [[Source Entity]] (employer)
- Marevento → [[The Western Shore]] (region)
- etc.
---
All new entities marked as 'draft' for review.
Suggested Next Steps:
1. Review and expand created entities with /expand-entity
2. Run /audit-world [World Name] to verify all connections
3. Generate images with /generate-image [Entity]
When --world flag is provided, the skill processes multiple entities:
Scan world directory:
.md files in Worlds/[World Name]/--category specified, only scan that folderAnalyze all entities:
Present consolidated plan:
=== BULK POPULATE: [World Name] ===
Files Analyzed: X
Files with Detections: Y
ENTITIES TO CREATE (de-duplicated):
| Entity | Type | Referenced In | Times |
|--------|------|---------------|-------|
| Marco Fortunato | Character | 3 files | 7 mentions |
| The Iron Guild | Organization | 2 files | 4 mentions |
...
Total: N new entities across M source files
Options:
1. Create all (uses best-guess types)
2. Review by category
3. Review each individually
4. Dry run complete
Process with de-duplication:
Bulk summary report:
=== BULK POPULATE COMPLETE ===
Entities Created: N
Source Files Updated: M
Total Wikilinks Added: X
Reciprocal Links Created: Y
By Category:
- Characters: N created
- Settlements: N created
...
# Process entire world (with confirmations)
/populate-entity --world Eldermyr
# Fully automated (no confirmations)
/populate-entity --world Eldermyr --auto
# Only fix broken links across world
/populate-entity --world Eldermyr --broken-only
# Limit total entities created in bulk
/populate-entity --world Eldermyr --limit 50
# Preview bulk changes
/populate-entity --world Eldermyr --dry-run
--limit to process in batches/audit-world --check links afterward to verify# Populate a specific entity by name
/populate-entity "House Valdren"
# Populate by file path
/populate-entity Worlds/Eldermyr/Organizations/House Valdren.md
# Preview what would be created (no changes)
/populate-entity "Porto Valdris" --dry-run
# Auto-populate without prompts (for batch processing)
/populate-entity "Lord Varic Valdren" --auto
# Only fix broken wikilinks, skip text detection
/populate-entity "World Overview" --broken-only
# Only add wikilinks to existing entities, don't create new
/populate-entity "The Great War" --links-only
# Limit number of entities to create
/populate-entity "The Great War" --limit 5
# Combine flags
/populate-entity "House Valdren" --auto --limit 10
/create-entityRun /populate-entity on newly created entities to automatically flesh out referenced names.
/audit-worldRun /populate-entity on key entities to reduce broken link count before audit.
/expand-entity/expand-entity adds depth to a single entity/populate-entity creates the network of related entities/link-entities/populate-entity creates entities from detected references/link-entities can refine the relationships afterwarddraft--auto flag