feat(app): 移除内置agents并添加CORS支持和技能上传优化

移除了agents/registry.json中的所有内置agents配置,将agents数组清空。
为web应用添加了CORS中间件支持,允许指定的前端地址跨域访问。
重构了技能上传功能,增加了LLM重写机制,自动规范化上传的技能格式。
新增了工具名称提取逻辑,从技能正文中自动识别Required Tools段落。
更新了技能学习候选者和草稿的载荷结构,添加评估报告统计信息。
修改了意图路由技能的说明,改进任务状态管理逻辑。
This commit is contained in:
2026-06-12 13:25:20 +08:00
parent fc9fd93c36
commit 8aeb97a5fc
76 changed files with 3382 additions and 553 deletions

View File

@ -5,9 +5,16 @@
"display_name": "filesystem-operation",
"lineage": [],
"name": "filesystem-operation",
"owners": ["system"],
"owners": [
"system"
],
"source_kind": "initial",
"status": "active",
"tags": ["filesystem", "file", "io", "directory"],
"tags": [
"filesystem",
"file",
"io",
"directory"
],
"updated_at": "2026-05-26T00:00:00.000000+00:00"
}
}

View File

@ -9,42 +9,83 @@ tools:
- list_directory
---
# Filesystem Operation — 文件系统操作
# Filesystem Operation
## Overview
本地文件系统读写、搜索和目录操作。支持读取、写入、修改、搜索文件和目录遍历。
## When to Use
- Use when the task requires Filesystem Operation guidance.
## Required Tools
- `read_file`
- `write_file`
- `patch_file`
- `search_files`
- `list_directory`
## Workflow
- Identify whether the user's request matches the skill's trigger conditions.
- Read the relevant source guidance below and apply only the steps that fit the current task.
- Use the required tools deliberately and keep tool output tied to the user's goal.
### Source Guidance
### Filesystem Operation — 文件系统操作
本地文件系统工具集,用于读写和搜索项目文件。
## 工具说明
#### 工具说明
### read_file
##### read_file
读取本地文件内容。
- 使用 `skill_view` 查看文件预览
- 大文件会分页返回,可通过 offset/limit 控制
### write_file
##### write_file
写入新文件或覆盖已有文件。
- 创建新文件时自动创建父目录
- 写入前确认不会覆盖重要配置
### patch_file
##### patch_file
精确修改文件中的指定内容。
- 通过搜索-替换方式修改
- 适用于局部更新,避免整文件重写
### search_files
##### search_files
在项目中搜索文件名或内容。
- 支持 glob 模式匹配
- 支持按内容搜索
- 支持限制搜索目录深度
### list_directory
##### list_directory
列出目录内容。
- 可递归列出子目录
- 支持过滤文件类型
## 使用原则
#### 使用原则
1. 优先使用 `read_file` 查看文件内容,再决定修改方案
2. 小范围修改用 `patch_file`,大范围用 `write_file`
3. 搜索文件时先确认路径是否存在
4. 修改前确认文件编码(默认 UTF-8
5. 敏感文件(.env、密钥等不写入版本控制
## Validation
- Verify the requested outcome with the most direct available check.
- Report any skipped step, unavailable dependency, or remaining uncertainty explicitly.
## Boundaries
- Do not broaden the task beyond the user's request.
- Do not use tools that are not listed or clearly available in the current runtime.
## Anti-Patterns
- Do not summarize the skill instead of applying it.
- Do not claim completion without validation evidence.

View File

@ -1,12 +1,18 @@
{
"change_reason": "Initial skill for local filesystem operations",
"content_hash": "placeholder",
"content_hash": "d462cfff23d0a7c79e5c7319c66952133482193f063150062a93853a489e1160",
"created_at": "2026-05-26T00:00:00.000000+00:00",
"created_by": "system",
"frontmatter": {
"description": "本地文件系统读写、搜索和目录操作。支持读取、写入、修改、搜索文件和目录遍历。",
"name": "filesystem-operation",
"tools": ["read_file", "write_file", "patch_file", "search_files", "list_directory"]
"tools": [
"read_file",
"write_file",
"patch_file",
"search_files",
"list_directory"
]
},
"parent_version": null,
"provenance": {
@ -15,8 +21,14 @@
},
"review_state": "published",
"skill_name": "filesystem-operation",
"summary": "Filesystem Operation — 本地文件系统操作工具集",
"summary_hash": "placeholder",
"tool_hints": ["read_file", "write_file", "patch_file", "search_files", "list_directory"],
"summary": "# Filesystem Operation ## Overview 本地文件系统读写、搜索和目录操作。支持读取、写入、修改、搜索文件和目录遍历。",
"summary_hash": "aa53a9010f1f28469aecbdc81e382a2a6ff1a1335cce3abba56ae9a084535605",
"tool_hints": [
"read_file",
"write_file",
"patch_file",
"search_files",
"list_directory"
],
"version": "v0001"
}
}