Communitygithub.com

codehealth-mcp

CodeScene MCP를 통한 실시간 구조적 코드 건강도 — 편집 전 검토, 변경 후 점수 델타 확인, 커밋 및 PR 게이팅에 사용합니다. 코드 품질 검토, 리팩토링, AI 변경으로 인한 파일 저하 확인, 커밋/PR 전에 활용하세요.

codehealth-mcp란 무엇인가요?

이 스킬은 AI 기반 코딩 중에 구조적 유지보수성을 실시간으로 평가할 수 있는 CodeScene MCP 서버를 통합합니다. 개발자가 파일을 수정하기 전에 `code_health_review`를 실행하여 기준 점수와 코드 스멜을 파악하고, 변경 후 `code_health_score`로 점수 변화를 추적합니다. `pre_commit_code_health_safeguard`는 커밋 시 코드 건강도 회귀를 차단하며, `analyze_change_set`은 PR 생성 전 브랜치 수준 점검을 제공합니다. 점수는 1~10점으로 해석되며, 9.0 이상은 안전, 4.0~8.9는 주의, 3.9 이하는 심각한 부채로 간주됩니다. 스타일/린트 스킬과 달리 설계 수준의 건강도를 평가하므로, `coding-standards`, `verification-loop`, `tdd-workflow` 등과 함께 사용하여 종합적인 품질 관문을 구성할 수 있습니다. Claude Code, Cursor 등 MCP를 지원하는 모든 플랫폼에서 사용 가능하며, 독립 실행 모드를 위해 무료 토큰이 제공됩니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/codehealth-mcp

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Code Health MCP (CodeScene)

AI 기반 코딩을 위한 구조적 유지보수성 피드백입니다. 스타일/린트 스킬(coding-standards, plankton-code-quality)을 설계 수준의 건강 점수 및 회귀 게이트로 보완합니다.

상위 저장소: codescene-oss/codescene-mcp-server 패키지: @codescene/codehealth-mcp (stdio via npx)

보안 및 경계

옵트인 (ECC): mcp-configs/mcp-servers.json의 codescene 블록은 템플릿일 뿐입니다. ECC 플러그인 설치는 번들된 MCP 서버를 자동 활성화하지 않습니다. 원하는 경우에만 해당 항목을 설정에 복사하세요. ECC_DISABLED_MCPS=codescene,...을 사용하여 ECC 설치/동기화 중에 제외할 수 있습니다.

자격 증명: 번들된 토큰은 없습니다. CS_ACCESS_TOKEN을 직접 설정하세요 (상위 저장소의 getting-a-personal-access-token.md 참조). 토큰을 저장소에 커밋하지 마세요.

도구가 읽는 항목: 호출 시 도구는 사용자가 지정한 로컬 저장소의 파일과 git 상태를 분석합니다 (전달한 경로 및 analyze_change_set의 브랜치 컨텍스트). 자체적으로 실행되지는 않습니다. 독립 실행 모드의 경우 상위 저장소의 개인정보 보호 문서(codescene-mcp-server README 및 CodeScene 정책)를 따르세요. 이 스킬을 비밀, 자격 증명 또는 분석을 원하지 않는 경로에 사용하지 마세요.

MCP를 사용할 수 없는 경우 (오프라인, 잘못된 토큰, 서버 충돌): Code Health 점수를 임의로 생성하지 마세요. 사용자에게 검사가 생략되었음을 알리세요. 명시적인 사용자 승인 없이 계속 진행하지 마세요. MCP가 다운된 경우 게이팅에는 린트/테스트/검증 루프를 우선 사용하세요. 서버가 연결되면 검사를 다시 활성화하세요.

사용 시기

  • 사용자가 코드 품질 검토, 파일 리팩토링 또는 AI 변경으로 유지보수성 저하 여부 확인을 요청할 때
  • 핫스팟, 레거시 모듈 또는 익숙하지 않은 파일을 편집하기 전
  • 유지보수성 보호 장치가 필요한 커밋 또는 풀 리퀘스트 전
  • 대규모 에이전트 작성 diff 후 Code Health 회귀 여부 확인
  • 구조적 검사(테스트/린트 대체 아님)로 verification-loop, tdd-workflow 또는 /quality-gate와 함께 사용

활성화 시기

위의 사용 시기와 동일한 트리거입니다. 이 제목은 ECC가 스킬 자동 활성화에 사용합니다.

작동 방식

1. MCP 서버 연결

mcp-configs/mcp-servers.json에서 codescene 항목을 사용 중인 MCP 설정에 복사하세요.

Claude Code (~/.claude.json → mcpServers):

"codescene": {
  "command": "npx",
  "args": ["-y", "@codescene/codehealth-mcp"],
  "env": {
    "CS_ACCESS_TOKEN": "YOUR_CS_ACCESS_TOKEN_HERE"
  }
}

프로젝트 범위: 동일한 블록을 저장소 루트의 .mcp.json에 병합하세요.

토큰 설정은 상위 저장소(위 링크)에 문서화되어 있습니다. 독립 실행 모드는 아래 나열된 네 가지 도구에 대해 유료 CodeScene 플랫폼 계정이 필요하지 않습니다. 세션을 다시 시작하고 점수에 의존하기 전에 codescene 서버가 연결되었는지 확인하세요.

2. 독립 실행 도구만 호출

도구사용 시기
code_health_review파일을 수정하기 전 전체 구조 분석
code_health_score각 변경 후 빠른 숫자 점수 (델타 확인)
pre_commit_code_health_safeguardCode Health 회귀를 유발하는 커밋 차단
analyze_change_setPR을 열기 전 브랜치 수준 검사

플랫폼 전용 도구(예: 저장소 전체 기술 부채 핫스팟 목록)를 호출하지 마세요. delta_analysis를 참조하지 마세요. 독립 실행 모드에서 사용할 수 없습니다.

3. 점수 해석 (1–10)

범위의미에이전트 동작
9.0–10.0녹색 — 건강함확장해도 안전하지만 여전히 수직 슬라이스 선호
4.0–8.9노란색 — 부채 있음신중하게 접근; 우회 리팩토링 금지
1.0–3.9빨간색 — 심각한 부채범위를 좁게만 유지

4. 피드백 루프 실행

파일을 건드리기 전

  1. 대상 경로에서 code_health_review를 실행합니다.
  2. 기준 점수와 나열된 코드 스멜을 기록합니다.
  3. 작업을 처리하는 가장 작은 변경을 계획합니다.

점수별 범위: 5 미만 — 최소 diff만; 5–7 — 광범위한 리팩토링 금지; 7 초과 — 리팩토링해도 더 안전하지만 각 편집 후 여전히 확인 필요.

각 변경 후

  1. 동일한 파일에서 code_health_score를 실행합니다.
  2. code_health_review의 기준과 비교합니다.
  3. 점수가 회귀되었다면 계속 진행하기 전에 수정하세요. 시작했을 때보다 점수가 낮은 상태에서 작업을 완료로 표시하지 마세요.

모든 커밋 전 — 저장소 경로에서 pre_commit_code_health_safeguard를 실행합니다.

PR 전 — 기본 브랜치(예: main)를 대상으로 analyze_change_set을 실행합니다.

예제

예제: Flask 유지보수성 개선

pallets/flask에서 독립 실행 도구만 사용하는 에이전트 루프:

  1. 대상 모듈에서 code_health_review 실행 (기준 4.82)
  2. 나열된 스멜을 해결하는 목표 지향 리팩토링
  3. 각 편집 후 code_health_score 실행
  4. 커밋 전 pre_commit_code_health_safeguard 실행
  5. PR 전 analyze_change_set 실행

결과: Code Health 4.82 → 9.1 (무료 독립 실행 토큰만 사용).

예제: AGENTS.md 적용 블록

프로젝트 AGENTS.md 또는 CLAUDE.md에 붙여넣기:

## Code Health (CodeScene MCP)

파일을 수정하기 전: `code_health_review`를 실행하고 점수와 문제점을 기록합니다.

- 점수가 5 미만: 문제 영역 — 변경 범위를 좁게 유지합니다.
- 점수가 5–7: 경고 영역 — 광범위한 리팩토링을 하지 마세요.

각 변경 후: `code_health_score`를 실행하여 델타를 확인합니다.

- 점수가 회귀된 경우: 계속 진행하기 전에 수정하세요. 점수가 떨어졌으면 완료로 선언하지 마세요.

모든 커밋 전: `pre_commit_code_health_safeguard`를 실행합니다.

PR 전: `analyze_change_set`을 실행합니다.

예제: 안티패턴 vs 올바른 루프

# 잘못된 예: 먼저 편집하고 나중에 확인
[code_health_review 없이 대규모 리팩토링]

# 잘못된 예: 점수 하락 무시
"테스트 통과" → Code Health가 감소했지만 작업 완료 처리

# 잘못된 예: 빨간 점수 파일(5 미만)에서 광범위 리팩토링
모듈 전체를 우회하여 정리

# 올바른 예: 검토 → 작은 변경 → 점수 → 커밋 보호 → analyze_change_set

ECC와의 페어링

ECC 스킬 / 흐름Code Health MCP 역할
coding-standards스타일/명명; Code Health = 구조/복잡도
plankton-code-quality작성 시 린트/포맷; Code Health = 편집 전후 구조적 게이트
verification-loop / /quality-gate"완료" 전 구조적 회귀 검사 추가
security-review보안 vs 유지보수성 — 관련 있을 때 둘 다 사용
tdd-workflow테스트 통과 ≠ 건강한 설계 — 리팩토링 후 점수 확인

컨텍스트 팁: ECC는 MCP 수를 낮게 유지할 것을 권장합니다. 실질적인 편집을 할 때 codescene을 활성화하고 필요하지 않을 때는 비활성화하세요.

관련 스킬

  • coding-standards — 기본 규칙
  • plankton-code-quality — 작성 시 린트/포맷 훅
  • verification-loop — 빌드/테스트/린트 게이트
  • tdd-workflow — 테스트 우선 개발
  • security-review — 보안 체크리스트
  • documentation-lookup — Context7을 통한 라이브러리 문서 (직교)

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

관련 스킬