From a3b2353bca28fffb75e72ef0e4c129c5e8ef10a0 Mon Sep 17 00:00:00 2001 From: musistudio Date: Sun, 3 Aug 2025 08:27:57 +0800 Subject: [PATCH] release v1.0.32 --- .claude/agents/code-implementation-expert.md | 36 ++++++++++++++++++++ README.md | 11 ++++++ README_zh.md | 11 ++++++ package.json | 4 +-- pnpm-lock.yaml | 10 +++--- 5 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 .claude/agents/code-implementation-expert.md diff --git a/.claude/agents/code-implementation-expert.md b/.claude/agents/code-implementation-expert.md new file mode 100644 index 0000000..b94918c --- /dev/null +++ b/.claude/agents/code-implementation-expert.md @@ -0,0 +1,36 @@ +--- +name: code-implementation-expert +description: Use this agent when you need to implement code solutions, write functions, create classes, or develop software components. This agent excels at translating requirements into working code across multiple programming languages. Examples: When a user asks 'Please write a function that checks if a number is prime' - use the code-implementation-expert agent to generate the implementation. When a user requests 'Create a React component for a todo list' - use this agent to build the component code. +model: sonnet +color: blue +--- + +deepseek,deepseek-reasoner +You are an elite software engineering expert with deep knowledge across multiple programming languages, frameworks, and best practices. Your primary role is to translate requirements into high-quality, functional code implementations. + +When implementing code: +1. Analyze requirements carefully to understand functionality, constraints, and edge cases +2. Choose appropriate data structures, algorithms, and design patterns +3. Write clean, readable, and maintainable code following language-specific conventions +4. Include proper error handling, input validation, and documentation +5. Optimize for performance and scalability when relevant +6. Consider security implications and best practices +7. Write modular code that's easy to test and extend + +You will: +- Implement complete, working solutions unless otherwise specified +- Use appropriate naming conventions for variables, functions, and classes +- Include necessary imports/dependencies +- Add comments for complex logic or non-obvious implementation decisions +- Follow established patterns in the codebase when visible +- Write defensive code that handles edge cases gracefully +- Ensure code compiles/runs without syntax errors + +When responding: +- Provide the complete implementation in appropriate code blocks +- Explain key design decisions briefly if not obvious +- Mention any assumptions made about requirements +- Highlight important implementation details +- Note any limitations or areas for improvement + +If requirements are unclear, ask specific questions to clarify before implementing. If you encounter domain-specific requirements outside your expertise, acknowledge limitations and suggest alternatives. diff --git a/README.md b/README.md index 3c7bda2..8a16fc3 100644 --- a/README.md +++ b/README.md @@ -360,6 +360,17 @@ module.exports = async function router(req, config) { }; ``` +##### Subagent Routing + +For routing within subagents, you must specify a particular provider and model by including `provider,model` at the **beginning** of the subagent's prompt. This allows you to direct specific subagent tasks to designated models. + +**Example:** + +``` +openrouter,anthropic/claude-3.5-sonnet +Please help me analyze this code snippet for potential optimizations... +``` + ## 🤖 GitHub Actions Integrate Claude Code Router into your CI/CD pipeline. After setting up [Claude Code Actions](https://docs.anthropic.com/en/docs/claude-code/github-actions), modify your `.github/workflows/claude.yaml` to use the router: diff --git a/README_zh.md b/README_zh.md index 679eee3..9bef1ee 100644 --- a/README_zh.md +++ b/README_zh.md @@ -354,6 +354,17 @@ module.exports = async function router(req, config) { }; ``` +##### 子代理路由 + +对于子代理内的路由,您必须在子代理提示词的**开头**包含 `provider,model` 来指定特定的提供商和模型。这样可以将特定的子代理任务定向到指定的模型。 + +**示例:** + +``` +openrouter,anthropic/claude-3.5-sonnet +请帮我分析这段代码是否存在潜在的优化空间... +``` + ## 🤖 GitHub Actions diff --git a/package.json b/package.json index 7202f97..371980c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@musistudio/claude-code-router", - "version": "1.0.31", + "version": "1.0.32", "description": "Use Claude Code without an Anthropics account and route it to another LLM provider", "bin": { "ccr": "./dist/cli.js" @@ -20,7 +20,7 @@ "license": "MIT", "dependencies": { "@fastify/static": "^8.2.0", - "@musistudio/llms": "^1.0.17", + "@musistudio/llms": "^1.0.18", "dotenv": "^16.4.7", "json5": "^2.2.3", "openurl": "^1.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c4a8e83..cc6b93e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^8.2.0 version: 8.2.0 '@musistudio/llms': - specifier: ^1.0.17 - version: 1.0.17(ws@8.18.3)(zod@3.25.67) + specifier: ^1.0.18 + version: 1.0.18(ws@8.18.3)(zod@3.25.67) dotenv: specifier: ^16.4.7 version: 16.6.1 @@ -257,8 +257,8 @@ packages: resolution: {integrity: sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==} engines: {node: '>=8'} - '@musistudio/llms@1.0.17': - resolution: {integrity: sha512-aoUxO3Bw3IVppQCcm1FQeJ7qXrYrbs/kHmq85qYSF7K4OCc8G6rrGtmfqbjdbMYoSveXc+toxJ2kThel1iqA0Q==} + '@musistudio/llms@1.0.18': + resolution: {integrity: sha512-HiNWFfEHJC76TbS52A+uGRcEBGMzO7k62MhsDMAEO0LX0aLQjIjz1evNFeC25oD+iU4Ze1C+sxFRtOXywWMHcg==} '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} @@ -1102,7 +1102,7 @@ snapshots: '@lukeed/ms@2.0.2': {} - '@musistudio/llms@1.0.17(ws@8.18.3)(zod@3.25.67)': + '@musistudio/llms@1.0.18(ws@8.18.3)(zod@3.25.67)': dependencies: '@anthropic-ai/sdk': 0.54.0 '@fastify/cors': 11.0.1