Files
agent-skills/README.md
T
ken.li b88e934f86 Add Agent Skills documentation and implement g3fo-bug-finder skill
- Created README.md to introduce the Agent Skills repository and its functionalities.
- Added g3fo-bug-finder skill with detailed SKILL.md for automated bug diagnosis on remote servers.
- Included service inventory reference for mapping services to server configurations.
- Implemented scripts for fetching logs and configurations from remote servers using SSH and Nacos API.
- Provided usage instructions and environment setup for Python dependencies.
2026-01-16 17:56:29 +08:00

81 lines
3.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Agent Skills
这是一个为 Cursor 和 Claude Agent 设计的“技能 (Skills)”集合仓库。
## 什么是 Agent Skills?
根据 [Cursor 官方文档](https://cursor.com/cn/docs/context/skills),Agent Skills 是 Agent 的**动态能力**:
- **按需加载**:与始终加载的 Rules(规则)不同,Skills 仅在 Agent 认为与当前任务相关时才被调用。
- **结构化定义**:每个 Skill 由一个 `SKILL.md` 文件定义,通常包含:
- **Frontmatter**:定义 Skill 的名称和触发描述。
- **Markdown 指令**:提供特定领域的知识或工作流。
- **附属资源**:包括脚本 (`scripts/`)、参考文档 (`references/`) 和素材 (`assets/`)。
- **扩展性**:通过自定义命令 (`/command`) 和钩子 (Hooks) 增强 Agent 的自动化能力。
> **提示**:目前 Agent Skills 功能主要在 Cursor 的 **Nightly/Beta** 渠道中提供。
## 环境准备
本项目中的部分技能依赖本地 Python 环境执行自动化任务(如日志提取、配置分析等)。
### 1. 安装 Python
请确保您的系统中已安装 Python 3.8+:
- **Windows**: [从 Python 官网下载](https://www.python.org/downloads/windows/) 并确保勾选 "Add Python to PATH"。
- **验证安装**: 在终端运行 `python --version`。
### 2. 安装依赖
部分 Skill(如 `g3fo-bug-finder`)需要额外的库:
```bash
pip install paramiko
```
## 如何使用
### 本地同步
本项目提供了一个 `skill-sync` 技能,用于将项目内的 Skills 同步到 Claude 的全局目录。
1. **同步命令 (Windows)**:
```powershell
powershell -ExecutionPolicy Bypass -File skills/skill-sync/scripts/sync.ps1
```
2. **全局路径**: 同步后的 Skills 将存放在 `~/.claude/skills` (即 `C:\Users\<YourUser>\.claude\skills`)。
### 触发技能
Agent 会根据您的请求内容自动识别并加载相关的技能。您也可以在对话中显式提及,例如:
- “使用 `g3fo-bug-finder` 帮我看看 order-service 为什么报错。”
- “根据 `g3fo-docs` 生成 client_a 的部署配置。”
---
## 现有技能概览
### 本仓库核心技能 (Project Skills)
| 技能名称 | 作用说明 |
| :--- | :--- |
| **g3fo-bug-finder** | **故障排查专家**:自动登录远程 Ubuntu 服务器,提取日志,结合 Nacos 配置与代码进行 Bug 诊断和修复。 |
| **g3fo-docs** | **系统百科全书**:管理业务流程、服务职责、资产清单(Dev/UAT/客户)以及中间件标准部署规范。 |
| **skill-creator** | **技能创作指南**:提供创建、初始化、打包新技能的标准工作流和设计模式。 |
| **skill-sync** | **同步工具**:实现从项目到全局环境的技能同步,方便开发与调试。 |
### 常用系统/全局技能 (System Skills)
| 技能名称 | 作用说明 |
| :--- | :--- |
| **canvas-design** | 视觉艺术创作,生成 .png 或 .pdf 设计稿。 |
| **docx / pdf / pptx** | 专业的文档、PDF 及幻灯片处理与分析。 |
| **create-rule** | 创建 Cursor Rules (`.mdc`),用于持久化的编码规范引导。 |
| **create-subagent** | 创建专门的子代理,用于代码审查、调试等特定任务。 |
| **update-settings** | 修改 Cursor/VSCode 的 `settings.json` 配置。 |
---
## 技能开发建议
如果您想创建新技能,请参考 `skills/skill-creator/SKILL.md`。核心步骤如下:
1. **理解场景**:确定技能要解决的具体重复性问题。
2. **初始化**:运行 `python skills/skill-creator/scripts/init_skill.py <name>`。
3. **编写逻辑**:在 `SKILL.md` 中定义工作流,并在 `scripts/` 中编写辅助脚本。
4. **打包与同步**:完成开发后进行打包,并同步至全局环境测试。