npx skills add https://github.com/hugorcd/evlog --skill create-evlog-adapter为 evlog 添加一个新的内置适配器。每个适配器都遵循相同的架构。本技能将引导您完成所有 8 个接触点。每一个接触点都是强制性的——不要跳过任何步骤。
推荐的拉取请求标题格式:
feat: add {name} adapter
具体措辞可能因适配器而异(例如 feat: add OTLP adapter、feat: add Axiom drain adapter),但应始终遵循 feat: 的约定式提交前缀。
---|---|---
1 | packages/evlog/src/adapters/{name}.ts | 创建适配器源代码
2 | packages/evlog/tsdown.config.ts | 添加构建入口
3 | packages/evlog/package.json | 添加 和 条目
4 | | 创建测试
5 | | 创建适配器文档页面(在 之前)
6 | | 在概览页中添加适配器(链接、卡片、环境变量)
7 | | 在 Drain Adapters 表格中添加适配器行
8 | 重命名 | 确保添加新适配器后 仍为最后一个
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
exportstypesVersionspackages/evlog/test/adapters/{name}.test.tsapps/docs/content/4.adapters/{n}.{name}.mdcustom.mdapps/docs/content/4.adapters/1.overview.mdskills/review-logging-patterns/SKILL.mdcustom.mdcustom.md重要提示:在所有 8 个接触点都处理完毕之前,请勿认为任务已完成。
请一致地使用这些占位符:
| 占位符 | 示例 (Datadog) | 用途 |
|---|---|---|
{name} | datadog | 文件名、导入路径、环境变量后缀 |
{Name} | Datadog | 函数/接口名称中的 PascalCase |
{NAME} | DATADOG | 环境变量前缀中的 SCREAMING_CASE |
创建 packages/evlog/src/adapters/{name}.ts。
完整的带注释模板请参阅 references/adapter-template.md。
关键架构规则:
timeout?: numbergetRuntimeConfig() —— 从 ./_utils 导入(共享辅助函数,请勿在本地重新定义)create{Name}Drain() 的覆盖项runtimeConfig.evlog.{name}runtimeConfig.{name}NUXT_{NAME}_* 然后是 {NAME}_*create{Name}Drain(overrides?: Partial<Config>) 返回 (ctx: DrainContext) => Promise<void>sendTo{Name}(event, config) 和 sendBatchTo{Name}(events, config) 用于直接使用和可测试性console.error('[evlog/{name}] ...'),切勿从 drain 函数中抛出错误AbortController,默认 5000 毫秒,可通过 config.timeout 配置to{Name}Event() 转换器在 packages/evlog/tsdown.config.ts 中,与现有适配器一起添加一个构建入口:
'adapters/{name}': 'src/adapters/{name}.ts',
将其放在最后一个适配器条目之后(当前 tsdown.config.ts 中是 hyperdx)。
在 packages/evlog/package.json 中,添加两个条目:
在 exports 中(在最后一个适配器之后,当前是 ./posthog):
"./{name}": {
"types": "./dist/adapters/{name}.d.mts",
"import": "./dist/adapters/{name}.mjs"
}
在 typesVersions["*"] 中(在最后一个适配器之后):
"{name}": [
"./dist/adapters/{name}.d.mts"
]
创建 packages/evlog/test/adapters/{name}.test.ts。
完整的带注释模板请参阅 references/test-template.md。
必需的测试类别:
sendBatchTo{Name})创建 apps/docs/content/4.adapters/{n}.{name}.md,其中 {n} 是 custom.md 之前的下一个数字(custom 应始终为最后一个)。
使用现有的 Axiom 适配器页面(apps/docs/content/4.adapters/2.axiom.md)作为 frontmatter 结构、语气和章节的参考。关键章节包括:介绍、快速设置、配置(环境变量表格 + 优先级)、高级用法、在目标服务中查询、故障排除、直接 API 使用、后续步骤。
重要提示:多框架示例。 快速开始部分必须包含一个 ::code-group,其中包含所有支持框架(Nuxt/Nitro、Hono、Express、Fastify、Elysia、NestJS、Standalone)的标签页。不要只展示 Nitro 示例。请参考任何现有适配器页面的模式。
编辑 apps/docs/content/4.adapters/1.overview.md,在 三个 地方添加新适配器(遵循现有适配器的模式):
links 数组 —— 添加一个包含图标和路径的链接条目::card-group 部分 —— 在 Custom 卡片之前添加一个卡片块.env 示例 —— 添加适配器的环境变量skills/review-logging-patterns/SKILL.md在 skills/review-logging-patterns/SKILL.md(分发给用户的公共技能)中,找到 Drain Adapters 表格并添加一个新行:
| {Name} | `evlog/{name}` | `{NAME}_TOKEN`, `{NAME}_DATASET` (或等效变量) |
遵循现有行(Axiom、OTLP、PostHog、Sentry、Better Stack)的模式。不需要额外的使用示例块——表格条目已足够。
custom.md如果新适配器的编号与 custom.md 冲突,请将 custom.md 重新编号为最后一个条目。例如,如果新适配器是 5.{name}.md,则将 5.custom.md 重命名为 6.custom.md。
完成所有步骤后,运行:
cd packages/evlog
bun run build # 验证构建成功,包含新条目
bun run test # 验证测试通过
每周安装量
445
代码仓库
GitHub 星标数
966
首次出现
2026年2月8日
安全审计
安装于
codex379
opencode379
github-copilot378
gemini-cli377
amp375
kimi-cli373
Add a new built-in adapter to evlog. Every adapter follows the same architecture. This skill walks through all 8 touchpoints. Every single touchpoint is mandatory -- do not skip any.
Recommended format for the pull request title:
feat: add {name} adapter
The exact wording may vary depending on the adapter (e.g., feat: add OTLP adapter, feat: add Axiom drain adapter), but it should always follow the feat: conventional commit prefix.
---|---|---
1 | packages/evlog/src/adapters/{name}.ts | Create adapter source
2 | packages/evlog/tsdown.config.ts | Add build entry
3 | packages/evlog/package.json | Add exports + typesVersions entries
4 | packages/evlog/test/adapters/{name}.test.ts | Create tests
5 | apps/docs/content/4.adapters/{n}.{name}.md | Create adapter doc page (before custom.md)
6 | apps/docs/content/4.adapters/1.overview.md | Add adapter to overview (links, card, env vars)
7 | skills/review-logging-patterns/SKILL.md | Add adapter row in the Drain Adapters table
8 | Renumber custom.md | Ensure custom.md stays last after the new adapter
Important : Do NOT consider the task complete until all 8 touchpoints have been addressed.
Use these placeholders consistently:
| Placeholder | Example (Datadog) | Usage |
|---|---|---|
{name} | datadog | File names, import paths, env var suffix |
{Name} | Datadog | PascalCase in function/interface names |
{NAME} | DATADOG | SCREAMING_CASE in env var prefixes |
Create packages/evlog/src/adapters/{name}.ts.
Read references/adapter-template.md for the full annotated template.
Key architecture rules:
timeout?: numbergetRuntimeConfig() -- import from ./_utils (shared helper, do NOT redefine locally)create{Name}Drain()runtimeConfig.evlog.{name}runtimeConfig.{name}NUXT_{NAME}_* then {NAME}_*Add a build entry in packages/evlog/tsdown.config.ts alongside the existing adapters:
'adapters/{name}': 'src/adapters/{name}.ts',
Place it after the last adapter entry (currently hyperdx in tsdown.config.ts).
In packages/evlog/package.json, add two entries:
Inexports (after the last adapter, currently ./posthog):
"./{name}": {
"types": "./dist/adapters/{name}.d.mts",
"import": "./dist/adapters/{name}.mjs"
}
IntypesVersions["*"] (after the last adapter):
"{name}": [
"./dist/adapters/{name}.d.mts"
]
Create packages/evlog/test/adapters/{name}.test.ts.
Read references/test-template.md for the full annotated template.
Required test categories:
sendBatchTo{Name})Create apps/docs/content/4.adapters/{n}.{name}.md where {n} is the next number before custom.md (custom should always be last).
Use the existing Axiom adapter page (apps/docs/content/4.adapters/2.axiom.md) as a reference for frontmatter structure, tone, and sections. Key sections: intro, quick setup, configuration (env vars table + priority), advanced usage, querying in the target service, troubleshooting, direct API usage, next steps.
Important: multi-framework examples. The Quick Start section must include a ::code-group with tabs for all supported frameworks (Nuxt/Nitro, Hono, Express, Fastify, Elysia, NestJS, Standalone). Do not only show Nitro examples. See any existing adapter page for the pattern.
Edit apps/docs/content/4.adapters/1.overview.md to add the new adapter in three places (follow the pattern of existing adapters):
links array -- add a link entry with icon and path::card-group section -- add a card block before the Custom card.env example -- add the adapter's env varsskills/review-logging-patterns/SKILL.mdIn skills/review-logging-patterns/SKILL.md (the public skill distributed to users), find the Drain Adapters table and add a new row:
| {Name} | `evlog/{name}` | `{NAME}_TOKEN`, `{NAME}_DATASET` (or equivalent) |
Follow the pattern of the existing rows (Axiom, OTLP, PostHog, Sentry, Better Stack). No additional usage example block is needed — the table entry is sufficient.
custom.mdIf the new adapter's number conflicts with custom.md, renumber custom.md to be the last entry. For example, if the new adapter is 5.{name}.md, rename 5.custom.md to 6.custom.md.
After completing all steps, run:
cd packages/evlog
bun run build # Verify build succeeds with new entry
bun run test # Verify tests pass
Weekly Installs
445
Repository
GitHub Stars
966
First Seen
Feb 8, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex379
opencode379
github-copilot378
gemini-cli377
amp375
kimi-cli373
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
105,000 周安装
create{Name}Drain(overrides?: Partial<Config>)(ctx: DrainContext) => Promise<void>sendTo{Name}(event, config) and sendBatchTo{Name}(events, config) for direct use and testabilityconsole.error('[evlog/{name}] ...'), never throw from the drainAbortController with 5000ms default, configurable via config.timeoutto{Name}Event() converter