agent-calling 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/GEMINI.md ADDED
@@ -0,0 +1,24 @@
1
+ # Gemini CLI 指令集 (agent-calling)
2
+
3
+ 作为本项目的辅助开发 Agent,你必须遵循以下任务委派准则:
4
+
5
+ ## 1. 复杂任务自动委派 (Claude Delegation)
6
+
7
+ 当用户提出的任务涉及复杂逻辑或需要深度分析时,你必须**优先使用子代理(Sub-agent)**(如 `claude-agent`)来执行委派任务,而不是由主代理直接发起工具调用:
8
+
9
+ - **系统架构分析**:如“分析项目整体架构”、“识别模块间依赖关系”、“技术栈分析”等。
10
+ - **产品指南**:如“产品定义”、“功能分析”等
11
+ - **需求规划**:如“需求拆分”、“开发流程规划”等
12
+
13
+ ### 执行协议
14
+ 1. **工具调用规范**:在子代理(如 `claude-agent`)中调用本项目提供的工具时,**必须使用完整前缀** `claude-mcp__run_claude`。
15
+ 2. **委派指令注入**:当主代理(你)发起 `claude-agent` 调用时,必须在 `query` 提示词中明确包含:“如果需要调用 Claude 工具,请务必使用完整工具名 `claude-mcp__run_claude`”。
16
+ 3. **注入上下文**:将当前正在处理的文件列表或相关的技术文档作为 `prompt` 的一部分。
17
+ 4. **结构化输出**:要求 Claude 返回 JSON 格式(如 `--output-format json`),以便后续自动化处理。
18
+
19
+ ## 工具偏好
20
+ - **首选工具**:在进行静态代码分析以外的逻辑决策时,`claude-agent` 具有最高优先级向。
21
+ - **降级方案**:如果 `claude-agent` 调用失败,请回退到 `codebase_investigator` 进行基础调研,并告知用户建议手动运行 Claude CLI。
22
+
23
+ ## 结果处理
24
+ - **直接展示结果**:当 `claude-agent` 子代理返回结果后,主代理必须**原样输出**给用户,严禁进行任何形式的二次总结、重写或改写。
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: claude-agent
3
+ description: 专门用于深度代码库分析、架构设计、复杂重构计划制定和深度代码审查的专家子代理。
4
+ kind: local
5
+ tools:
6
+ - read_file
7
+ - grep_search
8
+ - glob
9
+ - list_directory
10
+ - claude-mcp__run_claude
11
+ ---
12
+
13
+ # 角色定位
14
+ 你是一个资深的软件架构师和代码分析专家。你擅长通过阅读代码、分析依赖关系和理解设计模式来解构复杂的代码库。
15
+
16
+ # 强制性工作协议
17
+ 1. **工具调用规范**:在调用本项目提供的 Claude 增强工具时,你**必须**使用完整工具名 `claude-mcp__run_claude`。
18
+ 2. **用户指令传递**:在发起调用时,提示词中应尽可能完整的传达用户语义。
@@ -0,0 +1,41 @@
1
+ {
2
+ "id": "agent-calling",
3
+ "name": "agent-calling",
4
+ "version": "0.1.0",
5
+ "description": "Gemini cli agent 增强组件,通过路径劫持和上下文注入在 Gemini CLI 中调用 其他模型。",
6
+ "entrypoint": "dist/index.js",
7
+ "capabilities": {
8
+ "tools": true
9
+ },
10
+ "mcpServers": {
11
+ "claude-mcp": {
12
+ "command": "node",
13
+ "args": [
14
+ "${extensionPath}/dist/index.js"
15
+ ]
16
+ }
17
+ },
18
+ "tools": [
19
+ {
20
+ "name": "run_claude",
21
+ "description": "调用 Anthropic 的 Claude CLI。支持复杂的代码库分析、架构设计和计划制定。它将自动注入当前工作区上下文并劫持 PATH 环境变量。注意:在子代理中调用时,请务必使用完整工具名 'claude-mcp__run_claude'。",
22
+ "inputSchema": {
23
+ "type": "object",
24
+ "properties": {
25
+ "prompt": {
26
+ "type": "string",
27
+ "description": "发送给 Claude CLI 的提示词或指令。"
28
+ },
29
+ "args": {
30
+ "type": "array",
31
+ "items": {
32
+ "type": "string"
33
+ },
34
+ "description": "透传给 Claude CLI 的原始命令行参数。"
35
+ }
36
+ },
37
+ "required": ["prompt"]
38
+ }
39
+ }
40
+ ]
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-calling",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A Gemini CLI plugin that wraps Claude CLI with path hijacking.",
5
5
  "bin": {
6
6
  "agent-calling": "./dist/index.js"
@@ -15,7 +15,10 @@
15
15
  "main": "dist/index.js",
16
16
  "types": "dist/index.d.ts",
17
17
  "files": [
18
- "dist"
18
+ "dist",
19
+ "agents",
20
+ "GEMINI.md",
21
+ "gemini-extension.json"
19
22
  ],
20
23
  "publishConfig": {
21
24
  "access": "public"