{
  "application": {
    "name": "Flip by Forgeboro",
    "version": "2.0.0",
    "type": "Vector Flipbook Animation Studio",
    "canvas": {
      "width": 800,
      "height": 600,
      "aspectRatio": "4:3",
      "viewBox": "0 0 800 600"
    }
  },
  "tools": [
    {
      "id": "select",
      "name": "Select & Move",
      "shortcut": "V",
      "selector": "[data-tool=\"select\"]",
      "description": "Point-and-click or drag a marquee box to select vector elements. Drag selection to translate. Drag 8-point bounding box handles to scale. Drag top knob to rotate.",
      "modifiers": [
        {
          "key": "Shift",
          "effect": "When scaling: preserves aspect ratio. When rotating: snaps angle to 15° increments."
        }
      ]
    },
    {
      "id": "pencil",
      "name": "Freehand Pencil",
      "shortcut": "P or N",
      "selector": "[data-tool=\"pencil\"]",
      "description": "Freehand sketching tool. Automatically converts raw pointer points into smooth cubic Bézier splines with anchor nodes and tangent handles upon stroke release (Catmull-Rom & RDP simplification)."
    },
    {
      "id": "node",
      "name": "Spline Node Edit",
      "shortcut": "A",
      "selector": "[data-tool=\"node\"]",
      "description": "Sub-selection node editing tool. Displays square anchor nodes and circular tangent handles along curves. Drag anchor to reposition. Drag circular handles to shape curvature. Click on path to insert a node. Delete/Backspace removes selected node.",
      "modifiers": [
        {
          "key": "Shift",
          "effect": "When dragging handle: Corner mode (manipulates handle angle independently without opposing handle lock)."
        }
      ]
    },
    {
      "id": "bucket",
      "name": "Paint Bucket",
      "shortcut": "B",
      "selector": "[data-tool=\"bucket\"]",
      "description": "Smart flood-fill tool. Automatically vectorizes enclosed line art into SVG fill patches placed beneath ink lines. Directly recolors shapes on click. Uses analytical border refinement when bounded by rectangles or ellipses."
    },
    {
      "id": "line",
      "name": "Straight Line",
      "shortcut": "L",
      "selector": "[data-tool=\"line\"]",
      "description": "Draws straight vector line segments.",
      "modifiers": [
        {
          "key": "Shift",
          "effect": "Snaps line angle to 45° increments (horizontal, vertical, diagonal)."
        }
      ]
    },
    {
      "id": "rect",
      "name": "Rectangle",
      "shortcut": "R",
      "selector": "[data-tool=\"rect\"]",
      "description": "Draws vector rectangle shapes with customizable stroke color, width, and fill color.",
      "modifiers": [
        {
          "key": "Shift",
          "effect": "Constrains proportions to a 1:1 perfect square."
        }
      ]
    },
    {
      "id": "ellipse",
      "name": "Ellipse / Oval",
      "shortcut": "O",
      "selector": "[data-tool=\"ellipse\"]",
      "description": "Draws vector ellipse shapes with customizable stroke color, width, and fill color.",
      "modifiers": [
        {
          "key": "Shift",
          "effect": "Constrains proportions to a 1:1 perfect circle."
        }
      ]
    },
    {
      "id": "group",
      "name": "Group Inspector & Moving Parts",
      "shortcut": "G",
      "selector": "[data-tool=\"group\"]",
      "description": "Dedicated group and character inspector tool. Highlights character boundaries and moving parts on hover. Direct click selects individual moving subgroups (limbs, tail, head) for isolated transform, rotation, and animation without ungrouping. Double-click in Select tool (V) or Esc drills in/out of hierarchy."
    }
  ],
  "layoutAndComposition": [
    {
      "action": "duplicate",
      "name": "Duplicate Selection",
      "shortcut": "Ctrl+D / Cmd+D",
      "selector": "[data-action=\"duplicate\"]",
      "description": "Clones selected elements with a +20px offset, generates unique IDs, preserves nested group hierarchies, and selects the new duplicates."
    },
    {
      "action": "group",
      "name": "Group Selected",
      "shortcut": "Ctrl+G / Cmd+G",
      "selector": "[data-action=\"group\"]",
      "description": "Combines two or more selected elements into a single group element."
    },
    {
      "action": "ungroup",
      "name": "Ungroup Selected",
      "shortcut": "Ctrl+Shift+G / Cmd+Shift+G",
      "selector": "[data-action=\"ungroup\"]",
      "description": "Dissolves selected group element into independent top-level elements."
    },
    {
      "action": "copy",
      "name": "Copy Selection",
      "shortcut": "Ctrl+C / Cmd+C",
      "selector": "[data-action=\"copy\"]",
      "description": "Deep clones selected elements and groups into the internal application clipboard."
    },
    {
      "action": "paste",
      "name": "Paste Elements",
      "shortcut": "Ctrl+V / Cmd+V",
      "selector": "[data-action=\"paste\"]",
      "description": "Pastes elements from clipboard with a +25px offset and selects the pasted items."
    },
    {
      "action": "delete",
      "name": "Delete Selection",
      "shortcut": "Delete / Backspace",
      "selector": "[data-action=\"delete\"]",
      "description": "Deletes all currently selected elements and their group descendants."
    }
  ],
  "historyAndState": [
    {
      "action": "undo",
      "name": "Undo Action",
      "shortcut": "Ctrl+Z / Cmd+Z",
      "selector": "[data-action=\"undo\"]",
      "description": "Reverts the last modification on the active slide (or active background plate during plate editing mode)."
    },
    {
      "action": "redo",
      "name": "Redo Action",
      "shortcut": "Ctrl+Y / Cmd+Y or Ctrl+Shift+Z / Cmd+Shift+Z",
      "selector": "[data-action=\"redo\"]",
      "description": "Reapplies the last undone modification."
    },
    {
      "action": "clear",
      "name": "Clear Frame",
      "selector": "[data-action=\"clear-page\"]",
      "description": "Erases all elements on the active slide while recording a step in the undo history."
    }
  ],
  "backgroundSystem": {
    "description": "Multi-Background Plate System allowing stationary background artwork to be shared across slide groups.",
    "features": [
      "Reusable background plate library per sketchbook",
      "Batch range assignment syntax (e.g., \"1-3, 8\" or \"all\")",
      "Live background editing mode with real-time propagation to all referencing slides",
      "Dedicated background undo/redo history stack"
    ],
    "selectors": {
      "dropdown": "[data-testid=\"background-select\"]",
      "createButton": "[data-action=\"create-background\"]",
      "editButton": "[data-action=\"edit-background\"]",
      "doneEditingButton": "[data-action=\"done-editing-background\"]",
      "rangeAssignButton": "[data-action=\"range-assign-background\"]"
    }
  },
  "layerSystem": {
    "description": "Per-slide multi-layer stack for segregating animation elements.",
    "features": [
      "Layer visibility toggling (eye icon)",
      "Layer locking to prevent accidental edits (lock icon)",
      "Layer opacity adjustment (0% to 100% slider)",
      "Layer reordering (up/down)",
      "Active layer stamping: newly drawn elements automatically inherit active layerId"
    ],
    "selectors": {
      "addLayerButton": "[data-action=\"add-layer\"]",
      "layerCard": "[data-layer-id]",
      "visibilityToggle": "[data-action=\"toggle-layer-visibility\"]",
      "lockToggle": "[data-action=\"toggle-layer-lock\"]",
      "opacitySlider": "[data-action=\"set-layer-opacity\"]"
    }
  },
  "timelineAndPlayback": {
    "description": "Frame-by-frame thumbnail sequence with real-time animation loop.",
    "controls": [
      {
        "action": "play-pause",
        "label": "Play / Pause",
        "selector": "[data-action=\"play-pause\"]"
      },
      {
        "action": "step-forward",
        "label": "Step Forward (+1 frame)",
        "selector": "[data-action=\"step-forward\"]"
      },
      {
        "action": "step-backward",
        "label": "Step Backward (-1 frame)",
        "selector": "[data-action=\"step-backward\"]"
      },
      {
        "action": "fps-slider",
        "label": "Playback Speed (1-60 FPS)",
        "selector": "[data-action=\"set-fps\"]"
      },
      {
        "action": "onion-skin-toggle",
        "label": "Onion Skinning Guide",
        "selector": "[data-action=\"toggle-onion-skin\"]"
      },
      {
        "action": "add-page",
        "label": "Add Blank Slide",
        "selector": "[data-action=\"add-page\"]"
      },
      {
        "action": "duplicate-page",
        "label": "Duplicate Current Slide",
        "selector": "[data-action=\"duplicate-page\"]"
      },
      {
        "action": "delete-page",
        "label": "Delete Current Slide",
        "selector": "[data-action=\"delete-page\"]"
      }
    ]
  },
  "exports": [
    {
      "format": "SVG",
      "label": "Export SVG",
      "selector": "[data-action=\"export-svg\"]",
      "description": "Exports the active frame as a standalone W3C XML SVG vector graphic, compositing assigned background plates and visible layers with opacities."
    },
    {
      "format": "PDF",
      "label": "Generate PDF",
      "selector": "[data-action=\"export-pdf\"]",
      "description": "Compiles all flipbook slides into a high-definition landscape PDF document."
    },
    {
      "format": "JSON",
      "label": "Backup / Download JSON",
      "selector": "[data-action=\"download-json\"]",
      "description": "Downloads entire sketchbook or library as lightweight JSON preserving full history stacks."
    }
  ],
  "assetLibrary": {
    "description": "Story Starter Kits & Scenario Asset Library containing pre-defined vector backgrounds and characters bundled with animation ideas.",
    "endpoint": "/starter-kits.json",
    "cliIngestion": "node scripts/importScenarioKit.js <scenario-folder>",
    "selectors": {
      "openLibraryButton": "[data-action=\"open-asset-library\"]",
      "openStoryKitsButton": "[data-action=\"open-story-kits\"]",
      "openPresetsButton": "[data-action=\"open-preset-backgrounds\"]",
      "kitCard": "[data-kit-id]",
      "createBookFromKitButton": "[data-action=\"create-book-from-kit\"]",
      "importBackgroundButton": "[data-action=\"import-background\"]",
      "importCharacterButton": "[data-action=\"import-character\"]"
    }
  },
  "dataSchemas": {
    "StarterKit": {
      "id": "string",
      "title": "string",
      "category": "string",
      "explanation": "string",
      "animationIdeas": "Array<string>",
      "backgrounds": "Array<KitBackground>",
      "characters": "Array<KitCharacter>"
    },
    "KitBackground": {
      "id": "string",
      "name": "string",
      "description": "string",
      "elements": "Array<VectorElement>"
    },
    "KitCharacter": {
      "id": "string",
      "name": "string",
      "description": "string",
      "elements": "Array<VectorElement>"
    },
    "Book": {
      "id": "string",
      "title": "string",
      "storyGuide": "{ kitId: string, title: string, explanation: string, animationIdeas: string[] } | null",
      "pages": "Array<Page>",
      "backgrounds": "Array<BackgroundPlate>"
    },
    "Page": {
      "id": "string",
      "elements": "Array<VectorElement>",
      "layers": "Array<Layer>",
      "backgroundId": "string | null"
    },
    "BackgroundPlate": {
      "id": "string",
      "name": "string",
      "elements": "Array<VectorElement>"
    },
    "Layer": {
      "id": "string",
      "name": "string",
      "visible": "boolean",
      "locked": "boolean",
      "opacity": "number (0.0 to 1.0)"
    },
    "SplineNode": {
      "id": "string",
      "x": "number",
      "y": "number",
      "handleIn": "{ x: number, y: number } | null",
      "handleOut": "{ x: number, y: number } | null",
      "nodeType": "'smooth' | 'corner' | 'symmetric'"
    },
    "VectorElement": {
      "id": "string",
      "type": "'path' | 'line' | 'rect' | 'ellipse' | 'group'",
      "stroke": "string (hex or color keyword)",
      "strokeWidth": "number",
      "fill": "string (hex or \"none\")",
      "rotation": "number (degrees)",
      "layerId": "string",
      "parentId": "string | null",
      "d": "string (SVG path data for type path)",
      "points": "Array<{x: number, y: number}>",
      "nodes": "Array<SplineNode>"
    }
  }
}