Core Principles: Claude Code brain → Kimi search → (complex? Gemini reasoning) → Claude synthesis → ChatGPT review → Claude fix Provider layer:
AgentChat-OneWeb, zero code duplication Security policy: never close the user's Chrome
⚠️ Mandatory rules — invoked means executed
When this skill is invoked, Step 1→6 must be executed in order. Step 2 and Step 5 are executed unconditionally; Step 3 is determined by complexity. Skipping any step is prohibited; only explaining the process without executing is prohibited.
Core constraints:
- ❌ Prohibited: after reading SKILL.md, describing the pipeline, explaining role分工, analyzing the architecture — yet not running
node index.js - ❌ Prohibited: skipping Step 2 on the grounds of "the task is too simple / purely local / no search needed" (
--search) - ❌ Prohibited: skipping Step 5 on the grounds of "the output is very simple / no review needed" (
--review) - ❌ Prohibited: replacing
node index.jsinvocation with local file reading, code analysis, or Claude's own knowledge - ❌ Prohibited: writing local file paths into the prompt and expecting the web AI to read them itself (it has no access to the local disk). The content must be read in by Claude Code before being sent
- ✅ Mandatory: Step 2 and Step 5 executed unconditionally. The complexity determination only affects whether Step 3 (Gemini reasoning) is skipped
- ✅ Mandatory: each step produces a verifiable
node index.jsJSON output; only after the result is returned may you add your interpretation
Execution receipt — whether it was executed is judged by this, not by the narrative
Each node index.js --search/--reason/--review output JSON contains a machine-generated receipt field
(also a line is printed to stderr [receipt] AGENTCHAT_RUN {...}):
"receipt": { "run_id": "ac-xxxxxxxxxxxx", "skill": "AgentChat-WebSubAgent", "mode": "search", "exit": 0, "provider_used": "kimi", ... }
- The final report must list, step by step, each execution's
receipt.run_id(one for Step 2; one for Step 3 if executed; one for Step 5). - Missing a step's run_id = that step was not executed = violation, and it must be re-run.
- run_id is randomly generated and persisted to disk
skills/AgentChat-WebSubAgent/data/receipts.jsonl, the user cangrep <run_id>verify it; fabricating one out of thin air cannot pass verification. - A failed execution (exit≠0) also has a receipt: only after citing the failure receipt and explaining the degradation/failure reason is it permitted to continue that step using the model's own capability, and it must be clearly marked "web AI did not participate in this step".
Anti-bypass principle: if a step "looks like it doesn't need the web AI", the correct approach is to still send the local findings to the web AI via node index.js for verification/supplementation/cross-checking — rather than skipping that step. Step 2's search prompt and Step 5's review content must include the local analysis results Claude has already done, so the web AI can do a second confirmation.
Self-check list (Claude Code must confirm all are complete before the final output):
- Step 2:
node index.js --searchexecuted, returned JSON? receipt.run_id = ______ - Step 3: (when complex)
node index.js --reasonexecuted? receipt.run_id = ______ (when simple) skip reason clearly recorded? - Step 5:
node index.js --reviewexecuted, returned JSON? receipt.run_id = ______ - Step 6: review comments processed one by one?
- Final report has listed all the above run_ids?
Exception: --smoke、--doctor, or the user explicitly requests "only check the environment, do not send"
Config loading (cross-directory — shared skills/lib/cdp.js, v31)
This skill calls OneWeb and actually performs the provider invocation, but .env Parsing, Chain priority, and the AGENTCHAT_DISABLED full pipeline are in the shared cdp.js completed.
5-step lookup order + cross-directory usage + NOT-LOADED output format Full documentation is in AgentChat-OneWeb/SKILL.md configuration loading. The most common "invoke ~/.agents/skills/.../index.js from any cwd" scenario is handled in one line:
mkdir -p ~/.agentchat && ln -sf /path/to/AgentChat/.env ~/.agentchat/.env
Architecture
用户需求 → [1.Claude 规划] → [2.Kimi 搜索] →{复杂?}→ [3.Gemini 推理] → [4.Claude 合成] → [5.ChatGPT 审查] → [6.Claude 修复] → 最终产出
└── 简单: 跳过 ──┘
Serial pipeline + conditional branching. Claude Code serves as the brain throughout, calling OneWeb via index.js only in Steps 2/3/5.
Roles and Prompt Specifications
| Step | AI | Role | Instructions that must be embedded |
|---|---|---|---|
| 2 | Kimi | Web search | 请进行联网搜索,用要点列出关键事实和数据。不要运行代码。 |
| 3 | Gemini Pro | Deep reasoning (conditional) | 直接给出完整的分析。不需要搜索新资料,基于已有信息推理。 |
| 5 | ChatGPT | Cross-review | 请逐一审查以下内容,列出所有问题点并给出具体修改建议。不要重写整个方案。 |
Complexity determination (Step 1)
Only determines whether Step 3 (Gemini reasoning) is executed. Does not affect the mandatory execution of Step 2 and Step 5.
When uncertain, lean toward judging as "complex"。
Complex (triggers Step 3, satisfies ≥2 items):
- Requires synthesizing multiple information sources to reach a conclusion
- Involves multi-step logical reasoning or mathematical derivation
- Has non-trivial architecture/design decisions, or requires multi-file code
- The problem domain requires domain expertise
- The user requests "deep analysis" or a "comprehensive solution"
Simple (skip Step 3, but Step 2 and Step 5 must still be executed):
- Single-fact queries, intuitive code of ≤50 lines, format conversion, and other mechanical work
Operational workflow
Step 1: Planning and dispatch
- Understand the requirements, quickly browse relevant local files
- Determine complexity (only determines whether Step 3 is executed)
- Write a comprehensive search prompt — must include:
- The user's original requirements
- A summary of the local analysis Claude has already done (file contents, project structure, and other findings)
- Domain background or latest developments that need to be supplemented/verified by a web AI
- Even if the problem appears purely local, a search prompt must still be constructed——at minimum, have Kimi verify local findings, supplement the latest domain developments, or cross-check Claude's judgment
- Report to the user: complexity + search query + expected output
Step 2: Web search (executed unconditionally)
⚠️ Regardless of task type, this step cannot be skipped. Even if the problem is 100% about understanding local files, the search must still be executed——the value lies in supplementing domain background, verifying local findings, and discovering the latest developments not covered in the README.
node skills/AgentChat-WebSubAgent/index.js --search "综合搜索 prompt"
The output is JSON.response The field is Kimi's complete search result. Claude Code reads it in full and then extracts key facts.
Fallback: Kimi → Qwen
Step 3: Deep reasoning (complex tasks only)
Assemble the search summary + original requirements into a single reasoning prompt. Summarize the key information; do not paste the original full text.
node skills/AgentChat-WebSubAgent/index.js --reason "原始需求: ...搜索摘要: ...请从[角度]深度分析,直接给出完整推理。不需要搜索新资料。" --timeout=300000
Fallback: Gemini → ChatGPT → Claude
Step 4: Core generation
Combine the search facts + reasoning conclusions (if any) + original requirements to generate the final deliverable (code/document/report). Self-check: Have all search facts been incorporated? Have the reasoning conclusions been absorbed? Are all key requirements covered?
Step 5: Cross-review (executed unconditionally)
⚠️ Regardless of task type, this step cannot be skipped. Send the full text of the Step 4 output to ChatGPT. Review dimensions: correctness, security, performance, maintainability.
Even if the output is "simple," the value of review lies in: catching errors Claude might overlook, verifying factual accuracy, and checking logical consistency. Review of simple output may be quick ("no issues" is also a valid result), but it must be performed.
node skills/AgentChat-WebSubAgent/index.js --review "原始需求: ...待审查产出: ...请从正确性、安全性、性能、可维护性逐一审查,列出问题并给修改建议。不要重写方案。"
Fallback: ChatGPT → Claude → Qwen
After receiving review comments, evaluate them one by one: reasonable → fix in Step 6 / not applicable → record the reason / needs clarification → flag it.
Step 6: Fix and Output
Apply the review comments one by one and output the final file. Report to the user: step summary, complexity rationale, review handling status, and output location.
📐 Output Formatting Standards — Mandatory Format for the Final Answer
The constrained subject is the final delivered text written by Claude Code.final delivered text; worker raw output, code blocks, diffs, tables, and receipt lines are not constrained.
- Conclusion first: The first paragraph at the beginning is a core conclusion of ≤50 characters (TL;DR), directly answering the user's fundamental need, with no pleasantries and no methodology preamble.
- Heading hierarchy: Main modules use
##, sub-points use###, and level-one headings are prohibited#. Dimensions are logically clustered into 3–5 blocks (e.g., background/current state/analysis/conclusion); writing a running account in retrieval order is prohibited. - Visual focus: Data, times, proper nouns, and core arguments are marked with
**加粗**; bolding is used only for focus guidance, with no more than 2 instances per natural paragraph. - List discipline: Only single-level unordered lists are allowed
*; any multi-level nested lists are prohibited (to ensure a good reading experience in terminals/chat boxes). - Text density: Narrative natural paragraphs are ≤3 sentences, and new logical branches must start a new line and paragraph; transitional sentences with no substantive information such as "in conclusion," "based on the above search results," and "as an AI" are prohibited.
- Information isolation: When quoting excerpts of web AI source text or external links, they must be placed in
>quote blocks with the source provider labeled, strictly distinguished from your own analysis. - Exemption clauses (priority higher than clauses 1–6):
[receipt] AGENTCHAT_RUN {...}lines (or the run_id list for each step) must be retained verbatim in a code block at the end of the answer, and must not be rewritten, bolded, or omitted — governed by mandatory rule §2.- Degradation/failure disclosure (e.g., "N roles degraded," "web AI did not participate in this answer") is a process transparency requirement, does not count as a redundant transitional sentence, and must not be deleted.
- Code blocks, diffs, and tables are not subject to paragraph length and list level restrictions.
CLI Quick Reference
node skills/AgentChat-WebSubAgent/index.js --search "query" # Kimi 搜索
node skills/AgentChat-WebSubAgent/index.js --reason "prompt" # Gemini 推理
node skills/AgentChat-WebSubAgent/index.js --review "content" # ChatGPT 审查
node skills/AgentChat-WebSubAgent/index.js --smoke | --doctor # 环境检查
| Flag | Description |
|---|---|
--search/--reason/--review |
Step mode (choose one of three) |
--provider=X |
Override default provider |
--timeout=N |
Timeout ms (default 180000) |
Degradation chain
| Step | Preferred | Fallback |
|---|---|---|
| Search | Kimi → Qwen | |
| Reason | Gemini → ChatGPT → Claude | |
| Review | ChatGPT → Claude → Qwen |