shitcode
1
总安装量
1
周安装量
#47959
全站排名
安装命令
npx skills add https://github.com/shiqkuangsan/oh-my-daily-skills --skill shitcode
Agent 安装分布
windsurf
1
trae
1
trae-cn
1
opencode
1
cursor
1
codex
1
Skill 文档
State-of-the-Art Shitcode Generator
Transform clean code into glorious shitcode for educational purposes, code review training, or pure entertainment.
Inspired by: state-of-the-art-shitcode
When to Use
Invoke this skill when the user says things like:
/shitcode- “Add some spice to this code”
- “Make this code worse”
- “Write some shitcode”
- “Show me what bad code looks like”
- “ç»æç代ç å ç¹æ”
- “åä¸çå±å±±ä»£ç ”
The Shitcode Principles
Apply these principles to generate authentic shitcode:
ð© Name variables like they’re already obfuscated
// Clean code
let userAge = 42;
// Shitcode
let a = 42;
ð© Mix naming styles freely
// Clean code
let windowWidth = 640;
let windowHeight = 480;
// Shitcode
let wWidth = 640;
let w_height = 480;
ð© Never write comments
// Clean code
// 700ms debounce based on UX A/B testing
const callbackDebounceRate = 700;
// Shitcode
const cdr = 700;
ð© Write comments in random languages
// Shitcode
// ÐакÑиваÑмо модалÑне вÑконеÑко пÑи Ð²Ð¸Ð½Ð¸ÐºÐ½ÐµÐ½Ð½Ñ Ð¿Ð¾Ð¼Ð¸Ð»ÐºÐ¸.
toggleModal(false);
ð© Mix formatting styles
// Shitcode
let i = ["tomato", "onion", "mushrooms"];
let d = ["ketchup", "mayonnaise"];
ð© Put everything on one line
// Clean code
document.location.search
.replace(/(^\?)/, "")
.split("&")
.reduce((params, pair) => {
pair = pair.split("=");
params[pair[0]] = pair[1];
return params;
}, {});
// Shitcode
document.location.search
.replace(/(^\?)/, "")
.split("&")
.reduce(function (o, n) {
n = n.split("=");
o[n[0]] = n[1];
return o;
}, {});
ð© Fail silently
// Clean code
try {
riskyOperation();
} catch (error) {
logError(error);
}
// Shitcode
try {
riskyOperation();
} catch (error) {
// tss... ð¤«
}
ð© Use global variables extensively
// Shitcode
let x = 5;
function square() {
x = x ** 2;
}
square(); // Now x is 25... somewhere
ð© Create unused variables
// Shitcode
function sum(a, b, c) {
const timeout = 1300;
const result = a + b;
return a + b;
}
ð© Skip type checks
// Shitcode
function sum(a, b) {
return a + b;
}
const guessWhat = sum([], {}); // -> "[object Object]" ð
ð© Keep unreachable code as “Plan B”
// Shitcode
function square(num) {
if (typeof num === "undefined") {
return undefined;
} else {
return num ** 2;
}
return null; // This is my "Plan B".
}
ð© Embrace the Triangle of Doom
// Shitcode
function someFunction() {
if (condition1) {
if (condition2) {
asyncFunction(params, (result) => {
if (result) {
for (;;) {
if (condition3) {
}
}
}
});
}
}
}
ð© Mess with indentation
// Shitcode
const fruits = ["apple", "orange", "grape", "pineapple"];
const toppings = ["syrup", "cream", "jam", "chocolate"];
const desserts = [];
fruits.forEach((fruit) => {
toppings.forEach((topping) => {
desserts.push([fruit, topping]);
});
});
ð© Never lock dependencies
// Shitcode project
$ ls -la
package.json
// No package-lock.json, live dangerously!
ð© Name all booleans “flag”
// Shitcode
let flag = true;
let flag2 = false;
let flag3 = true;
ð© Write massive functions
- 10000 lines in one file? OK.
- 1000 lines in one function? OK.
- All services in one
service.js? OK.
ð© Never write tests
Tests are a waste of time. Ship it!
ð© Avoid linters
Write code however you want. Freedom!
ð© No README needed
If they can’t figure it out, they don’t deserve to use it.
ð© Comment out code instead of deleting
// Shitcode
// function oldImplementation() {
// // ... 500 lines of commented code from 2019
// }
// function olderImplementation() {
// // ... 300 more lines, not sure what this does
// }
function newImplementation() {
// TODO: refactor someday
}
Usage
When this skill is invoked, transform the user’s code by applying 3-5 of these principles. Always add a disclaimer:
â ï¸ WARNING: This is intentionally bad code for educational purposes. Do NOT use in production!
State-of-the-Art Shitcode | Making code worse since 2024 ð©