Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

puda-edge普达边缘

Agent Skill

puda-edge 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

541

周安装

23

GitHub Stars

1

下载量

190
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:puda-edge(普达边缘)
来源仓库:https://github.com/pudap/skills
仓库路径:skills/puda-edge
安装命令:
npx skills add https://github.com/pudap/skills --skill puda-edge
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pudap/skills --skill puda-edge

简介

用于基于关键词检索外部资源或文档片段。

  • 适合信息搜集、竞品分析等研究型任务。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 通过 GitHub 安装并传入查询参数执行搜索。
  • 结果仅供参考,需人工验证来源可靠性。
  • puda-edge 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Puda Edge

Goal

Scaffold and implement an edge service that integrates any machine (with a working SDK or API) into PUDA with NATS messaging.

Repository Structure

<machine-name>/
├── pyproject.toml          # workspace root — declares edge as a member
├── .gitignore
├── uv.lock
└── edge/
    ├── pyproject.toml      # edge package dependencies
    ├── main.py             # entry point: config, NATS client, EdgeRunner
    ├── <machine_name>.py   # machine driver: public command methods
    └── Dockerfile          # optional, for containerised deployment

Root pyproject.toml

Declares the uv workspace with edge as a member:

[tool.uv.workspace]
members = ["edge"]

Edge pyproject.toml

[project]
name = "<machine-name>-edge"
version = "0.1.0"
description = "Edge service for the '<machine-name>' machine"
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
    "puda-comms>=0.0.10",
    "pydantic>=2.12.5",
    "pydantic-settings>=2.12.0",
    "python-dotenv>=1.2.1",
    # add machine-specific SDK packages here
]

main.py — Entry Point

main.py handles configuration, driver initialisation, NATS connection, and the run loop. It follows this exact pattern:

1. Configuration via pydantic-settings

Define a Config(BaseSettings) class that reads from a .env file. Fields:

FieldTypePurpose
machine_idstrUnique machine identifier in PUDA
nats_serversstrComma-separated NATS server URLs
<machine>_ip (or similar)strMachine-specific connection address

Add a nats_server_list property that splits the comma-separated string:

@property
def nats_server_list(self) -> list[str]:
    return [s.strip() for s in self.nats_servers.split(",") if s.strip()]

Wrap construction in load_config() that exits the process on failure.

2. async def main()

  1. Load config
  2. Instantiate the machine driver and call driver.startup()
  3. Create EdgeNatsClient(servers=..., machine_id=...)
  4. Define a telemetry_handler coroutine that publishes heartbeat/health/position
  5. Create EdgeRunner(nats_client=..., machine_driver=..., telemetry_handler=..., state_handler=...)
  6. Call runner.connect() then runner.run()

3. Retry loop

Run asyncio.run(main()) in a while True loop. Catch KeyboardInterrupt (log and continue) and general Exception (log and sleep 5 s before retry).

Template

import asyncio
import logging
import sys
import time
from pydantic_settings import BaseSettings, SettingsConfigDict
from puda_comms import EdgeNatsClient, EdgeRunner
from <machine_module> import <MachineClass>

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    force=True,
)
logger = logging.getLogger(__name__)

class Config(BaseSettings):
    machine_id: str
    nats_servers: str
    # add machine-specific fields (IP, port, serial path, etc.)

    model_config = SettingsConfigDict(
        env_file=".env",
        env_file_encoding="utf-8",
        case_sensitive=False,
    )

    @property
    def nats_server_list(self) -> list[str]:
        return [s.strip() for s in self.nats_servers.split(",") if s.strip()]

def load_config() -> Config:
    try:
        return Config()
    except Exception as e:
        logger.error("Failed to load configuration: %s", e, exc_info=True)
        sys.exit(1)

async def main():
    config = load_config()
    logger.info("Config: machine_id=%s", config.machine_id)

    driver = <MachineClass>(...)
    driver.startup()

    edge_nats_client = EdgeNatsClient(
        servers=config.nats_server_list,
        machine_id=config.machine_id,
    )

    async def telemetry_handler():
        await edge_nats_client.publish_heartbeat()
        await edge_nats_client.publish_health({})

    runner = EdgeRunner(
        nats_client=edge_nats_client,
        machine_driver=driver,
        telemetry_handler=telemetry_handler,
        state_handler=lambda: {},
    )
    await runner.connect()
    logger.info("==================== %s Edge Service Ready ====================", config.machine_id)
    await runner.run()

if __name__ == "__main__":
    while True:
        try:
            asyncio.run(main())
        except KeyboardInterrupt:
            logger.warning("Received KeyboardInterrupt, but continuing to run...")
            time.sleep(1)
        except Exception as e:
            logger.error("Fatal error: %s", e, exc_info=True)
            time.sleep(5)

<machine_name>.py — Machine Driver

This file defines a single class whose public methods are the commands the machine can execute. EdgeRunner discovers them via getattr, so each public method name becomes a command name in PUDA.

Design Rules

  1. Only basic JSON-serializable parameter types. The communication layer serialises everything as JSON. Method parameters must be primitive types only: str, int, float, bool, list, dict. Never use enums, dataclasses, or custom objects as parameter types. If the underlying SDK uses enums, convert from strings inside the method body (see biologic's _convert_irange_string pattern).
  2. Required lifecycle methods:

- __init__(self,...) — accept connection info (IP, port, serial path, etc.) and store it. Do not connect yet. - startup(self) — establish the actual connection to the machine. Called once from main.py before the run loop.

  1. Optional lifecycle methods: connect(), disconnect(), shutdown() as needed.
  2. Command methods — each public method (not prefixed with _) is a command. Convention:

- Accept params: dict[str, Any] as the first argument for the command's parameters. - Accept **kwargs for additional options (e.g. channels, retrieve_data). - Return a dict[str, Any] with the result data. - Log the invocation at INFO level.

  1. Document parameters thoroughly in the docstring: name, type, valid range, units, required vs default. This documentation is the contract that protocol generators rely on.

Template

import logging
from typing import Any, Dict

logger = logging.getLogger(__name__)

class <MachineClass>:
    def __init__(self, <machine>_ip: str):
        self.<machine>_ip = <machine>_ip
        self._device = None

    def startup(self):
        if self._device is not None:
            return
        # initialise connection to the machine SDK/API
        self._device = ...
        logger.info("Machine started at %s", self.<machine>_ip)

    # --- Commands (public methods = PUDA commands) ---

    def <CommandName>(self, params: dict[str, Any], **kwargs) -> Dict[str, Any]:
        """
        <Short description of the command.>

        Args:
            params: Dictionary containing:
                - <param_name>: <description> (<type>, <range/constraints>). [Required | Default: <val>]
            **kwargs: Additional keyword arguments.

        Returns:
            Dictionary containing the result data.
        """
        logger.info("Running <CommandName>: params=%s, kwargs=%s", params, kwargs)
        # call underlying SDK, return results as dict
        ...

String-to-enum conversion pattern

When the underlying SDK requires enum values, accept strings from JSON and convert internally:

def _convert_some_enum(value: str):
    """Convert a string like 'EnumType.member' or 'member' to the SDK enum."""
    if not isinstance(value, str):
        return value
    name = value.split(".")[-1]
    try:
        return getattr(sdk_module.EnumType, name)
    except AttributeError:
        raise ValueError(f"Invalid value: {value}")

Then call this converter at the top of the command method before passing params to the SDK.

Dockerfile (Optional)

For containerised deployment:

FROM python:3.14-slim-bookworm
WORKDIR /app
ENV UV_COMPILE_BYTECODE=1

RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

COPY pyproject.toml uv.lock ./
COPY edge/ ./edge/

WORKDIR /app/edge
RUN uv sync --frozen --no-dev --no-install-project --package <machine-name>-edge

CMD ["uv", "run", "python", "main.py"]

Add system dependencies (udev, libgl1, etc.) as needed for the machine SDK.

Checklist

When creating a new edge service:

  1. Create the repo structure (root pyproject.toml, edge/ folder)
  2. Write edge/<machine_name>.py with the driver class — public methods are commands, params use only basic types
  3. Write edge/main.py following the Config → driver → EdgeNatsClient → EdgeRunner pattern
  4. Write edge/pyproject.toml with puda-comms and machine SDK dependencies
  5. Add .env.example with required environment variables (MACHINE_ID, NATS_SERVERS, machine-specific vars)
  6. Add .gitignore (exclude .env, __pycache__, .venv, etc.)
  7. Optionally add a Dockerfile for container deployment

Reference Implementations

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.96%
按下载量换算66

Claude

27.23%
按下载量换算52

Cursor

20.14%
按下载量换算38

Gemini CLI

9.66%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills