Agent skill

Async Jobs And Events

by latitude-dev in latitude-dev/latitude-llm

Queues and workers, domain event publishers, async notifications or projections, or not doing that work inside HTTP handlers.

MITAuto-check passed

Install Async Jobs And Events

skills CLI
$ npx skills add latitude-dev/latitude-llm --skill async-jobs-and-events -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install latitude-dev/latitude-llm async-jobs-and-events --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/latitude-dev/latitude-llm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/async-jobs-and-events .claude/skills/async-jobs-and-events && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
async-jobs-and-events
GitHub stars
4.7k
Token cost
~2.8k tokens
SKILL.md length
1,314 words
Files
1
Skills in repo
28
Repo updated
First seen
Licence
MIT

At a glance

Queues and workers, domain event publishers, async notifications or projections, or not doing that work inside HTTP handlers.

  • Works in 6 steps: Name events after what the aggregate… → Smell test: if you deleted every event… → One canonical event per state… → …
  • SKILL.md covers Side effects and eventing, Domain event naming and…, Async and background tasks and Choosing between debounceMs…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Async Jobs And Events is an agent skill from latitude-dev/latitude-llm. Queues and workers, domain event publishers, async notifications or projections, or not doing that work inside HTTP handlers.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Open-source observability for AI agents. Find where your agents fail, dispatch your coding agent to fix it, and verify the fix against real traces. The licence is MIT.

Example prompts

  • “Use the async-jobs-and-events skill to queue and workers, domain event publishers, async notifications or projections, or not doing that work inside…”
  • “/async-jobs-and-events”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Name events after what the aggregate did, not what consumers need to hear. Good: ScoreCreated, ScoreStatusChanged. Bad: ScoreDraftSaved…
  2. Smell test: if you deleted every event handler, would you still emit this event because it describes a meaningfully different thing that…
  3. One canonical event per state transition. Do not split a single write operation into multiple event types to route to different handlers…
  4. Consumers own their filtering logic. If a handler only cares about published scores, the handler checks the payload or re-fetches state…
  5. Dedupe keys must not collide across lifecycle stages. If the same entity emits the same event at different lifecycle points (e.g., draft…
  6. Payload carries facts, not routing hints. Include the aggregate's current state (or the fields consumers might filter on) in the payload…

What it can do on your machine

Read from SKILL.md and the folder at commit 22e4d3b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Async Jobs And Events loads about 2.8k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 1,314 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from latitude-dev/latitude-llm at commit 22e4d3b, republished under its MIT licence (© latitude-dev). 1,314 words, ~2,774 tokens.

Download SKILL.mdSave it as .claude/skills/async-jobs-and-events/SKILL.md (or your agent's skills folder).
name
async-jobs-and-events
description
Queues and workers, domain event publishers, async notifications or projections, or not doing that work inside HTTP handlers.

Background jobs, domain events, and side effects

When to use: Queues and workers, domain event publishers, async notifications or projections, or not doing that work inside HTTP handlers.

Side effects and eventing

  • Domain code emits domain events through domain-level publisher abstractions (ports), not ad-hoc calls from use-cases to email/HTTP/Slack.
  • Workers handle notifications, integrations, projections, and other I/O asynchronously.
  • Do not orchestrate side effects (fan-out integrations, “fire and forget” HTTP, etc.) inside HTTP handlers — enqueue / publish and return.

Domain event naming and publisher–consumer decoupling

Domain events represent facts that happened — state transitions on an aggregate — not instructions for what should happen next. The publisher must never know or care which handlers are subscribed.

Rules
  1. Name events after what the aggregate did, not what consumers need to hear. Good: ScoreCreated, ScoreStatusChanged. Bad: ScoreDraftSaved (named to route around a handler), ScoreReadyForDiscovery (named after a consumer concern).
  2. Smell test: if you deleted every event handler, would you still emit this event because it describes a meaningfully different thing that happened? If the answer is no, the event is coupling in disguise.
  3. One canonical event per state transition. Do not split a single write operation into multiple event types to route to different handlers. If a score is written, emit ScoreCreated — regardless of whether the score is a draft or published.
  4. Consumers own their filtering logic. If a handler only cares about published scores, the handler checks the payload or re-fetches state and skips drafts. The publisher does not pre-filter by emitting different event names.
  5. Dedupe keys must not collide across lifecycle stages. If the same entity emits the same event at different lifecycle points (e.g., draft save then final publish), include the relevant discriminator in the dedupe key — not in the event name. Example: issues:discovery:${scoreId}:${status} instead of splitting into separate event types.
  6. Payload carries facts, not routing hints. Include the aggregate's current state (or the fields consumers might filter on) in the payload. Let consumers decide relevance from payload data.
When a new event type IS warranted

A new event type is justified when it represents a genuinely distinct state transition that would exist even with zero handlers — for example, ScoreDeleted is a different fact from ScoreCreated. The test: does the aggregate's lifecycle model include this transition independently of downstream concerns?

Anti-pattern: conditional event publishing
ts
// BAD — publisher decides routing based on consumer needs
const eventName = score.draftedAt === null ? “ScorePublished” : “ScoreDraftSaved”
yield* outboxEventWriter.write({ eventName, ... })

// GOOD — one canonical event, consumers filter
yield* outboxEventWriter.write({
  eventName: “ScoreCreated”,
  payload: { scoreId: score.id, organizationId, projectId, status: score.draftedAt === null ? “published” : “draft” },
})

// Consumer side — handler owns its filtering
ScoreCreated: (event) =>
  Effect.all([
    // discovery uses status-aware dedupe key, skips drafts internally
    pub.publish(“issues”, “discovery”, event.payload, {
      dedupeKey: `issues:discovery:${event.payload.scoreId}:${event.payload.status}`,
    }),
    pub.publish(“annotation-scores”, “publishHumanAnnotation”, event.payload, {
      debounceMs: SCORE_PUBLICATION_DEBOUNCE,
    }),
  ])

Async and background tasks

  • Put IDs or opaque storage keys in job payloads — not full mutable entities.
  • Re-fetch authoritative state inside the worker before acting.
  • Make stale or deleted entities an explicit outcome (skip, dead-letter, or record failure) instead of assuming rows still exist.
  • Worker handler effects must include withTracing from @repo/observability in their pipe chain so that Effect spans flow into the OTel pipeline. See effect-and-errors for tracing rules.
  • For transactional domain events, write through the OutboxEventWriter service (or a plain OutboxEventWriterShape from createOutboxWriter in @platform/db-postgres) instead of inserting outbox rows directly.
  • For high-volume or otherwise non-transactional producers whose upstream write is already durable, publish directly through createEventsPublisher(queuePublisher) into domain-events instead of persisting an outbox row only to forward it.
  • Domain-event consumers should act as dispatchers: publish downstream topic tasks or start workflows, but do not run synchronous business logic inline inside the event handler.
  • Extend the repo’s existing async rails instead of inventing new ones: BullMQ-backed queue workers live in apps/workers, and durable multi-step workflows live in the Temporal-backed apps/workflows app.
  • Changing a Temporal workflow that may have in-flight runs is a versioning event, not a refactor. Reordering, inserting, or removing activities (or sleeps, timers, child workflows) breaks replay for any history written under the old code and the workflow gets stuck on a non-determinism error — its workflow task keeps failing forever, and from the UI's perspective it stays "running" (e.g. an evaluation issue sits on "Generating" because getIssueAlignmentState sees status === "running"). Guard the change with patched("<descriptive-id>") from @temporalio/workflow, or pin the new code to a new Worker Deployment Version, before merging. See temporal-developer and its references/typescript/versioning.md for the three-step patched → deprecatePatch → remove flow and Worker Versioning setup. Draining in-flight workflows before deploy is rarely viable here: optimizeEvaluationWorkflow activities are sized up to 75 min (GEPA budget) and the full pipeline can run substantially longer, so a deploy window almost never finds all evaluations:* workflow IDs idle.
  • Queue topics may own several related lower-kebab-case task names; one worker module owns the topic and dispatches by task name.
  • Queue publication should expose logical dedupe/debounce or throttle keyed by the relevant entity identity when the transport supports it.
  • Use queue topics for single-step tasks and the workflow abstraction for long-running or multi-step orchestration.
  • For reliability async contracts, include both organizationId and projectId in domain-event payloads, topic/task payloads, and workflow inputs by default. Exceptions: MagicLinkEmailRequested, InvitationEmailRequested, UserDeletionRequested, the domain-events topic payload, the magic-link-email topic payload, the invitation-email topic payload, and the user-deletion topic payload.
  • When BullMQ delay is the chosen coalescing mechanism, key the delayed job by the logical entity identity so newer writes can replace, extend, or be dropped against the pending job — see the debounce-vs-throttle guidance below for which semantic to pick.
  • When a delayed queue topic semantically marks a lifecycle edge, let the delayed task publish a domain event through the appropriate rail after the delay elapses: use OutboxEventWriter / OutboxEventWriterShape for transactional boundaries and direct EventsPublisher publication for non-transactional or high-volume worker flows. Downstream side effects should run from the domain-event consumers rather than inline in the delayed task.
Show full SKILL.md (416 more words)Show less

Choosing between debounceMs and throttleMs

PublishOptions exposes two mutually exclusive delay fields. Both accept a window in ms and coalesce repeated publishes against dedupeKey, but they answer different questions.

debounceMs — fires after N ms of quiet on the dedupe key. Each publish within the window pushes the fire time forward and replaces the pending payload (BullMQ extend: true, replace: true). Use when the task should wait for a stream of events to settle.

Example: trace-end:run after TracesIngested. The batch event fans out one publish per deduped trace id; every new publish for the same trace resets the clock, so end-of-trace work fires once that trace is actually idle. If spans keep arriving every few seconds, that means the trace is still active — not firing is correct.

throttleMs — fires at most once per N ms per dedupe key. The first publish schedules the fire time; subsequent publishes within the window are dropped (BullMQ extend: false, replace: false). Requires dedupeKey. Use when you need a hard upper bound on fire latency and a cap on frequency, and where starvation under a continuous publish stream would be a product bug.

Example: annotation-driven alignment refresh (evaluations:automaticRefreshAlignment, 1h) and its escalation (evaluations:automaticOptimization, 8h). We want at most one refresh per evaluation per hour, firing at most 1h after the first new annotation, even if annotations keep arriving every 30 min.

Decision heuristic

Ask: if a publisher fires every 30 min forever on the same dedupeKey, what should happen?

  • "Fire after they stop" → debounceMs. Classic debounce. Fire time keeps sliding forward; fires only during quiet periods.
  • "Fire every N min regardless" → throttleMs. Bounded latency, bounded frequency; never starves.
Anti-pattern

Reaching for debounceMs when the intent is "run at most once per hour". With a continuous publish stream every publish extends the TTL and the task never fires — silent starvation. If the wording in the spec or PR is "at most once per X" or "every X at most", that is throttle semantics; use throttleMs.

ts
// Debounce — wait for events to settle
pub.publish("trace-end", "run", payload, {
  dedupeKey: `trace-end:run:${traceId}`,
  debounceMs: TRACE_END_DEBOUNCE_MS,
})

// Throttle — at most once per window, bounded latency
pub.publish("issues", "refresh", payload, {
  dedupeKey: `issues:refresh:${issueId}`,
  throttleMs: ISSUE_REFRESH_THROTTLE_MS,
})

Name the constant to match the semantic: *_DEBOUNCE_MS vs. *_THROTTLE_MS. A constant named for one semantic that is passed as the other is a lie readers will trip over.

New infrastructure dependencies

When adding a new external system the product talks to:

  1. Add a concrete provider package in packages/platform/*-<provider>.
  2. Wire it in the app composition root from environment-driven config.
  3. Change domain only if business rules change — not for every new adapter.

For env var naming when wiring config, see env-configuration. For layer rules, see architecture-boundaries.

© latitude-dev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/async-jobs-and-events of latitude-dev/latitude-llm.

Open the folder on GitHubat commit 22e4d3b

Compare with similar skills

Async Jobs And Events next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Async Jobs And Events compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Async Jobs And Events this skilllatitude-dev/latitude-llm4.7k—~2.8kAutomated safety check: PassMIT
Publishcode-yeongyu/oh-my-openagent70k—~5.5kAutomated safety check: WarnCustom licence
Python Background Jobswshobson/agents40k—~1.8kAutomated safety check: PassMIT
Social Publisheraffaan-m/ECC277k1 repos~1.1kAutomated safety check: PassMIT
Eventscoreyhaines31/marketingskills54k—~3kAutomated safety check: PassMIT
Publishyc-software/qm15k—~2.2kAutomated safety check: WarnMIT

Similar skills

  • Publish

    code-yeongyu/oh-my-openagent

    Publish oh-my-opencode to npm by triggering the GitHub Actions publish workflow and verifying its artifacts.

    70k GitHub stars~5.5k tokensUpdated today
    DevOps & CloudAuto-check: warnings
  • Python Background Jobs

    wshobson/agents

    Python background job patterns including task queues, workers, and event-driven architecture.

    40k GitHub stars~1.8k tokensUpdated 6 days ago
    Backend & APIsAuto-check passed
  • Social Publisher

    affaan-m/ECC

    Agent-driven scheduling and publishing of social media posts across 13 platforms via SocialClaw.

    277k GitHub starsUsed in 1 repo~1.1k tokens
    Writing & ContentAuto-check passed
  • Events

    coreyhaines31/marketingskills

    When the user wants to plan, run, sponsor, speak at, or get pipeline from events — webinars, conferences, trade shows, meetups, dinners, workshops, virtual summits, or user conferences.

    54k GitHub stars~3k tokensUpdated 2 days ago
    Marketing & SEOAuto-check passed
  • Publish

    yc-software/qm

    Publish a long-lived internal web app, site, or dashboard from the agent computer.

    15k GitHub stars~2.2k tokensUpdated yesterday
    DevOps & CloudAuto-check: warnings
  • Technical Job Search

    github/awesome-copilot

    Official

    A skill your agent uses when a software engineer asks for help with job search tasks: parsing or analyzing a job description, tailoring a CV/resume, writing a cover letter, evaluating a job offer…

    40k GitHub stars~1.2k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed

More from latitude-dev/latitude-llm

All 28 skills in this repo
  • Better Auth Best Practices

    latitude-dev/latitude-llm

    Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables.

    4.7k GitHub starsUsed in 7 repos~1.6k tokens
    Auto-check passed
  • Artifact Designer

    latitude-dev/latitude-llm

    Create, validate, preview, and publish self-contained HTML artifacts.

    4.7k GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check passed
  • CI Watchdog

    latitude-dev/latitude-llm

    Continuously monitor GitHub PR CI checks and automatically fix failures until all checks pass.

    4.7k GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed
  • Temporal Developer

    latitude-dev/latitude-llm

    This skill should be used when the user asks to "create a Temporal workflow", "write a Temporal activity", "debug stuck workflow", "fix non-determinism error", "Temporal Python", "Temporal…

    4.7k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Docs

    latitude-dev/latitude-llm

    Review the current conversation context and git changes, then persist durable repository knowledge into dev-docs/.md by domain and into AGENTS.md for cross-cutting repo rules.

    4.7k GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Managing Maintenance Windows

    latitude-dev/latitude-llm

    Enables or disables Latitude production maintenance mode by redirecting all publicly exposed production services to the Better Stack status page.

    4.7k GitHub stars~802 tokensUpdated 2 days ago
    Auto-check passed

Questions about Async Jobs And Events

What does Async Jobs And Events do?

Queues and workers, domain event publishers, async notifications or projections, or not doing that work inside HTTP handlers. Async Jobs And Events is an agent skill from latitude-dev/latitude-llm. Queues and workers, domain event publishers, async notifications or projections, or not doing that work inside HTTP handlers.

How do I install Async Jobs And Events in Claude Code?

Run `npx skills add latitude-dev/latitude-llm --skill async-jobs-and-events -a claude-code`. Or copy the skill folder (.agents/skills/async-jobs-and-events in latitude-dev/latitude-llm) into .claude/skills/async-jobs-and-events in your project. Claude Code loads it when a task matches its description.

How do I install Async Jobs And Events in Codex?

Run `npx skills add latitude-dev/latitude-llm --skill async-jobs-and-events -a codex`. Or copy the skill folder (.agents/skills/async-jobs-and-events in latitude-dev/latitude-llm) into .agents/skills/async-jobs-and-events in your project. Codex loads it when a task matches its description.

Can I use Async Jobs And Events in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add latitude-dev/latitude-llm --skill async-jobs-and-events -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/async-jobs-and-events, .gemini/skills/async-jobs-and-events, .github/skills/async-jobs-and-events and .opencode/skills/async-jobs-and-events in your project.

What does Async Jobs And Events need to run?

SKILL.md names no scripts, command-line tools or credentials: Async Jobs And Events is instructions for the agent only.

Does Async Jobs And Events access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Async Jobs And Events safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Async Jobs And Events use?

Async Jobs And Events is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Async Jobs And Events use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Async Jobs And Events?

Skills that share tags, products or a category with Async Jobs And Events: Publish (code-yeongyu/oh-my-openagent, 70k stars), Python Background Jobs (wshobson/agents, 40k stars), Social Publisher (affaan-m/ECC, 277k stars) and Events (coreyhaines31/marketingskills, 54k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Async Jobs And Events?

latitude-dev (a GitHub organization) maintains it in latitude-dev/latitude-llm, which has 4,718 GitHub stars. The repository holds 28 skills in this directory. The repository was last updated on October 9, 2026.

Source: latitude-dev/latitude-llm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.