skills/bdi-agent-design-mora/SKILL.md
Design patterns for BDI agents using the MORA methodology for practical multi-agent system development
npx skillsauth add curiositech/windags-skills bdi-agent-design-moraInstall 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.
Skill ID: bdi-agent-design-mora
Version: 1.0
Author: Based on "BDI Models and Systems: Reducing the Gap" by Móra, Lopes, Viccari, and Coelho
Activation Triggers: BDI architecture, agent systems, intention reasoning, belief-desire-intention, operational semantics, agent deliberation, commitment mechanisms, rational agents
Design and implement rational agent systems using the Beliefs-Desires-Intentions (BDI) paradigm with executable semantics. This skill bridges the theory-practice gap by using Extended Logic Programming with paraconsistent semantics as both formal specification AND reasoning engine.
IF building theoretical specification OR formal verification required
├─ Use axiomatic modal/temporal BDI logics (Cohen & Levesque, Rao & Georgeff)
└─ Accept theory-implementation gap
IF building executable agent system
├─ Use Extended Logic Programming with operational semantics
└─ Formal specification IS the reasoning engine
IF action completes/fails
├─ Remove completed intentions from commitment set
├─ Check if failure makes other intentions impossible
└─ Filter satisfied desires from candidate pool
IF deadline reached
├─ Remove expired intentions
├─ Re-evaluate previously delayed desires
└─ Trigger replanning for dependent actions
IF belief-intention contradiction detected
├─ IF abduction can find missing preconditions → revise beliefs
└─ IF intention truly impossible → abandon intention
IF higher-priority desire becomes feasible
├─ IF conflicts with current intentions → trigger deliberation
└─ IF compatible → adopt without disrupting commitments
IF no trigger condition met
└─ Maintain current intentions (commitment persistence)
IF representing "agent actively believes/desires X is false"
└─ Use explicit negation: ¬P
IF querying "is there evidence for X?"
└─ Use negation-by-failure: not P
IF detecting conflicts between mental states
├─ Need explicit negation for: desire(P) ∧ desire(¬P)
└─ Negation-by-failure cannot detect this contradiction
IF desires directly contradict (P ∧ ¬P)
├─ Apply priority ordering
└─ Keep higher-priority desire, remove lower
IF desires have incompatible resource requirements
├─ Use abduction to test joint feasibility
├─ IF multiple consistent subsets exist → apply maximality preference
└─ IF no consistent subset → escalate to user/higher-level goal
IF paraconsistent contradiction detected
├─ Trigger minimal revision procedure
├─ Restore consistency through preference-guided removal
└─ Use contradiction as deliberation input, not error condition
Detection: Elegant BDI specifications exist but implementation uses ad-hoc Java/Python data structures with no resemblance to specification Root Cause: Choosing specification formalisms that cannot execute Fix: Use formalisms where specification IS executable (Extended Logic Programming) or commit to mechanized modal logic with runtime theorem proving
Detection: System uses only not P for both "unknown" and "actively false"; cannot represent negative intentions like "intend NOT to interrupt user"
Root Cause: Treating negation-by-failure as sufficient for all negative information
Fix: Use explicit negation ¬P for affirmative negative knowledge; reserve not P for closed-world queries
Detection: Agent recalculates optimal intentions every cycle; never executes plans longer than one decision cycle; high CPU usage in deliberation Root Cause: No commitment mechanism; treating all desires as immediate commands Fix: Implement trigger-based revision with explicit commitment constraints; intentions persist between triggers
Detection: System enters undefined state or throws exceptions when desires conflict; requires pre-filtering desires for consistency Root Cause: Classical logic semantics where contradictions make everything provable Fix: Use paraconsistent semantics (WFSX) where contradictions are detectable signals triggering deliberation
Detection: System generates all possible consistent desire subsets then applies preference; exponential slowdown with desire set size Root Cause: Treating preference as post-processing filter rather than search guidance Fix: Integrate preference into revision procedure; guide search toward preferred revisions without enumerating all possibilities
Scenario: Household robot intends to serve_coffee but discovers coffee_maker_broken.
% Initial state
belief(coffee_maker_broken).
intention(serve_coffee).
action_precondition(serve_coffee, working_coffee_maker).
% Contradiction detection (paraconsistent semantics)
contradiction :-
intention(serve_coffee),
belief(coffee_maker_broken),
action_precondition(serve_coffee, working_coffee_maker),
not belief(working_coffee_maker).
% Abductive feasibility check
missing_precondition(X) :-
intention(A),
action_precondition(A, X),
not belief(X),
not belief(¬X).
% Revision options:
% Option 1: Abandon intention
revised_intentions_1([]) :- contradiction.
% Option 2: Abductive belief revision (find alternative)
revised_beliefs_2([belief(use_instant_coffee), belief(working_instant_dispenser)]) :-
contradiction,
alternative_action(serve_coffee, use_instant_coffee),
abducible(working_instant_dispenser).
Decision Process:
Novice Miss: Would abandon intention immediately without checking alternatives Expert Catch: Uses abduction to find feasible alternative means to same end
Scenario: Personal assistant agent with conflicting scheduling desires.
% Competing desires
desire(schedule_meeting(client_A, 2pm)).
desire(¬schedule_meeting(client_A, 2pm)). % Explicit negation - active aversion
desire(schedule_workout(2pm)).
% Priority information
priority(schedule_meeting(client_A, 2pm), 8).
priority(schedule_workout(2pm), 6).
% Resource constraints
conflicts(schedule_meeting(client_A, 2pm), schedule_workout(2pm)) :-
same_time_slot(2pm, 2pm).
% Revision procedure
deliberate_intentions(Result) :-
find_contradictions(Conflicts),
resolve_by_priority(Conflicts, Resolved),
check_resource_conflicts(Resolved, Final),
Result = Final.
% Paraconsistent detection
find_contradictions([(desire(P), desire(¬P)) | Rest]) :-
desire(P), desire(¬P),
find_contradictions(Rest).
% Priority-based resolution
resolve_by_priority([(desire(P), desire(¬P))], [desire(P)]) :-
priority(P, X), priority(¬P, Y), X > Y.
Decision Process:
Novice Miss: Would use only negation-by-failure, missing the explicit aversion Expert Catch: Recognizes explicit negative desires as different from mere absence
Scenario: Study assistant maintains focus intention despite social media desires.
% Committed intentions (established through previous deliberation)
committed_intention(study_mathematics, until(exam_complete)).
committed_intention(¬use_social_media, until(study_session_end)).
% New desires arise
desire(check_facebook).
desire(browse_instagram).
% Commitment constraint check
viable_intention(X) :-
desire(X),
\+ conflicts_with_commitment(X).
conflicts_with_commitment(X) :-
committed_intention(¬X, Until),
\+ condition_met(Until).
% No trigger conditions met
trigger_deliberation :-
(action_completed(_) ; deadline_reached(_) ; impossibility_detected(_)).
% Result: No deliberation triggered, maintain commitments
current_intentions(Result) :-
\+ trigger_deliberation,
findall(I, committed_intention(I, _), Result).
Decision Process:
Novice Miss: Would re-evaluate all desires, breaking commitment Expert Catch: Commitment means NOT reconsidering unless specific triggers fire
This skill is NOT for:
reactive-agent-patterns insteadagent-communication-protocols insteadreinforcement-learning-agents insteadreal-time-agent-scheduling insteaddistributed-agent-coordination insteadDelegate to other skills when:
goal-learning-systemsmulti-agent-planningclassical-planning-agentsanytime-reasoning-agentsdata-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.