Class SubAgent

java.lang.Object
ai.tabforge.workshop.agent.SubAgent
Direct Known Subclasses:
DefaultSubAgent

public abstract class SubAgent extends Object
  • Constructor Details

  • Method Details

    • execute

      public final AgentResult execute(AgentContext context)
      Called by the OrchestratorAgent.startReview()
      Parameters:
      context - - created and passed to this method by
      invalid reference
      OrchestratorAgent#startReview()
      Returns:
    • buildPrompt

      protected abstract String buildPrompt(AgentContext context)
      A string that defines the role and behavior of the agent. For example for SecurityAuditorAgent:
      
             "You are a security auditor specialized in Jakarta EE applications. 
              Analyze the provided Java code for security vulnerabilities. 
             Focus on: SQL injection, hardcoded secrets, missing authorization... 
      
             Respond ONLY in this JSON format: 
             [{ "ruleId": "SEC-001", "severity": "CRITICAL", ... }]"
             
      That string goes to the Claude API call as a system parameter.
      Parameters:
      context - - Some agents may use this parameter, SecurityAuditorAgent ignores it.
      Returns:
    • analyzeFile

      protected abstract AgentResult analyzeFile(String prompt, String fileContent, int maxOutputTokens)
      Actual Claude API call
      Parameters:
      prompt -
      fileContent -
      Returns:
    • getAgentName

      protected abstract String getAgentName()