diff --git a/README.md b/README.md index 0a13fb7..988ed38 100644 --- a/README.md +++ b/README.md @@ -23,16 +23,16 @@ DesireCore 官方市场仓库,存放官方维护的 Agent/Skill 定义,以 The market currently contains: - `1` Agent: `desirecore` -- `30` local built-in skills with `SKILL.md` +- `31` local built-in skills with `SKILL.md` - `22` external skill entries with `entry.json` -- `52` publishable skills in total (`SKILL.md` + `entry.json`) +- `53` publishable skills in total (`SKILL.md` + `entry.json`) ## Skill Sources Local built-in skills are installable from this repository and must be listed in `builtin-skills.json`: ```text -configuring-compute, create-agent, dashscope-image-gen, delete-agent, +code-intelligence, configuring-compute, create-agent, dashscope-image-gen, delete-agent, dev-environment-setup, discover-agent, docx, frontend-design, guizang-ppt, image-to-image, mail-operations, manage-skills, manage-teams, markdown, minimax-music-gen, minimax-video-gen, nodejs-runtime, pdf, pptx, diff --git a/builtin-skills.json b/builtin-skills.json index e16f94d..6821841 100644 --- a/builtin-skills.json +++ b/builtin-skills.json @@ -1,5 +1,6 @@ { "skills": [ + "code-intelligence", "configuring-compute", "create-agent", "dashscope-image-gen", diff --git a/manifest.json b/manifest.json index 4529211..5efcc9a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "DesireCore Official Market", - "version": "1.2.15", + "version": "1.2.16", "schemaVersion": "1.1.0", "supportedLocales": ["zh-CN", "en-US"], "defaultLocale": "en-US", @@ -27,8 +27,8 @@ }, "stats": { "totalAgents": 1, - "totalSkills": 52, - "lastUpdated": "2026-07-19" + "totalSkills": 53, + "lastUpdated": "2026-07-22" }, "features": [ "curated-index", diff --git a/skills/code-intelligence/SKILL.md b/skills/code-intelligence/SKILL.md new file mode 100644 index 0000000..24ca570 --- /dev/null +++ b/skills/code-intelligence/SKILL.md @@ -0,0 +1,133 @@ +--- +name: code-intelligence +description: >- + Use this skill when the user needs semantic code navigation backed by a + Language Server: jump to definitions or implementations, find references, + inspect hover/type information, list document or workspace symbols, or trace + incoming and outgoing calls. Activate it for requests such as "where is this + symbol defined", "find usages", "who calls this function", "show the file + outline", or "search symbols in the workspace". A compatible Language Server + must already be installed; this skill never installs one automatically. Use + when 用户提到 跳转定义、查找引用、查找实现、类型信息、悬停信息、符号大纲、 + 工作区符号、调用关系、谁调用了这个函数、这个函数调用了谁、语义代码导航。 +version: 1.0.0 +type: procedural +risk_level: low +status: enabled +disable-model-invocation: true +tags: + - development + - lsp + - code-navigation + - symbols + - references +provides: + tools: + - Lsp +metadata: + author: desirecore + updated_at: '2026-07-22' + i18n: + default_locale: en-US + source_locale: zh-CN + locales: + - zh-CN + - en-US + zh-CN: + name: 代码智能 + short_desc: 基于 Language Server 的定义、引用、符号与调用关系导航 + description: >- + 使用已安装的 Language Server 执行语义代码导航,包括定义、引用、实现、悬停类型、符号大纲和调用层级。 + body: ./SKILL.zh-CN.md + source_hash: sha256:cf613ab2572810e5 + translated_by: human + en-US: + name: Code Intelligence + short_desc: Language Server powered definitions, references, symbols, and call navigation + description: >- + Use an installed Language Server for semantic code navigation, including definitions, references, implementations, hover types, symbols, and call hierarchies. + body: ./SKILL.md + source_hash: sha256:cf613ab2572810e5 + translated_by: human +market: + icon: >- + + category: development + maintainer: + name: DesireCore Official + verified: true + compatible_agents: [] + channel: latest + required_client_version: 10.0.94 +--- + +# code-intelligence Skill + +## L0: One-line Summary + +Use DesireCore's hidden `Lsp` tool for semantic code navigation through an already-installed Language Server. + +## L1: When to Use + +Activate this skill when the task depends on symbol meaning rather than text matching: + +- Jump to a symbol's definition or implementation. +- Find all semantic references to a symbol. +- Inspect type information or documentation at a source position. +- List the symbols in one file or search symbols across the workspace. +- Find callers and callees through the LSP call hierarchy. + +Use `Grep` or `Glob` instead when the task is purely textual or no compatible Language Server is installed. + +## L2: Operating Procedure + +### 1. Check the workspace boundary + +`Lsp` starts an external indexing process that can read the authorized workspace. The target file therefore needs directory-level read access. If the tool reports that an exact-file grant is insufficient, ask the user to authorize the project directory through `ManageWorkDirs`; never widen the scope silently. + +### 2. Choose one operation + +| Operation | Purpose | Required input | +|---|---|---| +| `goToDefinition` | Find where a symbol is defined | file, line, character | +| `findReferences` | Find semantic references, including the declaration | file, line, character | +| `hover` | Read type information or documentation | file, line, character | +| `documentSymbol` | Outline symbols in one file | file | +| `workspaceSymbol` | Search named symbols in the current workspace | file, non-empty query | +| `goToImplementation` | Find concrete implementations | file, line, character | +| `prepareCallHierarchy` | Resolve a callable item at a position | file, line, character | +| `incomingCalls` | Find functions or methods that call the target | file, line, character | +| `outgoingCalls` | Find functions or methods called by the target | file, line, character | + +`line` and `character` are 1-based, matching editor coordinates. Character offsets use UTF-16 semantics. + +### 3. Treat results as bounded navigation evidence + +- Results are filtered by the active read scope and workspace `.gitignore` rules. +- Use `maxResults` to keep broad reference or symbol searches focused; the maximum is 200. +- A first request may take longer while the server indexes the workspace. +- Re-run the request after source files change; DesireCore synchronizes the latest saved UTF-8 content. + +### 4. Handle missing servers without modifying the system + +DesireCore only discovers installed binaries and returns an installation hint when one is missing. Do not run that installation command unless the user explicitly asks you to install the dependency. + +Supported built-in mappings: + +- TypeScript/JavaScript: `typescript-language-server` +- Python: `pyright-langserver` +- Go: `gopls` +- Rust: `rust-analyzer` + +### 5. Fallbacks + +- Unsupported file type or missing server: use `Grep`, `Glob`, and `Read` for text-level investigation. +- Server does not advertise an operation: report that capability mismatch instead of guessing. +- Empty semantic result: explain that the symbol may be unresolved, excluded, or filtered by access rules; do not claim the symbol has no usages without qualification. diff --git a/skills/code-intelligence/SKILL.zh-CN.md b/skills/code-intelligence/SKILL.zh-CN.md new file mode 100644 index 0000000..72b0445 --- /dev/null +++ b/skills/code-intelligence/SKILL.zh-CN.md @@ -0,0 +1,66 @@ + + +# code-intelligence 技能 + +## L0:一句话摘要 + +通过用户已经安装的 Language Server,使用 DesireCore 默认隐藏的 `Lsp` 工具完成语义代码导航。 + +## L1:何时使用 + +当任务依赖符号语义而不是文本匹配时激活本技能: + +- 跳转到符号的定义或具体实现。 +- 查找符号的全部语义引用。 +- 查看源码位置上的类型信息或文档。 +- 列出单个文件的符号大纲,或在工作区内搜索符号。 +- 通过 LSP 调用层级查找调用者与被调用者。 + +如果需求只是文本搜索,或者没有兼容的 Language Server,改用 `Grep` 或 `Glob`。 + +## L2:操作流程 + +### 1. 检查工作区权限边界 + +`Lsp` 会启动能够读取授权工作区的外部索引进程,因此目标文件必须具备目录级读取权限。如果工具提示精确文件授权不足,应让用户通过 `ManageWorkDirs` 授权项目目录;不得静默扩大访问范围。 + +### 2. 选择一个 operation + +| Operation | 用途 | 必需输入 | +|---|---|---| +| `goToDefinition` | 查找符号定义 | 文件、行、列 | +| `findReferences` | 查找语义引用,包含声明 | 文件、行、列 | +| `hover` | 查看类型信息或文档 | 文件、行、列 | +| `documentSymbol` | 获取单个文件的符号大纲 | 文件 | +| `workspaceSymbol` | 在当前工作区搜索具名符号 | 文件、非空 query | +| `goToImplementation` | 查找具体实现 | 文件、行、列 | +| `prepareCallHierarchy` | 解析当前位置的可调用符号 | 文件、行、列 | +| `incomingCalls` | 查找谁调用了目标符号 | 文件、行、列 | +| `outgoingCalls` | 查找目标符号调用了谁 | 文件、行、列 | + +`line` 和 `character` 都是与编辑器一致的 1-based 坐标;列偏移使用 UTF-16 语义。 + +### 3. 把结果作为有边界的导航证据 + +- 返回位置会经过当前读取范围和工作区 `.gitignore` 过滤。 +- 引用或符号过多时使用 `maxResults` 收敛结果,最大值为 200。 +- 首次调用时 Language Server 可能需要索引工作区,因此耗时会更长。 +- 源码文件变化后重新调用;DesireCore 会同步最新的已保存 UTF-8 内容。 + +### 4. 缺少 Server 时不得擅自修改系统 + +DesireCore 只探测用户已经安装的二进制,缺失时返回安装提示。除非用户明确要求安装依赖,否则不得执行该安装命令。 + +内置支持映射: + +- TypeScript/JavaScript:`typescript-language-server` +- Python:`pyright-langserver` +- Go:`gopls` +- Rust:`rust-analyzer` + +### 5. 降级策略 + +- 文件类型不支持或 Server 未安装:使用 `Grep`、`Glob`、`Read` 做文本级调查。 +- Server 未声明某项能力:如实报告 capability 不匹配,不得猜测结果。 +- 语义结果为空:说明符号可能未解析、被排除或被访问规则过滤;不能直接断言“没有引用”。 +