{"skill":{"slug":"kiro-realtime","displayName":"Kiro Realtime Chat","summary":"Enables near real-time chat between multiple Kiro instances via a shared JSON file with polling for quick message exchange and task coordination.","description":"---\nname: kiro-realtime\ndescription: Real-time chat between Kiro instances via shared JSON file with polling. Use when: (1) Two or more Kiros need to chat in real-time, (2) One Kiro sends a message and expects quick response, (3) Coordinating tasks between instances.\n---\n\n# Kiro Realtime Chat\n\n## Overview\n\nThis skill enables near real-time communication between multiple Kiro instances using a shared JSON file with polling. Each message includes timestamp, sender, and content.\n\n## File Location\n\n```\nmemory/kiro-realtime.json\n```\n\n## JSON Structure\n\n```json\n{\n  \"messages\": [\n    {\n      \"id\": 1,\n      \"from\": \"VPS Kiro\",\n      \"to\": \"Laptop Kiro\",\n      \"message\": \"Selam!\",\n      \"timestamp\": \"2026-03-05T22:58:00Z\",\n      \"read\": false\n    }\n  ],\n  \"lastCheck\": \"2026-03-05T22:58:00Z\"\n}\n```\n\n## Usage\n\n### Sending a Message\n\n```python\nimport json\nimport os\nfrom datetime import datetime\n\nCHAT_FILE = \"memory/kiro-realtime.json\"\n\ndef send_message(from_name, to_name, message):\n    # Load or create chat file\n    if os.path.exists(CHAT_FILE):\n        with open(CHAT_FILE, \"r\") as f:\n            chat = json.load(f)\n    else:\n        chat = {\"messages\": [], \"lastCheck\": datetime.now().isoformat()}\n    \n    # Add new message\n    msg_id = len(chat[\"messages\"]) + 1\n    chat[\"messages\"].append({\n        \"id\": msg_id,\n        \"from\": from_name,\n        \"to\": to_name,\n        \"message\": message,\n        \"timestamp\": datetime.now().isoformat(),\n        \"read\": False\n    })\n    \n    # Save\n    with open(CHAT_FILE, \"w\") as f:\n        json.dump(chat, f, indent=2)\n    \n    return msg_id\n```\n\n### Checking for New Messages\n\n```python\ndef check_messages(my_name, since_timestamp=None):\n    if not os.path.exists(CHAT_FILE):\n        return []\n    \n    with open(CHAT_FILE, \"r\") as f:\n        chat = json.load(f)\n    \n    # Update last check time\n    chat[\"lastCheck\"] = datetime.now().isoformat()\n    with open(CHAT_FILE, \"w\") as f:\n        json.dump(chat, f, indent=2)\n    \n    # Filter messages my_messages = []\n for me\n       for msg in chat[\"messages\"]:\n        if msg[\"to\"] == my_name and not msg[\"read\"]:\n            my_messages.append(msg)\n            msg[\"read\"] = True\n    \n    # Save read status\n    with open(CHAT_FILE, \"w\") as f:\n        json.dump(chat, f, indent=2)\n    \n    return my_messages\n```\n\n### Polling Loop (for near real-time)\n\n```python\nimport time\n\ndef poll_messages(my_name, interval=5):\n    \"\"\"Poll for new messages every N seconds\"\"\"\n    while True:\n        msgs = check_messages(my_name)\n        for msg in msgs:\n            print(f\"{msg['from']}: {msg['message']}\")\n            # Process and respond here\n        time.sleep(interval)\n```\n\n## Recommended Polling Interval\n\n- **Fast response needed:** 2-3 seconds\n- **Normal:** 5-10 seconds\n- **Low bandwidth:** 30-60 seconds\n\n## Tips\n\n- Mark messages as \"read\" after processing\n- Use timestamps to avoid duplicate processing\n- For better real-time, consider MCP server or WebSocket\n- Keep messages under 1000 characters\n","topics":["Json","Message"],"tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":537,"installsAllTime":20,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1772751540039,"updatedAt":1778491742347},"latestVersion":{"version":"1.0.0","createdAt":1772751540039,"changelog":"Real-time chat between Kiro instances via JSON polling","license":null},"metadata":null,"owner":{"handle":"sonerbo","userId":"s17ak6egwy66gcm77c1hdkhnwn885jnq","displayName":"sonerbo","image":"https://avatars.githubusercontent.com/u/71600332?v=4"},"moderation":null}