mcpField
D
development-assistant

development-assistant

github.com/robthepcguy开发20659 次安装3 天前更新
代码仓库

关于 development-assistant

development-assistant 是用于扩展 Claude Patent Creator 的开发技能,面向添加工具、分析器、配置和功能的开发者。它提供遵循现有模式的实施、验证、测试与文档工作流。

主要功能

  1. 01指导添加 MCP 工具
  2. 02指导构建 USPTO 合规分析器
  3. 03使用 Pydantic 添加配置
  4. 04修改 RAG 搜索流程
  5. 05添加 Claude Code 斜杠命令
  6. 06提供性能监控模式

适用场景

  1. 01为项目扩展 MCP 工具
  2. 02实现新的合规分析器
  3. 03调整 RAG 检索与重排
  4. 04为功能添加测试和文档

MCP 相关

该技能说明如何在 Claude Patent Creator 中添加 MCP 工具,包括输入验证、性能监控和服务器注册。

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/robthepcguy/claude-patent-creator --skill development-assistant

安装后在 Claude Code 中输入/development-assistant确认已加载。

详细介绍

开发助手技能

用于开发和扩展 Claude Patent Creator 的专家系统。指导你按照最佳实践和现有模式添加新的 MCP 工具、分析器、配置选项和功能。

何时使用此技能

添加 MCP 工具、分析器、配置选项、BigQuery 查询、斜杠命令,或实现性能优化时使用。

开发工作流

Feature Request -> Planning -> Implementation (Code + Validation + Monitoring + Tests) -> Testing -> Documentation -> Integration

添加新的 MCP 工具

快速入门:

  1. 定义输入、输出和依赖项
  2. 在 mcp_server/validation.py 中创建 Pydantic 模型
  3. 在 mcp_server/server.py 中使用装饰器添加工具函数
  4. 在 scripts/ 中创建测试脚本
  5. 更新 CLAUDE.md

关键装饰器:

@mcp.tool()                    # Register as MCP tool
@validate_input(YourInput)     # Pydantic validation
@track_performance             # Performance monitoring

模板:

def your_tool(param: str, optional: int = 10) -> dict:
    """Comprehensive docstring (Claude sees this).

    Args:
        param: Description
        optional: Description with default

    Returns:
        Dictionary containing: key1, key2, key3
    """
    # Implementation
    return {"result": "data"}

添加新的分析器

概述: 分析器继承自 BaseAnalyzer,并检查是否符合 USPTO 要求。

最简示例:

from mcp_server.analyzer_base import BaseAnalyzer

class YourAnalyzer(BaseAnalyzer):
    def __init__(self):
        super().__init__()
        self.mpep_sections = ["608", "2173"]

    def analyze(self, content: str) -> dict:
        issues = []
        if violation:
            issues.append({
                "type": "violation_name",
                "severity": "critical",
                "mpep_citation": "MPEP 608",
                "recommendation": "Fix description"
            })
        return {"compliant": len(issues) == 0, "issues": issues}

添加配置选项

在 mcp_server/config.py 中使用 Pydantic 设置:

# In config.py
class AppSettings(BaseSettings):
    enable_feature_x: bool = Field(default=False, description="Enable X")

# In your code
from mcp_server.config import get_settings
if get_settings().enable_feature_x:
    # Feature enabled

添加性能监控

@track_performance
def your_function(data):
    with OperationTimer("step1"):
        result1 = step1(data)
    with OperationTimer("step2"):
        result2 = step2(result1)
    return result2

修改 RAG 搜索管道

管道:Query -> HyDE -> Vector+BM25 -> RRF -> Reranking -> Results

自定义点: 查询扩展、自定义评分、过滤、重排序策略

添加新的斜杠命令

  1. 创建 .claude/commands/your-command.md
  2. 添加 frontmatter:description、model
  3. 编写工作流说明
  4. 重启 Claude Code

模板:

---
description: Brief command description
model: claude-sonnet-4-5-20250929
---

# Command Name

## When to Use
- Use case 1

## How It Works
Step 1: ...

开发最佳实践

  1. 遵循现有模式
  2. 使用类型提示
  3. 编写文档字符串(Google 风格)
  4. 妥善处理错误
  5. 验证输入(Pydantic)
  6. 记录操作日志
  7. 监控性能

常见开发任务

添加 BigQuery 查询: 在 mcp_server/bigquery_search.py 中添加方法

添加验证规则:

class YourInput(BaseModel):
    field: str

    @field_validator("field")
    @classmethod
    def validate_field(cls, v):
        if not meets_requirement(v):
            raise ValueError("Error message")
        return v

添加日志记录:

from mcp_server.logging_config import get_logger
logger = get_logger()
logger.info("event_name", extra={"context": "data"})

快速参考:文件位置

任务主要文件相关文件
添加 MCP 工具mcp_server/server.pymcp_server/validation.py
添加分析器mcp_server/your_analyzer.pymcp_server/analyzer_base.py
添加配置mcp_server/config.py.env、CLAUDE.md
添加 BigQuery 查询mcp_server/bigquery_search.py-
添加测试scripts/test_your_feature.py-

关键模式

MCP 工具模式:

@mcp.tool()
@validate_input(InputModel)
@track_performance
def tool_name(param: type) -> dict:
    """Docstring visible to Claude."""
    from module import Component
    if invalid:
        return {"error": "message"}
    result = process(param)
    return {"key": "value"}

分析器模式:

class YourAnalyzer(BaseAnalyzer):
    def analyze(self, content: str) -> dict:
        issues = []
        issues.extend(self._check_x(content))
        return {
            "compliant": len(issues) == 0,
            "issues": issues,
            "recommendations": self._generate_recommendations(issues)
        }

评论

支持 Markdown