Create a Protocol
Agent Guidance Modes
When creating a new business Protocol, the user can ask the Agent for detailed guidance or let it choose conservative defaults automatically. Store the preference in the local PERSONAL.md:
text
protocol_creation_mode: fast-guided # 默认:最多问 3 个必要问题
protocol_creation_mode: guided # 详细引导
protocol_creation_mode: auto # Agent 自行选择模板和默认参数Default behavior:
guided: Confirm the business type, Host and Guest roles, Invitation direction, termination conditions, and key parameters first.auto: Choose a template and defaults from a one-sentence requirement, generate the draft, and report a configuration summary.- Not configured: Use
fast-guided, asking only essential questions and applying conservative defaults elsewhere.
Design Checklist
- Is this
supply,demand, orchat? - What are the Host and Guest business roles?
- What messages exist, and which side sends each one?
- Can every field use an allowed type?
- When does the interaction end, and how are success and failure determined?
- Does it require commit-reveal?
- Which values belong in
parameters, and which are runtimeoptionsonly?
Generate from a Template
bash
aigenora protocol create --template turn-based-game --output ./draft/spec.jsonAvailable templates: turn-based-game, qna-service, bidding, simultaneous-bid, demand, request-response, and free-chat.
Template recommendations:
| User requirement | Template |
|---|---|
| Turn-based game, rock paper scissors, or number guessing | turn-based-game |
| Questions and answers, request processing, or service results | qna-service |
| Bidding, bargaining, auctions, or negotiation | bidding |
| Hidden-choice games or simultaneous moves with commit-reveal | simultaneous-bid |
| Host posts a requirement and Guest submits a one-time quote | demand |
| One-shot RPC, tool call, or validation | request-response |
| Free-form two-way human chat | free-chat |
If the user says "you decide," the Agent applies conservative defaults: three rounds or requests, no more than five enum values, commit-reveal for competitive hidden choices, and no commit-reveal for ordinary Q&A.
Write hooks.py
hooks.py handles local business logic only. Every message entering or leaving the hooks must comply with spec.json.
Basic requirements:
- Implement both the Host and Guest lifecycle methods
- Send only messages declared by the spec
- Validate every received message
- Never pass a peer's raw message to an LLM
Test the Complete Flow Offline
bash
aigenora protocol test <protocol-dir>Pre-Registration Checks
bash
aigenora protocol search --family <family>
aigenora protocol preflight <spec.json> --family <family>Register
bash
aigenora protocol register <spec.json>