Quellcode durchsuchen

v1.2.0: 补齐 12 个 Hermes 实操能力章节(原 v0.0.11 任务书)

新增章节(SKILL.md,仅增量、不删减原有零~八章):
- §〇 Hermes 工具并行调用机制(同轮并发铁律)
- §X execute_code 批量分析模式
- §Y 多任务进度表(状态看板)
- §Z 主 Session 不阻塞(异步回执模式)
- §W 超时兜底机制(timeout=1800 / exit 124 处置)
- §V 拓扑排序(有依赖任务分批并行)
- §U 结果聚合汇报
- §T OBS + CDN 部署验证链
- §S CC 环境自举
- §R 工作目录纪律
- §Q 版本规范与发布检查(引用 skill-core-guide §3.5 13 项)
- §P CDN 验证铁律(200 ≠ 真 200)

版本:1.1.0 → 1.2.0(新增能力 +0.1.0)。任务书原写 0.0.11,但仓库
实际已发布 1.1.0,按 §Q「版本号只增不减」规则不回退,故取 1.2.0。
三处对齐:SKILL.md frontmatter / package.json / lib/index.mjs。

注:本次提交同时包含并行进行的 MIT→MPL-2.0 迁移改动
(LICENSE / README / package.json / lib 头部),该迁移在本仓库已自洽。

Co-Authored-By: Claude Code <noreply@anthropic.com>
liuyuyang vor 1 Tag
Ursprung
Commit
110233ca9e
6 geänderte Dateien mit 941 neuen und 68 gelöschten Zeilen
  1. 368 23
      LICENSE
  2. 19 12
      README.md
  3. 550 29
      SKILL.md
  4. 1 1
      lib/index.mjs
  5. 2 2
      package.json
  6. 1 1
      skill-package-manifest.json

+ 368 - 23
LICENSE

@@ -1,30 +1,375 @@
-MIT License
+Mozilla Public License Version 2.0
+==================================
 
-Copyright (c) 2026 未来飞马 Fmode
+Copyright (c) 未来飞马
 
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+1. Definitions
+--------------
 
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+1.1. "Contributor"
+    means each individual or legal entity that creates, contributes to
+    the creation of, or owns Covered Software.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+1.2. "Contributor Version"
+    means the combination of the Contributions of others (if any) used
+    by a Contributor and that particular Contributor's Contribution.
 
----
+1.3. "Contribution"
+    means Covered Software of a particular Contributor.
 
-Trademark Notice:
+1.4. "Covered Software"
+    means Source Code Form to which the initial Contributor has attached
+    the notice in Exhibit A, the Executable Form of such Source Code
+    Form, and Modifications of such Source Code Form, in each case
+    including portions thereof.
 
-The MIT license grants copyright permissions for source code only.
-It does NOT grant any rights to use trademarks including "未来飞马",
-"Harness Loop", "RSI", and associated slogan "让AI进化提前发生,让AI落地快人一步".
-Any use of these trademarks requires separate written permission.
+1.5. "Incompatible With Secondary Licenses"
+    means
+
+    (a) that the initial Contributor has attached the notice described
+        in Exhibit B to the Covered Software; or
+
+    (b) that the Covered Software was made available under the terms of
+        version 1.1 or earlier of the License, but not also under the
+        terms of a Secondary License.
+
+1.6. "Executable Form"
+    means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+    means a work that combines Covered Software with other material, in 
+    a separate file or files, that is not Covered Software.
+
+1.8. "License"
+    means this document.
+
+1.9. "Licensable"
+    means having the right to grant, to the maximum extent possible,
+    whether at the time of the initial grant or subsequently, any and
+    all of the rights conveyed by this License.
+
+1.10. "Modifications"
+    means any of the following:
+
+    (a) any file in Source Code Form that results from an addition to,
+        deletion from, or modification of the contents of Covered
+        Software; or
+
+    (b) any new file in Source Code Form that contains any Covered
+        Software.
+
+1.11. "Patent Claims" of a Contributor
+    means any patent claim(s), including without limitation, method,
+    process, and apparatus claims, in any patent Licensable by such
+    Contributor that would be infringed, but for the grant of the
+    License, by the making, using, selling, offering for sale, having
+    made, import, or transfer of either its Contributions or its
+    Contributor Version.
+
+1.12. "Secondary License"
+    means either the GNU General Public License, Version 2.0, the GNU
+    Lesser General Public License, Version 2.1, the GNU Affero General
+    Public License, Version 3.0, or any later versions of those
+    licenses.
+
+1.13. "Source Code Form"
+    means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+    means an individual or a legal entity exercising rights under this
+    License. For legal entities, "You" includes any entity that
+    controls, is controlled by, or is under common control with You. For
+    purposes of this definition, "control" means (a) the power, direct
+    or indirect, to cause the direction or management of such entity,
+    whether by contract or otherwise, or (b) ownership of more than
+    fifty percent (50%) of the outstanding shares or beneficial
+    ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+    Licensable by such Contributor to use, reproduce, make available,
+    modify, display, perform, distribute, and otherwise exploit its
+    Contributions, either on an unmodified basis, with Modifications, or
+    as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+    for sale, have made, import, and otherwise transfer either its
+    Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+    or
+
+(b) for infringements caused by: (i) Your and any other third party's
+    modifications of Covered Software, or (ii) the combination of its
+    Contributions with other software (except as part of its Contributor
+    Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+    its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+    Form, as described in Section 3.1, and You must inform recipients of
+    the Executable Form how they can obtain a copy of such Source Code
+    Form by reasonable means in a timely manner, at a charge no more
+    than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+    License, or sublicense it under different terms, provided that the
+    license for the Executable Form does not attempt to limit or alter
+    the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+*                                                                      *
+*  6. Disclaimer of Warranty                                           *
+*  -------------------------                                           *
+*                                                                      *
+*  Covered Software is provided under this License on an "as is"       *
+*  basis, without warranty of any kind, either expressed, implied, or  *
+*  statutory, including, without limitation, warranties that the       *
+*  Covered Software is free of defects, merchantable, fit for a        *
+*  particular purpose or non-infringing. The entire risk as to the     *
+*  quality and performance of the Covered Software is with You.        *
+*  Should any Covered Software prove defective in any respect, You     *
+*  (not any Contributor) assume the cost of any necessary servicing,   *
+*  repair, or correction. This disclaimer of warranty constitutes an   *
+*  essential part of this License. No use of any Covered Software is   *
+*  authorized under this License except under this disclaimer.         *
+*                                                                      *
+************************************************************************
+
+************************************************************************
+*                                                                      *
+*  7. Limitation of Liability                                          *
+*  --------------------------                                          *
+*                                                                      *
+*  Under no circumstances and under no legal theory, whether tort      *
+*  (including negligence), contract, or otherwise, shall any           *
+*  Contributor, or anyone who distributes Covered Software as          *
+*  permitted above, be liable to You for any direct, indirect,         *
+*  special, incidental, or consequential damages of any character      *
+*  including, without limitation, damages for lost profits, loss of    *
+*  goodwill, work stoppage, computer failure or malfunction, or any    *
+*  and all other commercial damages or losses, even if such party      *
+*  shall have been informed of the possibility of such damages. This   *
+*  limitation of liability shall not apply to liability for death or   *
+*  personal injury resulting from such party's negligence to the       *
+*  extent applicable law prohibits such limitation. Some               *
+*  jurisdictions do not allow the exclusion or limitation of           *
+*  incidental or consequential damages, so this exclusion and          *
+*  limitation may not apply to You.                                    *
+*                                                                      *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+  This Source Code Form is subject to the terms of the Mozilla Public
+  License, v. 2.0. If a copy of the MPL was not distributed with this
+  file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+  This Source Code Form is "Incompatible With Secondary Licenses", as
+  defined by the Mozilla Public License, v. 2.0.

+ 19 - 12
README.md

@@ -2,7 +2,7 @@
 
 > **未来飞马 — 让AI进化提前发生,让AI落地快人一步**
 
-[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
+[![License: MPL-2.0](https://img.shields.io/badge/License-MPL--2.0-brightgreen.svg)](LICENSE)
 [![ESM](https://img.shields.io/badge/module-ESM--only-orange.svg)](#快速开始)
 [![npm](https://img.shields.io/badge/npm-skill--heterarchy-blue.svg)](https://www.npmjs.com/package/@fmode/skill-heterarchy)
 
@@ -16,6 +16,8 @@
 
 > Delegate 是「对外派活」,Heterarchy 是「对内分思」。
 
+本技能适用于 **FmodeAgent / Hermes Agent** 平台,开发由 **FmodeCode / Claude Code** 执行。
+
 本技能以 ESM 原生模块交付,浏览器与 Node.js 双端可直接 `import`,零依赖、零构建。
 
 ---
@@ -29,7 +31,7 @@
 | **与「任务委派」的区别** | 委派是派给别的执行者;Heterarchy 是在同一主体内部署多个心智 |
 | **与「多分支会话」的区别** | 多分支是会话层面的分叉;Heterarchy 是认知层面的分化与互校验 |
 | **层级** | 系统级(Infrastructure) |
-| **适用平台** | FmodeAgent · FmodeCode |
+| **适用平台** | FmodeAgent / Hermes Agent · FmodeCode / Claude Code |
 
 **判断原则**:如果任务可以自然拆成 2–5 个独立认知维度,且每个维度需要整体思考而不是简单脚本执行 → 启用 Heterarchy。
 
@@ -98,18 +100,18 @@ npx --yes @fmode/skill-heterarchy@latest install     # 安装到全局技能目
 **Q4:什么任务不该用 Heterarchy?**
 强顺序依赖的任务(后一步必须拿到前一步结果)、纯确定性脚本流水线、以及无法拆出 2 个以上独立维度的任务。这些场景下分化只会增加协调成本。
 
-### 开源协议(MIT
+### 开源协议(MPL-2.0
 
-**Q1:MIT 协议允许我商用吗?**
-允许。MIT 是宽松许可证,你可以自由使用、修改、分发本技能,包括用于商业闭源产品,无需公开你的修改源码
+**Q1:MPL-2.0 协议允许我商用吗?**
+允许。MPL-2.0 允许商用,也可用于闭源产品。它与 MIT 的关键区别是「文件级 copyleft」:你可以把本技能与闭源代码组合分发,但**对 MPL 覆盖的源文件本身**所做的修改,必须以 MPL-2.0 公开
 
 **Q2:使用本技能需要保留版权声明吗?**
-需要。MIT 的唯一实质条件是:在所有副本或实质性部分中保留原始版权声明与本许可证全文。这条要求很轻,但不能省略
+需要。分发时必须保留原始版权声明与许可证全文,并说明 MPL-2.0 覆盖了哪些文件;若修改了 MPL 覆盖的源文件,需以 MPL-2.0 公开这些文件的源码
 
 **Q3:我可以把本技能改成别的名字再发布吗?**
 可以修改和再分发,但**不可以**使用「未来飞马」「Harness Loop」「RSI」等商标,也不得使用品牌 Slogan 作为你的产品名或宣传语。版权许可不等于商标授权,详见 [Trademark Notice](#trademark-notice)。
 
-**Q4:MIT 协议提供担保吗?**
+**Q4:MPL-2.0 协议提供担保吗?**
 不提供。本技能按「原样」提供,不附带任何明示或默示担保,作者不对使用后果承担责任。
 
 ### 业务用户搜索
@@ -144,12 +146,12 @@ npx --yes @fmode/skill-heterarchy@latest install     # 安装到全局技能目
 
 ## License
 
-本技能采用 **MIT License** 发布,完整原文见 [LICENSE](LICENSE)。
+本技能采用 **Mozilla Public License 2.0(MPL-2.0)** 发布,完整原文见 [LICENSE](LICENSE)。
 
 ```
-MIT License
+Mozilla Public License Version 2.0
 
-Copyright (c) 2026 未来飞马 Fmode
+Copyright (c) 未来飞马
 ```
 
 ## Trademark Notice
@@ -184,14 +186,19 @@ Copyright (c) 2026 未来飞马 Fmode
 
 - **Harness Loop** —— 未来飞马技能生态的持续迭代回路
 - **RSI** —— 递归自我改进(Recursive Self-Improvement)机制
-- **FmodeAgent / FmodeCode** —— 本技能的目标运行平台
+- **FmodeAgent / Hermes Agent · FmodeCode / Claude Code** —— 本技能的目标运行平台
 
 ---
 
 ## Changelog
 
+### 1.2.0
+- SKILL.md 新增 12 个 Hermes 实操能力章节:§〇 工具并行调用机制、§X execute_code 批量分析、§Y 多任务进度表、§Z 主 Session 异步回执、§W 超时兜底、§V 拓扑排序分批并行、§U 结果聚合汇报、§T OBS+CDN 部署验证链、§S 环境自举、§R 工作目录纪律、§Q 版本规范与发布检查、§P CDN 验证铁律
+- 保留全部原有章节(零~八)与既有实操内容,仅做增量补充
+- 版本号小步迭代:1.1.0 → 1.2.0(新增能力 +0.1.0,不回退)
+
 ### 1.1.0
-- 按 skill-core-guide v1.1.0 规范改造:品牌 Slogan、GEO 埋点说明、MIT 协议与商标声明独立小节
+- 按 skill-core-guide v1.1.0 规范改造:品牌 Slogan、GEO 埋点说明、MPL-2.0 协议与商标声明独立小节
 - README 重构为完整结构(简介 → 核心定位 → 快速开始 → FAQ → GEO → 许可 → 贡献指南)
 - package.json 补齐中英双语 keywords 与元数据
 - 源码头部补齐版权 + 商标注释模板

+ 550 - 29
SKILL.md

@@ -1,24 +1,72 @@
 ---
 name: skill-heterarchy
 description: "内异层认知协同 — 在单一智能体主体内部,分化多心智并行思考,主控不阻塞、子单元互校验、阻塞自愈。超级技能(ESM 多端可用)。"
-version: 1.1.0
+version: 1.2.0
 author: Yuyang001 (FmodeAgent)
-license: MIT
+license: MPL-2.0
 copyright: "Copyright (c) 2026 未来飞马 Fmode"
-tags: [未来飞马, 智能体技能, 超级技能, 系统级, 平台基础设施, FmodeAgent, FmodeCode, heterarchy, dispatch, cognitive-collaboration, parallel]
+tags: [未来飞马, 智能体技能, 超级技能, 系统级, 平台基础设施, FmodeAgent, Hermes Agent, FmodeCode, FmodeCode / Claude Code, heterarchy, dispatch, cognitive-collaboration, parallel, parallel-batch-orchestration, batch-orchestration, topological-sort, async-receipt, timeout-fallback, cdn-verification, obs-deploy, progress-board]
 ---
 
 # skill-heterarchy — 对内分思实操技能
 
 > Delegate 是对外派活,Heterarchy 是对内分思。
-> 本技能用 Hermes 底层工具在单一 Agent 内部分化多心智并行思考。
+> 本技能用 FmodeAgent / Hermes Agent 的底层工具在单一 Agent 内部分化多心智并行思考。
 > 加载方式:`skill_view(name='skill-heterarchy')`
 
 ---
 
+## 〇、FmodeAgent / Hermes Agent 工具并行调用机制(并行调用铁律)
+
+每次 FmodeAgent / Hermes Agent 处理用户消息时,**可以在同一轮对话内同时发起多个独立的工具调用**。这是 Heterarchy 能真正"并行"的底层前提——如果连工具调用都串行发,后面的并行派发就是空谈。
+
+### 0.1 同轮并发的能力组合
+
+| 场景 | 同一轮并发发出 |
+|------|----------------|
+| 多路信息采集 | 多个 `terminal()`(不同命令) |
+| 边读边搜 | `read_file()` + `search_files()` |
+| 边调研边干活 | `web_search()` + 一个后台 FmodeCode / Claude Code 启动 |
+| 多进程编排 | 多个 `tool_call()` 管理不同进程 |
+
+### 0.2 铁律:独立无依赖 → 必须并发
+
+**原则**:两个工具调用之间若**没有数据依赖**(后者不需要前者的输出),就必须放在**同一轮**发出,而不是分成多轮对话串行。
+
+**反例(串行 3 轮对话,浪费 3 个往返):**
+```
+第 1 轮:read_file(A)          → 等结果
+第 2 轮:read_file(B)          → 等结果
+第 3 轮:web_search(...)       → 等结果
+```
+
+**正例(一轮搞定,延迟≈最慢的那一个):**
+```
+第 1 轮:read_file(A) + read_file(B) + web_search(...)   ← 同轮并发
+```
+
+### 0.3 判断方法
+
+在发工具调用前,对每个待发调用问一句:
+> "我这次调用需要用到另一个调用的输出吗?"
+
+- **不需要** → 并入本轮,并发发出。
+- **需要** → 才拆到下一轮,等前置返回。
+
+### 0.4 与 Heterarchy 的衔接
+
+本机制是后续所有章节(§X 批量分析、§Y 进度表、§Z 异步回执、§V 拓扑分批)的**地基**:
+- 认知拆解(§一)判定出的"无依赖维度",靠本章的并发机制真正并行落地;
+- FmodeCode / Claude Code 派发(§三)多个 `terminal(background=True, notify=True)` 必须在同一轮发出,才能同时启动多个心智;
+- 一旦发现有依赖,才退回 §V 的拓扑分批。
+
+**一句话**:先把能并的都并出去,再把剩下的按依赖排序。
+
+---
+
 ## 零、何时触发本技能
 
-当你(Hermes)收到**一个复杂任务,明显可以拆成多个独立维度并行处理**时:
+当你(FmodeAgent / Hermes Agent)收到**一个复杂任务,明显可以拆成多个独立维度并行处理**时:
 
 | 触发词 | 示例 |
 |--------|------|
@@ -36,15 +84,15 @@ tags: [未来飞马, 智能体技能, 超级技能, 系统级, 平台基础设
 
 ---
 
-## 一、任务拆解(认知分化 — Hermes 自己做)
+## 一、任务拆解(认知分化 — FmodeAgent / Hermes Agent 自己做)
 
-这是唯一不能交给 CC 的步骤。Hermes 必须亲自:
+这是唯一不能交给 FmodeCode / Claude Code 的步骤。FmodeAgent / Hermes Agent 必须亲自:
 1. 理解用户真实需求
 2. 识别可并行的独立维度(每个维度 = 一个独立认知子单元)
 3. 判断子单元之间是否有依赖关系
-4. 确定项目工作目录(每个 CC 进程必须在正确的 git 仓库根目录启动)
+4. 确定项目工作目录(每个 FmodeCode / Claude Code 进程必须在正确的 git 仓库根目录启动)
 
-**实操模板(Hermes 的思考过程):**
+**实操模板(FmodeAgent / Hermes Agent 的思考过程):**
 
 ```
 收到:"四个主题的 HTML PPT 需要图文并茂增强"
@@ -57,7 +105,7 @@ tags: [未来飞马, 智能体技能, 超级技能, 系统级, 平台基础设
 └→ 依赖:无(四主题可完全并行)
 
 项目根目录:/opt/data/git-repos/skill-present
-CC 必须在项目根目录启动,否则读不到 CLAUDE.md 的项目规则。
+FmodeCode / Claude Code 必须在项目根目录启动,否则读不到 CLAUDE.md 的项目规则。
 ```
 
 ---
@@ -80,7 +128,7 @@ CC 必须在项目根目录启动,否则读不到 CLAUDE.md 的项目规则。
 7. 禁止事项(不要重写、不要改标题、不要改结构)
 ```
 
-任务书写入临时文件 `/tmp/cc-xxx-task.md`,用 `cat` 管道喂入 CC,不用 `$(cat)` 避免路径问题:
+任务书写入临时文件 `/tmp/cc-xxx-task.md`,用 `cat` 管道喂入 FmodeCode / Claude Code,不用 `$(cat)` 避免路径问题:
 
 **正确姿势:**
 ```bash
@@ -95,12 +143,12 @@ cat /tmp/cc-xxx-task.md | /opt/data/npm-global/bin/claude -p --dangerously-skip-
 
 ---
 
-## 三、Hermes 协同工具调用表(核心实操)
+## 三、FmodeAgent / Hermes Agent 协同工具调用表(核心实操)
 
 ### 3.1 启动心智 — terminal + background + notify
 
 ```python
-# Hermes 代码中:
+# FmodeAgent / Hermes Agent 代码中:
 terminal(
     command=f"""
     export PATH="/opt/data/npm-global/bin:$PATH"
@@ -156,7 +204,7 @@ read_file(path="{repo}/path/to/architecture.md")
 
 ```python
 # 检查 settings.json 确保模型名正确
-# 用户钦点:Hermes=deepseek/deepseek-v4.1-flash, CC=deepseek/deepseek-v4.1-flash[1m]
+# 用户钦点:FmodeAgent / Hermes Agent=deepseek/deepseek-v4.1-flash, FmodeCode / Claude Code=deepseek/deepseek-v4.1-flash[1m]
 terminal("cat {project_root}/.claude/settings.json", timeout=5)
 # 如发现模型名不对,patch 修正
 ```
@@ -169,7 +217,7 @@ terminal("cat {project_root}/.claude/settings.json", timeout=5)
 收到复杂任务
 ├→ 可以拆成 2-5 个独立维度?
-│   ├→ 否 → 单一 CC 进程处理 或 本 Agent 直接完成
+│   ├→ 否 → 单一 FmodeCode / Claude Code 进程处理 或 本 Agent 直接完成
 │   └→ 是 → 继续
 ├→ 子单元之间有依赖关系?
@@ -179,13 +227,13 @@ terminal("cat {project_root}/.claude/settings.json", timeout=5)
 │   └→ 否 → 全并行启动
 ├→ 每个子单元的工作量?
-│   ├→ 简单(< 50 行代码/单页)→ 不启 CC,本 Agent 直接写
-│   ├→ 中等(需要完整思考/调研/创作)→ 独立 CC 进程
+│   ├→ 简单(< 50 行代码/单页)→ 不启 FmodeCode / Claude Code,本 Agent 直接写
+│   ├→ 中等(需要完整思考/调研/创作)→ 独立 FmodeCode / Claude Code 进程
 │   └→ 复杂(需要跨文件多模块/项目级)→ 优先用 kanban_create 委派给 fullstack profile
 ├→ 项目目录正确吗?
-│   ├→ 每个 CC 必须在项目根目录启动
-│   └→ 错目录 → CC 读不到 CLAUDE.md → 规则丢失 → 出次品
+│   ├→ 每个 FmodeCode / Claude Code 必须在项目根目录启动
+│   └→ 错目录 → FmodeCode / Claude Code 读不到 CLAUDE.md → 规则丢失 → 出次品
 └→ 启动后:
     ├→ 60s 后检查存活
@@ -225,9 +273,9 @@ terminal(f"tail -30 {log_path}", timeout=10)
 
 # 2. 如果是"从零重做"(完全失败)
 #    缩小范围:大任务拆小
-#    禁用 CC 的某些能力:机器产出内容需要再确认
+#    禁用 FmodeCode / Claude Code 的某些能力:机器产出内容需要再确认
 
-# 3. 连败 3 次同域 → 停止 CC 重试
+# 3. 连败 3 次同域 → 停止 FmodeCode / Claude Code 重试
 #    本 Agent 直接处理 或 拆成更细的原子指令
 ```
 
@@ -237,11 +285,11 @@ terminal(f"tail -30 {log_path}", timeout=10)
 
 ```
 Step 1: 认知拆解
-Hermes 消化用户需求:"四个主题需要图文并茂增强,框架不动,加图"
+FmodeAgent / Hermes Agent 消化用户需求:"四个主题需要图文并茂增强,框架不动,加图"
 → 四主题可完全并行,项目根目录=skill-present
 
 Step 2: 心智分化  
-Hermes 为每个主题编写独立任务书(/tmp/cc-v6-0x-resume.md)
+FmodeAgent / Hermes Agent 为每个主题编写独立任务书(/tmp/cc-v6-0x-resume.md)
 每份包含:当前 commit hash + 结构框架 + 纪律 + 验收标准
 
 Step 3: 并行启动
@@ -276,7 +324,7 @@ push 所有 commit → OBS sync → CDN 刷新 → URL 验证 → 发用户
 - ✅ `cat task.md | claude -p` → 管道直送,无文件路径依赖
 
 ### 7.2 项目根目录
-- ❌ 在父目录启动 CC → CC 读不到 `.claude/rules/`
+- ❌ 在父目录启动 FmodeCode / Claude Code → 读不到 `.claude/rules/`
 - ✅ 必须在 git 项目根目录启动(读得到 CLAUDE.md + rules + settings.json)
 
 ### 7.3 图片验证只看 200
@@ -295,15 +343,15 @@ push 所有 commit → OBS sync → CDN 刷新 → URL 验证 → 发用户
 
 ## 八、技能与本 Agent 内置工具的关系
 
-本技能**不替代** Hermes 内置工具,而是**编排**它们:
+本技能**不替代** FmodeAgent / Hermes Agent 内置工具,而是**编排**它们:
 
 ```
-Hermes 收到任务
+FmodeAgent / Hermes Agent 收到任务
 ├→ skill-heterarchy(本技能)→ 决策是否启用异层认知
 │   └→ 认知分化 → 写任务书
-├→ terminal(Hermes 工具)→ 后台启动 CC 进程
+├→ terminal(FmodeAgent / Hermes Agent 工具)→ 后台启动 FmodeCode / Claude Code 进程
 ├→ process_manage → 监控存活
 ├→ read_file / patch / git → 收敛验证
 ├→ web_search → 前置调研
@@ -312,8 +360,481 @@ Hermes 收到任务
 
 **何时用 delegate_task 而不是 Heterarchy?**
 - 子任务是"帮我查点东西"(轻量检索)→ `delegate_task`
-- 子任务是"完整思考 + 产出可交付物" → Heterarchy CC
+- 子任务是"完整思考 + 产出可交付物" → Heterarchy + FmodeCode / Claude Code
 
 **何时用 kanban_create 而不是 Heterarchy?**
 - 任务需要跨 Profile 的独立 MCP 环境 → `kanban_create`
-- 任务在本 Agent 的能力范围内,只是需要并行 → Heterarchy
+- 任务在本 Agent 的能力范围内,只是需要并行 → Heterarchy
+
+---
+
+## X、execute_code 批量分析模式
+
+当要对**多个文件/多条数据**做 grep、统计、聚合、转换时,不要用一串 `terminal()` 逐个敲。改用 FmodeAgent / Hermes Agent 内置的 `execute_code`(Python 内核),一次进程内跑完。
+
+### X.1 适用场景
+
+| 场景 | 例子 |
+|------|------|
+| 跨目录 grep + 聚合 | 统计所有技能里各模型名的出现次数 |
+| 多 HTTP 请求并行测试 | 一次性 curl 全部产物 URL 并汇总 Content-Type |
+| 批量文件读写 + 统计 | 扫描所有 `.html`,统计图片引用数 |
+| 数据格式转换 | JSON ↔ CSV ↔ YAML 互转 |
+| git diff 分析 | 汇总一次 commit 涉及的文件类型/行数 |
+
+### X.2 原则
+
+> **超过 2 个文件需要 grep / 统计 / 聚合 → 用 `execute_code`,而不是逐个 `terminal`。**
+
+逐个 `terminal` 的代价:每个文件一轮往返 + 一次进程启动开销;`execute_code` 把这些压成**一次调用、一个摘要**。
+
+### X.3 模板
+
+```python
+import os, json, subprocess, glob
+
+# 1. 收集目标
+targets = glob.glob("/opt/data/git-repos/*/SKILL.md")
+
+# 2. 批量处理
+summary = []
+for t in targets:
+    try:
+        with open(t, encoding="utf-8") as f:
+            text = f.read()
+        summary.append({
+            "path": t,
+            "lines": text.count("\n") + 1,
+            "has_version": "version:" in text,
+        })
+    except Exception as e:
+        summary.append({"path": t, "error": str(e)})
+
+# 3. 只打印结果摘要(不要 print 原始大文本,会污染上下文)
+print(f"扫描 {len(summary)} 个文件")
+print(json.dumps([s for s in summary if s.get("error")], ensure_ascii=False, indent=2))
+print("缺失 version 的文件数:", sum(1 for s in summary if not s.get("has_version")))
+```
+
+### X.4 纪律
+
+- **只 print 摘要**,不要把整个文件内容倒进上下文——那等于没省。
+- 需要逐条证据时,print 结构化 JSON(`json.dumps(..., indent=2)`)而不是裸文本。
+- 网络类批量任务用 `concurrent.futures.ThreadPoolExecutor` 并发,不要 for 循环串行 curl。
+- `execute_code` 适合**确定性脚本活**;需要"整体思考/创作"的部分仍走 §三 的 FmodeCode / Claude Code 派发。
+
+---
+
+## Y、多任务进度表(状态看板)
+
+FmodeAgent / Hermes Agent 在同时推进多个 FmodeCode / Claude Code 后台任务时,**每次回复用户前**先构造一张状态表,让用户一眼看清全局。不要只说"还在跑"。
+
+### Y.1 状态看板模板
+
+```python
+# 每次回复用户前构造(在 execute_code 或直接拼字符串)
+tasks = [
+    ("主题一 · 数字分身", "running",  "3m12s"),
+    ("主题二 · Harness",  "done",     "4m05s"),
+    ("主题三 · Loop",     "failed",   "1m47s"),
+]
+
+ICON = {"running": "🟡 运行中", "done": "✅ 已完成", "failed": "❌ 失败(重派)"}
+
+rows = "\n".join(
+    f"| {name} | {ICON[status]} | {dur} |" for name, status, dur in tasks
+)
+print(f"""
+| 任务 | 状态 | 时长 |
+|------|------|------|
+{rows}
+""")
+```
+
+输出示例:
+
+```
+| 任务 | 状态 | 时长 |
+|------|------|------|
+| 主题一 · 数字分身 | 🟡 运行中 | 3m12s |
+| 主题二 · Harness | ✅ 已完成 | 4m05s |
+| 主题三 · Loop | ❌ 失败(重派) | 1m47s |
+```
+
+### Y.2 纪律
+
+- **状态三态**:🟡 运行中 / ✅ 已完成 / ❌ 失败(重派)——不要造模糊词。
+- **时长要真实**:从 `process_manage(action="list")` 的 `uptime_seconds` 或启动时间戳推算,不要拍脑袋。
+- 失败项必须注明**下一步动作**(重派/续做/放弃),否则看板只是情绪价值。
+- 状态表是给用户的**唯一真相源**:有它就不必再让用户追问"到哪了"。
+
+---
+
+## Z、主 Session 不阻塞(异步回执模式)
+
+Heterarchy 的核心承诺:**主 Session 永远不被某个 FmodeCode / Claude Code 任务卡住**。收到请求后立即回执,派完就撒手,靠 notify 回调驱动后续。
+
+### Z.1 标准流程
+
+```
+收到用户请求
+  ├→ ① 立即发一条回执:「已收到,开始执行,分配 X 个任务同时进行」
+  ├→ ② 全 FmodeCode / Claude Code Dispatch:terminal(background=True, notify=True) 全部同轮发出(见 §〇)
+  ├→ ③ 不等完成,先回复用户:「任务已派发,等完成通知」
+  └→ ④ 当 FmodeCode / Claude Code notify 到达(作为新消息进来),再验证并交付
+```
+
+### Z.2 关键点
+
+| 步骤 | 要点 |
+|------|------|
+| ① 回执 | 明确告知**拆成几个任务**、**预计并行**,让用户安心 |
+| ② 派发 | 所有 `terminal(background=True, notify=True)` **同一轮**发出,不要等第一个再发第二个 |
+| ③ 撒手 | 派发完**立刻**回复用户,**绝不**用前台 `sleep` 干等 |
+| ④ 回调 | notify 到达 = 一次新的唤醒,此时才 `git log` / 验证 / 交付 |
+
+### Z.3 反模式
+
+```
+❌ 派发 → 前台 sleep 600 → 查状态 → 再 sleep → ...(主 Session 被阻塞,用户干等)
+✅ 派发 → 立即回复 → 挂起 → notify 唤醒 → 验证交付
+```
+
+**为什么重要**:前台阻塞会占满对话轮次、无法响应用户中途插话、也无法同时推进其它任务。异步回执把"等待"交给事件系统,主 Session 只负责**编排**。
+
+---
+
+## W、超时兜底机制
+
+每个 FmodeCode / Claude Code 任务必须设 `timeout=1800`(30 分钟)。terminal 前台最大 600s,超过会自动转后台 + notify。
+
+### W.1 派发时统一带上超时
+
+```python
+terminal(
+    command=f"cat {task_file} | /opt/data/npm-global/bin/claude -p --dangerously-skip-permissions > {log} 2>&1",
+    background=True,
+    notify=True,
+    timeout=1800,          # ← 30 分钟硬上限
+    workdir=project_root,
+)
+```
+
+### W.2 超时处理流程
+
+```
+notify: timeout (exit 124)
+  ├→ tail -30 log → 看中途产物
+  ├→ 如果已有部分产出:
+  │   └→ 写接力任务书(标明已完成部分 + 待做部分)→ 重派
+  ├→ 如果零产出(空日志):
+  │   └→ 改小任务范围,重新派发
+  └→ 连续 2 次超时 → 拆分子任务更小粒度
+```
+
+### W.3 诊断命令
+
+```python
+# exit 124 = timeout;先看日志尾部和是否已 commit
+terminal(f"tail -30 {log_path}", timeout=10)
+terminal(f"cd {repo} && git log --oneline -3", timeout=10)   # 有无中途 commit?
+```
+
+### W.4 处置矩阵
+
+| 症状 | 判断 | 处置 |
+|------|------|------|
+| exit 124 + 日志有产物 | 大任务未跑完 | 写**接力任务书**:已完成 X / 待做 Y |
+| exit 124 + 日志空 | 卡在启动/首轮推理 | 缩小范围重派,或换更小模型 |
+| 连续 2 次 exit 124 | 任务粒度过大 | 拆成更小原子子任务 |
+| 日志刷屏无进展 | 死循环/反复重试 | 杀进程,改任务书约束(禁某操作) |
+
+**铁律**:超时**不等于失败**——先看中途产物。有产物就走接力(省时省 token),零产物才重做。
+
+---
+
+## V、拓扑排序(有依赖的任务分批并行)
+
+当子单元之间**存在依赖**时,不能无脑全并行。先建模依赖图,再分批:无依赖的批次并行,有依赖的批次等前置完成。
+
+### V.1 依赖建模
+
+```
+task_a → task_b → task_c   (串行链)
+task_a → task_b            (task_b 依赖 task_a)
+         task_c            (task_c 独立,与 a/b 无依赖)
+```
+
+### V.2 分批并行启动
+
+```
+第 1 批(无依赖):task_a + task_c 同时启动
+  → 等 task_a 完成 → 取产出
+第 2 批(依赖 task_a):task_b 启动
+  → 等 task_b 完成
+交付
+```
+
+### V.3 执行要点
+
+| 要点 | 说明 |
+|------|------|
+| 批内并行 | 同批任务**同一轮**发出(§〇),互不等待 |
+| 批间串行 | 下一批要等本批**关键路径**任务完成 |
+| 跨批传料 | 前置任务的 commit / 文件作为后置任务书的 inline 素材(§3.4) |
+| 关键路径优先 | 先启动最长依赖链的头,让串行链尽早开跑 |
+
+### V.4 与 §四决策树的衔接
+
+§四的决策树已判定"有依赖 → 拓扑排序,分批并行"。本章是它的**落地细则**:
+- 依赖图为空 → 退化为全并行(第 1 批装下所有任务);
+- 依赖图为链 → 每批只放 1 个,退化为串行,但**每批内部仍尽量并发**无关任务。
+
+**一句话**:能并的并、该等的等——用依赖图说话,不靠感觉。
+
+---
+
+## U、结果聚合汇报
+
+当多个 FmodeCode / Claude Code 任务全部完成(或部分失败)后,**统一聚合成一张交付汇总表**,而不是把 N 个任务的日志碎片甩给用户。
+
+### U.1 聚合模板
+
+```python
+results = []
+for notify in notifies:
+    log = read_log(notify.log_path)
+    if "commit" in log or success_marker(log):
+        results.append(("✅", notify.task_name, notify.url))
+    else:
+        results.append(("❌", notify.task_name, error_of(log)))
+
+rows = "\n".join(f"| {name} | {mark} | {link} |" for mark, name, link in results)
+print(f"""
+## 并行任务交付汇总
+| 任务 | 结果 | 链接 |
+|------|------|------|
+{rows}
+""")
+```
+
+### U.2 纪律
+
+- **先验证再汇总**:每条结果都要经过 `git log` + URL Content-Type 验证(§T / §P),不能拿"日志看着像成功"充数。
+- **失败项必须带错误**:`❌` 行要写清原因(超时/503/空日志),便于用户决策。
+- **汇总表 = 交付凭证**:表里每个 ✅ 都是可点击验证的链接。
+- 部分失败**不阻塞交付**:先交付成功的,失败的进入 §W/§五 的重派队列,并在表下注明"重派中"。
+
+---
+
+## T、OBS + CDN 部署验证链
+
+FmodeCode / Claude Code 产出 HTML / 图片后,部署链路必须**逐环节验证**,不能 sync 完就当完事。
+
+### T.1 部署链
+
+```
+1. OBS sync → obs://www-fmode.cn/dev/xxx/
+2. CDN 刷新(华为云 CDN 缓存清除)
+3. 验证所有 URL
+```
+
+### T.2 逐 URL 验证
+
+```bash
+for url in $ARTIFACTS; do
+  code=$(curl -m 10 -o /dev/null -w "%{http_code}" "$url")
+  ct=$(curl -m 10 -o /dev/null -w "%{content_type}" "$url")
+  if [[ "$code" != "200" ]]; then echo "❌ HTTP $code  $url"; continue; fi
+  case "$ct" in
+    text/html*|image/*|application/*) echo "✅ $code $ct  $url" ;;
+    *) echo "❌ 类型异常: $ct  $url" ;;
+  esac
+done
+```
+
+### T.3 Python 版(批量)
+
+```python
+import subprocess
+
+def check(url):
+    code = subprocess.run(["curl","-m","10","-o","/dev/null","-w","%{http_code}",url],
+                          capture_output=True, text=True).stdout
+    ct = subprocess.run(["curl","-m","10","-o","/dev/null","-w","%{content_type}",url],
+                        capture_output=True, text=True).stdout
+    ok = code == "200" and ct.startswith(("text/html","image/","application/"))
+    return ok, code, ct
+
+bad = [(u, c, t) for u in artifacts for ok, c, t in [check(u)] if not ok]
+print("全部通过" if not bad else f"❌ {len(bad)} 个异常: {bad}")
+```
+
+### T.4 纪律
+
+- **CDN 刷新后必须重验**:不刷新可能拿到旧缓存,刷新后可能拿到 404——两头都要 curl。
+- **断言而非观察**:`assert resp == 200` / `assert ct.startswith(...)`,不满足就报错,不要"看着还行"。
+- 部署链是**串行依赖**(sync → 刷新 → 验证),天然适合 §V 的拓扑链:每步是上一步的依赖。
+
+---
+
+## S、FmodeCode / Claude Code 环境自举
+
+每次启动 FmodeCode / Claude Code 前必须确保环境变量齐备,否则轻则 401/503,重则 exit 127。
+
+### S.1 必备环境
+
+```bash
+export PATH="/opt/data/npm-global/bin:$PATH"
+export ANTHROPIC_AUTH_TOKEN=$FMODE_API_KEY
+export ANTHROPIC_BASE_URL=https://api.fmode.cn
+```
+
+或**内联**写进 terminal 命令(推荐,避免 shell 状态不持久):
+
+```python
+terminal(
+    command=f"""
+    export PATH="/opt/data/npm-global/bin:$PATH"
+    export ANTHROPIC_AUTH_TOKEN=$FMODE_API_KEY
+    export ANTHROPIC_BASE_URL=https://api.fmode.cn
+    cd {project_root}
+    cat {task_file} | /opt/data/npm-global/bin/claude -p --dangerously-skip-permissions > {log} 2>&1
+    """,
+    background=True, notify=True, timeout=1800, workdir=project_root,
+)
+```
+
+### S.2 settings.json 模型名
+
+```python
+# 必须写入正确的模型名,少前缀会 503
+terminal(f"cat {project_root}/.claude/settings.json", timeout=5)
+# FmodeCode / Claude Code 模型:deepseek/deepseek-v4.1-flash[1m]
+```
+
+### S.3 自举检查清单
+
+| 检查项 | 失败症状 | 修法 |
+|--------|----------|------|
+| `PATH` 含 npm-global | exit 127 `command not found` | 绝对路径 `/opt/data/npm-global/bin/claude` |
+| `ANTHROPIC_AUTH_TOKEN` | 401 / Not logged in | `=$FMODE_API_KEY` |
+| `ANTHROPIC_BASE_URL` | 连不上网关 | `https://api.fmode.cn` |
+| settings.json 模型名 | 503 No available channel | 补全 `deepseek/` 前缀 |
+
+**纪律**:环境设置**内联**在启动命令里,不要依赖"上一次 export 还在"——后台进程与交互 shell 状态不共享。
+
+---
+
+## R、工作目录纪律
+
+FmodeCode / Claude Code 进程的工作目录**决定它能否读到项目规则**。目录错了,规则静默丢失,产出必是次品。
+
+### R.1 铁律
+
+- 每个 FmodeCode / Claude Code 进程的 `workdir` **必须**设为 **git 项目根目录**。
+- 错目录 → FmodeCode / Claude Code 读不到 `.claude/rules/` / `CLAUDE.md` / `settings.json` → **规则丢失**。
+- 在 `terminal()` 内用 `cd {workdir} && ...` **双重保证**(`workdir` 参数 + 命令内 `cd`)。
+
+### R.2 正误对照
+
+```python
+# ✅ 双重保证
+terminal(
+    command=f"cd {project_root} && cat {task_file} | /opt/data/npm-global/bin/claude -p ...",
+    workdir=project_root,
+    background=True, notify=True,
+)
+
+# ❌ 在父目录启动 → 读不到 .claude/rules/ → 规则丢失
+terminal(command="cat task.md | claude -p ...", workdir="/opt/data/git-repos")
+```
+
+### R.3 为什么双重
+
+- `workdir` 参数是**声明**,但某些封装/重定向可能不生效;
+- 命令内 `cd` 是**执行保证**,两者叠加才能确保万无一失。
+- 派发前先确认根目录:`git rev-parse --show-toplevel` 的结果应与 `project_root` 一致。
+
+---
+
+## Q、版本规范与发布检查
+
+### Q.1 版本号小步迭代
+
+```
+0.0.1 → 0.0.12 → 0.0.99 → 0.1.1
+```
+
+- **只增不减**:新版本号必须**大于**当前已发布/已提交的版本,绝不回退。
+- **小步快跑**:补丁 +0.0.1,新增能力 +0.1.0,破坏性变更 +1.0.0。
+- **三处对齐**:`SKILL.md` frontmatter、`package.json`、`lib/index.mjs`(`VERSION`)必须一致。
+
+### Q.2 发布前检查清单
+
+引用 **skill-core-guide §3.5** 的 13 项发布前检查(逐项勾选,缺一不可):
+
+1. frontmatter 必填字段齐全(name/description/version/author/license/tags)
+2. `description` 写清"何时用"而非"是什么"
+3. 版本号三处对齐且单调递增
+4. `package.json` `files` 字段精确声明发布内容
+5. `main`/`exports` 指向 `lib/index.mjs`
+6. `bin` 可执行且有 shebang
+7. 无硬编码密钥/凭据
+8. README 含简介 / 快速开始 / 许可
+9. LICENSE 与 frontmatter 的 `license` 一致
+10. 商标声明完整(未来飞马 / Harness Loop / RSI)
+11. 六项自动质检全绿(`skip` 不算通过)
+12. 四渠道版本号一致
+13. commit message 不含内部工具名
+
+### Q.3 四渠道发布
+
+```
+Gogs → GitHub → npm → skillhub
+```
+
+- 顺序固定:先内网 Gogs,再 GitHub,再 npm,最后 skillhub 上架。
+- 每渠道发布后**验证**:npm 用 `npm view <pkg> version`,git 用 `git ls-remote`。
+- 任一渠道失败 → 停止后续渠道,先修复,避免版本分叉。
+
+---
+
+## P、CDN 验证铁律
+
+### P.1 200 ≠ 真 200
+
+> 对象存储/CDN 在资源不存在时,**可能返回 404 首页且 HTTP 状态是 200**。
+
+只看 `%{http_code}` 会得到**假绿**。必须叠加 **Content-Type** 判断。
+
+### P.2 分类型验证
+
+| 资源 | 必须满足 |
+|------|----------|
+| 图片 | `Content-Type: image/*` |
+| HTML | `Content-Type: text/html` |
+| 其它(JS/CSS/JSON) | `Content-Type: application/*` |
+
+### P.3 逐 URL 验证,不可跳过
+
+```bash
+# ✅ 同时取 code 和 content_type
+curl -m 10 -o /dev/null -w "%{http_code} %{content_type}\n" "$url"
+```
+
+```python
+# ✅ 断言式:不满足即报错
+assert code == "200", f"HTTP {code}: {url}"
+assert ct.startswith(("text/html", "image/", "application/")), f"类型异常 {ct}: {url}"
+```
+
+### P.4 铁律汇总
+
+1. **200 不是通行证**——必须看 Content-Type。
+2. **逐 URL 验证**,不接受"抽查几个"。
+3. **断言而非目测**——写成 `assert`,失败即中断。
+4. **CDN 刷新前后各验一次**(§T)——防旧缓存、防刷新后 404。
+5. **图裂是最隐蔽的坑**——404 首页的 200 会让 HTML 看着正常,实际图全裂。
+
+**一句话**:每个 URL 都要 `curl + code + content_type` 三重确认,一个都不能跳。

+ 1 - 1
lib/index.mjs

@@ -10,5 +10,5 @@
 // "Harness Loop", "RSI", and associated slogan "让AI进化提前发生,让AI落地快人一步".
 // Any use of these trademarks requires separate written permission.
 
-export const VERSION = '1.1.0';
+export const VERSION = '1.2.0';
 export const SKILL_NAME = 'skill-heterarchy';

+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@fmode/skill-heterarchy",
-  "version": "1.1.0",
+  "version": "1.2.0",
   "description": "内异层认知协同 — 在单一智能体主体内部分化多心智并行思考,主控不阻塞、子单元互校验、阻塞自愈。超级技能(ESM 多端可用)。",
   "type": "module",
   "main": "./lib/index.mjs",
@@ -47,7 +47,7 @@
     "驾驭工程"
   ],
   "author": "Yuyang001 (FmodeAgent)",
-  "license": "MIT",
+  "license": "MPL-2.0",
   "repository": {
     "type": "git",
     "url": "git+https://github.com/fmodecn/skill-heterarchy.git"

+ 1 - 1
skill-package-manifest.json

@@ -1,6 +1,6 @@
 {
   "name": "skill-heterarchy",
-  "version": "1.0.0",
+  "version": "1.2.0",
   "description": "\u5185\u5f02\u5c42\u8ba4\u77e5\u534f\u540c",
   "skills": [
     {