# tegarthegreat/supermd architecture

> Architecture diagram of the GitHub repository tegarthegreat/supermd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tegarthegreat/supermd
- Repository: https://github.com/tegarthegreat/supermd

## Overview

SuperMD is a bilingual, Markdown-based anti-slop prompt system with a CLI and importable prompt-composition and text-scanning libraries. The main workflow is to select a language, profession, and optional style; compose the matching prompt layers; then use that prompt in an AI system message. Its separate `check` workflow scans supplied text for known patterns. The graph reflects the sampled runtime and README capabilities; it does not map the unsampled evaluation harness or detail individual profession modules.

Main entry points: [`lib/compose.mjs`](https://github.com/tegarthegreat/supermd/blob/main/lib/compose.mjs) (Prompt composer), [`bin/supermd.mjs`](https://github.com/tegarthegreat/supermd/blob/main/bin/supermd.mjs) (SuperMD CLI), [`lib/slop-scan.mjs`](https://github.com/tegarthegreat/supermd/blob/main/lib/slop-scan.mjs) (Slop scanner), [`en/adapters/UNIVERSAL-ADAPTER.md`](https://github.com/tegarthegreat/supermd/blob/main/en/adapters/UNIVERSAL-ADAPTER.md) (Universal adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Prompt content"]
  node_adapter["Universal adapter"]
  node_core["Universal core<br/>[SUPERMD.md]"]
  node_domains["Profession modules"]
  node_styles["Writing styles"]
  node_prompt["Composed prompt"]
end

subgraph group_runtime["CLI and composition"]
  node_cli["SuperMD CLI<br/>[supermd.mjs]"]
  node_composer["Prompt composer<br/>[compose.mjs]"]
  node_catalog["Profession catalog<br/>[compose.mjs]"]
end

subgraph group_quality["Slop detection"]
  node_scanner["Slop scanner<br/>[slop-scan.mjs]"]
  node_lexicon["Pattern lexicon<br/>[lexicon.json]"]
  node_findings["Scan findings"]
end

node_user(("Prompt author"))
node_text["Text to check"]

node_user -->|"runs commands"| node_cli
node_cli -->|"composes prompts"| node_composer
node_cli -->|"lists fields"| node_catalog
node_cli -->|"checks text"| node_scanner
node_composer -->|"resolves fields"| node_catalog
node_composer -->|"reads core"| node_core
node_composer -->|"reads field modules"| node_domains
node_composer -->|"reads style"| node_styles
node_composer -->|"reads adapter"| node_adapter
node_composer -->|"assembles layers"| node_prompt
node_user -->|"supplies text"| node_text
node_text -->|"is checked by"| node_cli
node_scanner -->|"loads patterns"| node_lexicon
node_scanner -->|"returns matches"| node_findings

click node_cli "https://github.com/tegarthegreat/supermd/blob/main/bin/supermd.mjs"
click node_composer "https://github.com/tegarthegreat/supermd/blob/main/lib/compose.mjs"
click node_catalog "https://github.com/tegarthegreat/supermd/blob/main/lib/compose.mjs"
click node_adapter "https://github.com/tegarthegreat/supermd/blob/main/en/adapters/UNIVERSAL-ADAPTER.md"
click node_core "https://github.com/tegarthegreat/supermd/blob/main/en/SUPERMD.md"
click node_domains "https://github.com/tegarthegreat/supermd/tree/main/en/domains"
click node_styles "https://github.com/tegarthegreat/supermd/tree/main/en/styles"
click node_scanner "https://github.com/tegarthegreat/supermd/blob/main/lib/slop-scan.mjs"
click node_lexicon "https://github.com/tegarthegreat/supermd/blob/main/eval/lexicon.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_adapter,node_core,node_domains,node_styles,node_prompt toneBlue
class node_cli,node_composer,node_catalog toneAmber
class node_scanner,node_lexicon,node_findings toneMint
class node_user,node_text toneIndigo
```

## Components

### Prompt content

- [Universal adapter](https://github.com/tegarthegreat/supermd/blob/main/en/adapters/UNIVERSAL-ADAPTER.md): `en/adapters/UNIVERSAL-ADAPTER.md`
- [Universal core](https://github.com/tegarthegreat/supermd/blob/main/en/SUPERMD.md): `en/SUPERMD.md`
- [Profession modules](https://github.com/tegarthegreat/supermd/tree/main/en/domains): `en/domains`
- [Writing styles](https://github.com/tegarthegreat/supermd/tree/main/en/styles): `en/styles`
- **Composed prompt**

### CLI and composition

- [SuperMD CLI](https://github.com/tegarthegreat/supermd/blob/main/bin/supermd.mjs): `bin/supermd.mjs`
- [Prompt composer](https://github.com/tegarthegreat/supermd/blob/main/lib/compose.mjs): `lib/compose.mjs`
- [Profession catalog](https://github.com/tegarthegreat/supermd/blob/main/lib/compose.mjs): `lib/compose.mjs`

### Slop detection

- [Slop scanner](https://github.com/tegarthegreat/supermd/blob/main/lib/slop-scan.mjs): `lib/slop-scan.mjs`
- [Pattern lexicon](https://github.com/tegarthegreat/supermd/blob/main/eval/lexicon.json): `eval/lexicon.json`
- **Scan findings**

### Other components

- **Prompt author**
- **Text to check**

## Connections

- Prompt author → SuperMD CLI: runs commands (evidence: `README.md`)
- SuperMD CLI → Prompt composer: composes prompts (evidence: `bin/supermd.mjs`)
- SuperMD CLI → Profession catalog: lists fields (evidence: `bin/supermd.mjs`)
- SuperMD CLI → Slop scanner: checks text (evidence: `bin/supermd.mjs`)
- Prompt composer → Profession catalog: resolves fields (evidence: `lib/compose.mjs`)
- Prompt composer → Universal core: reads core (evidence: `lib/compose.mjs`)
- Prompt composer → Profession modules: reads field modules (evidence: `lib/compose.mjs`)
- Prompt composer → Writing styles: reads style (evidence: `lib/compose.mjs`)
- Prompt composer → Universal adapter: reads adapter (evidence: `lib/compose.mjs`)
- Prompt composer → Composed prompt: assembles layers (evidence: `lib/compose.mjs`)
- Prompt author → Text to check: supplies text (evidence: `README.md`)
- Text to check → SuperMD CLI: is checked by (evidence: `README.md`)
- Slop scanner → Pattern lexicon: loads patterns (evidence: `lib/slop-scan.mjs`)
- Slop scanner → Scan findings: returns matches (evidence: `lib/slop-scan.mjs`)
