[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75D1R540P4EKM1278MA47DZ":3,"skill-same:01M75D1R540P4EKM1278MA47DZ":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M75D1R540P4EKM1278MA47DZ","structured-output",null,"Structured data extraction using Pydantic schemas, strict JSON output formats, and schema validation.","Lord1Egypt\u002Fai-skillforge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M7597M9CBBVAPX1CYE1KFTSM",2,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fpython\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fstructured-output\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: structured-output\ndescription: Structured data extraction using Pydantic schemas, strict JSON output formats, and schema validation.\nallowed-tools: Read Write Edit Bash\nlicense: MIT license\nmetadata:\n    skill-author: Lord1Egypt\n---\n\n# Gemini Structured Output & Schema Validation Skill\n\n## Overview\nThis skill provides guidelines and code patterns for enforcing structured, type-safe output formats (specifically JSON) from Gemini models. By declaring a Pydantic model or defining a JSON Schema, developers guarantee that the model's response adheres strictly to the schema structure, avoiding parsing failures at runtime.\n\n---\n\n## When to Use This Skill\n- Extracting entities, metrics, or relationships from unstructured text.\n- Generating forms, configurations, or structured databases.\n- Creating API payloads or feeding downstream programming workflows.\n- Classifying inputs into predefined categories.\n\n---\n\n## Quick Start (with runnable code examples)\n\n```python\nfrom typing import List, Optional\nfrom pydantic import BaseModel, Field\nfrom google import genai\n\n# Initialize the Gemini GenAI Client\nclient = genai.Client()\n\n# Define the target structure using Pydantic\nclass EntityExtraction(BaseModel):\n    name: str = Field(description=\"Name of the person, company, or concept\")\n    category: str = Field(description=\"Type of entity (e.g., Person, Organization, Location, Technology)\")\n    relevance_score: float = Field(description=\"Relevance score from 0.0 to 1.0\")\n    context_snippet: Optional[str] = Field(None, description=\"A snippet from the text showing where this was found\")\n\nclass TextAnalysisReport(BaseModel):\n    summary: str = Field(description=\"A concise summary of the analyzed text\")\n    sentiment: str = Field(description=\"Sentiment classification: POSITIVE, NEGATIVE, or NEUTRAL\")\n    entities: List[EntityExtraction] = Field(default=[], description=\"List of extracted entities\")\n\ndef extract_structured_data(text: str):\n    print(\"Sending text to Gemini for structured analysis...\")\n    \n    # Generate content using gemini-2.5-flash with a schema configuration\n    response = client.models.generate_content(\n        model='gemini-2.5-flash',\n        contents=f\"Analyze the following text and extract details:\\n\\n{text}\",\n        config=dict(\n            # Force JSON mime type output\n            response_mime_type=\"application\u002Fjson\",\n            # Pass the Pydantic class to define the target schema structure\n            response_schema=TextAnalysisReport\n        )\n    )\n    \n    # Parse the response text directly as a Pydantic model instance\n    try:\n        report = TextAnalysisReport.model_validate_json(response.text)\n        print(\"\\n--- Successfully Extracted Pydantic Object ---\")\n        print(f\"Sentiment: {report.sentiment}\")\n        print(f\"Summary: {report.summary}\")\n        print(\"\\nEntities Found:\")\n        for entity in report.entities:\n            print(f\" - [{entity.category}] {entity.name} (Relevance: {entity.relevance_score})\")\n    except Exception as e:\n        print(f\"Failed to validate JSON output: {e}\")\n        print(response.text)\n\nif __name__ == \"__main__\":\n    sample_text = (\n        \"Yesterday, Google announced the release of Gemini 2.5 on their official blog in California. \"\n        \"Sundar Pichai expressed great excitement about the natively multimodal architecture, which shows \"\n        \"unprecedented speed improvements for developers worldwide.\"\n    )\n    extract_structured_data(sample_text)\n```\n\n---\n\n## Advanced Usage\n\n### Raw Dict \u002F JSON Schema Fallback\nIf you are not using Pydantic, you can pass a raw dictionary containing a standard OpenAPI 3.0 schema:\n\n```python\nraw_schema = {\n    \"type\": \"OBJECT\",\n    \"properties\": {\n        \"items\": {\n            \"type\": \"ARRAY\",\n            \"items\": {\"type\": \"STRING\"}\n        }\n    },\n    \"required\": [\"items\"]\n}\n\nresponse = client.models.generate_content(\n    model='gemini-2.5-flash',\n    contents=\"List five colors\",\n    config=dict(\n        response_mime_type=\"application\u002Fjson\",\n        response_schema=raw_schema\n    )\n)\n```\n\n---\n\n## Key References\n- [Google GenAI Structured Output documentation](https:\u002F\u002Fgithub.com\u002Fgoogleapis\u002Fpython-genai)\n- Pydantic v2 Documentation\n\n---\n\n## Dependencies\n- `google-genai>=0.1.1`\n- `pydantic>=2.0`\n","# Gemini Structured Output & Schema Validation Skill\n\n## Overview\nThis skill provides guidelines and code patterns for enforcing structured, type-safe output formats (specifically JSON) from Gemini models. By declaring a Pydantic model or defining a JSON Schema, developers guarantee that the model's response adheres strictly to the schema structure, avoiding parsing failures at runtime.\n\n---\n\n## When to Use This Skill\n- Extracting entities, metrics, or relationships from unstructured text.\n- Generating forms, configurations, or structured databases.\n- Creating API payloads or feeding downstream programming workflows.\n- Classifying inputs into predefined categories.\n\n---\n\n## Quick Start (with runnable code examples)\n\n```python\nfrom typing import List, Optional\nfrom pydantic import BaseModel, Field\nfrom google import genai\n\n# Initialize the Gemini GenAI Client\nclient = genai.Client()\n\n# Define the target structure using Pydantic\nclass EntityExtraction(BaseModel):\n    name: str = Field(description=\"Name of the person, company, or concept\")\n    category: str = Field(description=\"Type of entity (e.g., Person, Organization, Location, Technology)\")\n    relevance_score: float = Field(description=\"Relevance score from 0.0 to 1.0\")\n    context_snippet: Optional[str] = Field(None, description=\"A snippet from the text showing where this was found\")\n\nclass TextAnalysisReport(BaseModel):\n    summary: str = Field(description=\"A concise summary of the analyzed text\")\n    sentiment: str = Field(description=\"Sentiment classification: POSITIVE, NEGATIVE, or NEUTRAL\")\n    entities: List[EntityExtraction] = Field(default=[], description=\"List of extracted entities\")\n\ndef extract_structured_data(text: str):\n    print(\"Sending text to Gemini for structured analysis...\")\n    \n    # Generate content using gemini-2.5-flash with a schema configuration\n    response = client.models.generate_content(\n        model='gemini-2.5-flash',\n        contents=f\"Analyze the following text and extract details:\\n\\n{text}\",\n        config=dict(\n            # Force JSON mime type output\n            response_mime_type=\"application\u002Fjson\",\n            # Pass the Pydantic class to define the target schema structure\n            response_schema=TextAnalysisReport\n        )\n    )\n    \n    # Parse the response text directly as a Pydantic model instance\n    try:\n        report = TextAnalysisReport.model_validate_json(response.text)\n        print(\"\\n--- Successfully Extracted Pydantic Object ---\")\n        print(f\"Sentiment: {report.sentiment}\")\n        print(f\"Summary: {report.summary}\")\n        print(\"\\nEntities Found:\")\n        for entity in report.entities:\n            print(f\" - [{entity.category}] {entity.name} (Relevance: {entity.relevance_score})\")\n    except Exception as e:\n        print(f\"Failed to validate JSON output: {e}\")\n        print(response.text)\n\nif __name__ == \"__main__\":\n    sample_text = (\n        \"Yesterday, Google announced the release of Gemini 2.5 on their official blog in California. \"\n        \"Sundar Pichai expressed great excitement about the natively multimodal architecture, which shows \"\n        \"unprecedented speed improvements for developers worldwide.\"\n    )\n    extract_structured_data(sample_text)\n```\n\n---\n\n## Advanced Usage\n\n### Raw Dict \u002F JSON Schema Fallback\nIf you are not using Pydantic, you can pass a raw dictionary containing a standard OpenAPI 3.0 schema:\n\n```python\nraw_schema = {\n    \"type\": \"OBJECT\",\n    \"properties\": {\n        \"items\": {\n            \"type\": \"ARRAY\",\n            \"items\": {\"type\": \"STRING\"}\n        }\n    },\n    \"required\": [\"items\"]\n}\n\nresponse = client.models.generate_content(\n    model='gemini-2.5-flash',\n    contents=\"List five colors\",\n    config=dict(\n        response_mime_type=\"application\u002Fjson\",\n        response_schema=raw_schema\n    )\n)\n```\n\n---\n\n## Key References\n- [Google GenAI Structured Output documentation](https:\u002F\u002Fgithub.com\u002Fgoogleapis\u002Fpython-genai)\n- Pydantic v2 Documentation\n\n---\n\n## Dependencies\n- `google-genai>=0.1.1`\n- `pydantic>=2.0`\n",{"name":5,"license":24,"metadata":25,"description":7,"allowed-tools":26},"MIT license",{"skill-author":9},"Read Write Edit Bash","main","3f88e1b76af67701a6405069a542e21a997d2868","python\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fstructured-output",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-05 10:16:24",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Lord1Egypt\u002Fai-skillforge --skill structured-output",{"tool":41,"command":42},"bunx","bunx skills add Lord1Egypt\u002Fai-skillforge --skill structured-output",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fai-skillforge --skill structured-output","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fpython\u002Fskillforge_agent\u002Fskills\u002Fgemini\u002Fstructured-output\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M75GWTHWA52GYQKS347FF6CD","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M75GW9FBP9NAFBSNVJ23RHSX","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Fwhat-if-oracle\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M75GW351MZZQ1V7207PDCX5D","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Fvenue-templates\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M75GVYGMAZDV2NHWSV6PP6TK","vaex","Use this skill for processing and analyzing large tabular datasets (billions of rows) that exceed available RAM. Vaex excels at out-of-core DataFrame operations, lazy evaluation, fast aggregations, efficient visualization of big data, and machine learning on large datasets. Apply when users need to work with large CSV\u002FHDF5\u002FArrow\u002FParquet files, perform fast statistics on massive datasets, create visualizations of big data, or build ML pipelines that do not fit in memory.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Fvaex\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M75GVS0ADH3DZ3QB564EVYC9","usfiscaldata","Query the U.S. Treasury Fiscal Data API for federal financial data including national debt, government spending, revenue, interest rates, exchange rates, and savings bonds. Access 54 datasets and 182 data tables with no API key required. Use when working with U.S. federal fiscal data, national debt tracking (Debt to the Penny), Daily Treasury Statements, Monthly Treasury Statements, Treasury securities auctions, interest rates on Treasury securities, foreign exchange rates, savings bonds, or any U.S. government financial statistics.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Fusfiscaldata\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M75GVDTBSXRQ4Q11RVJQC56M","treatment-plans","Generate concise (3-4 page), focused medical treatment plans in LaTeX\u002FPDF format for all clinical specialties. Supports general medical treatment, rehabilitation therapy, mental health care, chronic disease management, perioperative care, and pain management. Includes SMART goal frameworks, evidence-based interventions with minimal text citations, regulatory compliance (HIPAA), and professional formatting. Prioritizes brevity and clinical actionability.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fai-skillforge\u002Fblob\u002Fmain\u002Fskills\u002Fscientific\u002Ftreatment-plans\u002FSKILL.md",[],[]]