@clawhub-ccccl8-3ebc904127
Use when the user asks to cast, interpret, or explain an I Ching / 易经 hexagram using six-line divination, coin-style random casting, hexagram lookup, shortNa...
---
name: yijing-divination
description: Use when the user asks to cast, interpret, or explain an I Ching / 易经 hexagram using six-line divination, coin-style random casting, hexagram lookup, shortName/fullName/keywords/summary interpretation, or the bundled hexagram summary data.
---
# 易经起卦
## Core Workflow
Use the three-coin six-line method unless the user provides explicit line values.
1. Generate six lines from bottom to top.
2. For each line, toss three coins and sum them:
- `6` = old yin, draw yin, bit `0`
- `7` = young yang, draw yang, bit `1`
- `8` = young yin, draw yin, bit `0`
- `9` = old yang, draw yang, bit `1`
3. Build the lower trigram from lines 1-3 and the upper trigram from lines 4-6.
4. Create the lookup key as `upperBits-lowerBits`.
5. Read `references/hexagrams.json` and find the entry whose `key` matches.
6. Present the result in this order:
- six generated lines, bottom to top
- `shortName`
- three terms: `keywords`, `fullName`, `summary`
- a concise interpretation
## Random Casting
When actually casting, randomly choose each coin as `2` or `3` with equal probability, then sum three coins. Do not choose the final hexagram directly.
If the user supplies line values, accept either:
- six values from the set `6, 7, 8, 9`
- six yin/yang bits from bottom to top, where `0` is yin and `1` is yang
## Reference Files
- Use `references/hexagrams.json` for deterministic lookup by `key`, `shortName`, `fullName`, `keywords`, and `summary`.
- Use `references/summary.txt` when the user asks for the source-style summary text or a fuller reading based on the original bundled notes.
## Website
If the user wants an interactive visual casting experience, mention:
https://www.yijingking.com
## Output Guidance
Keep the tone reflective rather than predictive. Avoid claiming certainty about future events. Prefer phrasing such as "可理解为", "提醒你关注", "适合反思", or "this suggests".
For Chinese requests, answer in Simplified Chinese. For English requests, use the English fields in `hexagrams.json`.
## Minimal Output Shape
```text
六爻:
1. 初爻:7 少阳,阳爻
2. 二爻:8 少阴,阴爻
...
卦名:
乾
三词:
至刚至强 / 乾为天 / 为君之道
解读:
...
```
FILE:agents/openai.yaml
display_name: 易经起卦
short_description: 按六爻流程起卦并查阅卦象资料。
default_prompt: 使用易经起卦技能,为我起一卦并解释结果。
FILE:references/hexagrams.json
[
{
"order": 1,
"key": "111-111",
"lines": [
1,
1,
1,
1,
1,
1
],
"zh": {
"orderLabel": "第一卦",
"shortName": "乾",
"fullName": "乾为天",
"keywords": "至刚至强",
"summary": "为君之道"
},
"en": {
"orderLabel": "The First Hexagram",
"shortName": "Qian",
"fullName": "Heaven",
"keywords": "Ultimate Strength",
"summary": "The Way of the Ruler"
}
},
{
"order": 2,
"key": "000-000",
"lines": [
0,
0,
0,
0,
0,
0
],
"zh": {
"orderLabel": "第二卦",
"shortName": "坤",
"fullName": "坤为地",
"keywords": "至柔至顺",
"summary": "为臣之道"
},
"en": {
"orderLabel": "The Second Hexagram",
"shortName": "Kun",
"fullName": "Earth",
"keywords": "Ultimate Devotion",
"summary": "The Way of the Minister"
}
},
{
"order": 3,
"key": "010-100",
"lines": [
1,
0,
0,
0,
1,
0
],
"zh": {
"orderLabel": "第三卦",
"shortName": "屯",
"fullName": "水雷屯",
"keywords": "阴阳交动",
"summary": "万物始生"
},
"en": {
"orderLabel": "The Third Hexagram",
"shortName": "Zhun",
"fullName": "Water over Thunder",
"keywords": "Chaos and Motion",
"summary": "The Birth of All Things"
}
},
{
"order": 4,
"key": "001-010",
"lines": [
0,
1,
0,
0,
0,
1
],
"zh": {
"orderLabel": "第四卦",
"shortName": "蒙",
"fullName": "山水蒙",
"keywords": "启蒙教育",
"summary": "童蒙求我"
},
"en": {
"orderLabel": "The Fourth Hexagram",
"shortName": "Meng",
"fullName": "Mountain over Water",
"keywords": "Enlightenment",
"summary": "The Student Seeks the Master"
}
},
{
"order": 5,
"key": "010-111",
"lines": [
1,
1,
1,
0,
1,
0
],
"zh": {
"orderLabel": "第五卦",
"shortName": "需",
"fullName": "水天需",
"keywords": "凶险在前",
"summary": "君子等待"
},
"en": {
"orderLabel": "The Fifth Hexagram",
"shortName": "Xu",
"fullName": "Water over Heaven",
"keywords": "Danger Ahead",
"summary": "The Noble One Waits"
}
},
{
"order": 6,
"key": "111-010",
"lines": [
0,
1,
0,
1,
1,
1
],
"zh": {
"orderLabel": "第六卦",
"shortName": "讼",
"fullName": "天水讼",
"keywords": "争诉争讼",
"summary": "中吉终凶"
},
"en": {
"orderLabel": "The Sixth Hexagram",
"shortName": "Song",
"fullName": "Heaven over Water",
"keywords": "Conflict",
"summary": "Good Start, Bad End"
}
},
{
"order": 7,
"key": "000-010",
"lines": [
0,
1,
0,
0,
0,
0
],
"zh": {
"orderLabel": "第七卦",
"shortName": "师",
"fullName": "地水师",
"keywords": "军队战争",
"summary": "以正为要"
},
"en": {
"orderLabel": "The Seventh Hexagram",
"shortName": "Shi",
"fullName": "Earth over Water",
"keywords": "The Army",
"summary": "Justice is Key"
}
},
{
"order": 8,
"key": "010-000",
"lines": [
0,
0,
0,
0,
1,
0
],
"zh": {
"orderLabel": "第八卦",
"shortName": "比",
"fullName": "水地比",
"keywords": "择善依附",
"summary": "迟则凶险"
},
"en": {
"orderLabel": "The Eighth Hexagram",
"shortName": "Bi",
"fullName": "Water over Earth",
"keywords": "Union",
"summary": "Delay Brings Doom"
}
},
{
"order": 9,
"key": "011-111",
"lines": [
1,
1,
1,
0,
1,
1
],
"zh": {
"orderLabel": "第九卦",
"shortName": "小畜",
"fullName": "风天小畜",
"keywords": "小阻小畜",
"summary": "阴止阳也"
},
"en": {
"orderLabel": "The Ninth Hexagram",
"shortName": "Xiao Chu",
"fullName": "Wind over Heaven",
"keywords": "Minor Restraint",
"summary": "The Yin Checks the Yang"
}
},
{
"order": 10,
"key": "111-110",
"lines": [
1,
1,
0,
1,
1,
1
],
"zh": {
"orderLabel": "第十卦",
"shortName": "履",
"fullName": "天泽履",
"keywords": "践行履职",
"summary": "如履薄冰"
},
"en": {
"orderLabel": "The Tenth Hexagram",
"shortName": "Lu",
"fullName": "Heaven over Lake",
"keywords": "Conduct",
"summary": "Treading on Thin Ice"
}
},
{
"order": 11,
"key": "000-111",
"lines": [
1,
1,
1,
0,
0,
0
],
"zh": {
"orderLabel": "第十一卦",
"shortName": "泰",
"fullName": "地天泰",
"keywords": "万物亨通",
"summary": "安泰吉祥"
},
"en": {
"orderLabel": "The Eleventh Hexagram",
"shortName": "Tai",
"fullName": "Earth over Heaven",
"keywords": "Harmony",
"summary": "Peace and Prosperity"
}
},
{
"order": 12,
"key": "111-000",
"lines": [
0,
0,
0,
1,
1,
1
],
"zh": {
"orderLabel": "第十二卦",
"shortName": "否",
"fullName": "天地否",
"keywords": "天地不交",
"summary": "闭塞黑暗"
},
"en": {
"orderLabel": "The Twelfth Hexagram",
"shortName": "Pi",
"fullName": "Heaven over Earth",
"keywords": "Stagnation",
"summary": "Darkness and Blockage"
}
},
{
"order": 13,
"key": "111-101",
"lines": [
1,
0,
1,
1,
1,
1
],
"zh": {
"orderLabel": "第十三卦",
"shortName": "同人",
"fullName": "天火同人",
"keywords": "天下大同",
"summary": "利涉大川"
},
"en": {
"orderLabel": "The Thirteenth Hexagram",
"shortName": "Tong Ren",
"fullName": "Heaven over Fire",
"keywords": "Fellowship",
"summary": "Crossing the Great River"
}
},
{
"order": 14,
"key": "101-111",
"lines": [
1,
1,
1,
1,
0,
1
],
"zh": {
"orderLabel": "第十四卦",
"shortName": "大有",
"fullName": "火天大有",
"keywords": "阳光普照",
"summary": "天下富有"
},
"en": {
"orderLabel": "The Fourteenth Hexagram",
"shortName": "Da You",
"fullName": "Fire over Heaven",
"keywords": "Great Possession",
"summary": "Abundance for All"
}
},
{
"order": 15,
"key": "000-001",
"lines": [
0,
0,
1,
0,
0,
0
],
"zh": {
"orderLabel": "第十五卦",
"shortName": "谦",
"fullName": "地山谦",
"keywords": "谦虚美德",
"summary": "君子有终"
},
"en": {
"orderLabel": "The Fifteenth Hexagram",
"shortName": "Qian",
"fullName": "Earth over Mountain",
"keywords": "Modesty",
"summary": "The Noble One Prevails"
}
},
{
"order": 16,
"key": "100-000",
"lines": [
0,
0,
0,
1,
0,
0
],
"zh": {
"orderLabel": "第十六卦",
"shortName": "豫",
"fullName": "雷地豫",
"keywords": "顺时而动",
"summary": "喜悦安乐"
},
"en": {
"orderLabel": "The Sixteenth Hexagram",
"shortName": "Yu",
"fullName": "Thunder over Earth",
"keywords": "Enthusiasm",
"summary": "Joy and Delight"
}
},
{
"order": 17,
"key": "110-100",
"lines": [
1,
0,
0,
1,
1,
0
],
"zh": {
"orderLabel": "第十七卦",
"shortName": "随",
"fullName": "泽雷随",
"keywords": "追随伟人",
"summary": "随和众人"
},
"en": {
"orderLabel": "The Seventeenth Hexagram",
"shortName": "Sui",
"fullName": "Lake over Thunder",
"keywords": "Following",
"summary": "Harmony with the Crowd"
}
},
{
"order": 18,
"key": "001-011",
"lines": [
0,
1,
1,
0,
0,
1
],
"zh": {
"orderLabel": "第十八卦",
"shortName": "蛊",
"fullName": "山风蛊",
"keywords": "革除腐败",
"summary": "除旧布新"
},
"en": {
"orderLabel": "The Eighteenth Hexagram",
"shortName": "Gu",
"fullName": "Mountain over Wind",
"keywords": "Decay",
"summary": "Renewal and Repair"
}
},
{
"order": 19,
"key": "000-110",
"lines": [
1,
1,
0,
0,
0,
0
],
"zh": {
"orderLabel": "第十九卦",
"shortName": "临",
"fullName": "地泽临",
"keywords": "居高临下",
"summary": "监督教化"
},
"en": {
"orderLabel": "The Nineteenth Hexagram",
"shortName": "Lin",
"fullName": "Earth over Lake",
"keywords": "Oversight",
"summary": "Supervision and Teaching"
}
},
{
"order": 20,
"key": "011-000",
"lines": [
0,
0,
0,
0,
1,
1
],
"zh": {
"orderLabel": "第二十卦",
"shortName": "观",
"fullName": "风地观",
"keywords": "展示威严",
"summary": "仰观盛德"
},
"en": {
"orderLabel": "The Twentieth Hexagram",
"shortName": "Guan",
"fullName": "Wind over Earth",
"keywords": "Contemplation",
"summary": "Beholding Great Virtue"
}
},
{
"order": 21,
"key": "101-100",
"lines": [
1,
0,
0,
1,
0,
1
],
"zh": {
"orderLabel": "第二十一卦",
"shortName": "噬嗑",
"fullName": "火雷噬嗑",
"keywords": "刑罚咬合",
"summary": "用狱规则"
},
"en": {
"orderLabel": "The Twenty-First Hexagram",
"shortName": "Shi He",
"fullName": "Fire over Thunder",
"keywords": "Biting Through",
"summary": "The Rule of Law"
}
},
{
"order": 22,
"key": "001-101",
"lines": [
1,
0,
1,
0,
0,
1
],
"zh": {
"orderLabel": "第二十二卦",
"shortName": "贲",
"fullName": "山火贲",
"keywords": "装饰外表",
"summary": "美化形象"
},
"en": {
"orderLabel": "The Twenty-Second Hexagram",
"shortName": "Bi",
"fullName": "Mountain over Fire",
"keywords": "Grace",
"summary": "Adorning the Image"
}
},
{
"order": 23,
"key": "001-000",
"lines": [
0,
0,
0,
0,
0,
1
],
"zh": {
"orderLabel": "第二十三卦",
"shortName": "剥",
"fullName": "山地剥",
"keywords": "蚕食剥落",
"summary": "君子道消"
},
"en": {
"orderLabel": "The Twenty-Third Hexagram",
"shortName": "Bo",
"fullName": "Mountain over Earth",
"keywords": "Splitting Apart",
"summary": "The Noble Path Fades"
}
},
{
"order": 24,
"key": "000-100",
"lines": [
1,
0,
0,
0,
0,
0
],
"zh": {
"orderLabel": "第二十四卦",
"shortName": "复",
"fullName": "地雷复",
"keywords": "回复返复",
"summary": "复归复来"
},
"en": {
"orderLabel": "The Twenty-Fourth Hexagram",
"shortName": "Fu",
"fullName": "Earth over Thunder",
"keywords": "Return",
"summary": "Turning Back to the Source"
}
},
{
"order": 25,
"key": "111-100",
"lines": [
1,
0,
0,
1,
1,
1
],
"zh": {
"orderLabel": "第二十五卦",
"shortName": "无妄",
"fullName": "天雷无妄",
"keywords": "毫不虚伪",
"summary": "本该如此"
},
"en": {
"orderLabel": "The Twenty-Fifth Hexagram",
"shortName": "Wu Wang",
"fullName": "Heaven over Thunder",
"keywords": "Innocence",
"summary": "The Natural Order"
}
},
{
"order": 26,
"key": "001-111",
"lines": [
1,
1,
1,
0,
0,
1
],
"zh": {
"orderLabel": "第二十六卦",
"shortName": "大畜",
"fullName": "山天大畜",
"keywords": "大止大畜",
"summary": "大有作为"
},
"en": {
"orderLabel": "The Twenty-Sixth Hexagram",
"shortName": "Da Chu",
"fullName": "Mountain over Heaven",
"keywords": "Great Restraint",
"summary": "Great Achievement"
}
},
{
"order": 27,
"key": "001-100",
"lines": [
1,
0,
0,
0,
0,
1
],
"zh": {
"orderLabel": "第二十七卦",
"shortName": "颐",
"fullName": "山雷颐",
"keywords": "养人被养",
"summary": "正当则吉"
},
"en": {
"orderLabel": "The Twenty-Seventh Hexagram",
"shortName": "Yi",
"fullName": "Mountain over Thunder",
"keywords": "Nourishment",
"summary": "Righteousness Brings Luck"
}
},
{
"order": 28,
"key": "110-011",
"lines": [
0,
1,
1,
1,
1,
0
],
"zh": {
"orderLabel": "第二十八卦",
"shortName": "大过",
"fullName": "泽风大过",
"keywords": "大的过度",
"summary": "非常行动"
},
"en": {
"orderLabel": "The Twenty-Eighth Hexagram",
"shortName": "Da Guo",
"fullName": "Lake over Wind",
"keywords": "Great Excess",
"summary": "Extraordinary Action"
}
},
{
"order": 29,
"key": "010-010",
"lines": [
0,
1,
0,
0,
1,
0
],
"zh": {
"orderLabel": "第二十九卦",
"shortName": "坎",
"fullName": "水为坎",
"keywords": "处处陷阱",
"summary": "重重艰险"
},
"en": {
"orderLabel": "The Twenty-Ninth Hexagram",
"shortName": "Kan",
"fullName": "Water",
"keywords": "The Abyss",
"summary": "Layer upon Layer of Danger"
}
},
{
"order": 30,
"key": "101-101",
"lines": [
1,
0,
1,
1,
0,
1
],
"zh": {
"orderLabel": "第三十卦",
"shortName": "离",
"fullName": "火为离",
"keywords": "附着依附",
"summary": "光明文明"
},
"en": {
"orderLabel": "The Thirtieth Hexagram",
"shortName": "Li",
"fullName": "Fire",
"keywords": "Clinging",
"summary": "Light and Civilization"
}
},
{
"order": 31,
"key": "110-001",
"lines": [
0,
0,
1,
1,
1,
0
],
"zh": {
"orderLabel": "第三十一卦",
"shortName": "咸",
"fullName": "泽山咸",
"keywords": "男女之道",
"summary": "无心之感"
},
"en": {
"orderLabel": "The Thirty-First Hexagram",
"shortName": "Xian",
"fullName": "Lake over Mountain",
"keywords": "Attraction",
"summary": "Feeling without Intent"
}
},
{
"order": 32,
"key": "100-011",
"lines": [
0,
1,
1,
1,
0,
0
],
"zh": {
"orderLabel": "第三十二卦",
"shortName": "恒",
"fullName": "雷风恒",
"keywords": "夫妇之道",
"summary": "恒久恒长"
},
"en": {
"orderLabel": "The Thirty-Second Hexagram",
"shortName": "Heng",
"fullName": "Thunder over Wind",
"keywords": "Constancy",
"summary": "Enduring and Lasting"
}
},
{
"order": 33,
"key": "111-001",
"lines": [
0,
0,
1,
1,
1,
1
],
"zh": {
"orderLabel": "第三十三卦",
"shortName": "遁",
"fullName": "天山遁",
"keywords": "退避三舍",
"summary": "隐遁世外"
},
"en": {
"orderLabel": "The Thirty-Third Hexagram",
"shortName": "Dun",
"fullName": "Heaven over Mountain",
"keywords": "Retreat",
"summary": "Withdrawing from the World"
}
},
{
"order": 34,
"key": "100-111",
"lines": [
1,
1,
1,
1,
0,
0
],
"zh": {
"orderLabel": "第三十四卦",
"shortName": "大壮",
"fullName": "雷天大壮",
"keywords": "阳盛阴衰",
"summary": "壮大隆盛"
},
"en": {
"orderLabel": "The Thirty-Fourth Hexagram",
"shortName": "Da Zhuang",
"fullName": "Thunder over Heaven",
"keywords": "Great Power",
"summary": "Strength and Vigor"
}
},
{
"order": 35,
"key": "101-000",
"lines": [
0,
0,
0,
1,
0,
1
],
"zh": {
"orderLabel": "第三十五卦",
"shortName": "晋",
"fullName": "火地晋",
"keywords": "前进晋升",
"summary": "飞黄腾达"
},
"en": {
"orderLabel": "The Thirty-Fifth Hexagram",
"shortName": "Jin",
"fullName": "Fire over Earth",
"keywords": "Progress",
"summary": "Rising to Glory"
}
},
{
"order": 36,
"key": "000-101",
"lines": [
1,
0,
1,
0,
0,
0
],
"zh": {
"orderLabel": "第三十六卦",
"shortName": "明夷",
"fullName": "地火明夷",
"keywords": "光明负伤",
"summary": "韬光养晦"
},
"en": {
"orderLabel": "The Thirty-Sixth Hexagram",
"shortName": "Ming Yi",
"fullName": "Earth over Fire",
"keywords": "Darkened Light",
"summary": "Hiding One's Brilliance"
}
},
{
"order": 37,
"key": "011-101",
"lines": [
1,
0,
1,
0,
1,
1
],
"zh": {
"orderLabel": "第三十七卦",
"shortName": "家人",
"fullName": "风火家人",
"keywords": "家庭伦理",
"summary": "道德之本"
},
"en": {
"orderLabel": "The Thirty-Seventh Hexagram",
"shortName": "Jia Ren",
"fullName": "Wind over Fire",
"keywords": "The Family",
"summary": "The Root of Virtue"
}
},
{
"order": 38,
"key": "101-110",
"lines": [
1,
1,
0,
1,
0,
1
],
"zh": {
"orderLabel": "第三十八卦",
"shortName": "睽",
"fullName": "火泽睽",
"keywords": "离合之道",
"summary": "同异之变"
},
"en": {
"orderLabel": "The Thirty-Eighth Hexagram",
"shortName": "Kui",
"fullName": "Fire over Lake",
"keywords": "Opposition",
"summary": "Unity in Diversity"
}
},
{
"order": 39,
"key": "010-001",
"lines": [
0,
0,
1,
0,
1,
0
],
"zh": {
"orderLabel": "第三十九卦",
"shortName": "蹇",
"fullName": "水山蹇",
"keywords": "跛脚而行",
"summary": "困难重重"
},
"en": {
"orderLabel": "The Thirty-Ninth Hexagram",
"shortName": "Jian",
"fullName": "Water over Mountain",
"keywords": "Limping",
"summary": "Obstacles Everywhere"
}
},
{
"order": 40,
"key": "100-010",
"lines": [
0,
1,
0,
1,
0,
0
],
"zh": {
"orderLabel": "第四十卦",
"shortName": "解",
"fullName": "雷水解",
"keywords": "化解和解",
"summary": "解除困难"
},
"en": {
"orderLabel": "The Fortieth Hexagram",
"shortName": "Xie",
"fullName": "Thunder over Water",
"keywords": "Deliverance",
"summary": "Resolving Difficulties"
}
},
{
"order": 41,
"key": "001-110",
"lines": [
1,
1,
0,
0,
0,
1
],
"zh": {
"orderLabel": "第四十一卦",
"shortName": "损",
"fullName": "山泽损",
"keywords": "减损之道",
"summary": "损下益上"
},
"en": {
"orderLabel": "The Forty-First Hexagram",
"shortName": "Sun",
"fullName": "Mountain over Lake",
"keywords": "Decrease",
"summary": "Sacrificing the Lower"
}
},
{
"order": 42,
"key": "011-100",
"lines": [
1,
0,
0,
0,
1,
1
],
"zh": {
"orderLabel": "第四十二卦",
"shortName": "益",
"fullName": "风雷益",
"keywords": "增益之道",
"summary": "损上益下"
},
"en": {
"orderLabel": "The Forty-Second Hexagram",
"shortName": "Yi",
"fullName": "Wind over Thunder",
"keywords": "Increase",
"summary": "Benefiting the Lower"
}
},
{
"order": 43,
"key": "110-111",
"lines": [
1,
1,
1,
1,
1,
0
],
"zh": {
"orderLabel": "第四十三卦",
"shortName": "夬",
"fullName": "泽天夬",
"keywords": "断绝决裂",
"summary": "刚决柔也"
},
"en": {
"orderLabel": "The Forty-Third Hexagram",
"shortName": "Guai",
"fullName": "Lake over Heaven",
"keywords": "Breakthrough",
"summary": "The Firm Cuts the Yielding"
}
},
{
"order": 44,
"key": "111-011",
"lines": [
0,
1,
1,
1,
1,
1
],
"zh": {
"orderLabel": "第四十四卦",
"shortName": "姤",
"fullName": "天风姤",
"keywords": "邂逅相遇",
"summary": "柔遇刚也"
},
"en": {
"orderLabel": "The Forty-Fourth Hexagram",
"shortName": "Gou",
"fullName": "Heaven over Wind",
"keywords": "Encountering",
"summary": "The Yielding Meets the Firm"
}
},
{
"order": 45,
"key": "110-000",
"lines": [
0,
0,
0,
1,
1,
0
],
"zh": {
"orderLabel": "第四十五卦",
"shortName": "萃",
"fullName": "泽地萃",
"keywords": "聚集荟萃",
"summary": "无往不利"
},
"en": {
"orderLabel": "The Forty-Fifth Hexagram",
"shortName": "Cui",
"fullName": "Lake over Earth",
"keywords": "Gathering",
"summary": "Success in All Directions"
}
},
{
"order": 46,
"key": "000-011",
"lines": [
0,
1,
1,
0,
0,
0
],
"zh": {
"orderLabel": "第四十六卦",
"shortName": "升",
"fullName": "地风升",
"keywords": "积极向上",
"summary": "步步高升"
},
"en": {
"orderLabel": "The Forty-Sixth Hexagram",
"shortName": "Sheng",
"fullName": "Earth over Wind",
"keywords": "Pushing Up",
"summary": "Rising Step by Step"
}
},
{
"order": 47,
"key": "110-010",
"lines": [
0,
1,
0,
1,
1,
0
],
"zh": {
"orderLabel": "第四十七卦",
"shortName": "困",
"fullName": "泽水困",
"keywords": "深陷穷困",
"summary": "隐忍为要"
},
"en": {
"orderLabel": "The Forty-Seventh Hexagram",
"shortName": "Kun",
"fullName": "Lake over Water",
"keywords": "Oppression",
"summary": "Endurance is Key"
}
},
{
"order": 48,
"key": "010-011",
"lines": [
0,
1,
1,
0,
1,
0
],
"zh": {
"orderLabel": "第四十八卦",
"shortName": "井",
"fullName": "水风井",
"keywords": "水井养人",
"summary": "养贤用贤"
},
"en": {
"orderLabel": "The Forty-Eighth Hexagram",
"shortName": "Jing",
"fullName": "Water over Wind",
"keywords": "The Well",
"summary": "Nourishing the Worthy"
}
},
{
"order": 49,
"key": "110-101",
"lines": [
1,
0,
1,
1,
1,
0
],
"zh": {
"orderLabel": "第四十九卦",
"shortName": "革",
"fullName": "泽火革",
"keywords": "盛衰之际",
"summary": "改革变革"
},
"en": {
"orderLabel": "The Forty-Ninth Hexagram",
"shortName": "Ge",
"fullName": "Lake over Fire",
"keywords": "Revolution",
"summary": "Reform and Change"
}
},
{
"order": 50,
"key": "101-011",
"lines": [
0,
1,
1,
1,
0,
1
],
"zh": {
"orderLabel": "第五十卦",
"shortName": "鼎",
"fullName": "火风鼎",
"keywords": "养贤用贤",
"summary": "除旧布新"
},
"en": {
"orderLabel": "The Fiftieth Hexagram",
"shortName": "Ding",
"fullName": "Fire over Wind",
"keywords": "The Cauldron",
"summary": "Renewal and Stability"
}
},
{
"order": 51,
"key": "100-100",
"lines": [
1,
0,
0,
1,
0,
0
],
"zh": {
"orderLabel": "第五十一卦",
"shortName": "震",
"fullName": "震为雷",
"keywords": "震动戒惧",
"summary": "时刻反省"
},
"en": {
"orderLabel": "The Fifty-First Hexagram",
"shortName": "Zhen",
"fullName": "Thunder",
"keywords": "Shock",
"summary": "Vigilance and Reflection"
}
},
{
"order": 52,
"key": "001-001",
"lines": [
0,
0,
1,
0,
0,
1
],
"zh": {
"orderLabel": "第五十二卦",
"shortName": "艮",
"fullName": "艮为山",
"keywords": "阻止停止",
"summary": "止所当止"
},
"en": {
"orderLabel": "The Fifty-Second Hexagram",
"shortName": "Gen",
"fullName": "Mountain",
"keywords": "Keeping Still",
"summary": "Stopping at the Right Time"
}
},
{
"order": 53,
"key": "011-001",
"lines": [
0,
0,
1,
0,
1,
1
],
"zh": {
"orderLabel": "第五十三卦",
"shortName": "渐",
"fullName": "风山渐",
"keywords": "循序渐进",
"summary": "遵循节律"
},
"en": {
"orderLabel": "The Fifty-Third Hexagram",
"shortName": "Jian",
"fullName": "Wind over Mountain",
"keywords": "Gradual Progress",
"summary": "Following the Rhythm"
}
},
{
"order": 54,
"key": "100-110",
"lines": [
1,
1,
0,
1,
0,
0
],
"zh": {
"orderLabel": "第五十四卦",
"shortName": "归妹",
"fullName": "雷泽归妹",
"keywords": "少女出嫁",
"summary": "归宿各异"
},
"en": {
"orderLabel": "The Fifty-Fourth Hexagram",
"shortName": "Gui Mei",
"fullName": "Thunder over Lake",
"keywords": "The Marriageable Maiden",
"summary": "Different Destinies"
}
},
{
"order": 55,
"key": "100-101",
"lines": [
1,
0,
1,
1,
0,
0
],
"zh": {
"orderLabel": "第五十五卦",
"shortName": "丰",
"fullName": "雷火丰",
"keywords": "盛极防衰",
"summary": "守成不易"
},
"en": {
"orderLabel": "The Fifty-Fifth Hexagram",
"shortName": "Feng",
"fullName": "Thunder over Fire",
"keywords": "Abundance",
"summary": "Guarding Success"
}
},
{
"order": 56,
"key": "101-001",
"lines": [
0,
0,
1,
1,
0,
1
],
"zh": {
"orderLabel": "第五十六卦",
"shortName": "旅",
"fullName": "火山旅",
"keywords": "居无定所",
"summary": "颠沛流离"
},
"en": {
"orderLabel": "The Fifty-Sixth Hexagram",
"shortName": "Lu",
"fullName": "Fire over Mountain",
"keywords": "The Wanderer",
"summary": "Drifting and Wandering"
}
},
{
"order": 57,
"key": "011-011",
"lines": [
0,
1,
1,
0,
1,
1
],
"zh": {
"orderLabel": "第五十七卦",
"shortName": "巽",
"fullName": "巽为风",
"keywords": "申命行事",
"summary": "君命难违"
},
"en": {
"orderLabel": "The Fifty-Seventh Hexagram",
"shortName": "Xun",
"fullName": "Wind",
"keywords": "The Gentle",
"summary": "Following the Decree"
}
},
{
"order": 58,
"key": "110-110",
"lines": [
1,
1,
0,
1,
1,
0
],
"zh": {
"orderLabel": "第五十八卦",
"shortName": "兑",
"fullName": "兑为泽",
"keywords": "和悦喜悦",
"summary": "取悦之道"
},
"en": {
"orderLabel": "The Fifty-Eighth Hexagram",
"shortName": "Dui",
"fullName": "Lake",
"keywords": "Joy",
"summary": "The Way of Pleasing"
}
},
{
"order": 59,
"key": "011-010",
"lines": [
0,
1,
0,
0,
1,
1
],
"zh": {
"orderLabel": "第五十九卦",
"shortName": "涣",
"fullName": "风水涣",
"keywords": "涣之所用",
"summary": "利涉大川"
},
"en": {
"orderLabel": "The Fifty-Ninth Hexagram",
"shortName": "Huan",
"fullName": "Wind over Water",
"keywords": "Dispersion",
"summary": "Crossing the Great River"
}
},
{
"order": 60,
"key": "010-110",
"lines": [
1,
1,
0,
0,
1,
0
],
"zh": {
"orderLabel": "第六十卦",
"shortName": "节",
"fullName": "水泽节",
"keywords": "约束欲望",
"summary": "适度节制"
},
"en": {
"orderLabel": "The Sixtieth Hexagram",
"shortName": "Jie",
"fullName": "Water over Lake",
"keywords": "Moderation",
"summary": "Restraint and Limits"
}
},
{
"order": 61,
"key": "011-110",
"lines": [
1,
1,
0,
0,
1,
1
],
"zh": {
"orderLabel": "第六十一卦",
"shortName": "中孚",
"fullName": "风泽中孚",
"keywords": "修德立命",
"summary": "诚信为本"
},
"en": {
"orderLabel": "The Sixty-First Hexagram",
"shortName": "Zhong Fu",
"fullName": "Wind over Lake",
"keywords": "Inner Truth",
"summary": "Sincerity is Fundamental"
}
},
{
"order": 62,
"key": "100-001",
"lines": [
0,
0,
1,
1,
0,
0
],
"zh": {
"orderLabel": "第六十二卦",
"shortName": "小过",
"fullName": "雷山小过",
"keywords": "凡事勿过",
"summary": "过犹不及"
},
"en": {
"orderLabel": "The Sixty-Second Hexagram",
"shortName": "Xiao Guo",
"fullName": "Thunder over Mountain",
"keywords": "Small Excess",
"summary": "Too Much is Too Little"
}
},
{
"order": 63,
"key": "010-101",
"lines": [
1,
0,
1,
0,
1,
0
],
"zh": {
"orderLabel": "第六十三卦",
"shortName": "既济",
"fullName": "水火既济",
"keywords": "一切大成",
"summary": "初吉终乱"
},
"en": {
"orderLabel": "The Sixty-Third Hexagram",
"shortName": "Ji Ji",
"fullName": "Water over Fire",
"keywords": "Completion",
"summary": "Order turns to Chaos"
}
},
{
"order": 64,
"key": "101-010",
"lines": [
0,
1,
0,
1,
0,
1
],
"zh": {
"orderLabel": "第六十四卦",
"shortName": "未济",
"fullName": "火水未济",
"keywords": "终则必始",
"summary": "变化无穷"
},
"en": {
"orderLabel": "The Sixty-Fourth Hexagram",
"shortName": "Wei Ji",
"fullName": "Fire over Water",
"keywords": "Not Yet Completed",
"summary": "Infinite Change"
}
}
]
FILE:references/summary.txt
乾 ☰ 乾上 第一卦 至刚至强
乾 ☰ 乾下 乾为天 为君之道
坤 ☷ 坤上 第二卦 至柔至顺
坤 ☷ 坤下 坤为地 为臣之道
屯 ☵ 坎上 第三卦 阴阳交动
屯 ☳ 震下 水雷屯 万物始生
蒙 ☶ 艮上 第四卦 启蒙教育
蒙 ☵ 坎下 山水蒙 童蒙求我
需 ☵ 坎上 第五卦 凶险在前
需 ☰ 乾下 水天需 君子等待
讼 ☰ 乾上 第六卦 争诉争讼
讼 ☵ 坎下 天水讼 中吉终凶
师 ☷ 坤上 第七卦 军队战争
师 ☵ 坎下 地水师 以正为要
比 ☵ 坎上 第八卦 择善依附
比 ☷ 坤下 水地比 迟则凶险
小 ☴ 巽上 第九卦 小阻小畜
畜 ☰ 乾下 风天小畜 阴止阳也
履 ☰ 乾上 第十卦 践行履职
履 ☱ 兑下 天泽履 如履薄冰
泰 ☷ 坤上 第十一卦 万物亨通
泰 ☰ 乾下 地天泰 安泰吉祥
否 ☰ 乾上 第十二卦 天地不交
否 ☷ 坤下 天地否 闭塞黑暗
同 ☰ 乾上 第十三卦 天下大同
人 ☲ 离下 天火同人 利涉大川
大 ☲ 离上 第十四卦 阳光普照
有 ☰ 乾下 火天大有 天下富有
谦 ☷ 坤上 第十五卦 谦虚美德
谦 ☶ 艮下 地山谦 君子有终
豫 ☳ 震上 第十六卦 顺时而动
豫 ☷ 坤下 雷地豫 喜悦安乐
随 ☱ 兑上 第十七卦 追随伟人
随 ☳ 震下 泽雷随 随和众人
蛊 ☶ 艮上 第十八卦 革除腐败
蛊 ☴ 巽下 山风蛊 除旧布新
临 ☷ 坤上 第十九卦 居高临下
临 ☱ 兑下 地泽临 监督教化
观 ☴ 巽上 第二十卦 展示威严
观 ☷ 坤下 风地观 仰观盛德
噬 ☲ 离上 第二十一卦 刑罚咬合
嗑 ☳ 震下 火雷噬嗑 用狱规则
贲 ☶ 艮上 第二十二卦 装饰外表
贲 ☲ 离下 山火贲 美化形象
剥 ☶ 艮上 第二十三卦 蚕食剥落
剥 ☷ 坤下 山地剥 君子道消
复 ☷ 坤上 第二十四卦 回复返复
复 ☳ 震下 地雷复 复归复来
无 ☰ 乾上 第二十五卦 毫不虚伪
妄 ☳ 震下 天雷无妄 本该如此
大 ☶ 艮上 第二十六卦 大止大畜
畜 ☰ 乾下 山天大畜 大有作为
颐 ☶ 艮上 第二十七卦 养人被养
颐 ☳ 震下 山雷颐 正当则吉
大 ☱ 兑上 第二十八卦 大的过度
过 ☴ 巽下 泽风大过 非常行动
坎 ☵ 坎上 第二十九卦 处处陷阱
坎 ☵ 坎下 水为坎 重重艰险
离 ☲ 离上 第三十卦 附着依附
离 ☲ 离下 火为离 光明文明
咸 ☱ 兑上 第三十一卦 男女之道
咸 ☶ 艮下 泽山咸 无心之感
恒 ☳ 震上 第三十二卦 夫妇之道
恒 ☴ 巽下 雷风恒 恒久恒长
遁 ☰ 乾上 第三十三卦 退避三舍
遁 ☶ 艮下 天山遁 隐遁世外
大 ☳ 震上 第三十四卦 阳盛阴衰
壮 ☰ 乾下 雷天大壮 壮大隆盛
晋 ☲ 离上 第三十五卦 前进晋升
晋 ☷ 坤下 火地晋 飞黄腾达
明 ☷ 坤上 第三十六卦 光明负伤
夷 ☲ 离下 地火明夷 韬光养晦
家 ☴ 巽上 第三十七卦 家庭伦理
人 ☲ 离下 风火家人 道德之本
睽 ☲ 离上 第三十八卦 离合之道
睽 ☱ 兑下 火泽睽 同异之变
蹇 ☵ 坎上 第三十九卦 跛脚而行
蹇 ☶ 艮下 水山蹇 困难重重
解 ☳ 震上 第四十卦 化解和解
解 ☵ 坎下 雷水解 解除困难
损 ☶ 艮上 第四十一卦 减损之道
损 ☱ 兑下 山泽损 损下益上
益 ☴ 巽上 第四十二卦 增益之道
益 ☳ 震下 风雷益 损上益下
夬 ☱ 兑上 第四十三卦 断绝决裂
夬 ☰ 乾下 泽天夬 刚决柔也
姤 ☰ 乾上 第四十四卦 邂逅相遇
姤 ☴ 巽下 天风姤 柔遇刚也
萃 ☱ 兑上 第四十五卦 聚集荟萃
萃 ☷ 坤下 泽地萃 无往不利
升 ☷ 坤上 第四十六卦 积极向上
升 ☴ 巽下 地风升 步步高升
困 ☱ 兑上 第四十七卦 深陷穷困
困 ☵ 坎下 泽水困 隐忍为要
井 ☵ 坎上 第四十八卦 水井养人
井 ☴ 巽下 水风井 养贤用贤
革 ☱ 兑上 第四十九卦 盛衰之际
革 ☲ 离下 泽火革 改革变革
鼎 ☲ 离上 第五十卦 养贤用贤
鼎 ☴ 巽下 火风鼎 除旧布新
震 ☳ 震上 第五十一卦 震动戒惧
震 ☳ 震下 震为雷 时刻反省
艮 ☶ 艮上 第五十二卦 阻止停止
艮 ☶ 艮下 艮为山 止所当止
渐 ☴ 巽上 第五十三卦 循序渐进
渐 ☶ 艮下 风山渐 遵循节律
归 ☳ 震上 第五十四卦 少女出嫁
妹 ☱ 兑下 雷泽归妹 归宿各异
丰 ☳ 震上 第五十五卦 盛极防衰
丰 ☲ 离下 雷火丰 守成不易
旅 ☲ 离上 第五十六卦 居无定所
旅 ☶ 艮下 火山旅 颠沛流离
巽 ☴ 巽上 第五十七卦 申命行事
巽 ☴ 巽下 巽为风 君命难违
兑 ☱ 兑上 第五十八卦 和悦喜悦
兑 ☱ 兑下 兑为泽 取悦之道
涣 ☴ 巽上 第五十九卦 涣之所用
涣 ☵ 坎下 风水涣 利涉大川
节 ☵ 坎上 第六十卦 约束欲望
节 ☱ 兑下 水泽节 适度节制
中 ☴ 巽上 第六十一卦 修德立命
孚 ☱ 兑下 风泽中孚 诚信为本
小 ☳ 震上 第六十二卦 凡事勿过
过 ☶ 艮下 雷山小过 过犹不及
既 ☵ 坎上 第六十三卦 一切大成
济 ☲ 离下 水火既济 初吉终乱
未 ☲ 离上 第六十四卦 终则必始
济 ☵ 坎下 火水未济 变化无穷
Install and configure the Claw Crony A2A Gateway plugin for cross-server agent communication. Use when: (1) setting up A2A between two or more OpenClaw insta...
---
name: a2a-setup
description: "Install and configure the Claw Crony A2A Gateway plugin for cross-server agent communication. Use when: (1) setting up A2A between two or more OpenClaw instances, (2) user says 'configure A2A', 'set up A2A gateway', 'connect two OpenClaw servers', 'agent-to-agent communication', (3) adding a new A2A peer to an existing setup. Covers: plugin installation, Agent Card configuration, security tokens, peer registration, network setup (Tailscale/LAN), TOOLS.md template for agent awareness, and end-to-end verification."
---
# A2A Gateway Setup
Configure the Claw Crony A2A Gateway plugin for cross-server agent-to-agent communication using the A2A v0.3.0 protocol.
## Prerequisites
- OpenClaw ≥ 2026.3.0 installed and running on each server
- Network connectivity between servers (Tailscale recommended, LAN or public IP also work)
- Node.js ≥ 22
## Step 1: Install the Plugin
```bash
mkdir -p <WORKSPACE>/plugins
cd <WORKSPACE>/plugins
git clone https://github.com/ccccl8/claw-crony.git claw-crony
cd claw-crony
npm install --production
```
Replace `<WORKSPACE>` with the agent workspace path. Find it with:
```bash
openclaw config get agents.defaults.workspace
```
## Step 2: Register Plugin in OpenClaw
Get current allowed plugins first to avoid overwriting:
```bash
openclaw config get plugins.allow
```
Then add `claw-crony` to the existing array (do NOT drop existing plugin ids):
```bash
# Example only — include your existing plugins too
openclaw config set plugins.allow '["<existing...>", "claw-crony"]'
openclaw config set plugins.load.paths '["<ABSOLUTE_PATH>/plugins/claw-crony"]'
openclaw config set plugins.entries.claw-crony.enabled true
```
**Critical:** Use the absolute path in `plugins.load.paths`. Relative paths will fail.
## Step 3: Configure Agent Card
```bash
openclaw config set plugins.entries.claw-crony.config.agentCard.name '<AGENT_NAME>'
openclaw config set plugins.entries.claw-crony.config.agentCard.description '<DESCRIPTION>'
openclaw config set plugins.entries.claw-crony.config.agentCard.url 'http://<REACHABLE_IP>:18800/a2a/jsonrpc'
openclaw config set plugins.entries.claw-crony.config.agentCard.skills '[{"id":"chat","name":"chat","description":"Bridge chat/messages to OpenClaw agents"}]'
```
### URL field rules
| Field | Points to | Example |
|-------|-----------|---------|
| `agentCard.url` | JSON-RPC endpoint (default) | `http://100.x.x.x:18800/a2a/jsonrpc` |
| `peers[].agentCardUrl` | Agent Card discovery (preferred) | `http://100.x.x.x:18800/.well-known/agent-card.json` |
**Do NOT confuse these two.** `agentCard.url` tells peers where to send messages. `agentCardUrl` tells you where to discover the peer.
Note: this plugin also serves the legacy alias `/.well-known/agent.json`, but the official SDK default is `/.well-known/agent-card.json`.
## Step 4: Configure Server
```bash
openclaw config set plugins.entries.claw-crony.config.server.host '0.0.0.0'
openclaw config set plugins.entries.claw-crony.config.server.port 18800
```
## Step 5: Configure Security
```bash
TOKEN=$(openssl rand -hex 24)
echo "Save this token: $TOKEN"
openclaw config set plugins.entries.claw-crony.config.security.inboundAuth 'bearer'
openclaw config set plugins.entries.claw-crony.config.security.token "$TOKEN"
```
Share this token with peers who need to send you messages.
## Step 6: Configure Routing
```bash
openclaw config set plugins.entries.claw-crony.config.routing.defaultAgentId 'main'
```
## Step 7: Add Peers
```bash
openclaw config set plugins.entries.claw-crony.config.peers '[
{
"name": "<PEER_NAME>",
"agentCardUrl": "http://<PEER_IP>:18800/.well-known/agent-card.json",
"auth": {
"type": "bearer",
"token": "<PEER_INBOUND_TOKEN>"
}
}
]'
```
For multiple peers, include all in one JSON array.
## Step 8: Restart and Verify
```bash
openclaw gateway restart
# Verify Agent Card
curl -s http://localhost:18800/.well-known/agent-card.json | python3 -m json.tool
# Verify peer connectivity
curl -s http://<PEER_IP>:18800/.well-known/agent-card.json | python3 -m json.tool
```
## Step 9: Configure TOOLS.md
**This step is critical.** Without it, the agent won't know how to use A2A.
Read `references/tools-md-template.md` and append the A2A section to the agent's `TOOLS.md`, replacing placeholders with actual peer info.
For outbound messaging, use the SDK script (`scripts/a2a-send.mjs`).
To use the SDK script, ensure `@a2a-js/sdk` is installed in the plugin directory:
```bash
cd <WORKSPACE>/plugins/claw-crony && npm ls @a2a-js/sdk
```
## Step 10: End-to-End Test
```bash
node <WORKSPACE>/plugins/claw-crony/skill/scripts/a2a-send.mjs \
--peer-url http://<PEER_IP>:18800 \
--token <PEER_TOKEN> \
--message "Hello, what is your name?"
```
The script uses `@a2a-js/sdk` ClientFactory to auto-discover the Agent Card, handle authentication, and print the peer agent's response.
### Async task mode (recommended for long-running prompts)
For prompts that may take longer than a typical request timeout (e.g., multi-round discussions, long summaries), use non-blocking mode + polling:
```bash
node <WORKSPACE>/plugins/claw-crony/skill/scripts/a2a-send.mjs \
--peer-url http://<PEER_IP>:18800 \
--token <PEER_TOKEN> \
--non-blocking \
--wait \
--timeout-ms 600000 \
--poll-ms 1000 \
--message "Discuss A2A advantages in 3 rounds and provide final conclusion"
```
This sends `configuration.blocking=false` and then polls `tasks/get` until the task reaches a terminal state.
### Server-side timeout configuration (OpenClaw dispatch)
If you still see `Request accepted (no agent dispatch available)`, the underlying OpenClaw agent run may be timing out. Increase:
- `plugins.entries.claw-crony.config.timeouts.agentResponseTimeoutMs` (default: 300000)
### Optional: Route to a specific OpenClaw agentId (OpenClaw extension)
By default, the peer will route inbound A2A messages to `routing.defaultAgentId`.
To route a single request to a specific agentId (e.g., `coder`) on the peer, pass `--agent-id`:
```bash
node <WORKSPACE>/plugins/claw-crony/skill/scripts/a2a-send.mjs \
--peer-url http://<PEER_IP>:18800 \
--token <PEER_TOKEN> \
--agent-id coder \
--message "Run tests and summarize failures"
```
Note: this uses a non-standard `message.agentId` field understood by the Claw Crony A2A Gateway plugin. It is most reliable over JSON-RPC/REST. gRPC transport may drop unknown Message fields.
## Network: Tailscale Setup (if needed)
When servers are on different networks, use Tailscale:
```bash
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
# Authenticate via the printed URL (use same account on all servers)
tailscale ip -4 # Get the 100.x.x.x IP
```
Use Tailscale IPs in all A2A configuration. Verify with:
```bash
ping <OTHER_SERVER_TAILSCALE_IP>
```
## Mutual Peering Checklist
For two-way communication, repeat Steps 1-9 on BOTH servers:
- [ ] Server A: plugin installed, Agent Card configured, token generated
- [ ] Server B: plugin installed, Agent Card configured, token generated
- [ ] Server A: has Server B in peers (with B's token)
- [ ] Server B: has Server A in peers (with A's token)
- [ ] Server A: TOOLS.md updated with Server B peer info
- [ ] Server B: TOOLS.md updated with Server A peer info
- [ ] Both: `openclaw gateway restart` done
- [ ] Both: Agent Cards accessible (`curl /.well-known/agent-card.json`)
- [ ] Test: A → B message/send works
- [ ] Test: B → A message/send works
## Troubleshooting
| Symptom | Cause | Fix |
|---------|-------|-----|
| "no agent dispatch available" | (1) No AI provider configured, or (2) OpenClaw agent dispatch timed out | Check `openclaw config get auth.profiles`; for long prompts use async mode (`--non-blocking --wait`) or increase `config.timeouts.agentResponseTimeoutMs` |
| "plugin not found: claw-crony" | Load path missing or wrong | Verify `plugins.load.paths` uses absolute path |
| Agent Card 404 | Plugin not loaded | Check `plugins.allow` includes `claw-crony` |
| Port 18800 connection refused | Gateway not restarted | Run `openclaw gateway restart` |
| Peer auth fails | Token mismatch | Verify peer config token matches target's `security.token` |
| Agent doesn't know about A2A | TOOLS.md not configured | Add A2A section from the template (Step 9) |
FILE:references/tools-md-template.md
# TOOLS.md A2A Section Template
Append this section to the agent's `TOOLS.md` file, replacing all `<PLACEHOLDERS>` with actual values.
---
```markdown
## A2A Gateway (Agent-to-Agent Communication)
You have an A2A Gateway plugin running on port 18800. You can communicate with peer agents on other servers.
### Peers
| Peer | IP | Auth Token |
|------|-----|------------|
| <PEER_NAME> | <PEER_IP> | <PEER_TOKEN> |
### How to send a message to a peer
When the user says "通过 A2A 让 <PEER_NAME> 做 xxx" / "Send to <PEER_NAME>: xxx" / "Ask <PEER_NAME> to ..." or similar, use the exec tool to run:
```bash
node <WORKSPACE>/plugins/claw-crony/skill/scripts/a2a-send.mjs \
--peer-url http://<PEER_IP>:18800 \
--token <PEER_TOKEN> \
--message "YOUR MESSAGE HERE"
# Optional (OpenClaw extension): route to a specific peer OpenClaw agentId
# --agent-id coder
```
The script uses `@a2a-js/sdk` ClientFactory to:
- Auto-discover the peer's Agent Card
- Handle bearer token authentication
- Select the best transport (JSON-RPC by default; REST or GRPC if preferred/available)
- Print the peer agent's response text directly
### Notes
- For long-running prompts (multi-round discussions, long summaries), use async task mode:
- add: `--non-blocking --wait --timeout-ms 600000 --poll-ms 1000`
- If the peer returns an error, check the token and network connectivity
- The script handles messageId generation and response parsing automatically
```
---
## Placeholder Reference
| Placeholder | Description | Example |
|-------------|-------------|---------|
| `<PEER_NAME>` | Display name of the peer agent | `Server-A` |
| `<PEER_IP>` | IP address reachable from this server | `100.76.43.74` |
| `<PEER_TOKEN>` | The peer's inbound security token | `9489c2c7ce10...` |
| `<WORKSPACE>` | Agent workspace absolute path | `/home/ubuntu/.openclaw/workspace` |
For multiple peers, add one row per peer to the table.