How jonmarkgo/15mincodingagent works
This repository is a small, offline-first Ruby coding-agent tutorial. Its main workflow builds a task and tool descriptions, asks an OpenAI-compatible model for tool calls, checks and dispatches those calls, runs tools in a workspace, and returns results until the model finishes. Separate examples demonstrate plain chat and hallucination checking; the skills and build variants extend the agent loop. The README documents capabilities beyond the sampled code, so those are represented only where their paths and relationships are supported.
Main entry points: 06_loop.rb Agent loop · 01_ask.rb Inference client · 07_skills.rb Skills · hallucinate.rb Reality check
Components 13
Agent workflow
- Inference client
steps/01_ask.rb - Prompt and tools
steps/03_describe.rb - Tool dispatcher
steps/04_act.rb - Guardrails
steps/05_guardrails.rb - Agent loop
steps/06_loop.rb
Workspace tools
- Workspace files
steps/02_tools.rb - File and shell tools
steps/02_tools.rb
Agent examples
- Skills
steps/07_skills.rb - Interactive builder
steps/build.rb - Chat example
steps/chat.rb - Reality check
steps/hallucinate.rb
External services
- Model server
Other components
- User
Connections 21
- User → Agent loop: gives task
steps/06_loop.rb - Agent loop → Prompt and tools: builds context
steps/06_loop.rb - Prompt and tools → File and shell tools: lists files
steps/03_describe.rb - Agent loop → Inference client: sends messages
steps/06_loop.rb - Inference client → Model server: HTTP request
steps/01_ask.rb - Model server → Inference client: returns reply
steps/01_ask.rb - Agent loop → Guardrails: passes tool call
steps/06_loop.rb - Guardrails → Tool dispatcher: approves dispatch
steps/05_guardrails.rb - Tool dispatcher → File and shell tools: dispatches tool
steps/04_act.rb - File and shell tools → Workspace files: reads and writes
steps/02_tools.rb - Agent loop → Inference client: returns tool results
steps/06_loop.rb - User → Interactive builder: requests changes
steps/build.rb - Interactive builder → Agent loop: runs agent
steps/build.rb - User → Skills: requests task
steps/07_skills.rb - Skills → Agent loop: starts agent
steps/07_skills.rb - Skills → Workspace files: reads skill files
steps/07_skills.rb - User → Chat example: asks question
steps/chat.rb - Chat example → Inference client: sends question
steps/chat.rb - User → Reality check: requests prediction
steps/hallucinate.rb - Reality check → Inference client: asks without tools
steps/hallucinate.rb - Reality check → Workspace files: runs reality check
steps/hallucinate.rb