Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Docker 8 min read How-to mediumAdept

Using Docker AI Tools for Devs to Provide Context for Better Code Fixes

LLMs fix lint violations far better when given the surrounding code, so Docker Labs built a prompt-driven pipeline where each step runs in a container: Pylint produces a violation report, violations are loaded into SQLite, and Tree-sitter parses the project into an AST whose top-level statement ranges are indexed alongside the source. The LLM then queries this database (writing its own SQL from the schema) to retrieve the enclosing function for a violation before proposing a fix. This sidesteps context-window limits of reading whole files, and the same pattern generalizes to any tool that maps code locations to issues.

Related posts

  • Getting Started with the Labs AI Tools for Devs Docker Desktop Extension

    Docker mediumAdept

    The Labs AI Tools for Devs Docker Desktop extension runs LLM prompts against local projects. Prompts are referenced by git ref or URL, or loaded as local files. A prompt is a markdown file with system and user sections, and project context such as languages and files is injected through mustache templates. Tools the LLM can call are defined as Docker images that get bind-mounted into the project and receive a JSON payload as their first argument. Sample prompts cover Dockerfile generation, runbooks, ESLint and Pylint fixes.

  • Using an AI Assistant to Script Tools

    Docker mediumAdept

    Instead of feeding large datasets like Pylint violation JSON through an LLM to transform them into SQL INSERT statements, the assistant can be prompted to write a JavaScript program that performs the transformation, then run it through a tool call. The tool is defined in YAML and backed by a minimal Docker container with no network, host filesystem, GPU or shell access, only shared volumes and Node.js. Having the model generate tools this way limits how much data goes into the context window and lets repeated tasks run without going back to the LLM.

  • How to Fix ESLint Violations with AI Assistance

    Docker mediumAdept

    An LLM can produce correct fixes for ESLint violations once it has tools that supply minimal, precise context. ESLint's JSON output for even 100 violations exceeds 10,000 characters, so the full report is written to an ephemeral Docker volume and read through condensed or per-file parse tools rather than passed through the model's context. A Dockerized Tree-sitter tool then fetches the AST node and surrounding code for a given line. Violations are grouped by whether they need source context and human supervision. The agent fixed individual violations such as floating promises and unused vars, but it would not loop through multiple violations unless each prompt named a specific rule.

  • Adding the ESLint Tool to an AI Assistant: Improving Recommendations for JS/TS Projects

    Docker mediumAdept

    An AI assistant gets better at linting JavaScript and TypeScript projects when it is given ESLint tooling instead of relying on the LLM's built-in knowledge. Out of the box, GPT-4 suggests boilerplate ESLint configs that often don't work. A prompt plus a containerized StandardJS function definition lets the assistant pick ts-standard when tsconfig files exist, run it from the right directory, and install Docker-based Git hooks. The LLM can then generate JSON edit ranges for violations that aren't auto-fixable. Showing these fixes in VSCode's problems window, driven by linter output, avoids the hallucinations that context-free Copilot "fix this" requests produce.

  • Build Your Own AI-Driven Code Analysis Chatbot for Developers with the GenAI Stack

    Docker mediumAdept

    Code Explorer, a winning Docker AI/ML Hackathon project, is a RAG chatbot that answers questions about a local codebase by parsing source files, chunking them with LangChain's RecursiveCharacterTextSplitter (5000 characters with 500 overlap), and storing embeddings in a Neo4j vector store. LangChain builds two chains: a QnA RAG chain for detailed answers and an agent chain that wraps it as a tool and tends to return more concise summaries. The app falls back to the plain LLM when no codebase has been processed. The walkthrough runs the stack with Docker Compose: a Streamlit UI, Ollama serving codellama:7b-instruct, a one-shot model-pull container, and Neo4j, configured through a .env file.

The quest for software engineering knowledge.

Look:
Layout: