| name | buddys |
| description | Buddys tri-agent decision-review skill for Codex × Claude × Gemini. Trigger when the user explicitly writes "兄弟们", "/buddys", "buddys", or legacy "/xiongdimen" / "xiongdimen", or asks to bring Claude and Gemini into the same product/design/review loop. Uses friend internally as Codex↔Claude transport and asks Gemini for bounded independent review. Does not block native Codex/ClaudeCode agent routes. Optimize for a better product decision, preserve useful dissent, and avoid consensus theater. |
兄弟们 (Buddys)
Use 兄弟们 / Buddys when Claude, Codex, and Gemini can add distinct signal to the same decision. It is heavier than 朋友; skip it when the goal is clear enough for one agent or ordinary bilateral review. The goal is not full alignment — the goal is a better product/implementation decision with explicit tradeoffs.
Buddys is a cross-model review route, not a prerequisite for native agent activation. If the owner asks for Codex sub-agents, ClaudeCode agents, codeagent-wrapper, or parallel delegation, or the relevant host's native agent policy/tooling would normally activate, let that host use its native agents under their own rules; Buddys may review the route or result when a third view changes the decision.
Use Buddys to create independent signal, not three short assistant replies. Give each participant a distinct angle, enough context to verify claims, and permission to object with a better route. Keep only the protocol and safety boundaries hard; let each model decide how to investigate within its assigned scope.
Environment Memory
For local tool, shell, path, Gemini runner, or inter-agent runtime issues, read ${BUDDYS_SHARED_ENV:-${XIONGDIMEN_SHARED_ENV:-${CODEX_HOME:-$HOME/.codex}/../.shared/env/ENVIRONMENT.md}} if present. Update it in place only for stable environment facts, fixes, missing tools, and user improvement suggestions; do not record task details.
Activation Boundaries
- Manual trigger:
兄弟们, /buddys, buddys, legacy /xiongdimen / xiongdimen, or an explicit request to involve both Claude and Gemini. 朋友 may recommend escalating to 兄弟们, but 兄弟们 does not auto-start.
- Native Agent boundary:
兄弟们 must not downgrade an explicit or host-appropriate native multi-agent route into only tri-agent discussion. The final route may be native Codex sub-agents, ClaudeCode agents, self-execution, counterpart execution, helper, or owner escalation.
- If
[FRIEND_CONSULT round=N], [BUDDYS_*], or legacy [XIONGDIMEN_*] is already active, do not start another Buddys session. Respond under the active protocol.
- The initiating agent hosts the session. If Codex receives
[FRIEND_CONSULT round=N] with Mode: buddys or legacy Mode: xiongdimen, Codex responds within that inbound flow and must not spawn a new tri-agent flow.
Roles
- Host: keep scope useful, choose the smallest useful quorum, synthesize the final brief, and act as decision editor rather than vote counter.
- Codex: implementation contracts, backend/API shape, repo-grounded risks, validation boundaries.
- Claude: ambiguity checks, alternative framings, user-facing synthesis, risk narrative.
- Gemini: breadth, frontend/UX, multimodal/product critique, or any outcome-changing issue the prompt asks it to inspect.
- User: final arbiter.
These roles are defaults, not cages. Any participant may raise out-of-role issues when they change the decision. The host owns synthesis, scope control, and whether follow-up rounds are worth the cost. Preserve dissent when it clarifies product tradeoffs; do not flatten it into fake agreement.
Flow
- Decide whether
朋友 is enough. Use 兄弟们 only when a third independent view is materially useful.
- Build a compact context block. For non-code/meta-skill tasks:
N/A — not a code project.
- Ask the Claude/Codex peer through
朋友 transport with Mode: buddys. This is internal transport for Buddys, not a separate user-facing 朋友 activation.
- Ask Gemini with
[BUDDYS_GEMINI_QUERY]. If Gemini is unavailable, record Gemini: BLOCKED (<reason>) in the brief's participants field and continue with the available quorum.
- Synthesize a brief decision document with a recommended route, why it is better, validation, and preserved dissent. Do not claim full consensus when a participant was blocked or when meaningful disagreement remains; surface the tradeoff instead of majority-voting it away.
Runtime and process handling follows friend/SKILL.md: do not kill or restart active non-erroring friend/Buddys/helper/bridge/Gemini processes, and use the minimal supported CLI invocation before adding trust, sandbox, read-only, or tool-mode flags.
Claude/Codex Peer Prompt
Use the normal friend/SKILL.md transport, trust, resume, and anti-recursion rules.
[FRIEND_CONSULT round=1]
Mode: buddys
Phase: Explore | Decide | Final Review
Task: <one sentence>
## Project Context
<friend project context block, or "N/A — not a code project">
## Decision Frame
- Target outcome: <what would make the product/work better for the user>
- Current best route: <host preference + why>
- Credible alternatives: <real alternatives or N/A>
- Evidence: <verified facts, files, commands, observations>
- Unknowns / kill criteria: <assumptions that would change the route>
Draft:
<current plan, contracts, UI flow, or skill protocol>
Review:
1. What would make the final product or implementation materially better?
2. What assumption, contract, UX/API shape, or validation boundary is brittle or missing?
3. What disagreement should be preserved for the owner or integrator instead of averaged away?
4. Decision: AGREE / REFINE / OBJECT
Inbound Mode: buddys or legacy Mode: xiongdimen response as Codex:
- Check implementation contracts, API/data shape, validation, and operational risk.
- Return
AGREE, REFINE, or OBJECT.
- Include what was verified, what was assumed, open risks, and any dissent that should survive synthesis.
- Do not start a new outbound collaboration chain from inside this inbound review.
Gemini Query
Prefer the existing runner when available:
BUDDYS_GEMINI="${BUDDYS_GEMINI:-${XIONGDIMEN_GEMINI:-${CODEX_HOME:-$HOME/.codex}/skills/xiongdimen/scripts/gemini_leaf.py}}"
${BUDDYS_PYTHON:-${XIONGDIMEN_PYTHON:-python3}} "$BUDDYS_GEMINI" "<prompt>" "<project_dir_or_.>"
The runner sends multiline prompts through stdin (gemini -p "") so Windows cmd.exe, Git Bash, WSL, and POSIX shells do not mangle query text. If no runner exists, probe command -v gemini and use the minimal Gemini CLI invocation that supports the request. On command, auth, trust, or network failure, skip Gemini and record the reason.
Gemini is bounded by the prompt and does not own final synthesis. It may raise out-of-focus issues, propose alternatives, or answer follow-up rounds when useful. If Gemini returns vague or malformed output, request the same response shape again while it is still useful; record Gemini: BLOCKED (unusable output) when the output cannot support synthesis.
[BUDDYS_GEMINI_QUERY]
Task: <one sentence>
Focus: frontend | product | multimodal | meta-skill | other
Context: <only what Gemini needs>
Known constraints: <backend/API/user constraints, or N/A>
Independence scope: <what Gemini should focus on; it may raise out-of-scope issues if they change the decision>
Return:
Status: READY | NEEDS_CLARIFICATION | BLOCKED
Verdict: <PROCEED | REFINE | BLOCKED, plus one sentence>
Key observations:
- <Claim>: <evidence from provided context/files; if unverified, label it as a hypothesis>
Recommended route: <Gemini's independent route or N/A>
Interface/API needs: <only if relevant>
Data or UX assumptions: <specific assumptions>
Risks: <risks relevant to the requested focus>
Open questions: <blocking questions, or N/A>
Accept legacy [XIONGDIMEN_GEMINI_QUERY] and [XIONGDIMEN_FRONTEND_QUERY] as the same Gemini leaf query.
New briefs and work cards output BUDDYS_* markers only; XIONGDIMEN_* is accepted as input for backward compatibility but never emitted.
Final Brief
Use the smallest brief that captures the decision, evidence, and live tradeoffs:
[BUDDYS_BRIEF]
# Buddys Brief: <topic>
participants: Codex: READY | Claude: READY | Gemini: READY|BLOCKED(<reason>)
## Decision
## Recommended Route
## Role Inputs
## Interface / Contract
## Implementation + Validation
## Preserved Dissent / Tradeoffs
## Risks / Open Questions
If the task is not a feature, rename sections naturally but keep Decision, Recommended Route, Role Inputs, and Risks / Open Questions.
When the owner asks for split execution or the chosen decision explicitly needs file-disjoint execution by 帮手, add [SPLIT: YES] to the brief with owners, integrator, validation, and stop-if fields. The tag remains explicit authorization; discussion-only outcomes omit it.
Suggest handoff
When context pressure is high, a role switch is signaled, or the session is ending after a tri-agent decision, suggest: "Consider writing a handoff before switching agents — say 交班 or /handoff." Do not write automatically. Record the decision outcome in decisions_and_changes and unresolved points in open_issues.
On-Demand Collaboration Report
Default: do not emit a process report. If the owner asks for 报告, /report, 协商流程报告, 过程复盘, 谁提的, 谁纠正了什么, 改了什么, consultation report, or process report, the host synthesizes [COLLABORATION_REPORT] from visible round context, role inputs, briefs, and completion notes.
Report useful deltas only:
- who proposed an adopted direction;
- who corrected or refined it;
- what changed as a result;
- final decision and unresolved risks.
- explicitly rejected options only when the rejection changed the final path.
Scope to the current task or the period since the last user request unless the owner asks for a wider range. Use short for key deltas; use detail when visible rationale is useful. Do not ask Gemini to self-report the process. Do not include raw transcripts, hidden deliberation, JSONL, or long quotes. If a 交班 handoff already records the final decision, focus this report on the path to that decision instead of duplicating the handoff.