# 第十二章 插件扩展与生产落地

本章回答如何把 OpenClaw 用成长期可演进的平台能力。主线是插件体系与工具治理：插件如何启停与白名单化，工具如何纳入策略约束，扩展如何通过自检、探针与日志做成可回放完整流程，并最终形成可上线、可回滚的生产落地方案。通过本章，你将学会如何在保持稳定性的前提下，灵活地扩展 OpenClaw 的能力。

> \[!NOTE] **与第五章的关系**：[第五章](/openclaw_guide/di-er-bu-fen-jin-jie-shi-yong/05_tools_skills.md)从使用者视角介绍工具系统的通识基础（工具分类、策略语义、技能与插件的协同定位）；本章从扩展开发者视角深入插件的工程机制（Hook 架构、生命周期、Manifest 校验），并聚焦生产落地（灰度上线、监控告警、部署检查清单、回滚流程）。如果你尚未阅读第五章，建议先了解工具策略的基本概念再进入本章。

## 本章内容导读

本章包括以下几个小节：

* [**12.1 插件开发体系：自定义扩展的工程机制**](/openclaw_guide/di-san-bu-fen-shi-xian-yuan-li-yu-gong-cheng-luo-di/12_extension_engineering/12.1_plugin_architecture.md)：理解插件体系的配置、启用与安全边界。
* [**12.2 自定义工具：把副作用关进可控边界**](/openclaw_guide/di-san-bu-fen-shi-xian-yuan-li-yu-gong-cheng-luo-di/12_extension_engineering/12.2_custom_tools.md)：掌握自定义工具的治理方法，将副作用收敛到确定性策略中。
* [**12.3 测试与调试：把扩展做成可回放的工程完整流程**](/openclaw_guide/di-san-bu-fen-shi-xian-yuan-li-yu-gong-cheng-luo-di/12_extension_engineering/12.3_testing_debugging.md)：建立扩展的测试、调试与灰度回滚流程。
* [**12.4 生产落地蓝图：扩展可控化**](/openclaw_guide/di-san-bu-fen-shi-xian-yuan-li-yu-gong-cheng-luo-di/12_extension_engineering/12.4_production_blueprint.md)：形成生产落地清单，使扩展可控、可审计、可回放。
* [**12.5 主流框架互操作性指南**](/openclaw_guide/di-san-bu-fen-shi-xian-yuan-li-yu-gong-cheng-luo-di/12_extension_engineering/12.5_framework_interoperability.md)：掌握与其他主流框架的互操作性，扩大生态联动。
* [**12.6 本章小结**](/openclaw_guide/di-san-bu-fen-shi-xian-yuan-li-yu-gong-cheng-luo-di/12_extension_engineering/summary.md)：关键结论与读者自检。

## 学习目标

完成本章的阅读后，你将能够：

1. **开发插件**：理解插件开发的整个工程体系。
2. **编写工具**：设计安全、可控的自定义工具。
3. **测试扩展**：建立完整的测试与调试流程。
4. **上线部署**：从开发到生产的完整交付流程。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yeasy.gitbook.io/openclaw_guide/di-san-bu-fen-shi-xian-yuan-li-yu-gong-cheng-luo-di/12_extension_engineering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
