agentleFS
gustavoeenriquezgustavoeenriquez/MakerAi/Source/CLAUDE.md

MakerAi / Source

CLAUDE.md212 starsChanged 2 months agoMITView on GitHub

This is the main source code directory for MakerAI 3.2, an AI orchestration framework for Delphi. See individual module CLAUDE.md files for detailed guidance on specific subsystems. Open Packages/MakerAiGrp.groupproj to compile all packages. Register in uMakerAi.Chat.Initializations.pas. Environment variables: Use @VAR_NAME syntax (e.g., @OPENAI_API_KEY). See ../CLAUDE.md for project overview, naming conventions, Delphi version compatibility, thread safety details, troubleshooting, and known issues.

  • Reads credentials

The file

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

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    All chat implementations follow: acsIdle → acsConnecting → [acsReasoning] → acsWriting → [acsToolCalling] → acsFinished/acsError

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Source Directory Overview

This is the main source code directory for MakerAI 3.2, an AI orchestration framework for Delphi. See individual module CLAUDE.md files for detailed guidance on specific subsystems.

Building

Package Compilation Order (Critical)

1. Packages/MakerAI.dpk          - Runtime core (~98 units)
2. Packages/MakerAi.RAG.Drivers.dpk  - PostgreSQL connectors
3. Packages/MakerAi.UI.dpk       - FMX visual components
4. Packages/MakerAiDsg.dpk       - Design-time (requires VCL, DesignIDE)

Open Packages/MakerAiGrp.groupproj to compile all packages.

Required Library Paths

All subdirectories (Agents, Chat, ChatUI, Core, Design, Embeddings, MCPClient, MCPServer, Memory, Packages, RAG, Realtime, Resources, Tools, Utils, WebSocket) must be in Delphi Library Path. Memory is easy to miss: the packages compile without it (the .dpk uses relative paths), but an app that uses TAiMemory fails with "File not found: uMakerAi.Memory.dcu".

Module Quick Reference

ModuleEntry PointKey Classes
CoreuMakerAi.Chat.pasTAiChat (abstract base), TAiMediaFile, TAiChatMessage
ChatuMakerAi.Chat.AiConnection.pasTAiChatConnection (universal connector)
RAGuMakerAi.RAG.Vectors.pas, uMakerAi.RAG.Graph.Core.pasTAiVectorStore, TAiRagGraph
AgentsuMakerAi.Agents.pasTAIAgentManager, TAIAgentsNode, TAIBlackboard
MCPServeruMakerAi.MCPServer.Core.pasTAiMCPServer, IAiMCPTool
MCPClientuMakerAi.MCPClient.Core.pasTMCPClientItem, transport classes
ToolsuMakerAi.Tools.Functions.pasTAiFunctions, TFunctionActionItem
ChatUIuMakerAi.UI.ChatList.pasTChatList, TChatBubble, TChatInput
RealtimeuMakerAi.Realtime.AiConnection.pasTAiRealtimeConnection, TAiRealtimeBase, TAiOpenAiRealtimeSTT
WebSocketuMakerAi.WebSocket.Client.pasTAiWSClient, ITlsTransport, TSChannelTransport, TAndroidSSLTransport, TOpenSSLTransport

Architecture Patterns

Universal Connector

TAiChatConnection abstracts all LLM providers. Switch providers by setting DriverName:

AiConnection.DriverName := 'OpenAI';  // or 'Claude', 'Gemini', 'Ollama', etc.
AiConnection.Model := 'gpt-5.1-turbo';

Driver Registration

New LLM drivers must implement these class methods in TAiChat descendant:

class function GetDriverName: string; override;
class procedure RegisterDefaultParams(Params: TStrings); override;
class function CreateInstance(Sender: TComponent): TAiChat; override;

Register in uMakerAi.Chat.Initializations.pas.

Chat State Machine

All chat implementations follow: acsIdle → acsConnecting → [acsReasoning] → acsWriting → [acsToolCalling] → acsFinished/acsError

Media File Handling

TAiMediaFile abstracts files across providers. Load with LoadFromFile(), attach to messages via AddMessageAndRun(prompt, role, [mediaFile]).

Parameter Hierarchy

Three levels (lowest to highest priority):

  1. Driver defaults (RegisterDefaultParams)
  2. Model overrides (TAiChatFactory.RegisterModelParam)
  3. User overrides (TAiChatFactory.RegisterUserParam)

Environment variables: Use @VAR_NAME syntax (e.g., @OPENAI_API_KEY).

Common Tasks

TaskLocation
Add LLM providerChat/uMakerAi.Chat.*.pas (inherit TAiChat)
Add MCP toolMCPServer/ (implement IAiMCPTool)
Add agent toolAgents/ (inherit TAiToolBase, register in TEngineRegistry)
Modify function callingTools/uMakerAi.Tools.Functions.pas
Change version/flagsCore/uMakerAi.Version.inc

Navigation

See ../CLAUDE.md for project overview, naming conventions, Delphi version compatibility, thread safety details, troubleshooting, and known issues.

Module Documentation

ModuleDocumentation
Core/Foundation classes, TAiChat, TAiMediaFile
Chat/LLM provider drivers
Agents/Agent orchestration framework
RAG/Retrieval-Augmented Generation
MCPServer/MCP server implementations
MCPClient/MCP client connector
Tools/Function calling, Shell, ComputerUse
ChatUI/FMX visual components
Realtime/Real-time STT drivers (OpenAI WebSocket, Gemini stub)
WebSocket/RFC 6455 WebSocket client + TLS (SChannel/OpenSSL)
Utils/Voice monitor, diff updater
Design/Design-time property editors
Resources/Embedded resources

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.