用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Objective-Arts/lens-dist --skill data-first命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | data-first |
| description | Kernel style and good taste |
| allowed-tools | [] |
Linus Torvalds' core belief: Good taste is recognizing the difference between ugly code that works and beautiful code that works. Both function. One is maintainable.
"Talk is cheap. Show me the code."
Don't explain what you're going to do. Do it. Let the code speak. If your code needs extensive explanation, it's probably wrong.
From Linus's TED talk, the canonical example of taste:
No taste (works, but ugly):
void remove_list_entry(list *entry) {
list *prev = NULL;
list *walk = head;
while (walk != entry) {
prev = walk;
walk = walk->next;
}
// Special case for head
if (!prev)
head = entry->next;
else
prev->next = entry->next;
}
Good taste (works, and beautiful):
void remove_list_entry(list *entry) {
list **indirect = &head;
while (*indirect != entry)
indirect = &(*indirect)->next;
*indirect = entry->next;
}
The second version has no special cases. No if statement. The edge case (removing the head) is handled by the structure of the code, not by explicit logic.
"I don't want you to understand why it doesn't have the if statement. I want you to understand that this is how I want you to design your code."
"Bad programmers worry about the code. Good programmers worry about data structures and their relationships."
Get the data structures right. The code will follow naturally. If your code is complicated, you probably have the wrong data structures.
Not this:
// Complex algorithm to work around poor data structure
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (matrix[i][j].type == TYPE_A &&
matrix[i][j].state == STATE_ACTIVE &&
/* 10 more conditions */) {
// Finally found it
}
}
}
This:
// Right data structure makes code trivial
struct active_type_a *item = lookup_table[id];
"I don't like debuggers. Never have, probably never will."
Debuggers encourage a bad workflow: write code, run debugger, fix symptom, repeat. Instead:
printk/printf strategically to verify assumptionsIf you need a debugger to understand your code, your code is too complex.
"Abstraction is powerful. But abstraction is also evil."
Every abstraction has a cost. Layers of indirection make code harder to understand and debug. Sometimes the "ugly" direct approach is actually better.
Not this:
// Over-abstracted
interface->vtable->operations->read(interface->context,
buffer_manager_get_buffer(mgr),
size_calculator_compute(calc));
This:
// Direct
read(fd, buf, size);
"C++ is a horrible language... designed to be a way to shoot yourself in the foot."
Linus's view: C++ encourages abstraction for abstraction's sake. It hides what the machine is actually doing. For systems code, you need to see the machine.
This doesn't mean C++ is always wrong. It means: know what your code is doing at the machine level.
From Documentation/process/coding-style.rst:
8-character tabs. Not 4. Not 2. 8.
"Tabs are 8 characters. If you need more than 3 levels of indentation, you're screwed anyway and should fix your program."
Deep nesting is a code smell. If you need 4+ levels, refactor.
80 characters. Not 100. Not 120. 80.
This forces you to:
K&R style. Opening brace at end of line, closing brace on its own line:
if (condition) {
do_something();
} else {
do_other();
}
Exception: functions have opening brace on new line:
int function(int x)
{
return x + 1;
}
get_page_count()i, tmp, plpszFoo nonsense"Local variable names should be short, and to the point. If you have a random integer loop counter, it should probably be called 'i'."
Should be short and do one thing. If your function scrolls off the screen, it's too long.
"Functions should be short and sweet, and do just one thing."
Maximum: ~48 lines as a general guideline.
Comment the why, not the what:
Not this:
// Increment i
i++;
This:
// Skip the header row which contains column names, not data
i++;
Avoid them for structures. They hide what things are:
Not this:
typedef struct {
int x, y;
} Point;
This:
struct point {
int x, y;
};
Exception: Opaque types, integer types, and sparse annotations.
Linus is famous for harsh feedback. But there's a method:
Before committing code, ask:
Apply these checks:
Use a different skill when:
simplicity (Go Proverbs, Go idioms, small interfaces)optimization (functional core, cache optimization, profiling)clarity (general clarity, language-agnostic principles)distributed (NFS principles, statelessness, scale)composition (Unix philosophy, pipes, composition)correctness (formal methods, invariants)Linus is the Linux kernel skill—use it for kernel-style C, data structure design, and eliminating special cases.
"I'm a bastard. I have absolutely no languge of any kind." — Linus Torvalds
"Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." — Linus Torvalds