fuck-u-code-analysis
यह क्या करती है
यह स्किल एक कोड गुणवत्ता विश्लेषण टूल चलाती है और नतीजे सरल भाषा में समझाती है। यह उन डेवलपर्स के लिए है जो कमिट या पुल रिक्वेस्ट से पहले उलझे कोड और तकनीकी कर्ज़ को खोजना चाहते हैं।
कब इस्तेमाल करें
- ✓जब कोड बदलाव पूरे हो जाते हैं और आप कमिट से पहले गुणवत्ता जाँच चाहते हैं।
- ✓जब आप किसी प्रोजेक्ट में तकनीकी कर्ज़ या पढ़ने में कठिन कोड खोजना चाहते हैं।
- ✓जब आप पुल रिक्वेस्ट खोलने से पहले कोड गुणवत्ता की समीक्षा माँगते हैं।
Skill का लिंक
https://github.com/Done-0/fuck-u-code/blob/main/skills/fuck-u-code-analysis/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे प्रोजेक्ट के कोड की गुणवत्ता जाँचिए और बताइए कि पहले कौन-सी फ़ाइलें साफ़ करनी चाहिए।”
हर हफ़्ते 5 नई skills, 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
अक्सर पूछे जाने वाले सवाल
यह कौन-सी प्रोग्रामिंग भाषाएँ सपोर्ट करती है?
स्किल कहती है कि यह 14 भाषाएँ कवर करती है, जिनमें Go और JavaScript शामिल हैं।
इस्तेमाल से पहले मुझे क्या चाहिए?
विश्लेषण टूल एक बार इंस्टॉल करना होता है, और उसे 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
- अपडेट की गई
- 7/9/2026
कमेंट
- …
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।