emit-event

Append session-lifecycle events as JSON lines to a live event log.

1|1|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/williamthorsen/codeassembly --skill emit-event-williamthorsen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: emit-event
Source: https://github.com/williamthorsen/codeassembly/tree/main/packages/agents/content/skills/emit-event
Command: npx skills add https://github.com/williamthorsen/codeassembly --skill emit-event-williamthorsen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Instrumented agent skills need a way to report what a session is doing while it is doing it, so a watching surface can render live progress. This Skill appends one lifecycle event to the session's event log without ever blocking or breaking the skill it observes. ## Core Features & Use Cases - Lifecycle event emission: Append typed events such as skill.started, skill.completed, artifact.written, input.requested, and pr.created to a per-session JSONL log. - Automatic context enrichment: The bundled helper fills in repo, branch, session id, working directory, a ULID, and a timestamp, omitting fields that cannot be resolved. - Never-block contract: The helper always exits 0 and prints a JSON result, so telemetry can never interrupt the work it watches. - Use Case: An instrumented planning skill emits skill.started when it begins and skill.completed with the outcome when it finishes, letting a watching UI render the session timeline in real time. ## Quick Start Ask the agent to emit a skill.started event with a payload naming the current skill by invoking the bundled emit-event helper with the appropriate type flag.

Frequently Asked Questions about emit-event

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I emit a lifecycle event from an agent skill?

Invoke the bundled emit-event.mjs helper with node, passing --type for the event type and --payload as a single-quoted JSON object. The helper fills in repo, branch, session, and timestamp automatically and appends one JSON line to the session log.

What event types can a skill emit to the session event log?

Skills emit skill.started, skill.progress, skill.completed, artifact.written, input.requested, and pr.created. The four relayed types (session.started, turn.started, turn.completed, session.ended) are emitted only by the harness hook relay and must never be emitted from a skill.

What happens if event emission fails during a skill run?

Nothing interrupts the skill. The helper always exits 0 and prints a JSON result with ok false and an error message on failure. Callers must never branch on the result, retry, or report the failure to the user.

Does emit-event work outside a git repository?

Yes. When repo, branch, or session cannot be resolved, those fields are omitted from the envelope and the event is appended under placeholder path segments like _no-repo, so sessions outside a repo remain observable.

Why must the payload be a JSON object?

The payload's shape is the contract read by consuming surfaces, so bare arrays or scalars are refused with an invalid-payload result. Keep the payload small since it is a status line, not a report.