AI Context
AI coding agents consume layered documentation that provides complete understanding of the Ioto platform. This context enables AI agents to write correct, idiomatic Ioto code without guesswork — using the Safe Runtime functions, fiber-based async patterns, and proper memory management conventions.
Context Layers
| Context | Description |
|---|---|
CLAUDE.md | Project instructions, coding conventions, and build commands. |
AI/designs/DESIGN.md | Architecture overview, module design, and key decisions. |
AI/context/ | Per-module API guides covering the runtime, database, web server, JSON, URL client, MQTT, and more. |
| API Reference | Complete documentation for every public function and data structure. |
CLAUDE.md
The CLAUDE.md file at the root of each project provides instructions that AI agents read automatically. It includes:
- Build commands — How to compile, test, and run the project.
- Coding conventions — Indentation, naming, line limits, and style rules.
- Project structure — Key directories, configuration files, and entry points.
- Security policies — What is and isn't in scope for security auditing.
Architecture Documentation
The AI/designs/DESIGN.md file provides a high-level architecture overview:
- Module organization and dependencies
- Data flow between components
- Threading model (single-threaded fiber scheduling)
- Memory management strategy (Safe Runtime with global error handler)
- Key design decisions and their rationale
Per-Module API Guides
The AI/context/ directory contains detailed guides for each Ioto module:
| Module | Guide | Coverage |
|---|---|---|
| Safe Runtime | modules/r.md | Memory allocation, strings, buffers, lists, hashes, fibers, events, logging |
| Database | modules/db.md | Schema design, CRUD operations, change callbacks, pagination |
| Web Server | modules/web.md | Request handling, routing, authentication, sessions, TLS |
| JSON | modules/json.md | Parsing, path queries, tree manipulation, serialization |
| URL Client | modules/url.md | HTTP requests, streaming, JSON responses |
| MQTT | modules/mqtt.md | Publish/subscribe, QoS, connection management |
| WebSocket | modules/websock.md | Real-time communication, event handling |
| OpenAI | modules/openai.md | Chat Completions, Responses API, streaming, agentic workflows |
| Cryptography | modules/crypt.md | TLS, certificates, hashing, encryption |
| OS Abstraction | modules/osdep.md | Portable types, platform detection |
Each guide covers the module's API functions, data structures, usage patterns, and code examples. AI agents read these guides to understand how to correctly use each module.
How Context is Used
When you invoke a skill or ask Claude Code to build something, the AI agent:
- Reads
CLAUDE.mdfor project conventions and build instructions - Consults the architecture documentation for design context
- References the relevant module guides for API details
- Uses the skill's guided workflow for step-by-step implementation
This layered approach means the AI agent has the same level of understanding as a developer who has read the full documentation — enabling it to write production-quality code on the first attempt.
Keeping Context Updated
The context files are included in each Ioto agent distribution and are updated with each release. If you extend the Ioto platform or add custom modules, you can add your own context files to the AI/context/ directory to help AI agents understand your extensions.
