Communitygithub.com

AgentSpeak(L) BDI 架构技能

设计 AgentSpeak(L) 风格的 BDI 智能体,具备上下文守卫计划、选择函数和意图栈。适用于动态环境中的可中断自主性、智能体策略和多智能体协调。不适合简单规则引擎、静态规划器或集中式工作流。

AgentSpeak(L) BDI 架构技能 是什么?

该技能指导开发者构建 BDI(信念-愿望-意图)架构的自主智能体。它强调将信念、愿望和意图分离为不同对象,以便智能体的决策过程可审计和可解释。核心能力包括:使用上下文守卫的计划库实现行为重用,通过选择函数(事件选择器、选项选择器、意图选择器)封装策略,以及支持意图栈的挂起、恢复和中断。该技能适用于需要平衡响应性与承诺的系统,如工具调用型 LLM 智能体(处理紧急中断)或仓库多智能体协调(拥堵时动态调整作业优先级)。它适用的平台包括 Claude Code、Cursor、Codex 等智能体框架,主要优势在于防止策略与知识耦合、避免失败时系统崩溃、以及暴露意图栈用于审计。最终目标是让智能体既能响应环境变化,又能完成长期承诺。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/curiositech/windags-skills/tree/HEAD/skills/agentspeak-l-bdi-agents-speak-out-in-a-logical-computable

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

AgentSpeak(L) BDI 架构

当难点不是编写另一个工作流,而是决定自主智能体在变化条件下应如何反应、承诺、挂起工作并解释其选择时,使用此技能。

何时使用

  • 系统必须对新事件做出反应,同时不放弃长期运行的承诺。
  • 需要一个计划库,其中包含可重用的行为,这些行为根据当前上下文选择,而不是由单个控制器决定。
  • 智能体策略必须与领域知识分离,以便能在不重写计划的情况下更改紧迫性、公平性或风险承受能力。
  • 失败应触发恢复行为和重新规划,而不是导致整个智能体崩溃。
  • 需要一个可检查的心理模型,用于解释智能体为什么选择某个任务或计划而不是另一个。

不适合用于

  • 不需要持久承诺或意图栈的简单规则引擎。
  • 环境不会中断执行的静态规划问题。
  • 由一个调度器决定所有步骤的集中式工作流系统。
  • 从不分别表示信念、计划或策略的纯提示智能体循环。

核心心智模型

信念、愿望和意图是不同的对象

信念模拟当前世界,愿望定义候选结果,意图是当前正在消耗执行预算的特定承诺计划栈。如果三者合并成一个整体,智能体将无法被解释。

计划是情境化知识

AgentSpeak 计划不是通用过程。它们是事件触发的配方,带有上下文守卫,因此同一个目标可以根据智能体当前的信念调用不同的行为。

选择函数包含策略

事件选择器、选项选择器和意图选择器属于紧迫性、公平性和风险承受能力。计划应编码“怎么做”,选择函数应编码“策略”。

可中断性是特性,不是缺陷

意图是部分执行的栈,可以交错、挂起和恢复。这使得响应式智能体能够处理中断,而无需将每个长任务都变成重新开始。

从运行系统向上形式化

AgentSpeak(L) 的实践教训是从运行中的智能体循环开始,然后形式化它实际做的事情。不要编写优雅的抽象理论,然后稍后再将其近似为运行时行为。

决策点

flowchart TD
  A[需要自主行为设计] --> B{需要持久承诺?}
  B -->|否| C[使用规则、状态机或简单工作流]
  B -->|是| D{环境中断活跃工作?}
  D -->|否| E[经典规划器可能足够]
  D -->|是| F{需要策略与计划分离?}
  F -->|否| G[自定义智能体循环,但注意耦合]
  F -->|是| H[使用 AgentSpeak 风格 BDI]
  H --> I{当前问题}
  I -->|选择了错误任务| J[重新检查 SI 或 SE]
  I -->|选择了错误计划| K[重新检查 SO 或上下文守卫]
  I -->|失败导致执行终止| L[添加失败事件和恢复计划]
  I -->|难以审计| M[暴露意图栈和选择痕迹]
  • 当系统必须在响应性与承诺之间取得平衡而不是二选一时,使用 AgentSpeak 风格建模。
  • 将世界假设放入信念查询和计划守卫中,而不是作为深层嵌套在动作内部的条件语句。
  • 如果策略发生变化但领域知识不变,优先更改选择函数而不是重写计划。
  • 将长任务分解为子目标,以便意图栈保持可检查和可中断。

失败模式

目标-意图混淆

线索:设计声称智能体“有一个目标”,但无法显示它是否真正为这个目标提交了资源。

修复:将候选目标与当前活跃的意图栈分开表示。

策略隐藏在计划中

线索:每个计划体都包含优先级、公平性或紧迫性分支。

修复:将这些选择移动到事件、选项或意图选择函数中。

巨型计划

线索:计划太长,任何中断都迫使整个序列在心理上重新启动。

修复:将长行为拆分为较短的、带有显式子目标边界的计划。

失败作为崩溃而不是事件

线索:失败的子目标中止整个智能体或无声消失。

修复:将失败建模为可以触发恢复、重试或放弃计划的事件。

无依据的上下文守卫

线索:计划匹配基于模糊的世界假设,这些假设从未与实际信念或观察绑定。

修复:使信念更新路径明确,并确保守卫可对照当前信念状态查询。

工作示例

带有紧急中断的工具调用型 LLM 智能体

一个编码智能体正在执行长时间的重构任务,突然收到一个高严重级别的生产告警。将重构任务建模为一个意图栈,将告警建模为一个新事件。让选择函数抢占重构任务,稍后在不丢失状态的情况下恢复它。

无中央调度器的仓库协调

多个移动智能体共享关于通道拥堵和库存状态的信念基础。它们的领域知识保留在计划中,而选择函数编码哪些紧急取货作业在拥堵情况下优先于补货工作。

质量关卡

  • 信念、愿望和意图被分开表示。
  • 每个主要触发事件至少有一个带有显式上下文守卫的计划。
  • 设计明确指出 SE、SO 和 SI 策略所在的位置。
  • 失败路径创建事件或恢复计划,而不是无声崩溃。
  • 审查者可以检查活跃意图并解释为什么选中一个计划而不是另一个。

行话测试

  • 如果某人无法解释智能体“想要”的目标与它“承诺”的意图之间的区别,那么他们就还没有内化这个模型。
  • 如果“策略”变化需要重写计划体,说明策略和知识从未分离。
  • 如果智能体无法说出是什么中断了它以及下一步将恢复什么,那么它并没有真正使用意图栈。

参考索引

  • references/bdi-architecture-for-agent-orchestration.md:加载以获取完整的智能体循环和 B/D/I 交互。
  • references/context-sensitive-plans-as-agent-knowledge.md:当计划结构和守卫设计是主要问题时加载。
  • references/selection-functions-as-agent-policy.md:当优先级、公平性或风险承受能力需要显式策略处理时加载。
  • references/intention-management-and-goal-decomposition.md:当暂停/恢复、子目标或意图可审计性是核心问题时加载。
  • references/failure-modes-in-bdi-systems.md:当已存在的设计出现故障并需要调试时加载。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

curiositech/windags-skills

Expert in 2000s-era music visualization (Milkdrop, AVS, Geiss) and modern WebGL implementations. Specializes in Butterchurn integration, Web Audio API AnalyserNode FFT data, GLSL shaders for audio-reactive visuals, and psychedelic generative art. Activate on "Milkdrop", "music visualization", "WebGL visualizer", "Butterchurn", "audio reactive", "FFT visualization", "spectrum analyzer". NOT for simple bar charts/waveforms (use basic canvas), video editing, or non-audio visuals.

curiositech/windags-skills

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape.

curiositech/windags-skills

Expert in 3D computer vision labeling tools, workflows, and AI-assisted annotation for LiDAR, point clouds, and sensor fusion. Covers SAM4D/Point-SAM, human-in-the-loop architectures, and vertical-specific training strategies. Activate on '3D labeling', 'point cloud annotation', 'LiDAR labeling', 'SAM 3D', 'SAM4D', 'sensor fusion annotation', '3D bounding box', 'semantic segmentation point cloud'. NOT for 2D image labeling (use clip-aware-embeddings), general ML training (use ml-engineer), video annotation without 3D (use computer-vision-pipeline), or VLM prompt engineering (use prompt-engineer).

curiositech/windags-skills

Implement WCAG 2.2 AA/AAA compliance with automated testing, keyboard navigation, screen reader support, and focus management. Activate on: accessibility audit, WCAG compliance, keyboard navigation, screen reader, aria attributes, axe-core, focus trap. NOT for: design-level accessibility review (use design-accessibility-auditor), color contrast only (use css-in-js-architect).

curiositech/windags-skills

Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that actually work for neurodivergent minds.

curiositech/windags-skills

Designs digital experiences for ADHD brains using neuroscience research and UX principles. Expert in reducing cognitive load, time blindness solutions, dopamine-driven engagement, and compassionate design patterns. Activate on 'ADHD design', 'cognitive load', 'accessibility', 'neurodivergent UX', 'time blindness', 'dopamine-driven', 'executive function'. NOT for general accessibility (WCAG only), neurotypical UX design, or simple UI styling without ADHD context.

curiositech/windags-skills

>- Apply crisis decision-making research to agent routing, uncertainty triage, and coordination failure analysis in time-pressured systems. Use when diagnosing handoff failures, analytical paralysis, or expert judgment under incomplete information. NOT for routine coding, simple CRUD design, or static single-agent tasks with complete information.

curiositech/windags-skills

Extend and modify the admin dashboard, developer portal, and operations console. Use when adding new admin tabs, metrics, monitoring features, or internal tools. Activates for dashboard development, analytics, user management, and internal tooling.

curiositech/windags-skills

Conversation patterns and interaction protocols for multi-agent systems. Covers request/response, pub/sub, blackboard, delegation chains, debate, critique, consensus, fan-out/fan-in, supervisor-worker, and peer negotiation. Deep analysis of AutoGen conversation patterns, CrewAI delegation, LangGraph state passing, and FIPA-ACL performatives. Teaches how to design what agents say to each other and in what order. Activate on: "agent conversation", "agent protocol", "multi-agent debate", "agent delegation", "supervisor worker pattern", "agent voting", "consensus protocol", "fan-out fan-in", "agent negotiation", "blackboard pattern", "agent dialogue", "conversation topology", "agent handoff". NOT for: wire format or serialization (use agent-interchange-formats), orchestration infrastructure (use agentic-infrastructure-2026), single agent behavior (use agentic-patterns).

curiositech/windags-skills

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use language-specific skills), or infrastructure setup (use deployment-engineer).

curiositech/windags-skills

AI-powered calendar management and agent-based scheduling coordination. Covers calendar APIs (Google Calendar, CalDAV/iCal), AI scheduling assistants (Reclaim, Clockwise, Motion, Cal.com), building custom calendar agents with MCP, multi-calendar merging, timezone management, focus block protection, meeting fatigue detection, and agent-to-agent meeting negotiation protocols. Activate on: "calendar agent", "AI scheduling", "calendar coordination", "meeting scheduling", "calendar API", "focus time protection", "calendar optimization", "Google Calendar MCP", "Reclaim", "Clockwise", "Motion", "Cal.com", "smart scheduling", "calendar-aware agent", "timezone scheduling", "agent negotiation meetings". NOT for: manual calendar UI component design (use form-validation-architect), project management scheduling or Gantt charts (use project-management-guru-adhd), general time-tracking or pomodoro apps (use adhd-daily-planner for time-awareness), building the agent itself from scratch (use agent-creator).

curiositech/windags-skills

Build and adopt production AI agent infrastructure in 2026. Covers framework selection (LangGraph, CrewAI, AutoGen, MCP), orchestration patterns, evaluation, observability, memory systems, and tool use. Also covers the SOCIAL dimension: how to sell agent infrastructure internally, change management, measuring ROI, building trust in autonomous systems, and scaling adoption across teams. Activate on: "agent infrastructure", "agent framework comparison", "which agent framework", "sell AI tools internally", "agent adoption", "agent observability", "agent evaluation", "MCP architecture", "agentic mesh", "enterprise AI agents", "AI change management", "agent ROI". NOT for: building specific agents (use ai-engineer), designing agent behavior patterns (use agentic-patterns), prompt tuning (use prompt-engineer).

curiositech/windags-skills

Fundamental patterns for effective agentic behavior. Teaches decomposition, tool orchestration, error recovery, context management, quality self-assessment, and knowing when to stop. Model-agnostic principles that make any agent more effective regardless of domain. Activate on: "how should I structure this agent", "agentic workflow", "agent patterns", "multi-step task", "tool orchestration", "/agentic-patterns", "decompose this", "agent best practices", "chain of actions", "when should the agent stop", "agent loop design". NOT for: creating agent infrastructure (use agent-creator), building DAGs (use windags-architect), specific tool implementation.

curiositech/windags-skills

Automated discovery and matching of agent skills for dynamic task routing and capability assessment

curiositech/windags-skills

Cryptographic security for agentic systems — zero-trust agent networking, signed message envelopes (JWS/JWE), capability-based security (ocaps), Merkle tree audit trails, WASM sandboxing, and formal verification. Covers CLI dev tool security, mTLS between agents, permission boundaries (least privilege for AI agents), and supply chain security for skills/plugins. Activate on: "agent security", "zero trust agents", "secure agent communication", "capability-based security", "ocap", "signed messages between agents", "agent audit trail", "sandbox agent execution", "agent permissions", "mTLS agents", "cryptographic verification", "agent supply chain", "OWASP agentic", "prove agent did X", "tamper-proof agent logs". NOT for: application-level SAST scanning (use security-auditor), network firewall rules (use infrastructure), SOC2/HIPAA compliance (organizational), or prompt injection defense (use prompt-engineer).

curiositech/windags-skills

Data structures and serialization formats for agent-to-agent communication. Covers message envelopes, structured output schemas, capability declarations, task handoff payloads, error/retry signaling, and context windows as data structures. Deep comparison of A2A protocol, MCP, OpenAI function calling, and LangChain message types. Teaches when to use rigid schemas vs free-form with validation, typed vs untyped, streaming vs batch. Activate on: "agent message format", "agent communication schema", "agent-to-agent protocol", "A2A protocol", "MCP message format", "structured output for agents", "agent interop", "interchange format", "agent serialization", "task handoff format", "capability declaration". NOT for: what agents say to each other (use agent-conversation-protocols), orchestration topology (use multi-agent-coordination), building agent infrastructure (use agentic-infrastructure-2026).

curiositech/windags-skills

Logic-based agent programming language implementing BDI architecture for practical autonomous agent development

curiositech/windags-skills

Foundational concurrent computation model where actors communicate exclusively through asynchronous message passing

curiositech/windags-skills

Build production-ready LLM applications, advanced RAG systems, and intelligent agents. Implements vector search, multimodal AI, agent orchestration, and enterprise AI integrations. Use PROACTIVELY for LLM features, chatbots, AI agents, or AI-powered applications.

curiositech/windags-skills

license: Apache-2.0 NOT for unrelated tasks outside this domain.

相关技能