KISS原则 logo

KISS原则

Organization
microwind
KISS原则

Keep It Simple, Stupid - 保持简单,避免不必要的复杂性。简单的设计更易理解、维护和扩展。

Overview

Publishermicrowind
Repositoryai-skills
Skill nameKISS原则
Stars
93
Forks
25
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by microwind on GitHub. Read the source before you install it.

Installation

Install the KISS原则 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/microwind/ai-skills/tree/main/design-principles/kiss-principle
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/microwind/ai-skills.git /tmp/ai-skills
mkdir -p .claude/skills
cp -r /tmp/ai-skills/design-principles/kiss-principle .claude/skills/microwind-kiss
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable KISS原则 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads KISS原则 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so KISS原则 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

KISS 原则 (Keep It Simple, Stupid)

概述

KISS 原则源自美国海军1960年代的设计理念:大多数系统保持简单而非复杂时运行得最好。

核心思想:

  • 简单是设计的首要目标
  • 不要为了炫技而增加复杂性
  • 能用简单方案解决的问题,不要用复杂方案
  • 复杂性是软件最大的敌人

复杂性的代价:

  • 理解时间增加
  • bug 更多、更难定位
  • 新人上手困难
  • 维护成本成倍增长

过度工程示例

java
// ❌ 过度设计:只是判断奇偶数
public interface NumberClassifier {
    boolean classify(int number);
}

public class EvenNumberClassifier implements NumberClassifier {
    @Override
    public boolean classify(int number) { return number % 2 == 0; }
}

public class NumberClassifierFactory {
    public static NumberClassifier create(String type) {
        if ("even".equals(type)) return new EvenNumberClassifier();
        throw new IllegalArgumentException("Unknown type: " + type);
    }
}

// 使用
NumberClassifier classifier = NumberClassifierFactory.create("even");
boolean result = classifier.classify(4);

// ✅ KISS:直接写
public boolean isEven(int number) {
    return number % 2 == 0;
}
python
# ❌ 过度设计:获取列表最大值
from abc import ABC, abstractmethod

class ComparatorStrategy(ABC):
    @abstractmethod
    def compare(self, a, b): pass

class MaxComparator(ComparatorStrategy):
    def compare(self, a, b):
        return a if a > b else b

class AggregatorService:
    def __init__(self, strategy: ComparatorStrategy):
        self.strategy = strategy

    def aggregate(self, numbers):
        result = numbers[0]
        for n in numbers[1:]:
            result = self.strategy.compare(result, n)
        return result

# 使用
service = AggregatorService(MaxComparator())
result = service.aggregate([1, 5, 3, 9, 2])

# ✅ KISS
result = max([1, 5, 3, 9, 2])

代码简化示例

typescript
// ❌ 复杂的条件判断
function getDiscount(user: User): number {
    let discount = 0;
    if (user.isPremium) {
        if (user.years > 5) {
            if (user.orders > 100) {
                discount = 0.3;
            } else {
                discount = 0.2;
            }
        } else {
            discount = 0.1;
        }
    } else {
        if (user.orders > 50) {
            discount = 0.05;
        }
    }
    return discount;
}

// ✅ 简化:提前返回 + 扁平化
function getDiscount(user: User): number {
    if (!user.isPremium && user.orders > 50) return 0.05;
    if (!user.isPremium) return 0;
    if (user.years > 5 && user.orders > 100) return 0.3;
    if (user.years > 5) return 0.2;
    return 0.1;
}
java
// ❌ 不必要的抽象层
public interface StringFormatter {
    String format(String input);
}
public class UpperCaseFormatter implements StringFormatter {
    public String format(String input) { return input.toUpperCase(); }
}
public class FormatterService {
    private StringFormatter formatter;
    public String process(String input) { return formatter.format(input); }
}

// ✅ KISS
String result = input.toUpperCase();

何时简单是"太简单了"

KISS 不等于偷懒:
❌ 没有错误处理
❌ 没有输入验证(在系统边界)
❌ 把所有逻辑塞在一个方法里
❌ 用全局变量代替参数传递

KISS 是关于"恰到好处"的复杂度:
✅ 满足当前需求
✅ 代码可读
✅ 逻辑清晰
✅ 容易修改

复杂性检测

代码复杂性信号:
□ 方法超过 20 行
□ 嵌套超过 3 层
□ 参数超过 4 个
□ 一个方法中有超过 3 个 if-else
□ 类超过 200 行
□ 需要画图才能理解流程
□ 注释比代码多(说明代码不够清晰)
□ 使用了团队成员不熟悉的设计模式

优缺点分析

✅ 优点

  1. 易于理解 - 新人能快速上手
  2. 易于维护 - bug 容易定位和修复
  3. 易于测试 - 简单逻辑测试用例少
  4. 易于修改 - 需求变更时改动小

❌ 注意事项

  1. 不是偷工减料 - 简单 ≠ 简陋
  2. 不是拒绝抽象 - 必要的抽象仍然需要
  3. 不是忽视性能 - 但不要过早优化

最佳实践

1. 先让它工作,再优化

1. Make it work(让它能用)
2. Make it right(让它正确)
3. Make it fast(让它快)—— 只在必要时

2. 简化方法

技巧说明
提前返回减少嵌套层级
使用标准库不要重新发明轮子
命名清晰好名字胜过注释
单一职责每个方法做一件事
删除死代码注释掉的代码直接删

3. 问自己

□ 有没有更简单的方法实现同样的效果?
□ 新人能在 5 分钟内理解这段代码吗?
□ 如果删掉这个抽象层,会有什么影响?
□ 这个设计模式真的解决了当前问题吗?

与其他原则的关系

原则关系
YAGNIYAGNI 是 KISS 在功能维度的体现
DRYDRY 可能与 KISS 冲突,过度 DRY 增加复杂性
SRPSRP 帮助保持类和方法的简单性

总结

KISS 核心:最好的代码是最简单的能满足需求的代码。

实践要点:

  • 选择最简单的可行方案
  • 避免过度设计和不必要的抽象
  • 代码应该一目了然,而非需要解释
  • 复杂性是逐渐积累的,持续简化

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the KISS原则 AI skill do?

Keep It Simple, Stupid - 保持简单,避免不必要的复杂性。简单的设计更易理解、维护和扩展。

Why use KISS原则 on TypingMind?

Because you install it once and use it with any model. KISS原则 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install KISS原则 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/microwind/ai-skills/tree/main/design-principles/kiss-principle. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use KISS原则?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with KISS原则?

As many as you like. As long as a model supports skills, you can use KISS原则 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the KISS原则 AI skill free?

Yes. It is published on GitHub by microwind under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇