Coding Standards

io.github.corbat-tech由 GitHub 帳號 corbat-tech 發布v1.0.3更新於 Nov 10, 2026

AI coding standards that enforce production-grade code with DDD, SOLID, TDD guardrails.

發布方自己的服務:Standards

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

為 AI 編碼助理提供團隊編碼規範、技術棧設定檔與驗證檢查,在程式碼產生前後把關。

可以做什麼
Corbat 是針對 AI 編碼助理的本地策略與品質引擎。它會讀取 pom.xml、package.json、go.mod、Cargo.toml 等檔案辨識專案技術棧,再回傳相符的規範設定檔,涵蓋架構、程式碼品質、錯誤處理與安全相關規則。它也提供驗證回饋,讓助理在交付前依審查標準檢查實作。它不會修改 AI 的輸出,只提供脈絡、規範與檢查。
適用情境
適合啟動新專案、多個助理共用同一套策略脈絡、團隊經驗落差較大,或程式碼必須符合嚴格審查與受監管產業要求的情境。對一次性腳本、快速原型與學習專案幫助不大。
執行需求
透過 npx 以 stdio 本地行程方式執行 npm 套件 @corbat-tech/coding-standards-mcp,因此需要 Node.js 與 npx。未宣告驗證、環境變數或標頭。選用的專案設定放在專案根目錄的 .corbat.json 檔案中。
安裝前請注意
README 指出實際程式碼品質取決於模型、宿主工具、提示詞、儲存庫脈絡、測試與人工審查,Corbat 是策略與驗證層,並不保證可投入正式環境。其基準測試結果被描述為好壞參半,不足以宣稱普遍提升品質;安全檢查來自模式比對,不能取代 SAST、DAST、相依性掃描、人工審查或威脅建模。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Coding Standards,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

CORBAT MCP

Policy and quality engine for AI coding agents

Shared standards, context, and verification gates for agent-assisted software delivery.

[npm version] [CI] [Coverage] [License: MIT] [MCP]


[Cursor] [VS Code] [Windsurf] [JetBrains] [Zed] [Claude]

Designed for MCP-compatible coding tools and multi-agent workflows. See compatibility notes.

⚡ Try it in 30 seconds — just add the config below and start coding.


The Problem

AI-generated code often works locally but misses team-specific review expectations:

Without CorbatWith Corbat
Methods with 50+ linesMax 20 lines per method
No dependency injectionProper DI with interfaces
throw new Error('failed')Custom exceptions with context
Missing or minimal testsTests included, TDD approach
God classes, mixed concernsSOLID principles, clean layers
Works locallyReviewable implementation with explicit checks

Corbat helps by giving agents your team's standards before implementation and by providing validation tools before review or handoff.


Quick Start

1. Add to your MCP config:

json
{  "mcpServers": {    "corbat": {      "command": "npx",      "args": ["-y", "@corbat-tech/coding-standards-mcp"]    }  }}

2. Config file location:

ToolLocation
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Windsurf~/.codeium/windsurf/mcp_config.json
JetBrainsSettings → AI Assistant → MCP
Claude Desktop~/.config/Claude/claude_desktop_config.json
Claude Codeclaude mcp add corbat -- npx -y @corbat-tech/coding-standards-mcp

Complete setup guide for common MCP-compatible tools

3. Done. Corbat can auto-detect your stack and return matching standards.

Zero overhead. Corbat runs locally and adds ~50ms to detect your stack. After that, it's just context for the AI.

Fully customizable. Don't like a rule? Override it in .corbat.json. Jump to customization →


See It In Action

You: "Create a user registration service"

Without Corbat, you get:

typescript
class UserService {  private users: Map<string, User> = new Map();
  register(name: string, email: string, password: string) {    if (!name || !email || !password) throw new Error('Invalid input');    const user = { id: crypto.randomUUID(), name, email, password };    this.users.set(user.id, user);    return user;  }}// ✗ Hardcoded storage  ✗ Password in plain text  ✗ Generic error  ✗ No tests

With Corbat, you get:

typescript
// Domaininterface UserRepository {  save(user: User): Promise<void>;  findByEmail(email: string): Promise<User | null>;}
class EmailAlreadyExistsError extends Error {  constructor(email: string) {    super(`Email already registered: ${email}`);  }}
// Applicationclass RegisterUserUseCase {  constructor(    private readonly repository: UserRepository,    private readonly hasher: PasswordHasher  ) {}
  async execute(input: RegisterUserInput): Promise<User> {    const existing = await this.repository.findByEmail(input.email);    if (existing) throw new EmailAlreadyExistsError(input.email);
    const user = User.create({      ...input,      password: await this.hasher.hash(input.password)    });    await this.repository.save(user);    return user;  }}// ✓ Repository interface  ✓ Password hashing  ✓ Custom error  ✓ Testable
typescript
// Test includeddescribe('RegisterUserUseCase', () => {  const repository = { save: vi.fn(), findByEmail: vi.fn() };  const hasher = { hash: vi.fn() };  const useCase = new RegisterUserUseCase(repository, hasher);
  beforeEach(() => vi.clearAllMocks());
  it('should hash password before saving', async () => {    repository.findByEmail.mockResolvedValue(null);    hasher.hash.mockResolvedValue('hashed_password');
    await useCase.execute({ name: 'John', email: '[email protected]', password: 'secret' });
    expect(hasher.hash).toHaveBeenCalledWith('secret');    expect(repository.save).toHaveBeenCalledWith(      expect.objectContaining({ password: 'hashed_password' })    );  });
  it('should reject duplicate emails', async () => {    repository.findByEmail.mockResolvedValue({ id: '1', email: '[email protected]' });
    await expect(      useCase.execute({ name: 'John', email: '[email protected]', password: 'secret' })    ).rejects.toThrow(EmailAlreadyExistsError);  });});

This is the kind of structure Corbat asks agents to consider before handoff.


What Corbat Provides

Corbat provides these guardrails before generation and validation checks during iteration:

Code Quality

RuleWhy It Matters
Max 20 lines per methodReadable, testable, single-purpose functions
Max 200 lines per classSingle Responsibility Principle
Meaningful namesNo data, info, temp, x
No magic numbersConstants with descriptive names

Architecture

RuleWhy It Matters
Interfaces for dependenciesTestable code, easy mocking
Layer separationDomain logic isolated from infrastructure
Hexagonal/Clean patternsFramework-agnostic business rules

Error Handling

RuleWhy It Matters
Custom exceptionsUserNotFoundError vs Error('not found')
Error contextInclude IDs, values, state in errors
No empty catchesEvery error handled or propagated

Security-Oriented Checks

RuleWhy It Matters
Input validationReject bad data at boundaries
No hardcoded secretsEnvironment variables only
Parameterized queriesPrevent SQL injection
Output encodingPrevent XSS

Benchmark Results v3.0

We evaluated Corbat across 15 scenarios in 6 languages. The primary benchmark report is mixed and should be read honestly: Corbat won 1/15 scenarios by the original aggregate score, while an alternative value analysis found stronger results for code compactness and maintainability.

What The Data Supports

The strongest observed signal is that Corbat-guided outputs are often smaller and more focused:

ScenarioWith CorbatWithout CorbatWhat This Means
Kotlin Coroutines236 lines1,923 linesSame functionality, 8x less to maintain
Java Hexagonal623 lines2,740 linesClean architecture without the bloat
Go Clean Arch459 lines2,012 linesIdiomatic Go, not Java-in-Go
TypeScript NestJS395 lines1,554 linesRight patterns, right size

This is not enough to claim universal quality improvement. It is evidence that standards context can reduce over-generation in some workflows.

Value Metrics

The value report reweights the same dataset toward efficiency and maintainability:

MetricResultWhat It Means
Code Reduction67%Less to maintain, review, and debug
Security checks100%No issues detected by benchmark pattern checks
Maintainability93% winEasier to understand and modify
Architecture Efficiency87% winBetter patterns per line of code
Cognitive Load-59%Faster onboarding for new developers

📊 Detailed value analysis

Security: No Benchmark Pattern Findings

Every scenario was analyzed using pattern checks inspired by OWASP Top 10 categories. This is not a replacement for SAST, DAST, dependency scanning, manual review, or threat modeling.

  • No SQL/NoSQL injection patterns detected
  • No XSS patterns detected
  • No hardcoded credentials detected
  • Input validation patterns present at boundaries
  • Error messages did not expose stack traces in the benchmark samples

Languages & Patterns Tested

LanguageScenariosPatterns
☕ Java5Spring Boot, DDD Aggregates, Hexagonal, Kafka Events, Saga
📘 TypeScript4Express REST, NestJS Clean, React Components, Next.js Full-Stack
🐍 Python2FastAPI CRUD, Repository Pattern
🐹 Go2HTTP Handlers, Clean Architecture
🦀 Rust1Axum with Repository Trait
🟣 Kotlin1Coroutines + Strategy Pattern

📖 Full benchmark methodology · Value analysis


Built-in Profiles

Corbat auto-detects your stack and applies the right standards:

ProfileStackWhat You Get
java-spring-backendJava 21 + Spring Boot 3Hexagonal + DDD, TDD with 80%+ coverage
kotlin-springKotlin + Spring Boot 3Coroutines, Kotest + MockK
nodejsNode.js + TypeScriptClean Architecture, Vitest
nextjsNext.js 14+App Router patterns, Server Components
reactReact 18+Hooks, Testing Library, accessible components
vueVue 3.5+Composition API, Vitest
angularAngular 19+Standalone components, Jest
pythonPython + FastAPIAsync patterns, pytest
goGo 1.22+Idiomatic Go, table-driven tests
rustRust + AxumOwnership patterns, proptest
csharp-dotnetC# 12 + ASP.NET Core 8Clean + CQRS, xUnit
flutterDart 3 + FlutterBLoC/Riverpod, widget tests

Auto-detection: Corbat reads pom.xml, package.json, go.mod, Cargo.toml, etc.


When to Use Corbat

Use CaseWhy Corbat Helps
Starting a new projectCorrect architecture from day one
Multi-agent deliveryPlanner, implementation, review, and security agents share the same policy context
Teams with mixed experienceStandards become explicit and repeatable
Strict code review standardsAgents can validate against the review bar before handoff
Regulated industriesConsistent security and documentation
Legacy modernizationNew code follows modern patterns

When Corbat Might Not Be Needed

  • Quick prototypes where quality doesn't matter
  • One-off scripts you'll throw away
  • Learning projects where you want to make mistakes

Customize

Option 1: Interactive Setup

bash
npx corbat-init

Detects your stack and generates a .corbat.json with sensible defaults.

Option 2: Manual Configuration

Create .corbat.json in your project root:

json
{  "profile": "java-spring-backend",  "architecture": {    "pattern": "hexagonal",    "layers": ["domain", "application", "infrastructure", "api"]  },  "quality": {    "maxMethodLines": 20,    "maxClassLines": 200,    "minCoverage": 80  },  "rules": {    "always": [      "Use records for DTOs",      "Prefer Optional over null"    ],    "never": [      "Use field injection",      "Catch generic Exception"    ]  }}

Option 3: Use a Template

Browse 14 ready-to-use templates for Java, Python, Node.js, React, Go, Rust, and more.


How It Works

┌─────────────┐     ┌─────────────┐     ┌─────────────┐│ Your Prompt │────▶│ Corbat MCP  │────▶│ AI + Rules  │└─────────────┘     └──────┬──────┘     └─────────────┘                          │           ┌──────────────┼──────────────┐           ▼              ▼              ▼    ┌────────────┐ ┌────────────┐ ┌────────────┐    │ 1. Detect  │ │ 2. Load    │ │ 3. Inject  │    │   Stack    │ │  Profile   │ │ Guardrails │    └────────────┘ └────────────┘ └────────────┘     pom.xml        hexagonal      max 20 lines     package.json   + DDD          + interfaces     go.mod         + SOLID        + custom errors

Corbat does not modify AI output. It supplies context, standards, profiles, and validation feedback so agents can align with your review expectations.

Important: Actual code quality depends on the model, host tool, prompt, repository context, tests, and human review. Treat Corbat as a policy and verification layer, not as a guarantee of production readiness.


Documentation

ResourceDescription
Setup GuideInstallation notes for common MCP-compatible tools
TemplatesReady-to-use .corbat.json configurations
CompatibilityFull list of supported AI tools
Benchmark AnalysisDetailed results from 15 scenarios
Multi-Agent ArchitectureHow Corbat fits planner/reviewer/security/release agent workflows
Security ModelLocal execution model, threat model, and reporting
API ReferenceTools, prompts, and configuration options

Make agent output easier to review.

Add to your MCP config and you're done:

json
{ "mcpServers": { "corbat": { "command": "npx", "args": ["-y", "@corbat-tech/coding-standards-mcp"] }}}

Use Corbat as shared standards context plus a local quality gate.


Developed by corbat-tech

來源:README.md,提交 6c6b365

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Standards 整合