Skip to content

YuhangTsim/public_note

Repository files navigation

AI Coding Agent Learning Repository

Personal learning notes and research on AI coding agents, focusing on architecture, implementation patterns, and context management strategies.

πŸ“‚ Repository Structure

Comprehensive documentation on OpenCode and Oh-My-OpenCode architecture and design.

Topics covered:

  • Agent system architecture (build, plan, explore, oracle, librarian)
  • Session lifecycle and state management
  • Tool registry and execution
  • Model Context Protocol (MCP) integration
  • Prompt design and optimization
  • OpenCode vs Oh-My-OpenCode comparison
  • Task completion detection and TODO system
  • LSP integration and refactoring tools

Key documents:

See opencode_learning/README.md for complete documentation index.

In-depth analysis of Roo Code (VS Code extension) architecture, with focus on the XML β†’ Native protocol transition.

Topics covered:

  • System prompt structure (Architect vs Code modes)
  • Native Protocol vs XML Protocol
  • Tool definitions and API integration
  • Skills system (Agent Skills specification)
  • Conversation flow and task completion
  • Error handling and malformed JSON resilience
  • Incremental JSON parsing

Key documents:

See roocode_learning/README.md for detailed documentation map.

Comprehensive documentation for OpenClaw - a personal AI assistant platform with multi-channel support, gateway-based architecture, and extensive security controls.

Topics covered:

  • Gateway architecture and WebSocket control plane
  • Multi-channel support (WhatsApp, Telegram, Discord, Slack, iMessage, Signal)
  • Workspace files (SOUL.md, AGENTS.md, WORKSPACE.md)
  • Tool system with approval and sandbox isolation
  • Skills discovery, installation, and eligibility
  • DM pairing and access control systems
  • Security audit and compliance tools
  • Agent run lifecycle and task completion detection

Key documents:

See openclaw_learning/README.md for complete documentation index.

Deep dive into Oh My OpenCode (OMO), a "battery-included" orchestration suite for OpenCode that introduces the Sisyphus agent.

Topics covered:

  • Sisyphus Orchestrator & "Ultrawork" workflow
  • Specialized sub-agents (Oracle, Librarian, Explore)
  • Mandatory Category/Skill delegation protocols
  • Prompt engineering analysis of sisyphus-prompt.md
  • "Todo Continuation Enforcer" for persistence
  • Boulder pattern for persistent multi-step plans
  • 160+ lifecycle hook architecture

Key documents:

See oh_my_opencode_learning/README.md for detailed index.

Research on context selection and management methodologies in open-source coding agents.

Focus areas:

  • Context selection strategies given a prompt
  • Context management during execution
  • Comparative analysis across different agents
  • Limitations and trade-offs

Analyzed agents:

  • Cursor
  • Augment
  • Aider
  • Continue
  • Cline
  • OpenHands
  • Roo-Code
  • Pi-Agent
  • And more...

See coding_agent_research/readme.md for research objectives.

🎯 Key Concepts Explored

Agent Architectures

  • Primary agents (user-facing): build, plan
  • Specialized subagents: explore (contextual grep), oracle (expert advisor), librarian (reference search)
  • Agent orchestration: Parallel execution, delegation patterns, background tasks
  • Gateway-based architecture (OpenClaw): WebSocket control plane, multi-channel routing

Protocol Evolution

  • XML Protocol: Tools embedded in system prompt (deprecated)
  • Native Protocol: Tools passed as separate API parameter (current standard)
  • Benefits: Token savings, type safety, cleaner parsing

Context Management

  • Session-based conversation history
  • Snapshot and diff systems
  • Message compaction strategies
  • Tool permission systems
  • Workspace files (SOUL.md, AGENTS.md, WORKSPACE.md)

Prompt Engineering

  • Multi-layer prompt assembly
  • Provider-specific optimizations
  • Dynamic context injection
  • Mode-specific behaviors (Architect vs Code)
  • Personality configuration via workspace files

Security & Access Control

  • DM Pairing: Ephemeral codes for user authentication
  • Allowlist Matching: Platform-specific identifier matching
  • Exec Approvals: Bash command approval system (~/.openclaw/exec-approvals.json)
  • Sandbox Policies: Tool allow/deny lists for isolated execution
  • Security Audit: Automated vulnerability scanning

Task Completion

  • LLM finish reason detection (stop, tool-calls, length, error)
  • Streaming architecture and event processing
  • TODO continuation enforcement
  • Decision logic (continue vs stop vs compact)
  • Agent run lifecycle management

πŸš€ Getting Started

For Understanding OpenCode/Oh-My-OpenCode:

  1. Read opencode_learning/01_overview.md for big picture
  2. Explore opencode_learning/02_agent_system.md for agent orchestration
  3. Review opencode_learning/07_opencode_vs_oh_my_opencode.md for architecture comparison

For Understanding Roo Code:

  1. Start with roocode_learning/conv_example.md to see complete conversation flow
  2. Read roocode_learning/native_protocol_and_completion.md for protocol details
  3. Explore mode prompts: architect_mode_prompt.md and code_mode_prompt.md

For Understanding OpenClaw:

  1. Read openclaw_learning/01_overview.md for architecture overview
  2. Explore openclaw_learning/02_prompt_system.md for workspace file configuration
  3. Review openclaw_learning/05_access_control.md for security setup

For Comparative Research:

  1. Review coding_agent_research/ for context management strategies
  2. Compare different approaches across agents

πŸ“š Documentation Statistics

  • OpenCode Learning: 13+ comprehensive documents covering architecture, agents, tools, and prompts
  • Roo Code Learning: 7 documents totaling ~4,375 lines of in-depth analysis
  • OpenClaw Learning: 6+ documents covering gateway architecture, security, skills, and agent lifecycle
  • Oh My OpenCode Learning: 4 documents detailing the Sisyphus orchestrator and delegation system
  • Coding Agent Research: Analysis of 10+ open-source coding agents

πŸ”— External Resources

OpenCode

Roo Code

OpenClaw

Oh My OpenCode

Pi-Agent

Research References

  • Various open-source coding agent repositories (see coding_agent_research/)

πŸ“ Notes

This is a personal learning repository documenting my exploration of AI coding agent architectures. The materials are organized for:

  • Understanding: Deep dives into how these systems work
  • Comparison: Side-by-side analysis of different approaches
  • Implementation: Practical insights for building similar systems
  • Research: Context management and selection strategies

🀝 Contributing

This is a personal learning repository. However, if you find errors or have suggestions:

  1. Open an issue to discuss
  2. Submit a pull request with corrections

Keep documentation accurate, clear, and well-referenced.


Created: January 2026
Last Updated: March 4, 2026
Focus: AI coding agent architecture, protocols, context management, and multi-channel platforms


πŸ“… Recent Updates

March 2026

February 2026

  • New: OMOS Boulder Pattern - Persistent task state and Ralph Loop enforcement
  • New: OMOS Hook Architecture - Deep dive into 160+ lifecycle hooks
  • Enhanced: OMOS Skills System - 5-tier discovery, auto-permissions, intent-based loading
  • Fixed: Path corrections in main README for oh_my_opencode_learning
  • Removed: Empty latte_learning directory

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages