/caddis:lld [app] [--page-id ID]from caddis
Write the living Low-Level Design (LLD) as Markdown in Git, publish it to Confluence with 2x Mermaid figures, and keep its generated db-catalog and data-lineage sections current
Ships in caddis. Installing the plugin adds it to Claude Code.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub saajunaid/caddis-plugin --plugin caddisThe LLD is the engineering document that the team keeps current while the app changes. It holds the components, the
process flow, the end-to-end sequence, the interface contracts, the ETL and refresh schedules, and two sections that a
script generates: the database catalog (db-catalog) and the data lineage matrix (data-lineage). It replaces the
legacy lld pool skill and the data-lineage skill.
docs/<app>/<app>-lld.md. Confluence is a copy.caddis_confluence.py. It turns each Mermaid block into a PNG attachment at 2x scale on a
white canvas (headless Microsoft Edge, msedge), uploads a figure only when its SHA-256 changed, and writes each
document into its own marked section of the page. Text outside the sections stays as it is.$ARGUMENTS: the app name and the Confluence page id. With no app, use the repo name. Ask for the page id only at
the dry-run step.CONFLUENCE_URL (https only) and CONFLUENCE_TOKEN. Never
print, echo or show the token.mermaid.min.js (CADDIS_MERMAID_JS). Prove the
login and the renderer with python "<home>/.caddis/bin/caddis_run.py" caddis_confluence.py check.docs/<app>/<app>-hla.md) when it exists, so that SYS_Lxx items map to its
SYS_xx systems.SYS_L01 ...) and
every internal interface (INT_L01 ...) with a proposed Impacted value, and a style class for each component. Ask the
person to confirm or correct it in one turn. In a headless run (CADDIS_HEADLESS set), draw the figures with the
proposed classes, write the document with Status: Draft (classification not confirmed) and stop before step 5.docs/<app>/<app>-lld.md from the template below. Do not invent a route, a table or a schedule that the
code does not show; write it as an open question instead.python "<home>/.caddis/bin/caddis_run.py" caddis_confluence.py render-diagrams --input docs/<app>/<app>-lld.md --slug lld --out-dir <scratch folder>.
Fix the Mermaid source of every FAIL line.python "<home>/.caddis/bin/caddis_run.py" caddis_confluence.py publish --page-id <ID> --slug lld --input docs/<app>/<app>-lld.md --dry-run.
Show the ACTION:, PAGE: and FIGURES: lines.--dry-run. Report the ACTION:, PAGE: and UPLOADED: lines.docs/<app>/<app>-data-lineage.md (the matrix below, one row per UI dataset).
Run the publish below with --dry-run first, then without it, to the same page:
python "<home>/.caddis/bin/caddis_run.py" caddis_confluence.py publish --page-id <ID> --slug data-lineage --input docs/<app>/<app>-data-lineage.md.db-catalog section current, and no person edits it.Stop at the first step that does not exit 0, and report its output.
The LLD page holds three marked sections. Each has its own markers and its own anti-overwrite check:
| Slug | Source | Who writes it |
|---|---|---|
lld | docs/<app>/<app>-lld.md | /lld (a person reviews it) |
data-lineage | docs/<app>/<app>-data-lineage.md | /lld step 7, generated from the code |
db-catalog | the app's catalog generator output | the post-deploy hook, never a person |
The data lineage matrix follows one dataset from end to end: domain -> source -> staging -> SP -> mart -> API -> UI.
| Domain | Source | Staging | Stored procedure | Mart | API route | UI page |
|---|---|---|---|---|---|---|
db-catalog publishRun it in the app pipeline after deploy_prod succeeds and the health check passes. Run the app's own catalog
generator first (for example its generate_db_catalog.py; its flags belong to the app), then:
CADDIS_HEADLESS=1 python "<home>/.caddis/bin/caddis_run.py" caddis_confluence.py publish-catalog --page-id <ID> --slug db-catalog \
--input build/db-catalog/summary.md \
--attach build/db-catalog/db-catalog.json --attach build/db-catalog/db-catalog.csv \
--state-hash-file .caddis/state/db-catalog.sha256
--attach file. The section shows that hash, and a link and a hash for
each file.--state-hash-file holds the same hash, the run ends before any request: ACTION: unchanged. A CI runner
without a kept state file still makes no write: the live section and each attachment comment
(caddis sha256:<hex>) are compared first.db-catalog section is rewritten
(ACTION: add or update). When only an attachment is missing on the page, only that file is uploaded
(ACTION: attachments).db-catalog section in Confluence (the diff is printed). Do not fail the release
on it: run the step with continue-on-error and report it. A person removes the edit, then the next deploy publishes.., - and _.| Exit | Meaning | What to do |
|---|---|---|
| 0 | Published, or unchanged | Nothing |
| 1 | Refused: a person edited the section in Confluence (a unified diff follows), a figure failed its check, or Confluence refused | Diff: copy the person's change into the Markdown; then a person publishes with --force-overwrite (the live hash still differs from the marker). Figure: fix the Mermaid source |
| 3 | Not configured, the renderer is missing, or the network failed | Add the keys, install the renderer, or try again later |
| 4 | Bad input: the slug, the page id, a file or an attachment name | Fix the command |
A person (never an agent, and never with CADDIS_HEADLESS set) may pass --force-overwrite after reading the diff.
flowchart LR for a process flow, flowchart TB for a topology and sequenceDiagram with
autonumber for the end-to-end sequence. Keep a figure to about 12 nodes.SYS_L01, SYS_L02 ... and edge labels start with INT_L01, INT_L02 ... Wrap label lines at about
40 characters with <br/>.existingStyle, newStyle, changedStyle, externalStyle, dataStyle or
retiredStyle (see /hla). The engine adds the class definition when the figure does not define it.# Low-Level Design (LLD): <Application name>
## Document information
| Field | Value |
|---|---|
| Status | Draft |
| Version | 0.1 |
| Owner | <name or team> |
| HLA | <link to the HLA page> |
## 1. Components and service topology
```mermaid
flowchart TB
SYS_L01["SYS_L01: Web UI<br/>React, served by IIS"]:::newStyle
SYS_L02["SYS_L02: API service<br/>FastAPI, Windows service"]:::newStyle
SYS_L03["SYS_L03: Refresh worker<br/>Python, scheduled task"]:::newStyle
SYS_L04["SYS_L04: Application database<br/>SQL Server"]:::dataStyle
SYS_L05["SYS_L05: Source database<br/>Existing"]:::existingStyle
SYS_L01 -->|"INT_L01: REST calls<br/>HTTPS, JSON"| SYS_L02
SYS_L02 -->|"INT_L02: read marts<br/>SQL"| SYS_L04
SYS_L03 -->|"INT_L03: extract<br/>SQL, watermark"| SYS_L05
SYS_L03 -->|"INT_L04: load staging<br/>SQL"| SYS_L04
```
| ID | Component | Runtime | Host and process | Port | Impacted |
|---|---|---|---|---|---|
| SYS_L01 | Web UI | <Runtime> | <Host, process> | <Port> | Yes |
| SYS_L02 | API service | <Runtime> | <Host, process> | <Port> | Yes |
## 2. Operational process flow
```mermaid
flowchart LR
SYS_L05["SYS_L05: Source database"]:::existingStyle -->|"INT_L03: extract"| SYS_L03["SYS_L03: Refresh worker"]:::newStyle
SYS_L03 -->|"INT_L04: load and validate"| SYS_L04["SYS_L04: Staging and marts"]:::dataStyle
SYS_L04 -->|"INT_L02: serve"| SYS_L02["SYS_L02: API service"]:::newStyle
```
1. **Extract:** <What runs, when, and what it reads.>
2. **Load and validate:** <Checks, and what happens to a bad row.>
3. **Serve:** <Which routes read which marts.>
## 3. End-to-end sequence
```mermaid
sequenceDiagram
autonumber
participant UI as SYS_L01 Web UI
participant API as SYS_L02 API service
participant DB as SYS_L04 Application database
UI->>API: INT_L01 GET /api/orders
API->>DB: INT_L02 read the orders mart
DB-->>API: rows
API-->>UI: JSON page of orders
```
## 4. Interfaces and API contracts
| ID | From | To | Method and route | Contract | Auth | Errors |
|---|---|---|---|---|---|---|
| INT_L01 | SYS_L01 | SYS_L02 | GET /api/orders | OpenAPI: <path to openapi.json> | <Auth> | <Codes> |
## 5. ETL, refresh schedules and watermarks
| Job | Schedule | Source | Target | Watermark | Idempotency | Volume |
|---|---|---|---|---|---|---|
| <Job> | <Cron or trigger> | <Source> | <Target> | <Column and rule> | <Rule> | <Rows per run> |
## 6. Stored procedures
| Procedure | Parameters | Reads | Writes | Called by |
|---|---|---|---|---|
| <Procedure> | <Parameters> | <Tables> | <Tables> | <Job or route> |
## 7. Reliability and recovery
| Failure | Detection | Automatic action | Person action |
|---|---|---|---|
| <Failure> | <Alert or check> | <Retry rule> | <Runbook step> |
## 8. Open questions
| ID | Question | Owner | Status |
|---|---|---|---|
| Q1 | <A route, table or schedule the code does not show> | <Owner> | Open |
## 9. Generated sections
The database catalog (`db-catalog`) and the data lineage matrix (`data-lineage`) are separate marked sections on this
page. Scripts write them. Do not copy them into this file.
caddis-doc-<slug>-start-<hash8> to caddis-doc-<slug>-end) in Confluence:
the next publish refuses with a diff. Write comments and other text outside the markers./hla owns the board view: context, NFRs, security and rollback. Link to it; do not copy it.44 commands in this plugin
/add-rules/add-rules — add canonical rules to a folderCreate canonical rules for ANY folder — write <folder>/AGENTS.md (from the folder template) + a <folder>/CLAUDE.md @import shim. For folders the stack-map generator doesn't cover./catchup/catchup — where are we?Where were we? A quick list of what this session was doing and what is still open/cloud-phases/caddis:cloud-phases — run plan phases in the cloud, then take them backRun plan phases in Claude Code cloud sessions — write one prompt per phase, push, hand out paste lines, then take the PRs back/coordinate/coordinate — the coordinator session for one repoRun this session as the repo's coordinator — one merge queue for all sessions, one merge at a time, a deploy check after each merge, routine approvals in the ledger./cross-review/caddis:cross-review — a second-vendor set of eyes on your diffCross-vendor code review of the current diff — a second-vendor model (agy Carbon by default; DeepSeek, GLM or any OpenAI-compatible endpoint) reviews your changes to catch bugs a same-vendor reviewer misses/data-lineage/data-lineage (deprecated): use /lldDeprecated: use /lld. Redirects to /lld, which publishes through caddis_confluence.py