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-agentstools
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.