一键导入
to-issues
自动分析代码问题并提交规范化的 GitHub Issues。遵循统一格式(Summary/Environment/Description/Impact/Steps/Expected/Actual/Proposed Fix),末尾自动添加智能体生成标记。无需用户交互,直接提交。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
自动分析代码问题并提交规范化的 GitHub Issues。遵循统一格式(Summary/Environment/Description/Impact/Steps/Expected/Actual/Proposed Fix),末尾自动添加智能体生成标记。无需用户交互,直接提交。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
GitHub 仓库操作工具集,支持 Issue 评论回复、PR 创建、Issue/PR 详情查询、代码推送和 PR 创建联动。使用 Python requests 库调用 GitHub API,配合 gh CLI 工具完成分支操作。Use when 用户提到回复 GitHub Issue、创建 PR、推送并创建 PR、查看 issue 状态、GitHub 操作。
DriFox UI 插件开发技能。用于创建、修改、调试 UI 插件(浮动卡片 / 内容块渲染器 / 消息元素工厂)。
AI 驱动的智能体编排画布设计器。通过对话理解需求,AI 自动生成画布配置, 通过 Playwright MCP 自动操控浏览器进行可视化验证和迭代。 无需用户手动拖拽编辑。内置 JSON 校验和自动备份防损坏。 Use when 用户说"设计智能体"、"画布设计"、"编排流程"、 "workflow design"、"生成画布JSON"、"生成配置"。
跨平台截图分析工具,基于 MiniMax 多模态 API。支持 macOS (screencapture) 和 Windows (PowerShell) 截图,自动完成截图→Base64编码→API调用全流程。适用于:错误信息分析、代码解读、UI设计分析、文字提取、图表数据解读等场景。
DriFox 项目专用开发技能。当你需要在 DriFox 项目中进行任何开发工作时(功能开发、Bug 修复、UI 组件开发、架构分析、插件/Skill/Agent 开发、代码审查、重构优化),必须首先加载本技能。本技能把固定规范放在 references/ 子文件、按需加载,根据任务类型把「新增功能」分派给 brainstorming、把「Bug/回归」分派给 diagnose,并把项目实时状态(git 快照 + GitHub open issues)缓存到 state.json 跨会话复用。即使看起来简单的改动也应该加载此技能——DriFox 架构复杂、模块依赖多,不加载容易违反项目约定。
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
基于 SOC 职业分类
| name | to-issues |
| description | 自动分析代码问题并提交规范化的 GitHub Issues。遵循统一格式(Summary/Environment/Description/Impact/Steps/Expected/Actual/Proposed Fix),末尾自动添加智能体生成标记。无需用户交互,直接提交。 |
快速将分析结果提交为 GitHub Issues。无需用户交互,自动完成。
@to-issues 分析XXX - 分析并提交@to-issues #29 - 获取已有 issue 并补充分析@to-issues fix:xxx - 提交 bug fix issue@to-issues feat:xxx - 提交功能增强 issue技能会按以下顺序获取配置:
GitHub Token (优先级):
minimax apikey 或 github token 中读取.drifox/app.config 中读取GITHUB_TOKEN 获取仓库地址:
.git/config 中的 remote.origin.url 获取仓库名称格式: owner/repo (自动从 git URL 解析)
@to-issues 分析当前项目的内存泄漏问题
执行步骤:
@to-issues fix: BackgroundTaskManager 线程安全问题
自动生成:
[Bug] BackgroundTaskManager 线程安全问题bug, high-priority@to-issues feat: 添加上下文压缩可视化
自动生成:
[Enhancement] 添加上下文压缩可视化enhancement@to-issues 参考 #29 分析代码并提交新issue
技能内置提交脚本,可在项目根目录执行:
#!/usr/bin/env python3
"""
快速提交 issue 到 GitHub
"""
import requests
import json
import sys
import re
# ========== 配置 (自动获取) ==========
TOKEN = '' # 将在运行时从以下来源获取
REPO = '' # 将在运行时从 git config 获取
def get_config():
"""自动获取配置"""
config = {}
# 1. 从环境变量
config['token'] = os.environ.get('GITHUB_TOKEN', '')
config['repo'] = os.environ.get('GITHUB_REPO', '')
# 2. 从 .drifox/app.config
config_file = Path('.drifox/app.config')
if config_file.exists():
try:
with open(config_file, 'r', encoding='utf-8') as f:
data = json.load(f)
config['token'] = config.get('token') or data.get('github_token', '')
config['repo'] = config.get('repo') or data.get('github_repo', '')
except:
pass
# 3. 从 .git/config 解析 repo
git_config = Path('.git/config')
if git_config.exists() and not config.get('repo'):
with open(git_config, 'r', encoding='utf-8') as f:
content = f.read()
match = re.search(r'git@github\.com:([^/]+)/([^.]+)\.git', content)
if match:
config['repo'] = f"{match.group(1)}/{match.group(2)}"
# 4. 从长期记忆读取 token
# 注意: 需要在调用时传入 token
return config
def submit_issue(title, body, labels=None):
"""提交单个 issue"""
config = get_config()
if not config.get('token'):
print("❌ 未找到 GitHub Token")
return None
repo = config.get('repo') or 'martin98-afk/DriFox' # 默认值
headers = {
'Authorization': f"token {config['token']}",
'Accept': 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28',
'Content-Type': 'application/json'
}
data = {
'title': title,
'body': body,
'labels': labels or []
}
try:
resp = requests.post(
f'https://api.github.com/repos/{repo}/issues',
headers=headers,
json=data,
timeout=15
)
if resp.status_code == 201:
result = resp.json()
print(f"✅ Created #{result['number']}: {result['html_url']}")
return result
elif resp.status_code == 403:
# 尝试无 labels 重试
data['labels'] = []
resp = requests.post(
f'https://api.github.com/repos/{repo}/issues',
headers=headers,
json=data,
timeout=15
)
if resp.status_code == 201:
result = resp.json()
print(f"✅ Created #{result['number']} (no labels): {result['html_url']}")
return result
print(f"❌ 403: {resp.text[:200]}")
else:
print(f"❌ Failed: {resp.status_code} - {resp.text[:200]}")
except Exception as e:
print(f"❌ Error: {e}")
return None
def batch_submit(issues):
"""批量提交 issues"""
results = []
for issue in issues:
print(f"\n📝 提交: {issue['title']}")
result = submit_issue(
title=issue['title'],
body=issue['body'],
labels=issue.get('labels', [])
)
results.append(result)
if result:
time.sleep(0.5) # 避免限流
return results
if __name__ == '__main__':
# 示例: 从命令行参数获取 issues
issues_json = sys.argv[1] if len(sys.argv) > 1 else '[]'
issues = json.loads(issues_json)
batch_submit(issues)
所有通过本技能提交的 Issue 必须遵循以下格式规范:
[问题类型] 简洁描述(不超过80字符)
Bug, Enhancement, Performance, Refactoring, Documentation## Summary
一句话描述问题和影响
## Environment
- Python 版本
- DriFox 版本
- 涉及文件: xxx, xxx
## Description
### 问题 1: [标题]
[详细描述]
```python
# 问题代码(可选)
[详细描述]
[期望的正确行为]
[实际发生的错误行为]
🤖 DriFox 智能体自动生成
submit_issue(
title="[Bug] 虚拟滚动内存泄漏",
body="""## Summary
长会话后内存持续增长,消息批次数据未被清理。
## Environment
- Python: 3.x
- DriFox 版本: 最新
- 涉及文件: `app/main_widget.py`
## Description
### 问题: _message_batch 未清理
虚拟滚动回收消息卡片时,对应的批次数据仍保留在内存中。
## Impact
1. 长时间运行内存持续增长
2. 可能导致 OOM 错误
## Steps to Reproduce
1. 启动 DriFox 进行长时间对话
2. 观察内存占用持续增长
## Expected Behavior
回收的消息批次数据也被清理,长时间运行内存稳定。
## Actual Behavior
内存持续增长,未释放已回收消息的数据。
---
> 🤖 DriFox 智能体自动生成
""",
labels=["bug", "performance"]
)
issues = [
{"title": "[Bug] Hook重复触发", "body": "...", "labels": ["bug"]},
{"title": "[Enhancement] 权限缓存失效", "body": "...", "labels": ["enhancement"]},
]
batch_submit(issues)
| 错误码 | 处理方式 |
|---|---|
| 401 | 提示 Token 无效,建议检查配置 |
| 403 | 移除 labels 后重试,或提示权限不足 |
| 404 | 提示仓库不存在,检查 repo 配置 |
| 422 | 提示请求格式错误,检查 issue 内容 |
| 网络错误 | 自动重试 2 次,间隔 2 秒 |
| 场景 | 标签 |
|---|---|
| Bug 修复 | bug |
| 功能增强 | enhancement |
| 性能优化 | performance |
| 代码重构 | refactoring |
| 文档改进 | documentation |
| 测试相关 | tests |
| 高优先级 | high-priority |
| 需要审查 | needs-review |
| 讨论中 | discussion |
[类型] 简洁描述 (如 [Bug] 内存泄漏)#number 关联相关问题@brainstorming 后 → 用 @to-issues 拆分为可执行任务@diagnose 后 → 用 @to-issues 提交发现的问题@to-issues 提交改进建议