Turn complex codebases into clear, navigable architecture diagrams with Claude Code.
TypeScript aiarchitectureclaude-codeclaude-code-skillclicodebase-visualizationdeveloper-toolsdiagramsdocumentationmermaid
Release v0.2.0 — Perspective Class Tree (#17)
김승진724b517684ab
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex b3face1..b843d90 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -7,7 +7,7 @@{"name": "oh-my-mermaid","description": "Turn complex codebases into clear, navigable architecture diagrams with Mermaid",- "version": "0.1.8",+ "version": "0.2.0","source": "./","category": "development","homepage": "https://github.com/oh-my-mermaid/oh-my-mermaid"diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 75e58fd..7ae9b6b 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "oh-my-mermaid","description": "Turn complex codebases into clear, navigable architecture diagrams",- "version": "0.1.8",+ "version": "0.2.0","author": {"name": "oh-my-mermaid"},diff --git a/.omm/cli-commands/constraint.md b/.omm/cli-commands/constraint.mddeleted file mode 100644index 7302b7f..0000000--- a/.omm/cli-commands/constraint.md+++ /dev/null@@ -1,3 +0,0 @@-- Class-field pattern (`omm <class> <field>`) requires at least 2 args; first arg must NOT be a global command keyword-- Valid fields: description, diagram, constraint, concern, context, todo, note (enforced by `VALID_FIELDS` in types.ts)-- When field is `-`, content is read from stdin — critical for multi-line heredoc writes from Claudediff --git a/.omm/cli-commands/description.md b/.omm/cli-commands/description.mddeleted file mode 100644index 2b020fe..0000000--- a/.omm/cli-commands/description.md+++ /dev/null@@ -1 +0,0 @@-Covers how `omm` CLI dispatches commands and how class-field writes work. Read this if you want to add a new command or understand the class-field pattern.diff --git a/.omm/cli-commands/diagram.mmd b/.omm/cli-commands/diagram.mmddeleted file mode 100644index 3604aca..0000000--- a/.omm/cli-commands/diagram.mmd+++ /dev/null@@ -1,12 +0,0 @@-graph TD- classDef entry fill:#89b4fa,stroke:#89b4fa,color:#1e1e2e-- cli["omm CLI Entry\nsrc/cli.ts"]:::entry- cli -->|"global commands"| global["Global Commands\ninit / list / show / delete\nstatus / diff / refs / serve"]- cli -->|"cloud commands"| cloud_cmds["Cloud Commands\nlogin / logout / push / pull\nlink / share"]- cli -->|"omm <class> <field>"| class_field["Class-Field Command\nsrc/commands/class-field.ts"]- class_field -->|"stdin (-) or inline"| read_content["Read Content\nstdin piped or args"]- class_field -->|"write field"| store["Store Write\nsrc/lib/store.ts"]- class_field -->|"validate"| types["Field Validation\nsrc/types.ts"]- global -->|"reads"| store- cloud_cmds -->|"auth + HTTP"| cloud_lib["Cloud Client\nsrc/lib/cloud.ts"]diff --git a/.omm/cli-commands/meta.yaml b/.omm/cli-commands/meta.yamldeleted file mode 100644index 474c991..0000000--- a/.omm/cli-commands/meta.yaml+++ /dev/null@@ -1,6 +0,0 @@-created: 2026-03-22T06:05:52.486Z-updated: 2026-03-22T06:05:58.024Z-update_count: 4-last_field: note-git_commit: 55c1fe5-git_branch: maindiff --git a/.omm/cli-commands/note.md b/.omm/cli-commands/note.mddeleted file mode 100644index 855ea53..0000000--- a/.omm/cli-commands/note.md+++ /dev/null@@ -1 +0,0 @@-The class-field dispatch is a catch-all `default` case in the switch: any unknown first arg is treated as a class name. This means typos in command names silently become class names. Intentional design — keeps the API simple.diff --git a/.omm/command-surface/class-field/description.md b/.omm/command-surface/class-field/description.mdnew file mode 100644index 0000000..53d9b45--- /dev/null+++ b/.omm/command-surface/class-field/description.md@@ -0,0 +1 @@+Fallback handler for `omm <class> <field> [content]`. Without content: reads the field to stdout. With content or `-` (stdin): writes the field to .omm/<class>/<field-file>. Supports all 7 fields: description, diagram, constraint, concern, context, todo, note.diff --git a/.omm/command-surface/class-field/meta.yaml b/.omm/command-surface/class-field/meta.yamlnew file mode 100644index 0000000..c55a727--- /dev/null+++ b/.omm/command-surface/class-field/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:30:33.312Z+updated: 2026-03-25T12:30:33.312Z+update_count: 1+last_field: description+kind: nested-class+title: class-field+children: []+parentPath: []diff --git a/.omm/command-surface/delete/description.md b/.omm/command-surface/delete/description.mdnew file mode 100644index 0000000..833dc64--- /dev/null+++ b/.omm/command-surface/delete/description.md@@ -0,0 +1 @@+Removes a class directory and all its fields from .omm/. Irreversible.diff --git a/.omm/command-surface/delete/meta.yaml b/.omm/command-surface/delete/meta.yamlnew file mode 100644index 0000000..5653d09--- /dev/null+++ b/.omm/command-surface/delete/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:05.926Z+updated: 2026-03-25T12:29:05.927Z+update_count: 1+last_field: description+kind: nested-class+title: delete+children: []+parentPath: []diff --git a/.omm/command-surface/description.md b/.omm/command-surface/description.mdnew file mode 100644index 0000000..5c6c341--- /dev/null+++ b/.omm/command-surface/description.md@@ -0,0 +1 @@+The omm CLI exposes 19 commands organized into four groups: local operations (init, list, show, delete, status), query operations (diff, refs, validate), cloud operations (login, logout, link, push, pull, share, org), and integration operations (setup, update, view). A fallback pattern `omm <class> <field> [content]` handles direct field read/write. Dispatch is a switch statement in src/cli.ts with no subcommand framework.diff --git a/.omm/command-surface/diagram.mmd b/.omm/command-surface/diagram.mmdnew file mode 100644index 0000000..bdf6668--- /dev/null+++ b/.omm/command-surface/diagram.mmd@@ -0,0 +1,25 @@+graph TD+ omm["omm\nCLI entry"]++ omm -->|"local"| init["init\nomm init"]+ omm -->|"local"| list["list\nomm list"]+ omm -->|"local"| show["show\nomm show <class>"]+ omm -->|"local"| delete["delete\nomm delete <class>"]+ omm -->|"local"| status["status\nomm status"]+ omm -->|"query"| diff["diff\nomm diff <class>"]+ omm -->|"query"| refs["refs\nomm refs [--reverse] <class>"]+ omm -->|"query"| validate["validate\nomm validate [class]"]+ omm -->|"viewer"| view["view\nomm view [--port N]"]+ omm -->|"cloud"| login["login\nomm login"]+ omm -->|"cloud"| logout["logout\nomm logout"]+ omm -->|"cloud"| link["link\nomm link [org/slug]"]+ omm -->|"cloud"| push["push\nomm push"]+ omm -->|"cloud"| pull["pull\nomm pull"]+ omm -->|"cloud"| share["share\nomm share"]+ omm -->|"cloud"| org["org\nomm org <sub>"]+ omm -->|"integration"| setup["setup\nomm setup [platform]"]+ omm -->|"integration"| update["update\nomm update"]+ omm -->|"fallback"| class-field["class-field\nomm <class> <field> [content]"]++ classDef entry fill:#89b4fa,stroke:#89b4fa,color:#1e1e2e+ class omm entrydiff --git a/.omm/command-surface/diff/description.md b/.omm/command-surface/diff/description.mdnew file mode 100644index 0000000..a593b90--- /dev/null+++ b/.omm/command-surface/diff/description.md@@ -0,0 +1 @@+Compares the current diagram against the previously saved version (stored in meta.prev_diagram). Shows added/removed nodes and edges.diff --git a/.omm/command-surface/diff/meta.yaml b/.omm/command-surface/diff/meta.yamlnew file mode 100644index 0000000..15f6138--- /dev/null+++ b/.omm/command-surface/diff/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:18.295Z+updated: 2026-03-25T12:29:18.296Z+update_count: 1+last_field: description+kind: nested-class+title: diff+children: []+parentPath: []diff --git a/.omm/command-surface/init/description.md b/.omm/command-surface/init/description.mdnew file mode 100644index 0000000..1f6c08e--- /dev/null+++ b/.omm/command-surface/init/description.md@@ -0,0 +1 @@+Creates the .omm/ directory and config.yaml with default version. Usually not needed since write operations auto-create via lazy-init.diff --git a/.omm/command-surface/init/meta.yaml b/.omm/command-surface/init/meta.yamlnew file mode 100644index 0000000..3c99d38--- /dev/null+++ b/.omm/command-surface/init/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:28:48.788Z+updated: 2026-03-25T12:28:48.789Z+update_count: 1+last_field: description+kind: nested-class+title: init+children: []+parentPath: []diff --git a/.omm/command-surface/link/description.md b/.omm/command-surface/link/description.mdnew file mode 100644index 0000000..b4bb04f--- /dev/null+++ b/.omm/command-surface/link/description.md@@ -0,0 +1 @@+Associates the local project with a cloud project slug. Writes the slug (and optional org_slug) to .omm/config.yaml under the cloud section. Required before push/pull.diff --git a/.omm/command-surface/link/meta.yaml b/.omm/command-surface/link/meta.yamlnew file mode 100644index 0000000..bffcc2b--- /dev/null+++ b/.omm/command-surface/link/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:53.188Z+updated: 2026-03-25T12:29:53.189Z+update_count: 1+last_field: description+kind: nested-class+title: link+children: []+parentPath: []diff --git a/.omm/command-surface/list/description.md b/.omm/command-surface/list/description.mdnew file mode 100644index 0000000..96f3d6f--- /dev/null+++ b/.omm/command-surface/list/description.md@@ -0,0 +1 @@+Lists all class directories in .omm/ sorted alphabetically. Outputs one class name per line.diff --git a/.omm/command-surface/list/meta.yaml b/.omm/command-surface/list/meta.yamlnew file mode 100644index 0000000..a21f593--- /dev/null+++ b/.omm/command-surface/list/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:28:54.204Z+updated: 2026-03-25T12:28:54.205Z+update_count: 1+last_field: description+kind: nested-class+title: list+children: []+parentPath: []diff --git a/.omm/command-surface/login/description.md b/.omm/command-surface/login/description.mdnew file mode 100644index 0000000..76efde9--- /dev/null+++ b/.omm/command-surface/login/description.md@@ -0,0 +1 @@+Authenticates with ohmymermaid.com via browser OAuth flow. Stores token and handle in ~/.omm/credentials.json.diff --git a/.omm/command-surface/login/meta.yaml b/.omm/command-surface/login/meta.yamlnew file mode 100644index 0000000..bd7d7e2--- /dev/null+++ b/.omm/command-surface/login/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:43.274Z+updated: 2026-03-25T12:29:43.276Z+update_count: 1+last_field: description+kind: nested-class+title: login+children: []+parentPath: []diff --git a/.omm/command-surface/logout/description.md b/.omm/command-surface/logout/description.mdnew file mode 100644index 0000000..5daab90--- /dev/null+++ b/.omm/command-surface/logout/description.md@@ -0,0 +1 @@+Removes the authentication token from ~/.omm/credentials.json.diff --git a/.omm/command-surface/logout/meta.yaml b/.omm/command-surface/logout/meta.yamlnew file mode 100644index 0000000..9d57f15--- /dev/null+++ b/.omm/command-surface/logout/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:48.005Z+updated: 2026-03-25T12:29:48.006Z+update_count: 1+last_field: description+kind: nested-class+title: logout+children: []+parentPath: []diff --git a/.omm/command-surface/meta.yaml b/.omm/command-surface/meta.yamlnew file mode 100644index 0000000..e46d558--- /dev/null+++ b/.omm/command-surface/meta.yaml@@ -0,0 +1,27 @@+created: 2026-03-25T12:28:30.340Z+updated: 2026-03-25T12:28:36.687Z+update_count: 2+last_field: description+git_commit: 2fb887a+git_branch: main+children:+ - class-field+ - delete+ - diff+ - init+ - link+ - list+ - login+ - logout+ - omm+ - org+ - pull+ - push+ - refs+ - setup+ - share+ - show+ - status+ - update+ - validate+ - viewdiff --git a/.omm/command-surface/omm/description.md b/.omm/command-surface/omm/description.mdnew file mode 100644index 0000000..5470105--- /dev/null+++ b/.omm/command-surface/omm/description.md@@ -0,0 +1 @@+CLI entry point (src/cli.ts). Parses process.argv, matches the first argument against known command names, and dispatches to the corresponding handler. Falls through to class-field handler for unknown commands with 2+ args. Prints help on no args or --help.diff --git a/.omm/command-surface/omm/meta.yaml b/.omm/command-surface/omm/meta.yamlnew file mode 100644index 0000000..5735024--- /dev/null+++ b/.omm/command-surface/omm/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:28:42.579Z+updated: 2026-03-25T12:28:42.586Z+update_count: 1+last_field: description+kind: nested-class+title: omm+children: []+parentPath: []diff --git a/.omm/command-surface/org/description.md b/.omm/command-surface/org/description.mdnew file mode 100644index 0000000..306ee69--- /dev/null+++ b/.omm/command-surface/org/description.md@@ -0,0 +1 @@+Organization management subcommands: `list` shows your orgs, `switch <slug>` sets the default org in credentials, `members [slug]` opens the web members page.diff --git a/.omm/command-surface/org/meta.yaml b/.omm/command-surface/org/meta.yamlnew file mode 100644index 0000000..43795e8--- /dev/null+++ b/.omm/command-surface/org/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:30:15.088Z+updated: 2026-03-25T12:30:15.089Z+update_count: 1+last_field: description+kind: nested-class+title: org+children: []+parentPath: []diff --git a/.omm/command-surface/pull/description.md b/.omm/command-surface/pull/description.mdnew file mode 100644index 0000000..9159c56--- /dev/null+++ b/.omm/command-surface/pull/description.md@@ -0,0 +1 @@+Downloads .omm/ files from the cloud API. Fetches from /api/pull with the project slug and writes each file locally after path-safety validation via resolvePullDestination().diff --git a/.omm/command-surface/pull/meta.yaml b/.omm/command-surface/pull/meta.yamlnew file mode 100644index 0000000..b837631--- /dev/null+++ b/.omm/command-surface/pull/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:30:03.484Z+updated: 2026-03-25T12:30:03.485Z+update_count: 1+last_field: description+kind: nested-class+title: pull+children: []+parentPath: []diff --git a/.omm/command-surface/push/description.md b/.omm/command-surface/push/description.mdnew file mode 100644index 0000000..d8b2499--- /dev/null+++ b/.omm/command-surface/push/description.md@@ -0,0 +1 @@+Uploads all .omm/ files to the cloud API. Walks the directory tree, reads each file, and POSTs them to /api/push with the project slug and git commit hash.diff --git a/.omm/command-surface/push/meta.yaml b/.omm/command-surface/push/meta.yamlnew file mode 100644index 0000000..65508a5--- /dev/null+++ b/.omm/command-surface/push/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:58.185Z+updated: 2026-03-25T12:29:58.186Z+update_count: 1+last_field: description+kind: nested-class+title: push+children: []+parentPath: []diff --git a/.omm/command-surface/refs/description.md b/.omm/command-surface/refs/description.mdnew file mode 100644index 0000000..7131d05--- /dev/null+++ b/.omm/command-surface/refs/description.md@@ -0,0 +1 @@+Shows cross-references for a class. Default: classes that reference this one (incoming). With --reverse: classes this one references (outgoing). Uses @mentions in diagram text.diff --git a/.omm/command-surface/refs/meta.yaml b/.omm/command-surface/refs/meta.yamlnew file mode 100644index 0000000..6bc6124--- /dev/null+++ b/.omm/command-surface/refs/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:23.928Z+updated: 2026-03-25T12:29:23.929Z+update_count: 1+last_field: description+kind: nested-class+title: refs+children: []+parentPath: []diff --git a/.omm/command-surface/setup/description.md b/.omm/command-surface/setup/description.mdnew file mode 100644index 0000000..22fbda7--- /dev/null+++ b/.omm/command-surface/setup/description.md@@ -0,0 +1 @@+Registers omm skills/plugins with AI coding tools. Auto-detects installed platforms, or targets a specific one via `omm setup <platform>`. Supports --list (show detected) and --teardown (unregister all).diff --git a/.omm/command-surface/setup/meta.yaml b/.omm/command-surface/setup/meta.yamlnew file mode 100644index 0000000..54c156b--- /dev/null+++ b/.omm/command-surface/setup/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:30:21.322Z+updated: 2026-03-25T12:30:21.323Z+update_count: 1+last_field: description+kind: nested-class+title: setup+children: []+parentPath: []diff --git a/.omm/command-surface/share/description.md b/.omm/command-surface/share/description.mdnew file mode 100644index 0000000..d1789d3--- /dev/null+++ b/.omm/command-surface/share/description.md@@ -0,0 +1 @@+Prints the shareable URL for the project on ohmymermaid.com based on the linked slug and org from config.yaml.diff --git a/.omm/command-surface/share/meta.yaml b/.omm/command-surface/share/meta.yamlnew file mode 100644index 0000000..0f453c3--- /dev/null+++ b/.omm/command-surface/share/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:30:08.825Z+updated: 2026-03-25T12:30:08.826Z+update_count: 1+last_field: description+kind: nested-class+title: share+children: []+parentPath: []diff --git a/.omm/command-surface/show/description.md b/.omm/command-surface/show/description.mdnew file mode 100644index 0000000..2b1c358--- /dev/null+++ b/.omm/command-surface/show/description.md@@ -0,0 +1 @@+Reads and displays all fields (description, diagram, constraint, concern, context, todo, note) and metadata for a single class.diff --git a/.omm/command-surface/show/meta.yaml b/.omm/command-surface/show/meta.yamlnew file mode 100644index 0000000..ee6c3ca--- /dev/null+++ b/.omm/command-surface/show/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:00.391Z+updated: 2026-03-25T12:29:00.392Z+update_count: 1+last_field: description+kind: nested-class+title: show+children: []+parentPath: []diff --git a/.omm/command-surface/status/description.md b/.omm/command-surface/status/description.mdnew file mode 100644index 0000000..f9215a5--- /dev/null+++ b/.omm/command-surface/status/description.md@@ -0,0 +1 @@+Prints an overview table of all classes with field counts, last-updated timestamps, and update counts.diff --git a/.omm/command-surface/status/meta.yaml b/.omm/command-surface/status/meta.yamlnew file mode 100644index 0000000..8edb0a3--- /dev/null+++ b/.omm/command-surface/status/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:10.876Z+updated: 2026-03-25T12:29:10.877Z+update_count: 1+last_field: description+kind: nested-class+title: status+children: []+parentPath: []diff --git a/.omm/command-surface/update/description.md b/.omm/command-surface/update/description.mdnew file mode 100644index 0000000..c5f7e1e--- /dev/null+++ b/.omm/command-surface/update/description.md@@ -0,0 +1 @@+Updates the omm CLI to the latest npm version and re-runs setup to ensure platform plugins are in sync.diff --git a/.omm/command-surface/update/meta.yaml b/.omm/command-surface/update/meta.yamlnew file mode 100644index 0000000..6c67bde--- /dev/null+++ b/.omm/command-surface/update/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:30:26.560Z+updated: 2026-03-25T12:30:26.561Z+update_count: 1+last_field: description+kind: nested-class+title: update+children: []+parentPath: []diff --git a/.omm/command-surface/validate/description.md b/.omm/command-surface/validate/description.mdnew file mode 100644index 0000000..2012282--- /dev/null+++ b/.omm/command-surface/validate/description.md@@ -0,0 +1 @@+Validates Mermaid diagram syntax and conventions. Checks graph declaration, bracket balance, edge labels, classDef names/colors, self-references, and node count. Optional class argument; validates all if omitted.diff --git a/.omm/command-surface/validate/meta.yaml b/.omm/command-surface/validate/meta.yamlnew file mode 100644index 0000000..339651a--- /dev/null+++ b/.omm/command-surface/validate/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:32.448Z+updated: 2026-03-25T12:29:32.452Z+update_count: 1+last_field: description+kind: nested-class+title: validate+children: []+parentPath: []diff --git a/.omm/command-surface/view/description.md b/.omm/command-surface/view/description.mdnew file mode 100644index 0000000..48aeed8--- /dev/null+++ b/.omm/command-surface/view/description.md@@ -0,0 +1 @@+Starts the local HTTP web viewer on port 3000 (configurable via --port). Serves the single-page viewer, REST API, and SSE live-reload endpoint.diff --git a/.omm/command-surface/view/meta.yaml b/.omm/command-surface/view/meta.yamlnew file mode 100644index 0000000..47f284a--- /dev/null+++ b/.omm/command-surface/view/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:29:38.308Z+updated: 2026-03-25T12:29:38.308Z+update_count: 1+last_field: description+kind: nested-class+title: view+children: []+parentPath: []diff --git a/.omm/config.yaml b/.omm/config.yamlindex 55cb48c..8139618 100644--- a/.omm/config.yaml+++ b/.omm/config.yaml@@ -1,3 +1,4 @@version: 0.1.0cloud:project_slug: oh-my-mermaid+ org_slug: hitkoodiff --git a/.omm/data-flow/ai-assistant/description.md b/.omm/data-flow/ai-assistant/description.mdnew file mode 100644index 0000000..4def6ad--- /dev/null+++ b/.omm/data-flow/ai-assistant/description.md@@ -0,0 +1 @@+External AI coding assistants (Claude Code, Codex, Cursor, OpenClaw, Antigravity) that invoke omm CLI commands via skills/plugins. The primary write path starts here — AI assistants call `omm write <class> <field> - <<'CONTENT'` to generate architecture documentation.diff --git a/.omm/data-flow/ai-assistant/meta.yaml b/.omm/data-flow/ai-assistant/meta.yamlnew file mode 100644index 0000000..ec6a9da--- /dev/null+++ b/.omm/data-flow/ai-assistant/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:31:03.592Z+updated: 2026-03-25T12:31:03.592Z+update_count: 1+last_field: description+kind: nested-class+title: ai-assistant+children: []+parentPath: []diff --git a/.omm/data-flow/cli-input/description.md b/.omm/data-flow/cli-input/description.mdnew file mode 100644index 0000000..5647d01--- /dev/null+++ b/.omm/data-flow/cli-input/description.md@@ -0,0 +1 @@+CLI entry point for data operations. Parses the class-field pattern from argv, reads content from arguments or stdin (when `-` is passed), and routes to writeField() or readField() in the store engine.diff --git a/.omm/data-flow/cli-input/meta.yaml b/.omm/data-flow/cli-input/meta.yamlnew file mode 100644index 0000000..5adcd7a--- /dev/null+++ b/.omm/data-flow/cli-input/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:31:09.654Z+updated: 2026-03-25T12:31:09.655Z+update_count: 1+last_field: description+kind: nested-class+title: cli-input+children: []+parentPath: []diff --git a/.omm/data-flow/cloud-api/description.md b/.omm/data-flow/cloud-api/description.mdnew file mode 100644index 0000000..9ccb1cc--- /dev/null+++ b/.omm/data-flow/cloud-api/description.md@@ -0,0 +1 @@+External ohmymermaid.com REST API. Receives pushed files via POST /api/push and serves them back via GET /api/pull. Requires Bearer token authentication from ~/.omm/credentials.json. API URL defaults to https://ohmymermaid.com.diff --git a/.omm/data-flow/cloud-api/meta.yaml b/.omm/data-flow/cloud-api/meta.yamlnew file mode 100644index 0000000..0f5f1ee--- /dev/null+++ b/.omm/data-flow/cloud-api/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:31:51.728Z+updated: 2026-03-25T12:31:51.728Z+update_count: 1+last_field: description+kind: nested-class+title: cloud-api+children: []+parentPath: []diff --git a/.omm/data-flow/credentials/description.md b/.omm/data-flow/credentials/description.mdnew file mode 100644index 0000000..fa54993--- /dev/null+++ b/.omm/data-flow/credentials/description.md@@ -0,0 +1 @@+Credential store at ~/.omm/credentials.json (file mode 0o600). Holds token (Bearer auth), handle (user identity), and default_org (active organization). Read by the cloud client for API authentication on push/pull/org operations.diff --git a/.omm/data-flow/credentials/meta.yaml b/.omm/data-flow/credentials/meta.yamlnew file mode 100644index 0000000..b92455e--- /dev/null+++ b/.omm/data-flow/credentials/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:32:02.817Z+updated: 2026-03-25T12:32:02.818Z+update_count: 1+last_field: description+kind: nested-class+title: credentials+children: []+parentPath: []diff --git a/.omm/data-flow/description.md b/.omm/data-flow/description.mdnew file mode 100644index 0000000..9fc5d65--- /dev/null+++ b/.omm/data-flow/description.md@@ -0,0 +1 @@+Data flows through oh-my-mermaid in three main paths: (1) Write path — AI assistants or users invoke `omm write` which passes through the store engine to persist field files and metadata in .omm/. (2) Read/analysis path — validator, diff engine, and ref tracker read diagrams from the store to analyze content. (3) Sync path — push uploads .omm/ to the cloud API with credentials, pull downloads back with path-safe resolution, and the web viewer reads via REST + SSE live-reload.diff --git a/.omm/data-flow/diagram.mmd b/.omm/data-flow/diagram.mmdnew file mode 100644index 0000000..6e362ae--- /dev/null+++ b/.omm/data-flow/diagram.mmd@@ -0,0 +1,36 @@+graph LR+ ai-assistant["AI Assistant\nClaude Code / Codex / Cursor"]+ cli-input["CLI Input\nomm <class> <field> [content]"]+ store["Store Engine\nsrc/lib/store.ts"]+ omm-dir[".omm/ Directory\nFilesystem"]+ meta-tracker["Meta Tracker\nsrc/lib/meta.ts"]+ validator["Validator\nsrc/lib/validate.ts"]+ diff-engine["Diff Engine\nsrc/lib/diff.ts"]+ ref-tracker["Ref Tracker\nsrc/lib/refs.ts"]+ cloud-api["Cloud API\nohmymermaid.com"]+ web-viewer["Web Viewer\nlocalhost:3000"]+ credentials["Credentials\n~/.omm/credentials.json"]++ ai-assistant -->|"invokes omm write"| cli-input+ cli-input -->|"writeField(class, field, content)"| store+ store -->|"write field files"| omm-dir+ store -->|"save prev_diagram on overwrite"| omm-dir+ store -->|"updateMeta()"| meta-tracker+ meta-tracker -->|"write meta.yaml + git info"| omm-dir+ omm-dir -->|"readField()"| store+ store -->|"diagram text"| validator+ store -->|"diagram text"| diff-engine+ store -->|"diagram text"| ref-tracker+ omm-dir -->|"push all files"| cloud-api+ cloud-api -->|"pull files"| omm-dir+ credentials -->|"Bearer token"| cloud-api+ omm-dir -->|"fs.watch + SSE"| web-viewer+ web-viewer -->|"REST API reads"| store++ classDef external fill:#585b70,stroke:#585b70,color:#cdd6f4+ classDef entry fill:#89b4fa,stroke:#89b4fa,color:#1e1e2e+ classDef store fill:#a6e3a1,stroke:#a6e3a1,color:#1e1e2e++ class ai-assistant,cloud-api external+ class cli-input entry+ class omm-dir,credentials storediff --git a/.omm/data-flow/diff-engine/description.md b/.omm/data-flow/diff-engine/description.mdnew file mode 100644index 0000000..b0f58b6--- /dev/null+++ b/.omm/data-flow/diff-engine/description.md@@ -0,0 +1 @@+Compares two diagram versions by parsing nodes and edges from each, then computing set differences. Consumes diagram text from the store (current + prev_diagram from meta). Output is a DiffResult with added/removed nodes and edges.diff --git a/.omm/data-flow/diff-engine/meta.yaml b/.omm/data-flow/diff-engine/meta.yamlnew file mode 100644index 0000000..1d39eba--- /dev/null+++ b/.omm/data-flow/diff-engine/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:31:40.793Z+updated: 2026-03-25T12:31:40.793Z+update_count: 1+last_field: description+kind: nested-class+title: diff-engine+children: []+parentPath: []diff --git a/.omm/data-flow/meta-tracker/description.md b/.omm/data-flow/meta-tracker/description.mdnew file mode 100644index 0000000..73c4224--- /dev/null+++ b/.omm/data-flow/meta-tracker/description.md@@ -0,0 +1 @@+Writes meta.yaml on every field update. Records created/updated ISO timestamps, update count, last-modified field name, and current git commit SHA + branch name (via execSync git commands).diff --git a/.omm/data-flow/meta-tracker/meta.yaml b/.omm/data-flow/meta-tracker/meta.yamlnew file mode 100644index 0000000..95f3ac2--- /dev/null+++ b/.omm/data-flow/meta-tracker/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:31:27.895Z+updated: 2026-03-25T12:31:27.895Z+update_count: 1+last_field: description+kind: nested-class+title: meta-tracker+children: []+parentPath: []diff --git a/.omm/data-flow/meta.yaml b/.omm/data-flow/meta.yamlnew file mode 100644index 0000000..2a1693d--- /dev/null+++ b/.omm/data-flow/meta.yaml@@ -0,0 +1,18 @@+created: 2026-03-25T12:30:49.487Z+updated: 2026-03-25T12:30:57.358Z+update_count: 2+last_field: description+git_commit: 2fb887a+git_branch: main+children:+ - ai-assistant+ - cli-input+ - cloud-api+ - credentials+ - diff-engine+ - meta-tracker+ - omm-dir+ - ref-tracker+ - store+ - validator+ - web-viewerdiff --git a/.omm/data-flow/omm-dir/description.md b/.omm/data-flow/omm-dir/description.mdnew file mode 100644index 0000000..364787a--- /dev/null+++ b/.omm/data-flow/omm-dir/description.md@@ -0,0 +1 @@+The .omm/ directory in the project root. Contains config.yaml at top level and one subdirectory per class. Each class directory holds field files (description.md, diagram.mmd, constraint.md, concern.md, context.md, todo.md, note.md) and meta.yaml. This is the single source of truth for all architecture documentation.diff --git a/.omm/data-flow/omm-dir/meta.yaml b/.omm/data-flow/omm-dir/meta.yamlnew file mode 100644index 0000000..ac61b09--- /dev/null+++ b/.omm/data-flow/omm-dir/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:31:21.799Z+updated: 2026-03-25T12:31:21.800Z+update_count: 1+last_field: description+kind: nested-class+title: omm-dir+children: []+parentPath: []diff --git a/.omm/data-flow/ref-tracker/description.md b/.omm/data-flow/ref-tracker/description.mdnew file mode 100644index 0000000..77597a7--- /dev/null+++ b/.omm/data-flow/ref-tracker/description.md@@ -0,0 +1 @@+Scans diagram text for @class-name mentions to build cross-reference graphs. Reads all class diagrams from the store to compute incoming and outgoing references for any given class.diff --git a/.omm/data-flow/ref-tracker/meta.yaml b/.omm/data-flow/ref-tracker/meta.yamlnew file mode 100644index 0000000..0558f56--- /dev/null+++ b/.omm/data-flow/ref-tracker/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:31:46.250Z+updated: 2026-03-25T12:31:46.251Z+update_count: 1+last_field: description+kind: nested-class+title: ref-tracker+children: []+parentPath: []diff --git a/.omm/data-flow/store/description.md b/.omm/data-flow/store/description.mdnew file mode 100644index 0000000..6054f57--- /dev/null+++ b/.omm/data-flow/store/description.md@@ -0,0 +1 @@+Central data engine. On write: ensures .omm/ exists (lazy-init), creates class directory, writes the field file, saves previous diagram to meta if overwriting, and triggers meta update. On read: reads field files from the class directory and returns content or null.diff --git a/.omm/data-flow/store/meta.yaml b/.omm/data-flow/store/meta.yamlnew file mode 100644index 0000000..8571da8--- /dev/null+++ b/.omm/data-flow/store/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:31:15.920Z+updated: 2026-03-25T12:31:15.921Z+update_count: 1+last_field: description+kind: nested-class+title: store+children: []+parentPath: []diff --git a/.omm/data-flow/validator/description.md b/.omm/data-flow/validator/description.mdnew file mode 100644index 0000000..bdce7a7--- /dev/null+++ b/.omm/data-flow/validator/description.md@@ -0,0 +1 @@+Reads diagram text from the store and runs rule-based validation checks. Returns structured results with error/warning levels. Does not modify data — purely analytical.diff --git a/.omm/data-flow/validator/meta.yaml b/.omm/data-flow/validator/meta.yamlnew file mode 100644index 0000000..788eade--- /dev/null+++ b/.omm/data-flow/validator/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:31:33.135Z+updated: 2026-03-25T12:31:33.136Z+update_count: 1+last_field: description+kind: nested-class+title: validator+children: []+parentPath: []diff --git a/.omm/data-flow/web-viewer/description.md b/.omm/data-flow/web-viewer/description.mdnew file mode 100644index 0000000..8062166--- /dev/null+++ b/.omm/data-flow/web-viewer/description.md@@ -0,0 +1 @@+Local web viewer that reads data from the store via REST API endpoints. Receives live-reload events via SSE when the file watcher detects changes in .omm/. Renders diagrams using Mermaid.js in the browser.diff --git a/.omm/data-flow/web-viewer/meta.yaml b/.omm/data-flow/web-viewer/meta.yamlnew file mode 100644index 0000000..3200295--- /dev/null+++ b/.omm/data-flow/web-viewer/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:31:56.816Z+updated: 2026-03-25T12:31:56.816Z+update_count: 1+last_field: description+kind: nested-class+title: web-viewer+children: []+parentPath: []diff --git a/.omm/overall-architecture/cli/description.md b/.omm/overall-architecture/cli/description.mdnew file mode 100644index 0000000..4bb31dd--- /dev/null+++ b/.omm/overall-architecture/cli/description.md@@ -0,0 +1 @@+Entry point for the `omm` CLI binary. Parses `process.argv`, dispatches to named command handlers (init, setup, list, show, delete, status, diff, refs, validate, view, login, logout, push, pull, link, share, org, update), and falls back to the class-field pattern (`omm <class> <field> [content]`) for direct read/write operations. Prints help on no args or `--help`.diff --git a/.omm/overall-architecture/cli/meta.yaml b/.omm/overall-architecture/cli/meta.yamlnew file mode 100644index 0000000..a9755eb--- /dev/null+++ b/.omm/overall-architecture/cli/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:25:01.240Z+updated: 2026-03-25T12:25:01.240Z+update_count: 1+last_field: description+kind: nested-class+title: cli+children: []+parentPath: []diff --git a/.omm/overall-architecture/cloud-paths/description.md b/.omm/overall-architecture/cloud-paths/description.mdnew file mode 100644index 0000000..c384faf--- /dev/null+++ b/.omm/overall-architecture/cloud-paths/description.md@@ -0,0 +1 @@+Path safety module for cloud pull operations. resolvePullDestination() validates file paths received from the cloud API, rejecting path traversal attacks (../, absolute paths, escapes outside .omm/). Ensures all pulled files land within the .omm/ directory.diff --git a/.omm/overall-architecture/cloud-paths/meta.yaml b/.omm/overall-architecture/cloud-paths/meta.yamlnew file mode 100644index 0000000..6c9e935--- /dev/null+++ b/.omm/overall-architecture/cloud-paths/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:26:33.972Z+updated: 2026-03-25T12:26:33.973Z+update_count: 1+last_field: description+kind: nested-class+title: cloud-paths+children: []+parentPath: []diff --git a/.omm/overall-architecture/cloud/description.md b/.omm/overall-architecture/cloud/description.mdnew file mode 100644index 0000000..ddf03d0--- /dev/null+++ b/.omm/overall-architecture/cloud/description.md@@ -0,0 +1 @@+Cloud authentication and API client for ohmymermaid.com. Manages credentials (token, handle, default_org) in ~/.omm/credentials.json with 0o600 permissions. Provides apiRequest() for authenticated REST calls with Bearer token. API URL defaults to https://ohmymermaid.com, overridable via OMM_API_URL env var.diff --git a/.omm/overall-architecture/cloud/meta.yaml b/.omm/overall-architecture/cloud/meta.yamlnew file mode 100644index 0000000..0bfbc99--- /dev/null+++ b/.omm/overall-architecture/cloud/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:26:02.590Z+updated: 2026-03-25T12:26:02.591Z+update_count: 1+last_field: description+kind: nested-class+title: cloud+children: []+parentPath: []diff --git a/.omm/overall-architecture/commands/class-field/description.md b/.omm/overall-architecture/commands/class-field/description.mdnew file mode 100644index 0000000..3b7e3c8--- /dev/null+++ b/.omm/overall-architecture/commands/class-field/description.md@@ -0,0 +1 @@+Default handler for the `omm <class> <field> [content]` pattern. When no global command matches, the CLI falls through to this handler. Without content, it reads the field to stdout. With content (or `-` for stdin), it writes the field. Supports all 7 field types: description, diagram, constraint, concern, context, todo, note.diff --git a/.omm/overall-architecture/commands/class-field/meta.yaml b/.omm/overall-architecture/commands/class-field/meta.yamlnew file mode 100644index 0000000..719596b--- /dev/null+++ b/.omm/overall-architecture/commands/class-field/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:25:49.707Z+updated: 2026-03-25T12:25:49.708Z+update_count: 1+last_field: description+kind: nested-class+title: class-field+children: []+parentPath:+ - commandsdiff --git a/.omm/overall-architecture/commands/cloud-ops/description.md b/.omm/overall-architecture/commands/cloud-ops/description.mdnew file mode 100644index 0000000..574ad48--- /dev/null+++ b/.omm/overall-architecture/commands/cloud-ops/description.md@@ -0,0 +1 @@+Cloud sync commands for ohmymermaid.com. `login` authenticates via browser OAuth and stores token in ~/.omm/credentials.json. `logout` removes the token. `link` associates the project with a cloud slug in config.yaml. `push` uploads all .omm/ files to the cloud API. `pull` downloads files with path-safe resolution. `share` prints the shareable URL. `org` manages organization membership (list, switch, members).diff --git a/.omm/overall-architecture/commands/cloud-ops/meta.yaml b/.omm/overall-architecture/commands/cloud-ops/meta.yamlnew file mode 100644index 0000000..42a5c75--- /dev/null+++ b/.omm/overall-architecture/commands/cloud-ops/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:25:38.020Z+updated: 2026-03-25T12:25:38.021Z+update_count: 1+last_field: description+kind: nested-class+title: cloud-ops+children: []+parentPath:+ - commandsdiff --git a/.omm/overall-architecture/commands/description.md b/.omm/overall-architecture/commands/description.mdnew file mode 100644index 0000000..7be73ac--- /dev/null+++ b/.omm/overall-architecture/commands/description.md@@ -0,0 +1 @@+Individual command implementations, one file per command. Each exports an async or sync function invoked by the CLI dispatcher. Commands fall into three groups: local operations (init, list, show, delete, status, diff, refs, validate, class-field), cloud operations (login, logout, link, push, pull, share, org), and tool integration (setup, update, view).diff --git a/.omm/overall-architecture/commands/diagram.mmd b/.omm/overall-architecture/commands/diagram.mmdnew file mode 100644index 0000000..7e664dc--- /dev/null+++ b/.omm/overall-architecture/commands/diagram.mmd@@ -0,0 +1,16 @@+graph LR+ local-ops["Local Operations\ninit, list, show, delete, status"]+ query-ops["Query Operations\ndiff, refs, validate"]+ cloud-ops["Cloud Operations\nlogin, logout, link, push, pull, share, org"]+ tool-ops["Tool Operations\nsetup, update, view"]+ class-field["Class-Field Handler\nsrc/commands/class-field.ts"]++ local-ops -->|"read/write .omm/"| store["Store"]+ query-ops -->|"analyze diagrams"| libs["Diff / Refs / Validate"]+ cloud-ops -->|"REST API calls"| cloud["Cloud Client"]+ tool-ops -->|"platform detect + register"| platforms["Platforms"]+ tool-ops -->|"start server"| server["Web Viewer"]+ class-field -->|"read or write field"| store++ classDef external fill:#585b70,stroke:#585b70,color:#cdd6f4+ class store,libs,cloud,platforms,server externaldiff --git a/.omm/overall-architecture/commands/local-ops/description.md b/.omm/overall-architecture/commands/local-ops/description.mdnew file mode 100644index 0000000..ad51228--- /dev/null+++ b/.omm/overall-architecture/commands/local-ops/description.md@@ -0,0 +1 @@+Core CRUD operations on .omm/ classes. `init` creates the .omm/ directory and config.yaml. `list` enumerates all class directories. `show` reads all fields for a class. `delete` removes a class directory. `status` prints an overview of all classes with their field counts and last-updated timestamps.diff --git a/.omm/overall-architecture/commands/local-ops/meta.yaml b/.omm/overall-architecture/commands/local-ops/meta.yamlnew file mode 100644index 0000000..da5bad7--- /dev/null+++ b/.omm/overall-architecture/commands/local-ops/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:25:20.861Z+updated: 2026-03-25T12:25:20.863Z+update_count: 1+last_field: description+kind: nested-class+title: local-ops+children: []+parentPath:+ - commandsdiff --git a/.omm/overall-architecture/commands/meta.yaml b/.omm/overall-architecture/commands/meta.yamlnew file mode 100644index 0000000..5a220ae--- /dev/null+++ b/.omm/overall-architecture/commands/meta.yaml@@ -0,0 +1,13 @@+created: 2026-03-25T12:25:06.735Z+updated: 2026-03-25T12:25:14.479Z+update_count: 2+last_field: diagram+kind: nested-class+title: commands+children:+ - class-field+ - cloud-ops+ - local-ops+ - query-ops+ - tool-ops+parentPath: []diff --git a/.omm/overall-architecture/commands/query-ops/description.md b/.omm/overall-architecture/commands/query-ops/description.mdnew file mode 100644index 0000000..45025c6--- /dev/null+++ b/.omm/overall-architecture/commands/query-ops/description.md@@ -0,0 +1 @@+Analytical commands that inspect diagram content. `diff` compares the current diagram against the previously saved version using the diff engine. `refs` traces cross-references between classes via @mentions in diagrams. `validate` checks diagrams for syntax errors, convention violations, and structural warnings.diff --git a/.omm/overall-architecture/commands/query-ops/meta.yaml b/.omm/overall-architecture/commands/query-ops/meta.yamlnew file mode 100644index 0000000..c6d3d7c--- /dev/null+++ b/.omm/overall-architecture/commands/query-ops/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:25:31.924Z+updated: 2026-03-25T12:25:31.925Z+update_count: 1+last_field: description+kind: nested-class+title: query-ops+children: []+parentPath:+ - commandsdiff --git a/.omm/overall-architecture/commands/tool-ops/description.md b/.omm/overall-architecture/commands/tool-ops/description.mdnew file mode 100644index 0000000..d0b5717--- /dev/null+++ b/.omm/overall-architecture/commands/tool-ops/description.md@@ -0,0 +1 @@+Integration commands. `setup` auto-detects AI coding tools and registers omm skills/plugins with them. `update` upgrades the CLI and re-runs setup. `view` starts the local HTTP web viewer for browsing diagrams.diff --git a/.omm/overall-architecture/commands/tool-ops/meta.yaml b/.omm/overall-architecture/commands/tool-ops/meta.yamlnew file mode 100644index 0000000..ab7eba8--- /dev/null+++ b/.omm/overall-architecture/commands/tool-ops/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:25:43.655Z+updated: 2026-03-25T12:25:43.656Z+update_count: 1+last_field: description+kind: nested-class+title: tool-ops+children: []+parentPath:+ - commandsdiff --git a/.omm/overall-architecture/constraint.md b/.omm/overall-architecture/constraint.mdindex 6003540..7535fc8 100644--- a/.omm/overall-architecture/constraint.md+++ b/.omm/overall-architecture/constraint.md@@ -1,3 +1,5 @@-- Server is strictly read-only: never write `.omm/` data through HTTP API, only through the CLI-- All `.omm/` content must be plain text (markdown or mermaid) — no binary files-- Cloud credentials stored only in `~/.omm/credentials.json`, never in `.omm/` or git+- Single runtime dependency (yaml) — keep the dependency footprint minimal+- Must work as both CLI and programmatic library (dual entry points)+- Cloud paths must be validated to prevent path traversal attacks+- Platform integrations must be detect-based (no hard requirement on any AI tool)+- All storage is filesystem-based (.omm/ directory) — no databasediff --git a/.omm/overall-architecture/context.md b/.omm/overall-architecture/context.mdindex 611f7cc..a11ddfe 100644--- a/.omm/overall-architecture/context.md+++ b/.omm/overall-architecture/context.md@@ -1,7 +1 @@-omm is a CLI tool that generates and serves architecture documentation as Mermaid diagrams. The core loop is: AI scans code → writes `.omm/` files via CLI → developer serves them locally or pushes to cloud.--Key decisions:-- Local-first: all data lives in `.omm/` plain files (markdown + mmd), no database-- CLI as the write interface: Claude Code uses `omm <class> <field> - <<'EOF'` to write docs; the server is read-only-- SSE for live reload: avoids WebSocket complexity while enabling instant viewer refresh as Claude writes-- Cloud sync is optional: push/pull uploads raw `.omm/` files; cloud hosts its own renderer (separate from viewer.html)+Built as a TypeScript ESM package with zero runtime dependencies beyond `yaml`. Uses tsup for bundling. Published to npm as `oh-my-mermaid` with both a CLI binary (`omm`) and a library API. Designed to be invoked by AI coding assistants via skills/plugins, with the `/omm-scan` skill being the primary entry point for generating architecture docs.diff --git a/.omm/overall-architecture/description.md b/.omm/overall-architecture/description.mdindex 9bf8518..2e02147 100644--- a/.omm/overall-architecture/description.md+++ b/.omm/overall-architecture/description.md@@ -1 +1 @@-Top-level view of the oh-my-mermaid (omm) CLI tool — architecture mirror for vibe coding. Read this first to understand how the CLI, local viewer, storage, and cloud sync all connect.+oh-my-mermaid is a CLI tool and Node.js library for managing architecture documentation as Mermaid diagrams. It stores documentation in a `.omm/` directory within the project, where each "class" (architecture element) is a subdirectory containing fields like diagram, description, constraints, and concerns. The system supports local viewing via a built-in web server, cloud sync to ohmymermaid.com, cross-reference tracking between diagrams, validation, diffing, and integration with AI coding tools (Claude Code, Codex, Cursor, OpenClaw, Antigravity).diff --git a/.omm/overall-architecture/diagram.mmd b/.omm/overall-architecture/diagram.mmdindex b076464..b823fdc 100644--- a/.omm/overall-architecture/diagram.mmd+++ b/.omm/overall-architecture/diagram.mmd@@ -1,13 +1,38 @@graph LR+ cli["CLI Dispatcher\nsrc/cli.ts"]+ commands["Commands\nsrc/commands/"]+ store["Store\nsrc/lib/store.ts"]+ cloud["Cloud Client\nsrc/lib/cloud.ts"]+ diff-engine["Diff Engine\nsrc/lib/diff.ts"]+ refs["Ref Tracker\nsrc/lib/refs.ts"]+ validator["Validator\nsrc/lib/validate.ts"]+ meta["Meta Tracker\nsrc/lib/meta.ts"]+ cloud-paths["Cloud Paths\nsrc/lib/cloud-paths.ts"]+ platforms["Platform Integrations\nsrc/lib/platforms/"]+ server["Web Viewer\nsrc/server/"]+ public-api["Public API\nsrc/index.ts"]++ cli -->|"dispatches args to"| commands+ commands -->|"read/write .omm/"| store+ commands -->|"push/pull via REST"| cloud+ commands -->|"compare diagrams"| diff-engine+ commands -->|"cross-references"| refs+ commands -->|"validate mermaid"| validator+ commands -->|"register skills"| platforms+ commands -->|"start HTTP server"| server+ store -->|"update timestamps + git"| meta+ cloud -->|"safe path resolution"| cloud-paths+ server -->|"read classes"| store+ server -->|"compare diagrams"| diff-engine+ server -->|"resolve refs"| refs+ public-api -->|"re-exports"| store+ public-api -->|"re-exports"| diff-engine+ public-api -->|"re-exports"| refs+ public-api -->|"re-exports"| validator++ classDef external fill:#585b70,stroke:#585b70,color:#cdd6f4classDef entry fill:#89b4fa,stroke:#89b4fa,color:#1e1e2eclassDef store fill:#a6e3a1,stroke:#a6e3a1,color:#1e1e2e- classDef external fill:#585b70,stroke:#585b70,color:#cdd6f4- cli["omm CLI\nsrc/cli.ts"]:::entry- cli -->|"dispatch command"| @cli-commands["CLI Commands\nsrc/commands/"]- @cli-commands -->|"read/write fields"| @storage-model["Storage Model\n.omm/"]- @cli-commands -->|"omm serve"| @serve-layer["Local Server\nsrc/server/"]- @serve-layer -->|"serve viewer + API"| @viewer-rendering["Browser Viewer\nsrc/server/viewer.html"]- @serve-layer -->|"read class data"| @storage-model- @cli-commands -->|"omm push/pull/login"| cloud["ohmymermaid.com\nhttps://ohmymermaid.com"]:::external- cloud -->|"shareable URL"| browser["Browser\n(remote viewer)"]:::external+ class cli,public-api entry+ class store storediff --git a/.omm/overall-architecture/diff-engine/description.md b/.omm/overall-architecture/diff-engine/description.mdnew file mode 100644index 0000000..f026c83--- /dev/null+++ b/.omm/overall-architecture/diff-engine/description.md@@ -0,0 +1 @@+Lightweight Mermaid diagram parser and diff engine. parseMermaid() extracts node IDs and edges from diagram text using regex-based pattern matching. diffMermaid() compares two diagram versions and returns added/removed nodes and edges. formatDiff() renders the diff as human-readable text.diff --git a/.omm/overall-architecture/diff-engine/meta.yaml b/.omm/overall-architecture/diff-engine/meta.yamlnew file mode 100644index 0000000..104b7ff--- /dev/null+++ b/.omm/overall-architecture/diff-engine/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:26:08.379Z+updated: 2026-03-25T12:26:08.379Z+update_count: 1+last_field: description+kind: nested-class+title: diff-engine+children: []+parentPath: []diff --git a/.omm/overall-architecture/meta.yaml b/.omm/overall-architecture/meta.yamlindex 314d8f6..6009cfd 100644--- a/.omm/overall-architecture/meta.yaml+++ b/.omm/overall-architecture/meta.yaml@@ -1,6 +1,19 @@-created: 2026-03-22T06:05:25.271Z-updated: 2026-03-22T06:05:43.316Z+created: 2026-03-25T12:24:32.098Z+updated: 2026-03-25T12:24:53.575Zupdate_count: 4last_field: constraint-git_commit: 55c1fe5+git_commit: 2fb887agit_branch: main+children:+ - cli+ - cloud+ - cloud-paths+ - commands+ - diff-engine+ - meta+ - platforms+ - public-api+ - refs+ - server+ - store+ - validatordiff --git a/.omm/overall-architecture/meta/description.md b/.omm/overall-architecture/meta/description.mdnew file mode 100644index 0000000..8763ee8--- /dev/null+++ b/.omm/overall-architecture/meta/description.md@@ -0,0 +1 @@+Metadata tracker that maintains meta.yaml per class. Records created/updated timestamps, update count, last-modified field, and git info (commit SHA and branch name). Automatically called by store.writeField() on every write.diff --git a/.omm/overall-architecture/meta/meta.yaml b/.omm/overall-architecture/meta/meta.yamlnew file mode 100644index 0000000..984d835--- /dev/null+++ b/.omm/overall-architecture/meta/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:26:26.463Z+updated: 2026-03-25T12:26:26.463Z+update_count: 1+last_field: description+kind: nested-class+title: meta+children: []+parentPath: []diff --git a/.omm/overall-architecture/platforms/antigravity-platform/description.md b/.omm/overall-architecture/platforms/antigravity-platform/description.mdnew file mode 100644index 0000000..ab14749--- /dev/null+++ b/.omm/overall-architecture/platforms/antigravity-platform/description.md@@ -0,0 +1 @@+Antigravity platform adapter. Detects via `which antigravity`. Registers omm skills with Antigravity's configuration system.diff --git a/.omm/overall-architecture/platforms/antigravity-platform/meta.yaml b/.omm/overall-architecture/platforms/antigravity-platform/meta.yamlnew file mode 100644index 0000000..d171c3b--- /dev/null+++ b/.omm/overall-architecture/platforms/antigravity-platform/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:27:30.629Z+updated: 2026-03-25T12:27:30.630Z+update_count: 1+last_field: description+kind: nested-class+title: antigravity-platform+children: []+parentPath:+ - platformsdiff --git a/.omm/overall-architecture/platforms/claude-platform/description.md b/.omm/overall-architecture/platforms/claude-platform/description.mdnew file mode 100644index 0000000..2a60207--- /dev/null+++ b/.omm/overall-architecture/platforms/claude-platform/description.md@@ -0,0 +1 @@+Claude Code platform adapter. Detects via `which claude`. Registers by installing the oh-my-mermaid plugin via `claude plugin install`. Handles version-aware upgrades by comparing installed vs package version, uninstalling old before installing new.diff --git a/.omm/overall-architecture/platforms/claude-platform/meta.yaml b/.omm/overall-architecture/platforms/claude-platform/meta.yamlnew file mode 100644index 0000000..e3d2ba8--- /dev/null+++ b/.omm/overall-architecture/platforms/claude-platform/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:27:09.618Z+updated: 2026-03-25T12:27:09.619Z+update_count: 1+last_field: description+kind: nested-class+title: claude-platform+children: []+parentPath:+ - platformsdiff --git a/.omm/overall-architecture/platforms/codex-platform/description.md b/.omm/overall-architecture/platforms/codex-platform/description.mdnew file mode 100644index 0000000..ffdc0b3--- /dev/null+++ b/.omm/overall-architecture/platforms/codex-platform/description.md@@ -0,0 +1 @@+Codex CLI platform adapter. Detects via `which codex`. Registers omm skills by writing instruction files to Codex's configuration directory.diff --git a/.omm/overall-architecture/platforms/codex-platform/meta.yaml b/.omm/overall-architecture/platforms/codex-platform/meta.yamlnew file mode 100644index 0000000..69d1883--- /dev/null+++ b/.omm/overall-architecture/platforms/codex-platform/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:27:14.788Z+updated: 2026-03-25T12:27:14.789Z+update_count: 1+last_field: description+kind: nested-class+title: codex-platform+children: []+parentPath:+ - platformsdiff --git a/.omm/overall-architecture/platforms/cursor-platform/description.md b/.omm/overall-architecture/platforms/cursor-platform/description.mdnew file mode 100644index 0000000..188cf14--- /dev/null+++ b/.omm/overall-architecture/platforms/cursor-platform/description.md@@ -0,0 +1 @@+Cursor IDE platform adapter. Detects via cursor configuration directories. Registers by writing skill definitions to Cursor's rules directory.diff --git a/.omm/overall-architecture/platforms/cursor-platform/meta.yaml b/.omm/overall-architecture/platforms/cursor-platform/meta.yamlnew file mode 100644index 0000000..861d443--- /dev/null+++ b/.omm/overall-architecture/platforms/cursor-platform/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:27:20.284Z+updated: 2026-03-25T12:27:20.285Z+update_count: 1+last_field: description+kind: nested-class+title: cursor-platform+children: []+parentPath:+ - platformsdiff --git a/.omm/overall-architecture/platforms/description.md b/.omm/overall-architecture/platforms/description.mdnew file mode 100644index 0000000..c2f1e26--- /dev/null+++ b/.omm/overall-architecture/platforms/description.md@@ -0,0 +1 @@+Platform integration layer for AI coding tools. Each platform implements a common interface (detect, isSetup, setup, teardown) to register omm skills/plugins. The setup command auto-detects installed tools and configures them. Supports 5 platforms: Claude Code, Codex, Cursor, OpenClaw, and Antigravity.diff --git a/.omm/overall-architecture/platforms/diagram.mmd b/.omm/overall-architecture/platforms/diagram.mmdnew file mode 100644index 0000000..1047978--- /dev/null+++ b/.omm/overall-architecture/platforms/diagram.mmd@@ -0,0 +1,22 @@+graph LR+ platform-registry["Platform Registry\nsrc/lib/platforms/index.ts"]+ platform-interface["Platform Interface\nsrc/lib/platforms/types.ts"]+ claude-platform["Claude Code\nsrc/lib/platforms/claude.ts"]+ codex-platform["Codex\nsrc/lib/platforms/codex.ts"]+ cursor-platform["Cursor\nsrc/lib/platforms/cursor.ts"]+ openclaw-platform["OpenClaw\nsrc/lib/platforms/openclaw.ts"]+ antigravity-platform["Antigravity\nsrc/lib/platforms/antigravity.ts"]++ platform-registry -->|"aggregates"| claude-platform+ platform-registry -->|"aggregates"| codex-platform+ platform-registry -->|"aggregates"| cursor-platform+ platform-registry -->|"aggregates"| openclaw-platform+ platform-registry -->|"aggregates"| antigravity-platform+ claude-platform -->|"implements"| platform-interface+ codex-platform -->|"implements"| platform-interface+ cursor-platform -->|"implements"| platform-interface+ openclaw-platform -->|"implements"| platform-interface+ antigravity-platform -->|"implements"| platform-interface++ classDef external fill:#585b70,stroke:#585b70,color:#cdd6f4+ class claude-platform,codex-platform,cursor-platform,openclaw-platform,antigravity-platform externaldiff --git a/.omm/overall-architecture/platforms/meta.yaml b/.omm/overall-architecture/platforms/meta.yamlnew file mode 100644index 0000000..cdffd32--- /dev/null+++ b/.omm/overall-architecture/platforms/meta.yaml@@ -0,0 +1,15 @@+created: 2026-03-25T12:26:40.942Z+updated: 2026-03-25T12:26:48.074Z+update_count: 2+last_field: diagram+kind: nested-class+title: platforms+children:+ - antigravity-platform+ - claude-platform+ - codex-platform+ - cursor-platform+ - openclaw-platform+ - platform-interface+ - platform-registry+parentPath: []diff --git a/.omm/overall-architecture/platforms/openclaw-platform/description.md b/.omm/overall-architecture/platforms/openclaw-platform/description.mdnew file mode 100644index 0000000..4a1f911--- /dev/null+++ b/.omm/overall-architecture/platforms/openclaw-platform/description.md@@ -0,0 +1 @@+OpenClaw platform adapter. Detects via `which openclaw`. Registers omm skills with OpenClaw's skill configuration system.diff --git a/.omm/overall-architecture/platforms/openclaw-platform/meta.yaml b/.omm/overall-architecture/platforms/openclaw-platform/meta.yamlnew file mode 100644index 0000000..562065f--- /dev/null+++ b/.omm/overall-architecture/platforms/openclaw-platform/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:27:25.847Z+updated: 2026-03-25T12:27:25.848Z+update_count: 1+last_field: description+kind: nested-class+title: openclaw-platform+children: []+parentPath:+ - platformsdiff --git a/.omm/overall-architecture/platforms/platform-interface/description.md b/.omm/overall-architecture/platforms/platform-interface/description.mdnew file mode 100644index 0000000..23bfa0c--- /dev/null+++ b/.omm/overall-architecture/platforms/platform-interface/description.md@@ -0,0 +1 @@+TypeScript interface that all platform adapters must implement: name (display), id (CLI-facing), detect() (is binary installed), isSetup() (are skills registered), setup() (register skills/plugin), teardown() (unregister).diff --git a/.omm/overall-architecture/platforms/platform-interface/meta.yaml b/.omm/overall-architecture/platforms/platform-interface/meta.yamlnew file mode 100644index 0000000..4d2338b--- /dev/null+++ b/.omm/overall-architecture/platforms/platform-interface/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:27:03.301Z+updated: 2026-03-25T12:27:03.302Z+update_count: 1+last_field: description+kind: nested-class+title: platform-interface+children: []+parentPath:+ - platformsdiff --git a/.omm/overall-architecture/platforms/platform-registry/description.md b/.omm/overall-architecture/platforms/platform-registry/description.mdnew file mode 100644index 0000000..4c82dac--- /dev/null+++ b/.omm/overall-architecture/platforms/platform-registry/description.md@@ -0,0 +1 @@+Central registry that aggregates all platform implementations. Exports ALL_PLATFORMS array, getPlatformById() for targeted lookup, and getDetectedPlatforms() to filter by what's installed on the current machine.diff --git a/.omm/overall-architecture/platforms/platform-registry/meta.yaml b/.omm/overall-architecture/platforms/platform-registry/meta.yamlnew file mode 100644index 0000000..8c12a80--- /dev/null+++ b/.omm/overall-architecture/platforms/platform-registry/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:26:54.101Z+updated: 2026-03-25T12:26:54.102Z+update_count: 1+last_field: description+kind: nested-class+title: platform-registry+children: []+parentPath:+ - platformsdiff --git a/.omm/overall-architecture/public-api/description.md b/.omm/overall-architecture/public-api/description.mdnew file mode 100644index 0000000..498268b--- /dev/null+++ b/.omm/overall-architecture/public-api/description.md@@ -0,0 +1 @@+Library entry point (src/index.ts) that re-exports the public API for programmatic use. Exports store operations (initOmm, listClasses, readField, writeField, etc.), diff functions (diffMermaid, parseMermaid, formatDiff), ref functions (extractRefs, buildRefGraph), validation (validateDiagram), and all TypeScript types. Used when oh-my-mermaid is imported as a dependency rather than used as a CLI.diff --git a/.omm/overall-architecture/public-api/meta.yaml b/.omm/overall-architecture/public-api/meta.yamlnew file mode 100644index 0000000..44f6cb3--- /dev/null+++ b/.omm/overall-architecture/public-api/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:28:19.887Z+updated: 2026-03-25T12:28:19.888Z+update_count: 1+last_field: description+kind: nested-class+title: public-api+children: []+parentPath: []diff --git a/.omm/overall-architecture/refs/description.md b/.omm/overall-architecture/refs/description.mdnew file mode 100644index 0000000..31df933--- /dev/null+++ b/.omm/overall-architecture/refs/description.md@@ -0,0 +1 @@+Cross-reference tracker that finds @class-name mentions in Mermaid diagram text. extractRefs() parses @mentions from a diagram. getOutgoingRefs() returns what a class references. getIncomingRefs() scans all classes to find who references a given class. buildRefGraph() constructs the full reference graph across all classes.diff --git a/.omm/overall-architecture/refs/meta.yaml b/.omm/overall-architecture/refs/meta.yamlnew file mode 100644index 0000000..643959e--- /dev/null+++ b/.omm/overall-architecture/refs/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:26:13.992Z+updated: 2026-03-25T12:26:13.992Z+update_count: 1+last_field: description+kind: nested-class+title: refs+children: []+parentPath: []diff --git a/.omm/overall-architecture/server/api-handler/description.md b/.omm/overall-architecture/server/api-handler/description.mdnew file mode 100644index 0000000..0284039--- /dev/null+++ b/.omm/overall-architecture/server/api-handler/description.md@@ -0,0 +1 @@+REST API handler serving JSON endpoints: GET /api/classes (list all), GET /api/class/:name (show one), GET /api/class/:name/diff (diagram diff), GET /api/class/:name/refs (incoming + outgoing references). All responses include CORS headers for browser access.diff --git a/.omm/overall-architecture/server/api-handler/meta.yaml b/.omm/overall-architecture/server/api-handler/meta.yamlnew file mode 100644index 0000000..d37867e--- /dev/null+++ b/.omm/overall-architecture/server/api-handler/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:27:59.485Z+updated: 2026-03-25T12:27:59.486Z+update_count: 1+last_field: description+kind: nested-class+title: api-handler+children: []+parentPath:+ - serverdiff --git a/.omm/overall-architecture/server/description.md b/.omm/overall-architecture/server/description.mdnew file mode 100644index 0000000..d739106--- /dev/null+++ b/.omm/overall-architecture/server/description.md@@ -0,0 +1 @@+Built-in HTTP web viewer for browsing architecture diagrams locally. Serves a single-page HTML viewer at localhost, provides a JSON REST API for reading classes/diffs/refs, and uses Server-Sent Events (SSE) to push live-reload notifications when .omm/ files change. Auto-increments port if the default (3000) is in use.diff --git a/.omm/overall-architecture/server/diagram.mmd b/.omm/overall-architecture/server/diagram.mmdnew file mode 100644index 0000000..e7d182e--- /dev/null+++ b/.omm/overall-architecture/server/diagram.mmd@@ -0,0 +1,19 @@+graph LR+ http-server["HTTP Server\nsrc/server/index.ts"]+ api-handler["API Handler\nsrc/server/api.ts"]+ watcher["File Watcher\nsrc/server/watcher.ts"]+ viewer-html["Viewer HTML\nsrc/server/viewer.html"]++ http-server -->|"routes /api/* to"| api-handler+ http-server -->|"serves at /"| viewer-html+ http-server -->|"routes /events to"| watcher+ watcher -->|"watches .omm/ for changes"| sse-clients["SSE Clients"]+ api-handler -->|"reads classes via"| store["Store"]+ api-handler -->|"compares via"| diff["Diff Engine"]+ api-handler -->|"resolves via"| refs["Ref Tracker"]++ classDef external fill:#585b70,stroke:#585b70,color:#cdd6f4+ classDef entry fill:#89b4fa,stroke:#89b4fa,color:#1e1e2e++ class http-server entry+ class store,diff,refs,sse-clients externaldiff --git a/.omm/overall-architecture/server/http-server/description.md b/.omm/overall-architecture/server/http-server/description.mdnew file mode 100644index 0000000..979bbf6--- /dev/null+++ b/.omm/overall-architecture/server/http-server/description.md@@ -0,0 +1 @@+Node.js HTTP server (no framework). Routes requests to three handlers: `/api/*` to the API handler, `/events` to SSE watcher, and `/` to the viewer HTML. Injects the project name into the HTML via a script tag. Auto-retries on EADDRINUSE by incrementing the port.diff --git a/.omm/overall-architecture/server/http-server/meta.yaml b/.omm/overall-architecture/server/http-server/meta.yamlnew file mode 100644index 0000000..16edfc5--- /dev/null+++ b/.omm/overall-architecture/server/http-server/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:27:53.706Z+updated: 2026-03-25T12:27:53.706Z+update_count: 1+last_field: description+kind: nested-class+title: http-server+children: []+parentPath:+ - serverdiff --git a/.omm/overall-architecture/server/meta.yaml b/.omm/overall-architecture/server/meta.yamlnew file mode 100644index 0000000..6a926dd--- /dev/null+++ b/.omm/overall-architecture/server/meta.yaml@@ -0,0 +1,12 @@+created: 2026-03-25T12:27:38.477Z+updated: 2026-03-25T12:27:47.021Z+update_count: 2+last_field: diagram+kind: nested-class+title: server+children:+ - api-handler+ - http-server+ - viewer-html+ - watcher+parentPath: []diff --git a/.omm/overall-architecture/server/viewer-html/description.md b/.omm/overall-architecture/server/viewer-html/description.mdnew file mode 100644index 0000000..bbde9f5--- /dev/null+++ b/.omm/overall-architecture/server/viewer-html/description.md@@ -0,0 +1 @@+Single-file HTML/CSS/JS viewer application. Renders Mermaid diagrams in the browser using the Mermaid.js library. Provides navigation between classes, field viewing, diff visualization, and reference graph display. Receives live-reload events via SSE to auto-refresh when .omm/ files change.diff --git a/.omm/overall-architecture/server/viewer-html/meta.yaml b/.omm/overall-architecture/server/viewer-html/meta.yamlnew file mode 100644index 0000000..609662a--- /dev/null+++ b/.omm/overall-architecture/server/viewer-html/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:28:10.645Z+updated: 2026-03-25T12:28:10.646Z+update_count: 1+last_field: description+kind: nested-class+title: viewer-html+children: []+parentPath:+ - serverdiff --git a/.omm/overall-architecture/server/watcher/description.md b/.omm/overall-architecture/server/watcher/description.mdnew file mode 100644index 0000000..f2fecea--- /dev/null+++ b/.omm/overall-architecture/server/watcher/description.md@@ -0,0 +1 @@+File system watcher using fs.watch() with recursive mode on the .omm/ directory. Debounces rapid changes (300ms) and broadcasts SSE events to all connected clients. Manages a set of active SSE connections with automatic cleanup on disconnect.diff --git a/.omm/overall-architecture/server/watcher/meta.yaml b/.omm/overall-architecture/server/watcher/meta.yamlnew file mode 100644index 0000000..58516ba--- /dev/null+++ b/.omm/overall-architecture/server/watcher/meta.yaml@@ -0,0 +1,9 @@+created: 2026-03-25T12:28:04.985Z+updated: 2026-03-25T12:28:04.986Z+update_count: 1+last_field: description+kind: nested-class+title: watcher+children: []+parentPath:+ - serverdiff --git a/.omm/overall-architecture/store/description.md b/.omm/overall-architecture/store/description.mdnew file mode 100644index 0000000..9ab3611--- /dev/null+++ b/.omm/overall-architecture/store/description.md@@ -0,0 +1 @@+Filesystem-based storage engine for .omm/ architecture docs. Manages the .omm/ directory, class subdirectories, and field files. Provides CRUD operations: initOmm, listClasses, classExists, readField, writeField, showClass, deleteClass. Auto-creates .omm/ on write operations (lazy-init). When writing a diagram field, saves the previous version to meta for diffing.diff --git a/.omm/overall-architecture/store/meta.yaml b/.omm/overall-architecture/store/meta.yamlnew file mode 100644index 0000000..30cbd3d--- /dev/null+++ b/.omm/overall-architecture/store/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:25:56.699Z+updated: 2026-03-25T12:25:56.701Z+update_count: 1+last_field: description+kind: nested-class+title: store+children: []+parentPath: []diff --git a/.omm/overall-architecture/validator/description.md b/.omm/overall-architecture/validator/description.mdnew file mode 100644index 0000000..3dcfe2e--- /dev/null+++ b/.omm/overall-architecture/validator/description.md@@ -0,0 +1 @@+Diagram validation engine with rule-based checks. Validates: graph declaration presence, bracket balance (quote-aware), edge labels, classDef names and colors against the approved palette, self-references, missing cross-references, and node count (warns if <3 or >15). Returns structured ValidationResult with error/warning levels and rule names.diff --git a/.omm/overall-architecture/validator/meta.yaml b/.omm/overall-architecture/validator/meta.yamlnew file mode 100644index 0000000..837c181--- /dev/null+++ b/.omm/overall-architecture/validator/meta.yaml@@ -0,0 +1,8 @@+created: 2026-03-25T12:26:20.498Z+updated: 2026-03-25T12:26:20.498Z+update_count: 1+last_field: description+kind: nested-class+title: validator+children: []+parentPath: []diff --git a/.omm/serve-layer/constraint.md b/.omm/serve-layer/constraint.mddeleted file mode 100644index 81303c9..0000000--- a/.omm/serve-layer/constraint.md+++ /dev/null@@ -1,3 +0,0 @@-- The API is strictly read-only: no POST/PUT/DELETE routes — all writes go through the CLI-- `viewer.html` is served from `dist/` in production (bundled by tsup), with fallback to `src/server/viewer.html` for dev-- Project name is injected server-side via `window.__projectName` script tag before `</head>` — not passed via APIdiff --git a/.omm/serve-layer/description.md b/.omm/serve-layer/description.mddeleted file mode 100644index 4b66c2a..0000000--- a/.omm/serve-layer/description.md+++ /dev/null@@ -1 +0,0 @@-The local HTTP server started by `omm serve`. Serves the viewer HTML, a read-only JSON API, and a Server-Sent Events stream for live reload. Read this if you're modifying the server or adding API endpoints.diff --git a/.omm/serve-layer/diagram.mmd b/.omm/serve-layer/diagram.mmddeleted file mode 100644index 95d1c8c..0000000--- a/.omm/serve-layer/diagram.mmd+++ /dev/null@@ -1,13 +0,0 @@-graph LR- classDef entry fill:#89b4fa,stroke:#89b4fa,color:#1e1e2e- classDef store fill:#a6e3a1,stroke:#a6e3a1,color:#1e1e2e-- browser["Browser\n(localhost)"]:::entry- browser -->|"GET /"| html_handler["HTML Handler\nsrc/server/index.ts"]- html_handler -->|"injects project name"| viewer_html["viewer.html\nsrc/server/viewer.html"]- browser -->|"GET /api/classes\nGET /api/class/:name\nGET /api/class/:name/diff\nGET /api/class/:name/refs"| api["API Handler\nsrc/server/api.ts"]- api -->|"read only"| store["Store / Lib\nsrc/lib/store.ts"]:::store- browser -->|"GET /events (SSE)"| sse["SSE Endpoint\nsrc/server/index.ts"]- sse --> watcher["File Watcher\nsrc/server/watcher.ts"]- watcher -->|"fs.watch .omm/ recursive"| omm_dir[".omm/\nfile system"]:::store- watcher -->|"broadcast change event (300ms debounce)"| ssediff --git a/.omm/serve-layer/meta.yaml b/.omm/serve-layer/meta.yamldeleted file mode 100644index a90d230..0000000--- a/.omm/serve-layer/meta.yaml+++ /dev/null@@ -1,6 +0,0 @@-created: 2026-03-22T06:06:21.806Z-updated: 2026-03-22T06:06:26.692Z-update_count: 4-last_field: note-git_commit: 55c1fe5-git_branch: maindiff --git a/.omm/serve-layer/note.md b/.omm/serve-layer/note.mddeleted file mode 100644index 3c1f45a..0000000--- a/.omm/serve-layer/note.md+++ /dev/null@@ -1 +0,0 @@-The SSE watcher uses a 300ms debounce to coalesce rapid file changes (e.g., Claude writing multiple fields in sequence) into a single browser reload event.diff --git a/.omm/storage-model/concern.md b/.omm/storage-model/concern.mddeleted file mode 100644index f9ad71e..0000000--- a/.omm/storage-model/concern.md+++ /dev/null@@ -1,2 +0,0 @@-- `prev_diagram` only stores the immediately previous version — no full history; multiple rapid writes lose intermediate states-- No locking: concurrent CLI writes to the same class could corrupt meta.yaml (unlikely in practice but possible if parallelized)diff --git a/.omm/storage-model/constraint.md b/.omm/storage-model/constraint.mddeleted file mode 100644index 74c6018..0000000--- a/.omm/storage-model/constraint.md+++ /dev/null@@ -1,3 +0,0 @@-- `prev_diagram` in meta.yaml is automatically saved whenever the `diagram` field is overwritten — enables diff without git-- Never write class data through the HTTP API; only `src/lib/store.ts` may write to `.omm/`-- `config.yaml` lives directly in `.omm/` (not in a class dir); class dirs are identified by `isDirectory()` filter in `listClasses()`diff --git a/.omm/storage-model/description.md b/.omm/storage-model/description.mddeleted file mode 100644index 31cae23..0000000--- a/.omm/storage-model/description.md+++ /dev/null@@ -1 +0,0 @@-How omm persists architecture data as a directory tree of plain text files. Read this if you're working on the store, meta tracking, or the diff system.diff --git a/.omm/storage-model/diagram.mmd b/.omm/storage-model/diagram.mmddeleted file mode 100644index 6ddc3cf..0000000--- a/.omm/storage-model/diagram.mmd+++ /dev/null@@ -1,18 +0,0 @@-graph TD- classDef store fill:#a6e3a1,stroke:#a6e3a1,color:#1e1e2e-- omm_dir[".omm/\nproject root"]:::store- omm_dir --> config[".omm/config.yaml\nversion + cloud.project_slug"]- omm_dir --> class_dir[".omm/<class>/\none dir per class"]:::store- class_dir --> description["description.md\nhuman-readable summary"]- class_dir --> diagram["diagram.mmd\nmermaid source"]- class_dir --> constraint["constraint.md"]- class_dir --> concern["concern.md"]- class_dir --> context["context.md"]- class_dir --> todo["todo.md"]- class_dir --> note["note.md"]- class_dir --> meta["meta.yaml\ncreated/updated/update_count\nlast_field/git_commit/prev_diagram"]-- store_ts["Store API\nsrc/lib/store.ts"] -->|"read/write"| omm_dir- meta_ts["Meta Updater\nsrc/lib/meta.ts"] -->|"auto-update on write"| meta- store_ts -->|"save prev on diagram write"| metadiff --git a/.omm/storage-model/meta.yaml b/.omm/storage-model/meta.yamldeleted file mode 100644index 40bcbef..0000000--- a/.omm/storage-model/meta.yaml+++ /dev/null@@ -1,6 +0,0 @@-created: 2026-03-22T06:06:06.850Z-updated: 2026-03-22T06:06:13.178Z-update_count: 4-last_field: concern-git_commit: 55c1fe5-git_branch: maindiff --git a/.omm/viewer-rendering/concern.md b/.omm/viewer-rendering/concern.mddeleted file mode 100644index f92a63a..0000000--- a/.omm/viewer-rendering/concern.md+++ /dev/null@@ -1,2 +0,0 @@-- Single large HTML file (~2000+ lines) with inline CSS and JS — hard to maintain as complexity grows; no component abstraction-- Custom Mermaid parser is a subset of Mermaid syntax — edge cases in Mermaid spec may not render correctlydiff --git a/.omm/viewer-rendering/constraint.md b/.omm/viewer-rendering/constraint.mddeleted file mode 100644index 6ab71cb..0000000--- a/.omm/viewer-rendering/constraint.md+++ /dev/null@@ -1,3 +0,0 @@-- Mermaid is NOT rendered via the official mermaid.js library — the viewer uses a custom dagre-based layout engine for full control over node interaction and styling-- `@class-name` nodes in diagrams must be recognized as drill-down references; do not use `@` prefix for non-class nodes-- viewer.html is a single self-contained file (no build step for frontend); all CSS/JS is inlinediff --git a/.omm/viewer-rendering/context.md b/.omm/viewer-rendering/context.mddeleted file mode 100644index 064d106..0000000--- a/.omm/viewer-rendering/context.md+++ /dev/null@@ -1,7 +0,0 @@-The viewer deliberately avoids the official mermaid.js renderer to enable:-1. Clickable nodes that navigate between classes-2. Custom `@ref` node rendering (glow, expand, nested group reveal)-3. Fine-grained zoom/pan control and focus-exempt behavior-4. Inline detail sidebar driven by the same class data--The dagre library handles graph layout; the viewer draws SVG manually on top of dagre's position output.diff --git a/.omm/viewer-rendering/description.md b/.omm/viewer-rendering/description.mddeleted file mode 100644index 06e1d43..0000000--- a/.omm/viewer-rendering/description.md+++ /dev/null@@ -1 +0,0 @@-The browser-side viewer in viewer.html: sidebar navigation, Mermaid diagram rendering (custom dagre-based engine), and the detail sidebar. Read this if you're modifying how diagrams look or how class navigation works.diff --git a/.omm/viewer-rendering/diagram.mmd b/.omm/viewer-rendering/diagram.mmddeleted file mode 100644index d70733c..0000000--- a/.omm/viewer-rendering/diagram.mmd+++ /dev/null@@ -1,13 +0,0 @@-graph TD- classDef entry fill:#89b4fa,stroke:#89b4fa,color:#1e1e2e-- sse["SSE /events\n(live reload)"]:::entry- api["REST API\n/api/*"]:::entry- sse -->|"change event → refetch"| state["App State\nclasses / activeClass / data"]- api -->|"fetch on load + navigate"| state- state -->|"render"| nav["Nav Sidebar\nclass list + tree"]- state -->|"render"| diagram_canvas["Diagram Canvas\ndagre layout engine"]- state -->|"render"| detail_sidebar["Detail Sidebar\ndescription / context / constraints\nconcerns / todos / notes"]- diagram_canvas -->|"@class-name nodes"| nav_ref["Clickable Sub-diagram\ndrills into referenced class"]- diagram_canvas -->|"node click"| detail_sidebar- detail_sidebar -->|"outgoing refs"| nav_refdiff --git a/.omm/viewer-rendering/meta.yaml b/.omm/viewer-rendering/meta.yamldeleted file mode 100644index 985b65c..0000000--- a/.omm/viewer-rendering/meta.yaml+++ /dev/null@@ -1,6 +0,0 @@-created: 2026-03-22T06:06:37.243Z-updated: 2026-03-22T06:06:47.420Z-update_count: 5-last_field: concern-git_commit: 55c1fe5-git_branch: maindiff --git a/CLAUDE.md b/CLAUDE.mdnew file mode 100644index 0000000..6acaa5f--- /dev/null+++ b/CLAUDE.md@@ -0,0 +1,32 @@+# Project Rules++## README Localization++- `README.md` (English) is the source of truth+- Maintain translations: `README.ko.md`, `README.ja.md`, `README.zh.md`+- Every README (including English) must have language links at the top:+ ```+ [English](./README.md) | [한국어](./README.ko.md) | [日本語](./README.ja.md) | [中文](./README.zh.md)+ ```+- Translated READMEs include a disclaimer at the top:+ > This document was translated from the English README. Some phrasing may be unnatural.+- When updating `README.md`, update all translations in the same commit+- Translations can be machine-generated but should be reviewed for obvious errors++## Versioning++- Follow [Semantic Versioning](https://semver.org/)+- Sync version across: `package.json`, `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json`++## Commits++- Use [Conventional Commits](https://www.conventionalcommits.org/)+- Co-author tag for AI-assisted commits++## Terminology++- "element" — any architectural unit in `.omm/`+- "perspective" — top-level element only+- "group" — element with children (rendered as expandable box in viewer)+- "leaf" — element without children+- Do not use "class" in user-facing strings (internal code names like `listClasses` are fine)diff --git a/README.md b/README.mdindex c84ecb4..fb0d2a2 100644--- a/README.md+++ b/README.md@@ -1,194 +1,136 @@-# oh-my-mermaid (omm)+[English](./README.md) | [한국어](./README.ko.md) | [日本語](./README.ja.md) | [中文](./README.zh.md)-[](https://www.npmjs.com/package/oh-my-mermaid)-[](./LICENSE)+<p align="center">+ <img src="./docs/logo.jpg" alt="omm logo" width="80"/>+ <br/>+ <h1>Oh-my-mermaid</h1>+</p>-**Turn complex codebases into clear, navigable architecture diagrams with AI coding tools.**+<p align="center">+ <a href="https://www.npmjs.com/package/oh-my-mermaid"><img src="https://img.shields.io/npm/v/oh-my-mermaid" alt="npm version"/></a>+ <a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"/></a>+</p>-> `omm setup` → `/omm-scan` → done. Your architecture docs write themselves.+<p align="center">+ AI writes code in seconds. Humans understand it in hours.<br/>+ But skip understanding, the codebase becomes a black box — even to you.<br/><br/>+ <strong>omm closes the gap — architecture docs, generated by AI, for humans.</strong>+</p>-<video src="https://github.com/user-attachments/assets/2de6c496-b9a6-4734-8059-282ab130c1bc" width="100%" autoplay loop muted playsinline></video>+------## Why?+## Quick Start-Plain Mermaid diagrams are flat — one file, one diagram, no connections between them.+Paste this in your terminal:-omm structures your architecture as **interconnected classes** that you can drill into. Use `@class-name` references to nest diagrams inside each other, zoom out to see the full picture, or click into a subsystem to focus on the details. Each class carries not just a diagram, but also context, constraints, and concerns — so the *why* behind your architecture lives right next to the *what*.+```bash+npm install -g oh-my-mermaid && omm setup+```-Your AI coding tool does the heavy lifting: it analyzes your code and generates everything automatically.+Then open your AI coding tool and use the `/omm-scan` skill:```-Your code → AI analyzes → .omm/ stores diagrams → Live viewer in browser+/omm-scan```-## Prerequisites--- [Node.js](https://nodejs.org/) 18+-- An AI coding tool: [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Codex](https://github.com/openai/codex), [Cursor](https://cursor.sh/), or [Antigravity](https://github.com/ArcadeAI/antigravity)--## Install+That's it. View the result:```bash-npm install -g oh-my-mermaid-omm setup+omm view```-`omm setup` auto-detects installed AI coding tools and registers the `/omm-scan` skill for each. Run `omm setup --list` to see what was detected.+## Example-## Quick Start+> omm scanned itself. This is what it found.-```bash-# 1. Install-npm install -g oh-my-mermaid && omm setup--# 2. Open your AI coding tool in a project-cd your-project-claude # or codex, cursor, etc.--# 3. Scan your architecture-/omm-scan--# 4. View in browser-omm view-# → http://localhost:3000-```--`/omm-scan` analyzes your code and generates architecture docs in the `.omm/` directory.-To focus on a specific area, pass a topic: `/omm-scan auth flow`.+<table><tr>+<td width="50%"><img src="./docs/screenshot.png" alt="omm viewer"/></td>+<td width="50%"><img src="./docs/demo.gif" alt="omm scan demo"/></td>+</tr></table>## How It Works-### The `.omm/` directory+Your AI analyzes the codebase and generates **perspectives** — different lenses on your architecture (structure, data flow, integrations...). Each perspective contains a Mermaid diagram and documentation fields.-omm creates an `.omm/` directory at your project root. Each architectural unit ("class") gets its own folder with up to 7 documentation fields:+Every node gets **recursively analyzed**. Complex nodes become nested child elements with their own diagrams. Simple ones stay as leaves. The filesystem reflects the tree:```.omm/-├── config.yaml-├── overall-architecture/-│ ├── description.md # What this diagram represents-│ ├── diagram.mmd # Mermaid flowchart code-│ ├── context.md # Why this architecture exists-│ ├── constraint.md # Rules that must be followed-│ ├── concern.md # Risks, tech debt, known issues-│ ├── todo.md # Planned improvements-│ ├── note.md # Additional notes-│ └── meta.yaml # Auto-managed (timestamps, git info)-├── auth-flow/-│ └── ...-└── data-pipeline/- └── ...+├── overall-architecture/ ← perspective+│ ├── description.md+│ ├── diagram.mmd+│ ├── context.md+│ ├── main-process/ ← nested element+│ │ ├── description.md+│ │ ├── diagram.mmd+│ │ └── auth-service/ ← deeper nesting+│ │ └── ...+│ └── renderer/+│ └── ...+├── data-flow/+└── external-integrations/```-### Cross-references+The viewer auto-detects nesting from the filesystem — elements with children render as expandable groups, others as nodes.-Use `@class-name` in diagram nodes to link between classes:--```text-graph LR- Client -->|"HTTP"| @auth-flow[Auth Service]- Client -->|"WebSocket"| @data-pipeline[Data Pipeline]-```+Each element carries up to 7 fields: `description`, `diagram`, `context`, `constraint`, `concern`, `todo`, `note`.-Click `@auth-flow` in the viewer to navigate to that class.--## CLI Commands--### Basics--```bash-omm setup # Register skills with detected AI tools-omm setup --list # Show detected platforms and status-omm list # List all classes-omm show <class> # Display all fields for a class-omm status # Overview of all classes-omm delete <class> # Delete a class-```--### Read / Write fields+## CLI```bash-omm <class> <field> # Read a field-omm <class> <field> "content" # Write to a field-omm <class> <field> - # Write from stdin (multiline)+omm setup # Register skills with your AI tools+omm view # Open interactive viewer+omm config language ko # Set content language+omm update # Update to latest version```-Available fields: `description`, `diagram`, `context`, `constraint`, `concern`, `todo`, `note`--### Analysis--```bash-omm diff <class> # Compare current vs previous diagram-omm refs <class> # Show classes that reference this one-omm refs --reverse <class> # Show classes this one references-```+Run `omm help` for the full command list.-### Local viewer+## Skills-```bash-omm view # Start live viewer at http://localhost:3000-omm view --port 8080 # Custom port-```+Skills are commands you run **inside your AI coding tool** (not the terminal). They start with `/`.-Auto-refreshes in the browser when files change (via SSE).+| Skill | What it does |+| --- | --- |+| `/omm-scan` | Analyze codebase → generate architecture docs |+| `/omm-push` | Login + link + push to cloud in one step |## Cloud-Share your architecture with your team via [ohmymermaid.com](https://ohmymermaid.com).+You can store your architecture in the cloud via [ohmymermaid.com](https://ohmymermaid.com).```bash-omm login # Sign in (opens browser)-omm link # Link project to cloud-omm push # Upload to cloud-omm share # Print shareable URL--omm pull # Download from cloud-omm logout # Sign out+omm login && omm link && omm push```-Or use `/omm-push` inside Claude Code to handle login, link, and push in one step.+It's private by default. Share with your team, or make it public like [this example](https://ohmymermaid.com/share/c47e20a7063c231760361ed9cb9ec4b6).-## AI Coding Tool Skills+## Supported AI Tools-| Skill | Description |-|-------|-------------|-| `/omm-scan` | Analyze full codebase → auto-generate architecture docs |-| `/omm-scan [topic]` | Focus on a specific area (e.g. `/omm-scan auth flow`) |-| `/omm-push` | Login + link + push to cloud in one step |+| Platform | Setup |+| --- | --- |+| Claude Code | `omm setup claude` |+| Codex | `omm setup codex` |+| Cursor | `omm setup cursor` |+| OpenClaw | `omm setup openclaw` |+| Antigravity | `omm setup antigravity` |-### Supported Platforms+Run `omm setup` to auto-detect and configure all installed tools.-| Platform | Status | Setup method |-|----------|--------|--------------|-| Claude Code | Supported | Plugin marketplace registration |-| Codex | Supported | Symlink to `~/.agents/skills/` |-| Cursor | Supported | `.cursor-plugin/` auto-discovery |-| OpenClaw | Supported | Symlink to `~/.openclaw/skills/` |-| Antigravity | Supported | Symlink to `~/.gemini/antigravity/skills/` |+## Roadmap-## Development+See [docs/ROADMAP.md](./docs/ROADMAP.md).++## Development & Contributing```bashgit clone https://github.com/oh-my-mermaid/oh-my-mermaid.gitcd oh-my-mermaid-npm install-npm run build--# Watch mode-npm run dev--# Test+npm install && npm run buildnpm test```-## Contributing--Issues and PRs are welcome.--1. Fork → branch → change → PR-2. Use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages+Issues and PRs welcome. Use [Conventional Commits](https://www.conventionalcommits.org/).## Licensediff --git a/docs/ROADMAP.md b/docs/ROADMAP.mdnew file mode 100644index 0000000..0236f30--- /dev/null+++ b/docs/ROADMAP.md@@ -0,0 +1,15 @@+# Roadmap++## Planned++### Sub-agent scan pipeline+Split `/omm-scan` from a single skill into a multi-agent pipeline — parallel analysis per perspective, reduced token usage, faster scans.++### Incremental analysis+Detect changed files since last scan and update only affected perspectives and elements — skip unchanged subtrees.++### AI-powered search in viewer+Natural language search across architecture docs — "where does auth happen?" finds relevant elements across perspectives.++### Guide & onboarding skill+`/omm-guide` skill that walks new developers through the architecture interactively using the generated `.omm/` docs as context.diff --git a/docs/demo.gif b/docs/demo.gifnew file mode 100644index 0000000..9636007Binary files /dev/null and b/docs/demo.gif differdiff --git a/docs/logo.jpg b/docs/logo.jpgnew file mode 100644index 0000000..1efe1bcBinary files /dev/null and b/docs/logo.jpg differdiff --git a/package-lock.json b/package-lock.jsonindex 58957f7..f650646 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "oh-my-mermaid",- "version": "0.1.8",+ "version": "0.2.0","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "oh-my-mermaid",- "version": "0.1.8",+ "version": "0.2.0","license": "MIT","dependencies": {"yaml": "^2.8.3"diff --git a/package.json b/package.jsonindex 40aefc1..3df5742 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "oh-my-mermaid",- "version": "0.1.8",+ "version": "0.2.0","description": "Architecture mirror for vibe coding — CLI + Claude Code skills","type": "module","bin": {diff --git a/src/cli.ts b/src/cli.tsindex dc0ced8..edacbe1 100644--- a/src/cli.ts+++ b/src/cli.ts@@ -184,7 +184,7 @@ async function main(): Promise<void> {return;case 'link':- commandLink(args[1]);+ await commandLink(args[1]);return;case 'push':diff --git a/src/commands/link.ts b/src/commands/link.tsindex 1e661ba..f99d4af 100644--- a/src/commands/link.ts+++ b/src/commands/link.ts@@ -1,13 +1,87 @@import fs from 'node:fs';import path from 'node:path';+import readline from 'node:readline';import YAML from 'yaml';import { ensureOmmForWrite, getOmmDir } from '../lib/store.js';-import { getDefaultOrg } from '../lib/cloud.js';+import { getToken, getDefaultOrg, getApiUrl, apiRequest } from '../lib/cloud.js';-export function commandLink(input?: string): void {+interface OrgInfo {+ slug: string;+ name: string;+ plan: string;+ role: string;+ is_personal: boolean;+}++function prompt(question: string): Promise<string> {+ const rl = readline.createInterface({ input: process.stdin, output: process.stderr });+ return new Promise((resolve) => {+ rl.question(question, (answer) => {+ rl.close();+ resolve(answer.trim());+ });+ });+}++async function fetchOrgs(): Promise<OrgInfo[]> {+ const res = await apiRequest('GET', '/api/cli/orgs');+ if (!res.ok) {+ process.stderr.write(`error: failed to fetch organizations (${res.status})\n`);+ process.exit(1);+ }+ const data = await res.json() as { orgs?: OrgInfo[] };+ return data.orgs ?? [];+}++async function selectOrg(): Promise<string> {+ const orgs = await fetchOrgs();++ if (orgs.length === 0) {+ const apiUrl = getApiUrl();+ process.stderr.write(+ `error: no organizations found.\n` ++ `Set your handle at ${apiUrl}/auth/login to create your personal organization.\n`+ );+ process.exit(1);+ }++ if (orgs.length === 1) {+ process.stderr.write(`Using org: ${orgs[0].slug}\n`);+ return orgs[0].slug;+ }++ // Multiple orgs — let user pick+ const defaultOrg = getDefaultOrg();+ process.stderr.write(`\nSelect an organization:\n\n`);+ for (let i = 0; i < orgs.length; i++) {+ const org = orgs[i];+ const marker = org.slug === defaultOrg ? '*' : ' ';+ const label = org.is_personal ? ' (personal)' : '';+ process.stderr.write(` ${marker} ${i + 1}) ${org.slug}${label} [${org.plan}]\n`);+ }+ process.stderr.write('\n');++ const answer = await prompt(`Enter number (1-${orgs.length}): `);+ const idx = parseInt(answer, 10) - 1;++ if (isNaN(idx) || idx < 0 || idx >= orgs.length) {+ process.stderr.write('error: invalid selection.\n');+ process.exit(1);+ }++ return orgs[idx].slug;+}++export async function commandLink(input?: string): Promise<void> {ensureOmmForWrite();- let orgSlug: string | undefined;+ const token = getToken();+ if (!token) {+ process.stderr.write("error: not logged in. Run 'omm login' first.\n");+ process.exit(1);+ }++ let orgSlug: string;let projectSlug: string;if (input && input.includes('/')) {@@ -20,9 +94,10 @@ export function commandLink(input?: string): void {orgSlug = parts[0];projectSlug = parts[1];} else {- // Just project slug — use default org+ // Project slug from input or cwd nameprojectSlug = input || path.basename(process.cwd());- orgSlug = getDefaultOrg() ?? undefined;+ // Select org interactively+ orgSlug = await selectOrg();}const configPath = path.join(getOmmDir(), 'config.yaml');@@ -32,17 +107,13 @@ export function commandLink(input?: string): void {config = (YAML.parse(raw) as Record<string, unknown>) || {};}- const cloudConfig: Record<string, unknown> = {+ config.cloud = {...(config.cloud as Record<string, unknown> | undefined),project_slug: projectSlug,+ org_slug: orgSlug,};- if (orgSlug) {- cloudConfig.org_slug = orgSlug;- }- config.cloud = cloudConfig;fs.writeFileSync(configPath, YAML.stringify(config), 'utf-8');- const display = orgSlug ? `${orgSlug}/${projectSlug}` : projectSlug;- process.stderr.write(`Linked to ${display}. Run 'omm push' to upload.\n`);+ process.stderr.write(`Linked to ${orgSlug}/${projectSlug}. Run 'omm push' to upload.\n`);}diff --git a/src/commands/login.ts b/src/commands/login.tsindex 7e908eb..8287560 100644--- a/src/commands/login.ts+++ b/src/commands/login.ts@@ -37,10 +37,10 @@ export async function commandLogin(): Promise<void> {res.writeHead(200, { 'Content-Type': 'text/html' });res.end(`- <html><body style="background:#1e1e2e;color:#a6e3a1;font-family:monospace;display:flex;align-items:center;justify-content:center;height:100vh;margin:0">- <div style="text-align:center">- <h2>${token ? 'Login successful!' : 'Login failed.'}</h2>- <p style="color:#a6adc8">${token ? 'You can close this tab and return to your terminal.' : 'No token received.'}</p>+ <html><body style="background:#0a0a0a;color:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0">+ <div style="background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.1);border-radius:12px;padding:32px;max-width:360px;width:100%;text-align:center">+ <h2 style="font-size:14px;font-weight:600;margin:0 0 8px">${token ? 'Login successful!' : 'Login failed.'}</h2>+ <p style="font-size:12px;color:rgba(255,255,255,0.4);margin:0">${token ? 'You can close this tab and return to your terminal.' : 'No token received.'}</p></div></body></html>`);diff --git a/src/server/viewer.html b/src/server/viewer.htmlindex c290359..8352abd 100644--- a/src/server/viewer.html+++ b/src/server/viewer.html@@ -278,8 +278,7 @@ body.light .reg-node:hover .nshape { stroke: #000 !important; }width: 36px; height: 4px;background: #444; border-radius: 2px;}- .hud { right: 8px; top: 8px; }- .hud .hbtn { width: 28px; height: 28px; font-size: 12px; }+ .float-controls { display: none; }}</style></head>@@ -1011,6 +1010,41 @@ window.addEventListener('mouseup', () => {if (panning) { panning = false; updateCursor(); }});+// Touch: pan + pinch zoom+(function() {+ var touchStart = null, touchDist = null, touchScale = null;+ canvasWrap.addEventListener('touchstart', function(e) {+ if (e.touches.length === 1) {+ touchStart = { x: e.touches[0].clientX, y: e.touches[0].clientY, vpX: vpX, vpY: vpY };+ } else if (e.touches.length === 2) {+ touchStart = null;+ var dx = e.touches[1].clientX - e.touches[0].clientX;+ var dy = e.touches[1].clientY - e.touches[0].clientY;+ touchDist = Math.hypot(dx, dy);+ touchScale = vpScale;+ }+ }, { passive: true });+ canvasWrap.addEventListener('touchmove', function(e) {+ if (e.touches.length === 1 && touchStart) {+ e.preventDefault();+ vpX = touchStart.vpX + (e.touches[0].clientX - touchStart.x);+ vpY = touchStart.vpY + (e.touches[0].clientY - touchStart.y);+ applyTransform();+ } else if (e.touches.length === 2 && touchDist) {+ e.preventDefault();+ var dx = e.touches[1].clientX - e.touches[0].clientX;+ var dy = e.touches[1].clientY - e.touches[0].clientY;+ var newDist = Math.hypot(dx, dy);+ var scale = touchScale * (newDist / touchDist);+ vpScale = Math.min(10, Math.max(0.05, scale));+ applyTransform();+ }+ }, { passive: false });+ canvasWrap.addEventListener('touchend', function() {+ touchStart = null; touchDist = null; touchScale = null;+ });+})();+// close sidebar when clicking empty canvas areacanvasWrap.addEventListener('click', e => {if (!e.target.closest('[onclick]')) closeSidebar();