Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/skill-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Tessl Skill Review — runs on PRs that change any SKILL.md; posts scores as one PR comment.
# Docs: https://github.com/tesslio/skill-review
name: Tessl Skill Review

on:
pull_request:
branches: [main]
paths:
- "**/SKILL.md"

jobs:
review:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: tesslio/skill-review@main
# Optional quality gate (off by default — do not enable unless user asked):
# with:
# fail-threshold: 70
98 changes: 21 additions & 77 deletions OpenLum.Console/Skills/csharp/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: csharp
description: 用于在 C# / .NET 项目中进行规划、实现、重构和调试。优先使用 dotnet CLI 完成项目管理与编译,结合 Grep / SemanticSearch / 子代理 / 网络搜索进行代码定位与 Debug。禁止执行 dotnet run / dotnet test,编译通过即视为任务完成。
description: "Plans, implements, refactors, and debugs C# / .NET projects using the dotnet CLI, Grep, SemanticSearch, sub-agents, and web search. Use when: working with .cs, .csproj, .sln files, C#, ASP.NET, Entity Framework, NuGet packages, or any .NET development task. Compiles with dotnet build — never executes dotnet run or dotnet test (user runs those manually). Compilation success = task complete."
---

# C# 项目开发 Skill(csharp)
Expand All @@ -14,64 +14,13 @@ description: 用于在 C# / .NET 项目中进行规划、实现、重构和调
- **禁止** 在任何场景下执行 `dotnet run`、`dotnet test` 或等价命令(包括通过脚本间接运行)。程序运行与测试由用户自行执行。
- **禁止** 为“验证运行”而启动可执行程序或启动服务;只允许通过编译结果和静态分析来判断质量。

## 二、可用工具与职责分工
## 二、工具使用指南

### 1. 文件与代码操作

- 使用 `Read`:读取 `.cs`、`.csproj`、`.sln`、配置文件等内容。
- 使用 `ApplyPatch`:对单个文件进行结构化修改(新增类/方法、重构逻辑、修复 Bug)。
- 使用 `Glob`:按模式列出 C# 相关文件(如 `**/*.cs`、`**/*.csproj`),避免硬编码文件列表。
- 使用 `ReadLints`:在修改后检查被编辑文件是否存在新的编译/分析错误,并尽量修复。

### 2. 代码搜索与理解

- 使用 `Grep`(rg):
- 精确或正则搜索:类名、方法名、接口、错误消息、日志文本。
- 典型用法:搜索 `class <Name>`、`interface <Name>`、`MethodName\(` 或错误码。
- 通过 `glob` 或 `type=cs` 仅在 C# 文件中搜索。
- 使用 `SemanticSearch`:
- 在功能/概念级别查找相关实现,例如“HTTP 调用是如何封装的”、“日志是在哪个层写入的”。
- 适合单个关键字不足以准确匹配的场景。

### 3. 终端命令(Shell / exec)

- 始终按 **PowerShell** 语法构造命令;多命令串联使用 `;` 而不是 `&&`。
- 合法典型命令:
- `dotnet new sln -n MyApp`
- `dotnet new console -n MyApp`
- `dotnet new classlib -n MyLib`
- `dotnet sln add MyApp/MyApp.csproj`
- `dotnet add MyApp reference MyLib/MyLib.csproj`
- `dotnet add MyApp package <PackageId> [-v <Version>]`
- `dotnet restore`
- `dotnet build -v normal`(推荐,用于捕获完整编译输出)
- `dotnet build -c Release`
- 不得通过 Shell 调用 `grep` / `rg`,优先使用内置 `Grep` 工具完成搜索。

### 4. 子代理(Task 工具)

当单次对话难以完成复杂任务(如大规模重构、全仓库架构梳理、复杂调试)时:

- 使用子代理:
- `subagent_type: "explore"`:需要在大仓库中系统梳理结构、找调用链、罗列相关文件时使用。
- `subagent_type: "generalPurpose"`:需要多轮推理、综合文档/网络信息来设计方案或长流程任务时使用。
- 在 `prompt` 中明确:
- 目标(例如:“重构所有同步 IO 调用为异步”)。
- 需要返回的结果形式(文件列表、改造建议、TODO 列表等)。
- 是否允许写入(单纯分析用 `readonly: true`)。

### 5. 网络信息(WebSearch / WebFetch)

在以下场景主动使用网络:

- 不确定某个 .NET API / NuGet 包的最新用法或推荐实践。
- 碰到晦涩异常或编译错误,仓库内代码与注释无法解释原因。
- 需要确认 2026 年左右的最佳实践或重大 Breaking Change。

使用建议:

- `WebSearch`:根据错误消息 / API 名 + `c#` + `2026` 搜索最新资料。
- `WebFetch`:对于具体的文档链接(如 `learn.microsoft.com`、GitHub README)拉取并阅读关键片段。
- **Shell**: always use **PowerShell** syntax; chain commands with `;` not `&&`. Never call `grep`/`rg` via shell — use the built-in Grep tool.
- **Grep**: search C# files with `type: “cs”` — class definitions, interface names, error codes, method references.
- **SemanticSearch**: concept-level search when a single keyword is insufficient (e.g. “how is HTTP wrapped?”).
- **Sub-agents**: use `explore` for large-repo analysis and call chains; `generalPurpose` for multi-step design tasks.
- **WebSearch/WebFetch**: look up unfamiliar .NET APIs, NuGet packages, or obscure compiler errors.

## 三、四步闭环(提高编写质量与成功率)

Expand Down Expand Up @@ -140,25 +89,20 @@ description: 用于在 C# / .NET 项目中进行规划、实现、重构和调
- 用 `WebSearch` + `WebFetch` 查看官方文档与示例。
- 对照现有用法,识别是否存在已废弃的 API、默认行为变化、配置缺失等问题。

## 六、dotnet CLI 速查表(Shell 命令)

> 所有命令均以工作区根目录或解决方案根目录为基准,注意相对路径。

| 命令 | 说明 |
|------|------|
| `dotnet new sln -n <Name>` | 创建解决方案 |
| `dotnet new console -n <Name>` | 创建控制台项目 |
| `dotnet new classlib -n <Name>` | 创建类库项目 |
| `dotnet sln add <projPath>` | 将项目加入解决方案 |
| `dotnet add <projPath> reference <refProj>` | 添加项目引用 |
| `dotnet add <projPath> package <PackageId> [-v <Version>]` | 向项目添加 NuGet 包 |
| `dotnet restore` | 还原所有依赖包 |
| `dotnet build -v normal` | Debug 编译并输出详细信息(推荐默认) |
| `dotnet build -c Release` | Release 编译 |

NuGet 包搜索(如本地 SDK 支持):

- `dotnet package search <关键词> [--take 10] [--exact-match] [--prerelease] [--source <url>] [--format json]`
## 六、dotnet CLI Quick Reference

```powershell
dotnet new sln -n <Name> # Create solution
dotnet new console -n <Name> # Create console project
dotnet new classlib -n <Name> # Create class library
dotnet sln add <projPath> # Add project to solution
dotnet add <proj> reference <refProj> # Add project reference
dotnet add <proj> package <PkgId> # Add NuGet package
dotnet restore # Restore dependencies
dotnet build -v normal # Build (recommended default)
dotnet build -c Release # Release build
dotnet package search <keyword> # Search NuGet packages
```

## 七、注意事项与最佳实践

Expand Down
4 changes: 2 additions & 2 deletions OpenLum.Console/Skills/deepThink/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: deepThink
description: "通用问题诊断与深度分析 Skill。适用于代码、系统、业务、学习规划等需要严肃推理和可执行结论的任务。"
name: deep-think
description: "Diagnoses and deeply analyzes problems across code, systems, business logic, learning plans, and career decisions. Use when: debugging errors, designing architectures, analyzing complex requirements, planning learning paths, or making technical trade-off decisions. Produces structured conclusions with evidence-backed reasoning, hypothesis testing via available tools, and immediately actionable next steps."
---

# DeepThink Skill(通用深度诊断)
Expand Down
61 changes: 23 additions & 38 deletions OpenLum.Console/Skills/python/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,39 @@
---
name: python
description: "在缺少专用工具时,优先使用本地 Python 脚本完成复杂任务。临时脚本统一放在工作区 script 目录下的独立子文件夹中。"
description: "Writes and runs local Python scripts for data processing, file transformations, batch generation, web scraping, and automation tasks. Use when: the user says 'write a script', 'automate', 'Python', 'batch process', 'convert CSV', 'parse JSON', 'scrape', or when built-in tools and existing skills cannot handle a complex data/file task. Scripts are organized in workspace `script/` subdirectories."
---

# Python Skill

当没有更合适的专用工具(如特定 API、数据库工具等)时,可以用 **Python 脚本** 在本地完成复杂的数据处理、格式转换、批量生成等任务。
Writes local Python scripts for tasks that built-in tools or other skills cannot handle — data processing, format conversion, batch file operations, web scraping, test data generation, etc.

## 四步闭环(提高脚本质量与成功率)
## Directory Convention

与 coding 一致:**识别分析问题 → 规划路径 → 编写执行 → 检查验证**。
- **Root:** `script/`
- **Per task:** create a named subfolder, e.g. `script/20260305-data-clean/` or `script/json-to-csv-converter/`
- All Python files for one task stay in its subfolder.

1. **识别分析问题** — 明确输入/输出格式、数据规模、边界情况与错误信息(若有)。
2. **规划路径** — 确定脚本放在 `script/任务名/`、需要哪些文件/参数、是否要虚拟环境或依赖。
3. **代码编写** — 先读已有类似脚本或数据样例,再写 `main.py`;保持结构清晰、可读。
4. **检查验证** — 逻辑与异常处理自查;输出量大或敏感时,提示用户本地运行并查看结果,不代为执行。
## Commands (PowerShell)

## 目录约定
```powershell
# Run a script
python .\script\<task-folder>\main.py

- **工作区脚本根目录**:`script`
- **每个临时任务**:在 `script` 下新建一个 **独立子文件夹**,用有意义的名称(如时间戳或任务名),例如:
- `script/20260305-data-clean/`
- `script/json-to-csv-converter/`
- **该任务相关的所有 Python 文件** 都放在这个子文件夹中,避免不同任务的脚本混在一起。
# With arguments
python .\script\<task-folder>\main.py --input data.json --output result.csv

## 常用 Python 命令(PowerShell)
# Virtual environment (when dependencies needed)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install requests pandas
```

- **运行脚本(推荐使用工作区 Python)**:
- `python .\script\子文件夹\main.py`
- **指定脚本参数**:
- `python .\script\子文件夹\main.py --input data.json --output result.csv`
- **创建虚拟环境(如有需要)**:
- `python -m venv .venv`
- `.\.venv\Scripts\Activate.ps1`
- **安装依赖**(在已激活的虚拟环境中):
- `pip install requests pandas`
> Paths with spaces require quotes: `python ".\script\my-task\main.py"`

> 注意:命令在 **PowerShell** 中执行,含空格路径时要用引号,例如:`python ".\script\my-task\main.py"`。
## Workflow

## 使用原则

1. **优先选择 Python**:当内置工具或现有 Skill 无法方便完成任务时(例如复杂数据处理、文件批量重构、生成测试数据等),优先考虑编写 Python 脚本。
2. **保持脚本可重用**:尽量把一次性的脚本写得清晰、模块化,方便后续复用或改造。
3. **不负责最终运行结果展示**:如果输出量很大或涉及真实业务数据,可以提示用户在本地手动运行脚本并查看结果。

## 典型流程

1. 在 `script` 下为当前任务新建目录,例如 `script/20260305-clean-logs/`。
2. 在该目录下创建 `main.py` 及必要的辅助模块。
3. 在代码中实现读取输入文件、处理逻辑、输出结果等功能。
4. 根据需要提示用户在 PowerShell 中执行类似命令:
- `python .\script\20260305-clean-logs\main.py --input ".\logs\raw.log" --output ".\logs\clean.log"`
1. **Analyze** — clarify input/output formats, data scale, edge cases.
2. **Plan** — decide subfolder name, required dependencies, whether a venv is needed.
3. **Write** — read existing scripts or data samples first, then create `main.py`. Keep code clear and modular.
4. **Validate** — run `python -m py_compile main.py` for syntax check. For large or sensitive output, prompt the user to run locally rather than executing directly.

68 changes: 24 additions & 44 deletions OpenLum.Console/Skills/search/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,42 @@
---
name: search
description: "高效纯文本 / 代码搜索:优先用 Grep 做精确 / 正则匹配,配合 SemanticSearch 做语义级定位。只针对工作区内的文本与代码文件。"
description: "Searches workspace text and code files using Grep (ripgrep) for exact/regex matching and SemanticSearch for concept-level discovery. Use when: finding class/method/interface definitions, locating error codes or log messages, searching configuration keys, exploring where a feature is implemented, or narrowing scope before reading files. Handles .cs, .ts, .js, .json, .md, and other text files. Does NOT handle PDFs, Office docs, or binary files (use the read skill for those)."
---

# Search Skill(纯文本 / 代码搜索)
# Search Skill

适用于在**工作区文件**中快速定位字符串、正则模式、类名 / 方法名、错误信息等。
只处理**文本 / 代码**文件(如 .cs/.ts/.js/.json/.md 等),不负责 PDF/Office/CAD(这些由 `read` skill 处理)。
Searches workspace text and code files. Uses **Grep** (ripgrep) for exact/regex matching and **SemanticSearch** for concept-level discovery.

## 何时使用
## Workflow

- 想知道「某个类 / 方法 / 接口 / 常量定义在哪里」;
- 想找「某个错误码 / 日志片段 / 配置键」在代码中的所有出现位置;
- 在大仓库中,先用搜索快速缩小范围,再进入具体文件阅读或重构;
- 对某个功能「大概在哪一块代码里实现」不确定时,可配合 SemanticSearch 做语义级定位。
1. **Grep first** — for known strings, class names, error codes, log text:

## 使用的工具
```
Grep: pattern: "class\\s+OrderService", type: "cs"
Grep: pattern: "ERR_1234", output_mode: "files_with_matches"
Grep: pattern: "Payment failed", glob: "**/*.cs"
```

- **Grep 工具**(基于 ripgrep):高效、精确 / 正则匹配,是首选的纯文本搜索方式。
- 支持参数:`pattern`、`path`、`glob`、`type`、`output_mode`、`-i` 等。
- **SemanticSearch 工具**:当问题更偏「语义 / 概念」,而不是一个固定字符串时,用来找「某一类逻辑」所在的文件或函数。
Start with `output_mode: "files_with_matches"` to list affected files, then switch to `content` with `-C`/`-A`/`-B` for context.

## 推荐工作流
2. **SemanticSearch second** — for concept-level questions ("where is authentication handled?", "how is HTTP wrapped?"):

1. **精确定位:优先 Grep**
- 已知类名 / 方法名 / 错误码 / 日志文本:
- 例如查找类定义:`pattern: "class\\s+OrderService"`,`type: "cs"`;
- 查找错误码:`pattern: "ERR_1234"`,`output_mode: "files_with_matches"`;
- 查找日志关键字:`pattern: "Payment failed"`, `glob: "**/*.cs" 或 "**/*.ts"`.
- 先用 `output_mode: "files_with_matches"` 获取受影响文件列表,需要查看更多上下文时再切换成 `content`。
```
SemanticSearch: query: "HTTP API call wrapper", target_directories: ["OpenLum.Console/"]
```

2. **语义级定位:配合 SemanticSearch**
- 当你在问:「用户登录是在哪里做的?」「HTTP 请求是在哪一层封装的?」「缓存策略怎么实现?」时:
- 先用 SemanticSearch 在整个仓库或某个目录内搜索,例如:
- query: "Where are HTTP API calls wrapped?"
- target_directories: ["backend/"] 或 ["OpenLum.Console/"]
- 得到候选文件后,再在这些文件内部用 Grep 做更精确的字符串 / 正则搜索。
Then refine with Grep inside the candidate files.

3. **与其他技能的协作**
- 做 C#/.NET 重构或 Debug 时:优先组合 `csharp` + `search` + `coding`;
- 缺少专用工具,需要通过 Python 脚本处理数据前:用 `search` 找到相关输入文件 / 模板,再交给 `python` skill 规划脚本。
3. **Combine with other skills** — pair with `csharp` + `coding` for refactoring; use `search` to find inputs before handing off to `python` for processing.

## 使用技巧
## Tips

- **限制范围**:
- `path` 指向子目录(如 `src/`、`OpenLum.Console/`)以减少噪音;
- `glob`(如 `"**/*.cs"`, `"**/*.{ts,tsx}"`)避免搜索无关文件。
- **输出模式**:
- 快速罗列文件:`output_mode: "files_with_matches"`;
- 需要上下文:`output_mode: "content"` 并设置 `-C`/`-A`/`-B` 控制上下文行数。
- **大小写与正则**:
- 不确定大小写时使用 `-i: true`;
- 复杂匹配使用正则(如 `"HttpClient\\s*\\("`、`"ILogger<[^>]+>"` 等)。
- **Narrow scope**: set `path` to a subdirectory and `glob` to target file types (`"**/*.cs"`, `"**/*.{ts,tsx}"`).
- **Case-insensitive**: use `-i: true` when unsure about casing.
- **Regex patterns**: `"HttpClient\\s*\\("`, `"ILogger<[^>]+>"`.

## 不负责的内容
## Out of Scope

- 二进制文件、PDF、Office、CAD 等富文档的内容提取 → 使用 `read` skill 的相关 exe(`skills/read/...`)。
- 跨系统 / 网络搜索(如 GitHub / Web)→ 使用 `github` 或 `webbrowser` / `web_search` 相关技能。

> 总体原则:**能用 Grep 就尽量用 Grep,能先缩小文件范围再看完整文件,减少无目的扫描。** SemanticSearch 主要用来在概念层面「大致锁定区域」,然后继续回到 Grep 与文件阅读。
- Binary/PDF/Office/CAD → `read` skill
- GitHub/web search → `github` or `webbrowser` skill

Loading