Skip to content

Commit dd32666

Browse files
committed
improve AGENTS.md and skill to create-adapter
1 parent 48c5733 commit dd32666

2 files changed

Lines changed: 87 additions & 8 deletions

File tree

.agents/skills/create-adapter/SKILL.md

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
---
22
name: create-evlog-adapter
3-
description: Create a new built-in evlog adapter to send wide events to an external observability platform. Use when adding a new drain adapter (e.g., for Datadog, Sentry, Loki, Elasticsearch, etc.) to the evlog package. Covers source code, build config, package exports, tests, and documentation.
3+
description: Create a new built-in evlog adapter to send wide events to an external observability platform. Use when adding a new drain adapter (e.g., for Datadog, Sentry, Loki, Elasticsearch, etc.) to the evlog package. Covers source code, build config, package exports, tests, and all documentation.
44
---
55

66
# Create evlog Adapter
77

8-
Add a new built-in adapter to evlog. Every adapter follows the same architecture. This skill walks through all 5 touchpoints.
8+
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.
9+
10+
## PR Title
11+
12+
Recommended format for the pull request title:
13+
14+
```
15+
feat: add {name} adapter
16+
```
17+
18+
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.
919

1020
## Touchpoints Checklist
1121

@@ -15,9 +25,12 @@ Add a new built-in adapter to evlog. Every adapter follows the same architecture
1525
| 2 | `packages/evlog/build.config.ts` | Add build entry |
1626
| 3 | `packages/evlog/package.json` | Add `exports` + `typesVersions` entries |
1727
| 4 | `packages/evlog/test/adapters/{name}.test.ts` | Create tests |
18-
| 5 | `apps/docs/content/3.adapters/{n}.{name}.md` | Create doc page (before `custom.md`) |
28+
| 5 | `apps/docs/content/3.adapters/{n}.{name}.md` | Create adapter doc page (before `custom.md`) |
29+
| 6 | `apps/docs/content/3.adapters/1.overview.md` | Add adapter to overview (links, card, env vars) |
30+
| 7 | `AGENTS.md` | Add adapter to the "Built-in Adapters" table |
31+
| 8 | Renumber `custom.md` | Ensure `custom.md` stays last after the new adapter |
1932

20-
After all 5 steps, update `AGENTS.md` to list the new adapter in the adapters table.
33+
**Important**: Do NOT consider the task complete until all 8 touchpoints have been addressed.
2134

2235
## Naming Conventions
2336

@@ -96,7 +109,7 @@ Required test categories:
96109
5. Batch operations (`sendBatchTo{Name}`)
97110
6. Timeout handling (default 5000ms + custom)
98111

99-
## Step 5: Documentation
112+
## Step 5: Adapter Documentation Page
100113

101114
Create `apps/docs/content/3.adapters/{n}.{name}.md` where `{n}` is the next number before `custom.md` (custom should always be last).
102115

@@ -133,17 +146,81 @@ Sections to include:
133146
5. **Configuration Priority** -- overrides > runtimeConfig > env vars
134147
6. **Advanced** -- custom options, event transformation details
135148
7. **Querying/Using** -- how to find evlog events in the target service
149+
8. **Troubleshooting** -- common errors (missing config, auth failures)
150+
9. **Direct API Usage** -- `sendTo{Name}()` and `sendBatchTo{Name}()` examples
151+
10. **Next Steps** -- links to other adapters and best practices
152+
153+
Use the existing Axiom adapter page (`apps/docs/content/3.adapters/2.axiom.md`) as a reference for tone, structure, and depth.
154+
155+
## Step 6: Update Adapters Overview Page
156+
157+
Edit `apps/docs/content/3.adapters/1.overview.md` to add the new adapter in **three** places:
158+
159+
### 6a. Frontmatter `links` array
160+
161+
Add a link entry alongside the existing adapters:
162+
163+
```yaml
164+
- label: "{Name}"
165+
icon: i-simple-icons-{name}
166+
to: /adapters/{name}
167+
color: neutral
168+
variant: subtle
169+
```
170+
171+
### 6b. `::card-group` section
172+
173+
Add a card block for the new adapter (before the Custom card):
136174

137-
Renumber `custom.md` if needed so it stays last.
175+
```markdown
176+
:::card
177+
---
178+
icon: i-simple-icons-{name}
179+
title: {Name}
180+
to: /adapters/{name}
181+
---
182+
[Short description of what the adapter does.]
183+
:::
184+
```
185+
186+
### 6c. Zero-Config Setup `.env` example
187+
188+
Add the adapter's env vars in the `.env` code block. The variable names depend on the service (e.g., `NUXT_AXIOM_TOKEN`, `NUXT_OTLP_ENDPOINT`, `NUXT_POSTHOG_API_KEY`):
138189

139-
## Final Step: Update AGENTS.md
190+
```bash
191+
# {Name}
192+
NUXT_{NAME}_<RELEVANT_VAR>=xxx
193+
```
140194

141-
Add the new adapter to the adapters table in the root `AGENTS.md` file, in the "Log Draining & Adapters" section:
195+
## Step 7: Update AGENTS.md
196+
197+
Add the new adapter to the **"Built-in Adapters"** table in the root `AGENTS.md` file, in the "Log Draining & Adapters" section:
142198

143199
```markdown
144200
| {Name} | `evlog/{name}` | Send logs to {Name} for [description] |
145201
```
146202

203+
Also add a usage example block (following the pattern of existing adapters in AGENTS.md):
204+
205+
```markdown
206+
**Using {Name} Adapter:**
207+
208+
\`\`\`typescript
209+
// server/plugins/evlog-drain.ts
210+
import { create{Name}Drain } from 'evlog/{name}'
211+
212+
export default defineNitroPlugin((nitroApp) => {
213+
nitroApp.hooks.hook('evlog:drain', create{Name}Drain())
214+
})
215+
\`\`\`
216+
217+
Set the required environment variables (e.g., \`NUXT_{NAME}_TOKEN\`, \`NUXT_{NAME}_ENDPOINT\`, etc. -- depends on the service).
218+
```
219+
220+
## Step 8: Renumber `custom.md`
221+
222+
If 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`.
223+
147224
## Verification
148225

149226
After completing all steps, run:

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ export default defineNitroPlugin((nitroApp) => {
211211

212212
evlog provides built-in adapters for popular observability platforms. Use the `evlog:drain` hook to send logs to external services.
213213

214+
> **Creating a new adapter?** Follow the skill at `.agents/skills/create-adapter/SKILL.md`. It covers all touchpoints: source code, build config, package exports, tests, and all documentation updates.
215+
214216
**Built-in Adapters:**
215217

216218
| Adapter | Import | Description |

0 commit comments

Comments
 (0)