# ibelick/ui-skills architecture

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

- Interactive diagram: https://gitdiagram.com/ibelick/ui-skills
- Repository: https://github.com/ibelick/ui-skills

## Overview

#### Purpose and Delivery Modes
UI Skills is a curated, file-based set of guidance for design-engineering agents. It ships both:
- an npm CLI that selects and retrieves skills for an agent task;
- an Astro site that browses the same skill and agent registry at ui-skills.com.

Primary entry points are `bin/ui-skills.ts` / `bin/ui-skills.js` for CLI execution and `src/pages/index.astro` for the web catalog.

#### Skill Content as the Core Product
Each skill is Markdown content under `skills/`, with a stable directory slug and `SKILL.md` payload. Examples:
- `skills/baseline-ui/SKILL.md`
- `skills/improve-ui/SKILL.md`
- `skills/fixing-accessibility/SKILL.md`

The root routing guidance lives in `skills/ui-skills-root/SKILL.md`. Some skills include agent-specific metadata and reference material, notably `skills/improve-ui/agents/openai.yaml` and `skills/improve-ui/references/plan-template.md`.

#### Registry and Discovery Layer
TypeScript data modules translate filesystem-oriented skill content into site/CLI discovery structures:
- `src/data/skills.ts`
- `src/data/registry.ts`
- `src/data/topics.ts`
- `src/data/agents.ts`

These modules form the central catalog boundary: UI pages and dynamic routes should consume registry data rather than encode individual skills directly. Topics/categories drive filtered CLI listing and catalog navigation; agents map compatible agent integrations.

#### CLI Control Flow
The executable wrapper `bin/ui-skills` delegates to the JavaScript/TypeScript CLI implementation in `bin/ui-skills.js` and `bin/ui-skills.ts`. Its user-facing flows include default discovery, task routing (`start`), category listing, filtered listing, and direct skill retrieval.

The CLI’s material output boundary is the local `skills/` tree: retrieved guidance is emitted from the packaged Markdown assets rather than fetched from a remote service.

#### Astro Catalog and Content Routes
Astro renders static/catalog pages and parameterized resource views:
- `src/pages/skills/index.astro`
- `src/pages/skills/[...slug].astro`
- `src/pages/agents/[id].astro`
- `src/pages/agent/[id].astro`

The catch-all skill route resolves nested skill slugs to skill content. Separate `agent` and `agents` paths likely preserve alternate or legacy agent URL forms. Shared document shell and catalog UI live in `src/layouts/Layout.astro`, `src/ui/skill-card.astro`, and `src/ui/skill-content-card.astro`.

#### Machine-Readable Publishing Surface
The site exposes crawler and agent-oriented representations alongside HTML:
- `src/pages/llms.txt.ts`
- `src/pages/skills/[...slug]/llms.txt.ts`
- `src/pages/skills/registry.txt.ts`
- `src/pages/sitemap.xml.ts`

These endpoints make the registry and individual skill guidance consumable by LLM clients and search/indexing systems, while `src/middleware.ts` provides the request-level boundary for Astro routes.

#### Runtime, Deployment, and External Integration
The project uses Node.js/npm with TypeScript and Astro (`package.json`, `astro.config.mjs`). Deployment is configured for Cloudflare Workers through `wrangler.jsonc`. GitHub is the notable external service: `src/lib/github-stars.ts` backs `src/pages/api/github-stars.ts`, with presentation through `src/ui/github-star-button.astro`. Release automation is defined in `.github/workflows/release.yml`.

Main entry points: [`src/data/registry.ts`](https://github.com/ibelick/ui-skills/blob/main/src/data/registry.ts) (Skill registry), [`skills`](https://github.com/ibelick/ui-skills/tree/main/skills) (Skill Markdown tree), [`src/pages/index.astro`](https://github.com/ibelick/ui-skills/blob/main/src/pages/index.astro) (Catalog home), [`bin/ui-skills.ts`](https://github.com/ibelick/ui-skills/blob/main/bin/ui-skills.ts) (CLI implementation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Skill content"]
  node_skills["Skill Markdown tree<br/>content assets"]
  node_root_skill["Root routing skill<br/>Markdown guidance<br/>[SKILL.md]"]
  node_skill_metadata["Agent metadata and references<br/>content assets<br/>[openai.yaml]"]
end

subgraph group_catalog["Registry and catalog"]
  node_registry["Skill registry<br/>TypeScript catalog<br/>[registry.ts]"]
  node_skills_data["Skill data<br/>TypeScript catalog<br/>[skills.ts]"]
  node_topics["Topics and categories<br/>TypeScript catalog<br/>[topics.ts]"]
  node_agents["Agent integrations<br/>TypeScript catalog<br/>[agents.ts]"]
end

subgraph group_cli["npm CLI"]
  node_cli_wrapper{{"CLI executable wrapper<br/>npm executable"}}
  node_cli["CLI implementation<br/>TypeScript / JavaScript<br/>[ui-skills.ts]"]
end

subgraph group_site["Astro site"]
  node_astro_catalog["Catalog home<br/>Astro page<br/>[index.astro]"]
  node_skill_routes["Skill catalog routes<br/>Astro routes<br/>[&#91;...slug&#93;.astro]"]
  node_agent_routes["Agent profile routes<br/>Astro routes<br/>[&#91;id&#93;.astro]"]
  node_site_ui["Shared catalog UI<br/>Astro components<br/>[Layout.astro]"]
  node_machine_endpoints["Machine-readable endpoints<br/>[llms.txt.ts]"]
  node_middleware["Request middleware<br/>Astro middleware<br/>[middleware.ts]"]
  node_github_stars["GitHub stars integration<br/>Astro API integration<br/>[github-stars.ts]"]
end

subgraph group_delivery["Runtime and release"]
  node_node_astro{{"Node, npm, and Astro<br/>runtime<br/>[package.json]"}}
  node_cloudflare{{"Cloudflare Workers<br/>deployment target<br/>[wrangler.jsonc]"}}
  node_release["Release automation<br/>GitHub Actions workflow<br/>[release.yml]"]
end

node_skills -->|"indexed by"| node_skills_data
node_root_skill -->|"part of"| node_skills
node_skill_metadata -.->|"augments"| node_skills
node_skills_data -->|"feeds"| node_registry
node_topics -->|"categorizes"| node_registry
node_agents -->|"maps compatibility"| node_registry
node_cli_wrapper -->|"delegates to"| node_cli
node_cli -->|"discovers and filters"| node_registry
node_cli -->|"emits packaged guidance"| node_skills
node_astro_catalog -->|"reads"| node_registry
node_skill_routes -->|"resolves slugs through"| node_registry
node_skill_routes -->|"renders content from"| node_skills
node_agent_routes -->|"reads"| node_agents
node_astro_catalog -->|"uses"| node_site_ui
node_skill_routes -->|"uses"| node_site_ui
node_machine_endpoints -->|"publishes catalog"| node_registry
node_machine_endpoints -->|"publishes guidance"| node_skills
node_middleware -->|"guards request boundary"| node_astro_catalog
node_github_stars -->|"supplies star data"| node_astro_catalog
node_node_astro -->|"runs"| node_cli
node_node_astro -->|"builds and runs"| node_astro_catalog
node_cloudflare -->|"deploys Astro output"| node_node_astro
node_release -->|"releases npm package"| node_node_astro

click node_skills "https://github.com/ibelick/ui-skills/tree/main/skills"
click node_root_skill "https://github.com/ibelick/ui-skills/blob/main/skills/ui-skills-root/SKILL.md"
click node_skill_metadata "https://github.com/ibelick/ui-skills/blob/main/skills/improve-ui/agents/openai.yaml"
click node_registry "https://github.com/ibelick/ui-skills/blob/main/src/data/registry.ts"
click node_skills_data "https://github.com/ibelick/ui-skills/blob/main/src/data/skills.ts"
click node_topics "https://github.com/ibelick/ui-skills/blob/main/src/data/topics.ts"
click node_agents "https://github.com/ibelick/ui-skills/blob/main/src/data/agents.ts"
click node_cli_wrapper "https://github.com/ibelick/ui-skills/blob/main/bin/ui-skills"
click node_cli "https://github.com/ibelick/ui-skills/blob/main/bin/ui-skills.ts"
click node_astro_catalog "https://github.com/ibelick/ui-skills/blob/main/src/pages/index.astro"
click node_skill_routes "https://github.com/ibelick/ui-skills/blob/main/src/pages/skills/%5B...slug%5D.astro"
click node_agent_routes "https://github.com/ibelick/ui-skills/blob/main/src/pages/agents/%5Bid%5D.astro"
click node_site_ui "https://github.com/ibelick/ui-skills/blob/main/src/layouts/Layout.astro"
click node_machine_endpoints "https://github.com/ibelick/ui-skills/blob/main/src/pages/llms.txt.ts"
click node_middleware "https://github.com/ibelick/ui-skills/blob/main/src/middleware.ts"
click node_github_stars "https://github.com/ibelick/ui-skills/blob/main/src/lib/github-stars.ts"
click node_node_astro "https://github.com/ibelick/ui-skills/blob/main/package.json"
click node_cloudflare "https://github.com/ibelick/ui-skills/blob/main/wrangler.jsonc"
click node_release "https://github.com/ibelick/ui-skills/blob/main/.github/workflows/release.yml"

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_skills,node_root_skill,node_skill_metadata toneBlue
class node_registry,node_skills_data,node_topics,node_agents toneAmber
class node_cli_wrapper,node_cli toneMint
class node_astro_catalog,node_skill_routes,node_agent_routes,node_site_ui,node_machine_endpoints,node_middleware,node_github_stars toneRose
class node_node_astro,node_cloudflare,node_release toneIndigo
```

## Components

### Skill content

File-based guidance shipped to both delivery modes.

- [Skill Markdown tree](https://github.com/ibelick/ui-skills/tree/main/skills): content assets · Slug directories contain SKILL.md guidance and optional metadata. · `skills`
- [Root routing skill](https://github.com/ibelick/ui-skills/blob/main/skills/ui-skills-root/SKILL.md): Markdown guidance · `skills/ui-skills-root/SKILL.md`
- [Agent metadata and references](https://github.com/ibelick/ui-skills/blob/main/skills/improve-ui/agents/openai.yaml): content assets · `skills/improve-ui/agents/openai.yaml`

### Registry and catalog

TypeScript discovery boundary shared by CLI and site.

- [Skill registry](https://github.com/ibelick/ui-skills/blob/main/src/data/registry.ts): TypeScript catalog · Central discovery structures for skill content. · `src/data/registry.ts`
- [Skill data](https://github.com/ibelick/ui-skills/blob/main/src/data/skills.ts): TypeScript catalog · `src/data/skills.ts`
- [Topics and categories](https://github.com/ibelick/ui-skills/blob/main/src/data/topics.ts): TypeScript catalog · `src/data/topics.ts`
- [Agent integrations](https://github.com/ibelick/ui-skills/blob/main/src/data/agents.ts): TypeScript catalog · `src/data/agents.ts`

### npm CLI

- [CLI executable wrapper](https://github.com/ibelick/ui-skills/blob/main/bin/ui-skills): npm executable · `bin/ui-skills`
- [CLI implementation](https://github.com/ibelick/ui-skills/blob/main/bin/ui-skills.ts): TypeScript / JavaScript · Handles discovery, routing, listing, filtering, and retrieval. · `bin/ui-skills.ts`

### Astro site

- [Catalog home](https://github.com/ibelick/ui-skills/blob/main/src/pages/index.astro): Astro page · `src/pages/index.astro`
- [Skill catalog routes](https://github.com/ibelick/ui-skills/blob/main/src/pages/skills/%5B...slug%5D.astro): Astro routes · Lists skills and resolves nested skill slugs. · `src/pages/skills/[...slug].astro`
- [Agent profile routes](https://github.com/ibelick/ui-skills/blob/main/src/pages/agents/%5Bid%5D.astro): Astro routes · Supports current and alternate agent URL forms. · `src/pages/agents/[id].astro`
- [Shared catalog UI](https://github.com/ibelick/ui-skills/blob/main/src/layouts/Layout.astro): Astro components · `src/layouts/Layout.astro`
- [Machine-readable endpoints](https://github.com/ibelick/ui-skills/blob/main/src/pages/llms.txt.ts): Astro text and XML routes · Publishes LLM, registry, per-skill, and sitemap representations. · `src/pages/llms.txt.ts`
- [Request middleware](https://github.com/ibelick/ui-skills/blob/main/src/middleware.ts): Astro middleware · `src/middleware.ts`
- [GitHub stars integration](https://github.com/ibelick/ui-skills/blob/main/src/lib/github-stars.ts): Astro API integration · Fetches GitHub stars for the site presentation. · `src/lib/github-stars.ts`

### Runtime and release

- [Node, npm, and Astro](https://github.com/ibelick/ui-skills/blob/main/package.json): runtime · `package.json`
- [Cloudflare Workers](https://github.com/ibelick/ui-skills/blob/main/wrangler.jsonc): deployment target · `wrangler.jsonc`
- [Release automation](https://github.com/ibelick/ui-skills/blob/main/.github/workflows/release.yml): GitHub Actions workflow · `.github/workflows/release.yml`

## Connections

- Skill Markdown tree → Skill data: indexed by
- Root routing skill → Skill Markdown tree: part of
- Agent metadata and references → Skill Markdown tree: augments
- Skill data → Skill registry: feeds
- Topics and categories → Skill registry: categorizes
- Agent integrations → Skill registry: maps compatibility
- CLI executable wrapper → CLI implementation: delegates to
- CLI implementation → Skill registry: discovers and filters
- CLI implementation → Skill Markdown tree: emits packaged guidance
- Catalog home → Skill registry: reads
- Skill catalog routes → Skill registry: resolves slugs through
- Skill catalog routes → Skill Markdown tree: renders content from
- Agent profile routes → Agent integrations: reads
- Catalog home → Shared catalog UI: uses
- Skill catalog routes → Shared catalog UI: uses
- Machine-readable endpoints → Skill registry: publishes catalog
- Machine-readable endpoints → Skill Markdown tree: publishes guidance
- Request middleware → Catalog home: guards request boundary
- GitHub stars integration → Catalog home: supplies star data
- Node, npm, and Astro → CLI implementation: runs
- Node, npm, and Astro → Catalog home: builds and runs
- Cloudflare Workers → Node, npm, and Astro: deploys Astro output
- Release automation → Node, npm, and Astro: releases npm package
