Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ skill and the human-readable workflow are generated from this one source. Skill
discovery metadata lives in `content/skill-metadata.json`, and published CLI
identity lives in `content/cli-release.json`.

The four-locale site sources live in `content/site/`. They were imported from
`stack-sh/web` commit `c0c773fd2721a177c56406732c010808269e30bc` under Apache-2.0.
The original 56 page paths are preserved. Four generated `guide/agent-workflow.md`
pages expose the canonical English instructions used by the skill; the localized
coding-agent guides explain this and share one copyable prompt from
`content/agent-prompt.txt`. This avoids hand-maintaining the validation workflow
both in a guide and a skill. `{{cliVersion}}` comes from the release lock.

`generated/site/` contains complete Markdown inputs for the website. Website
presentation, images, VitePress configuration, and deployment are not owned here.

Language syntax, schemas, and canonical examples remain owned by
[stack-sh/specification](https://github.com/stack-sh/specification).
[stack-sh/cli](https://github.com/stack-sh/cli) owns native command behavior and the
Expand Down Expand Up @@ -39,7 +50,9 @@ version string alone does not prove a feature is available.

## Migration status

Shared workflow generation is available here. CLI and Web consumption, the full
multilingual guide migration, and automated consumer freshness checks are still
being integrated. Existing public documentation and skill installation remain
available from their current repositories until those consumer changes land.
Shared workflow and multilingual source generation are available here. CLI and Web
consumption and automated consumer freshness checks are still being integrated.
Existing public documentation and skill installation remain available from their
current repositories until those consumer changes land. The website's existing
language, example, link, and build gates must pass when switching to this source;
source generation alone does not prove rendered-site compatibility.
1 change: 1 addition & 0 deletions content/agent-prompt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use Stack to create or edit the architecture described below. Read https://stack-diagram.com/docs/guide/agent-workflow.md and follow its local validation and safety workflow. Read the relevant language reference and examples as needed. Deliver editable .stack source and report verification results. Architecture requirements:
7 changes: 7 additions & 0 deletions content/site/examples/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Example gallery

Start with a small diagram, then move through groups, layout constraints, provider icons, and production-like systems. Every thumbnail below is generated from the canonical source pinned to the public Stack specification.

Provider examples keep artwork caller-owned: install the listed icon packs when you want branded icons. Without a pack, the same source remains valid and renders with Stack's deterministic missing-icon fallback.

<ExampleGallery locale="en" />
27 changes: 27 additions & 0 deletions content/site/guide/coding-agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Coding agents

Use Stack with a coding agent to keep architecture diagrams as reviewable source. The agent can read the language reference and run the CLI locally; a remote MCP server is not required.

## Install the skill

Install only the diagram skill with `npx skills add stack-sh/cli`. This installs into the current project; add `-g` only when you want a user-wide installation. Review the downloaded instructions before use. This installs instructions, not the Stack CLI. For a reproducible installation, clone the repository, check out a reviewed commit, then run `npx skills add /absolute/path/to/cli --skill stack-diagrams`. The installer does not accept a raw commit SHA as a remote branch.

[SKILL.md](https://github.com/stack-sh/cli/blob/main/skills/stack-diagrams/SKILL.md)

## Without installation

Copy this instruction into your agent and add the architecture requirements. The same prompt works without a skill-aware client, provided it can read HTTPS pages and execute local commands.

```text
{{agentPrompt}}
```

The full [agent workflow](./agent-workflow) is generated from the same source as the CLI skill. The canonical agent instructions are in English; copy them or let your agent read the Markdown URL above.

## Reference and updates

- [Examples](../examples/index)
- [Syntax](../language/syntax)
- [Diagnostics](../reference/diagnostics-and-limits)
- [Provider icons](./provider-icons)
- [Markdown index](https://stack-diagram.com/docs/llms.txt)
86 changes: 86 additions & 0 deletions content/site/guide/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Getting started

The fastest way to use Stack is the browser [Playground](https://stack-diagram.com/). It runs the formatter, validator, layout engine, and SVG renderer locally in WebAssembly; you do not need to install a command or send source to a rendering API.

## Install the native CLI

For terminal workflows and local automation, install the owner-maintained Homebrew formula with `brew install stack-sh/tap/stack`. It uses the canonical Stack CLI {{cliVersion}} release archive and supports Apple Silicon macOS plus glibc-based Linux on arm64 and x86_64 when the host meets Homebrew's current tier-1 requirements. Homebrew owns upgrades through `brew upgrade stack-sh/tap/stack`; uninstalling the formula leaves your Stack configuration and icon store in place. See the [CLI distribution contract](https://github.com/stack-sh/cli/blob/main/docs/distribution.md#homebrew-installation) for the exact platform matrix, direct-install alternative, and recovery policy.

## Write your first document

Replace the editor content with this example:

```stack
stack 1.0

diagram "Checkout" {
theme default

node shopper "Shopper" {
kind actor
}

group application "Application" {
node web "Web app" {
kind client
detail "React"
}

node api "Checkout API" {
kind service
detail "Rust"
}

layout {
direction right
order [web, api]
}
}

node orders "Orders" {
kind database
detail "PostgreSQL"
}

edge shopper -> web "HTTPS" {
kind request
}

edge web -> api "JSON" {
kind request
}

edge api -> orders "SQL" {
kind data
}

layout {
direction right
order [shopper, application, orders]
}
}
```

## Render and inspect

Select **Run** or press <kbd>Command</kbd>/<kbd>Ctrl</kbd> + <kbd>Enter</kbd>. The preview shows a standalone SVG. Select the preview to inspect it at a larger size, then use **Download SVG** when you want the file.

The source has four parts:

1. `stack 1.0` declares the language version.
2. `diagram` provides one title and contains the architecture.
3. `node` and `group` declare components and boundaries.
4. `edge` records relationships, while `layout` supplies constrained placement intent.

## Check and format

Use **Check** to run the complete validation and layout pipeline without replacing the SVG. Use **Format** to rewrite syntactically valid source into the canonical two-space form while preserving line comments and meaning.

If Stack finds a problem, the diagnostic shows its severity, stable code, location, source frame, expected values, and corrective help when available. Selecting a diagnostic focuses its source range.

## Choose what to learn next

- Read [Document and syntax](../language/syntax) for lexical rules and the complete grammar.
- Read [Nodes and groups](../language/nodes-and-groups) to model components and boundaries.
- Read [Edges and layout](../language/edges-and-layout) for relationships and placement intent.
- Read [Themes and icons](../language/themes-and-icons) before selecting a visual system or explicit icon.
42 changes: 42 additions & 0 deletions content/site/guide/playground.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Using the Playground

The Playground is the public browser consumer at [stack-diagram.com](https://stack-diagram.com/). The editor remains a native text input while a shared TextMate grammar supplies syntax color. Validation, formatting, layout, and SVG always come from the published Stack WebAssembly engine.

## Actions

| Action | Result |
| ---------------- | ------------------------------------------------------------------------------------------------ |
| **Format** | Canonicalizes syntactically valid source and preserves comments. Semantic errors remain visible. |
| **Check** | Runs compiler, theme, icon, layout, and routing checks without creating a new SVG. |
| **Run** | Runs the full pipeline and updates the SVG when no error prevents rendering. |
| **Download SVG** | Saves the current standalone SVG. |

<kbd>Command</kbd>/<kbd>Ctrl</kbd> + <kbd>Enter</kbd> runs the document. Source changes clear stale diagnostics so old ranges are not presented as current results.

## Reading diagnostics

An error result can include:

```text
error[STK2002] at 4:22
4 | layout { direction hoo }
| ^^^ unexpected layout direction 'hoo'
= expected: right, down
= help: use 'right' for horizontal flow or 'down' for vertical flow
```

Select a diagnostic or its related information to focus the corresponding source. Errors prevent a successful render. Warnings describe a fallback or readability concern and can accompany an SVG.

## Two independent color choices

The header color-mode control changes the Playground and editor presentation. A source statement such as `theme dark` changes the generated diagram. The two settings are intentionally independent: switching the site to dark mode must not rewrite or reinterpret the diagram theme.

## Browser behavior and data

The Playground loads a published WebAssembly module, then runs synchronous `format`, `check`, and `render` operations in the browser. The engine itself does not read files, contact a network service, inspect the DOM, observe a clock, or measure host fonts.

The current Playground does not provide accounts, cloud persistence, collaboration, or paid themes. Download source or SVG that you need to keep.

## Accessibility

The editor retains native caret, selection, clipboard, undo, keyboard, and IME behavior. Diagnostics can navigate to source ranges. The preview has text alternatives and opens in a keyboard-accessible dialog. The interface supports 320-pixel layouts, light and dark contrast, visible focus, and reduced-motion preferences.
118 changes: 118 additions & 0 deletions content/site/guide/provider-icons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Provider icons

Stack includes a provider-neutral core icon catalog. AWS, Google Cloud, Azure, and common developer and collaboration artwork are available through provider packs stored in your user-managed icon store.

## Available provider catalog

The audited catalog contains 1,051 IDs: 305 AWS Architecture Icons, 45 Google Cloud product and category icons, 639 Azure service icons, and 62 curated tool icons. The tool catalog includes GitHub, GitHub Actions, Notion, Linear, Atlassian, Jira, Confluence, Docker, Kubernetes, Terraform, Datadog, Grafana, Sentry, and more.

Select a provider card to see its import command, then search or filter the complete catalog. Results are shown 100 at a time for comfortable use on smaller devices.

<ProviderCatalog locale="en" />

A provider pack supplies artwork. The node `kind` in Stack source continues to control semantic styling and layout.

## Quick start

Import each provider used by a diagram once. `--accept-terms` records your confirmation that you reviewed the linked provider and brand terms.

```sh
$ stack icons import gcp --accept-terms
$ stack icons import simple-icons --accept-terms
$ stack render architecture.stack -o architecture.svg
```

The CLI downloads the audited official archives, verifies their complete SHA-256 hashes, sanitizes the selected SVGs, and writes each processed provider pack to the shared icon store. Google Cloud product and category artwork is imported together by the single `gcp` command.

## Use provider icons in CLI

A Stack file can use multiple providers. This example combines Cloud Run from Google Cloud with GitHub from Simple Icons:

```stack
stack 1.0

diagram "Deploy from GitHub to Cloud Run" {
node repository "GitHub" {
kind external
icon "simple-icons:github"
}

node service "Cloud Run" {
kind service
icon "gcp:cloud-run"
}

edge repository -> service "Deploy" {
kind dependency
}
}
```

After both imports, the standard render command discovers both packs:

```sh
$ stack render architecture.stack -o architecture.svg --notice architecture.NOTICE.md
```

## Shared icon store

The default icon store is `$XDG_CONFIG_HOME/stack/icons`. When `XDG_CONFIG_HOME` is unset, Stack uses `$HOME/.config/stack/icons`.

```text
icons/
aws/
gcp/
azure/
simple-icons/
```

Set a different shared location in `$XDG_CONFIG_HOME/stack/config.yaml` with an absolute path:

```yaml
default_icons_path: /absolute/path/to/stack-icons
```

The configured location is used by both `stack icons import` and `stack render`.

## Use provider icons in Playground

Open **Icons**, choose the `stack/icons` folder, and the Playground loads every recognized provider directory in that store. Search the loaded artwork and select an item to copy its ID into Stack source.

The selected packs are processed in the current browser tab. When a rendered diagram contains provider artwork, **Notice** beside the SVG download provides the source, terms, and used-icon record.

## Keep icons with a project

Use `-o` to place imported packs in a project directory that can be committed with the repository:

```sh
$ stack icons import gcp --accept-terms -o .stack-icons
$ stack icons import simple-icons --accept-terms -o .stack-icons
```

Pass that icon-store root with `--provider-pack` when rendering:

```sh
$ stack render architecture.stack \
--provider-pack .stack-icons \
-o architecture.svg \
--notice architecture.NOTICE.md
```

## Find icon IDs

Search the catalog from the CLI or on this page:

```sh
$ stack icons list
$ stack icons list aws s3
$ stack icons list azure database
$ stack icons list simple-icons github
```

The CLI output contains `ID`, `PRODUCT`, `CATEGORY`, and recommended `KIND` columns. Namespaced IDs such as `gcp:cloud-run` and `simple-icons:github` select artwork from the corresponding pack.

## Verification, terms, and notices

The CLI catalog pins each official HTTPS archive URL, release, complete archive SHA-256, allowlisted entry path, terms URL, and review date. Import applies bounded archive and SVG sizes, sanitizes active and external SVG content, and writes each pack atomically.

Each pack includes `NOTICE.md`. `stack render --notice <PATH>` writes the exact pack revisions, source releases, terms URLs, attribution, non-endorsement text, and used icon IDs for a rendered artifact. The catalog links each provider's official source and terms, plus brand sources and guidelines for curated Simple Icons marks.
51 changes: 51 additions & 0 deletions content/site/guide/what-is-stack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# What is Stack?

Stack is a small declarative language for static software architecture and technology-stack diagrams. You describe components, boundaries, and relationships in a UTF-8 `.stack` file. A renderer decides coordinates, spacing, routes, typography, and visual treatment.

This split keeps the source concise, reviewable, and useful in version control. It also lets the same document be formatted, checked, and rendered by conforming tools without turning the file into drawing instructions.

## The basic model

Every document contains a language version and exactly one diagram. A diagram contains nodes, optional groups, edges, an optional theme, and optional layout intent.

```stack
stack 1.0

diagram "Service architecture" {
node client "Web app" {
kind client
}

node api "API" {
kind service
detail "Order orchestration"
}

edge client -> api "HTTPS" {
kind request
}
}
```

The document says that a client calls a service. It does not say where either box sits or how an arrow bends.

## What Stack optimizes for

- **Concise authoring:** useful diagrams need little more than named nodes and edges.
- **Predictable generation:** each concept has one constrained representation that people and language models can produce reliably.
- **Semantic source:** a document records topology and intent, not pixels.
- **Polished output:** the renderer owns a coherent visual system.
- **Actionable errors:** diagnostics point to source ranges and can include expected values, corrective help, and related declarations.
- **Safe embedding:** source cannot execute code, fetch arbitrary assets, or inject HTML or SVG.

## What Stack is not

Stack 1.0 is not a general graph language, pixel-perfect canvas, infrastructure definition, or executable programming language. It has no variables, imports, macros, conditionals, CSS, coordinates, arbitrary URLs, or embedded HTML. It is not a sequence, state-machine, class, ER, or complete UML notation.

Use several focused diagrams for a large system. A single Stack document deliberately has readability limits rather than unlimited elements.

## Processing model

A tool decodes and parses the document, resolves identifiers and defaults, validates semantics, resolves the theme and icons, solves layout, and finally renders. Source errors stop rendering. Missing optional theme or icon resources and unsatisfied layout hints are warnings, so the engine can still return a fallback diagram.

The [language pages](../language/syntax) explain every author-facing construct. The [versioning and safety reference](../reference/versioning-and-safety) explains compatibility and trust boundaries.
27 changes: 27 additions & 0 deletions content/site/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
layout: home

hero:
name: Stack
text: Architecture, as source.
tagline: Write a small, semantic document. Get a consistent, accessible architecture diagram without drawing coordinates or styling every box.
image:
light: /favicon.svg
dark: /favicon.svg
alt: Stack logo
actions:
- theme: brand
text: Get started
link: /guide/getting-started
- theme: alt
text: Open Playground
link: https://stack-diagram.com/

features:
- title: Describe the system
details: Nodes, groups, relationships, and layout intent stay readable in a compact .stack file.
- title: Keep meaning portable
details: A versioned language and structured diagnostics separate architecture meaning from renderer choices.
- title: Render safely
details: The engine produces standalone SVG without scripts, arbitrary HTML, or network-loaded assets.
---
Loading