Restructure entity storage from per-chapter subdirectories to a flat
canonical set in output/entities/. Each entity exists as a single file;
duplicates across chapters are detected by slug collision and skipped
(first occurrence wins). Chapter views use {{ include }} transclusion
to reference shared entity files.
Add @{existing_entities} macro to extract-entities template so the LLM
knows which entities already exist and focuses on genuinely new ones.
Refactor _call_llm() from _execute_llm() for callers that handle their
own file I/O. 41 unique entities from 4 chapters (2 duplicates removed).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
55 lines
1.9 KiB
Markdown
55 lines
1.9 KiB
Markdown
# Extract Economic Entities
|
|
|
|
You are an analytical economist specializing in classical economic theory.
|
|
Your task is to extract distinct economic entities from a chapter of
|
|
Adam Smith's *The Wealth of Nations*.
|
|
|
|
## Source Chapter
|
|
|
|
@{chapter_text}
|
|
|
|
## Extraction Guidelines
|
|
|
|
@{extraction_rules}
|
|
|
|
## VSM Framework Context
|
|
|
|
Use the following VSM framework as context to guide your extraction.
|
|
Prioritize entities that are likely to have clear mappings to VSM concepts,
|
|
but do not exclude entities simply because they lack an obvious mapping.
|
|
|
|
@{vsm_framework}
|
|
|
|
## Existing Entities
|
|
|
|
The following entities have already been extracted from previous chapters
|
|
of this work. Do NOT re-extract any of these. If one of these entities
|
|
appears in the current chapter, you may omit it entirely — the infospace
|
|
already contains it. Only extract entities that are genuinely new.
|
|
|
|
@{existing_entities}
|
|
|
|
## Instructions
|
|
|
|
1. Read the source chapter carefully.
|
|
2. Review the list of existing entities above and do not duplicate them.
|
|
3. Identify all distinct economic concepts, actors, mechanisms, and institutions
|
|
that are NOT already in the existing entities list.
|
|
4. For each new entity, produce a separate markdown document following the
|
|
Economic Entity Schema v1.0.
|
|
5. Each entity document must include:
|
|
- An H1 heading with the entity name
|
|
- A Definition section (20-150 words)
|
|
- A Source Chapter section citing the specific chapter
|
|
- A Context section describing where in the argument the entity appears
|
|
- An Economic Domain section classifying the entity
|
|
6. Optionally include Smith's Original Wording (direct quote) and
|
|
Modern Interpretation sections.
|
|
7. Use neutral, analytical language throughout.
|
|
8. Ensure each entity is distinct and self-contained.
|
|
|
|
## Output Format
|
|
|
|
Output each entity as a separate markdown document, delimited by
|
|
`--- ENTITY: <entity-name> ---` markers.
|