Agent Skills by ALSEL
Anthropic Claudeその他⭐ リポ 0品質スコア 50/100

iot-developer

IoT開発、マイクロコントローラー、センサー、MQTTプロトコルに精通したエキスパートスキルです。組み込みシステムの設計からデバイス間通信の実装まで、IoTプロジェクト全般をサポートします。

description の原文を見る

Expert in IoT development, microcontrollers, sensors, and MQTT protocols

SKILL.md 本文

IoT Developer Skill

IoT アプリケーションの構築、センサーとデバイスの接続、スマートホーム/産業用 IoT ソリューションの作成をサポートします。

機能

デバイス統合:

  • マイコンプログラミング (Arduino、ESP32)
  • センサーデータの読み込みと収集
  • アクチュエータ制御 (モータ、LED、リレー)
  • ハードウェアインターフェース

通信:

  • MQTT メッセージング
  • WebSocket 接続
  • REST API 統合
  • Bluetooth/WiFi 接続

IoT プラットフォーム:

  • リアルタイムダッシュボード
  • デバイス管理
  • データログ
  • アラートと自動化

MQTT の基本 (Web クライアント)

npm install mqtt
// lib/mqtt-client.ts
import mqtt from 'mqtt'

export class MQTTClient {
  private client: mqtt.MqttClient

  constructor(brokerUrl: string) {
    this.client = mqtt.connect(brokerUrl, {
      clientId: `web_${Math.random().toString(16).slice(3)}`,
      clean: true,
      connectTimeout: 4000
    })

    this.client.on('connect', () => {
      console.log('MQTT connected')
    })

    this.client.on('error', error => {
      console.error('MQTT error:', error)
    })
  }

  subscribe(topic: string, callback: (message: string) => void) {
    this.client.subscribe(topic, err => {
      if (err) console.error('Subscribe error:', err)
    })

    this.client.on('message', (receivedTopic, message) => {
      if (receivedTopic === topic) {
        callback(message.toString())
      }
    })
  }

  publish(topic: string, message: string) {
    this.client.publish(topic, message)
  }

  disconnect() {
    this.client.end()
  }
}

使用方法:

'use client'
import { useEffect, useState } from 'react'
import { MQTTClient } from '@/lib/mqtt-client'

export function TemperatureDashboard() {
  const [temperature, setTemperature] = useState(0)
  const [humidity, setHumidity] = useState(0)

  useEffect(() => {
    const mqtt = new MQTTClient('ws://broker.hivemq.com:8000/mqtt')

    mqtt.subscribe('home/temperature', (msg) => {
      setTemperature(parseFloat(msg))
    })

    mqtt.subscribe('home/humidity', (msg) => {
      setHumidity(parseFloat(msg))
    })

    return () => mqtt.disconnect()
  }, [])

  return (
    <div className="grid grid-cols-2 gap-4">
      <div className="p-6 bg-white rounded-lg shadow">
        <h3 className="text-gray-600">Temperature</h3>
        <p className="text-4xl font-bold">{temperature}°C</p>
      </div>

      <div className="p-6 bg-white rounded-lg shadow">
        <h3 className="text-gray-600">Humidity</h3>
        <p className="text-4xl font-bold">{humidity}%</p>
      </div>
    </div>
  )
}

Arduino/ESP32 コード

温度センサー (DHT22)

// ESP32 + DHT22 温度/湿度センサー
#include <WiFi.h>
#include <PubSubClient.h>
#include <DHT.h>

#define DHTPIN 4
#define DHTTYPE DHT22

const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";
const char* mqtt_server = "broker.hivemq.com";

WiFiClient espClient;
PubSubClient client(espClient);
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(115200);
  dht.begin();

  // WiFi に接続
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("WiFi connected");

  // MQTT に接続
  client.setServer(mqtt_server, 1883);
}

void loop() {
  if (!client.connected()) {
    reconnect();
  }
  client.loop();

  // センサーを読み込む
  float temperature = dht.readTemperature();
  float humidity = dht.readHumidity();

  // MQTT に発行
  if (!isnan(temperature)) {
    client.publish("home/temperature", String(temperature).c_str());
  }

  if (!isnan(humidity)) {
    client.publish("home/humidity", String(humidity).c_str());
  }

  delay(5000); // 5秒ごとに発行
}

void reconnect() {
  while (!client.connected()) {
    if (client.connect("ESP32Client")) {
      Serial.println("MQTT connected");
    } else {
      delay(5000);
    }
  }
}

スマートホームダッシュボード

'use client'
import { useEffect, useState } from 'react'
import { MQTTClient } from '@/lib/mqtt-client'

interface Device {
  id: string
  name: string
  type: 'light' | 'sensor' | 'thermostat'
  status: string | number
}

export function SmartHomeDashboard() {
  const [devices, setDevices] = useState<Device[]>([
    { id: '1', name: 'Living Room Light', type: 'light', status: 'off' },
    { id: '2', name: 'Temperature', type: 'sensor', status: 22 },
    { id: '3', name: 'Thermostat', type: 'thermostat', status: 20 }
  ])

  const [mqtt, setMqtt] = useState<MQTTClient | null>(null)

  useEffect(() => {
    const client = new MQTTClient('ws://broker.hivemq.com:8000/mqtt')

    // デバイストピックをサブスクライブ
    client.subscribe('home/light/1', (msg) => {
      updateDevice('1', msg)
    })

    client.subscribe('home/temperature', (msg) => {
      updateDevice('2', parseFloat(msg))
    })

    setMqtt(client)

    return () => client.disconnect()
  }, [])

  const updateDevice = (id: string, status: string | number) => {
    setDevices(prev => prev.map(device =>
      device.id === id ? { ...device, status } : device
    ))
  }

  const toggleLight = (id: string) => {
    const device = devices.find(d => d.id === id)
    if (device && mqtt) {
      const newStatus = device.status === 'on' ? 'off' : 'on'
      mqtt.publish(`home/light/${id}`, newStatus)
      updateDevice(id, newStatus)
    }
  }

  return (
    <div className="max-w-4xl mx-auto p-6">
      <h1 className="text-3xl font-bold mb-6">Smart Home</h1>

      <div className="grid md:grid-cols-2 lg:grid-cols-3 gap-4">
        {devices.map((device) => (
          <div key={device.id} className="p-6 bg-white rounded-lg shadow">
            <h3 className="font-semibold mb-2">{device.name}</h3>

            {device.type === 'light' && (
              <button
                onClick={() => toggleLight(device.id)}
                className={`px-4 py-2 rounded ${
                  device.status === 'on'
                    ? 'bg-yellow-400 text-black'
                    : 'bg-gray-300'
                }`}
              >
                {device.status === 'on' ? '💡 ON' : '🌑 OFF'}
              </button>
            )}

            {device.type === 'sensor' && (
              <p className="text-2xl font-bold">{device.status}°C</p>
            )}

            {device.type === 'thermostat' && (
              <div>
                <p className="text-xl">Target: {device.status}°C</p>
                <div className="flex gap-2 mt-2">
                  <button className="px-3 py-1 bg-blue-600 text-white rounded">
                    -
                  </button>
                  <button className="px-3 py-1 bg-blue-600 text-white rounded">
                    +
                  </button>
                </div>
              </div>
            )}
          </div>
        ))}
      </div>
    </div>
  )
}

WebSocket リアルタイムセンサーデータ

// app/api/sensor-stream/route.ts
export async function GET(req: Request) {
  const encoder = new TextEncoder()

  const stream = new ReadableStream({
    start(controller) {
      const interval = setInterval(async () => {
        // センサーデータをシミュレート (または実際の IoT デバイスから読み込む)
        const temperature = 20 + Math.random() * 10
        const humidity = 40 + Math.random() * 20

        const data = `data: ${JSON.stringify({
          temperature,
          humidity,
          timestamp: new Date().toISOString()
        })}\n\n`

        controller.enqueue(encoder.encode(data))
      }, 1000)

      req.signal.addEventListener('abort', () => {
        clearInterval(interval)
        controller.close()
      })
    }
  })

  return new Response(stream, {
    headers: {
      'Content-Type': 'text/event-stream',
      'Cache-Control': 'no-cache',
      Connection: 'keep-alive'
    }
  })
}

使用する場面

最適な用途:

  • スマートホームシステムの構築
  • 産業用 IoT ソリューションの作成
  • センサーネットワークの実装
  • デバイスダッシュボードの開発
  • 物理的なプロセスの自動化

サポート内容:

  • IoT デバイスの接続
  • MQTT プロトコルの実装
  • センサーデータの読み込み
  • リアルタイムダッシュボードの構築
  • アクチュエータの制御

作成内容

🌡️ センサー統合
💡 スマートデバイス制御
📊 IoT ダッシュボード
📡 MQTT 通信
🏠 スマートホームシステム
🏭 産業用 IoT

物理的な世界とデジタル世界をつなぎましょう!

ライセンス: MIT(寛容ライセンスのため全文を引用しています) · 原本リポジトリ

詳細情報

作者
daffy0208
リポジトリ
daffy0208/ai-dev-standards
ライセンス
MIT
最終更新
不明

Source: https://github.com/daffy0208/ai-dev-standards / ライセンス: MIT

関連スキル

汎用その他⭐ リポ 1,982

superfluid

Superfluidプロトコルおよびそのエコシステムに関するナレッジベースです。Superfluidについて情報を検索する際は、ウェブ検索の前にこちらを参照してください。対応キーワード:Superfluid、CFA、GDA、Super App、Super Token、stream、flow rate、real-time balance、pool(member/distributor)、IDA、sentinels、liquidation、TOGA、@sfpro/sdk、semantic money、yellowpaper、whitepaper

by LeoYeAI
汎用その他⭐ リポ 100

civ-finish-quotes

実質的なタスクが真に完了した際に、文明風の儀式的な引用句を追加します。ユーザーやエージェントが機能追加、リファクタリング、分析、設計ドキュメント、プロセス改善、レポート、執筆タスクといった実際の成果物を完成させるときに、明示的な依頼がなくても使用します。短い返信や小さな修正、未完成の作業には適用しません。

by huxiuhan
汎用その他⭐ リポ 1,110

nookplot

Base(Ethereum L2)上のAIエージェント向け分散型調整ネットワークです。エージェントがオンチェーンアイデンティティを登録する、コンテンツを公開する、他のエージェントにメッセージを送る、マーケットプレイスで専門家を雇う、バウンティを投稿・請求する、レピュテーションを構築する、共有プロジェクトで協業する、リサーチチャレンジを解くことでNOOKをマイニングする、キュレーションされたナレッジを備えたスタンドアロンオンチェーンエージェントをデプロイする、またはアグリーメントとリワードで収益を得る場合に利用できます。エージェントネットワーク、エージェント調整、分散型エージェント、NOOKトークン、マイニングチャレンジ、ナレッジバンドル、エージェントレピュテーション、エージェントマーケットプレイス、ERC-2771メタトランザクション、Prepare-Sign-Relay、AgentFactory、またはNookplotが言及された場合にトリガーされます。

by BankrBot
汎用その他⭐ リポ 59

web3-polymarket

Polygon上でのPolymarket予測市場取引統合です。認証機能(L1 EIP-712、L2 HMAC-SHA256、ビルダーヘッダー)、注文発注(GTC/GTD/FOK/FAK、バッチ、ポストオンリー、ハートビート)、市場データ(Gamma API、Data API、オーダーブック、サブグラフ)、WebSocketストリーミング(市場・ユーザー・スポーツチャネル)、CTF操作(分割、統合、償却、ネガティブリスク)、ブリッジ機能(入金、出金、マルチチェーン)、およびガスレスリレイトランザクションに対応しています。AIエージェント、自動マーケットメーカー、予測市場UI、またはPolygraph上のPolymarketと統合するアプリケーション構築時に活用できます。

by elophanto
汎用その他⭐ リポ 52

ethskills

Ethereum、EVM、またはブロックチェーン関連のリクエストに対応します。スマートコントラクト、dApps、ウォレット、DeFiプロトコルの構築、監査、デプロイ、インタラクションに適用されます。Solidityの開発、コントラクトアドレス、トークン規格(ERC-20、ERC-721、ERC-4626など)、Layer 2ネットワーク(Base、Arbitrum、Optimism、zkSync、Polygon)、Uniswap、Aave、Curveなどのプロトコルとの統合をカバーします。ガスコスト、コントラクトのデシマル設定、オラクルセキュリティ、リエントランシー、MEV、ブリッジング、ウォレット管理、オンチェーンデータの取得、本番環境へのデプロイ、プロトコル進化(EIPライフサイクル、フォーク追跡、今後の変更予定)といったトピックを含みます。

by jiayaoqijia
汎用その他⭐ リポ 44

xxyy-trade

このスキルは、ユーザーが「トークン購入」「トークン売却」「トークンスワップ」「暗号資産取引」「取引ステータス確認」「トランザクション照会」「トークンスキャン」「フィード」「チェーン監視」「トークン照会」「トークン詳細」「トークン安全性確認」「ウォレット一覧表示」「マイウォレット」「AIスキャン」「自動スキャン」「ツイートスキャン」「オンボーディング」「IP確認」「IPホワイトリスト」「トークン発行」「自動売却」「損切り」「利益確定」「トレーリングストップ」「保有者」「トップホルダー」「KOLホルダー」などをリクエストした場合、またはSolana/ETH/BSC/BaseチェーンでXXYYを経由した取引について言及した場合に使用します。XXYY Open APIを通じてオンチェーン取引とデータ照会を実現します。

by Jimmy-Holiday
本サイトは GitHub 上で公開されているオープンソースの SKILL.md ファイルをクロール・インデックス化したものです。 各スキルの著作権は原作者に帰属します。掲載に問題がある場合は info@alsel.co.jp または /takedown フォームよりご連絡ください。
原作者: daffy0208 · daffy0208/ai-dev-standards · ライセンス: MIT