代码插件 扫描中
SmartContext — Intelligent Conversation Guidelines — 插件工具
v1.0.7The plugin's code, commands, and runtime instructions are consistent with its stated purpose (injecting domain-specific conversation guidelines), but installing untrusted SKILL.md files can inject arbitrary instructions into every conversation — review skill content before installing.
0· 7·0 当前
by @hherosoul
安全扫描
OpenClaw
扫描中
high confidenceThe plugin's code, commands, and configuration are consistent with its stated purpose (injecting domain-specific, tiered conversation guidelines); nothing in the bundle indicates covert exfiltration or unrelated privilege requests.
安全有层次,运行前请审查代码。
版本
latestv1.0.72026/4/5
● Pending
安装命令 点击复制
官方npx clawhub@latest install @smartcontext/openclaw-plugin
镜像加速npx clawhub@latest install @smartcontext/openclaw-plugin --registry https://cn.clawhub-mirror.com
插件文档
SmartContext — Intelligent Conversation Guidelines
专业对话导航系统:向每一次对话注入领域特定的、分级的重要性准则,帮助 LLM 专注于关键信息,提升专业对话的质量和效率。
目录
项目概述
SmartContext 是为 OpenClaw 设计的专业对话导航系统,通过 Plugin + Skill 的混合架构,实现领域特定规则的灵活扩展和动态注入。
核心价值
- 精准导航: 基于 5 层重要性分级体系 (Tier 0-4),帮助 LLM 理解什么重要
- 领域适配: 可插拔的 Skill 架构,支持任意专业领域
- 手动控制: 用户显式指定活跃领域,精确控制规则生效
- 无侵入集成: 通过
before_prompt_build钩子注入准则,不影响 memory-core - 多领域协作: 支持跨领域协作,自动处理规则冲突
核心特性
1. 5 层优先级分级体系
| 层级 | 描述 | 示例 |
|---|---|---|
| Tier 0 | 始终优先(绝不能忽视) | 用户画像、架构决策、强约束 |
| Tier 1 | 最高优先级关注 | 代码审查、性能优化、安全设计 |
| Tier 2 | 高优先级注意 | 需求文档、详细设计、测试用例 |
| Tier 3 | 记住这些 | 编码规范、项目配置、调试记录 |
| Tier 4 | 可以简要参考 | 通用知识、确认回复、重复内容 |
2. Plugin + Skill 混合架构
SmartContext Plugin (框架)
├── 核心: 准则注入引擎
├── 配置: 领域选择管理
└── 扩展: Skill 加载器
Skill (领域规则)
├── 通用 (general-purpose)
├── 软件工程 (software-engineering)
├── 生物信息学 (bioinformatics)
└── 花艺 (floriculture)3. 用户角色适配
支持通过角色标签动态调整规则优先级:
| 标签 | 提升项 |
|---|---|
frontend | UI 约束、组件设计、样式方案 |
backend | API 契约、数据库设计、性能指标 |
architect | 架构决策、模块划分、技术选型 |
devops | 部署配置、CI/CD 流程、监控 |
fullstack | 各层均衡,不调整 |
4. 多领域组合
支持同时激活多个领域,自动处理规则冲突和跨领域协作。
快速开始
安装
在 OpenClaw 中配置插件:
// openclaw.config.ts
{
plugins: {
entries: {
"smartcontext": {
enabled: true,
config: {
activeDomains: ["software-engineering"],
roleTags: ["frontend"],
pinnedItems: ["本项目使用 TypeScript"]
}
}
}
}
}基本使用
# 查看当前配置
/smartcontext-config
# 列出可用领域
/smartcontext-list
# 切换到指定领域
/smartcontext-use software-engineering
# 添加领域
/smartcontext-add bioinformatics
# 移除领域
/smartcontext-remove software-engineering
# 设置用户角色
/smartcontext-set-role frontend typescript react
# 添加角色标签
/smartcontext-add-role backend
# 移除角色标签
/smartcontext-remove-role frontend
# 清除用户角色
/smartcontext-clear-role
# 标记重要内容
/smartcontext-pin "本项目必须支持离线功能"
# 取消标记
/smartcontext-unpin 0使用指南
配置说明
| 配置项 | 类型 | 说明 | 默认值 |
|---|---|---|---|
activeDomains | string[] | 启用的领域 ID 列表 | [] |
roleTags | string[] | 用户角色标签 | [] |
pinnedItems | string[] | 用户手动标记的重要内容 | [] |
Skill 扩展
创建自定义领域 Skill:
# 1. 创建 Skill 目录
mkdir -p skills/smartcontext-my-domain
# 2. 创建 SKILL.md 文件
# 按照规范编写领域规则
# 3. 启用该领域
/smartcontext-add my-domainSkill 格式参考 papers/SmartContext-设计文档.md。
文档
完整文档位于 papers/ 目录:
| 文档 | 说明 |
|---|---|
| SmartContext-设计文档.md | 插件设计方案,核心能力和流程 |
| SmartContext-架构设计文档.md | 详细架构设计,模块说明 |
| SmartContext-完整实施方案.md | 完整实施指南,开发测试部署 |
| SmartContext-Prompt设计文档.md | Prompt 设计优化,示例和测试 |
项目结构
smartcontext-plugin/
├── openclaw.plugin.json # Plugin Manifest
├── package.json # npm 包配置
├── tsconfig.json # TypeScript 配置
├── vitest.config.ts # 测试配置
├── README.md # 项目说明
│
├── src/
│ ├── index.ts # 插件入口
│ ├── types.ts # 全局类型定义
│ │
│ ├── core/
│ │ ├── guideline-engine.ts # 准则生成引擎
│ │ ├── skill-loader.ts # Skill 发现与加载
│ │ ├── domain-composer.ts # 多领域规则组合
│ │ ├── role-adapter.ts # 用户角色适配
│ │ ├── prompt-builder.ts # Prompt 文本拼接器
│ │ ├── skill-discovery.ts # Skill 发现器
│ │ └── skill-manager.ts # Skill 管理器
│ │
│ ├── commands/
│ │ └── index.ts # 命令注册入口
│ │
│ ├── config/
│ │ ├── schema.ts # 配置 Schema
│ │ ├── defaults.ts # 默认配置值
│ │ └── store.ts # 配置存储
│ │
│ └── utils/
│ ├── markdown-parser.ts # Skill Markdown 解析器
│ ├── logger.ts # 日志工具
│ └── cache.ts # 内存缓存
│
├── skills/ # 内置 Skill
│ ├── smartcontext-general-purpose/
│ ├── smartcontext-software-engineering/
│ ├── smartcontext-bioinformatics/
│ └── smartcontext-floriculture/
│
├── papers/ # 文档
│ ├── SmartContext-设计文档.md
│ ├── SmartContext-架构设计文档.md
│ ├── SmartContext-完整实施方案.md
│ └── SmartContext-Prompt设计文档.md
│
├── dist/ # 构建输出
└── tests/ # 测试开发与贡献
本地开发
# 1. 安装依赖
npm install
# 2. 构建项目
npm run build
# 3. 运行测试
npm test
# 4. 开发模式 (监听变化)
npm run test:watch测试覆盖率
# 生成覆盖率报告
npm run test:coverage
# 查看覆盖率报告
open coverage/index.html发布到 ClawHub
参考 papers/SmartContext-完整实施方案.md 中的部署指南。
与 OpenClaw 的职责边界
| 职责 | OpenClaw | SmartContext Plugin |
|---|---|---|
| 上下文管理 | ✅ 完全负责 | ❌ 不介入 |
| 内存压缩 | ✅ 完全负责 | ❌ 不介入 |
| Prompt 构建 | ✅ 完全负责 | ✅ 注入系统上下文 |
| 领域规则扩展 | ❌ 不提供 | ✅ Plugin + Skill 架构 |
| 用户配置管理 | ❌ 不提供 | ✅ 提供命令行接口 |
许可证
本项目采用 MIT 许可证。
致谢
感谢 OpenClaw 团队提供的优秀 Plugin SDK。
SmartContext — 让专业对话更高效!
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制