원클릭으로
add-inbound-event
TRIGGER when user asks to listen for, subscribe to, or handle an event emitted by another microservice.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
TRIGGER when user asks to listen for, subscribe to, or handle an event emitted by another microservice.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
TRIGGER when the user asks to upgrade the project to a newer or the latest version of Microbus, or to update the framework. Each Microbus release ships this one self-contained skill; it applies that release's single-version migration, then chains to the next release's copy of this skill until the target version is reached.
TRIGGER when user asks to create, scaffold, or initialize a new microservice.
How to choose the hostname of a new Microbus microservice. Referenced by the add-microservice and add-sql-microservice scaffolding skills (and, through their delegation to add-microservice, by add-python-microservice and import-openapi-microservice). Consult it whenever a microservice's hostname is being chosen.
Performs an architectural review of a microservice-based system built on the Microbus framework. Covers only cross-cutting, cross-microservice concerns - service boundaries, the dependency graph, coupling, cross-service consistency, data ownership, workflow composition, edge security, and system operations. Anything judgeable inside a single microservice directory belongs to the review-microservice skill and is out of scope here. Produces a structured report with findings and recommendations.
Reviews the microservices touched by a set of changes - by default the whole current feature branch versus its merge-base with main, plus any uncommitted work. Runs the review-microservice skill on each changed microservice and the review-architecture skill scoped to those microservices and their graph neighbors, then consolidates one report. Use before merging a branch or before committing working-tree changes.
Performs a thorough review of a single Microbus microservice. Checks for completeness, framework compliance, code quality, security, test coverage, documentation, API design, and data access performance. Produces a structured report with findings and recommendations.
| name | add-inbound-event |
| description | TRIGGER when user asks to listen for, subscribe to, or handle an event emitted by another microservice. |
CRITICAL: Do NOT explore or analyze other microservices unless explicitly instructed to do so. The instructions in this skill are self-contained to this microservice.
CRITICAL: An inbound event sink is declared as a define.InboundEvent var in myserviceapi/definition.go referencing the source microservice's OutboundEvent, and implemented as a handler in service.go. Add the declaration and run cmd/genservice.
CRITICAL: Keep the // MARKER: OnMyEvent comment on the define.InboundEvent var.
CRITICAL: Inbound event sinks are not exposed via OpenAPI. The connector's built-in :888/openapi.json handler enforces this filter automatically.
Copy this checklist and track your progress:
Creating or modifying an inbound event sink:
- [ ] Step 1: Read local CLAUDE.md file
- [ ] Step 2: Locate the source outbound event and determine the signature
- [ ] Step 3: Determine a description
- [ ] Step 4: Declare the inbound event in definition.go
- [ ] Step 5: Generate the boilerplate
- [ ] Step 6: Implement the sink in service.go
- [ ] Step 7: Test the inbound event sink
- [ ] Step 8: Housekeeping
CLAUDE.md FileRead the local CLAUDE.md file in the microservice's directory. It contains microservice-specific instructions that should take precedence over global instructions.
Locate the define.OutboundEvent var in the api package of the microservice that is the source of the event. Note its package import path (e.g. github.com/company/project/eventsource/eventsourceapi) and its In/Out structs - the handler's signature is the source event's signature.
func OnMyEvent(ctx context.Context, input1 string, input2 ThirdPartyStruct) (output1 map[string]MyStruct, err error)
Take the event's description from the source's OutboundEvent godoc. Use it for the godoc on this define.InboundEvent var.
definition.goAppend the define.InboundEvent var to myserviceapi/definition.go, referencing the source's OutboundEvent var. Add the import for the source api package.
import (
"github.com/microbus-io/fabric/define"
"github.com/company/project/eventsource/eventsourceapi"
)
/*
OnMyEvent is triggered when X.
*/
var OnMyEvent = define.InboundEvent{ // MARKER: OnMyEvent
Source: eventsourceapi.OnMyEvent,
}
OnAUpdated, OnBUpdated) so the handler methods differSource is the typed reference to the source's OutboundEvent var, so a renamed or removed source event becomes a compile error hereLoadBalancing: define.None to process the event on every replica of this service (broadcast, e.g. cache invalidation), or LoadBalancing: "my-queue" for a named queue; omit for the default queue (one replica processes each delivery)RequiredClaims: "roles.user" to process the event only when its carried actor satisfies the expression; omit to accept allTimeBudget: 30 * time.Second to cap the handler's duration; add the "time" import if usedFrom the microservice's directory, run the generator. It regenerates intermediate.go (the hook wiring and ToDo entry), mock.go, mock_test.go, and manifest.yaml from the updated definition.go. It also scaffolds a placeholder handler in service.go and a placeholder test in service_test.go for any new feature that lacks one, each ready for you to fill in.
go run github.com/microbus-io/fabric/cmd/genservice .
Then verify the microservice compiles with go vet ./... from the project root.
service.goThe previous step generated a placeholder sink handler func (svc *Service) OnMyEvent(...) in service.go, with its signature (the source event's signature, complex types referenced through the source api package) and godoc projected from definition.go, tagged // MARKER: OnMyEvent and holding a // TODO body. Fill in that body; leave the generated signature and godoc as they are. Add imports for any packages the body references that are not already present.
Skip this step if instructed to be "quick" or to skip tests.
The boilerplate generator created a placeholder test function TestMyService_OnMyEvent in service_test.go, tagged with a // MARKER: OnMyEvent comment and a HINT block. Add one or more test cases at the bottom of that function, following the pattern shown in its HINT comment. Do not remove the HINT comment.
Follow the housekeeping skill.