skills/behavior-prediction/SKILL.md
# Behavior Prediction Skill V2 为 AI 助手提供用户行为预测能力。通过记录和分析用户的会话内容,学习用户的工作流程、偏好和习惯,提供智能预测和个性化交互。 ## 安装说明 ### 安装步骤 安装此 Skill 需要完成以下两步: #### 1. 安装脚本文件 将 `scripts/` 目录复制到 Cursor skills 目录: ```bash # 全局安装(推荐,所有项目共享) cp -r scripts/ ~/.cursor/skills/behavior-prediction/scripts/ # 或项目级安装(仅当前项目使用) cp -r scripts/ .cursor/skills/behavior-prediction/scripts/ ``` #### 2. 安装规则文件(重要) 将 `rules/behavior-prediction.mdc` 复制到 Cursor rules 目录: ```bash # 全局安装(推荐,所有项目生效) cp rules/behavior-prediction.mdc ~/.cu
npx skillsauth add shetengteng/skillix-hub skills/behavior-predictionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
为 AI 助手提供用户行为预测能力。通过记录和分析用户的会话内容,学习用户的工作流程、偏好和习惯,提供智能预测和个性化交互。
安装此 Skill 需要完成以下两步:
将 scripts/ 目录复制到 Cursor skills 目录:
# 全局安装(推荐,所有项目共享)
cp -r scripts/ ~/.cursor/skills/behavior-prediction/scripts/
# 或项目级安装(仅当前项目使用)
cp -r scripts/ .cursor/skills/behavior-prediction/scripts/
将 rules/behavior-prediction.mdc 复制到 Cursor rules 目录:
# 全局安装(推荐,所有项目生效)
cp rules/behavior-prediction.mdc ~/.cursor/rules/
# 或项目级安装(仅当前项目生效)
cp rules/behavior-prediction.mdc .cursor/rules/
注意:规则文件必须安装,否则 AI 不会自动触发行为记录和预测功能。
| 安装级别 | 脚本目录 | 规则目录 | 数据目录 |
|---------|---------|---------|---------|
| 全局 | ~/.cursor/skills/behavior-prediction/ | ~/.cursor/rules/ | ~/.cursor/skills/behavior-prediction-data/ |
| 项目 | .cursor/skills/behavior-prediction/ | .cursor/rules/ | .cursor/skills/behavior-prediction-data/ |
安装完成后,可以运行以下命令验证:
# 验证脚本安装
python3 ~/.cursor/skills/behavior-prediction/scripts/hook.py --init
# 验证规则安装(检查文件是否存在)
ls ~/.cursor/rules/behavior-prediction.mdc
也可以使用 setup_rule.py 脚本自动安装规则文件:
# 启用规则(项目级)
python3 ~/.cursor/skills/behavior-prediction/scripts/setup_rule.py '{"action": "enable"}'
# 启用规则(全局)
python3 ~/.cursor/skills/behavior-prediction/scripts/setup_rule.py '{"action": "enable", "location": "global"}'
# 禁用规则
python3 ~/.cursor/skills/behavior-prediction/scripts/setup_rule.py '{"action": "disable"}'
# 更新规则到最新版本
python3 ~/.cursor/skills/behavior-prediction/scripts/setup_rule.py '{"action": "update"}'
# 检查规则状态
python3 ~/.cursor/skills/behavior-prediction/scripts/setup_rule.py '{"action": "check"}'
或者通过自然语言告诉 AI:
重要:安装完成后,请将以下内容展示给用户。
✅ Behavior Prediction Skill V2 安装成功!
| 命令 | 说明 |
|------|------|
| 启用行为预测规则 | 开启自动行为预测功能(推荐) |
| 查看我的行为模式 | 查看学习到的行为模式 |
| 查看用户画像 | 查看用户画像信息 |
| 查看行为统计 | 查看统计数据概览 |
运行 启用行为预测规则 开启自动行为预测功能,这样:
该 Skill 会记录你与 AI 的会话内容(工作流程、偏好、技术栈等),学习你的工作习惯,当你下次开始会话时,AI 会根据你的习惯主动提供建议。
用户: 帮我创建一个 API 文件
AI: 已创建 src/api/auth.py
✨ 基于你的习惯,你可能想要运行测试 (85%)
要执行吗?
运行 检查行为预测规则状态 确认规则已启用。
| 能力 | 说明 | |------|------| | 会话记录 | 会话结束时记录完整会话内容 | | 模式学习 | 提取工作流程、偏好、项目模式 | | 智能预测 | 基于模式预测下一步操作 | | 用户画像 | 综合分析生成用户画像 | | 交互优化 | 根据用户偏好调整交互方式 |
启用 Always Applied Rule 后,系统会自动:
| 命令 | 描述 |
|------|------|
| 查看我的行为模式 | 显示学习到的行为模式 |
| 查看用户画像 | 显示用户画像信息 |
| 更新用户画像 | 手动触发画像更新 |
| 查看行为统计 | 显示统计数据概览 |
| 预测下一步 | 手动触发预测 |
统一的 hook 入口,支持会话生命周期管理。
# 会话开始时
python3 <skill_dir>/scripts/hook.py --init
# 会话结束时
python3 <skill_dir>/scripts/hook.py --finalize '{
"session_summary": {
"topic": "会话主题",
"goals": ["目标"],
"completed_tasks": ["任务"],
"technologies_used": ["技术"],
"workflow_stages": ["implement", "test"],
"tags": ["#tag"]
},
"operations": {
"files": {"created": [], "modified": [], "deleted": []},
"commands": []
},
"conversation": {
"user_messages": ["消息"],
"message_count": 1
},
"time": {
"start": "ISO8601",
"end": "ISO8601"
}
}'
记录完整会话到本地。
python3 <skill_dir>/scripts/record_session.py '{...session_data...}'
从会话记录中提取行为模式。
# 查看当前模式
python3 <skill_dir>/scripts/extract_patterns.py
# 从会话数据提取模式
python3 <skill_dir>/scripts/extract_patterns.py '{...session_data...}'
用户画像管理。
# 获取用户画像
python3 <skill_dir>/scripts/user_profile.py
# 更新用户画像
python3 <skill_dir>/scripts/user_profile.py '{"action": "update"}'
# 获取 AI 摘要
python3 <skill_dir>/scripts/user_profile.py '{"action": "summary"}'
获取预测建议。
# 获取当前阶段的预测
python3 <skill_dir>/scripts/get_predictions.py '{"current_stage": "implement"}'
# 带上下文的预测
python3 <skill_dir>/scripts/get_predictions.py '{
"current_stage": "implement",
"context": {"project_type": "backend_api"}
}'
| 阶段 | 说明 | |------|------| | design | 设计、规划、讨论方案 | | implement | 编写代码、创建文件 | | test | 编写测试、运行测试 | | debug | 调试、修复问题 | | refactor | 重构、优化代码 | | document | 编写文档 | | deploy | 部署、发布 | | review | 代码审查 | | commit | 提交代码 |
behavior-prediction-data/
├── sessions/ # 会话记录(按月份)
│ └── 2026-01/
│ └── sess_20260131_001.json
├── patterns/ # 行为模式
│ ├── workflow_patterns.json # 工作流程模式
│ ├── preferences.json # 偏好数据
│ └── project_patterns.json # 项目模式
├── profile/ # 用户画像
│ └── user_profile.json
├── index/ # 索引
│ └── sessions_index.json
└── config.json # 用户配置
配置文件位于数据目录的 config.json。
{
"version": "2.0",
"enabled": true,
"recording": {
"enabled": true,
"retention_days": 90
},
"patterns": {
"extraction_enabled": true,
"min_sessions_for_pattern": 3
},
"profile": {
"auto_update": true,
"update_interval_sessions": 10
},
"prediction": {
"enabled": true,
"suggest_threshold": 0.5,
"max_suggestions": 3
}
}
| 参数 | 默认值 | 说明 |
|------|--------|------|
| enabled | true | 总开关 |
| recording.retention_days | 90 | 会话记录保留天数,-1 表示永久 |
| patterns.min_sessions_for_pattern | 3 | 最少会话数才识别模式 |
| profile.auto_update | true | 是否自动更新用户画像 |
| profile.update_interval_sessions | 10 | 每 N 次会话更新一次画像 |
| prediction.suggest_threshold | 0.5 | 显示建议的最低置信度 |
当完成一个阶段后,如果系统有高置信度的预测,会显示建议:
✨ 基于你的习惯,你可能想要:
→ 运行测试 (置信度: 85%)
要执行吗?
{
"stats": {
"total_sessions": 50,
"active_days": 30
},
"preferences": {
"common_stages": ["implement", "test", "commit"],
"common_tech": ["python", "fastapi", "pytest"]
},
"work_style": {
"planning_tendency": 0.3,
"test_driven": 0.6,
"documentation_focus": 0.2
}
}
development
读取网页内容,支持 SPA 页面自动检测与浏览器渲染降级。当普通 HTTP fetch 无法获取 Vue/React 等 SPA 页面的渲染数据时,自动通过 Playwright 浏览器获取完整内容。当用户需要读取网页数据、提取页面内容、或 WebFetch 工具返回空内容时使用。
tools
被动录制用户浏览器操作行为。打开浏览器后用户自由操作,系统通过 CDP + DOM 事件注入 自动记录点击、输入、导航等操作和 API 调用。录制完成后 LLM 分析生成结构化工作流。 支持参数化重放、生成独立 Skill、导出 Playwright 脚本。依赖 Playwright Skill。
development
# uni-app 小程序代码生成器 > **版本**: v1.0.0 > **作者**: AI Assistant > **参考项目**: tt-paikebao-mp(排课宝) ## 功能概述 这是一个基于 **tt-paikebao-mp** 项目代码规范的 uni-app 小程序代码生成器。根据用户提供的需求文档,自动生成符合项目规范的: - Vue3 页面组件 - API 接口文件 - Pinia Store 状态管理 - 路由配置 - 数据库 Schema 定义 ## 触发条件 当用户请求以下内容时,应使用此 Skill: 1. 创建新的页面模块 2. 生成 API 接口文件 3. 创建数据库集合定义 4. 生成 Store 状态管理 5. 提供需求文档要求生成代码 6. 询问 uni-app 小程序开发规范 ## 快速开始 ### 1. 用户提供需求文档 用户应提供以下格式的需求文档: ```markdown # 模块名称 ## 功能描述 简要描述该模块的功能 ## 数据字段 - fieldName: 字段描述(必填/可选,类型) ## 页面列
development
读取并缓存 Swagger/OpenAPI 文档供模型使用。当用户需要添加、读取、刷新 API 文档,或使用 Swagger URL 时触发。