{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "specVersion": "1.0.0",
  "appName": "Continuum",
  "tagline": "Personal Momentum, Agile Execution & Habit Mastery Cockpit",
  "description": "Continuum pairs an agile Kanban workspace, qualitative scales (weight/importance), and live stopwatch tracking with a deterministic Goals & Streaks calendar engine (daily allowance, rolling 7-day cycles, and multi-view calendars).",
  "documentation": {
    "manualUrl": "/help.html",
    "jsonSpecUrl": "/agent-spec.json",
    "manualHtml": "/help.html",
    "specificationJson": "/agent-spec.json",
    "runtimeGlobal": "window.__CONTINUUM_AGENT_SPEC__"
  },
  "architecture": {
    "framework": "React 18 + Vite 6 + Tailwind CSS",
    "stateManagement": "Zustand (localStorage persistence with fallback cache)",
    "storageKeys": {
      "workspace": "continuum_workspace_v1",
      "goals": "continuum_goals_v1",
      "goalLogs": "continuum_goal_logs_v1",
      "goalPreferences": "continuum_goal_prefs_v1",
      "theme": "continuum_theme_v1",
      "cookieConsent": "continuum_cookie_consent_v1"
    },
    "navigationPattern": "Option C (Left collapsible sidebar with dedicated top-level Goals Calendar, Personal group, and Project groups)"
  },
  "navigation": {
    "tabs": ["activities", "documents", "reports", "goals", "about"],
    "layout": "Option C Sidebar Rail with full-width dynamic views"
  },
  "dataModels": {
    "ProjectGroup": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "name": { "type": "string" },
        "description": { "type": "string" },
        "color": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
        "isPersonal": { "type": "boolean", "description": "Immutable personal group protected from deletion" },
        "createdAt": { "type": "string", "format": "date-time" }
      },
      "required": ["id", "name", "color", "isPersonal", "createdAt"]
    },
    "Project": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "groupId": { "type": "string" },
        "name": { "type": "string" },
        "description": { "type": "string" },
        "color": { "type": "string" },
        "status": { "type": "string", "enum": ["active", "archived"] },
        "createdAt": { "type": "string", "format": "date-time" },
        "updatedAt": { "type": "string", "format": "date-time" }
      },
      "required": ["id", "groupId", "name", "color", "status"]
    },
    "Activity": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "projectId": { "type": "string" },
        "title": { "type": "string" },
        "description": { "type": "string" },
        "status": { "type": "string", "enum": ["Not Started", "In Progress", "Done"] },
        "importance": { "type": "number" },
        "weight": { "type": "number" },
        "dueDate": { "type": "string", "format": "date" },
        "sessions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": { "type": "string" },
              "startTime": { "type": "string", "format": "date-time" },
              "endTime": { "type": "string", "format": "date-time" },
              "durationSeconds": { "type": "number" }
            }
          }
        },
        "totalTimeSeconds": { "type": "number" }
      },
      "required": ["id", "projectId", "title", "status", "sessions"]
    },
    "Goal": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "title": { "type": "string" },
        "description": { "type": "string" },
        "cadence": { "type": "string", "enum": ["DAILY", "WEEKLY", "MONTHLY", "ONCE"] },
        "targetValue": { "type": "number" },
        "unit": { "type": "string" },
        "incrementStep": { "type": "number" },
        "targetFrequency": { "type": "number" },
        "dailyAllowance": { "type": "number" },
        "deadline": { "type": "string", "format": "date" },
        "reminderTime": { "type": "string" },
        "color": { "type": "string" },
        "linkedProjectId": { "type": "string" },
        "linkedActivityId": { "type": "string" },
        "currentStreak": { "type": "number" },
        "longestStreak": { "type": "number" },
        "totalCompletions": { "type": "number" },
        "metricType": { "type": "string" },
        "evaluation": { "type": "object" },
        "lifecycle": { "type": "object" },
        "createdAt": { "type": "string", "format": "date-time" }
      },
      "required": ["id", "title", "cadence", "targetValue", "unit", "incrementStep", "currentStreak", "longestStreak", "totalCompletions"]
    },
    "GoalLog": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "goalId": { "type": "string" },
        "date": { "type": "string", "format": "date" },
        "value": { "type": "number" },
        "targetMet": { "type": "boolean" },
        "notes": { "type": "string" },
        "updatedAt": { "type": "string", "format": "date-time" }
      },
      "required": ["id", "goalId", "date", "value", "targetMet"]
    }
  },
  "domTools": [
    {
      "tool": "navigation",
      "action": "switch-tab",
      "selector": "[data-tool=\"navigation\"][data-action=\"switch-tab\"]",
      "description": "Switch workspace view tab. Target tab specified by [data-tab].",
      "parameters": { "data-tab": "activities | documents | reports | goals | about" }
    },
    {
      "tool": "navigation",
      "action": "view-all-activities",
      "selector": "[data-tool=\"navigation\"][data-action=\"view-all-activities\"]",
      "description": "Deselects project/group and views all tasks across the entire workspace."
    },
    {
      "tool": "navigation",
      "action": "view-reports",
      "selector": "[data-tool=\"navigation\"][data-action=\"view-reports\"]",
      "description": "Opens productivity analytics and time period reports."
    },
    {
      "tool": "navigation",
      "action": "view-goals",
      "selector": "[data-tool=\"navigation\"][data-action=\"view-goals\"]",
      "description": "Opens the full-width Goals & Streaks Calendar engine."
    },
    {
      "tool": "navigation",
      "action": "view-about",
      "selector": "[data-tool=\"navigation\"][data-action=\"view-about\"]",
      "description": "Opens the ForgeBoro About Continuum product and architecture overview page."
    },
    {
      "tool": "group",
      "action": "create",
      "selector": "[data-tool=\"group\"][data-action=\"create\"]",
      "description": "Opens modal to create a new Project Group."
    },
    {
      "tool": "group",
      "action": "select",
      "selector": "[data-tool=\"group\"][data-action=\"select\"]",
      "description": "Selects a project group to filter displayed projects and tasks.",
      "parameters": { "data-group-id": "string ID of group" }
    },
    {
      "tool": "project",
      "action": "create",
      "selector": "[data-tool=\"project\"][data-action=\"create\"]",
      "description": "Opens modal to create a new Project."
    },
    {
      "tool": "project",
      "action": "select",
      "selector": "[data-tool=\"project\"][data-action=\"select\"]",
      "description": "Selects a Project, opening its dedicated Kanban board and specs hub.",
      "parameters": { "data-project-id": "string ID of project" }
    },
    {
      "tool": "activity",
      "action": "create",
      "selector": "[data-tool=\"activity\"][data-action=\"create\"]",
      "description": "Opens modal to create a new Task."
    },
    {
      "tool": "activity",
      "action": "start-session",
      "selector": "[data-tool=\"activity\"][data-action=\"start-session\"]",
      "description": "Starts the active stopwatch session for a task.",
      "parameters": { "data-activity-id": "string ID" }
    },
    {
      "tool": "activity",
      "action": "pause-session",
      "selector": "[data-tool=\"activity\"][data-action=\"pause-session\"]",
      "description": "Pauses running session and records duration.",
      "parameters": { "data-activity-id": "string ID" }
    },
    {
      "tool": "activity",
      "action": "complete",
      "selector": "[data-tool=\"activity\"][data-action=\"complete\"]",
      "description": "Marks task as Done.",
      "parameters": { "data-activity-id": "string ID" }
    },
    {
      "tool": "activity",
      "action": "edit",
      "selector": "[data-tool=\"activity\"][data-action=\"edit\"]",
      "description": "Opens the edit modal for an existing task.",
      "parameters": { "data-activity-id": "string ID" }
    },
    {
      "tool": "activity",
      "action": "delete",
      "selector": "[data-tool=\"activity\"][data-action=\"delete\"]",
      "description": "Prompts to delete a task and its time sessions.",
      "parameters": { "data-activity-id": "string ID" }
    },
    {
      "tool": "activity",
      "action": "copy-description",
      "selector": "[data-tool=\"activity\"][data-action=\"copy-description\"]",
      "description": "Copies task description (or title) to the system clipboard.",
      "parameters": { "data-activity-id": "string ID" }
    },
    {
      "tool": "timer",
      "action": "pause",
      "selector": "[data-tool=\"timer\"][data-action=\"pause\"]",
      "description": "Quick-pauses currently active running task from navbar widget."
    },
    {
      "tool": "timer",
      "action": "complete",
      "selector": "[data-tool=\"timer\"][data-action=\"complete\"]",
      "description": "Quick-completes currently running task from navbar widget."
    },
    {
      "tool": "timer",
      "action": "reset",
      "selector": "[data-tool=\"timer\"][data-action=\"reset\"]",
      "description": "Resets active session stopwatch or resets all accumulated task time."
    },
    {
      "tool": "timer",
      "action": "enable-night-owl",
      "selector": "[data-tool=\"timer\"][data-action=\"enable-night-owl\"]",
      "description": "Enables Night Owl mode for intended late work hours (e.g. 1, 2, 3, or 4 hours), bypassing night auto-pause.",
      "parameters": { "data-hours": "number of hours (e.g. 1, 2, 3, 4)" }
    },
    {
      "tool": "timer",
      "action": "cancel-night-owl",
      "selector": "[data-tool=\"timer\"][data-action=\"cancel-night-owl\"]",
      "description": "Cancels active Night Owl mode, returning to standard night pause rules."
    },
    {
      "tool": "goals",
      "action": "create",
      "selector": "[data-tool=\"goals\"][data-action=\"create\"]",
      "description": "Opens GoalModal to create a new goal."
    },
    {
      "tool": "goals",
      "action": "open-natural-language-modal",
      "selector": "[data-tool=\"goals\"][data-action=\"open-natural-language-modal\"]",
      "description": "Opens NaturalLanguageGoalModal to define a goal using natural speech or text with AI."
    },
    {
      "tool": "goals",
      "action": "parse-prompt",
      "selector": "[data-tool=\"goals\"][data-action=\"parse-prompt\"]",
      "description": "Triggers AI parsing of natural language text into a deterministic rule specification."
    },
    {
      "tool": "goals",
      "action": "confirm-ai-goal",
      "selector": "[data-tool=\"goals\"][data-action=\"confirm-ai-goal\"]",
      "description": "Confirms and creates a new goal from the parsed deterministic rule preview."
    },
    {
      "tool": "goals",
      "action": "edit",
      "selector": "[data-tool=\"goals\"][data-action=\"edit\"]",
      "description": "Opens GoalModal to edit cadence, allowance, reminder, or color.",
      "parameters": { "data-goal-id": "string ID" }
    },
    {
      "tool": "goals",
      "action": "export-csv",
      "selector": "[data-tool=\"goals\"][data-action=\"export-csv\"]",
      "description": "Exports RFC-4180 CSV containing all goals and historical logs."
    },
    {
      "tool": "goals",
      "action": "increment",
      "selector": "[data-tool=\"goals\"][data-action=\"increment\"]",
      "description": "Increments progress on a goal for the selected date by incrementStep.",
      "parameters": { "data-goal-id": "string ID", "data-date": "YYYY-MM-DD" }
    },
    {
      "tool": "goals",
      "action": "toggle-complete",
      "selector": "[data-tool=\"goals\"][data-action=\"toggle-complete\"]",
      "description": "Toggles 100% completion status for a goal on a given date.",
      "parameters": { "data-goal-id": "string ID", "data-date": "YYYY-MM-DD" }
    },
    {
      "tool": "calendar",
      "action": "set-view-mode",
      "selector": "[data-tool=\"calendar\"][data-action=\"set-view-mode\"]",
      "description": "Switches calendar view mode.",
      "parameters": { "data-view": "day | week | month | year" }
    },
    {
      "tool": "calendar",
      "action": "navigate-prev",
      "selector": "[data-tool=\"calendar\"][data-action=\"navigate-prev\"]",
      "description": "Navigates calendar to previous period."
    },
    {
      "tool": "calendar",
      "action": "navigate-today",
      "selector": "[data-tool=\"calendar\"][data-action=\"navigate-today\"]",
      "description": "Navigates calendar to today."
    },
    {
      "tool": "calendar",
      "action": "navigate-next",
      "selector": "[data-tool=\"calendar\"][data-action=\"navigate-next\"]",
      "description": "Navigates calendar to next period."
    },
    {
      "tool": "backup",
      "action": "export-json",
      "selector": "[data-tool=\"backup\"][data-action=\"export-json\"]",
      "description": "Exports complete JSON backup of the workspace."
    },
    {
      "tool": "backup",
      "action": "import-json",
      "selector": "[data-tool=\"backup\"][data-action=\"import-json\"]",
      "description": "Opens file browser to restore workspace snapshot from JSON backup."
    },
    {
      "tool": "theme",
      "action": "set-theme",
      "selector": "[data-tool=\"theme\"][data-action=\"set-theme\"]",
      "description": "Sets application theme to light, dark, or system auto.",
      "parameters": { "data-theme": "light | dark | auto" }
    },
    {
      "tool": "notifications",
      "action": "test",
      "selector": "[data-tool=\"notifications\"][data-action=\"test\"]",
      "description": "Dispatches a test push notification or falls back to in-app toast banner."
    },
    {
      "tool": "notifications",
      "action": "request-permission",
      "selector": "[data-tool=\"notifications\"][data-action=\"request-permission\"]",
      "description": "Requests browser push notification permission."
    },
    {
      "tool": "settings",
      "action": "open-modal",
      "selector": "[data-tool=\"settings\"][data-action=\"open-modal\"]",
      "description": "Opens Settings modal for configuring custom weight & importance scales, night auto-pause, and local time rules."
    },
    {
      "tool": "settings",
      "action": "toggle-night-autopause",
      "selector": "[data-tool=\"settings\"][data-action=\"toggle-night-autopause\"]",
      "description": "Toggles overnight timer auto-pause protection on or off."
    },
    {
      "tool": "settings",
      "action": "set-night-cutoff",
      "selector": "[data-tool=\"settings\"][data-action=\"set-night-cutoff\"]",
      "description": "Sets the start of the night interval (cutoff hour) in user local time (e.g. 21, 22, 23, 0).",
      "parameters": { "data-hour": "Cutoff hour in local time (e.g. 21, 22, 23, 0)" }
    },
    {
      "tool": "settings",
      "action": "set-night-end",
      "selector": "[data-tool=\"settings\"][data-action=\"set-night-end\"]",
      "description": "Sets the end of the night interval (morning hour) in user local time (e.g. 5, 6, 7, 8).",
      "parameters": { "data-hour": "Morning end hour in local time (e.g. 5, 6, 7, 8)" }
    },
    {
      "tool": "help",
      "action": "open-modal",
      "selector": "[data-tool=\"help\"][data-action=\"open-modal\"]",
      "description": "Opens Help & Documentation modal."
    },
    {
      "tool": "privacy",
      "action": "view-policy",
      "selector": "[data-tool=\"privacy\"][data-action=\"view-policy\"]",
      "description": "Opens Continuum Privacy Policy & Cookie Disclosures modal or document."
    },
    {
      "tool": "privacy",
      "action": "open-preferences",
      "selector": "[data-tool=\"privacy\"][data-action=\"open-preferences\"]",
      "description": "Opens Cookie & Data Privacy Preferences dialog to configure advertising, analytics, and functional storage."
    },
    {
      "tool": "privacy",
      "action": "accept-all",
      "selector": "[data-tool=\"privacy\"][data-action=\"accept-all\"]",
      "description": "Accepts all cookie categories (essential, analytics, and advertising)."
    },
    {
      "tool": "privacy",
      "action": "reject-non-essential",
      "selector": "[data-tool=\"privacy\"][data-action=\"reject-non-essential\"]",
      "description": "Rejects non-essential advertising and analytics cookies, keeping essential local storage only."
    }
  ],
  "keyboardShortcuts": [
    { "key": "?", "description": "Open Help & Documentation Modal", "scope": "Global" },
    { "key": "Escape", "description": "Close any active modal or dialog", "scope": "Global" },
    { "key": "Alt + A", "description": "Switch to Tasks Tab", "scope": "Navigation" },
    { "key": "Alt + D", "description": "Switch to Documents & Specs Tab", "scope": "Navigation" },
    { "key": "Alt + R", "description": "Switch to Reports Tab", "scope": "Navigation" },
    { "key": "Alt + G", "description": "Switch to Goals & Streaks Calendar", "scope": "Navigation" },
    { "key": "Alt + N", "description": "Create New Task", "scope": "Tasks" },
    { "key": "Alt + Shift + G", "description": "Create New Goal", "scope": "Goals" }
  ]
}

