|
| 1 | +# AI-Optimized Resource Documentation |
| 2 | + |
| 3 | +This directory contains simplified, AI-friendly documentation for the IoT Cloud MCP Bridge. |
| 4 | + |
| 5 | +## Purpose |
| 6 | + |
| 7 | +These documents are designed specifically for **AI agents** (LLMs) to: |
| 8 | + |
| 9 | +- ✅ Understand device control concepts quickly |
| 10 | +- ✅ Find exact command formats easily |
| 11 | +- ✅ Follow clear step-by-step workflows |
| 12 | +- ✅ Avoid common mistakes |
| 13 | + |
| 14 | +## Files |
| 15 | + |
| 16 | +### 1. `overview.md` (433 lines) |
| 17 | + |
| 18 | +**Introduction to the IoT Cloud MCP Bridge** |
| 19 | + |
| 20 | +**Contains:** |
| 21 | + |
| 22 | +- System architecture overview |
| 23 | +- Core concepts (device, element, attribute, state) |
| 24 | +- Field definitions (uuid, elementIds, command) |
| 25 | +- Available MCP tools |
| 26 | +- Common patterns and workflows |
| 27 | +- Glossary of terms |
| 28 | +- Quick reference card |
| 29 | + |
| 30 | +**Use when:** First time using the system, need to understand fundamental concepts |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +### 2. `device-attributes.md` (253 lines) |
| 35 | + |
| 36 | +**Complete reference of device attributes and commands** |
| 37 | + |
| 38 | +**Contains:** |
| 39 | + |
| 40 | +- Quick reference table of common attributes |
| 41 | +- Device-type-specific sections (lights, switches, AC, etc.) |
| 42 | +- Command format examples with explanations |
| 43 | +- Value ranges and meanings |
| 44 | +- IR remote button codes |
| 45 | +- Do's and Don'ts for AI agents |
| 46 | + |
| 47 | +**Use when:** You need to know WHAT commands are available and their formats |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +### 3. `control-guide.md` (382 lines) |
| 52 | + |
| 53 | +**Step-by-step guide for controlling devices** |
| 54 | + |
| 55 | +**Contains:** |
| 56 | + |
| 57 | +- 2 control options (simple actions vs direct commands) |
| 58 | +- Step-by-step workflow |
| 59 | +- Multi-element device control |
| 60 | +- Common patterns and examples |
| 61 | +- Timing considerations |
| 62 | +- Troubleshooting guide |
| 63 | + |
| 64 | +**Use when:** You need to know HOW to control a device (workflow) |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +### 4. `state-guide.md` (435 lines) |
| 69 | + |
| 70 | +**Complete guide to reading and interpreting device state** |
| 71 | + |
| 72 | +**Contains:** |
| 73 | + |
| 74 | +- State structure explanation with visual examples |
| 75 | +- 5+ real device examples (lights, switches, multi-element, AC) |
| 76 | +- How to use state in code (verification, capability discovery) |
| 77 | +- State array format details |
| 78 | +- Common attribute ID reference table |
| 79 | +- Full annotated examples |
| 80 | + |
| 81 | +**Use when:** You need to READ device state or verify control commands worked |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## Key Improvements Over Original Docs |
| 86 | + |
| 87 | +### Before (Original Docs) |
| 88 | + |
| 89 | +- ❌ Mixed Vietnamese and English |
| 90 | +- ❌ CSV format hard to parse |
| 91 | +- ❌ Technical API documentation style |
| 92 | +- ❌ Scattered information |
| 93 | +- ❌ No AI-specific guidance |
| 94 | + |
| 95 | +### After (AI-Optimized Docs) |
| 96 | + |
| 97 | +- ✅ 100% English, clear language |
| 98 | +- ✅ Structured markdown with examples |
| 99 | +- ✅ Tutorial/guide style with clear explanations |
| 100 | +- ✅ Organized by use case |
| 101 | +- ✅ Explicit AI agent guidance (Do's/Don'ts, decision trees) |
| 102 | +- ✅ Real-world examples with annotations |
| 103 | +- ✅ Quick reference sections for fast lookup |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## How AI Agents Should Use These Resources |
| 108 | + |
| 109 | +### Recommended Reading Order |
| 110 | + |
| 111 | +**1. First Time Using the MCP:** |
| 112 | +Read in this order: |
| 113 | + |
| 114 | +1. `overview.md` - Core concepts and what you can do |
| 115 | +2. `device-attributes.md` - Available commands and device types |
| 116 | +3. `control-guide.md` - Control workflows |
| 117 | +4. `state-guide.md` - Read and verify state |
| 118 | + |
| 119 | +**2. When Controlling a Device:** |
| 120 | + |
| 121 | +1. Read `control-guide.md` → Choose simple or advanced control |
| 122 | +2. Reference `device-attributes.md` → Find command format |
| 123 | +3. Reference `state-guide.md` → Verify command worked |
| 124 | + |
| 125 | +**3. Quick Reference:** |
| 126 | + |
| 127 | +- Need a command format? → `device-attributes.md` Quick Reference table |
| 128 | +- Forgot the workflow? → `control-guide.md` Summary Checklist |
| 129 | +- How to read state? → `state-guide.md` Quick Reference section |
| 130 | + |
| 131 | +--- |
| 132 | + |
| 133 | +## Integration with MCP |
| 134 | + |
| 135 | +These files are exposed as MCP resources: |
| 136 | + |
| 137 | +```typescript |
| 138 | +// List all resources |
| 139 | +resources/list |
| 140 | + |
| 141 | +// Read specific resource |
| 142 | +resources/read { uri: "rogo://docs/overview" } |
| 143 | +resources/read { uri: "rogo://docs/device-attributes" } |
| 144 | +resources/read { uri: "rogo://docs/control-guide" } |
| 145 | +resources/read { uri: "rogo://docs/state-guide" } |
| 146 | +``` |
| 147 | + |
| 148 | +**Resource URIs:** |
| 149 | + |
| 150 | +- `rogo://docs/overview` → `overview.md` |
| 151 | +- `rogo://docs/device-attributes` → `device-attributes.md` |
| 152 | +- `rogo://docs/control-guide` → `control-guide.md` |
| 153 | +- `rogo://docs/state-guide` → `state-guide.md` |
| 154 | + |
| 155 | +--- |
| 156 | + |
| 157 | +## Content Principles |
| 158 | + |
| 159 | +All documentation follows these principles: |
| 160 | + |
| 161 | +### ✅ AI-Friendly Writing |
| 162 | + |
| 163 | +- Clear, direct language |
| 164 | +- Active voice |
| 165 | +- Short sentences and paragraphs |
| 166 | +- Concrete examples over abstract concepts |
| 167 | + |
| 168 | +### ✅ Actionable Content |
| 169 | + |
| 170 | +- Every section answers "what do I do?" |
| 171 | +- Step-by-step instructions |
| 172 | +- Copy-paste-ready code examples |
| 173 | +- Decision trees and checklists |
| 174 | + |
| 175 | +### ✅ Complete Coverage |
| 176 | + |
| 177 | +- No assumed knowledge |
| 178 | +- All edge cases explained |
| 179 | +- Error scenarios included |
| 180 | +- Verification steps mandatory |
| 181 | + |
| 182 | +### ✅ Structured Format |
| 183 | + |
| 184 | +- Consistent heading hierarchy |
| 185 | +- Visual separators (---) between major sections |
| 186 | +- Code blocks with syntax highlighting |
| 187 | +- Tables for quick reference |
| 188 | + |
| 189 | +--- |
| 190 | + |
| 191 | +## Maintenance |
| 192 | + |
| 193 | +When updating these docs: |
| 194 | + |
| 195 | +1. **Keep it simple** - AI agents prefer clear over clever |
| 196 | +2. **Add examples** - Every new concept needs a working example |
| 197 | +3. **Update all three** - If you change device behavior, update relevant sections in all files |
| 198 | +4. **Test with real AI** - Have an LLM read it and try to follow the instructions |
| 199 | + |
| 200 | +**Files to update:** |
| 201 | + |
| 202 | +- Source: `docs/ai-resources/*.md` |
| 203 | +- Resource definitions: `src/resources/definitions/*.resource.ts` (already point to these files) |
| 204 | + |
| 205 | +--- |
| 206 | + |
| 207 | +## Statistics |
| 208 | + |
| 209 | +- **Total Lines**: 1,502 lines of AI-optimized documentation |
| 210 | +- **overview.md**: 433 lines (29%) |
| 211 | +- **device-attributes.md**: 252 lines (17%) |
| 212 | +- **control-guide.md**: 382 lines (25%) |
| 213 | +- **state-guide.md**: 435 lines (29%) |
| 214 | + |
| 215 | +**Coverage:** |
| 216 | + |
| 217 | +- 4 comprehensive guides (overview + 3 specialized guides) |
| 218 | +- 8 device types documented |
| 219 | +- 30+ attribute IDs explained |
| 220 | +- 20+ workflow examples |
| 221 | +- 100% MCP tool coverage |
0 commit comments