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
35 changes: 25 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# The documentation site on GitHub Pages, rebuilt on every push to main:
# The documentation site on GitHub Pages: built on every pull request, which
# fails if agents/ is not what the pages write, and deployed from main.
# odoc's reference from the .mli files and the islands compiled by Melange,
# then Starlight's pages around them.
name: docs

on:
push:
branches: [main]
pull_request:

# A build reads the repository and nothing more; the deploy job alone is
# given the rights to publish.
permissions:
contents: read
pages: write
id-token: write

# A newer push to a pull request replaces its build; main's deploys queue
# and always finish.
concurrency:
group: pages
cancel-in-progress: true
group: pages-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
deploy:
build:
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/configure-pages@v6
- uses: actions/checkout@v5
- uses: ocaml/setup-ocaml@v3
with:
Expand All @@ -42,8 +42,23 @@ jobs:
# the token, past its limit for a runner's shared address.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The build writes agents/ from the pages: a page changed without it
# differs here.
- run: git add --intent-to-add agents/ && git diff --exit-code agents/
- uses: actions/upload-pages-artifact@v5
with:
path: _build/docs
deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/configure-pages@v6
- uses: actions/deploy-pages@v5
id: deployment
27 changes: 12 additions & 15 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ make setup # once: the switch solidtype, all dependencies, and
make test # the ppx's lowering, the plugin's rewrite, the
# libraries' tests and the example's
make lint # formatting, the plugin's and the generators' types,
# litany, the release build, the generated bindings, and
# agents/ against the pages
# litany, the release build and the generated bindings
make fmt # format in place
make example # the board, built by Vite into _build/example-dist, and
# its Astro page, into _build/example-astro
make example-serve # the board and its API, served on http://localhost:4420,
# its tasks in BOARD_DB, example/board.db, migrated first
make docs # the documentation site, odoc's reference copied into
# docs/public/reference, built by Astro into _build/docs,
# as .github/workflows/docs.yml publishes it from main
# as .github/workflows/docs.yml publishes it from main,
# and agents/ from its pages
make docs-serve # the documentation site built, served on DOCS_PORT with
# search
make agents # agents/ written from the documentation's pages
make release VERSION=1.2.3 # tag and release
```

Expand Down Expand Up @@ -183,18 +182,16 @@ docs/ the documentation, a Starlight site in Hypha's look,
ignored, since Starlight serves public/ as it is
agents.md what an agent knows before any page -- the packages
and how solidtype is written -- which the theme puts
at the head of llms.txt; each group's note, and the
skill's description and the parts agents have been
seen writing by hand instead, are in astro.config.mjs
at the head of llms.txt; each group's note is in
astro.config.mjs
src/pages/demo/ the Astro page's demo, pages of Astro's own outside
Starlight: a route per tea, its islands given props,
under a basket the client router keeps; the page
imports their sources as @demo/<path>?raw
agents/ the documentation for a user's agent, generated by
starlight-theme-hypha from the pages, `make agents`:
starlight-hypha-agents from the pages, `make docs`:
llms.txt, the catalogue; pages/, each page as
Markdown, its examples written in; skills/solidtype/,
the skill that sends an agent there; installed by the
Markdown, its examples written in; installed by the
root dune into $(opam var solidtype:doc), and llms.txt
alone, its links to solidtype's pages, into every other
package's doc/
Expand Down Expand Up @@ -705,15 +702,15 @@ break.
`_ Jsx.component`, never a function type, and an OCaml component is
`Jsx.component make`. Why: Melange wraps an external function used as
a value in a closure, which no JSX tag can name.
- **`agents/` is generated, never edited.** starlight-theme-hypha writes it
from the documentation's pages, `docs/agents.md` and the `agents` options
in `docs/astro.config.mjs`: a page changed is `make agents` run in the
- **`agents/` is generated, never edited.** starlight-hypha-agents writes it
from the documentation's pages, `docs/agents.md` and its options in
`docs/astro.config.mjs`: a page changed is `make docs` run in the
same commit. A module with a page of its own names the page's installed
path, `$(opam var solidtype:doc)/pages/<page>.md`, in its `.mli`'s opening
comment, and `generate/rhp.ts` writes it for rhp's generated components.
Why: a user's agent reads what the release installs, offline, and a page
it reads must be the release's. Test: `make lint` runs `HYPHA_AGENTS=check
astro sync`, which fails on each file that differs from the pages.
it reads must be the release's. Test: the docs workflow builds the
pages on every pull request and fails if `agents/` then differs.
- **Tests of what runs in a browser are OCaml, run by vitest.** Alcotest
does not build for Melange; `melange-jest` reaches the globals vitest
shares with Jest. The ppx, native, is tested by its expectations. Why:
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changes

## Unreleased

- Breaking: the skill, `skills/solidtype`, is no longer installed. The
documentation for an agent is `llms.txt` and every page in Markdown, in
`$(opam var solidtype:doc)`, and the README's *With an agent* gives the
line for a project's `AGENTS.md` that sends an agent there.

## 0.12.0 (2026-11-20)

- HeroUI's `Data_grid`: rows given as data, each known by its `row_id`, and
Expand Down
14 changes: 3 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DOCS_PORT ?= 4321
REFERENCE = solidtype solidtype-kobalte solidtype-headless solidtype-heroui solidtype-rhp solidtype-internationalized-date solidtype-gravity-icons ppx_solidtype odoc.support

.DEFAULT_GOAL := help
.PHONY: help setup build test lint fmt example example-serve docs docs-serve agents generate release
.PHONY: help setup build test lint fmt example example-serve docs docs-serve generate release

help: ## list targets
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
Expand All @@ -30,10 +30,8 @@ test: build node_modules ## run the tests
$(OPAM) dune test --force
$(OPAM) bun run test

# Release is the profile opam installs with. agents/ is checked from docs/,
# where Astro finds its config, by reading the pages without building the
# site.
lint: node_modules ## check formatting, types, litany, the release build, bindings and agents/
# Release is the profile opam installs with.
lint: node_modules ## check formatting, types, litany, the release build and bindings
$(OPAM) dune build @all @fmt
$(OPAM) dune build --profile release @all
$(OPAM) litany check
Expand All @@ -45,7 +43,6 @@ lint: node_modules ## check formatting, types, litany, the release build, bindin
$(OPAM) bun generate/rhp.ts --check
$(OPAM) bun generate/internationalized_date.ts --check
$(OPAM) bun generate/gravity_icons.ts --check
cd docs && HYPHA_AGENTS=check bunx astro sync

fmt: ## format the code
$(OPAM) dune fmt
Expand Down Expand Up @@ -77,11 +74,6 @@ docs: build node_modules ## build the documentation site
docs-serve: docs ## serve the built documentation site
cd docs && bun --bun astro preview --open --port $(DOCS_PORT)

# Each page as Markdown, llms.txt and the skill, from the documentation's
# pages, for the solidtype package to install.
agents: node_modules ## write agents/ from the documentation's pages
cd docs && HYPHA_AGENTS=write bunx astro sync

generate: node_modules ## write the generated bindings
$(OPAM) bun generate/html.ts
$(OPAM) bun generate/kobalte.ts
Expand Down
26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,14 @@ Setting up dune and Vite to build it:

## With an agent

Each release installs its documentation for an agent with it: `llms.txt`,
every page in Markdown, and a skill that sends the agent there before it
writes code with solidtype. With opam alone, copy the skill into your
project, into `.agents/skills/` for Codex, Cursor and most agents or
`.claude/skills/` for Claude Code:

```sh
mkdir -p .agents/skills
cp -r $(opam var solidtype:doc)/skills/solidtype .agents/skills/
```

With Node or Bun:

```sh
npx skills add hyphatech/solidtype
```

An agent that reads no skills is told in your project's `AGENTS.md`:
Each release installs its documentation for an agent with it, at
`$(opam var solidtype:doc)`: `llms.txt`, and every page in Markdown. An
agent reads it when your project's `AGENTS.md` tells it to:

```md
Before writing code with solidtype, read `$(opam var solidtype:doc)/llms.txt`
and the page of each part the work needs; build from its parts.
Before writing code with solidtype, read `$(opam var solidtype:doc)/llms.txt` and
the pages it lists for the parts you need, and use those parts rather than
writing your own.
```

## Licence
Expand Down
18 changes: 0 additions & 18 deletions agents/skills/solidtype/SKILL.md

This file was deleted.

7 changes: 5 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 13 additions & 21 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import solid from "@astrojs/solid-js";
import starlight from "@astrojs/starlight";
import tailwindcss from "@tailwindcss/vite";
import links from "starlight-links-validator";
import agents from "starlight-hypha-agents";
import hypha from "starlight-theme-hypha";
import solidtype from "vite-plugin-solidtype";
import astro from "@shikijs/langs/astro";
Expand Down Expand Up @@ -51,27 +52,18 @@ export default defineConfig({
github: "hyphatech/solidtype",
tabs: { "Start here": "rocket", Solid: "zap", Kobalte: "blocks", HeroUI: "component", Charts: "waves-horizontal", Reference: "library" },
links: [{ label: "Hypha Stack", href: "https://hyphatech.io/stack", icon: "layers" }],
// Each page as Markdown, llms.txt and a skill, written into
// agents/ for the solidtype package to install, and held to the
// pages by `make lint`. agents.md is what an agent knows before any
// page.
agents: {
dir: "../agents",
preamble: readFileSync(new URL("./agents.md", import.meta.url), "utf-8"),
groups: {
HeroUI: "Each component's page gives HeroUI's own examples in OCaml, and a table of its props with the name HeroUI's React component gives each.",
Charts: "Each page links to the page of rhp's documentation it follows.",
Reference: "Each module's interface, its `.mli`, is its contract: what each function does, refuses and defaults to.",
},
skill: {
name: "solidtype",
package: "solidtype",
description:
"Use before writing or changing OCaml code that uses solidtype or its packages: Solid's components, signals and stores in OCaml's JSX (.mlx), Kobalte's components, HeroUI's ported onto them (buttons, fields, lists, tabs, overlays, tables), rhp's charts, Gravity UI's icons and @internationalized/date.",
instead: [
"a raw `<button>`, `<input>`, `<a>`, `<ul>`/`<li>` used as a list, `<nav>`, or a `style=`, where solidtype-heroui has Button, TextField/Input, Link, ListBox, Tabs/Breadcrumbs, and the design's tokens",
],
},
}),
// Each page as Markdown and llms.txt, written into agents/
// by the build, for the solidtype package to install; the docs
// workflow holds it to the pages. agents.md is what an agent knows
// before any page.
agents({
dir: "../agents",
preamble: readFileSync(new URL("./agents.md", import.meta.url), "utf-8"),
groups: {
HeroUI: "Each component's page gives HeroUI's own examples in OCaml, and a table of its props with the name HeroUI's React component gives each.",
Charts: "Each page links to the page of rhp's documentation it follows.",
Reference: "Each module's interface, its `.mli`, is its contract: what each function does, refuses and defaults to.",
},
}),
// The reference is odoc's, in public/, and the Astro page's demo is
Expand Down
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"solid-js": "~1.9.17",
"solid-motionone": "~1.0.4",
"starlight-links-validator": "^0.27.0",
"starlight-theme-hypha": "github:hyphatech/starlight-theme-hypha#v0.7.0",
"starlight-hypha-agents": "github:hyphatech/starlight-hypha-agents#v0.2.0",
"starlight-theme-hypha": "github:hyphatech/starlight-theme-hypha#v0.8.0",
"tailwindcss": "^4.3.3",
"tw-animate-css": "1.4.0",
"vite-plugin-solidtype": "workspace:*"
Expand Down
4 changes: 2 additions & 2 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
(:standard -w +a-4-40-41-42-44-45-48-67-70))))

; The documentation for a user's agent, agents/, written from the site's pages
; by `make agents`: solidtype installs it whole, so $(opam var solidtype:doc)
; holds llms.txt, each page and the skill. Every other package installs the
; by `make docs`: solidtype installs it whole, so $(opam var solidtype:doc)
; holds llms.txt and each page. Every other package installs the
; catalogue alone, its links sent on to solidtype's pages, so whichever
; package an agent looks in, its llms.txt reaches them.

Expand Down