Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

elysiaelysia 命令行

Agent Skill

elysia 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,247

周安装

53

GitHub Stars

323

下载量

437
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/pedronauck/skills --skill elysia

简介

elysia 提供 Elysia 框架开发指南、模式规范和最佳实践参考。

  • 涵盖路由组织、控制器设计、TypeBox 验证和错误处理等企业级特性。
  • 推荐“一个 Elysia 实例对应一个控制器”的结构原则,提升可维护性。
  • 安装前需确认项目是否基于 Elysia 框架以避免误用。
  • 注意:主要面向 Bun 运行时环境,其他平台可能存在兼容性问题。

SKILL.md

Elysia Developer Guide

This skill provides guidelines, patterns, and best practices for working with the Elysia framework in this project.

Quick Start

For detailed development guidelines, imports, and patterns, please refer to references/patterns.md in this skill directory.

Core Philosophy

  • Pattern-agnostic but feature-based structure recommended
  • "1 Elysia instance = 1 controller" principle
  • Strong typing with TypeBox for runtime validation
  • Centralized error handling and consistent responses
  • Production-ready deployment strategies

Structure, Routing & Controllers

Essential Organization Patterns

  • App as controller: Treat each new Elysia({prefix}) instance as the controller for that feature. Do not pass entire class methods directly as handlers. Instead, inline a small handler that calls service functions.
  • Feature folders: Use a feature-based structure:

- src/modules/<feature>/index.ts - Elysia controller (routes, guards, cookies) - src/modules/<feature>/service.ts - business logic (no HTTP context) - src/modules/<feature>/model.ts - schemas & types via t (TypeBox) - Keep shared utilities in src/utils/*.

  • Method chaining: Prefer fluent chaining on the Elysia instance for routes, guards, plugins.
  • Plugins: Encapsulate cross-cutting concerns in plugins via .use() (e.g., OpenAPI, JWT, CORS).
  • Context hygiene: If a service needs request data, keep it in the controller and pass only the relevant fields into the service function.

Feature Scaffolding Pattern

When scaffolding a feature, generate:

  1. model.ts with t.Object(...) schemas and exported type aliases via typeof schema.static.
  2. service.ts with pure functions (or an abstract class of statics when no instance state is needed).
  3. index.ts that mounts the Elysia routes, applies guard() with shared validation, and returns typed responses.

Validation, Schemas & Types

Runtime Validation + Static Types

  • Use import {t} from 'elysia' to define Body, Query, Params, Headers, Cookie, and Response schemas.
  • Derive TS types from typeof schema.static and export them (e.g., export type SignInBody = typeof signInBody.static).
  • Apply shared validation with .guard({...}). If combining guards, consider schema: 'standalone' to keep them independent.
  • Validate files by content: use fileType (magic number) when using standard schema systems.
  • Ensure response schemas are present for 2xx and error variants for strong end-to-end typing.

Handler Schema Guidelines

When generating handlers:

  • Include the 3rd argument schema object with body/query/params/headers/cookie/response.
  • Don't parse body for GET/HEAD (Elysia follows HTTP spec).
  • Provide examples with t.Object, t.Array, t.Union, t.Literal, file schemas, and show guard() for shared query/headers.

Error Handling & Response Shape

Centralized Error Management

  • Use .onError(({code, error, path, request}) => {...}) on the app to map framework and custom errors to a uniform JSON shape (e.g., {ok: false, error: {code, message, details}}).
  • Prefer throw status(code, messageOrPayload) for error control flow that onError can catch. Note: return status(...) won't be caught by onError.
  • Validation errors: normalize them to a predictable JSON (array of issues) while hiding sensitive internals in production.
  • Include correlation ids (e.g., x-request-id) and log within onError. Avoid leaking stack traces in production.
  • For success responses, optionally wrap in {ok: true, data} for uniformity.

Error Plugin Structure

When generating code, create:

  • src/plugins/error.ts that installs .onError(...).
  • Optionally src/plugins/logging.ts to log in onResponse & onError.

OpenAPI, Auth & Cross-cutting

OpenAPI

  • Add @elysiajs/openapi plugin and expose docs route (Scalar UI).
  • Keep response schemas accurate - OpenAPI derives from them.
  • If building SDKs, ensure routes are fully typed and examples provided.

Auth

  • Use @elysiajs/jwt for JWT signing/verification, or integrate with your auth of choice.
  • Keep auth in a plugin that decorates context with user after verification.
  • Protect routes via .guard({headers: t.Object({authorization: t.String()})}) and verify bearer tokens before handlers.

Cross-cutting Plugins

  • Install @elysiajs/cors where needed.
  • Consider @elysiajs/server-timing and @elysiajs/opentelemetry for observability.

When scaffolding, generate src/plugins/openapi.ts, src/plugins/auth.ts, and wire them in src/app.ts.

Deploy, Performance & Docker

Production Deployment

  • Cluster mode for multi-core: use a small launcher (index.ts) that forks workers and imports server.ts per worker.
  • Prefer building with bundlers like Vite or esbuild for production deployments.
  • If compiling interferes with tracing (OpenTelemetry), avoid --minify or mark instrumented modules as --external.
  • Accept process.env.PORT (with fallback) and bind 0.0.0.0 for PaaS.

Docker

  • Build stage: use Node.js base image with pnpm.
  • Runtime: distroless base, copy binary, CMD ["./server"].

Deployment Scaffolding

When generating a deploy scaffold, include:

  • src/index.ts (cluster launcher), src/server.ts (app), Dockerfile (multi-stage), and build scripts.

Testing

Unit Tests

  • Use vitest.
  • Import the app and use app.handle(new Request(url, options)) to assert status/body/headers.
  • For service tests, call pure functions directly.

Test Examples to Include

  • Simple GET test returning text.
  • POST with body validation (both valid and invalid paths).
  • Authenticated route example using a mocked Authorization header.
  • Prefer small, focused tests per route and per service.

Quick Utilities

Common Patterns

  • App context: use .state() and .decorate() to add version info, helpers, etc., then read from {store, getDate}.
  • WebSocket endpoints via .ws() for simple real-time APIs.
  • Custom body parser with .onParse() for special content types.

Validation Checklist

Before finishing a task involving Elysia:

  • Feature structure follows model.ts, service.ts, index.ts pattern.
  • All handlers have proper schema definitions (body/query/params/response).
  • Error handling uses centralized .onError() plugin.
  • Response schemas are defined for OpenAPI generation.
  • Tests use app.handle(new Request(...)) pattern.
  • Run type checks (pnpm run typecheck) and tests (pnpm run test).

For detailed patterns and code examples, see references/patterns.md.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.41%
按下载量换算150

Claude

30.35%
按下载量换算133

Cursor

18.22%
按下载量换算80

Gemini CLI

8.9%
按下载量换算39

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills