fuck-u-code-analysis
하는 일
이 스킬은 코드 품질 분석 도구를 실행하고 결과를 쉬운 말로 설명합니다. 커밋하거나 풀 리퀘스트를 열기 전에 지저분한 코드와 기술 부채를 찾고 싶은 개발자를 위한 스킬입니다.
사용하는 경우
- ✓코드 변경을 마쳤고 커밋 전에 품질 점검을 원할 때.
- ✓프로젝트에서 기술 부채나 읽기 어려운 코드를 찾고 싶을 때.
- ✓풀 리퀘스트를 열기 전에 코드 품질 검토를 요청할 때.
스킬 링크
https://github.com/Done-0/fuck-u-code/blob/main/skills/fuck-u-code-analysis/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 프로젝트의 코드 품질을 확인하고, 먼저 정리해야 할 파일이 무엇인지 알려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 여러 영역에 걸쳐 점수를 매기는 분석 도구를 실행합니다. 그다음 점수가 가장 낮은 파일을 읽고, 정해진 기준에 따라 구체적인 개선 방법을 제안합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
fuck-u-code Code Quality Analysis & Review
Prerequisites
Install fuck-u-code globally before using this skill:
npm install -g eff-u-code
Verify installation:
fuck-u-code --version
Requires Node.js >= 18.0.0.
Overview
Run fuck-u-code analyze to obtain quantitative code quality metrics across 7 dimensions (11 metrics), then interpret results and provide actionable refactoring recommendations based on the standards defined in this skill.
The tool produces a 0-100 overall score and per-file scores. Higher = better quality. The skill teaches you how to interpret every metric, judge severity, and prescribe specific fixes.
Workflow
digraph workflow {
rankdir=LR;
node [shape=box];
"Run fuck-u-code analyze" -> "Read JSON output";
"Read JSON output" -> "Identify critical files (score < 60)";
"Identify critical files" -> "Drill into per-metric details";
"Drill into per-metric details" -> "Apply review standards (Section 4)";
"Apply review standards" -> "Write actionable remediation report";
}
Step 1: Run Analysis
# Basic analysis
fuck-u-code analyze . -f json -o /tmp/fuc-report.json
# Verbose with top 20 worst files
fuck-u-code analyze . -v -t 20 -f json -o /tmp/fuc-report.json
# Exclude generated/test files
fuck-u-code analyze . -e "**/*.test.ts" -e "**/generated/**" -f json -o /tmp/fuc-report.json
Read the JSON output file to get structured data.
Step 2: Identify Problem Areas
From the JSON report, extract:
- overallScore: Project-wide score (0-100). Weighted average by code line count.
- aggregatedMetrics: Per-metric averages, medians, min/max across all files.
- files[]: Per-file results, sorted by score ascending (worst first).
Focus on files with score < 60 (the "shit mountain" zone).
Step 3: Drill into Metrics
For each problem file, examine the metrics[] array. Each metric has:
| Field | Meaning |
|---|---|
name |
Metric identifier (see Section 3) |
category |
Dimension group (complexity/size/duplication/structure/error/documentation/naming) |
normalizedScore |
0-100, higher = better |
severity |
info / warning / error / critical |
details |
Human-readable summary |
locations[] |
Specific line/function-level issue locations |
Prioritize metrics with severity >= error.
Step 4: Write Remediation Report
Follow the output format in Section 5.
Scoring System
The overall score is a weighted average across 7 categories. The default weights are calibrated to industry research (SonarQube, NASA, Microsoft studies on defect correlation):
| Category | Weight | Rationale |
|---|---|---|
| Complexity | 32% | Strongest correlation with defects (0.7-0.8 Pearson) |
| Duplication | 20% | Direct maintenance cost multiplier |
| Size | 18% | Code volume and function granularity |
| Structure | 12% | File organization and coupling |
| Error Handling | 8% | Robustness and reliability |
| Documentation | 5% | Long-term maintainability |
| Naming | 5% | Readability and convention compliance |
Metrics Reference (11 Metrics)
Each metric uses a 4-tier threshold system: excellent / good / acceptable / poor. Thresholds are language-specific. See references/thresholds.md for the full per-language table.
3.1 Complexity Metrics (weight: 32% total, split 3 ways)
cyclomatic_complexity (CC)
Formula: CC = 1 + decision points (if/for/while/case/catch/&&/||/ternary)
Measures the number of independent execution paths through code. High CC means more test cases needed and higher defect probability.
Generic thresholds (most languages):
| Level | CC Range | Score |
|---|---|---|
| Excellent | ≤ 5 | 100 |
| Good | 6-10 | 80-100 |
| Acceptable | 11-15 | 50-80 |
| Poor | > 15 | 0-50 |
Common patterns & fixes:
- Long if-else chains → Replace with strategy pattern, lookup table, or polymorphism
- Nested conditionals → Extract guard clauses, flatten with early returns
- God functions (CC > 20) → Decompose into single-responsibility functions
cognitive_complexity
Formula: CC + nestingDepth × 2 (approximation)
Measures how difficult code is to understand. Unlike cyclomatic, it penalizes nesting exponentially.
Generic thresholds:
| Level | Range | Score |
|---|---|---|
| Excellent | ≤ 7 | 100 |
| Good | 8-15 | 80-100 |
| Acceptable | 16-25 | 45-80 |
| Poor | > 25 | 0-45 |
**Common patterns
자주 묻는 질문
어떤 프로그래밍 언어를 지원하나요?
Go와 JavaScript를 포함해 14개 언어를 지원한다고 스킬이 설명합니다.
사용하기 전에 무엇이 필요한가요?
분석 도구를 한 번 설치해야 하며, Node.js 18 이상이 필요합니다.
점수는 무엇을 뜻하나요?
도구는 0에서 100 사이의 전체 점수를 주며, 점수가 높을수록 코드 품질이 좋다는 뜻입니다.
상세 정보
작성자의 원본 설명
Use when code changes are complete and ready for quality review, before committing or creating PRs. Triggers after implementing features, fixing bugs, or refactoring code. Also use when user asks to check code quality, analyze technical debt, review code smell, or mentions "fuck-u-code", "code quality", "shit mountain", "code review", "static analysis". Covers all 14 supported languages (Go, JS, TS, Python, Java, C, C++, Rust, C#, Lua, PHP, Ruby, Swift, Shell).
repo: Done-0/fuck-u-code
인기도
- GitHub 스타
- 7.3k
- 순위
- #13307
- 라이선스
- MIT
- 업데이트
- 2026. 9. 7.
댓글
- …
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.