skills/agentspeak-bdi/SKILL.md
Logic-based agent programming language implementing BDI architecture for practical autonomous agent development
npx skillsauth add curiositech/windags-skills agentspeak-bdiInstall 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.
When autonomous entities must perceive, deliberate, and act while managing competing goals and responding to events without abandoning ongoing work.
IF system needs only event-reaction with no persistent goals
→ Use reactive/rule system (BDI is overkill)
ELIF system needs planning in static environment with no interrupts
→ Use classical planner
ELIF system needs both reactivity AND goal persistence in dynamic environment
→ Use BDI architecture
| Situation | Use Function | Decision Criteria | |-----------|-------------|-------------------| | New event arrives | SE (Event Selection) | Priority, urgency, resource constraints | | Event needs plan | SO (Option Selection) | Context guards, plan success history, risk tolerance | | Multiple active intentions | SI (Intention Selection) | Deadlines, resource allocation, fairness policy | | Plan failure occurs | SO then SI | Find failure-handling plan, then reschedule intentions |
Plan P fails executing action A:
IF failure-handling plan exists for this failure type
→ Post failure event, let SO select recovery plan
→ Continue with modified intention stack
ELIF alternative plans exist for same triggering event
→ Backtrack to event, let SO try next applicable plan
→ Remove failed plan from consideration
ELIF no alternatives available
→ Propagate failure up intention stack
→ IF parent plan exists → trigger failure event at parent level
→ ELSE drop intention entirely
New belief B arrives:
IF B contradicts existing beliefs
→ Run belief revision protocol
→ Check all active intentions for context guard violations
→ IF context no longer holds → suspend intention (don't drop)
ELIF B enables new applicable plans
→ Check event queue for dormant events that now have applicable plans
→ Reprioritize using SE
ELIF B satisfies pending goal conditions
→ Mark achievement, clean up related intentions
→ Post achievement event for plan cleanup
Symptoms: Agent rapidly cycles between plans without making progress; same event triggers different plans repeatedly. Detection Rule: If the same event is processed >3 times in N execution cycles with different plan selections each time, you have plan thrashing. Root Cause: SO (option selection) function is non-deterministic or context guards are too weak/overlapping. Fix: Make SO explicitly ordered by priority; strengthen context guards to be mutually exclusive; add plan success/failure history to selection criteria.
Symptoms: Agent selects plans based on outdated world model; plans fail immediately due to false assumptions about environment. Detection Rule: If plan failure rate >50% and failures are due to context guard violations at execution time (not planning time), you have stale beliefs. Root Cause: Belief update frequency is too low relative to environment change rate; belief revision is not propagating to intention context checks. Fix: Increase perception frequency; add belief staleness timestamps; suspend intentions when their context guards become invalid.
Symptoms: Agent creates intentions that post events that create more intentions for the same goal; intention stack grows without bound. Detection Rule: If intention stack depth increases monotonically over time without corresponding goal achievements, you have intention loops. Root Cause: Plans create subgoals that eventually lead back to the original goal without termination conditions. Fix: Add achievement detection in context guards; implement intention subsumption (merge duplicate intentions); add maximum recursion depth limits.
Symptoms: Same events trigger different behaviors based on conditionals inside plan bodies; agent policy is scattered and hard to change.
Detection Rule: If plan bodies contain priority/urgency conditionals (if high_priority then X else Y), policy is in the wrong place.
Root Cause: Agent rationality is encoded in plan logic instead of selection functions.
Fix: Move all priority/policy logic to SE/SO/SI functions; make plans policy-neutral and context-sensitive only.
Symptoms: Agent cannot handle interrupts; urgent events wait while agent completes long-running tasks; no concurrency. Detection Rule: If agent has at most one active intention at any time, you have single-intention bottleneck. Root Cause: SI (intention scheduling) function is not implementing true concurrency; treating intentions as exclusive rather than concurrent. Fix: Allow multiple active intentions; implement preemptive scheduling in SI; design plans as interruptible sequences.
Scenario: Two agents (A1, A2) coordinate to achieve deliver(package, destination). Both have plans but different capabilities.
Initial State:
location(A1, warehouse), can_carry(A1, small_items), location(package, warehouse)location(A2, depot), can_carry(A2, any), has_vehicle(A2)size(package, large), destination(customer_site)Event: +!deliver(package, customer_site) posted to both agents
Decision Process:
A1 Plan Selection (SO):
+!deliver(X,Y) : can_carry(A1,small_items) & size(X,small) <- pickup(X); transport(X,Y)size(package,large) contradicts size(X,small)plan_failure(deliver, no_capability)A2 Plan Selection (SO):
+!deliver(X,Y) : can_carry(A2,any) & has_vehicle(A2) <- pickup(X); drive(X,Y); dropoff(X)[pickup(package), drive(package,customer_site), dropoff(package)]A1 Belief Update:
attempting(A2, deliver, package)+delegated(deliver, package, A2)Novice Error: Would have both agents attempt delivery, creating resource conflicts. Expert Insight: Coordination happens through belief sharing and plan context guards, not hardcoded agent knowledge.
Scenario: Agent executing long-running data processing task receives urgent security alert.
Initial State:
[process_batch(data1), process_batch(data2), generate_report()]process_batch(data1) (will take 10 more minutes)Event: +security_alert(intrusion_detected, server_3)
Decision Process:
Event Selection (SE):
security_alert selected over continuing I1Plan Selection (SO):
+security_alert(Type,Location) : has_admin_access <- isolate_system(Location); notify_team(Type)[isolate_system(server_3), notify_team(intrusion_detected)]Intention Scheduling (SI):
process_batch(data1)), I2 (new, urgent)Execution:
isolate_system(server_3) immediatelynotify_team(intrusion_detected)Resumption:
[process_batch(data1), process_batch(data2), generate_report()]process_batch(data1) from suspension pointNovice Error: Would either ignore the security alert or abandon the processing task entirely. Expert Insight: Intention suspension preserves progress while enabling responsive behavior. SI scheduling policy is explicit and configurable.
NOT FOR: Simple rule-based systems where all behavior is reactive (no persistent goals) → USE INSTEAD: Basic rule engine or event-action system
NOT FOR: Static planning problems where environment doesn't change during execution
→ USE INSTEAD: Classical planners (A*, STRIPS, HTN)
NOT FOR: Real-time systems requiring guaranteed response times or hard deadlines → USE INSTEAD: Real-time scheduling systems with timing analysis
NOT FOR: Systems where all coordination can be handled by a central controller → USE INSTEAD: Workflow orchestration or centralized task queuing
NOT FOR: Pure data transformation pipelines with no autonomous decision-making → USE INSTEAD: ETL tools, stream processing frameworks
NOT FOR: Applications requiring machine learning or statistical inference as primary capability → USE INSTEAD: ML frameworks with BDI as coordination layer if needed
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.