add-activity
Skill4 starsChanged 9 months agoMITView on GitHub
Add a new duroxide activity to the runtime. Activities are the durable boundary between the orchestration and session management — they dispatch to ManagedSession or SessionManager methods.
In this repository22 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- duroxide-orchestration-versioningSkill
- add-eventSkill
- 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
The file
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 44
Use ctx.scheduleActivityOnSession() (not ctx.scheduleActivity()) to maintain session affinity.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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 Activity
Activities are the durable boundary between the orchestration generator and the session layer. They must only accept and return serializable data.
Steps
- Define the activity function in
src/session-proxy.tsinsideregisterActivities():runtime.registerActivity("myActivity", async (ctx: any, input: any) => { const { sessionId, ...args } = input; const session = await sessionManager.getOrCreate(sessionId, args.config); const result = await session.myMethod(args); return result; }); - Create a proxy function in
createSessionProxy()(session-scoped) orcreateSessionManagerProxy()(manager-scoped):myActivity: (args: any) => { return ctx.scheduleActivityOnSession( "myActivity", { sessionId, ...args }, affinityKey, ); } - Call it from the orchestration in
src/orchestration.ts:const result = yield session.myActivity(args); - Add tests in
test/sdk.test.js.
Key constraints
- Activities must only accept and return serializable data (no functions, no class instances).
- Activity functions should be thin — delegate business logic to
ManagedSessionorSessionManager. - Use
ctx.scheduleActivityOnSession()(notctx.scheduleActivity()) to maintain session affinity. - The
affinityKeyensures the activity runs on the same worker that holds the in-memory session.
Key files
- src/session-proxy.ts — activity definitions and proxy factories
- src/orchestration.ts — orchestration generator function
- src/types.ts — type definitions for activity inputs/outputs
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

