> ## Documentation Index
> Fetch the complete documentation index at: https://vietbui.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Software Design Principles

> Reference for SOLID, DRY, YAGNI, KISS, Law of Demeter, separation of concerns, and composition over inheritance. Each principle is stated, justified, and ill…

# Software Design Principles

Reference for SOLID, DRY, YAGNI, KISS, Law of Demeter, separation of concerns, and composition over inheritance. Each principle is stated, justified, and illustrated with a canonical violation and its fix.

Agent guidance: apply these when writing new classes/functions, and check against them during code review. Violation of multiple principles in one place is a refactor signal.

## Agent Trigger

**Apply when:** Making a design/structure decision or reviewing for design smells (SOLID, DRY, YAGNI, KISS, Law of Demeter).
**Rule of thumb:** Apply the principle that names the smell you actually see; don't over-abstract ahead of need (YAGNI beats speculative DIP).

***

## SOLID

### S — Single Responsibility Principle (SRP)

**Definition:** A class should have exactly one reason to change.

**Rationale:** Multiple responsibilities in one class mean multiple teams/features can modify it for unrelated reasons. Merge conflicts increase; the class becomes a catch-all that is hard to test and replace.

**Violation:**

```java theme={null}
// Invoice calculates totals, prints to console, AND writes to disk — three reasons to change
public class Invoice {
    public double calculateTotal() { ... }
    public void printInvoice() { System.out.println(...); }
    public void saveToFile(String filename) { ... }
}
```

**Fix:** Extract `InvoicePrinter` and `InvoicePersistence` as separate classes. `Invoice` changes only when business rules change.

**Anti-patterns to catch:**

* A class named `UserManager` or `DataHelper` — "Manager"/"Helper" suffix often means mixed responsibilities
* A class with both `save*` and `render*` methods
* A function that validates, transforms, AND persists in sequence

**Cross-link:** [Deep Modules](/concepts/deep-modules) — deep modules implement SRP by hiding a wide implementation behind a narrow interface.

***

### O — Open-Closed Principle (OCP)

**Definition:** Classes should be open for extension, closed for modification.

**Rationale:** Modifying tested production code risks introducing bugs. Extension via interfaces/abstract classes allows adding behavior without touching existing logic.

**Violation:**

```java theme={null}
// Every new persistence target requires modifying this class
public class InvoicePersistence {
    public void saveToFile(String filename) { ... }
    public void saveToDatabase() { ... }  // added by modifying the class
}
```

**Fix:** Define an interface, implement per-target:

```java theme={null}
interface InvoicePersistence { void save(Invoice invoice); }
class FilePersistence implements InvoicePersistence { ... }
class DatabasePersistence implements InvoicePersistence { ... }
```

**Anti-patterns to catch:**

* `if (type == "A") ... else if (type == "B")` in a class that was working — add a new implementor instead
* Adding a method to a class when a new feature is introduced rather than creating a new implementation

**Cross-link:** [Behavioral Design Patterns](/patterns/design-patterns-behavioral) — Strategy pattern is the canonical OCP implementation.

***

### L — Liskov Substitution Principle (LSP)

**Definition:** A subclass must be substitutable for its base class without altering program correctness.

**Rationale:** Inheritance is a promise: the child extends, never narrows. Violating LSP breaks caller assumptions and produces hard-to-detect runtime bugs.

**Violation:**

```java theme={null}
// Square overrides Rectangle setters to enforce equal sides,
// breaking callers that set width/height independently
class Square extends Rectangle {
    @Override public void setWidth(int w) { super.setWidth(w); super.setHeight(w); }
    @Override public void setHeight(int h) { super.setHeight(h); super.setWidth(h); }
}
// Caller: r.setHeight(10); expects area = width * 10 — fails for Square
```

**Fix:** Do not inherit. Model `Square` and `Rectangle` as separate implementations of a `Shape` interface with `getArea()`.

**Anti-patterns to catch:**

* Overriding a method to throw `UnsupportedOperationException` or `NotImplementedException`
* A child class that ignores or no-ops a parent method
* Checking `instanceof` before calling a method — signals the type hierarchy is wrong

***

### I — Interface Segregation Principle (ISP)

**Definition:** Many small, client-specific interfaces are better than one large general-purpose interface.

**Rationale:** Forcing implementors to stub out methods they don't need pollutes the codebase and misleads readers. A `FreeParking` that implements `doPayment()` with `throw new Exception` is a lie.

**Violation:**

```java theme={null}
interface ParkingLot {
    void parkCar(); void unparkCar(); void getCapacity();
    double calculateFee(Car car); void doPayment(Car car);  // payment shouldn't be mandatory
}
class FreeParking implements ParkingLot {
    public void doPayment(Car car) { throw new Exception("Parking lot is free"); }  // forced stub
}
```

**Fix:** Split into `ParkingLot` (park/unpark/capacity) and `PaidParkingLot extends ParkingLot` (fee/payment).

**Anti-patterns to catch:**

* An interface with 10+ methods
* Implementations that stub methods with empty bodies or exceptions
* A single interface imported by many unrelated consumers

**Cross-link:** [Deep Modules](/concepts/deep-modules) — ISP is the interface-side expression of deep modules; keep public surface narrow.

***

### D — Dependency Inversion Principle (DIP)

**Definition:** Depend on abstractions (interfaces/abstract classes), not concrete implementations.

**Rationale:** High-level modules should not be coupled to low-level details. When both depend on an abstraction, either can change independently.

**Violation:**

```java theme={null}
class PersistenceManager {
    FilePersistence filePersistence;  // depends on concrete class
}
```

**Fix:**

```java theme={null}
class PersistenceManager {
    InvoicePersistence invoicePersistence;  // depends on interface
    BookPersistence bookPersistence;
}
```

**Anti-patterns to catch:**

* `new ConcreteService()` inside a business-logic class instead of injecting it
* Unit tests that are hard to write because real dependencies (DB, HTTP) are constructed inline

**Note:** DIP is the mechanism that makes OCP work. If OCP is the goal, DIP is how you get there.

***

## DRY — Don't Repeat Yourself

**Definition:** Every piece of knowledge must have a single, unambiguous representation in the system.

**Rationale:** Duplicated logic means changes must be made in multiple places. One missed location creates divergence and bugs.

**Violation:**

```python theme={null}
def calculate_book_price(quantity, price): return quantity * price
def calculate_laptop_price(quantity, price): return quantity * price
```

**Fix:** `def calculate_product_price(quantity, price): return quantity * price`

**Anti-patterns to catch:**

* Copy-paste with minor variable name changes
* The same validation logic in the controller, service, and model layers
* Comments that describe what the code does — the code should express it; if it can't, extract a named function

**Qualifier:** DRY is about knowledge, not code. Two functions that look identical but represent different business rules should not be merged.

***

## YAGNI — You Aren't Gonna Need It

**Definition:** Do not add functionality until it is required.

**Rationale:** Speculative code adds complexity, needs maintenance, and is often wrong about what will actually be needed.

**Anti-patterns to catch:**

* A `strategy` parameter added "in case we need to swap algorithms later"
* Abstract base classes created before there is a second implementor
* Configuration flags for behavior that has no current user

**When to ignore:** When a known requirement is arriving in the next sprint and the upfront cost of extensibility is small.

***

## KISS — Keep It Simple, Stupid

**Definition:** Prefer the simplest solution that satisfies the requirement.

**Rationale:** Complexity is the primary source of bugs, onboarding cost, and maintenance burden. Clever code is a liability.

**Anti-patterns to catch:**

* Using a design pattern when a plain function works
* Premature abstraction: interfaces with one implementation, factories that construct one type
* Nested ternaries, one-liners that require 30 seconds to parse

**Agent guidance:** When two solutions both work, prefer the one with fewer moving parts, fewer files, and fewer concepts to hold in working memory.

***

## Law of Demeter (LoD) / Principle of Least Knowledge

**Definition:** A method should only call methods on: itself, its parameters, objects it creates, its direct component objects. Do not call methods on objects returned by other calls.

**Rationale:** Long chains like `a.getB().getC().doSomething()` create tight coupling between `A` and the internals of `B` and `C`. Changes to intermediate types ripple outward.

**Violation:**

```python theme={null}
total = order.getCart().getItems().calculateTotal()
```

**Fix:** `total = order.getTotal()` — `Order` exposes total directly, hiding the cart/items structure.

**Anti-patterns to catch:**

* Method chains longer than two hops (`obj.getX().getY().doZ()`)
* Passing a large object just to extract one field — pass the field directly

***

## Separation of Concerns (SoC)

**Definition:** Different concerns (business logic, persistence, presentation, validation) belong in distinct modules.

**Rationale:** Mixed concerns make each part harder to test and replace. A component that validates, saves, and emails is coupled to three external systems.

**Anti-patterns to catch:**

* SQL queries in a React component
* HTTP response formatting in a database repository
* Auth logic scattered across route handlers

**Cross-link:** SoC is SRP applied at the architectural level. SRP applies within a class; SoC applies across modules and layers.

***

## Composition Over Inheritance

**Definition:** Favor building behavior by composing objects with the desired capability rather than inheriting from a base class.

**Rationale:** Inheritance creates tight coupling through the class hierarchy. Adding behavior via composition keeps classes independent and substitutable.

**Violation:** `class LoggingService extends EmailService` — `LoggingService` inherits all of `EmailService`'s interface and internals just to add logging before sends.

**Fix:** `class LoggingService { constructor(private inner: EmailService) {} }` — wraps and delegates.

**Anti-patterns to catch:**

* Deep inheritance hierarchies (3+ levels)
* Inheriting just to reuse a utility method — inject the utility instead
* `extends BaseController`, `extends BaseRepository` with large shared state

**Cross-link:** [Structural Design Patterns](/patterns/design-patterns-structural) — Decorator pattern is composition over inheritance made explicit.

***

## Summary: When to Apply Which Principle

| Situation                                      | Check                                              |
| ---------------------------------------------- | -------------------------------------------------- |
| Adding a method to an existing class           | SRP — does this belong here?                       |
| New feature requires modifying a working class | OCP — can you extend instead?                      |
| Using inheritance                              | LSP — is the subtype truly substitutable?          |
| Designing an interface                         | ISP — is every method needed by every implementor? |
| Constructing dependencies inside a class       | DIP — can you inject instead?                      |
| Tempted to copy-paste logic                    | DRY — extract a named abstraction                  |
| Adding "future-proof" flexibility              | YAGNI — do you have a concrete requirement?        |
| Solution is growing complex                    | KISS — what is the simplest path?                  |
| Calling a method on a return value             | LoD — expose what callers need directly            |

***

## Related pages

* [Deep Modules](/concepts/deep-modules) — Ousterhout's framing: narrow interface, wide implementation; intersects SRP, ISP
* [Code Quality Heuristics](/patterns/code-quality) — Naming, function discipline, complexity — the tactical application of these principles
* [Behavioral Design Patterns](/patterns/design-patterns-behavioral) — Strategy (OCP), Observer, Command; behavioral patterns that implement SOLID
* [Structural Design Patterns](/patterns/design-patterns-structural) — Decorator (composition over inheritance), Adapter, Proxy
* [Refactoring Techniques](/patterns/refactoring) — Mechanics for moving from violation to compliance

<iframe
  srcDoc="<!doctype html><html><head><meta charset=&#x22;utf-8&#x22;><style>
html,body{margin:0;height:100%;background:#0f1117;overflow:hidden;font-family:ui-sans-serif,system-ui,-apple-system,sans-serif}
#g{width:100%;height:100%}
#hd{position:absolute;top:0;left:0;right:30px;height:22px;display:flex;align-items:center;gap:6px;padding:0 10px;color:#aeb3c2;font-size:10px;letter-spacing:.08em;text-transform:uppercase;z-index:6;cursor:move;user-select:none;touch-action:none;background:linear-gradient(#0f1117cc,#0f111700)}
#gear{position:absolute;top:5px;right:7px;z-index:7;cursor:pointer;color:#aeb3c2;background:#1b1e27;border:1px solid #2b2f3a;border-radius:6px;width:22px;height:22px;display:flex;align-items:center;justify-content:center;font-size:12px;user-select:none}
#panel{position:absolute;top:31px;right:7px;z-index:7;background:rgba(22,25,34,.96);border:1px solid #2b2f3a;border-radius:8px;padding:6px 9px 9px;display:none;width:150px;color:#c9cdd8;font-size:10px}
#panel.open{display:block}
#panel label{display:flex;justify-content:space-between;margin:7px 0 1px;color:#9aa0b0}
#panel input[type=range]{width:100%;margin:0}
#panel .row{display:flex;align-items:center;gap:6px;margin-top:8px;color:#c9cdd8}
</style><script src=&#x22;https://cdn.jsdelivr.net/npm/force-graph@1.51.4/dist/force-graph.min.js&#x22; integrity=&#x22;sha384-Hm6GpQcTNI5VqGgGS7lLxTGtEFcxu/kOVV0B7ozIZRu9blWVvigv5httJQZ2qZmY&#x22; crossorigin=&#x22;anonymous&#x22;></script></head>
<body><div id=&#x22;hd&#x22;>Graph</div><div id=&#x22;gear&#x22;>⚙</div>
<div id=&#x22;panel&#x22;>
<label>Node size<span id=&#x22;vns&#x22;></span></label><input id=&#x22;ns&#x22; type=&#x22;range&#x22; min=&#x22;0.6&#x22; max=&#x22;6&#x22; step=&#x22;0.2&#x22;>
<label>Link width<span id=&#x22;vlw&#x22;></span></label><input id=&#x22;lw&#x22; type=&#x22;range&#x22; min=&#x22;0&#x22; max=&#x22;3&#x22; step=&#x22;0.1&#x22;>
<label>Label size<span id=&#x22;vts&#x22;></span></label><input id=&#x22;ts&#x22; type=&#x22;range&#x22; min=&#x22;0&#x22; max=&#x22;8&#x22; step=&#x22;0.5&#x22;>
<label>Label opacity<span id=&#x22;vto&#x22;></span></label><input id=&#x22;to&#x22; type=&#x22;range&#x22; min=&#x22;0&#x22; max=&#x22;1&#x22; step=&#x22;0.05&#x22;>
<div id=&#x22;depthRow&#x22;><label>Depth<span id=&#x22;vd&#x22;></span></label><input id=&#x22;dp&#x22; type=&#x22;range&#x22; min=&#x22;1&#x22; max=&#x22;5&#x22; step=&#x22;1&#x22;></div>
<div class=&#x22;row&#x22;><input id=&#x22;ar&#x22; type=&#x22;checkbox&#x22;><span>Directional arrows</span></div>
</div>
<div id=&#x22;g&#x22;></div>
<script>
const NODES=[{&#x22;id&#x22;:&#x22;patterns/principles&#x22;,&#x22;label&#x22;:&#x22;Software Design Principles&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:4.872983346207417},{&#x22;id&#x22;:&#x22;patterns/backend&#x22;,&#x22;label&#x22;:&#x22;Backend Patterns&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:3.6457513110645907},{&#x22;id&#x22;:&#x22;systems/architectural-patterns&#x22;,&#x22;label&#x22;:&#x22;Architectural Patterns&#x22;,&#x22;group&#x22;:&#x22;systems&#x22;,&#x22;val&#x22;:3.6457513110645907},{&#x22;id&#x22;:&#x22;patterns/design-patterns-behavioral&#x22;,&#x22;label&#x22;:&#x22;Behavioral Design Patterns&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:3.449489742783178},{&#x22;id&#x22;:&#x22;concepts/deep-modules&#x22;,&#x22;label&#x22;:&#x22;Deep Modules&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:3.449489742783178},{&#x22;id&#x22;:&#x22;entities/ponytail&#x22;,&#x22;label&#x22;:&#x22;Ponytail&#x22;,&#x22;group&#x22;:&#x22;entities&#x22;,&#x22;val&#x22;:3.449489742783178},{&#x22;id&#x22;:&#x22;patterns/api-design&#x22;,&#x22;label&#x22;:&#x22;API Design Patterns&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:3.23606797749979},{&#x22;id&#x22;:&#x22;patterns/code-quality&#x22;,&#x22;label&#x22;:&#x22;Code Quality Heuristics&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:3.23606797749979},{&#x22;id&#x22;:&#x22;patterns/design-patterns-structural&#x22;,&#x22;label&#x22;:&#x22;Structural Design Patterns&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:3.23606797749979},{&#x22;id&#x22;:&#x22;patterns/error-handling&#x22;,&#x22;label&#x22;:&#x22;Error Handling Patterns&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:3.23606797749979},{&#x22;id&#x22;:&#x22;patterns/concurrency&#x22;,&#x22;label&#x22;:&#x22;Concurrency and Parallelism Patterns&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:3},{&#x22;id&#x22;:&#x22;patterns/database&#x22;,&#x22;label&#x22;:&#x22;Database Patterns&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:3},{&#x22;id&#x22;:&#x22;patterns/frontend&#x22;,&#x22;label&#x22;:&#x22;Frontend Patterns&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:3},{&#x22;id&#x22;:&#x22;patterns/design-patterns-creational&#x22;,&#x22;label&#x22;:&#x22;Creational Design Patterns&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:2.732050807568877},{&#x22;id&#x22;:&#x22;patterns/refactoring&#x22;,&#x22;label&#x22;:&#x22;Refactoring Techniques&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:2.732050807568877},{&#x22;id&#x22;:&#x22;patterns/algorithmic&#x22;,&#x22;label&#x22;:&#x22;Algorithmic Patterns&#x22;,&#x22;group&#x22;:&#x22;patterns&#x22;,&#x22;val&#x22;:2.414213562373095},{&#x22;id&#x22;:&#x22;concepts/agent-harness&#x22;,&#x22;label&#x22;:&#x22;Agent Harness&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:7.48074069840786},{&#x22;id&#x22;:&#x22;concepts/agent-skills&#x22;,&#x22;label&#x22;:&#x22;Agent Skills&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:5.795831523312719},{&#x22;id&#x22;:&#x22;entities/opencode&#x22;,&#x22;label&#x22;:&#x22;OpenCode&#x22;,&#x22;group&#x22;:&#x22;entities&#x22;,&#x22;val&#x22;:5.358898943540674},{&#x22;id&#x22;:&#x22;entities/pi-agent&#x22;,&#x22;label&#x22;:&#x22;Pi Agent (pi-mono)&#x22;,&#x22;group&#x22;:&#x22;entities&#x22;,&#x22;val&#x22;:5.123105625617661},{&#x22;id&#x22;:&#x22;concepts/agent-context-instructions&#x22;,&#x22;label&#x22;:&#x22;Agent Context Instructions&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:4.872983346207417},{&#x22;id&#x22;:&#x22;concepts/agentic-cicd&#x22;,&#x22;label&#x22;:&#x22;Agentic CI/CD&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:4.60555127546399},{&#x22;id&#x22;:&#x22;systems/scalability-reliability&#x22;,&#x22;label&#x22;:&#x22;Scalability and Reliability&#x22;,&#x22;group&#x22;:&#x22;systems&#x22;,&#x22;val&#x22;:4.16227766016838},{&#x22;id&#x22;:&#x22;concepts/self-healing-loop&#x22;,&#x22;label&#x22;:&#x22;Self-Healing Loop&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:4.16227766016838},{&#x22;id&#x22;:&#x22;systems/distributed-systems&#x22;,&#x22;label&#x22;:&#x22;Distributed Systems&#x22;,&#x22;group&#x22;:&#x22;systems&#x22;,&#x22;val&#x22;:4},{&#x22;id&#x22;:&#x22;concepts/error-budget&#x22;,&#x22;label&#x22;:&#x22;Error Budget (Agentic)&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:3.8284271247461903},{&#x22;id&#x22;:&#x22;concepts/ai-specific-pitfalls&#x22;,&#x22;label&#x22;:&#x22;AI-Specific Code Pitfalls&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:3.8284271247461903},{&#x22;id&#x22;:&#x22;concepts/unit-testing&#x22;,&#x22;label&#x22;:&#x22;Unit Testing&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:3.449489742783178},{&#x22;id&#x22;:&#x22;systems/system-design-process&#x22;,&#x22;label&#x22;:&#x22;System Design Process&#x22;,&#x22;group&#x22;:&#x22;systems&#x22;,&#x22;val&#x22;:3},{&#x22;id&#x22;:&#x22;concepts/actor-model&#x22;,&#x22;label&#x22;:&#x22;Actor Model&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:3},{&#x22;id&#x22;:&#x22;systems/data-modeling&#x22;,&#x22;label&#x22;:&#x22;Data Modeling&#x22;,&#x22;group&#x22;:&#x22;systems&#x22;,&#x22;val&#x22;:3},{&#x22;id&#x22;:&#x22;concepts/model-task-routing&#x22;,&#x22;label&#x22;:&#x22;Model-Task Routing (OpenCode Go)&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:3},{&#x22;id&#x22;:&#x22;concepts/mobile-design-patterns&#x22;,&#x22;label&#x22;:&#x22;Mobile Design Patterns&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:2.732050807568877},{&#x22;id&#x22;:&#x22;concepts/context-compression&#x22;,&#x22;label&#x22;:&#x22;Context Compression Strategies&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:6.0990195135927845},{&#x22;id&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;,&#x22;label&#x22;:&#x22;Lean Agentic Coding Workflow&#x22;,&#x22;group&#x22;:&#x22;syntheses&#x22;,&#x22;val&#x22;:5.795831523312719},{&#x22;id&#x22;:&#x22;concepts/agent-self-correction&#x22;,&#x22;label&#x22;:&#x22;Agent Self-Correction&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:5.358898943540674},{&#x22;id&#x22;:&#x22;concepts/verification-pipeline&#x22;,&#x22;label&#x22;:&#x22;Verification Pipeline&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:5.358898943540674},{&#x22;id&#x22;:&#x22;concepts/multi-vendor-adversarial-review&#x22;,&#x22;label&#x22;:&#x22;Multi-Vendor Adversarial Review&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:4.872983346207417},{&#x22;id&#x22;:&#x22;concepts/ralph-loop&#x22;,&#x22;label&#x22;:&#x22;Ralph Loop&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:4.872983346207417},{&#x22;id&#x22;:&#x22;concepts/agent-subagents&#x22;,&#x22;label&#x22;:&#x22;Agent Subagents&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:4.741657386773941},{&#x22;id&#x22;:&#x22;concepts/worktree-isolation&#x22;,&#x22;label&#x22;:&#x22;Worktree Isolation&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:4.60555127546399},{&#x22;id&#x22;:&#x22;concepts/context-degradation&#x22;,&#x22;label&#x22;:&#x22;Context Degradation Patterns&#x22;,&#x22;group&#x22;:&#x22;concepts&#x22;,&#x22;val&#x22;:4.60555127546399},{&#x22;id&#x22;:&#x22;syntheses/desktop-control-plane&#x22;,&#x22;label&#x22;:&#x22;Desktop AI Agent Control Plane — Architecture Synthesis&#x22;,&#x22;group&#x22;:&#x22;syntheses&#x22;,&#x22;val&#x22;:4.60555127546399},{&#x22;id&#x22;:&#x22;syntheses/agent-primitive-selection&#x22;,&#x22;label&#x22;:&#x22;Agent Primitive Selection&#x22;,&#x22;group&#x22;:&#x22;syntheses&#x22;,&#x22;val&#x22;:4.464101615137754}],LINKS=[{&#x22;source&#x22;:&#x22;concepts/actor-model&#x22;,&#x22;target&#x22;:&#x22;patterns/concurrency&#x22;},{&#x22;source&#x22;:&#x22;concepts/actor-model&#x22;,&#x22;target&#x22;:&#x22;systems/distributed-systems&#x22;},{&#x22;source&#x22;:&#x22;concepts/actor-model&#x22;,&#x22;target&#x22;:&#x22;systems/architectural-patterns&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-harness&#x22;,&#x22;target&#x22;:&#x22;concepts/ralph-loop&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-harness&#x22;,&#x22;target&#x22;:&#x22;concepts/context-degradation&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-harness&#x22;,&#x22;target&#x22;:&#x22;concepts/context-compression&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-harness&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-context-instructions&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-self-correction&#x22;,&#x22;target&#x22;:&#x22;concepts/verification-pipeline&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-self-correction&#x22;,&#x22;target&#x22;:&#x22;concepts/unit-testing&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-self-correction&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-self-correction&#x22;,&#x22;target&#x22;:&#x22;syntheses/agent-primitive-selection&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-self-correction&#x22;,&#x22;target&#x22;:&#x22;concepts/context-compression&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-self-correction&#x22;,&#x22;target&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-self-correction&#x22;,&#x22;target&#x22;:&#x22;concepts/multi-vendor-adversarial-review&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-self-correction&#x22;,&#x22;target&#x22;:&#x22;entities/opencode&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-skills&#x22;,&#x22;target&#x22;:&#x22;concepts/multi-vendor-adversarial-review&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-skills&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-skills&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-subagents&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-subagents&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-skills&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-subagents&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-subagents&#x22;,&#x22;target&#x22;:&#x22;concepts/context-compression&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-subagents&#x22;,&#x22;target&#x22;:&#x22;concepts/context-degradation&#x22;},{&#x22;source&#x22;:&#x22;concepts/agent-subagents&#x22;,&#x22;target&#x22;:&#x22;syntheses/agent-primitive-selection&#x22;},{&#x22;source&#x22;:&#x22;concepts/agentic-cicd&#x22;,&#x22;target&#x22;:&#x22;concepts/self-healing-loop&#x22;},{&#x22;source&#x22;:&#x22;concepts/agentic-cicd&#x22;,&#x22;target&#x22;:&#x22;concepts/verification-pipeline&#x22;},{&#x22;source&#x22;:&#x22;concepts/agentic-cicd&#x22;,&#x22;target&#x22;:&#x22;concepts/worktree-isolation&#x22;},{&#x22;source&#x22;:&#x22;concepts/agentic-cicd&#x22;,&#x22;target&#x22;:&#x22;concepts/ralph-loop&#x22;},{&#x22;source&#x22;:&#x22;concepts/agentic-cicd&#x22;,&#x22;target&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;},{&#x22;source&#x22;:&#x22;concepts/ai-specific-pitfalls&#x22;,&#x22;target&#x22;:&#x22;entities/ponytail&#x22;},{&#x22;source&#x22;:&#x22;concepts/ai-specific-pitfalls&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-context-instructions&#x22;},{&#x22;source&#x22;:&#x22;concepts/ai-specific-pitfalls&#x22;,&#x22;target&#x22;:&#x22;concepts/verification-pipeline&#x22;},{&#x22;source&#x22;:&#x22;concepts/context-compression&#x22;,&#x22;target&#x22;:&#x22;concepts/context-degradation&#x22;},{&#x22;source&#x22;:&#x22;concepts/context-compression&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;concepts/context-compression&#x22;,&#x22;target&#x22;:&#x22;concepts/ralph-loop&#x22;},{&#x22;source&#x22;:&#x22;concepts/context-degradation&#x22;,&#x22;target&#x22;:&#x22;concepts/context-compression&#x22;},{&#x22;source&#x22;:&#x22;concepts/context-degradation&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;concepts/context-degradation&#x22;,&#x22;target&#x22;:&#x22;concepts/ralph-loop&#x22;},{&#x22;source&#x22;:&#x22;concepts/deep-modules&#x22;,&#x22;target&#x22;:&#x22;concepts/unit-testing&#x22;},{&#x22;source&#x22;:&#x22;concepts/deep-modules&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;concepts/deep-modules&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-context-instructions&#x22;},{&#x22;source&#x22;:&#x22;concepts/error-budget&#x22;,&#x22;target&#x22;:&#x22;concepts/self-healing-loop&#x22;},{&#x22;source&#x22;:&#x22;concepts/error-budget&#x22;,&#x22;target&#x22;:&#x22;concepts/agentic-cicd&#x22;},{&#x22;source&#x22;:&#x22;concepts/error-budget&#x22;,&#x22;target&#x22;:&#x22;concepts/ralph-loop&#x22;},{&#x22;source&#x22;:&#x22;concepts/error-budget&#x22;,&#x22;target&#x22;:&#x22;concepts/verification-pipeline&#x22;},{&#x22;source&#x22;:&#x22;concepts/mobile-design-patterns&#x22;,&#x22;target&#x22;:&#x22;patterns/frontend&#x22;},{&#x22;source&#x22;:&#x22;concepts/model-task-routing&#x22;,&#x22;target&#x22;:&#x22;entities/pi-agent&#x22;},{&#x22;source&#x22;:&#x22;concepts/multi-vendor-adversarial-review&#x22;,&#x22;target&#x22;:&#x22;entities/pi-agent&#x22;},{&#x22;source&#x22;:&#x22;concepts/multi-vendor-adversarial-review&#x22;,&#x22;target&#x22;:&#x22;concepts/verification-pipeline&#x22;},{&#x22;source&#x22;:&#x22;concepts/multi-vendor-adversarial-review&#x22;,&#x22;target&#x22;:&#x22;syntheses/agent-primitive-selection&#x22;},{&#x22;source&#x22;:&#x22;concepts/ralph-loop&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;concepts/self-healing-loop&#x22;,&#x22;target&#x22;:&#x22;concepts/ralph-loop&#x22;},{&#x22;source&#x22;:&#x22;concepts/self-healing-loop&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;concepts/self-healing-loop&#x22;,&#x22;target&#x22;:&#x22;concepts/agentic-cicd&#x22;},{&#x22;source&#x22;:&#x22;concepts/self-healing-loop&#x22;,&#x22;target&#x22;:&#x22;concepts/verification-pipeline&#x22;},{&#x22;source&#x22;:&#x22;concepts/self-healing-loop&#x22;,&#x22;target&#x22;:&#x22;concepts/worktree-isolation&#x22;},{&#x22;source&#x22;:&#x22;concepts/unit-testing&#x22;,&#x22;target&#x22;:&#x22;concepts/verification-pipeline&#x22;},{&#x22;source&#x22;:&#x22;concepts/verification-pipeline&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;concepts/verification-pipeline&#x22;,&#x22;target&#x22;:&#x22;concepts/ralph-loop&#x22;},{&#x22;source&#x22;:&#x22;concepts/verification-pipeline&#x22;,&#x22;target&#x22;:&#x22;concepts/unit-testing&#x22;},{&#x22;source&#x22;:&#x22;concepts/worktree-isolation&#x22;,&#x22;target&#x22;:&#x22;concepts/context-compression&#x22;},{&#x22;source&#x22;:&#x22;concepts/worktree-isolation&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-subagents&#x22;},{&#x22;source&#x22;:&#x22;patterns/algorithmic&#x22;,&#x22;target&#x22;:&#x22;patterns/code-quality&#x22;},{&#x22;source&#x22;:&#x22;patterns/algorithmic&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/api-design&#x22;,&#x22;target&#x22;:&#x22;patterns/error-handling&#x22;},{&#x22;source&#x22;:&#x22;patterns/api-design&#x22;,&#x22;target&#x22;:&#x22;systems/distributed-systems&#x22;},{&#x22;source&#x22;:&#x22;patterns/api-design&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/api-design&#x22;,&#x22;target&#x22;:&#x22;systems/system-design-process&#x22;},{&#x22;source&#x22;:&#x22;patterns/backend&#x22;,&#x22;target&#x22;:&#x22;systems/scalability-reliability&#x22;},{&#x22;source&#x22;:&#x22;patterns/backend&#x22;,&#x22;target&#x22;:&#x22;patterns/api-design&#x22;},{&#x22;source&#x22;:&#x22;patterns/backend&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/backend&#x22;,&#x22;target&#x22;:&#x22;systems/distributed-systems&#x22;},{&#x22;source&#x22;:&#x22;patterns/backend&#x22;,&#x22;target&#x22;:&#x22;systems/architectural-patterns&#x22;},{&#x22;source&#x22;:&#x22;patterns/backend&#x22;,&#x22;target&#x22;:&#x22;patterns/database&#x22;},{&#x22;source&#x22;:&#x22;patterns/backend&#x22;,&#x22;target&#x22;:&#x22;patterns/error-handling&#x22;},{&#x22;source&#x22;:&#x22;patterns/code-quality&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/code-quality&#x22;,&#x22;target&#x22;:&#x22;patterns/refactoring&#x22;},{&#x22;source&#x22;:&#x22;patterns/code-quality&#x22;,&#x22;target&#x22;:&#x22;concepts/unit-testing&#x22;},{&#x22;source&#x22;:&#x22;patterns/code-quality&#x22;,&#x22;target&#x22;:&#x22;concepts/deep-modules&#x22;},{&#x22;source&#x22;:&#x22;patterns/concurrency&#x22;,&#x22;target&#x22;:&#x22;systems/distributed-systems&#x22;},{&#x22;source&#x22;:&#x22;patterns/concurrency&#x22;,&#x22;target&#x22;:&#x22;systems/scalability-reliability&#x22;},{&#x22;source&#x22;:&#x22;patterns/concurrency&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/database&#x22;,&#x22;target&#x22;:&#x22;systems/data-modeling&#x22;},{&#x22;source&#x22;:&#x22;patterns/database&#x22;,&#x22;target&#x22;:&#x22;systems/scalability-reliability&#x22;},{&#x22;source&#x22;:&#x22;patterns/database&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-behavioral&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-creational&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-behavioral&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-structural&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-behavioral&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-behavioral&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-skills&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-creational&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-creational&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-structural&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-creational&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-behavioral&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-structural&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-structural&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-creational&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-structural&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-behavioral&#x22;},{&#x22;source&#x22;:&#x22;patterns/design-patterns-structural&#x22;,&#x22;target&#x22;:&#x22;concepts/deep-modules&#x22;},{&#x22;source&#x22;:&#x22;patterns/error-handling&#x22;,&#x22;target&#x22;:&#x22;concepts/error-budget&#x22;},{&#x22;source&#x22;:&#x22;patterns/error-handling&#x22;,&#x22;target&#x22;:&#x22;concepts/self-healing-loop&#x22;},{&#x22;source&#x22;:&#x22;patterns/error-handling&#x22;,&#x22;target&#x22;:&#x22;patterns/api-design&#x22;},{&#x22;source&#x22;:&#x22;patterns/error-handling&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/frontend&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-behavioral&#x22;},{&#x22;source&#x22;:&#x22;patterns/frontend&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-structural&#x22;},{&#x22;source&#x22;:&#x22;patterns/frontend&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/principles&#x22;,&#x22;target&#x22;:&#x22;concepts/deep-modules&#x22;},{&#x22;source&#x22;:&#x22;patterns/principles&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-behavioral&#x22;},{&#x22;source&#x22;:&#x22;patterns/principles&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-structural&#x22;},{&#x22;source&#x22;:&#x22;patterns/principles&#x22;,&#x22;target&#x22;:&#x22;patterns/code-quality&#x22;},{&#x22;source&#x22;:&#x22;patterns/principles&#x22;,&#x22;target&#x22;:&#x22;patterns/refactoring&#x22;},{&#x22;source&#x22;:&#x22;patterns/refactoring&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;patterns/refactoring&#x22;,&#x22;target&#x22;:&#x22;patterns/code-quality&#x22;},{&#x22;source&#x22;:&#x22;patterns/refactoring&#x22;,&#x22;target&#x22;:&#x22;patterns/design-patterns-behavioral&#x22;},{&#x22;source&#x22;:&#x22;systems/architectural-patterns&#x22;,&#x22;target&#x22;:&#x22;systems/distributed-systems&#x22;},{&#x22;source&#x22;:&#x22;systems/architectural-patterns&#x22;,&#x22;target&#x22;:&#x22;concepts/agentic-cicd&#x22;},{&#x22;source&#x22;:&#x22;systems/architectural-patterns&#x22;,&#x22;target&#x22;:&#x22;systems/system-design-process&#x22;},{&#x22;source&#x22;:&#x22;systems/architectural-patterns&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;systems/data-modeling&#x22;,&#x22;target&#x22;:&#x22;systems/architectural-patterns&#x22;},{&#x22;source&#x22;:&#x22;systems/data-modeling&#x22;,&#x22;target&#x22;:&#x22;patterns/database&#x22;},{&#x22;source&#x22;:&#x22;systems/data-modeling&#x22;,&#x22;target&#x22;:&#x22;systems/scalability-reliability&#x22;},{&#x22;source&#x22;:&#x22;systems/distributed-systems&#x22;,&#x22;target&#x22;:&#x22;systems/scalability-reliability&#x22;},{&#x22;source&#x22;:&#x22;systems/distributed-systems&#x22;,&#x22;target&#x22;:&#x22;systems/architectural-patterns&#x22;},{&#x22;source&#x22;:&#x22;systems/distributed-systems&#x22;,&#x22;target&#x22;:&#x22;patterns/concurrency&#x22;},{&#x22;source&#x22;:&#x22;systems/distributed-systems&#x22;,&#x22;target&#x22;:&#x22;concepts/error-budget&#x22;},{&#x22;source&#x22;:&#x22;systems/distributed-systems&#x22;,&#x22;target&#x22;:&#x22;concepts/self-healing-loop&#x22;},{&#x22;source&#x22;:&#x22;systems/scalability-reliability&#x22;,&#x22;target&#x22;:&#x22;concepts/error-budget&#x22;},{&#x22;source&#x22;:&#x22;systems/scalability-reliability&#x22;,&#x22;target&#x22;:&#x22;systems/distributed-systems&#x22;},{&#x22;source&#x22;:&#x22;systems/scalability-reliability&#x22;,&#x22;target&#x22;:&#x22;patterns/database&#x22;},{&#x22;source&#x22;:&#x22;systems/scalability-reliability&#x22;,&#x22;target&#x22;:&#x22;concepts/self-healing-loop&#x22;},{&#x22;source&#x22;:&#x22;systems/scalability-reliability&#x22;,&#x22;target&#x22;:&#x22;concepts/agentic-cicd&#x22;},{&#x22;source&#x22;:&#x22;systems/system-design-process&#x22;,&#x22;target&#x22;:&#x22;systems/scalability-reliability&#x22;},{&#x22;source&#x22;:&#x22;systems/system-design-process&#x22;,&#x22;target&#x22;:&#x22;systems/architectural-patterns&#x22;},{&#x22;source&#x22;:&#x22;systems/system-design-process&#x22;,&#x22;target&#x22;:&#x22;systems/distributed-systems&#x22;},{&#x22;source&#x22;:&#x22;systems/system-design-process&#x22;,&#x22;target&#x22;:&#x22;patterns/api-design&#x22;},{&#x22;source&#x22;:&#x22;syntheses/agent-primitive-selection&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-skills&#x22;},{&#x22;source&#x22;:&#x22;syntheses/agent-primitive-selection&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-subagents&#x22;},{&#x22;source&#x22;:&#x22;syntheses/agent-primitive-selection&#x22;,&#x22;target&#x22;:&#x22;concepts/multi-vendor-adversarial-review&#x22;},{&#x22;source&#x22;:&#x22;syntheses/agent-primitive-selection&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;syntheses/agent-primitive-selection&#x22;,&#x22;target&#x22;:&#x22;concepts/verification-pipeline&#x22;},{&#x22;source&#x22;:&#x22;syntheses/desktop-control-plane&#x22;,&#x22;target&#x22;:&#x22;entities/pi-agent&#x22;},{&#x22;source&#x22;:&#x22;syntheses/desktop-control-plane&#x22;,&#x22;target&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;},{&#x22;source&#x22;:&#x22;syntheses/desktop-control-plane&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;,&#x22;target&#x22;:&#x22;concepts/verification-pipeline&#x22;},{&#x22;source&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-skills&#x22;},{&#x22;source&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;,&#x22;target&#x22;:&#x22;concepts/worktree-isolation&#x22;},{&#x22;source&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;,&#x22;target&#x22;:&#x22;concepts/multi-vendor-adversarial-review&#x22;},{&#x22;source&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;,&#x22;target&#x22;:&#x22;entities/opencode&#x22;},{&#x22;source&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;,&#x22;target&#x22;:&#x22;concepts/context-compression&#x22;},{&#x22;source&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-self-correction&#x22;},{&#x22;source&#x22;:&#x22;syntheses/lean-agentic-workflow&#x22;,&#x22;target&#x22;:&#x22;syntheses/agent-primitive-selection&#x22;},{&#x22;source&#x22;:&#x22;entities/opencode&#x22;,&#x22;target&#x22;:&#x22;concepts/context-compression&#x22;},{&#x22;source&#x22;:&#x22;entities/opencode&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-harness&#x22;},{&#x22;source&#x22;:&#x22;entities/pi-agent&#x22;,&#x22;target&#x22;:&#x22;concepts/multi-vendor-adversarial-review&#x22;},{&#x22;source&#x22;:&#x22;entities/pi-agent&#x22;,&#x22;target&#x22;:&#x22;entities/opencode&#x22;},{&#x22;source&#x22;:&#x22;entities/pi-agent&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-self-correction&#x22;},{&#x22;source&#x22;:&#x22;entities/ponytail&#x22;,&#x22;target&#x22;:&#x22;entities/opencode&#x22;},{&#x22;source&#x22;:&#x22;entities/ponytail&#x22;,&#x22;target&#x22;:&#x22;entities/pi-agent&#x22;},{&#x22;source&#x22;:&#x22;entities/ponytail&#x22;,&#x22;target&#x22;:&#x22;concepts/ai-specific-pitfalls&#x22;},{&#x22;source&#x22;:&#x22;entities/ponytail&#x22;,&#x22;target&#x22;:&#x22;concepts/model-task-routing&#x22;},{&#x22;source&#x22;:&#x22;entities/ponytail&#x22;,&#x22;target&#x22;:&#x22;patterns/principles&#x22;},{&#x22;source&#x22;:&#x22;entities/ponytail&#x22;,&#x22;target&#x22;:&#x22;concepts/agent-skills&#x22;}],CUR=&#x22;patterns/principles&#x22;,MAXD=3;
const C={concepts:'#8B7CF6',patterns:'#0D9373',systems:'#E0567C',syntheses:'#E2A03F',comparisons:'#3B82F6',entities:'#14B8A6',guides:'#9CA3AF'};
function lid(x){return (x&&x.id!==undefined)?x.id:x;}
const ADJ=new Map(NODES.map(function(n){return [n.id,new Set()];}));
LINKS.forEach(function(l){var s=lid(l.source),t=lid(l.target);if(ADJ.has(s)&&ADJ.has(t)){ADJ.get(s).add(t);ADJ.get(t).add(s);}});
var opt={ns:1.8,lw:0.6,ts:3.5,to:0.75,dp:2,ar:false};
function visible(){
if(!CUR)return {nodes:NODES,links:LINKS};
var dist=new Map([[CUR,0]]),fr=[CUR];
for(var d=1;d<=opt.dp;d++){var nx=[];fr.forEach(function(u){(ADJ.get(u)||[]).forEach(function(v){if(!dist.has(v)){dist.set(v,d);nx.push(v);}});});fr=nx;}
var keep=new Set(dist.keys());
return {nodes:NODES.filter(function(n){return keep.has(n.id);}),links:LINKS.filter(function(l){return keep.has(lid(l.source))&&keep.has(lid(l.target));})};
}
var el=document.getElementById('g');
var G=ForceGraph()(el).backgroundColor('#0f1117').nodeId('id')
.warmupTicks(24).cooldownTicks(70).autoPauseRedraw(true)
.nodeColor(function(n){return C[n.group]||'#9CA3AF';}).nodeLabel('label').nodeVal(function(n){return n.val;})
.linkColor(function(){return 'rgba(255,255,255,0.12)';})
.nodeRelSize(opt.ns).linkWidth(opt.lw)
.linkDirectionalArrowLength(0).linkDirectionalArrowRelPos(1).linkDirectionalArrowColor(function(){return 'rgba(255,255,255,0.4)';})
.nodeCanvasObjectMode(function(){return 'after';})
.nodeCanvasObject(function(n,ctx,scale){var r=opt.ns*Math.sqrt(n.val||1);
if(n.id===CUR){ctx.beginPath();ctx.arc(n.x,n.y,r+1.6,0,6.283);ctx.strokeStyle='#fff';ctx.lineWidth=1.2/scale;ctx.stroke();}
if(opt.to>0&&opt.ts>0){var t=n.label.length>28?n.label.slice(0,26)+'…':n.label;ctx.globalAlpha=opt.to;ctx.font=((n.id===CUR?opt.ts+1:opt.ts))+'px ui-sans-serif,sans-serif';ctx.fillStyle=(n.id===CUR)?'#ffffff':'#aab0c0';ctx.textAlign='center';ctx.textBaseline='top';ctx.fillText(t,n.x,n.y+r+1.5);ctx.globalAlpha=1;}})
.onNodeClick(function(n){if(window.top){window.top.location.href='/'+n.id;}});
G.graphData(visible());G.d3VelocityDecay(0.4);
function fit(){G.zoomToFit(400,20);}
setTimeout(fit,350);setTimeout(fit,1100);
// Stop the render/sim loop while idle so the fixed widget never repaints during
// parent-page scroll; resume only while the pointer is over the widget.
var pt;function pause(){G.pauseAnimation();}function resume(){G.resumeAnimation();}
function idle(ms){clearTimeout(pt);pt=setTimeout(pause,ms);}
document.body.addEventListener('pointerenter',function(){clearTimeout(pt);resume();});
document.body.addEventListener('pointerleave',function(){idle(250);});
addEventListener('resize',function(){resume();G.zoomToFit(0,20);idle(700);});
idle(2000);
function apply(re){resume();G.nodeRelSize(opt.ns).linkWidth(opt.lw).linkDirectionalArrowLength(opt.ar?2.6:0);if(re){G.graphData(visible());setTimeout(fit,450);}idle(re?2200:1400);}
function bind(id,key,fmt,re){var e=document.getElementById(id),o=document.getElementById('v'+id);e.value=opt[key];if(o)o.textContent=fmt(opt[key]);e.addEventListener('input',function(){opt[key]=parseFloat(e.value);if(o)o.textContent=fmt(opt[key]);apply(re);});}
bind('ns','ns',function(v){return v.toFixed(1);},false);
bind('lw','lw',function(v){return v.toFixed(1);},false);
bind('ts','ts',function(v){return v.toFixed(1);},false);
bind('to','to',function(v){return v.toFixed(2);},false);
var dE=document.getElementById('dp'),dO=document.getElementById('vd');dE.max=MAXD;dE.value=opt.dp;dO.textContent=opt.dp;dE.addEventListener('input',function(){opt.dp=parseInt(dE.value,10);dO.textContent=opt.dp;apply(true);});
if(!CUR)document.getElementById('depthRow').style.display='none';
var aE=document.getElementById('ar');aE.checked=opt.ar;aE.addEventListener('change',function(){opt.ar=aE.checked;apply(false);});
document.getElementById('gear').addEventListener('click',function(){document.getElementById('panel').classList.toggle('open');});
var hd=document.getElementById('hd');hd.textContent='⠿  '+(CUR?'Local graph':'Knowledge graph');
// free-form placement: drag by the header. Default is bottom-right (inline style);
// a moved position is saved per parent-origin and restored on every page.
function clampPos(fe,l,t){var TW=(window.top||window),r=fe.getBoundingClientRect();return [Math.min(Math.max(0,l),Math.max(0,TW.innerWidth-r.width)),Math.min(Math.max(0,t),Math.max(0,TW.innerHeight-r.height))];}
function place(fe,l,t){var p=clampPos(fe,l,t);fe.style.left=p[0]+'px';fe.style.top=p[1]+'px';fe.style.right='auto';fe.style.bottom='auto';}
try{var sp=JSON.parse(localStorage.getItem('llmwiki_graph_pos'));if(sp&&window.frameElement)place(window.frameElement,sp.l,sp.t);}catch(e){if(window.console)console.debug('graph: saved position unavailable',e);}
hd.addEventListener('pointerdown',function(e){var fe=window.frameElement;if(!fe)return;var rect=fe.getBoundingClientRect();var sx=e.screenX,sy=e.screenY,L=rect.left,T=rect.top;place(fe,L,T);hd.setPointerCapture(e.pointerId);
function mv(ev){place(fe,L+ev.screenX-sx,T+ev.screenY-sy);}
function up(){if(hd.hasPointerCapture(e.pointerId))hd.releasePointerCapture(e.pointerId);hd.removeEventListener('pointermove',mv);hd.removeEventListener('pointerup',up);try{localStorage.setItem('llmwiki_graph_pos',JSON.stringify({l:parseFloat(fe.style.left),t:parseFloat(fe.style.top)}));}catch(e2){if(window.console)console.debug('graph: could not persist position',e2);}}
hd.addEventListener('pointermove',mv);hd.addEventListener('pointerup',up);e.preventDefault();});
</script></body></html>"
  title="Knowledge graph"
  loading="lazy"
  style={{position:"fixed",right:"18px",bottom:"18px",width:"320px",height:"340px",border:0,borderRadius:"14px",boxShadow:"0 6px 28px rgba(0,0,0,0.38)",zIndex:50,background:"#0f1117"}}
/>
