Skip to content
Back to skills

Ape Add Event

ASecurity

Add a typed event about a subject: naming, allowed properties (never free text), emitting it from the server or tracking it in the app, and subscribers that act on it.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
developmenttestingapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add BuffApe/BuffApe --skill ape-add-event --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ape Add Event?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ape Add Event
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/buffape-ape-add-event/badge)](https://www.skillsdirectory.com/skills/buffape-ape-add-event)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ape-add-event
description: "Add a typed event about a subject: naming, allowed properties (never free text), emitting it from the server or tracking it in the app, and subscribers that act on it."
---

# Add an event

1. Name it `object_action` in the past tense (`note_created`).
2. Declare it in the module's manifest with what it is about and typed props: `events: { note_created: { subject: 'note', props: { titled: 'boolean', mode: ['typed', 'tap'] } } }`. The subject is a noun of your module (its rows' type); props are IDs, numbers, booleans and enum values, never free text from people.
3. Record it on the server with `emit(ctx, 'note_created', { subject: { type: 'note', id: note.id }, props: { titled: true } })` from `@buffcore/modules/events`, in the transaction of the write it is about (`{ ...ctx, em }` inside `ctx.em.transactional`), so it commits with that write or not at all. In a client, use the SDK's tracker: `tracker.track('note_created', { titled: true })`.
4. To act on it, add a subscriber: a job with `on: 'note_created'` in `jobs`, whose payload is the event (`EventDelivery` from `@buffcore/modules/events`: `id`, `name`, `at`, `subject`, `props`). Each event queues one run per subscriber in its transaction. A job tries again when it fails, so make it safe to run twice: write through `ctx.em` (it commits with the job's done mark), and give `ctx.job.key` to an outside service as its idempotency key. The playground's `notes.ready` (`apps/playground/src/modules/notes/ready.ts`) is one.
5. The API rejects unknown names, invalid props and a subject of another type, and counts them; `emit` throws for them. Check in a test that your event is accepted, and run its subscriber with `drainJobs(app)` from `@buffcore/server/testing`.
6. Analytics counts a person as active by the events in `defineApp({ settings: { analytics: { activity: [...] } } })` (default `['app_opened']`): list the event that means "used the product" there (one your product declares, such as a session started).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.