agentleFS
devoxxdevoxx/DevoxxGenieIDEAPlugin/AGENTS.md

DevoxxGenieIDEAPlugin

AGENTS.md689 starsChanged 7 days agoMITView on GitHub

DevoxxGenie is a Java-based LLM Code Assistant plugin for IntelliJ IDEA that integrates with both local LLM providers (Ollama, LMStudio, GPT4All, Llama.cpp, Exo) and cloud-based LLMs (OpenAI, Anthropic, Mistral, Groq, Gemini, DeepInfra, DeepSeek, OpenRouter, OrcaRouter, Requesty, DemonRoute, Azure OpenAI, Amazon Bedrock). The plugin supports advanced features like RAG (Retrieval-Augmented Generation), MCP (Model Context Protocol) servers, web search, and agentic programming capabilities. Entry Point: - UserPromptPanel → PromptSubmissionListener.onPromptSubmitted() → PromptExecutionController.handlePromptSubmission() Processing Layer: - PromptExecutionService.executeQuery() - Handles token calculations, RAG, and GitDiff…

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository7 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

16 rules. About 0 are common, 6 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create factory class implementing ChatModelFactory under chatmodel/cloud/ or chatmodel/local/

    line 86
  2. Very specific:

    Add provider to ModelProvider enum in model/enumarations/

    line 89
  3. Very specific:

    Update model/CustomPrompt.java if new model properties needed

    line 219
  4. Very specific:

    Update service/prompt/command/CustomPromptCommand.java for execution

    line 221
  5. Distinctive:

    Add entry in Settings → Prompts panel

    line 222
  6. Very specific:

    Check MCPCallbackLogger for request/response details

    line 227
  7. Distinctive:

    Verify transport configuration (stdio vs HTTP SSE)

    line 228
  8. Distinctive:

    Ensure Docker is running

    line 231
  9. Very specific:

    Use RAGValidatorService to check prerequisites

    line 234
  10. Very specific:

    Update version in build.gradle.kts

    line 238
  11. Very specific:

    Test: ./gradlew test and ./gradlew verifyPlugin

    line 242
  12. Very specific:

    If your client supports MCP resources, read backlog://workflow/overview to understand when and how to use Backlog for this project.

    line 266
  13. Very specific:

    If your client only supports tools or the above request fails, call backlog.get_workflow_overview() tool to load the tool-oriented overview …

    line 267
  14. Distinctive:

    First time working here?: Read the overview resource IMMEDIATELY to learn the workflow

    line 269
  15. Distinctive:

    When to read it: BEFORE creating tasks, or when you're unsure whether to track work

    line 271
  16. Distinctive:

    Search-first workflow to avoid duplicates

    line 275

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

This file provides guidance to AI agents when working with code in this repository.

Project Overview

DevoxxGenie is a Java-based LLM Code Assistant plugin for IntelliJ IDEA that integrates with both local LLM providers (Ollama, LMStudio, GPT4All, Llama.cpp, Exo) and cloud-based LLMs (OpenAI, Anthropic, Mistral, Groq, Gemini, DeepInfra, DeepSeek, OpenRouter, OrcaRouter, Requesty, DemonRoute, Azure OpenAI, Amazon Bedrock). The plugin supports advanced features like RAG (Retrieval-Augmented Generation), MCP (Model Context Protocol) servers, web search, and agentic programming capabilities.

Build & Development Commands

Building

./gradlew buildPlugin              # Build plugin (creates ZIP in build/distributions/)
./gradlew clean                    # Clean build artifacts
./gradlew shadowJar                # Create shadow JAR with dependencies

Testing

./gradlew test                                    # Run all tests
./gradlew test --tests ClassName                  # Run specific test class
./gradlew test --tests ClassName.methodName      # Run single test method
./gradlew verifyPlugin                            # Verify plugin (includes tests)

Running & Publishing

./gradlew runIde                   # Run IntelliJ IDEA with plugin for testing
./gradlew publishPlugin            # Publish to JetBrains Marketplace (requires PUBLISH_TOKEN env var)

Task Automation (using Taskfile)

task build                         # Build the plugin
task test                          # Run tests
task run-ide                       # Run IDE with plugin
task generate-changelog VERSION=0.8.0  # Generate changelog from merged PRs
task preview-changes VERSION=0.8.0     # Preview changelog without committing

Core Architecture

Multi-Module Structure

  • Root module: Main IntelliJ plugin code (src/main/java/com/devoxx/genie/)
  • Core module: Shared utilities being refactored (see core/README.md - issue #564)
  • Docusaurus: Documentation website (docusaurus/)

Key Architectural Components

1. Prompt Execution Flow

The plugin processes user prompts through a layered architecture:

Entry Point:

  • UserPromptPanel → PromptSubmissionListener.onPromptSubmitted() → PromptExecutionController.handlePromptSubmission()

Processing Layer:

  • PromptExecutionService.executeQuery() - Handles token calculations, RAG, and GitDiff settings
  • ChatPromptExecutor.executePrompt() - Dispatches to appropriate LLM provider
  • LLMProviderService.getAvailableModelProviders() - Retrieves model from ChatModelFactory

Execution Strategies:

  • StreamingPromptExecutor - Token-by-token streaming responses
  • NonStreamingPromptExecutionService - Full response mode
  • WebSearchPromptExecutionService - Web search augmented prompts

Response Rendering:

  • ChatStreamingResponsePanel - Real-time streaming UI updates
  • ChatResponsePanel - Final response display with code highlighting
  • ResponseHeaderPanel, ResponseDocumentPanel, MetricExecutionInfoPanel - Modular response components

2. LLM Provider System

Factory Pattern Implementation:

  • ChatModelFactory (interface) - Base factory for all providers
  • ChatModelFactoryProvider - Provider registry and lookup
  • Provider-specific factories under:
    • chatmodel/cloud/ - Cloud providers (OpenAI, Anthropic, Gemini, etc.)
    • chatmodel/local/ - Local providers (Ollama, GPT4All, LMStudio, etc.)

Cloud Providers: anthropic, azureopenai, bedrock, deepinfra, deepseek, google, grok, groq, mistral, openai

Routers (generic path, defined in chatmodel/cloud/router/RouterRegistry): openrouter, orcarouter, requesty, demonroute

Local Providers: ollama, gpt4all, lmstudio, llamacpp, jan, customopenai

Adding New Providers:

  1. Create factory class implementing ChatModelFactory under chatmodel/cloud/ or chatmodel/local/
  2. Implement createChatModel() and createStreamingChatModel() methods
  3. Register in ChatModelFactoryProvider
  4. Add provider to ModelProvider enum in model/enumarations/

3. RAG (Retrieval-Augmented Generation) System

Components:

  • ProjectIndexerService - Indexes project files for semantic search
  • ChromaEmbeddingService - Stores embeddings in ChromaDB (Docker-based, v0.6.2)
  • SemanticSearchService - Retrieves relevant code based on similarity
  • Uses Ollama with Nomic Text embeddings for vector generation
  • RAGValidatorService - Validates Docker, ChromaDB, and Ollama setup

Validators:

  • DockerValidator - Checks Docker availability
  • ChromeDBValidator - Validates ChromaDB connection
  • OllamaValidator - Verifies Ollama and embedding model
  • NomicEmbedTextValidator - Checks nomic-embed-text model

4. MCP (Model Context Protocol) Support

Key Services:

  • MCPService - Core MCP server management
  • MCPExecutionService - Executes MCP tool calls
  • MCPListenerService - Implements ChatModelListener for MCP integration
  • MCPCallbackLogger - Logs MCP requests/responses for debugging

Configuration:

  • MCP servers configured in Settings UI (ui/settings/mcp/)
  • Supports stdio and HTTP SSE transports
  • Tools are automatically exposed to LLM conversations when MCP is enabled

5. Service Layer Organization

Key services under service/:

  • ChatService - Manages chat conversations
  • MessageCreationService - Constructs LLM messages with context
  • TokenCalculationService - Calculates token usage and costs
  • ProjectContentService - Extracts project content for context
  • FileListManager - Manages files added to prompt context
  • ConversationStorageService - Persists chat history locally (SQLite)

UI Architecture

Main Panels:

  • DevoxxGenieToolWindowContent - Main plugin window
  • ConversationPanel - Chat conversation display
  • UserPromptPanel - User input area with image/file DnD support
  • ActionButtonsPanel - Control buttons (submit, stop, clear, etc.)
  • PromptOutputPanel - Response output with streaming support

Settings UI (ui/settings/):

  • LLMProvidersComponent - Configure LLM providers and API keys
  • RAGSettingsComponent - RAG feature configuration
  • MCPSettingsComponent - MCP server management
  • PromptSettingsComponent - Custom prompts and shortcuts
  • WebSearchProvidersComponent - Google/Tavily search setup

Project Scanner & AST Analysis

Language-Specific Scanners (service/analyzer/languages/):

  • Each language has a ProjectScannerExtension implementation
  • Supports: Java, Kotlin, Python, JavaScript, Go, Rust, C++, PHP
  • Extracts AST context (parent classes, field references) for better code analysis
  • ProjectAnalyzer coordinates language-specific scanning
  • CachedProjectScanner - Caches scan results for performance

Test Driven Generation (TDG)

Experimental Feature (service/tdg/):

  • CodeGeneratorService - Generates implementation from unit tests
  • Allows writing tests first, then generating implementation

Code Style & Conventions

Naming Conventions

  • Variables/Methods: camelCase
  • Classes/Interfaces: PascalCase
  • Constants: SCREAMING_SNAKE_CASE
  • Service Classes: Suffix with "Service" (e.g., ChatService)
  • Factory Classes: Suffix with "Factory" (e.g., ChatModelFactory)
  • Panel Classes: Suffix with "Panel" (e.g., UserPromptPanel)

Dependency Management

  • Java minimum: JDK 17
  • IntelliJ minimum: 2023.3.4
  • Langchain4J version: 1.10.0 (beta: 1.10.0-beta18 for MCP/Chroma/web search)
  • Uses Lombok for boilerplate reduction
  • Shadow plugin for fat JAR creation with dependency merging

Testing Practices

  • Tests located in src/test/java/ mirroring main structure
  • Uses JUnit 5 (Jupiter) for testing
  • Mockito for mocking
  • AssertJ for fluent assertions
  • Integration tests suffixed with IT (e.g., PromptExecutionServiceIT)
  • Platform tests extend AbstractLightPlatformTestCase

Important Implementation Details

DEVOXXGENIE.md Files

  • Projects can include a DEVOXXGENIE.md file at root
  • This file is automatically added to the system prompt for better LLM context
  • Can be generated via Settings UI or /init command in prompt input
  • Provides project-specific guidance to the LLM

Chat Memory & Context

  • Configurable chat memory size (default: 10 messages)
  • ChatMemoryManager handles memory lifecycle per conversation
  • Conversations stored locally using SQLite
  • Each conversation maintains independent memory context

Token Calculation & Cost Estimation

  • Real-time token counting using JTokkit library
  • Cost calculation for cloud providers
  • Context window tracking and warnings
  • Supports adding full project to context for large context models (e.g., Gemini 1M tokens)

Web Search Integration

  • Google Custom Search and Tavily supported
  • WebSearchPromptExecutionService augments prompts with search results
  • Configured via Settings UI with API keys

Git Integration

  • GitMergeService - Git diff integration
  • Can include uncommitted changes in prompt context
  • Useful for explaining changes or generating commit messages

Plugin Configuration Files

  • src/main/resources/META-INF/plugin.xml - Main plugin descriptor
  • Language-specific features: java-features.xml, kotlin-features.xml, python-features.xml, etc.
  • src/main/resources/application.properties - Application properties (version auto-updated by build)
  • gradle.properties - Gradle configuration
  • .env - Local environment variables (not committed)

Common Development Workflows

Adding a New Custom Prompt

  1. Update model/CustomPrompt.java if new model properties needed
  2. Modify ui/settings/prompt/PromptSettingsComponent.java for UI
  3. Update service/prompt/command/CustomPromptCommand.java for execution
  4. Add entry in Settings → Prompts panel

Debugging MCP Issues

  1. Enable MCP logging in Settings → MCP
  2. View logs in MCP Log Tool Window (MCPLogPanel)
  3. Check MCPCallbackLogger for request/response details
  4. Verify transport configuration (stdio vs HTTP SSE)

Working with RAG

  1. Ensure Docker is running
  2. ChromaDB container must be started (docker-java integration)
  3. Ollama with nomic-embed-text model required
  4. Use RAGValidatorService to check prerequisites
  5. Index project via ProjectIndexerService.indexFiles()

Release Process

  1. Update version in build.gradle.kts
  2. Generate changelog: task generate-changelog VERSION=x.y.z
  3. Review and commit changes to CHANGELOG.md and plugin.xml
  4. Build: ./gradlew buildPlugin
  5. Test: ./gradlew test and ./gradlew verifyPlugin
  6. Publish: Set PUBLISH_TOKEN env var and run ./gradlew publishPlugin

Key Dependencies & Tools

  • Langchain4J: LLM integration framework (core abstraction)
  • Docker Java: Docker integration for ChromaDB
  • JTokkit: Token counting
  • SQLite JDBC: Local conversation storage
  • CommonMark: Markdown parsing and rendering
  • Netty: Async networking
  • Logback: Logging framework
  • Retrofit: HTTP client for external APIs
  • AWS SDK: Amazon Bedrock integration
<!-- BACKLOG.MD MCP GUIDELINES START -->

<CRITICAL_INSTRUCTION>

BACKLOG WORKFLOW INSTRUCTIONS

This project uses Backlog.md MCP for all task and project management activities.

CRITICAL GUIDANCE

  • If your client supports MCP resources, read backlog://workflow/overview to understand when and how to use Backlog for this project.
  • If your client only supports tools or the above request fails, call backlog.get_workflow_overview() tool to load the tool-oriented overview (it lists the matching guide tools).
  • First time working here? Read the overview resource IMMEDIATELY to learn the workflow
  • Already familiar? You should have the overview cached ("## Backlog.md Overview (MCP)")
  • When to read it: BEFORE creating tasks, or when you're unsure whether to track work

These guides cover:

  • Decision framework for when to create tasks
  • Search-first workflow to avoid duplicates
  • Links to detailed guides for task creation, execution, and finalization
  • MCP tools reference

You MUST read the overview resource to understand the complete workflow. The information is NOT summarized here.

</CRITICAL_INSTRUCTION>

<!-- BACKLOG.MD MCP GUIDELINES END --><!-- groma:start -->

Groma

This project uses Groma. Before you scan, inspect, or curate architecture, or change files for a Backlog task, run groma agent-instructions and read the guide it names for that job. When it reports a first scan, ask the user whether they want you to curate the architecture. Do not edit Groma-owned architecture files directly.

<!-- groma:end -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.