跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
搜索与研究

verify-language

Language-specific verification for Python, TypeScript/JavaScript, and Go. Checks type safety, language idioms, and best practices. Use when asked to "verify language", "check types", or for language-specific checks.

Aurite-ai · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add Aurite-ai/agent-verifier --skill verify-language

技能说明


name: verify-language version: "1.0.0" description: Language-specific verification for Python, TypeScript/JavaScript, and Go. Checks type safety, language idioms, and best practices. Use when asked to "verify language", "check types", or for language-specific checks.

Language-Specific Verification

Purpose

Verify code against language-specific best practices and idioms for Python, TypeScript/JavaScript, and Go. All analysis happens locally.

When to Use

Trigger this skill when the user asks to:

  • "verify agent language"
  • "verify language"
  • "check types"
  • "check Python/TypeScript/Go code"

This skill is also auto-invoked by the main verification orchestrator based on detected language.

Note: For full verification including security, patterns, and quality checks, tell the user to say "verify agent".

Process

Step 1: Detect Language

Identify the primary language by checking:

IndicatorLanguage
pyproject.toml, requirements.txt, setup.pyPython
package.json, tsconfig.jsonTypeScript/JavaScript
go.mod, go.sumGo
Cargo.tomlRust

Also check file extensions in src/ or project root:

  • .py → Python
  • .ts, .tsx, .js, .jsx → TypeScript/JavaScript
  • .go → Go
  • .rs → Rust

Step 2: Run Language-Specific Checks

Apply checks based on detected language. Each section below is only applicable for its language.


Python Checks

[PATTERN] Type Hints on Public Functions

Flag any def function in public scope (no leading _) that has parameters without type annotations.

Examples:

# ⚠️ Warning - Missing type hints
def get_user(user_id):
    return db.find_user(user_id)

def process_items(items, filter_fn):
    return [filter_fn(item) for item in items]

# ✅ Pass - Has type hints
def get_user(user_id: int) -> User:
    return db.find_user(user_id)

def process_items(items: list[Item], filter_fn: Callable[[Item], bool]) -> list[Item]:
    return [filter_fn(item) for item in items]

Scope:

  • Public functions (no leading _)
  • Class methods (except __init__ can skip return type)
  • Module-level functions

Severity: ⚠️ Warning


[HEURISTIC] Docstrings

Check for missing docstrings:

LocationRequirement
ModuleTop-level docstring explaining purpose
ClassDocstring explaining class responsibility
Public functionDocstring explaining args, returns, raises

Examples:

# ⚠️ Warning - Missing docstrings
class UserService:
    def get_user(self, user_id: int) -> User:
        return self.db.find(user_id)

# ✅ Pass - Documented
class UserService:
    """Service for user-related operations."""
    
    def get_user(self, user_id: int) -> User:
        """
        Retrieve a user by ID.
        
        Args:
            user_id: The unique identifier of the user
            
        Returns:
            User object if found
            
        Raises:
            UserNotFoundError: If user doesn't exist
        """
        return self.db.find(user_id)

Severity: ⚠️ Warning


[PATTERN] Requirements Pinning

Check requirements.txt and pyproject.toml dependencies:

PatternSeverity
package>=1.0❌ Issue
package>1.0❌ Issue
package (no version)❌ Issue
package==1.0.0✅ Pass
package~=1.0✅ Pass

In pyproject.toml:

# ❌ Issue
[project]
dependencies = [
    "langchain>=0.1.0",
    "openai",
]

# ✅ Pass
[project]
dependencies = [
    "langchain==0.1.0",
    "openai==1.12.0",
]

Severity: ❌ Issue


[HEURISTIC] Python Idioms

Check for non-idiomatic patterns:

Anti-patternIdiomatic
if len(list) > 0:if list:
if x == True:if x:
list = list + [item]list.append(item)
for i in range(len(list)):for item in list: or enumerate()
dict.keys() iterationDirect dict iteration

Severity: ⚠️ Warning


TypeScript/JavaScript Checks

[PATTERN] Strict Mode

Check tsconfig.json for strict type checking:

// ❌ Issue - Not strict
{
  "compilerOptions": {
    "strict": false
  }
}

// ❌ Issue - Strict not set
{
  "compilerOptions": {
    "target": "ES2020"
  }
}

// ✅ Pass
{
  "compilerOptions": {
    "strict": true
  }
}

Severity: ❌ Issue (if strict is false or absent)


[PATTERN] No any Types

Flag unqualified : any type annotations:

// ⚠️ Warning
function process(data: any): any {
    return data.value;
}

const items: any[] = [];

// ✅ Pass - Specific types
function process(data: UserData): ProcessedData {
    return { value: data.value };
}

// ✅ Pass - Explicit unknown with narrowing
function process(data: unknown): ProcessedData {
    if (isUserData(data)) {
        return { value: data.value };
    }
    throw new Error("Invalid data");
}

Severity: ⚠️ Warning


[HEURISTIC] Async/Await Error Handling

Check that async functions handle errors:

// ⚠️ Warning - No error handling
async function fetchUser(id: string): Promise<User> {
    const response = await fetch(`/users/${id}`);
    return response.json();
}

// ✅ Pass - Has error handling
async function fetchUser(id: string): Promise<User> {
    try {
        const response = await fetch(`/users/${id}`);
        if (!response.ok) {
            throw new Error(`HTTP ${response.status}`);
        }
        return response.json();
    } catch (error) {
        logger.error("Failed to fetch user", { id, error });
        throw new UserFetchError(id, error);
    }
}

Severity: ⚠️ Warning


[HEURISTIC] Promise Handling

Check for common Promise anti-patterns:

Anti-patternIssue
Missing .catch()Unhandled rejection
new Promise() with async executorAnti-pattern
Fire-and-forget promisesNo await, no han
阅读完整来源 ↗