feat: 新增对话总结命令与浏览器自动化技能

- 本地化命令描述(英文→中文)

- 删除未使用命令文件

- 新增 summarize-conversation 命令

- 更新 AI 模型配置为 DeepSeek

- 新增 agent-browser 技能

- 重构技能目录结构(重命名)
This commit is contained in:
2026-01-15 17:30:39 +08:00
parent 75462f3412
commit 43e138b19e
28 changed files with 1139 additions and 302 deletions

View File

@@ -1,5 +1,5 @@
---
description: Commit staged files with auto-generated message and create version tag
description: 提交暂存文件,自动生成提交信息并创建版本标签
---
Auto-generate a commit message for staged files, commit to the local repository, and create a version tag following semantic versioning.

View File

@@ -1,23 +0,0 @@
---
description: Pull latest changes from remote repository
---
Pull the latest changes from the remote repository for the current branch.
Please perform the following tasks:
1. **Run `git pull`** to fetch and merge remote changes
2. **Handle merge conflicts if they occur:**
- Check conflict files with `git status`
- Guide me through conflict resolution
- Help stage resolved files with `git add <file>`
- Complete the merge with `git commit`
3. **Show the result** with branch status and changes summary
If there are any errors or conflicts, explain them clearly in Chinese and provide step-by-step guidance for resolution.
Present the final result showing:
- Branch name
- Number of commits pulled
- Files changed
- Any conflicts that need attention

View File

@@ -1,55 +0,0 @@
---
description: Push all local tags to remote repository
---
Push all local tags to the remote repository.
Please perform the following:
1. **List local tags:**
```bash
git tag --list | sort -V
```
2. **Check remote tags:**
```bash
git ls-remote --tags origin
```
3. **Identify unpushed tags** - Compare local and remote to find tags that need to be pushed
4. **Display summary in Chinese:**
```
本地标签总数N 个
远程标签总数M 个
待推送标签K 个
- [list of unpushed tags]
确认推送所有标签到 origin
```
5. **Wait for user confirmation** (or proceed if no confirmation needed)
6. **Push all tags:**
```bash
git push --tags
```
7. **Verify and display result in Chinese:**
```
✓ 已成功推送所有标签到 origin
最近 5 个远程标签:
- [list of recent tags]
```
**Use cases:**
- After creating multiple local tags
- Sync tags with remote repository
- Before triggering CI/CD release workflows
- Share version tags with team
**Notes:**
- Pushes ALL local tags, not just one
- To push a specific tag: `git push origin <tag-name>`
- Safe operation: won't overwrite existing tags (no force push)

View File

@@ -1,5 +1,5 @@
---
description: Commit staged files, create version tag, and push to remote repository
description: 提交暂存文件,创建版本标签并推送到远程仓库
---
Complete workflow: auto-generate commit message, create version tag, commit, and push everything to remote repository.

View File

@@ -1,5 +1,5 @@
---
description: View current Gitea configuration and runner status
description: 查看当前 Gitea 配置和 Runner 状态
---
Display the current Gitea configuration and runner status.

View File

@@ -1,5 +1,5 @@
---
description: Create a new Git repository on Gitea
description: 在 Gitea 上创建新的 Git 仓库
---
Create a new Git repository on Gitea via API.

View File

@@ -1,5 +1,5 @@
---
description: Create and start a Gitea Actions runner (default host mode)
description: 创建并启动 Gitea Actions Runner(默认使用 host 模式)
agent: general
subtask: true
---

View File

@@ -1,5 +1,5 @@
---
description: Delete a Gitea runner configuration (interactive)
description: 删除 Gitea Runner 配置(交互式)
agent: general
subtask: true
---

View File

@@ -1,5 +1,5 @@
---
description: List all global runners on Gitea server
description: 列出 Gitea 服务器上的所有全局 Runner
---
List all global runners registered on the Gitea server.

View File

@@ -1,132 +0,0 @@
---
description: Reset Gitea configuration with interactive setup wizard
agent: general
subtask: true
---
Launch an interactive configuration wizard to set up or reset Gitea configuration.
## 工作目录
**macOS / Linux:**
```
~/.config/gitea/
```
**Windows:**
```
%USERPROFILE%\.config\gitea\
```
配置文件和 Runner 目录都将存储在此位置。
Please perform the following:
1. **Create configuration directory:**
**macOS / Linux:**
```bash
mkdir -p ~/.config/gitea/runners
```
**Windows PowerShell:**
```powershell
New-Item -Path "$env:USERPROFILE\.config\gitea\runners" -ItemType Directory -Force
```
2. **Interactive input - Gitea URL:**
- Prompt: "请输入 Gitea 实例地址 (例如: https://git.digitevents.com):"
- Validate: Must start with http:// or https://
- Remove trailing slash
3. **Interactive input - Personal Access Token:**
- Prompt: "请输入 Personal Access Token:"
- Before input, show help:
```
提示:获取 Personal Access Token 的步骤:
1. 登录 Gitea
2. 右上角头像 → 设置 → 应用 → 访问令牌
3. 点击 "生成新令牌"
4. 设置令牌名称(如 opencode-cli
5. 选择权限repo, admin:org, write:runner推荐
6. 点击 "生成令牌"
7. 复制生成的 Token
```
- Validate: Not empty
- Use `read -sp` for secure input (password style)
4. **Test connection:**
- API: `GET ${GITEA_URL}/api/v1/user`
- If fails: Show error and possible reasons
- If success: Show username
5. **Validate token permissions:**
- Check `repo`: `GET /api/v1/user/repos` (required)
- Check `admin:org`: `GET /api/v1/user/orgs` (optional, for org runners)
- Check `write:runner`: Try to get registration token (optional, for runners)
- Warn if missing required permissions
6. **Input default organization (optional):**
- Prompt: "请输入默认组织名称 (回车跳过):"
- If provided, validate it exists: `GET /api/v1/orgs/${org_name}`
7. **Save configuration:**
**macOS / Linux** - Save to `~/.config/gitea/config.env`:
```bash
GITEA_URL=...
GITEA_TOKEN=...
GITEA_DEFAULT_ORG=... (if set)
GITEA_RUNNER_CAPACITY=2
GITEA_RUNNER_TIMEOUT=3h
```
- Set permissions: `chmod 600 ~/.config/gitea/config.env`
- Create `.gitignore` to exclude sensitive files
**Windows** - Save to `%USERPROFILE%\.config\gitea\config.env`:
```bash
GITEA_URL=...
GITEA_TOKEN=...
GITEA_DEFAULT_ORG=... (if set)
GITEA_RUNNER_CAPACITY=2
GITEA_RUNNER_TIMEOUT=3h
```
- Set file permissions to restrict access (see setup-guide.md for PowerShell script)
- Create `.gitignore` to exclude sensitive files
8. **Display completion summary in Chinese:**
**macOS / Linux:**
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
配置完成
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
配置文件: ~/.config/gitea/config.env
Runner 目录: ~/.config/gitea/runners
下一步:
- 查看配置: /gitea-config
- 创建 Runner: 告诉 AI '创建一个 runner'
- 创建仓库: /create-gitea-repo <repo-name>
```
**Windows:**
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
配置完成
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
配置文件: %USERPROFILE%\.config\gitea\config.env
Runner 目录: %USERPROFILE%\.config\gitea\runners
下一步:
- 查看配置: /gitea-config
- 创建 Runner: 告诉 AI '创建一个 runner'
- 创建仓库: /create-gitea-repo <repo-name>
```
**Security notes:**
- Config file permissions: 600 (owner read/write only)
- Token is never displayed after initial input
- Sensitive files excluded in .gitignore

View File

@@ -1,82 +0,0 @@
---
description: Switch default Gitea organization
---
Switch the default Gitea organization in configuration.
## 工作目录
**macOS / Linux:**
```
~/.config/gitea/
```
**Windows:**
```
%USERPROFILE%\.config\gitea\
```
**User input format:** `$ARGUMENTS` = organization name
**Example usage:**
```
/gitea-switch-org ai
/gitea-switch-org my-team
```
Please perform the following:
1. **Check configuration exists:**
- Config file:
- macOS/Linux: `~/.config/gitea/config.env`
- Windows: `%USERPROFILE%\.config\gitea\config.env`
- If not exists: prompt user to run `/gitea-reset`
2. **Load configuration:**
**macOS / Linux:**
```bash
source ~/.config/gitea/config.env
```
**Windows PowerShell:**
```powershell
Get-Content "$env:USERPROFILE\.config\gitea\config.env" | ForEach-Object {
if ($_ -match '^([^=]+)=(.*)$') {
[Environment]::SetEnvironmentVariable($matches[1], $matches[2], 'Process')
}
}
```
3. **Parse user input:**
- Organization name from `$ARGUMENTS`
- If empty: show usage and examples
4. **Validate organization exists:**
- API: `GET ${GITEA_URL}/api/v1/orgs/${org_name}`
- Header: `Authorization: token ${GITEA_TOKEN}`
- If 404: Show error and list available organizations:
```bash
curl -s -H "Authorization: token $GITEA_TOKEN" \
"${GITEA_URL}/api/v1/user/orgs" | jq -r '.[].username'
```
5. **Update configuration file:**
- If `GITEA_DEFAULT_ORG` exists: update the line
- If not exists: add after `GITEA_TOKEN`
- Handle macOS (sed -i '') and Linux (sed -i) differences
6. **Display result in Chinese:**
```
✓ 默认组织已切换到: [org_name]
现在可以:
- 创建仓库: /create-gitea-repo my-project
(将创建到 [org_name]/my-project
- 查看配置: /gitea-config
```
**Notes:**
- Switching organization doesn't affect existing repositories or runners
- Only affects default owner for future repository creation
- Can switch anytime

View File

@@ -1,5 +1,5 @@
---
description: Review code or documentation and provide suggestions
description: 审查代码或文档并提供建议
agent: plan
---

View File

@@ -0,0 +1,84 @@
---
description: 归纳总结当前对话中有价值的内容,生成 Markdown 文件以便后续参考
agent: general
---
# 对话内容总结
你的任务是归纳总结当前对话中有价值的内容,生成一个结构化的 Markdown 文件,方便后续与 AI 对话时快速回顾,避免重复查询。
## 总结内容
请从对话历史中提取以下信息:
1. **对话主题** - 用户的主要需求和目标
2. **关键决策** - 用户做出的重要选择、确定的技术方案
3. **代码更改** - 创建、修改或删除的代码文件及核心逻辑
4. **配置更新** - 环境变量、配置文件、依赖项变更
5. **待办事项** - 用户明确提到的未来任务或计划
6. **下一步行动** - 建议的后续步骤
7. **重要注意事项** - 需要特别记住的细节、限制条件
8. **相关文件路径** - 涉及的重要文件位置(格式:`文件路径:行号`
## 生成文件
1. **默认文件名**`conversation-summary.md`
2. **文件位置**:当前工作目录
3. **文件格式**:使用 Markdown 语法,包含清晰的标题和列表
4. **时间戳**在文件开头添加生成时间格式YYYY-MM-DD HH:MM:SS
5. **对话上下文**:简要描述对话的背景和目的
## 执行步骤
1. **分析对话** - 回顾完整的对话历史,识别有价值的信息点
2. **提取内容** - 按照上述分类整理信息,确保准确性和完整性
3. **生成总结** - 创建结构化的 Markdown 内容,使用中文描述
4. **保存文件** - 将总结写入 `conversation-summary.md` 文件
5. **验证内容** - 检查文件是否包含所有关键信息
6. **通知用户** - 告知用户文件已生成,并提供文件路径
## 注意事项
- 只总结**有价值**的内容,忽略闲聊和无关信息
- 保持总结简洁明了,便于快速查阅
- 涉及代码时,提供文件路径和关键行号引用
- 如果有未完成的任务,明确标注状态(待处理/进行中/已完成)
- 如果对话中涉及敏感信息(如密码、密钥),**不要**包含在总结中
## 输出示例
```
# 对话总结
**生成时间**: 2025-01-15 14:30:00
**对话主题**: 创建 OpenCode 命令用于总结对话内容
## 关键决策
- 命令名称: `summarize-conversation`
- 文件位置: 全局命令目录 (`~/.config/opencode/command/`)
- 代理类型: general
## 代码更改
- 创建命令文件: `command/summarize-conversation.md`
## 配置更新
- 无
## 待办事项
- 测试命令功能:运行 `/summarize-conversation`
- 考虑添加文件命名参数支持
## 下一步行动
1. 使用 `/summarize-conversation` 测试命令效果
2. 根据使用反馈优化总结模板
## 重要注意事项
- 总结文件保存在当前工作目录的 `conversation-summary.md`
- 每次运行会覆盖之前的总结文件
- 建议定期备份重要总结
## 相关文件
- `command/summarize-conversation.md`
```
**完成标准**:成功生成包含上述所有部分的 Markdown 文件,并通知用户文件位置。