skills/agentspeak-l-bdi-agents-speak-out-in-a-logical-computable/SKILL.md
Design AgentSpeak(L)-style BDI agents with context-guarded plans, selection functions, and intention stacks. Use for interruptible autonomy, agent policy, and multi-agent orchestration in dynamic environments. NOT for simple rule engines, static planners, or centralized workflows.
npx skillsauth add curiositech/windags-skills agentspeak-l-bdi-agents-speak-out-in-a-logical-computableInstall 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.
Use this skill when the hard part is not writing another workflow, but deciding how an autonomous agent should react, commit, suspend work, and explain its choices under changing conditions.
Beliefs model the current world, desires define candidate outcomes, and intentions are the specific committed plan stacks currently consuming execution budget. If those collapse into one blob, the agent stops being interpretable.
AgentSpeak plans are not generic procedures. They are event-triggered recipes with context guards, so the same goal can invoke different behaviors depending on what the agent currently believes.
The event selector, option selector, and intention selector are where urgency, fairness, and risk tolerance belong. Plans should encode know-how; selection functions should encode strategy.
Intentions are partially executed stacks that can be interleaved, suspended, and resumed. That is what allows responsive agents to handle interrupts without turning every long task into a restart.
The practical lesson from AgentSpeak(L) is to start from an operational agent cycle and formalize what it actually does. Do not write an elegant abstract theory that has to be approximated into runtime behavior later.
flowchart TD
A[Need autonomous behavior design] --> B{Persistent commitments required?}
B -->|No| C[Use rules, state machines, or a plain workflow]
B -->|Yes| D{Environment interrupts active work?}
D -->|No| E[Classical planner may suffice]
D -->|Yes| F{Need policy separate from plans?}
F -->|No| G[Custom agent loop, but expect coupling]
F -->|Yes| H[Use AgentSpeak-style BDI]
H --> I{Current problem}
I -->|Wrong task chosen| J[Revisit SI or SE]
I -->|Wrong plan chosen| K[Revisit SO or context guards]
I -->|Failure kills execution| L[Add failure events and recovery plans]
I -->|Hard to audit| M[Expose intention stack and selection traces]
Cue: the design says the agent "has a goal" but cannot show whether it has actually committed resources to it.
Fix: represent candidate goals separately from currently active intention stacks.
Cue: every plan body contains priority, fairness, or urgency branching.
Fix: move those choices into event, option, or intention selection functions.
Cue: plans are so long that any interrupt forces the whole sequence to restart mentally.
Fix: split long behaviors into shorter plans with explicit subgoal boundaries.
Cue: a failed subgoal aborts the whole agent or silently disappears.
Fix: model failure as an event that can trigger recovery, retry, or abandonment plans.
Cue: plans match on vague world assumptions that are never tied to real beliefs or observations.
Fix: make belief update paths explicit and keep guards queryable against current belief state.
A coding agent is working through a long refactor when a high-severity production alert arrives. Model the refactor as one intention stack and the alert as a new event. Let selection functions preempt the refactor, then resume it later without losing state.
Several mobile agents share a belief base about aisle congestion and inventory state. Their domain knowledge stays in plans, while selection functions encode which urgent pick jobs outrank replenishment work under congestion.
references/bdi-architecture-for-agent-orchestration.md: load for the full agent cycle and B/D/I interplay.references/context-sensitive-plans-as-agent-knowledge.md: load when plan structure and guard design are the main issue.references/selection-functions-as-agent-policy.md: load when priority, fairness, or risk tolerance need explicit policy treatment.references/intention-management-and-goal-decomposition.md: load when suspend/resume, subgoals, or intention auditability are central.references/failure-modes-in-bdi-systems.md: load when the current design already exists and you are debugging breakdowns.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.