Prompt: Map out the structure of this project, at a very high level. Describe the folder structure, the kinds of code that lives where, and a very short overview of how to run/build the project based on a package file or README. DO NOT read more than the top 20 lines of any particular file. Record your results in the file SLOP.md
Dolorous Code is an agentic development tool written in Go. It uses AI models (specifically Moonshot/OpenAI) to interact with a codebase autonomously, allowing the agent to read, write, and edit files within a sandboxed environment.
The project is a Go CLI application (main.go) that acts as a chat interface for an AI agent. The agent is equipped with "tools" (file reading, writing, editing, listing) to navigate and modify the project directory. It maintains a conversation history with the AI to plan and execute code changes.
main.go: The entry point. Contains the main CLI loop, AI client initialization, tool definitions (file operations), and the agent logic that drives the conversation and tool execution.go.mod/go.sum: Go module definitions. Dependencies includeopenai-gofor AI interactions andjsonschemafor generating tool parameters.paths/: Containspaths.goandpaths_test.go. Handles file system path operations and implements safety checks (sandboxing) to ensure the agent only accesses files within the allowed root directory.tools/: Containsbacklog.go,backlog_test.go, andtools.go. Provides additional agent utilities, such as managing a.dol/backlog.mdfile for tracking work items and other repository-specific tools.docs/: Containswork-tracking.md, likely used for documenting the agent's progress or internal workflows.patches/: Contains a patch file (0001-openai-go-extra-fields-on-request.patch), suggesting modifications to theopenai-godependency to support extra request fields.vendor/: Vendored third-party dependencies.dol.sublime-project: Sublime Text project configuration file.README.md: Project documentation, including TODOs, references to AI agent architectures, and ANSI color codes used in the CLI.
- Environment: Ensure Go is installed. Set the
MOONSHOT_API_KEYenvironment variable for the AI client to function. - Build: Run
go buildin the project root to compile the binary. - Run: Execute
go run main.goor the compiled binary. The application will start an interactive chat session where you can provide tasks for the agent to perform on the codebase.