skills/agha-actor-model/SKILL.md
Foundational concurrent computation model where actors communicate exclusively through asynchronous message passing
npx skillsauth add curiositech/windags-skills agha-actor-modelInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
IF task has sequential dependencies:
├─ Use customer pattern: create child with reply address
├─ Pass customer address to child as parameter
└─ Child sends result directly to customer (not parent)
IF task requires long computation:
├─ Create insensitive actor for computation
├─ Forward incoming messages to buffer actor
└─ Resume from buffer when computation completes
IF task needs dynamic resource allocation:
├─ Create resource manager actors on demand
├─ Pass capabilities (addresses) as message data
└─ No central registry - addresses flow through system
IF task has failure isolation requirements:
├─ Spawn supervised child actors for risky operations
├─ Supervisor detects failure via missing replies
└─ Replace failed actors without affecting others
IF composing existing agent systems:
├─ Verify interface preserves causal structure
├─ Test behavior under composition (not just isolation)
└─ Use message protocols as boundaries (not shared state)
IF coordination needed with other agents:
├─ SEND messages (don't modify local state first)
├─ Include reply address if response expected
└─ Never assume message ordering
IF local computation needed:
├─ SPECIFY replacement behavior
├─ Encapsulate new state (don't expose internals)
└─ Ensure one-message-at-a-time processing
IF dynamic scaling needed:
├─ CREATE new actors with specific behaviors
├─ Pass necessary addresses to new actors
└─ No shared initialization state
Detection: If you see one actor routing all messages or holding all system state Symptoms: Single point of failure, bottleneck under load, infinite regression problem Fix: Decompose into community of actors, each knowing only local context, use capability routing
Detection: If actors wait/block for responses instead of specifying replacement behavior Symptoms: Deadlock under load, hidden timing assumptions, reduced concurrency Fix: Model as request-reply message pairs, use customer pattern for dependencies, apply insensitive actor pattern
Detection: If multiple actors read/write same data structure (even with locks) Symptoms: Race conditions, sequential bottlenecks, hidden global state Fix: Encapsulate state in single actor, use message passing for coordination, mutual exclusion is free
Detection: If testing only compares final outputs without checking interaction patterns Symptoms: Brock-Ackerman anomaly - identical outputs but different composition behavior Fix: Verify causal structure preservation, test behavior under composition, use observation equivalence
Detection: If communication graph is fixed at startup with no runtime reconfiguration Symptoms: Cannot handle open systems, no dynamic resource management, brittle under change Fix: Treat addresses as first-class data, implement capability routing, support runtime topology changes
Scenario: Agent needs to process a complex request requiring sequential subtasks A → B → C, but must remain responsive to other messages.
Novice Approach:
receive request →
block while calling subtask A
block while calling subtask B
block while calling subtask C
send final result
Expert Application of Actor Model:
receive request →
create customer_BC actor with addresses for B, C, final recipient
send subtask A request to A_processor with customer_BC as reply address
specify replacement behavior: ready for next request
customer_BC receives A result →
send result to B_processor with customer_C as reply address
customer_C receives B result →
send result to C_processor with final_recipient as reply address
Key Decisions Made:
Scenario: System needs to handle agent failures without cascading to whole system.
Novice Approach: Try-catch around agent calls, restart everything on failure.
Expert Application:
supervisor creates worker_actor →
sends task to worker with reply timeout
specifies replacement: "waiting_for_reply"
IF reply received within timeout →
forward result to client
specify replacement: "ready"
IF timeout expires →
create new worker_actor (old one failed)
resend task to new worker
specify replacement: "waiting_for_reply"
Trade-offs Navigated:
This skill should NOT be used for:
Delegate to other skills when:
Common misconceptions about scope:
tools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.