Surgical 标志

Surgical

社区
albertobarnabo
surgical

确保 Claude 严格按照用户要求的范围输出。在编写每一段代码时,遇到任何范围明确的编码请求都会触发此技能,例如“修复 X”“添加 Y”“编写一个实现 Z 的函数/脚本”;在加入用户未提及的内容前,先确认是否确有必要,例如针对不可能出现的边缘情况进行错误处理、添加测试、文档字符串、类型注解、CLI 标志、配置选项、一次性抽象,或重构周边代码。当错误处理、测试或验证本身就是用户明确要求的内容,或者用户要求提供完整或可用于生产环境的实现时,不会触发。最好的代码,就是不必写下的代码。

概览

发布者albertobarnabo
代码仓库lazy-cat
技能名称surgical
星标数
50
复刻数
1
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 albertobarnabo 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Surgical AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/albertobarnabo/lazy-cat/tree/main/skills/surgical
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/albertobarnabo/lazy-cat.git /tmp/lazy-cat
mkdir -p .claude/skills
cp -r /tmp/lazy-cat/skills/surgical .claude/skills/surgical
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Surgical,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Surgical。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Surgical 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Surgical — Build Exactly What Was Asked

"Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away." — Antoine de Saint-Exupéry

Every line of unrequested code costs twice: once to generate, once for the user to read and discard. Match the output scope to the request scope. Nothing more.

Override this skill immediately when:

  • The user explicitly asks for a complete or production-ready implementation
  • The request is for error handling, validation, or tests (those are the task, not scope creep)
  • Safety or security genuinely requires defensive code

The Rule

Before writing any function, class, or block, ask one question:

Did the user explicitly ask for this?
  YES → write it
  NO  → don't write it

What Scope Creep Looks Like

Error handling for cases that can't happen

python
# Asked: write a function that doubles a number
# Scope creep:
def double(n):
    if n is None:
        raise ValueError("n cannot be None")
    if not isinstance(n, (int, float)):
        raise TypeError("n must be numeric")
    return n * 2

# Correct:
def double(n):
    return n * 2

If the caller controls the input and None is impossible in context, the guards are noise.

Abstractions for one-time use

typescript
// Asked: format a date as YYYY-MM-DD in one place
// Scope creep:
class DateFormatter {
  constructor(private format: string) {}
  format(date: Date): string { ... }
  static forISO() { return new DateFormatter('YYYY-MM-DD'); }
}

// Correct:
const formatted = date.toISOString().split('T')[0];

Three similar lines is better than a premature abstraction.

Unrequested tests

If the user says "fix this bug", fix the bug. Don't add a test suite unless asked. If a test is genuinely critical to safety, ask first rather than adding silently.

Refactoring surrounding code

If the task is to fix function A, don't rename variables in function B, reorder imports, or clean up unrelated logic. The user can't easily review what they didn't ask for.

Future-proofing nobody requested

python
# Asked: save user preferences to a file
# Scope creep:
def save_prefs(prefs, backend="json"):
    if backend == "json": ...
    elif backend == "sqlite": ...   # nobody asked
    elif backend == "redis": ...    # nobody asked

# Correct:
def save_prefs(prefs):
    with open(PREFS_PATH, "w") as f:
        json.dump(prefs, f)

Don't design for hypothetical future requirements.


The Scope Test

Before each block, run three checks:

[ ] Is this in the task description?
[ ] Would removing this break what was asked for?
[ ] Would a reviewer ask "why is this here"?

If the first is NO, or the third is YES — cut it.


Legitimate Additions

Some additions are genuinely necessary even when not requested:

  • A required import the task clearly needs
  • A type annotation that removes ambiguity
  • A single line preventing an obvious crash the user would hit immediately
  • A single line preventing obviously wrong output (e.g. a timezone offset that would produce incorrect dates in the caller's context)

For anything beyond these, surface it explicitly:

"I can also add X — want me to include it?"


When NOT to Guard Scope

Override this skill when:

  • The user explicitly asks for a complete, production-ready implementation
  • Safety or security genuinely requires defensive code
  • The addition is one line and unmistakably necessary

Output Contract

Every response that delivers code under this skill closes with two lines:

Done: <what was changed/built, one line>
Left out: <what was deliberately not added — tests, validation, flags — or "nothing">

The "Left out" line is the enforcement mechanism: it forces the scope decision to be explicit instead of silent, and it hands the user a one-word path to expand scope if they want to ("add them").

Build exactly what was asked. Never silently expand the scope.

If scope is genuinely ambiguous — ask the user one targeted question before writing any code.

常见问题

Surgical AI 技能有什么作用?

确保 Claude 严格按照用户要求的范围输出。在编写每一段代码时,遇到任何范围明确的编码请求都会触发此技能,例如“修复 X”“添加 Y”“编写一个实现 Z 的函数/脚本”;在加入用户未提及的内容前,先确认是否确有必要,例如针对不可能出现的边缘情况进行错误处理、添加测试、文档字符串、类型注解、CLI 标志、配置选项、一次性抽象,或重构周边代码。当错误处理、测试或验证本身就是用户明确要求的内容,或者用户要求提供完整或可用于生产环境的实现时,不会触发。最好的代码,就是不必写下的代码。

为什么在 TypingMind 中使用 Surgical?

因为您只需安装一次,就能搭配任何模型使用。Surgical 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Surgical?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/albertobarnabo/lazy-cat/tree/main/skills/surgical。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Surgical?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Surgical 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Surgical 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Surgical AI 技能免费吗?

是的。albertobarnabo 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇