Logo vun Programming As Theory Building

Programming As Theory Building

Communautéit
AnamKwon
programming-as-theory-building

Use when writing, generating, modifying, debugging, reviewing, or refactoring code. Treat code work as rebuilding and preserving the program theory: how real-world affairs map into program behavior, why the current shape exists, which existing facility the new demand resembles, and what observable behavior proves the change belongs.

Iwwersiicht

EditeurAnamKwon
Repositoryprogramming-as-theory-building-skill
Skill-Nummprogramming-as-theory-building
Stären
33
Forks
2
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum AnamKwon op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Programming As Theory Building an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/AnamKwon/programming-as-theory-building-skill/tree/main/skills/programming-as-theory-building
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AnamKwon/programming-as-theory-building-skill.git /tmp/programming-as-theory-building-skill
mkdir -p .claude/skills
cp -r /tmp/programming-as-theory-building-skill/skills/programming-as-theory-building .claude/skills/programming-as-theory-building
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Programming As Theory Building an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Programming As Theory Building automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Programming As Theory Building net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Programming as Theory Building

Operational rules for applying Peter Naur's "Programming as Theory Building" to coding-agent workflows. Use these rules to avoid context-free patches, speculative abstractions, and code that only looks right as text.

Tradeoff: This skill slows down trivial edits. For non-trivial code, pay the small upfront cost so the change fits the program.

Core Idea

Programming is not text production. The useful asset is the theory held by the programmer: how the program execution supports some real-world activity, why the program is shaped this way, and how it should change when the world changes.

Source code, tests, docs, and comments are evidence of that theory, not the theory itself.

Before Coding

Answer these briefly before a non-trivial edit:

  1. World Mapping: What real-world workflow, rule, protocol, or invariant is this code meant to support?
  2. Current Theory: Why is the current code shaped this way? What names, tests, callers, data shapes, or runtime behavior reveal that?
  3. Similarity: Which existing facility is the new demand most similar to? Where would a maintainer who knows the system expect it to live?
  4. Boundary: What real-world cases are intentionally outside this program's scope?
  5. Proof: What behavior, test, command, or review evidence would show the theory is now better supported?

If you cannot answer the first three, inspect more before patching.

Workflow

1. Rebuild Only The Needed Theory

  • Inspect the relevant code path, callers, callees, tests, fixtures, docs, names, and current runtime behavior.
  • Prefer executable behavior over stale comments or stale docs when they conflict.
  • Find at least one concrete example of how the code is used.
  • Keep the theory compact: a few precise sentences, not an architecture essay.
  • State uncertainty instead of hiding it.

2. Judge Similarity Before Placement

Naur's key modification question is not "where can I add this?" but "what existing world-facing capability is this most like?"

  • Put behavior beside the closest existing domain concept.
  • Use existing names, data shapes, validators, repositories, services, routes, UI patterns, and tests when they already encode the idea.
  • Do not duplicate a domain concept under a new name.
  • If the demand does not fit any existing facility, say why before creating one.

3. Keep Changes Surgical

  • Make the smallest coherent change that preserves the theory.
  • Touch only files required by the request.
  • Match local style even if you would design it differently from scratch.
  • Do not reformat, rename, reorganize, or modernize adjacent code as a side effect.
  • Remove only dead code introduced by your change unless cleanup was requested.

4. Avoid Speculative Flexibility

Future flexibility is not free. Every option, config knob, adapter, interface, or abstraction must be designed, implemented, tested, and explained.

  • No abstractions for one caller.
  • No unused hooks, queues, providers, registries, plugins, or settings.
  • No broad "just in case" error handling.
  • Add flexibility only when the present theory already needs it or the local pattern clearly requires it.

5. Preserve Invariants, Not Just Tests

  • Identify the invariant before changing behavior.
  • Do not patch around a broken invariant with a special case.
  • If several implementations pass the same narrow test, choose the one that keeps the design story easiest to explain.
  • Add names, comments, or tests only when they carry theory that would otherwise be hidden.

6. Verify The Theory

  • Bug fix: reproduce the violated invariant, then show it holds.
  • Feature or generated code: verify the user-visible path and one meaningful edge case when practical.
  • Refactor: verify behavior stayed the same.
  • Review: report concrete risks, regressions, and missing tests with file references.

If verification contradicts the theory, rebuild the theory before adding another patch.

Program Life Signals

Treat a program as "alive" when its theory can still be recovered and extended. Treat it as high-risk or "dead" when only text remains.

Stop and gather more context if:

  • the change needs special cases that do not match existing names or boundaries,
  • two areas encode the same domain concept differently,
  • the obvious fix is a broad rewrite or speculative abstraction,
  • the narrow test passes but the design story becomes harder to explain,
  • the code's purpose cannot be mapped back to the real-world activity,
  • the next step requires a product, domain, legal, security, or data decision the code cannot answer.

If the existing text is too far from any recoverable theory, say so. A rewrite may be cheaper than reviving dead code, but only after that risk is explicit.

Review Checklist

When reviewing code, look for:

  • code that satisfies a prompt but not the domain invariant,
  • misplaced behavior that belongs in an existing facility,
  • duplicated domain concepts under different names,
  • speculative flexibility not justified by current requirements,
  • tests that prove syntax or status codes but not the real-world behavior,
  • docs that claim a theory the code does not implement.

Response Shape

For non-trivial work, summarize briefly:

text
Theory: [world rule -> program location]
Changed: [what changed]
Verified: [checks run]
Risk: [meaningful residual risk, if any]

For review-only work, lead with findings and file references. If there are no findings, say so plainly and note remaining test gaps or residual risk.

Heefeg gestallte Froen

Wat mécht de KI-Skill Programming As Theory Building?

Use when writing, generating, modifying, debugging, reviewing, or refactoring code. Treat code work as rebuilding and preserving the program theory: how real-world affairs map into program behavior, why the current shape exists, which existing facility the new demand resembles, and what observable behavior proves the change belongs.

Firwat Programming As Theory Building op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Programming As Theory Building besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Programming As Theory Building an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/AnamKwon/programming-as-theory-building-skill/tree/main/skills/programming-as-theory-building an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Programming As Theory Building benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Programming As Theory Building benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Programming As Theory Building domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Programming As Theory Building gratis?

Jo. De Skill gëtt vum AnamKwon ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇