$npx -y skills add muratcankoylan/Agent-Skills-for-Context-Engineering --skill bdi-mental-statesThis skill should be used when modeling agent mental states with BDI concepts: beliefs, desires, intentions, RDF-to-belief transformations, rational agency traces, cognitive agents, BDI ontologies, and neuro-symbolic AI integration.
| 1 | # BDI Mental State Modeling |
| 2 | |
| 3 | Transform external RDF context into agent mental states (beliefs, desires, intentions) using formal BDI ontology patterns. This skill enables agents to reason about context through cognitive architecture, supporting deliberative reasoning, explainability, and semantic interoperability within multi-agent systems. |
| 4 | |
| 5 | ## When to Activate |
| 6 | |
| 7 | Activate this skill when: |
| 8 | - Processing external RDF context into agent beliefs about world states |
| 9 | - Modeling rational agency with perception, deliberation, and action cycles |
| 10 | - Enabling explainability through traceable reasoning chains |
| 11 | - Implementing BDI frameworks (SEMAS, JADE, JADEX) |
| 12 | - Augmenting LLMs with formal cognitive structures (Logic Augmented Generation) |
| 13 | - Coordinating mental states across multi-agent platforms |
| 14 | - Tracking temporal evolution of beliefs, desires, and intentions |
| 15 | - Linking motivational states to action plans |
| 16 | |
| 17 | Do not activate this skill for adjacent work owned by other skills: |
| 18 | - General context-window explanations or attention mechanics: `context-fundamentals`. |
| 19 | - Persistent user, entity, or conversation memory without formal BDI state: `memory-systems`. |
| 20 | - Supervisor, swarm, or handoff topology decisions: `multi-agent-patterns`. |
| 21 | - General agent evaluation rubrics or quality gates: `evaluation`. |
| 22 | |
| 23 | ## Core Concepts |
| 24 | |
| 25 | ### Mental Reality Architecture |
| 26 | |
| 27 | Separate mental states into two ontological categories because BDI reasoning requires distinguishing what persists from what happens: |
| 28 | |
| 29 | **Mental States (Endurants)** -- model these as persistent cognitive attributes that hold over time intervals: |
| 30 | - `Belief`: Represent what the agent holds true about the world. Ground every belief in a world state reference. |
| 31 | - `Desire`: Represent what the agent wishes to bring about. Link each desire back to the beliefs that motivate it. |
| 32 | - `Intention`: Represent what the agent commits to achieving. An intention must fulfil a desire and specify a plan. |
| 33 | |
| 34 | **Mental Processes (Perdurants)** -- model these as events that create or modify mental states, because tracking causal transitions enables explainability: |
| 35 | - `BeliefProcess`: Triggers belief formation/update from perception. Always connect to a generating world state. |
| 36 | - `DesireProcess`: Generates desires from existing beliefs. Preserves the motivational chain. |
| 37 | - `IntentionProcess`: Commits to selected desires as actionable intentions. |
| 38 | |
| 39 | ### Cognitive Chain Pattern |
| 40 | |
| 41 | Wire beliefs, desires, and intentions into directed chains using bidirectional properties (`motivates`/`isMotivatedBy`, `fulfils`/`isFulfilledBy`) because this enables both forward reasoning (what should the agent do?) and backward tracing (why did the agent act?): |
| 42 | |
| 43 | ```turtle |
| 44 | :Belief_store_open a bdi:Belief ; |
| 45 | rdfs:comment "Store is open" ; |
| 46 | bdi:motivates :Desire_buy_groceries . |
| 47 | |
| 48 | :Desire_buy_groceries a bdi:Desire ; |
| 49 | rdfs:comment "I desire to buy groceries" ; |
| 50 | bdi:isMotivatedBy :Belief_store_open . |
| 51 | |
| 52 | :Intention_go_shopping a bdi:Intention ; |
| 53 | rdfs:comment "I will buy groceries" ; |
| 54 | bdi:fulfils :Desire_buy_groceries ; |
| 55 | bdi:isSupportedBy :Belief_store_open ; |
| 56 | bdi:specifies :Plan_shopping . |
| 57 | ``` |
| 58 | |
| 59 | ### World State Grounding |
| 60 | |
| 61 | Always ground mental states in world state references rather than free-text descriptions, because ungrounded beliefs break semantic querying and cross-agent interoperability: |
| 62 | |
| 63 | ```turtle |
| 64 | :Agent_A a bdi:Agent ; |
| 65 | bdi:perceives :WorldState_WS1 ; |
| 66 | bdi:hasMentalState :Belief_B1 . |
| 67 | |
| 68 | :WorldState_WS1 a bdi:WorldState ; |
| 69 | rdfs:comment "Meeting scheduled at 10am in Room 5" ; |
| 70 | bdi:atTime :TimeInstant_10am . |
| 71 | |
| 72 | :Belief_B1 a bdi:Belief ; |
| 73 | bdi:refersTo :WorldState_WS1 . |
| 74 | ``` |
| 75 | |
| 76 | ### Goal-Directed Planning |
| 77 | |
| 78 | Connect intentions to plans via `bdi:specifies`, and decompose plans into ordered task sequences using `bdi:precedes`, because this separation allows plan reuse across different intentions while keeping execution order explicit: |
| 79 | |
| 80 | ```turtle |
| 81 | :Intention_I1 bdi:specifies :Plan_P1 . |
| 82 | |
| 83 | :Plan_P1 a bdi:Plan ; |
| 84 | bdi:addresses :Goal_G1 ; |
| 85 | bdi:beginsWith :Task_T1 ; |
| 86 | bdi:endsWith :Task_T3 . |
| 87 | |
| 88 | :Task_T1 bdi:precedes :Task_T2 . |
| 89 | :Task_T2 bdi:precedes :Task_T3 . |
| 90 | ``` |
| 91 | |
| 92 | ### T2B2T Paradigm |
| 93 | |
| 94 | Implement Triples-to-Beliefs-to-Triples as a bidirectional pipeline because agents must both consume external RDF context and produce new RDF assertions. Structure every T2B2T implementation in two explicit phases: |
| 95 | |
| 96 | **Phase 1: Triples-to-Beliefs** -- Translate incoming RDF triples into belief instances. Use `bdi:triggers` to connect the external world state to a `BeliefProcess`, and `bdi:generates` to produce the resulting belief. This preserves provenance from source data through to internal cognition: |
| 97 | ```turtle |
| 98 | :WorldState_notification a bdi:WorldState ; |
| 99 | rdfs:comment |