ワンクリックで
add-event
Add a new output event type to the event/sink system. Use when adding a new kind of event for domain-to-UI communication.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Add a new output event type to the event/sink system. Use when adding a new kind of event for domain-to-UI communication.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Create a GitHub pull request following lstk conventions with proper title, description, and ticket references.
Scaffold a new CLI subcommand following lstk patterns. Use when adding a new command to the CLI.
Review a PR against lstk architectural patterns and coding conventions. Use when asked to review a pull request.
Scaffold a new Bubble Tea TUI component following lstk's UI patterns. Use when adding a new reusable UI element.
SOC 職業分類に基づく
| name | add-event |
| description | Add a new output event type to the event/sink system. Use when adding a new kind of event for domain-to-UI communication. |
| argument-hint | <EventName> [description] |
| allowed-tools | Read, Write, Edit, Glob, Grep |
Add a new event type $ARGUMENTS to the output event system.
Read these files first — they are the source of truth:
internal/output/events.go — all event types, the Event marker interface, and its sealedEvent() implementationsinternal/output/plain_format.go — FormatEventLine() switch for plain text renderinginternal/output/plain_format_test.go — test cases for format parityinternal/ui/app.go — Update() method that handles events in the TUIIn internal/output/events.go:
Add a new struct with fields that are domain facts (not pre-rendered strings):
type <Name>Event struct {
// Fields should be typed data, not display strings
}
Add the marker method so the type satisfies the Event interface and Sink.Emit accepts it:
func (<Name>Event) sealedEvent() {}
Call sites emit directly on the sink — no helper needed:
sink.Emit(output.<Name>Event{...})
In internal/output/plain_format.go, add a case to FormatEventLine():
case <Name>Event:
return format<Name>(e), true
Write a format<Name>() helper that returns a single-line string. Keep formatting consistent with existing events — plain text, no ANSI codes, no lipgloss.
In internal/output/plain_format_test.go, add test cases to TestFormatEventLine covering:
Follow the existing table-driven test pattern with name, event, want, wantOK fields.
In internal/ui/app.go, add a case in Update() for the new event.
Decide based on the event's nature:
styledLine and append to a.lines (like MessageEvent)ErrorEvent → a.errorDisplay.Show())a.spinner.PendingStop() and buffer accordingly (like MessageEvent)If the event doesn't need special TUI handling, the default case in Update() already falls back to FormatEventLine() — so you may not need to add anything here.
plain_format.gosink.Emit(output.<Name>Event{...}) directlyfunc (<Name>Event) sealedEvent() {} — without it Sink.Emit will reject the type at compile time