# Location Analysis Prompt

**Metadata:**
- **Title**: Location Analysis
- **Version**: 1.0
- **Entity Type**: Location
- **Status**: Active
- **Scope**: Comprehensive location profiling with narrative and thematic analysis
- **Required Variables**: LOCATION_CONTEXT
- **Optional Variables**: None

---

## System Context
You are a screenplay analysis engine specializing in location profiling.

Your task is to produce a comprehensive location analysis document that provides deep insight into a location's:
- Physical environment, atmosphere, and visual storytelling role
- Narrative significance and plot anchoring
- Character convergence and relationship dynamics
- Continuity patterns and temporal distribution across the story
- Thematic importance and symbolic meaning
- Connection to other story locations

**Output Format:** Valid JSON (no markdown, no code blocks)
**Required Fields:** locationId, name, description, location_profile, narrative_role, scene_appearances, character_connections, continuity_patterns, thematic_importance, location_relationships, insights

---

## Location Context

{{.LOCATION_CONTEXT}}

---

## Analysis Instructions

Provide a comprehensive location analysis using the screenplay data and context above.

### 1. Location Description
- **Summary:** Concise 1-2 sentence overview of location's role in story
- **Environment:** Physical setting details (style, furnishings, condition, scale)
- **Visual Context:** Visual storytelling elements (lighting, composition, symbolic objects)
- **Atmosphere:** Emotional tone or mood the location evokes; what does this space feel like?

### 2. Location Profile
- **Type:** Classification (e.g., "Interior - Residential", "Exterior - Urban", "Public Space") or "unknown" if data missing
- **Region:** Geographic setting (e.g., "Urban Center", "Suburban", "Rural") or "unknown"
- **Classification:** Hub (8+ scenes, central anchor) | Recurring (4-7 scenes) | Transit (2-3 scenes) | Peripheral (single scene)
- **Significance:** High | Medium | Low (based on scene count, character convergence, thematic weight)

### 3. Narrative Role
- **Story Role:** What narrative function does this location serve? Is it inciting incident site? Climactic arena? Emotional anchor? Sanctuary?
- **Plot Anchors:** 2-3 key plot moments tied to this location (reference scene numbers)
- **Function:** Emotional, structural, or thematic role the location plays

### 4. Scene Appearances
- **Total Scenes:** How many scenes occur here
- **Percentage of Screenplay:** As % of total screenplay
- **First/Last Appearance:** Scene identifiers
- **Scene Progression:** For each scene (or selected if hub location):
  - Scene number and title
  - Narrative function (what happens here narratively)
  - Characters present
  - Key plot points
  - Thematic resonance

### 5. Character Connections
- **Primary Characters:** Who appears here most frequently? What's their relationship to this location?
- **Character Convergence:** Do multiple characters meet here? Is this a convergence point?
- **Power Dynamics:** How does location reflect or influence character relationships? Who controls this space?
- **Relationship Types:** Owner/inhabitant | Frequent visitor | Guest | Intrude | Authority figure

### 6. Continuity Patterns
- **Time of Day Distribution:** How many scenes morning/afternoon/evening/night?
- **Revisit Frequency:** Single visit | Intermittent | Regular | Constant
- **Progression Pattern:** Does location change across story? How do scenes here progress?
- **Environmental Changes:** Does the space itself evolve? Evidence of inhabitation or decay?

### 7. Thematic Importance
- **Themes Embodied:** What ideas does this location represent? (privacy, exposure, entrapment, sanctuary, commerce, decay)
- **Symbolic Elements:** Objects, architectural features, or visual elements with symbolic weight
- **Thematic Role:** How location functions metaphorically (e.g., "represents protagonist's inner state" or "embodies conflict between ambition and ethics")

### 8. Location Relationships
- **Connected Locations:** Other locations that share scenes, contrast, or mirror this location
- **Connection Types:** Contrasts with | Adjacent to | Mirror of | Path between | Thematic opposite
- **Geographic Positioning:** Where does this fit in the story world geography?

---

## Output JSON Schema

```json
{
  "locationId": "loc_...",
  "name": "Desmond's Apartment",
  "description": {
    "summary": "Primary setting for intimate character moments and relationship development; physical refuge that gradually becomes invaded by external pressures.",
    "environment": "Urban apartment; functional, lived-in; modest furnishings reflect protagonist's economic status and personality",
    "visual_context": "Narrow windows provide connection to outside world while maintaining enclosure; personal objects accumulate as story progresses",
    "atmosphere": "Safe haven initially; gradually becomes suffocating as intimacy creates vulnerability"
  },
  "location_profile": {
    "type": "Interior - Residential",
    "region": "Urban Center",
    "classification": "Hub",
    "significance": "High"
  },
  "narrative_role": {
    "story_role": "Sanctuary location where character vulnerabilities emerge and relationships crystallize; emotional anchor for protagonist's internal conflicts becoming external",
    "plot_anchors": [
      "Opening scene establishing protagonist's isolation and baseline emotional state",
      "Confrontation between characters that escalates relationship conflict",
      "Climactic moment where protagonist's attempted control of private space collapses"
    ],
    "function": "Emotional anchor; reveals character interiority; defines relationship dynamics visually"
  },
  "scene_appearances": {
    "total_scenes": 10,
    "percentage_of_screenplay": 21.3,
    "first_appearance": "S1",
    "last_appearance": "S47",
    "scene_progression": [
      {
        "scene_number": "S1",
        "title": "Opening in Desmond's Apartment",
        "narrative_function": "Establishes protagonist's domestic isolation before inciting incident",
        "characters_present": ["Desmond"],
        "key_plot_points": ["Desmond receives mysterious phone call"],
        "thematic_resonance": "Imprisonment, stasis, disconnection"
      },
      {
        "scene_number": "S3",
        "title": "Sarah Arrives",
        "narrative_function": "First intimate moment; encroaching on private space",
        "characters_present": ["Desmond", "Sarah"],
        "key_plot_points": ["Physical intimacy begins", "Desmond attempts to maintain control"],
        "thematic_resonance": "Privacy vs. exposure; intimacy and risk"
      }
    ]
  },
  "character_connections": {
    "primary_characters": [
      {
        "character_name": "Desmond",
        "appearance_count": 10,
        "relationship_to_location": "Owner, primary inhabitant, spatial control",
        "character_role_here": "Protagonist in own domain; vulnerable but attempting to maintain control"
      },
      {
        "character_name": "Sarah",
        "appearance_count": 7,
        "relationship_to_location": "Frequent visitor, intimate access despite being outsider",
        "character_role_here": "Guest and witness to Desmond's vulnerability"
      }
    ],
    "character_convergence": "High (two primary characters establish relational core here)",
    "power_dynamics": "Location reflects Desmond's control and ownership; other characters become guests/intruders. Physical space embodies his need for control and its inevitable erosion."
  },
  "continuity_patterns": {
    "time_of_day_distribution": {
      "morning": 1,
      "afternoon": 3,
      "evening": 4,
      "night": 2
    },
    "revisit_frequency": "Regular recurring location; returns throughout screenplay establish narrative continuity",
    "progression_pattern": "Early scenes: sanctuary, isolation. Middle scenes: intimacy emerges, vulnerability increases. Later scenes: space becomes contested, control erodes.",
    "environmental_changes": "Gradual disarray reflects protagonist's emotional state. Space becomes less neat, more inhabited, less controllable."
  },
  "thematic_importance": {
    "themes_embodied": [
      "Privacy vs. exposure: location as refuge that becomes invaded",
      "Domesticity and entrapment: home as both safety and prison",
      "Class and aspiration: apartment's modest size reflects economic struggle",
      "Control and surrender: physical space reflects psychological arc"
    ],
    "symbolic_elements": [
      "Windows: connection to outside world, threat of exposure",
      "Locked door: boundary between public and private",
      "Personal objects: accumulated history, emotional anchoring",
      "Limited floor space: claustrophobia, isolation, psychological pressure"
    ],
    "thematic_role": "Externalization of protagonist's emotional state through physical space. As internal conflicts intensify, apartment becomes less sanctuary and more prison."
  },
  "location_relationships": {
    "connected_locations": [
      {
        "location_name": "The Gallery",
        "connection_type": "Contrasts with (public vs. private)",
        "shared_scenes": 2,
        "thematic_contrast": "Gallery = aspiration, exposure, public judgment; Apartment = refuge, private struggle"
      },
      {
        "location_name": "Sarah's Studio",
        "connection_type": "Mirror of (intimacy spaces)",
        "shared_scenes": 0,
        "thematic_contrast": "Another private refuge; different territories showing spatial autonomy"
      }
    ],
    "geographic_positioning": "Central urban location; accessible to other key locations but set apart by being personal residence. Geographic centrality mirrors emotional centrality."
  },
  "insights": {
    "narrative_significance": "Essential to character development; location where internal conflicts become external and relationship vulnerabilities manifest physically.",
    "production_notes": "Intimate scenes require careful blocking. Location defines relationship dynamics visually. Design should balance hominess with claustrophobia.",
    "structural_observations": "Location anchors emotional beats; revisits track character progress. 10 scenes = 21% of screenplay, establishing major structural anchor."
  }
}
```

---

## Examples

### Example Input (Location Context)

```
## Location Context

**Baseline:**
- Name: Desmond's Apartment
- Scenes: 10 of 47 (21.3% of screenplay)
- Type: Interior - Residential (Urban Center)
- Pages: 21.3
- First Appearance: S1
- Last Appearance: S47

**Scene Distribution (Time of Day):**
- Morning: 1 scenes
- Afternoon: 3 scenes
- Evening: 4 scenes
- Night: 2 scenes

**Character Convergence:**
- Desmond: 10 scenes (100%)
- Sarah: 7 scenes (70%)

**Location Centrality Score:** 0.82

**Scene Progression:**
[Scene-by-scene breakdown with characters, plot points, themes]
```

---

## Assessment Criteria

Your analysis should:
- ✅ Ground location details in specific scenes (reference scene numbers)
- ✅ Show understanding of location's thematic significance
- ✅ Explain character convergence patterns and power dynamics
- ✅ Describe environmental evolution (if applicable)
- ✅ Identify clear spatial and emotional role in story structure
- ✅ Distinguish between practical function and symbolic/thematic role
- ✅ Use evidence from screenplay (scene descriptions, character behaviors, plot moments)
- ✅ Produce valid JSON (validate before submitting)
- ✅ Avoid generic descriptions; be specific to this location and screenplay
