@prefix :       <https://geminicli.com/docs/core/subagents#> .
@prefix schema: <http://schema.org/> .
@prefix skos:   <http://www.w3.org/2004/02/skos/core#> .
@prefix org:    <http://www.w3.org/ns/org#> .
@prefix dbo:    <http://dbpedia.org/ontology/> .
@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl:    <http://www.w3.org/2002/07/owl#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .

# ─────────────────────────────────────────────────────────────
# LIGHTWEIGHT ONTOLOGY
# ─────────────────────────────────────────────────────────────

:Industry a rdfs:Class ;
    rdfs:label "Industry Vertical"@en ;
    rdfs:comment "A business vertical impacted by AI application development tooling."@en .

:DeveloperToolsIndustry rdfs:subClassOf :Industry ;
    rdfs:label "Developer Tools Industry"@en .

:SoftwareServicesIndustry rdfs:subClassOf :Industry ;
    rdfs:label "Software Services Industry"@en .

:hasAutomationReadiness a rdf:Property ;
    rdfs:label "Automation Readiness"@en ;
    rdfs:domain :Industry ;
    rdfs:range xsd:string .

:hasSecurityNeeds a rdf:Property ;
    rdfs:label "Security Needs"@en ;
    rdfs:domain :Industry ;
    rdfs:range xsd:string .

# ─────────────────────────────────────────────────────────────
# CORE ENTITIES
# ─────────────────────────────────────────────────────────────

:analysis a schema:CreativeWork ;
    schema:name "Gemini CLI: Subagents Architecture & Capabilities"@en ;
    schema:headline "Specialized agents operating within your main Gemini CLI session"@en ;
    schema:abstract "An overview of Gemini CLI subagents, detailing built-in specialists, custom agent creation, browser automation, and security isolation mechanisms."@en ;
    schema:url <https://geminicli.com/docs/core/subagents/> ;
    schema:datePublished "2026-04-15"^^xsd:date ;
    schema:author :google ;
    schema:publisher :google ;
    schema:about :subagentsFeature, :browserAgent, :customSubagents ;
    schema:keywords "Gemini CLI, Subagents, Browser automation, CLI tools, AI agents, Codebase Investigator"@en ;
    schema:hasPart :faqSection, :glossarySection, :howtoSection ;
    schema:relatedLink <https://github.com/google-gemini/gemini-cli> .

:google a schema:Organization, org:Organization ;
    schema:name "Google"@en ;
    schema:url <https://google.com> ;
    schema:identifier "https://google.com" ;
    rdfs:seeAlso <http://dbpedia.org/resource/Google> .

# ─────────────────────────────────────────────────────────────
# FEATURES & PRODUCTS
# ─────────────────────────────────────────────────────────────

:subagentsFeature a schema:SoftwareApplication ;
    schema:name "Gemini CLI Subagents"@en ;
    schema:description "Specialized 'specialist' agents deployed by the main Gemini CLI to handle specific jobs without cluttering the primary context or toolset."@en ;
    schema:featureList
        "Independent context window"@en ,
        "Automatic and manual delegation"@en ,
        "Isolated toolset capabilities"@en ,
        "Interactive and headless management"@en .

:browserAgent a schema:SoftwareApplication ;
    schema:name "Browser Agent"@en ;
    schema:description "An experimental subagent automating web browser tasks natively through the accessibility tree using a bundled chrome-devtools-mcp server."@en .

:customSubagents a schema:SoftwareApplication ;
    schema:name "Custom Subagent Framework"@en ;
    schema:description "Markdown files mapping system prompts, models, and specialized tool wildcards to user-defined personas."@en .

# ─────────────────────────────────────────────────────────────
# INDUSTRY VERTICAL INSTANCES
# ─────────────────────────────────────────────────────────────

:developerToolingVertical a :DeveloperToolsIndustry ;
    schema:name "Software Publishers and Tooling"@en ;
    schema:description "Organizations building and interacting with complex frameworks requiring isolated analysis capabilities and AI assistants."@en ;
    :hasAutomationReadiness "High" ;
    :hasSecurityNeeds "Significant" ;
    schema:naics "513210" ;
    schema:identifier "https://www.census.gov/naics/?input=513210&year=2022&details=513210" ;
    rdfs:seeAlso <http://dbpedia.org/resource/Software_development> .

:qaAndTestingVertical a :SoftwareServicesIndustry ;
    schema:name "Quality Assurance & Testing"@en ;
    schema:description "Teams leveraging headless subagents and browser automation (e.g. Browser Agent) for end-to-end user journey validation."@en ;
    :hasAutomationReadiness "High" ;
    :hasSecurityNeeds "High" ;
    schema:naics "541511" ;
    schema:identifier "https://www.census.gov/naics/?input=541511&year=2022&details=541511" ;
    rdfs:seeAlso <http://dbpedia.org/resource/Software_testing> .

# ─────────────────────────────────────────────────────────────
# FAQ SECTION — exactly 12 questions
# ─────────────────────────────────────────────────────────────

:faqSection a schema:FAQPage ;
    schema:name "Gemini CLI Subagents — Frequently Asked Questions"@en ;
    schema:mainEntity :q1, :q2, :q3, :q4, :q5, :q6, :q7, :q8, :q9, :q10, :q11, :q12 ;
    schema:isPartOf :analysis .

:q1 a schema:Question ;
    schema:name "What is a subagent in Gemini CLI?"@en ;
    schema:acceptedAnswer :a1 .
:a1 a schema:Answer ;
    schema:text "A subagent is a specialized, focused agent that operates in its own independent context loop with dedicated tools, allowing the main agent to delegate specific tasks without cluttering its conversation history."@en .

:q2 a schema:Question ;
    schema:name "How are tasks routed to subagents?"@en ;
    schema:acceptedAnswer :a2 .
:a2 a schema:Answer ;
    schema:text "Tasks are routed either automatically by the main agent evaluating the request against subagent expertise, or manually forced by the user via the '@' syntax (e.g., '@codebase_investigator')."@en .

:q3 a schema:Question ;
    schema:name "What is the Codebase Investigator?"@en ;
    schema:acceptedAnswer :a3 .
:a3 a schema:Answer ;
    schema:text "A built-in subagent designed purely to analyze code, trace complex dependencies, and perform reverse-engineering tasks within your project."@en .

:q4 a schema:Question ;
    schema:name "When should I use the Generalist Agent?"@en ;
    schema:acceptedAnswer :a4 .
:a4 a schema:Answer ;
    schema:text "The Generalist should be used for extensive, multi-step operations like multi-file refactoring or high-volume execution that would heavily bloat the main conversation."@en .

:q5 a schema:Question ;
    schema:name "What capabilities does the experimental Browser Agent have?"@en ;
    schema:acceptedAnswer :a5 .
:a5 a schema:Answer ;
    schema:text "It can navigate sites, fill forms, and extract info using Chrome's accessibility tree, bundled securely with a 'chrome-devtools-mcp' server."@en .

:q6 a schema:Question ;
    schema:name "Do I need to install a separate extension for the Browser Agent?"@en ;
    schema:acceptedAnswer :a6 .
:a6 a schema:Answer ;
    schema:text "No, the underlying chrome-devtools-mcp server is natively bundled into Gemini CLI, though Chrome 144 or later is required on the host."@en .

:q7 a schema:Question ;
    schema:name "What session modes are available for the Browser Agent?"@en ;
    schema:acceptedAnswer :a7 .
:a7 a schema:Answer ;
    schema:text "The browser agent supports persistent (using a dedicated profile), isolated (ephemeral incognito), or existing (connecting to a running remote debug port) modes."@en .

:q8 a schema:Question ;
    schema:name "How do I create a custom subagent?"@en ;
    schema:acceptedAnswer :a8 .
:a8 a schema:Answer ;
    schema:text "By creating a Markdown file with YAML frontmatter containing the agent's name, description, tools, and model, placed under the `.gemini/agents/` directory."@en .

:q9 a schema:Question ;
    schema:name "What kind of security measures restrict the Browser Agent?"@en ;
    schema:acceptedAnswer :a9 .
:a9 a schema:Answer ;
    schema:text "It strictly enforces domain whitelists, blocks dangerous URL schemas, requires manual confirmation for sensitive actions like uploads, and enforces an action rate limit per task."@en .

:q10 a schema:Question ;
    schema:name "Can subagents call other subagents?"@en ;
    schema:acceptedAnswer :a10 .
:a10 a schema:Answer ;
    schema:text "No, subagents are strictly isolated from the main agent's subagent-launching tools to prevent infinite recursion and ensure clean delegation patterns."@en .

:q11 a schema:Question ;
    schema:name "How do I allocate specific tools to a subagent?"@en ;
    schema:acceptedAnswer :a11 .
:a11 a schema:Answer ;
    schema:text "In the custom agent's YAML block, use the 'tools' array. You can specify exact tool names, use wildcard groups, or include specific MCP server capacities."@en .

:q12 a schema:Question ;
    schema:name "How does Docker container sandboxing affect the browser agent?"@en ;
    schema:acceptedAnswer :a12 .
:a12 a schema:Answer ;
    schema:text "Chrome cannot run natively inside the Docker sandbox, so the agent must connect to an existing Chrome instance on the host using the 'existing' session mode over an exposed debug port."@en .

# ─────────────────────────────────────────────────────────────
# GLOSSARY — exactly 10 terms
# ─────────────────────────────────────────────────────────────

:glossarySection a skos:ConceptScheme, schema:DefinedTermSet ;
    schema:name "Gemini Subagents Glossary"@en ;
    schema:description "Key vocabulary around Gemini CLI agent ecosystems and tooling delegation."@en ;
    schema:hasDefinedTerm
        :termSubagent, :termAutomaticDelegation, :termAtSyntax,
        :termCodebaseInvestigator, :termBrowserAgent, :termSessionMode,
        :termAgentDefinitionFile, :termToolIsolation, :termVisualModel, :termVisualOverlay ;
    schema:isPartOf :analysis .

:termSubagent a schema:DefinedTerm ;
    schema:name "Subagent"@en ;
    schema:description "A specialized agent context spawned by the main CLI session to execute specific workflows without sharing its entire context history."@en ;
    skos:definition "Focused, task-specific worker agent."@en .

:termAutomaticDelegation a schema:DefinedTerm ;
    schema:name "Automatic Delegation"@en ;
    schema:description "The capability of the main agent to autonomously select and activate a subagent when it assesses a user's prompt matches that subagent's designated expertise."@en ;
    skos:definition "AI-driven selection of specialist subagents."@en .

:termAtSyntax a schema:DefinedTerm ;
    schema:name "@ Syntax"@en ;
    schema:description "A user command convention explicitly forcing the immediate invocation of a subagent, bypassing the main agent's routing decision."@en ;
    skos:definition "Manual invocation trigger for subagents."@en .

:termCodebaseInvestigator a schema:DefinedTerm ;
    schema:name "Codebase Investigator"@en ;
    schema:description "A native subagent equipped purely to analyze code, search directories, and map architectural dependencies."@en ;
    skos:definition "Subagent designed for code research."@en .

:termBrowserAgent a schema:DefinedTerm ;
    schema:name "Browser Agent"@en ;
    schema:description "An experimental native subagent capable of executing web navigation, form interactions, and data extraction using Chrome DevTools Protocol."@en ;
    skos:definition "Subagent controlling web browser automation."@en .

:termSessionMode a schema:DefinedTerm ;
    schema:name "Session Mode"@en ;
    schema:description "Configuration (persistent, isolated, or existing) determining how the Browser Agent instances manage cookies, cache, and launch characteristics."@en ;
    skos:definition "State management profile for browser automation."@en .

:termAgentDefinitionFile a schema:DefinedTerm ;
    schema:name "Agent Definition File"@en ;
    schema:description "A Markdown file starting with YAML frontmatter defining a custom subagent's capabilities, prompt logic, and model configurations."@en ;
    skos:definition "Declarative configuration file for custom agents."@en .

:termToolIsolation a schema:DefinedTerm ;
    schema:name "Tool Isolation"@en ;
    schema:description "A security framework ensuring that specific tools or MCP servers are only accessible to permitted subagents, restricting global scope."@en ;
    skos:definition "Limiting tool access strictly to assigned agents."@en .

:termVisualModel a schema:DefinedTerm ;
    schema:name "Visual Model"@en ;
    schema:description "A specialized secondary AI model (like gemini-2.5-computer-use) configured within the Browser Agent strictly for analyzing coordinate-based interactions."@en ;
    skos:definition "Vision-capable model deployed for UI coordinate resolution."@en .

:termVisualOverlay a schema:DefinedTerm ;
    schema:name "Visual Overlay"@en ;
    schema:description "A warning UI injected into non-headless browser sessions to indicate live automation and block accidental manual user input interference."@en ;
    skos:definition "Safety overlay blocking manual interaction during automation."@en .

# ─────────────────────────────────────────────────────────────
# HOWTO — exactly 7 steps
# ─────────────────────────────────────────────────────────────

:howtoSection a schema:HowTo ;
    schema:name "How to create and deploy a Custom Subagent"@en ;
    schema:description "A clear 7-step guide to provisioning isolated, custom subagent workflows in Gemini CLI."@en ;
    schema:step :step1, :step2, :step3, :step4, :step5, :step6, :step7 ;
    schema:isPartOf :analysis .

:step1 a schema:HowToStep ;
    schema:name "Create the Markdown File"@en ;
    schema:text "Initialize a `.md` file inside your project’s `.gemini/agents/` folder (or globally in `~/.gemini/agents/`)."@en ;
    schema:position 1 .

:step2 a schema:HowToStep ;
    schema:name "Add YAML Frontmatter"@en ;
    schema:text "Start the file with `---` and define the agent 'name', 'description', and the 'model' to be used."@en ;
    schema:position 2 .

:step3 a schema:HowToStep ;
    schema:name "Define Tool Capabilities"@en ;
    schema:text "Under the 'tools' key, array the exact native tools or MCP server capacities (optionally using `mcp_*` wildcards) you want to grant."@en ;
    schema:position 3 .

:step4 a schema:HowToStep ;
    schema:name "Write the System Prompt"@en ;
    schema:text "Below the ending `---`, write a decisive, strict instruction set outlining exactly how the persona should behave and solve problems."@en ;
    schema:position 4 .

:step5 a schema:HowToStep ;
    schema:name "Verify Isolation Settings"@en ;
    schema:text "If necessary, navigate to `settings.json` to configure subagent-specific approval policies or further isolate network/file interactions."@en ;
    schema:position 5 .

:step6 a schema:HowToStep ;
    schema:name "Test via Manual Invocation"@en ;
    schema:text "Start the CLI and use the `@my_agent_name` syntax to force the primary router to skip logic checks and test your agent directly."@en ;
    schema:position 6 .

:step7 a schema:HowToStep ;
    schema:name "Enable Automatic Delegation"@en ;
    schema:text "Once tested, pose a normal question closely aligned with the agent's description. Review the trace output to ensure the main agent routes to it autonomously."@en ;
    schema:position 7 .
