# cosmicstack-labs/mercury-agent-skills architecture

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

- Interactive diagram: https://gitdiagram.com/cosmicstack-labs/mercury-agent-skills
- Repository: https://github.com/cosmicstack-labs/mercury-agent-skills

## Overview

1. **What this repo is**
   Mercury Skills is a **content registry**, not an application with business logic. The primary artifacts are hundreds of standalone `SKILL.md` playbooks organized by category. These are meant to be consumed directly by AI agent runtimes, including Mercury, Claude Code, Codex CLI, OpenClaw, Hermes, Cursor, and Gemini CLI.

2. **Source-of-truth content layer**
   The core repository structure is `categories/<category>/<skill>/SKILL.md`. Each skill is a single Markdown document with YAML frontmatter plus the instructional body. This makes the repository a mostly static, file-based knowledge library where each skill is independently installable and versionable.

3. **Taxonomy and navigation boundaries**
   Categories are the main organizational boundary: AI/ML, backend, frontend, DevOps, automation, media download, PDF generation, etc. The category folders provide the human and machine-readable grouping used by the catalog, browse UI, and CLI search/install flows. `CATALOG.md` acts as the full index over this taxonomy.

4. **Generated registry data**
   `docs/data/skills.json` is the compiled registry dataset used by the website. The presence of `scripts/build_data.py` strongly suggests a build step that scans the category tree and extracts frontmatter/content metadata into a single machine-readable index. This is the main transformation boundary between authored markdown and consumable site data.

5. **Static browse-and-install web surface**
   The `docs/` directory is a client-side web app / static site: `index.html`, `app.js`, `style.css`, and bundled data under `docs/data/`. It powers browsing, search, per-skill detail pages, install instructions, leaderboard-like views, and shareable metadata. Architecturally, it is a read-only presentation layer over generated JSON.

6. **Distribution and consumption flows**
   There are two primary downstream consumption paths:
   - **Direct file consumption**: users or agents clone the repo or install individual skill files into agent-specific skills directories.
   - **Registry/web consumption**: the website and its JSON API surface provide searchable discovery and copy-paste install commands.
   The repo is therefore both a source library and an install distribution format.

7. **CLI and automation tooling**
   `scripts/package.json`, `scripts/package-lock.json`, and `scripts/zomato-order.js` indicate a small Node-based tooling surface for repository-related automation or demos. `scripts/export-data.sh` suggests shell-driven export/build orchestration, while `scripts/build_data.py` is the main data compilation utility. The tooling boundary is lightweight and exists to support publishing and data generation, not runtime serving.

8. **Publishing/update pipeline**
   The README says new contributions land on `skills.mercuryagent.sh` “within the hour” via automated sync. That implies an external deployment pipeline that consumes this repo, rebuilds the registry data, and republishes the static site and JSON endpoints. The repo itself is the authoritative content source; the website is a derived deployment.

9. **External services and runtime boundaries**
   The canonical web experience lives at `skills.mercuryagent.sh`, while `mercuryagent.sh` is the agent runtime ecosystem that consumes these skills. The repo does not appear to depend on a backend database or application server; its architecture is centered on static files plus generated data, with external services handling hosting and agent execution.

10. **How to diagram it**
   A good architecture diagram should show:
   - **Authors/contributors** editing `SKILL.md` files in category folders
   - A **build/export step** that compiles repo contents into `skills.json` and related catalog artifacts
   - A **static docs site** that reads the generated JSON and serves browsing/install UX
   - **Agent runtimes / CLI tools** consuming individual `SKILL.md` files directly
   - An **automation/deployment pipeline** syncing the repo to the public registry site

Overall, this repo is best modeled as a **content registry with generated catalog data and a static discovery layer**, rather than as an application with stateful services.

Main entry points: [`categories/ai-ml/agent-audit-logging/SKILL.md`](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/categories/ai-ml/agent-audit-logging/SKILL.md) (SKILL.md files), [`docs`](https://github.com/cosmicstack-labs/mercury-agent-skills/tree/main/docs) (Docs Site), [`docs/data/skills.json`](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/docs/data/skills.json) (skills.json), [`scripts/build_data.py`](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/build_data.py) (Build Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Skill Library"]
  node_categories["Categories<br/>taxonomy tree"]
  node_skill_docs["SKILL.md files<br/>skill playbook<br/>[SKILL.md]"]
  node_catalog_md["Catalog<br/>index markdown<br/>[CATALOG.md]"]
  node_readme["README<br/>repo guide<br/>[README.md]"]
end

subgraph group_registry["Catalog Pipeline"]
  node_build_data_py["Build Data<br/>python compiler<br/>[build_data.py]"]
  node_skills_json[("skills.json<br/>registry dataset<br/>[skills.json]")]
  node_export_sh["Export Script<br/>shell orchestration<br/>[export-data.sh]"]
end

subgraph group_site["Docs Site"]
  node_docs_site["Docs Site<br/>static web app"]
  node_index_html["Index Page<br/>site entry<br/>[index.html]"]
  node_app_js["App Logic<br/>frontend script<br/>[app.js]"]
  node_style_css["Styles<br/>presentation css<br/>[style.css]"]
end

subgraph group_tooling["Automation Tools"]
  node_package_json["Package Config<br/>node tooling<br/>[package.json]"]
  node_package_lock["Lockfile<br/>node dependency lock<br/>[package-lock.json]"]
  node_zomato_js["Zomato Tool<br/>node utility<br/>[zomato-order.js]"]
end

subgraph group_consumers["Downstream Consumers"]
  node_agents{{"Agent Runtimes<br/>ai consumers"}}
  node_publish_site{{"Public Site<br/>deployment target"}}
end

node_categories -->|"contains"| node_skill_docs
node_skill_docs -->|"indexed by"| node_catalog_md
node_skill_docs -->|"compiled by"| node_build_data_py
node_categories -->|"scanned by"| node_build_data_py
node_build_data_py -->|"produces"| node_skills_json
node_export_sh -->|"orchestrates"| node_build_data_py
node_export_sh -->|"writes"| node_skills_json
node_skills_json -->|"feeds"| node_docs_site
node_docs_site -->|"starts with"| node_index_html
node_docs_site -->|"runs"| node_app_js
node_docs_site -->|"styled by"| node_style_css
node_package_json -->|"defines"| node_zomato_js
node_package_json -->|"locks"| node_package_lock
node_zomato_js -.->|"supports"| node_agents
node_skill_docs -->|"consumed by"| node_agents
node_skills_json -->|"deployed to"| node_publish_site
node_readme -.->|"describes"| node_publish_site

click node_categories "https://github.com/cosmicstack-labs/mercury-agent-skills/tree/main/categories"
click node_skill_docs "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/categories/ai-ml/agent-audit-logging/SKILL.md"
click node_catalog_md "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/CATALOG.md"
click node_readme "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/README.md"
click node_build_data_py "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/build_data.py"
click node_skills_json "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/docs/data/skills.json"
click node_export_sh "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/export-data.sh"
click node_docs_site "https://github.com/cosmicstack-labs/mercury-agent-skills/tree/main/docs"
click node_index_html "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/docs/index.html"
click node_app_js "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/docs/app.js"
click node_style_css "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/docs/style.css"
click node_package_json "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/package.json"
click node_package_lock "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/package-lock.json"
click node_zomato_js "https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/zomato-order.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_categories,node_skill_docs,node_catalog_md,node_readme toneBlue
class node_build_data_py,node_skills_json,node_export_sh toneAmber
class node_docs_site,node_index_html,node_app_js,node_style_css toneMint
class node_package_json,node_package_lock,node_zomato_js toneRose
class node_agents,node_publish_site toneIndigo
```

## Components

### Skill Library

Authoritative SKILL.md playbooks organized by category.

- [Categories](https://github.com/cosmicstack-labs/mercury-agent-skills/tree/main/categories): taxonomy tree · Top-level organization for skills across domains like backend, frontend, DevOps, and more. · `categories`
- [SKILL.md files](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/categories/ai-ml/agent-audit-logging/SKILL.md): skill playbook · Standalone Markdown skill files with frontmatter and instructional content. · `categories/ai-ml/agent-audit-logging/SKILL.md`
- [Catalog](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/CATALOG.md): index markdown · Human-readable global index over the skill taxonomy. · `CATALOG.md`
- [README](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/README.md): repo guide · Repository overview, contribution guidance, and publishing context. · `README.md`

### Catalog Pipeline

Indexing and compilation from authored markdown into machine-readable registry data.

- [Build Data](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/build_data.py): python compiler · Scans categories and extracts metadata into registry JSON. · `scripts/build_data.py`
- [skills.json](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/docs/data/skills.json): registry dataset · Compiled machine-readable skill registry used by the website. · `docs/data/skills.json`
- [Export Script](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/export-data.sh): shell orchestration · Shell-driven build/export entrypoint for repository data. · `scripts/export-data.sh`

### Docs Site

Static browse-and-install experience backed by generated data.

- [Docs Site](https://github.com/cosmicstack-labs/mercury-agent-skills/tree/main/docs): static web app · Client-side browsing and install UX for the registry. · `docs`
- [Index Page](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/docs/index.html): site entry · Main HTML shell for the static registry UI. · `docs/index.html`
- [App Logic](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/docs/app.js): frontend script · Browser-side navigation, search, detail views, and install flows. · `docs/app.js`
- [Styles](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/docs/style.css): presentation css · Visual styling for the static docs experience. · `docs/style.css`

### Automation Tools

Lightweight scripts and Node utilities supporting exports and demos.

- [Package Config](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/package.json): node tooling · Node-based tooling manifest for repository automation. · `scripts/package.json`
- [Lockfile](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/package-lock.json): node dependency lock · Pinned dependency state for the scripts tooling. · `scripts/package-lock.json`
- [Zomato Tool](https://github.com/cosmicstack-labs/mercury-agent-skills/blob/main/scripts/zomato-order.js): node utility · Repository-specific Node automation/demo script. · `scripts/zomato-order.js`

### Downstream Consumers

Agent runtimes and external deployment targets that use the registry.

- **Agent Runtimes**: ai consumers · External runtimes and CLIs that consume individual skill files directly.
- **Public Site**: deployment target · External hosted registry experience that receives automated syncs.

## Connections

- Categories → SKILL.md files: contains · Category folders organize the authored skill playbooks.
- SKILL.md files → Catalog: indexed by · The global catalog provides a navigable index over the skill set.
- SKILL.md files → Build Data: compiled by · Skill frontmatter and content are extracted into registry data.
- Categories → Build Data: scanned by · The compiler walks the category tree to build the dataset.
- Build Data → skills.json: produces · Compilation yields the machine-readable skills registry.
- Export Script → Build Data: orchestrates · Shell export wraps the Python compilation step.
- Export Script → skills.json: writes · Export flow generates or refreshes the registry artifact.
- skills.json → Docs Site: feeds · The static site reads generated registry data for browse and search.
- Docs Site → Index Page: starts with · The site is mounted from the main HTML entry point.
- Docs Site → App Logic: runs · Browser logic powers the interactive registry UI.
- Docs Site → Styles: styled by · Presentation layer is controlled by site styles.
- Package Config → Zomato Tool: defines · Node tooling manifest includes repository automation scripts.
- Package Config → Lockfile: locks · Dependency versions are pinned by the lockfile.
- Zomato Tool → Agent Runtimes: supports · Utility scripts complement downstream skill consumption flows.
- SKILL.md files → Agent Runtimes: consumed by · Agent runtimes install or read skills directly from markdown files.
- skills.json → Public Site: deployed to · Generated registry data is synced into the public hosted experience.
- README → Public Site: describes · Repository docs explain the external registry and sync behavior.
