Logo vun Code Module Design

Code Module Design

Communautéit
Integralist
code-module-design

Vocabulary and principles for designing deep modules. Use when designing or improving a module's interface, looking for deepening opportunities, deciding where a seam goes, making code more testable or easier for agents to navigate, or when another skill needs the deep-module vocabulary.

Iwwersiicht

EditeurIntegralist
Repositoryagent-skills
Skill-Nummcode-module-design
Stären
26
Forks
1
Matgeliwwert Fichieren
2
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.

  • 2 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

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

Installatioun

Installéiert de KI-Skill Code Module Design 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/Integralist/agent-skills/tree/main/.agents/skills/code-module-design
  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/Integralist/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/.agents/skills/code-module-design .claude/skills/code-module-design
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Code Module Design 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 Code Module Design automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Code Module Design 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.

Design deep modules: place substantial behaviour behind a small interface, choose a clean seam, and test through that interface. Use the vocabulary and principles here whenever code is designed or restructured. Deep modules give callers leverage and maintainers locality.

Vocabulary

Use these terms exactly; the shared vocabulary is deliberate. Prefer them to "component," "service," "API," or "boundary."

  • Module: Anything with an interface and implementation, at any scale: a function, class, package, or slice spanning tiers. Avoid unit, component, and service.
  • Interface: Everything a caller must know to use the module correctly: its type signature plus invariants, ordering constraints, error modes, required configuration, and performance characteristics. It is more than a language's interface keyword or a class's public methods. Avoid API and signature.
  • Implementation: The code inside a module. An adapter names a role, not what's inside: a Postgres repository can be an adapter with a large implementation; an in-memory fake can have a small one.
  • Depth: Leverage at the interface: how much behaviour a caller or test can exercise per unit of interface it learns. A module is deep when much behaviour sits behind a small interface, and shallow when the interface is nearly as complex as the implementation. Depth measures leverage, not the ratio of implementation lines to interface lines, which rewards padding.
  • Seam (Michael Feathers): The place a module's interface lives, where behaviour can change without editing that place. Deciding where the seam goes is separate from deciding what sits behind it. Avoid boundary, which collides with DDD's bounded context.
  • Adapter: A concrete thing that satisfies an interface at a seam. The term names its role, not its contents.
  • Leverage: What callers get from depth: more capability per unit of interface, so one implementation pays back across call sites and tests.
  • Locality: What maintainers get from depth: change, bugs, knowledge, and verification concentrate in one place, so a fix lands once.

Design principles

  • Depth belongs to the interface. A deep module can use small, swappable parts and internal seams that its own tests use; keep those out of the public interface. To deepen a module, cut methods, simplify parameters, and hide more behind the seam.
  • Deletion test. Imagine deleting the module. If complexity vanishes, it was a pass-through; if it reappears across callers, the module was earning its keep.
  • Interface is the test surface. Callers and tests cross the same seam. Needing to test past it means the module has the wrong shape.
  • One adapter is a hypothetical seam; two make it real. Add a seam only when something actually varies across it, typically production and test.
  • Testable by construction. Accept dependencies rather than creating them inside, and return results rather than mutating shared state, so tests can supply inputs and check outputs at the interface.
  • Redesign from first principles. For a new requirement, read the affected modules and ask what interface and implementation you would build if the requirement had existed from day one. Compare that with extending the current design; choose the smallest coherent change, not a rewrite by default. Plan the whole change and deliver it in increments. Keep existing behaviour except where the requirement changes it. Carry the design through every type, caller, test, doc, and example. Prefer a coherent abstraction over another feature-specific exception.

Further procedures

  • When deepening a cluster of shallow modules, read DEEPENING.md for how dependency categories determine the seam and tests.
  • When exploring alternative interfaces, follow DESIGN-IT-TWICE.md to have parallel subagents design alternatives and compare them.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Code Module Design?

Vocabulary and principles for designing deep modules. Use when designing or improving a module's interface, looking for deepening opportunities, deciding where a seam goes, making code more testable or easier for agents to navigate, or when another skill needs the deep-module vocabulary.

Firwat Code Module Design op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Code Module Design 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 Code Module Design an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/Integralist/agent-skills/tree/main/.agents/skills/code-module-design an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Code Module Design 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 Code Module Design benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Code Module Design 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 Code Module Design gratis?

De Skill gëtt vum Integralist op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. 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 👇