Old Code logo

Old Code

Community
zjw-swun
old-code

古法编程模式。在 AI 辅助开发中强制执行问题建模、执行流模拟、复杂度分析与架构控制, 防止认知空心化,提升系统级正确性、性能与可维护性。适用于高并发、底层系统、逆向工程与复杂问题排查。

Overview

Publisherzjw-swun
Repositoryold-code
Skill nameold-code
Stars
557
Forks
23
Bundled files
Instructions only
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by zjw-swun on GitHub. Read the source before you install it.

Installation

Install the Old Code 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/zjw-swun/old-code/tree/master/.claude/skills/old-code
  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/zjw-swun/old-code.git /tmp/old-code
mkdir -p .claude/skills
cp -r /tmp/old-code/.claude/skills/old-code .claude/skills/old-code
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Old Code 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 Old Code 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 Old Code 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.

古法编程核心指南

声明:本指南所指的“古法编程”并非复古怀旧或拒绝进步,并非玩梗而是严肃的,是一种在 AI 泛滥时代,为了确保系统极高可靠性、性能极致优化以及开发者认知不退化而存在的深度开发模式。

  1. 核心定义 古法编程是指开发者在不跳过任何底层细节的前提下,以“白盒”视角进行的编程实践。其核心准则包括:
  • 逻辑透明:每一行进入生产环境的代码,开发者必须能解释其在内存、CPU 寄存器或运行时环境中的行为。
  • 文档先行:拒绝“生成即运行”,坚持先查阅官方一手文档,而非依赖 AI 的二手总结。
  • 手工推演:在复杂逻辑实施前,优先使用纸笔或白板进行算法推演,而非通过 AI 反复“试错”生成。
  1. 古法编程的现实价值 在 AI 助手及的今天,坚持古法编程具有不可替代的工程意义:
  • 破除“黑盒幻觉”:AI 经常生成看似完美但含有隐蔽漏洞的代码。古法能力是识别并修正“AI 幻觉”的终极防线。
  • 应对极端场景:在涉及内存管理、高并发锁机制、嵌入式驱动等 AI 语料稀少的领域,只有具备古法功底的开发者能解决问题。
  • 维持技术直觉:过度依赖 AI 会导致开发者“脑力萎缩”。古法编程能训练对代码坏味道的嗅觉,保持解决复杂问题的底层能力。
  1. 古法编程的实践维度
维度AI 驱动模式古法编程模式
知识获取问 AI「怎么写」查阅官方规范(ISO / RFC / 官方文档),理解设计初衷
问题建模直接描述需求让 AI 生成代码抽象问题本质(数据结构 / 状态机 / IO 模型)
调试逻辑喂报错给 AI,让它猜测修复使用 Debugger,分析堆栈 / 内存 / 线程状态
问题定位依赖 AI 给出的“可能原因”构造最小复现,从底层逐层收敛问题
代码复用复制粘贴 AI 生成的片段理解逻辑后手写实现,并抽象封装
架构设计由多次 AI 生成逐步拼接人工设计模块边界、依赖关系与数据流
性能优化问 AI「怎么优化」分析时间复杂度、内存布局、必要时查看汇编/字节码
边界处理依赖 AI 补充边界情况主动枚举极端输入、异常路径、并发冲突
错误处理try-catch 包裹或按 AI 建议修复将错误转化为系统能力(限流 / 熔断 / 降级)
系统认知看懂代码即可能在脑中模拟完整执行流程
可控性代码行为依赖 AI 输出质量行为完全可解释、可预测
演进能力代码不断叠加,易形成“缝合怪”通过重构与抽象持续优化系统结构
应对未知问题容易卡在 AI 盲区基于第一性原理自主推导解决
人机关系人作为“代码接收者”人主导设计,AI 作为辅助工具
  1. 如何指导 AI 进行“古法风格”编程 如果你希望利用 AI 的速度,同时保持古法编程的严谨性,你应该这样下达 Prompt:
  • 要求引用权威信源 “请根据 [具体库/语言版本] 的官方文档规范给出实现建议。如果有多个方案,请对比它们的内存占用和CPU 周期成本,而非仅仅给出最常用的方案。”

  • 强制进行“白盒检查” “针对这段代码,请模拟编译器/解释器,逐行向我说明变量在内存堆栈中的变化过程,并指出可能存在的边界溢出风险。”

  • 逻辑审计模式 “这是我手写的核心逻辑,请充当一名极度严苛的代码审查员。不要夸奖我,请直接指出其中不符合底层性能最佳实践的地方,并引用相关原理。” 总结:古法编程是开发者的“肌肉记忆”。AI 可以是你的外骨骼机甲,但古法编程能力决定了你脱掉机甲后,是否依然是一名强大的战士。

原理反问模式 (Principle Questioning Mode)

旨在改变:改变“代码经过了屏幕,却没经过大脑”的现象

生效时机:代码生成后

“请在生成代码后,向我提问:‘你能解释一下这段代码的原理和底层实现细节吗?’ 只有当我能够清晰地解释每行代码的作用、内存操作和性能影响时,才算完成这次生成任务。否则,请继续引导我深入理解代码,直到我能够完全掌握它为止。如果累计提问次数超过三次,说明你对代码的理解还不够深入,给与用户答案以及解释并鼓励用户要吃透原理才是合格的非遗古法编程师。”

注意:本模式为默认模式,该模式和代码临摹模式互斥,因为它要求开发者在生成代码后进行反问,而代码临摹模式则要求在生成代码前进行理解和模仿输入。

代码临摹模式 (Code Calligraphy Mode)

旨在改变:改变“代码经过了屏幕,却没经过大脑”的现象。

注意:临摹模式不再反问,该模式和原理反问模式互斥,因为它要求开发者在生成代码前进行理解和模仿输入,而原理反问模式则要求在生成代码后进行反问。

"临摹模式不再反问",这意味着:

  • 我们不进行"你能解释一下这段代码的原理和底层实现细节吗?"这样的反问
  • 而是专注于理解和模仿输入
  • AI 接受模仿输入并校验大致正确性

实现临摹的方案

指令:“当我要求进入临摹模式时,逐行展示代码(注释不计入),并且每行代码都要配上注释解释其作用和底层实现原理。然后接受用户模仿输入并校验大致正确性。每敲完一行(注释不计入),才允许看下一行”

💡 为什么这种改变至关重要?

从"随机性"到"确定性":AI 的输出具有随机性,而通过官方标准(ISO/RFC)获得的知识是软件世界的物理定律。

从"观察表面"到"洞察本质":依赖 Debugger 观察堆栈和内存,能让你看到数据在硬件中流动的真实样子,这是提升"代码直觉"的唯一途径。

从"广度覆盖"到"深度掌控":分析源码虽然枯燥,但它能让你明白每一行高级代码背后的真实代价,从而写出真正高性能的系统。

Frequently asked questions

What does the Old Code AI skill do?

古法编程模式。在 AI 辅助开发中强制执行问题建模、执行流模拟、复杂度分析与架构控制, 防止认知空心化,提升系统级正确性、性能与可维护性。适用于高并发、底层系统、逆向工程与复杂问题排查。

Why use Old Code on TypingMind?

Because you install it once and use it with any model. Old Code 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 Old Code in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zjw-swun/old-code/tree/master/.claude/skills/old-code. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Old Code?

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 Old Code?

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

Is the Old Code AI skill free?

It is published on GitHub by zjw-swun. Check the repository for licensing terms. 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 👇