← Back to Skills Marketplace
534422530

意图分类器

by 534422530 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
39
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install intent-classifier
Description
意图分类器 - 原创技能。实时分析用户输入,识别真实意图并路由到对应处理流程。支持代码、提问、请求、闲聊等类型识别,适用于AI助手任务调度、智能路由、对话理解等场景。
README (SKILL.md)

⚠️ 发布规则

所有发布到ClawHub的技能必须严格测试,确定没有问题再发布


技能测试验证清单

  • frontmatter格式正确
  • 功能原创且实用
  • 分类体系完整
  • 路由逻辑明确
  • 无语法错误

Intent Classifier - 意图分类器

原创技能 | 激活词: 识别意图 / 分类任务 / 智能路由

核心功能

实时分析用户输入,识别真实意图并路由到对应处理流程。

意图分类体系

一级分类 (4类)

类型 标识 特征词
代码类 CODE 写代码、修复、创建、调试、测试
知识类 KNOW 是什么、为什么、如何、解释
任务类 TASK 帮我、请、帮我做、执行
闲聊类 CHAT 随便聊聊、你好、今天天气

二级分类 (扩展)

CODE:
├── 编写 (write) → 新建文件/功能
├── 修复 (fix) → Bug修复
├── 审查 (review) → 代码审查
├── 测试 (test) → 编写测试
└── 重构 (refactor) → 重构代码

KNOW:
├── 定义 (define) → 解释概念
├── 教程 (tutorial) → 学习路径
├── 对比 (compare) → 比较差异
└── 建议 (advice) → 给出建议

TASK:
├── 文件操作 → 读取/写入/删除
├── 命令执行 → 运行脚本/命令
├── 搜索查询 → 搜索信息
└── 流程编排 → 多步骤任务

CHAT:
├── 问候 (greeting) → 打招呼
├── 反馈 (feedback) → 表达情绪
├── 澄清 (clarify) → 追问细节
└── 结束 (close) → 结束对话

识别算法

关键词匹配

def classify_intent(text: str) -> Intent:
    text_lower = text.lower()
    
    # 代码类关键词
    code_keywords = ['写', '代码', 'function', 'class', 'def', 'fix', 'bug', 'test']
    if any(kw in text_lower for kw in code_keywords):
        return Intent(type='CODE', sub='write' if '写' in text else 'fix')
    
    # 知识类关键词
    know_keywords = ['是什么', '为什么', '如何', '解释', '什么']
    if any(kw in text_lower for kw in know_keywords):
        return Intent(type='KNOW', sub='define')
    
    # 任务类关键词
    task_keywords = ['帮我', '请', '执行', '做']
    if any(kw in text_lower for kw in task_keywords):
        return Intent(type='TASK', sub='general')
    
    # 默认闲聊类
    return Intent(type='CHAT', sub='general')

模式识别

# 复杂模式
patterns = [
    (r'^写一个.*', 'CODE:write'),
    (r'^修复.*bug', 'CODE:fix'),
    (r'^.*是什么', 'KNOW:define'),
    (r'^帮我.*', 'TASK:general'),
    (r'^(hi|你好|hey)', 'CHAT:greeting'),
]

置信度计算

class IntentResult:
    type: str        # 一级分类
    sub: str         # 二级分类
    confidence: float  # 置信度 0-1
    features: list   # 触发特征
    alternative: list # 备选分类

置信度规则

条件 置信度调整
明确关键词 +0.3
完整句子结构 +0.2
无歧义 +0.2
短文本 (\x3C10字) -0.2
多关键词冲突 -0.3

路由策略

直接路由

def route(intent: IntentResult) -> Skill:
    if intent.type == 'CODE':
        if intent.sub == 'write':
            return 'karpathy-principles'  # Karpathy法则
        elif intent.sub == 'fix':
            return 'workflow-verifier'     # 工作流验证
    elif intent.type == 'TASK':
        return 'auto-learn-skill'          # 自动学习
    elif intent.type == 'KNOW':
        return 'mempalace-assistant'       # 记忆搜索
    else:
        return 'general-chat'              # 闲聊模式

技能推荐

意图 推荐技能
写代码 karpathy-principles
修复Bug workflow-verifier
学习知识 mempalace-assistant
积累经验 auto-learn-skill
熵管理 entropy-manager
通用任务 skill-creator

输出格式

## 意图识别结果

### 分类
- **一级类型**: CODE
- **二级类型**: write
- **置信度**: 0.87

### 触发特征
- "写" 关键词
- 完整需求描述
- 代码相关语境

### 路由建议
→ karpathy-principles (Karpathy编程法则)

### 备选
- workflow-verifier (置信度0.12)

应用场景

  1. 智能助手调度 - 自动选择最佳处理技能
  2. 多技能编排 - 复杂任务分解路由
  3. 对话理解 - 深度语义分析
  4. 任务分类 - 自动归类用户请求

集成建议

将本技能与以下技能配合使用:

## 协作技能

- karpathy-principles: 代码生成路由
- workflow-verifier: Bug修复路由
- mempalace-assistant: 知识查询路由
- auto-learn-skill: 经验积累路由
- entropy-manager: 会话熵管理

原创性声明

本技能为原创,融合了:

  • 自然语言处理意图识别
  • 技能路由系统设计
  • AI Agent任务调度
  • 模式匹配算法

作者: laosi 创建日期: 2026-04-28

Usage Guidance
This skill itself is coherent and low-risk, but it routes user inputs to other skills. Before installing or allowing autonomous routing: 1) review the downstream skills it recommends (karpathy-principles, workflow-verifier, mempalace-assistant, auto-learn-skill, entropy-manager, etc.) to ensure none perform sensitive operations or require secrets; 2) test the classifier with varied inputs to confirm it doesn’t misroute; 3) if you are concerned about automated actions, require user confirmation before routing to skills that can perform file/command operations or access credentials; and 4) consider limiting autonomous invocation or applying policy controls to routed skills. If you want further help, provide the manifests of the downstream skills and I can check coherence and privileges for them as well.
Capability Analysis
Type: OpenClaw Skill Name: intent-classifier Version: 1.0.0 The skill bundle is a purely instructional tool designed to help an AI agent classify user intent and route requests to other skills. It contains descriptive markdown and illustrative Python logic for pattern matching and confidence scoring in SKILL.md, with no executable code, network activity, or sensitive data access.
Capability Assessment
Purpose & Capability
Name and description (intent classification and routing) match the SKILL.md: it contains keyword/pattern classifiers and explicit routing rules. No unrelated credentials, binaries, or installs are requested.
Instruction Scope
The SKILL.md only shows text-based classification code and routing logic; it does not instruct reading files, env vars, or contacting external endpoints. Note: the classification schema includes a TASK category that can map to actions like '文件操作' or '命令执行' — this is fine for a router, but it means the classifier may forward requests to other skills that perform sensitive operations. Review those downstream skills before enabling automated routing.
Install Mechanism
No install spec and no code files — instruction-only skill (lowest install risk).
Credentials
No environment variables, credentials, or config paths are requested. Declared requirements are minimal and appropriate for a text-classification skill.
Persistence & Privilege
always:false and default autonomous invocation allowed (normal). Because the skill's purpose is routing, consider the security posture of skills it routes to: autonomous invocation + routing can increase blast radius if downstream skills have elevated privileges.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install intent-classifier
  3. After installation, invoke the skill by name or use /intent-classifier
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
原创技能 - 实时识别用户意图并路由到对应技能
Metadata
Slug intent-classifier
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 意图分类器?

意图分类器 - 原创技能。实时分析用户输入,识别真实意图并路由到对应处理流程。支持代码、提问、请求、闲聊等类型识别,适用于AI助手任务调度、智能路由、对话理解等场景。 It is an AI Agent Skill for Claude Code / OpenClaw, with 39 downloads so far.

How do I install 意图分类器?

Run "/install intent-classifier" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 意图分类器 free?

Yes, 意图分类器 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 意图分类器 support?

意图分类器 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 意图分类器?

It is built and maintained by 534422530 (@534422530); the current version is v1.0.0.

💬 Comments