Logo von Nw Fp Algebra Driven Design

Nw Fp Algebra Driven Design

Organisation
nWave-ai
nw-fp-algebra-driven-design

Algebra-driven API design with monoids, semigroups, and interpreters via algebraic equations

Übersicht

HerausgebernWave-ai
RepositorynWave
Skill-Namenw-fp-algebra-driven-design
Sterne
616
Forks
65
Mitgelieferte Dateien
Nur Anweisungen
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von nWave-ai auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Nw Fp Algebra Driven Design in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/nWave-ai/nWave/tree/main/nWave/skills/nw-fp-algebra-driven-design
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nWave-ai/nWave.git /tmp/nWave
mkdir -p .claude/skills
cp -r /tmp/nWave/nWave/skills/nw-fp-algebra-driven-design .claude/skills/nw-fp-algebra-driven-design
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Nw Fp Algebra Driven Design in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Nw Fp Algebra Driven Design automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Nw Fp Algebra Driven Design nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

FP Algebra-Driven Design

Algebraic thinking for API design. Discover the right API before implementing by specifying rules (equations) that operations must satisfy.

Cross-references: fp-principles | fp-domain-modeling | fp-usable-design


1. Why Algebraic Thinking

[STARTER]

Code is the wrong abstraction level for design. Starting with data structures inherits unnecessary constraints.

  • Specify rules first, implement second. Implementation is a solution to a system of equations.
  • Rules generate tests automatically. Every rule is directly a property test generating thousands of cases.
  • Rules reveal missing features. Analysis often exposes operations you need but haven't designed.
  • Rules catch contradictions early. Contradiction during design costs minutes; in production, days.

2. The Design Process

[STARTER]

  1. Start with scope, not implementation. Don't decide data structures upfront.
  2. Define observations first. How do users extract information? Observations define equality: two values equal if no observation distinguishes them. Gives enormous implementation freedom.
  3. Add operations incrementally. For each new operation, immediately write rules connecting it to existing ones. This web of rules IS the design.
  4. Let messy rules signal problems. Complex rules mean coarse building blocks. Decompose until each rule is nearly trivial.
  5. Generalize aggressively. Remove unnecessary type constraints. If most operations don't inspect contained values, parameterize over them.

3. Common Algebraic Structures

[STARTER] -> [ADVANCED]

Recurring patterns in software. Recognizing them unlocks known rules and capabilities.

[STARTER] Combinable Values (Semigroup)

What: Type with one merge operation where grouping doesn't matter. Rule: (a merge b) merge c = a merge (b merge c) (associativity) When: Combining things where parenthesization shouldn't matter. Examples: String concatenation | config merging | min/max.

[STARTER] Combinable Values with Default (Monoid)

What: Combinable Value with a default element inert under combination. Rules: Associativity + default merge x = x and x merge default = x When: Safe defaults | fold operations | "nothing happened yet" values. Examples: (+, 0) | (*, 1) | (concat, []) | (and, true). Design signal: If you find an associative operation, look for a default element. Finding one enables fold/reduce over collections.

[INTERMEDIATE] Merge-and-Forget Values (Semilattice)

What: Combinable Value where merging is also order-independent and idempotent. When: Conflict resolution | eventually-consistent systems | CRDTs. Example: Status tracker with seen < failed < completed uses max as merge.

[INTERMEDIATE] Structure-Preserving Transformations (Functor)

What: Container type where you can transform contents without changing structure. Preserves identity and composition. When: Operations that work on data shape rather than values inside. Design signal: If most operations are agnostic to contained type, you likely have this.

[ADVANCED] Combinable Containers (Applicative)

What: Container where you can combine contents element-wise and fill with uniform values. When: Combining containers holding different content types.

[ADVANCED] Reversible Operations (Group)

What: Combinable Value with Default where every element has an inverse that cancels it. When: Undo operations | spatial transformations. Example: Clockwise/counter-clockwise rotation are inverses; horizontal flip is its own inverse.


4. Properties of a Well-Designed API

[INTERMEDIATE]

Three categories, eight properties:

Clarity (communicates well):

  • Compositional: Complex values built from simpler ones
  • Task-relevant: Operations provide high-level functionality useful to actual users
  • Interrelated: Rules connect every operation to others

Economy (no waste):

  • Parsimonious: Each operation does one thing well
  • Orthogonal: No half-baked concept shared across multiple operations
  • Generalized: Unnecessary type constraints removed

Safety (prevents mistakes):

  • Closed: Every syntactically valid construction is semantically valid
  • Complete: Maximum algebraic structure discovered for every concept

5. Refactoring with Rules

[INTERMEDIATE]

Decompose Large Operations

Complex rules mean coarse building blocks. Split operations with many parameters into smaller, orthogonal ones. If a rule ignores some parameters, those should be separate operations.

Find Contradictions

Algebraic manipulation reveals contradictions before code is written. Requiring order-independence while returning an ordered list is a contradiction. Fix: use unordered collection.

Unify Observations

When multiple observations share traversal logic, find one observation from which all others derive. Simplifies entire rule set.

Use Symmetry to Discover Missing Features

When you have a "both" operation (parallel composition), look for its symmetric "either" counterpart. Symmetry discovers functionality not explicitly requested but inevitably needed.


6. Three-Phase Testing Strategy

[INTERMEDIATE]

  1. Build naive implementation: Implement each operation as direct data constructor. Obviously correct because it mirrors the spec exactly.
  2. Discover all rules: Feed naive implementation to a tool that enumerates well-typed expressions and finds observational equalities. Discovers specified AND emergent rules.
  3. Freeze as regression tests: Convert rules into executable property tests protecting any future optimized implementation.

Key insight: Two values are equal if no observation distinguishes them. Testing through observations allows completely different implementations to pass the same suite.


7. Decision Tree: When Is Algebraic Thinking Worth It?

Is your domain about COMBINING things?
  YES --> Algebraic thinking helps significantly
    Do combinations have rules (order irrelevant, defaults, inverses)?
      YES --> Known algebraic structures; use their rules directly
      NO --> Rules still help, but structures are not standard
  NO --> Is your domain about TRANSFORMING things?
    YES --> Look for Structure-Preserving Transformation patterns
    NO --> Is your API surface small and well-understood?
      YES --> Algebraic thinking adds overhead; use conventional design
      NO --> Rules can still clarify, even without standard structures

8. Combining with Other Patterns

Rules + Property-Based Testing: Rules ARE property tests. Algebraic constructors become PBT generators. Example: empty merge x = x becomes forAll(x -> assertEquals(empty.merge(x), x)).

Rules + Domain Modeling (see fp-domain-modeling): Domain wrappers with smart constructors are algebraic rules. State machine transitions are rules about valid sequences. Example: items(addItem(cart, item)) contains item -- directly a property test.

Rules + Usable Design (see fp-usable-design): Simple algebraic rules map to simple, searchable, nameable operations -- improving navigability and learnability. Example: decomposing processOrder into validate, price, confirm gives three nameable functions instead of one opaque one.

Decomposition + Feature Organization: When algebraic decomposition splits a monolithic operation into orthogonal pieces, organize by feature domain. Example: splitting configureWidget(size, color, border) into resize, recolor, restyle lets each live in its own feature module.

Full Cycle: Rules to Tests

-- 1. Define operations and observations
CartOps = { empty, addItem, removeItem, itemCount, totalPrice }

-- 2. Write rules
rule: itemCount(empty) == 0
rule: itemCount(addItem(cart, item)) == itemCount(cart) + 1
rule: removeItem(addItem(empty, x), x) == empty
rule: totalPrice(addItem(cart, item)) == totalPrice(cart) + item.price

-- 3. Rules become property tests
forAll(item -> assertEquals(itemCount(addItem(empty, item)), 1))
forAll(cart, item -> assertEquals(totalPrice(addItem(cart, item)), totalPrice(cart) + item.price))

-- 4. Implement naive version, run tests, then optimize

9. Design Heuristics

  1. Don't start with an implementation. Rules first, code second.
  2. Simple rules indicate good decomposition. Complex rules mean coarse building blocks.
  3. Every new operation needs rules connecting it to existing ones. Isolated operations indicate missing relationships.
  4. Look for algebraic structures. Associative? Look for default. Default found? Check for commutativity or inverses. Each upgrade brings new rules.
  5. Generalize by removing type constraints. If rules don't mention a specific type, parameterize.
  6. Build naive first, optimize second. Generate tests from naive implementation, then build optimized one against those tests.
  7. Invariants belong in types, not business logic. When rules require commutativity but data structure is ordered, change the data structure.

Häufig gestellte Fragen

Was macht der KI-Skill Nw Fp Algebra Driven Design?

Algebra-driven API design with monoids, semigroups, and interpreters via algebraic equations

Warum Nw Fp Algebra Driven Design in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Nw Fp Algebra Driven Design besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Nw Fp Algebra Driven Design in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/nWave-ai/nWave/tree/main/nWave/skills/nw-fp-algebra-driven-design ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Nw Fp Algebra Driven Design nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Nw Fp Algebra Driven Design verwenden?

So viele Sie möchten. In TypingMind können Sie Nw Fp Algebra Driven Design mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Nw Fp Algebra Driven Design kostenlos?

Ja. Der Skill wird von nWave-ai auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇