{
  "name": "generateProductStructure",
  "description": "Generate structured product specification",
  "parameters": {
    "type": "object",
    "properties": {
      "output": {
        "type": "object",
        "properties": {
          "modules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "module_name": { "type": "string" },
                "module_id": { "type": "string", "pattern": "^MD_[a-zA-Z0-9]*$" },
                "module_type": { "type": "string", "enum": ["ENT", "TASK", "BIZ", "CORE"] },
                "description": { "type": "string" }
              },
              "required": ["module_name", "module_id", "module_type", "description"]
            }
          },
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "feature_name": { "type": "string" },
                "feature_id": { "type": "string", "pattern": "^FT_[a-zA-Z0-9]*$" },
                "module_id": {
                  "type": "array",
                  "items": { "type": "string" }
                },
                "scenario": { "type": "string" },
                "goal": { "type": "string" },
                "data_binding": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": ["UserProfile", "Lesson", "Dialogue", "Task", "TaskReward", "Leaderboard", "Purchase", "Subscription", "AdImpression", "Vocabulary", "VocabularyReview", "LifePoints", "ContinuousLearning", "TimeWarp"]
                  }
                },
                "view_ids": { "type": "array", "items": { "type": "string" } }
              },
              "required": ["feature_name", "feature_id", "module_id", "scenario", "goal", "data_binding", "view_ids"]
            }
          },
          "views": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "view_id": { "type": "string", "pattern": "^UI_[a-zA-Z][a-zA-Z0-9]*$" },
                "name": { "type": "string" },
                "type": { "type": "string", "enum": ["List", "Detail", "Form", "Modal", "Wizard", "Dashboard", "Empty", "State"] },
                "goal": { "type": "string" },
                "interaction": { "type": "string" },
                "components": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": { "type": "string" },
                      "type": { "type": "string", "enum": ["Button", "Image", "Card", "ListItem", "Text", "InputField", "Dropdown", "Tabs", "Toast", "Stepper", "Badge", "Avatar", "Chart", "Progress", "EmptyState"] },
                      "interaction": { "type": "string" },
                      "action": { "type": "string" },
                      "navigation_view_id": { "oneOf": [{ "type": "string" }, { "type": "null" }] }
                    },
                    "required": ["name", "type", "interaction", "action", "navigation_view_id"]
                  }
                }
              },
              "required": ["view_id", "name", "type", "goal", "interaction", "components"]
            }
          },
          "data_sources": {
            "type": "array",
            "items": { "type": "string" }
          },
          "diagnostics": {
            "type": "object",
            "properties": {
              "unbound_views": { "type": "array", "items": { "type": "string" } },
              "duplicates": { "type": "array", "items": { "type": "string" } },
              "rejections": { "type": "array", "items": { "type": "string" } }
            }
          }
        },
        "required": ["modules", "features", "views", "data_sources", "diagnostics"]
      }
    },
    "required": ["output"]
  }
}