smithery.ai

new-collector

新しいベンダーのファームウェアコレクターを追加します。雛形生成からテスト作成まで自動化。

First seen Mar 21, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsRead, Edit, Write, Bash, Grep, Glob

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,025 B
  • docs SUMMARY.md 153 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

新規コレクター追加スキル

新しいベンダー(Linksys、Xiaomi等)のファームウェアコレクターを追加する際に使用します。

実行手順

1. ベンダー情報を確認

ユーザーに以下を確認:

  • ベンダー名(例: Linksys)
  • ファームウェアダウンロードページのURL
  • 対象製品の種類(ルーター、メッシュWiFi等)

2. コレクターファイルを作成

src/ta_inspector/collector/<vendor>.py を作成:

"""<Vendor> router firmware collector."""

import asyncio
import logging
from typing import List, Optional

import aiohttp
from bs4 import BeautifulSoup

from .base import BaseCollector, FirmwareInfo

logger = logging.getLogger(__name__)


class <Vendor>Collector(BaseCollector):
    """Collector for <Vendor> router firmware."""

    vendor_name: str = "<Vendor>"
    base_url: str = "<base_url>"

    def __init__(
        self,
        timeout: int = 30,
        max_retries: int = 3,
        user_agent: Optional[str] = None,
    ):
        self.timeout = timeout
        self.max_retries = max_retries
        self.user_agent = user_agent or (
            "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
            "AppleWebKit/537.36 Chrome/120.0.0.0"
        )
        self._session: Optional[aiohttp.ClientSession] = None

    async def _get_session(self) -> aiohttp.ClientSession:
        if self._session is None or self._session.closed:
            timeout = aiohttp.ClientTimeout(total=self.timeout)
            self._session = aiohttp.ClientSession(
                timeout=timeout,
                headers={"User-Agent": self.user_agent}
            )
        return self._session

    async def close(self) -> None:
        if self._session and not self._session.closed:
            await self._session.close()

    async def list_products(self) -> List[str]:
        """List available products."""
        # TODO: ベンダーサイトから製品一覧を取得
        return []

    async def get_firmware_list(self, product: str) -> List[FirmwareInfo]:
        """Get firmware versions for a product."""
        # TODO: 製品のファームウェア一覧を取得
        return []

3. cli.pyに登録

src/tainspector/cli.py の registeravailablecollectors 関数に追加:

from .collector.<vendor> import <Vendor>Collector
auto_collector.register_collector(<Vendor>Collector())

4. テストを作成

tests/testcollector/test<vendor>.py を作成:

import pytest
from ta_inspector.collector.<vendor> import <Vendor>Collector


class Test<Vendor>Collector:
    @pytest.fixture
    def collector(self):
        return <Vendor>Collector()

    @pytest.mark.asyncio
    async def test_list_products(self, collector):
        products = await collector.list_products()
        assert isinstance(products, list)

    @pytest.mark.asyncio
    async def test_get_firmware_list(self, collector):
        # モック対象製品でテスト
        firmware_list = await collector.get_firmware_list("TestModel")
        assert isinstance(firmware_list, list)

5. 確認

# テスト実行
pytest tests/test_collector/test_<vendor>.py -v

# リント・型チェック
ruff check src/ta_inspector/collector/<vendor>.py
mypy src/ta_inspector/collector/<vendor>.py

参考実装

  • [asus.py](src/ta_inspector/collector/asus.py) - ASUS実装(API利用)
  • [tplink.py](src/ta_inspector/collector/tplink.py) - TP-Link実装
  • [base.py](src/ta_inspector/collector/base.py) - BaseCollector定義

チェックリスト

  • コレクタークラスを作成
  • list_products() を実装
  • getfirmwarelist() を実装
  • cli.pyに登録
  • テストを作成
  • ruff/mypyでチェック