Tool、Skill、Sub-Agent 散成一地?PluginDescriptor 一次打成业务插件 「Regnexe Python 实战系列」第 3 篇共 10 篇对应仓库examples/readme/03_plugin_packaging.py。上一篇02. Skill 和 Sub-Agent 到底差在哪一个借工具一个有私有工具。痛点能力一多就散成一地变量前两篇里我们已经有了 Tool、Skill、Sub-Agent。问题也随之出现get_weather estimate_trip_cost travel_advisor expense_estimator这些能力如果一直散落在构建代码里很快就会变成“看得见能跑但没人敢改”的状态。regnexe-py 的底层抽象是PluginDescriptor一个插件里可以装多个 CapabilityDescriptor每个能力都有稳定 id。实战代码一个插件打包三种能力示例里的核心代码是这段trip_plugin(PluginDescriptor.builder().plugin_id(trip-plugin).version(1.0).name(Trip Plugin).description(Bundles a tool, a skill, and a sub-agent for trip planning).tool(get_weather)# - trip-plugin.get_weather.skill_config(travel_advisor)# - trip-plugin.travel_advisor.sub_agent_config(expense_estimator)# - trip-plugin.expense_estimator.build())这段代码做了两件事把三种不同能力统一包装成 CapabilityDescriptor自动生成完整能力 idplugin_id.name所以get_weather不再只是一个裸函数而是trip-plugin.get_weather这个业务插件里的能力。踩坑提醒Skill 要写完整能力 id示例里travel_advisor的工具列表是这样写的travel_advisor{name:travel_advisor,tools:[trip-plugin.get_weather],}这里必须是trip-plugin.get_weather不是get_weather。原因很简单Skill 借的是完整能力 id。插件化以后同名工具可能来自不同插件只写裸名称会失去边界。怎么接进 Agent手动构造好的PluginDescriptor可以直接交给with_plugin(...)agent(RegnexeAgentBuilder().with_default_model(Vendor.DEEPSEEK,deepseek-v4-flash).with_plugin(trip_plugin).with_event_listener(ConsoleEventListener()).build())这样第 3 篇只需要关心“怎么把能力打成一个插件”不用提前理解 Marketplace。至于能力市场怎么替换、怎么接数据库后面第 6 篇再单独展开。小结PluginDescriptor.builder()适合这些场景能力定义来自数据库或配置中心需要运行时拼装一个业务插件里混合 Tool、Skill、Sub-Agent你想手动控制插件 id、版本、名称和描述需要把能力从“代码变量”升级成“可管理资产”一句话PluginDescriptor 是 regnexe-py 能力体系的底层真相。 上一篇02. Skill 和 Sub-Agent 到底差在哪一个借工具一个有私有工具 下一篇04. 一个 Python 类一次注册搞定 2 个工具 1 个 Skill 1 个 Sub-Agent 项目地址https://github.com/flower-trees/regnexe-py