# Story Weaver: Jungian Narrative Analysis

## Introduction

Welcome to Story Weaver, a narrative development and analysis system designed around Jungian psychological principles. This system bridges the gap between storytelling, psychological depth, and structured narrative development.

## Core Philosophy

Story Weaver embodies a Jungian approach to storytelling, recognizing that the most compelling narratives emerge from psychological archetypes and collective unconscious patterns. By analyzing and refining narratives through this lens, stories gain resonance, depth, and universal appeal.

## Global Commands

Below are the main commands available in Story Weaver:

### Element Management
```bash
# Initialize a new story elements file
story-weaver init

# Generate elements from a concept document
story-weaver parse-concept -i concept.txt

# List all story elements with their status
story-weaver list

# Generate formatted output files
story-weaver generate --format markdown
```

### Story Analysis
```bash
# Analyze a story's structure and psychological elements
story-weaver analyze-story -i story.txt -o analysis.md

# Perform deep psychological analysis using Jungian principles
story-weaver analyze-story -i story.txt -o analysis.md -d
```

### Story Refinement
```bash
# Refine a story based on analysis
story-weaver refine-story -i story.txt -a analysis.json -o refined.md

# Focus on specific elements during refinement
story-weaver refine-story -i story.txt -a analysis.json -f "character development" -t "darker"
```

### Advanced Operations
```bash
# Add a new archetypal element 
story-weaver add-element --title "The Shadow's Emergence" --archetype "Shadow"

# Set element status
story-weaver set-status --id=3 --status=complete

# Analyze element dependencies
story-weaver analyze-dependencies
```

## Narrative Element Structure

Each narrative element follows this structured format:

```json
{
  "id": 1,
  "title": "The Protagonist's Shadow",
  "description": "The protagonist confronts their repressed rage",
  "status": "draft",
  "dependencies": [2, 3],
  "archetypes": ["Hero", "Shadow"],
  "themes": ["Rebirth", "Integration"],
  "priority": "high",
  "details": "In a dream sequence, the protagonist faces their dark impulses...",
  "criticalAnalysis": "This represents the shadow integration phase..."
}
```

## Analytical Process

### 1. Element Complexity Analysis

The system evaluates narrative elements based on psychological depth:

| Complexity | Description | Example |
|------------|-------------|---------|
| Low (1-3) | Single archetype, straightforward | Basic character introduction |
| Medium (4-7) | Multiple archetypes, moderate conflict | Inner conflict scene |
| High (8-10) | Complex archetypal integration, transformation | Shadow integration climax |

### 2. Archetypal Identification

Story elements are classified by their primary Jungian archetypes:

- **Hero/Heroine**: The protagonist on a journey of growth
- **Shadow**: The dark, rejected aspects of the self
- **Anima/Animus**: Feminine/masculine aspects within the psyche
- **Mentor/Wise Old Man/Woman**: Guide providing wisdom
- **Trickster**: Agent of chaos and transformation
- **Self**: The integrated whole, representing completeness

### 3. Psychological Depth Assessment

Each element is evaluated for psychological depth:

- **Surface Level**: Basic plot mechanics
- **Character Psychology**: Individual character motivations
- **Archetypal Resonance**: Connection to collective unconscious
- **Symbolic Integration**: How symbols connect to psychological patterns
- **Transformative Potential**: Capacity for psychological growth

## Output Formats

Story Weaver generates analysis in multiple formats:

### Markdown (Default)
```markdown
# Story Analysis: "The Memory Merchant"

## Core Archetypes
- **Hero**: Alex Chen (Reluctant seeker of truth)
- **Shadow**: Suppressed memories of corporate crimes
...
```

### JSON
```json
{
  "title": "Story Analysis: The Memory Merchant",
  "coreArchetypes": [
    {
      "name": "Hero",
      "character": "Alex Chen",
      "description": "Reluctant seeker of truth"
    },
    ...
  ]
}
```

### YAML
```yaml
title: "Story Analysis: The Memory Merchant"
coreArchetypes:
  - name: Hero
    character: Alex Chen
    description: Reluctant seeker of truth
  ...
```

## Integration With AI Models

Story Weaver leverages Claude AI models to analyze and refine narratives:

- **claude-3-sonnet-20240229**: Used for standard narrative analysis
- **claude-3-opus-20240229**: Provides deeper psychological insights
- **claude-3-haiku-20240307**: Quick element generation and basic analysis

The system constructs specialized prompts that guide Claude to analyze narratives through a Jungian lens, identifying psychological patterns, archetypes, and symbolic elements.

## Narrative Analysis Principles

When analyzing narratives, Story Weaver evaluates:

1. **Archetypal Resonance**: How well do characters embody psychological archetypes?
2. **Shadow Integration**: Are characters confronting their shadow aspects?
3. **Symbolic Coherence**: Do symbols form a cohesive psychological pattern?
4. **Individuation Journey**: Does the protagonist undergo authentic psychological growth?
5. **Collective Unconscious Elements**: What shared human experiences are represented?

## Story Refinement Guidelines

When refining stories, Story Weaver applies these principles:

1. **Deepen Archetypal Resonance**: Strengthen character alignment with core archetypes
2. **Clarify Shadow Elements**: Make repressed/rejected aspects more distinct
3. **Enhance Symbolic Coherence**: Ensure symbols connect to psychological themes
4. **Strengthen Transformation Arc**: Focus on authentic psychological growth
5. **Maintain Author Voice**: Preserve the unique style and tone of the original

## About Jungian Psychology in Storytelling

Carl Jung's analytical psychology provides powerful tools for storytelling:

- **Collective Unconscious**: The shared repository of instincts and archetypes
- **Archetypes**: Universal patterns and images derived from the collective unconscious
- **Individuation**: The process of integrating the conscious with the unconscious
- **Shadow**: The unknown dark side of the personality
- **Anima/Animus**: The unconscious feminine side in men / masculine side in women
- **Self**: The unified conscious and unconscious elements of the personality

Modern storytelling frequently draws on these concepts, often unknowingly. Story Weaver makes this connection explicit, helping writers craft narratives with deeper psychological resonance.

## Implementation Guidelines

When implementing new story elements:

1. **Identify the Primary Archetype**: Determine which Jungian archetype the element primarily represents
2. **Connect to Existing Elements**: Establish meaningful dependencies with related elements
3. **Assess Psychological Depth**: Evaluate how deeply the element explores unconscious patterns
4. **Integrate Symbolic Content**: Include appropriate symbols that connect to the psychological themes
5. **Consider Transformation Potential**: How does this element contribute to character growth?

## Example: Shadow Integration Analysis

```
Element ID: 8
Title: The Protagonist Confronts Their Shadow
Archetype: Shadow
Psychological Analysis:

In this pivotal scene, the protagonist encounters their own repressed anger, represented by the shadowy figure in the abandoned factory. This represents a classic Shadow confrontation in Jungian terms - the meeting with the disowned aspects of self that must be integrated for psychological wholeness.

The symbolic elements (darkness, industrial decay, mirrors) amplify the psychological tension. The protagonist's initial rejection followed by reluctant acknowledgment follows the typical pattern of Shadow integration, though it could be deepened by:

1. Adding more specific manifestations of the Shadow's content
2. Clarifying the emotional resistance to integration
3. Showing the transformative potential more explicitly

Recommendation: Expand this element with stronger symbolic correlations and clearer psychological stakes.
```

## Command Reference

### analyze-story
```
story-weaver analyze-story [options]

Options:
  -i, --input <file>          The story file to analyze (required)
  -o, --output <file>         File to save the analysis results to
  -f, --format <format>       Output format (markdown, json, yaml) (default: "markdown")
  -d, --deep-analysis         Perform deep psychological analysis
  -r, --no-recommendations    Exclude recommendations from the analysis
  -m, --model <model>         Claude model to use for analysis
  -t, --temperature <value>   Temperature for generation (0-1)
```

### refine-story
```
story-weaver refine-story [options]

Options:
  -i, --input <file>          The story file to refine (required)
  -a, --analysis <file>       The analysis file to use for refinement (required)
  -o, --output <file>         File to save the refined story to
  -f, --focus <areas...>      Areas to focus on (e.g., "pacing", "characters")
  -t, --tone <adjustment>     Desired tone adjustment (e.g., "darker", "lighter")
  -g, --guidance <text>       Additional refinement guidance
  -m, --model <model>         Claude model to use for refinement
  --temperature <value>       Temperature for generation (0-1)
```

### parse-concept
```
story-weaver parse-concept [options]

Options:
  -i, --input <file>          Concept document to parse (required)
  -o, --output <file>         Elements output file (default: "elements/elements.json")
  -a, --archetypes            Focus on archetypal analysis
  -s, --symbols               Include symbolic analysis
  -d, --dependencies          Generate element dependencies
  -m, --model <model>         Claude model to use
```

### generate
```
story-weaver generate [options]

Options:
  -f, --file <file>           Path to the elements file (default: "elements/elements.json")
  -o, --output <dir>          Output directory (default: "elements")
  --format <format>           Output format (markdown, json, yaml) (default: "markdown")
```

## Closing Thoughts

Story Weaver is more than a tool—it's a methodology for creating psychologically rich narratives that resonate with universal human experiences. By consciously engaging with Jungian concepts, writers can craft stories that connect more deeply with readers, tapping into the collective unconscious that binds all human experience.