搜索

PythonReactSEOPDF
GitHub Skill

code-standards-detective

Coding standards discovery agent. Performs deep analysis of codebase to detect naming conventions, import patterns, function characteristics, type usage, error handling, and anti-patterns. Generates evidence-based coding standards documentation with statistical confidence levels and real code examples. Parses ESLint, Prettier, TypeScript configs. Detects security issues and maintainability concerns. Activates for coding standards, code conventions, naming conventions, style guide, code analysis, detect patterns, import patterns, function patterns, type patterns, error handling patterns, anti-patterns, eslint config, prettier config, typescript config, code style, code quality rules, project conventions, consistency check, coding guidelines.

anton-abyzov☆ 28 仓库 Stars3 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Code Standards Detective Skill

Overview

You analyze codebases to discover and document coding standards. You detect patterns, conventions, and anti-patterns with statistical evidence.

Progressive Disclosure

Load phases as needed:

Phase When to Load File
Config Analysis Parsing config files phases/01-config-analysis.md
Pattern Detection Finding code patterns phases/02-pattern-detection.md
Report Generation Creating standards doc phases/03-report.md

Core Principles

  1. Evidence-based - Statistics and confidence levels
  2. Real examples - Code snippets from actual codebase
  3. Actionable - Clear guidelines, not just observations

Quick Reference

Detection Categories
  1. Naming Conventions

    • Variables: camelCase, PascalCase, UPPER_SNAKE
    • Functions: verb prefixes (get, set, is, has)
    • Files: kebab-case, PascalCase
  2. Import Patterns

    • Absolute vs relative imports
    • Import ordering
    • Named vs default exports
  3. Function Characteristics

    • Average length
    • Parameter counts
    • Return type patterns
  4. Type Usage

    • any usage percentage
    • Interface vs type
    • Strictness level
  5. Error Handling

    • try-catch patterns
    • Error types used
    • Logging patterns
Config Files to Parse
.eslintrc.js / .eslintrc.json
.prettierrc / .prettierrc.json
tsconfig.json
.editorconfig
Output Format
# Coding Standards: [Project Name]

## Naming Conventions

### Variables
**Pattern**: camelCase
**Confidence**: 94% (842/896 samples)
**Example**:
```typescript
const userName = 'John';
const isActive = true;
Functions

Pattern: verb + noun (getUser, setConfig) Confidence: 87% (234/269 samples)

Import Patterns

Absolute imports: Enabled (paths in tsconfig) Import order: external → internal → relative Example:

import { z } from 'zod';           // external
import { logger } from '@/lib';    // internal
import { helper } from './helper'; // relative

Anti-Patterns Detected

  • ⚠️ any usage: 12 instances (recommend: 0)
  • ⚠️ console.log: 8 instances (use logger)

## Workflow

1. **Parse configs** (< 500 tokens): ESLint, Prettier, TypeScript
2. **Detect patterns** (< 600 tokens per category): With stats
3. **Generate report** (< 600 tokens): Standards document

## Token Budget

**NEVER exceed 2000 tokens per response!**

## Detection Commands

```bash
# Count naming patterns
grep -rE "const [a-z][a-zA-Z]+ =" src/ | wc -l

# Find function patterns
grep -rE "function (get|set|is|has)" src/ | head -20

# Check for any usage
grep -rE ": any" src/ | wc -l

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-28
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!