skills/eft-cot-multi-agent-chain-of-thought-framework/SKILL.md
Build multi-agent emotion-focused therapy (EFT) reasoning pipelines for empathetic mental health Q&A systems. Uses a bottom-up three-stage chain-of-thought: Embodied Perception, Cognitive Exploration, and Narrative Intervention with eight specialized agents. Trigger phrases: 'build an EFT chatbot', 'emotion-focused therapy agent', 'empathetic counseling system', 'multi-agent mental health pipeline', 'somatic-aware therapy bot', 'EFT-CoT reasoning chain'.
npx skillsauth add ndpvt-web/arxiv-claude-skills eft-cot-multi-agent-chain-of-thought-frameworkInstall 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.
This skill enables Claude to design and implement multi-agent systems that process mental health queries using Emotion-Focused Therapy (EFT) principles. Unlike CBT-based approaches that apply top-down rational restructuring ("your thought is distorted, replace it"), EFT-CoT follows a bottom-up trajectory: first grounding in the client's bodily and emotional experience, then exploring cognitive patterns, and finally restructuring through narrative. The framework decomposes this into eight specialized agents operating across three stages, producing chain-of-thought reasoning that is both interpretable and deeply empathetic.
Bottom-Up vs. Top-Down Therapy Reasoning. Most LLM-based mental health systems use Cognitive Behavioral Therapy (CBT), which works top-down: identify a distorted thought, challenge it rationally, replace it. This often feels dismissive because it skips the client's felt, embodied experience. EFT-CoT reverses this. It starts from the body (somatic sensations, primary emotions), moves through cognitive exploration (what beliefs and emotion schemes underlie the feeling), and only then constructs a narrative intervention. This mirrors how emotions actually form: sensation precedes cognition, and cognition precedes narrative meaning-making.
Eight Specialized Agents Across Three Stages. The framework partitions the therapeutic reasoning into discrete, auditable steps handled by purpose-built agents. Stage 1 (Embodied Perception) uses agents for somatic awareness mapping (detecting body-referenced language like "my chest feels tight") and adaptive emotion assessment (classifying primary vs. secondary vs. instrumental emotions). Stage 2 (Cognitive Exploration) deploys agents for emotion scheme analysis, core belief extraction, and maladaptive pattern identification. Stage 3 (Narrative Intervention) uses agents for narrative restructuring, adaptive coping generation, and response synthesis. Each agent produces structured intermediate output that feeds the next, creating an interpretable chain-of-thought.
Chain-of-Thought Distillation. The EFT-Instruct methodology shows how to build training data: take authentic mental health texts, run them through the multi-agent pipeline to generate step-by-step reasoning traces, then use those traces to fine-tune a single model that internalizes the multi-agent reasoning. This lets you deploy a single model that reasons as if it had eight agents, reducing inference cost while preserving reasoning depth.
Parse the input for emotional content. Extract the user's stated problem, any emotion words (explicit: "I feel anxious"; implicit: "I can't breathe when I think about it"), and situational context. Separate the presenting complaint from embedded emotional signals.
Run Somatic Awareness Mapping (Agent 1). Scan the input for body-referenced language: physical sensations ("tightness in my chest," "stomach in knots," "can't stop shaking"), somatic metaphors ("drowning," "weight on my shoulders"), and autonomic markers (sleep disruption, appetite changes). Output a structured somatic map:
{
"somatic_signals": ["chest tightness", "shallow breathing"],
"somatic_metaphors": ["feels like drowning"],
"autonomic_markers": ["insomnia", "loss of appetite"]
}
Run Adaptive Emotion Assessment (Agent 2). Classify the emotions detected into EFT categories:
Run Emotion Scheme Analysis (Agent 3). Identify the underlying emotion schemes -- the learned patterns connecting situations, bodily sensations, cognitions, and action tendencies. For example: "When criticized (situation) -> chest tightens (body) -> I'm not good enough (cognition) -> withdraw (action)."
Run Core Belief Extraction (Agent 4). From the emotion schemes, extract the core beliefs driving the maladaptive patterns. These are typically absolute statements: "I am unlovable," "The world is unsafe," "I must be perfect to be accepted." Distinguish between beliefs the client states explicitly and those inferred from patterns.
Run Maladaptive Pattern Identification (Agent 5). Map how the core beliefs, emotion schemes, and somatic responses form self-reinforcing cycles. Identify the specific avoidance strategies, emotional suppression patterns, or repetitive interpersonal scripts the client is stuck in.
Run Narrative Restructuring (Agent 6). Construct an alternative narrative that: (a) validates the primary emotion ("It makes sense that you feel this way"), (b) names the somatic experience ("That tightness you feel is your body's alarm system"), (c) gently reframes the core belief through the emotional experience rather than through logic alone, and (d) connects to the client's own stated values or desires.
Run Adaptive Coping Generation (Agent 7). Generate concrete, emotion-informed coping strategies that address the specific somatic, emotional, and cognitive patterns identified. These should be grounded in EFT techniques: emotion naming, somatic grounding exercises, empty-chair adaptations, or compassionate self-talk scripts tied to the identified core beliefs.
Run Response Synthesis (Agent 8). Compose the final response by weaving together outputs from all agents into a coherent, warm, professional therapeutic reply. The response must: lead with empathic attunement (reflecting the felt experience), include psychoeducation where appropriate, offer the narrative reframe, and close with actionable next steps. Maintain appropriate boundaries (not diagnosing, encouraging professional help for severe cases).
Validate the chain-of-thought. Review the full reasoning trace for: (a) logical consistency across stages, (b) no premature cognitive restructuring before embodied acknowledgment, (c) empathy depth (does the response feel like it truly heard the person?), and (d) appropriate safety guardrails (suicide risk screening, crisis resource provision if indicated).
Example 1: Building an EFT-CoT Pipeline in Python
User: "I want to build a mental health chatbot that uses emotion-focused therapy instead of CBT. Can you help me design the multi-agent pipeline?"
Approach:
Output:
from dataclasses import dataclass, field
from enum import Enum
class EmotionType(Enum):
PRIMARY_ADAPTIVE = "primary_adaptive"
PRIMARY_MALADAPTIVE = "primary_maladaptive"
SECONDARY = "secondary"
INSTRUMENTAL = "instrumental"
@dataclass
class SomaticMap:
signals: list[str] # "chest tightness", "jaw clenching"
metaphors: list[str] # "drowning", "walls closing in"
autonomic: list[str] # "insomnia", "nausea"
@dataclass
class EmotionAssessment:
emotions: dict[str, EmotionType] # emotion_name -> category
primary_target: str # the core emotion to process
evidence: dict[str, str] # emotion -> textual evidence
@dataclass
class EmotionScheme:
trigger: str # "being criticized"
body_response: str # "chest tightens, breathing shallows"
cognition: str # "I'm not good enough"
action_tendency: str # "withdraw and isolate"
@dataclass
class CoreBelief:
belief: str # "I am fundamentally flawed"
source: str # "explicit" or "inferred"
supporting_schemes: list[str]
@dataclass
class EFTChainOfThought:
"""Complete reasoning trace from all eight agents."""
somatic_map: SomaticMap
emotion_assessment: EmotionAssessment
emotion_schemes: list[EmotionScheme]
core_beliefs: list[CoreBelief]
maladaptive_cycles: list[str]
narrative_reframe: str
coping_strategies: list[str]
final_response: str
# Agent base with LLM call
class EFTAgent:
def __init__(self, role: str, system_prompt: str, llm_client):
self.role = role
self.system_prompt = system_prompt
self.llm = llm_client
def run(self, context: dict) -> dict:
prompt = self._build_prompt(context)
return self.llm.chat(self.system_prompt, prompt, response_format="json")
def _build_prompt(self, context: dict) -> str:
raise NotImplementedError
# Stage 1: Embodied Perception
class SomaticAwarenessAgent(EFTAgent):
def _build_prompt(self, context):
return (
f"Analyze this text for body-referenced language, somatic "
f"metaphors, and autonomic markers.\n\n"
f"Client text: {context['user_input']}\n\n"
f"Return JSON with keys: signals, metaphors, autonomic"
)
class AdaptiveAssessmentAgent(EFTAgent):
def _build_prompt(self, context):
return (
f"Classify emotions in this text into EFT categories: "
f"primary_adaptive, primary_maladaptive, secondary, instrumental.\n\n"
f"Client text: {context['user_input']}\n"
f"Somatic map: {context['somatic_map']}\n\n"
f"Identify which emotion is the primary target for processing."
)
# Pipeline orchestrator
class EFTCoTPipeline:
def __init__(self, llm_client):
self.agents = {
"somatic": SomaticAwarenessAgent("somatic", SOMATIC_PROMPT, llm_client),
"assessment": AdaptiveAssessmentAgent("assessment", ASSESS_PROMPT, llm_client),
# ... remaining 6 agents follow the same pattern
}
self.stage_order = [
["somatic", "assessment"], # Stage 1: Embodied Perception
["schemes", "beliefs", "patterns"], # Stage 2: Cognitive Exploration
["narrative", "coping", "synthesis"], # Stage 3: Narrative Intervention
]
def run(self, user_input: str) -> EFTChainOfThought:
context = {"user_input": user_input}
for stage in self.stage_order:
for agent_name in stage:
result = self.agents[agent_name].run(context)
context[agent_name] = result
return self._build_cot(context)
Example 2: Designing EFT-Instruct Training Data Pipeline
User: "I have 50,000 mental health forum posts. How do I create an EFT-Instruct dataset to fine-tune a model?"
Approach:
Output:
# EFT-Instruct dataset generation
def generate_eft_instruct(posts: list[str], pipeline: EFTCoTPipeline) -> list[dict]:
dataset = []
for post in posts:
cot = pipeline.run(post)
example = {
"instruction": (
"You are an emotion-focused therapy counselor. "
"Respond to the following with empathy and therapeutic depth."
),
"input": post,
"chain_of_thought": {
"stage_1_embodied_perception": {
"somatic_map": cot.somatic_map.__dict__,
"emotion_assessment": cot.emotion_assessment.__dict__,
},
"stage_2_cognitive_exploration": {
"emotion_schemes": [s.__dict__ for s in cot.emotion_schemes],
"core_beliefs": [b.__dict__ for b in cot.core_beliefs],
"maladaptive_cycles": cot.maladaptive_cycles,
},
"stage_3_narrative_intervention": {
"narrative_reframe": cot.narrative_reframe,
"coping_strategies": cot.coping_strategies,
},
},
"output": cot.final_response,
}
dataset.append(example)
return dataset
# Quality filter: discard traces with empty somatic maps or missing beliefs
def quality_filter(dataset):
return [
ex for ex in dataset
if len(ex["chain_of_thought"]["stage_1_embodied_perception"]["somatic_map"]["signals"]) > 0
and len(ex["chain_of_thought"]["stage_2_cognitive_exploration"]["core_beliefs"]) > 0
]
Example 3: Single-Model Inference with Internalized EFT-CoT
User: "I've already fine-tuned my model on EFT-Instruct data. How should I prompt it at inference time to get the full chain-of-thought?"
Approach:
Output:
EFT_INFERENCE_PROMPT = """You are an emotion-focused therapy counselor. Analyze the client's
message using bottom-up EFT reasoning, then respond.
## Stage 1: Embodied Perception
- Somatic signals: [identify body-referenced language]
- Emotion classification: [primary adaptive/maladaptive, secondary, instrumental]
## Stage 2: Cognitive Exploration
- Emotion schemes: [trigger -> body -> cognition -> action patterns]
- Core beliefs: [underlying absolute beliefs]
- Maladaptive cycles: [self-reinforcing patterns]
## Stage 3: Narrative Intervention
- Validation: [reflect the felt experience]
- Reframe: [emotion-grounded narrative shift]
- Coping: [concrete strategies tied to identified patterns]
## Response
[Final empathetic therapeutic response]
Client message: {user_message}"""
def eft_inference(model, user_message: str) -> dict:
prompt = EFT_INFERENCE_PROMPT.format(user_message=user_message)
raw = model.generate(prompt)
# Parse structured output into stages for audit trail
stages = parse_eft_stages(raw)
return {
"reasoning_trace": stages,
"response": stages["response"],
}
Paper: EFT-CoT: A Multi-Agent Chain-of-Thought Framework for Emotion-Focused Therapy (Du et al., 2026). Key sections: the three-stage agent architecture (Section 3), EFT-Instruct dataset construction methodology (Section 4), and ablation studies confirming that removing any agent degrades empathy and professionalism scores (Section 5).
development
Audit LLM-based automatic short answer grading (ASAG) systems for adversarial vulnerabilities using token-level and prompt-level attack strategies from the GradingAttack framework. Triggers: 'test grading robustness', 'adversarial attack on grading', 'audit LLM grader', 'red-team answer grading', 'ASAG vulnerability assessment', 'grading fairness attack'
development
Build structured information-seeking agents that decompose complex queries into multi-turn search-and-browse workflows, aggregate results from multiple web sources, and return answers in typed structured formats (items, sets, lists, tables). Applies the GISA benchmark's ReAct-based agent architecture and evaluation methodology. Trigger phrases: "build an information-seeking agent", "search agent pipeline", "multi-turn web research agent", "structured web search workflow", "aggregate information from multiple sources", "web research with structured output"
data-ai
Optimize LLM prompts using GFlowPO's iterative generate-evaluate-refine loop with diversity-preserving exploration and dynamic memory. Use when: 'optimize this prompt', 'find a better prompt for this task', 'prompt engineering with examples', 'auto-tune my system prompt', 'improve prompt accuracy', 'generate prompt variations'.
development
Constrain LLM generation with executable Pydantic schemas and multi-agent pipelines to produce structurally valid, domain-rich artifacts. Uses ontology-as-grammar to eliminate hallucinated structures while preserving creative output. Trigger phrases: "generate a valid game design", "schema-constrained generation", "build a multi-agent pipeline with Pydantic validation", "ontology-driven content generation", "structured creative generation with DSPy", "generate artifacts that pass domain validation".