Skip to content

bots

dev_tool.services.ai.intelligence.bots

CodeReviewBot

Bases: Bot

role = 'You are a senior code reviewer with expertise in Python best practices, security, and performance optimization.' class-attribute instance-attribute

task = 'Review the following code changes and provide structured feedback:' class-attribute instance-attribute

guidelines = Prompt().unordered_random_list(['List any bugs or critical issues (if any)', 'List improvements that could be made (if any)', 'Assess overall code quality', 'List any security concerns (if any)']).text('Please format your response in plain-text. Do not use Markdown.').text('Keep your responses concise and actionable.') class-attribute instance-attribute

intel_class = CodeReviewIntel class-attribute instance-attribute

process

Source code in dev_tool/services/ai/intelligence/bots.py
def process(self, prompt: str) -> CodeReviewIntel:  # pyrefly: ignore[bad-override]
    return self.llm.prompt_to_intel(prompt=prompt)

CommitSummaryBot

Bases: Bot

role = 'You are a technical writer summarizing git commit history to help developers quickly understand recent project changes.' class-attribute instance-attribute

task = 'Summarize the following git commit history:' class-attribute instance-attribute

guidelines = Prompt().text('Provide a clear summary with:').ordered_list(['An overview of the main changes and developments', 'Group related commits into themes or features', 'Highlight any significant refactoring or architectural changes', 'Note any bug fixes or improvements']).text('Please format your response in plain-text. Do not use Markdown.').text('Keep the summary concise but informative.') class-attribute instance-attribute

intel_class = CommitSummaryIntel class-attribute instance-attribute

process

Source code in dev_tool/services/ai/intelligence/bots.py
def process(self, prompt: str, intel_class: type[CommitSummaryIntel] | None = None) -> CommitSummaryIntel:  # pyrefly: ignore[bad-override]
    return self.llm.prompt_to_intel(
        prompt=prompt,
        intel_class=intel_class or CommitSummaryIntel
    )

ProjectAnalysisBot

Bases: Bot

role = 'You are a software architect analyzing project structures and architectures.' class-attribute instance-attribute

task = 'Analyze the following project structure:' class-attribute instance-attribute

guidelines = Prompt().ordered_list(['An overview of what this project doesList the main technologies and frameworks usedDescribe the architecture patterns you identify']).text('Please format your response in plain-text. Do not use Markdown.') class-attribute instance-attribute

intel_class = ProjectAnalysisIntel class-attribute instance-attribute

process

Source code in dev_tool/services/ai/intelligence/bots.py
def process(self, prompt: str) -> ProjectAnalysisIntel:  # pyrefly: ignore[bad-override]
    return self.llm.prompt_to_intel(prompt=prompt)

ProjectQuestionBot

Bases: Bot

role = 'You are a Python developer assistant helping answer questions about a codebase.' class-attribute instance-attribute

task = 'Answer the following question about the project based on the provided context.' class-attribute instance-attribute

guidelines = Prompt().text('Provide a clear, detailed answer based on the project context.').text('Reference specific files or code when relevant.') class-attribute instance-attribute

intel_class = ProjectQuestionIntel class-attribute instance-attribute

process

Source code in dev_tool/services/ai/intelligence/bots.py
def process(self, question: str, context: str) -> ProjectQuestionIntel:  # pyrefly: ignore[bad-override]
    prompt = Prompt()
    prompt.heading('Project Context')
    prompt.text(context)
    prompt.line_break()
    prompt.heading('Question')
    prompt.text(question)
    prompt.line_break()
    prompt.text('Please format your response in plain-text. Do not use Markdown.')

    return self.llm.prompt_to_intel(prompt=prompt)