Skip to content

Instantly share code, notes, and snippets.

View khandar-william's full-sized avatar

Khandar William khandar-william

View GitHub Profile

Clean Architecture

Source: Robert C. Martin, "The Clean Architecture" (2012). I wrote this from my knowledge of the article and did not fetch the page in this session. The code is my own illustration in Python and I did not run it.

The purpose

Clean Architecture divides software into layers. Each layer has one concern. The article lists five properties of a system that obeys the architecture:

  • Independent of frameworks. The framework is a tool. The system does not conform to the constraints of the framework.
  • Testable. You can test the business rules without the UI, the database, or the web server.

Catalog of Patterns of Enterprise Application Architecture

Compiled from Martin Fowler’s EAA catalog (published 5 March 2003; site design refreshed July 2024, content unchanged). Pattern text below is the catalog summary Fowler published for each pattern. Sketch GIFs on those pages are recreated here as Mermaid or ASCII diagrams.

The book Patterns of Enterprise Application Architecture is the full treatment. Each pattern links to the matching chapter on oreilly.com.

Fowler notes that many original Visio GIFs were later redrawn by David Heinemeier Hansson.

Five catalog pages have no sketch image: Client Session State, Server Session State, Database Session State, Layer Supertype, and Value Object. Those five use a reconstructed diagram marked as such.

Cordis is not a plugin host with a privileged core. It is a small runtime whose only unit of work is a plugin. This repo vendors that core as @deepseek-ai/cordis from packages/core on that tree. YAML loading is a separate plugin (@cordisjs/plugin-loader). The kernel would still work if you never used a config file.

The implementation is five mechanisms that lock together: a callback, a fiber, a proxied context, a reactive provide/inject graph, and effects.

1. A plugin is a callback, not a class hierarchy

The registry accepts three syntactic shapes and collapses them to one function:

export type Plugin<T = any> =

Dive into Claude Code: Core Technical Content

Reference: https://arxiv.org/pdf/2604.14228

Design Principles (Table 1)

Principle Values Served Design Question Sections
Deny-first with human escalation Authority, Safety Should unrecognized actions be allowed, blocked, or escalated to the human? 5, 8, 9
Graduated trust spectrum Authority, Adaptability Fixed permission level, or a spectrum users traverse over time? 5
name structurizr-architecture-as-code
description Generate Structurizr DSL (.dsl) from source code context. Comprehensive reference for Structurizr DSL syntax — workspace, model, views, styles, deployment, configuration, CLI. Use when asked to diagram, visualize, or document software architecture from code using C4 model.

Structurizr Architecture-as-Code Skill

Structurizr is the reference implementation of the C4 model, created by the C4 model's author (Simon Brown). You describe systems in .dsl files using the Structurizr DSL, and the tooling generates multiple diagram types from a single model.

Repository: https://github.com/structurizr/structurizr

@khandar-william
khandar-william / 01-skills-overview.md
Last active June 1, 2026 09:03
Hermes Agent exploration

Here is how Hermes Agent’s skills harness works end to end: what gets loaded when, how execution happens, and how you turn skills on or off.

Mental model

Skills are markdown playbooks (SKILL.md + optional references/, scripts/, etc.), not executable plugins. The harness does three jobs:

  1. Discover skills on disk and build a cheap catalog.
  2. Expose that catalog to the model (system prompt + tools + slash commands).
  3. Load full content on demand when the user or the model explicitly asks.
@khandar-william
khandar-william / 0-prompt.txt
Last active June 10, 2025 09:42
Sample Generated Technical Documentation
Write a Markdown file for technical documentation of "any-zkvm" library.
The goal of this document is to teach future engineers to understand and maintain this library correctly.
This document should also include {@docs: C4 Model} diagrams in {@docs: Mermaid} syntax at three different levels:
1. System context diagram
2. Container diagram
3. Component diagram

To find out where disk space is being used:

  1. use apt install ncdu

or

  1. Get to the root of your machine by running cd /
  2. Run sudo du -h --max-depth=1 | sort -rh
  3. Note which directories are using a lot of disk space.
  4. cd into one of the big directories.
// Tokopedia
function removeAdsType1() {
var adsType1 = document.querySelectorAll('a[label-atm="taProduct"]');
adsType1.forEach(function (e) {
e.parentNode.remove(e);
});
}
window.setInterval(removeAdsType1, 10000);
function removeAdsType2() {