add-event
Skill14 starsChanged 8 months agoMITView on GitHub
Add a new event type that flows from the LLM session through to client subscribers. Covers firing the event from ManagedSession, persisting to CMS, and filtering in PilotSwarmSession.on().
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Use dot-separated names: category.action (e.g., assistant.message, tool.execution_start).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add a New Event Type
Events flow from the Copilot SDK through ManagedSession, get persisted to CMS, and are delivered to client subscribers.
Steps
- Fire the event from
ManagedSessioninsrc/managed-session.ts:- Events are captured via the
onEventcallback passed torunTurn(). - Inside the
copilotSession.on()handler, events are captured asCapturedEventobjects:const captured: CapturedEvent = { eventType: "my.event_type", data: eventData, }; collectedEvents.push(captured); opts?.onEvent?.(captured);
- Events are captured via the
- Persist to CMS — events are automatically persisted by the activity in
src/session-proxy.tsvia theonEventcallback, which callscatalog.recordEvents(). No changes needed unless you want special handling. - Filter in
PilotSwarmSession.on()— if the event needs special client-side filtering (e.g., excluding ephemeral events from persistence), add logic insrc/client.ts:session.on("my.event_type", (event) => { ... }); - Add a test — verify the event appears in
session.getMessages()and/or viasession.on()polling.
Event naming conventions
- Use dot-separated names:
category.action(e.g.,assistant.message,tool.execution_start). - Ephemeral events (like
assistant.message_delta) should NOT be persisted to CMS — they are filtered out insession-proxy.ts.
Event flow
CopilotSession.on(event) ← Copilot SDK fires event
↓
ManagedSession captures as CapturedEvent
↓
onEvent callback → session-proxy.ts → catalog.recordEvents() ← persisted to CMS
↓
PilotSwarmSession.on() polls CMS → delivers to client subscribersKey files
- src/managed-session.ts — event capture during
runTurn() - src/session-proxy.ts — event persistence to CMS
- src/cms.ts —
recordEvents()andgetSessionEvents() - src/client.ts —
PilotSwarmSession.on()polling and dispatch
In this repository50 other files it gives its agents.
- packages/sdk/examples/repo-workspaces/seed/home/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-repair-loopSkill
- duroxide-orchestration-versioningSkill
- editorial-standardsSkill
- finance-research-standardsSkill
- valuation-methodsSkill
- pilotswarm-architectureSkill
- deployment-safetySkill
- incident-responseSkill
- add-activitySkill
- add-testSkill
- add-toolSkill
- agent-versioningSkill
- azure-ps-test-runner-vmSkill
- debug-orchestrationSkill
- debug-testSkill
- horizondb-idiosyncrasiesSkill
- horizon-facts-eval-sweepSkill
- investigate-duroxide-runtimeSkill
- pilotswarm-aks-deploySkill
- pilotswarm-aks-resetSkill
- pilotswarm-new-env-deploySkill
- pilotswarm-perfSkill
- pilotswarm-portal-app-regSkill
- pilotswarm-portal-auth-assignmentsSkill
- pilotswarm-releaseSkill
- pilotswarm-tuiSkill
- pilotswarm-vpn-client-profileSkill
- schema-migrationSkill
- notesSkill
- share-a-fileSkill
- cost-latency-analysisSkill
- graph-debugSkill
- orchestration-session-lifecycleSkill
- resourcemgrSkill
- sweeperSkill
- canvas-appsSkill
- html-visualsSkill
- pilotswarm-agent-versioningSkill
- pilotswarm-aks-identitySkill
- pilotswarm-azure-deployerSkill
- pilotswarm-azure-lessonsSkill
- pilotswarm-cli-builderSkill
- pilotswarm-duroxide-versioningSkill
- pilotswarm-hybrid-datastoreSkill
- pilotswarm-knowledge-harvesterSkill
- pilotswarm-portal-builderSkill
- pilotswarm-sdk-builderSkill
- pilotswarm-three-tierSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

