Sourcey
Generate a documentation site for a project using Sourcey. Sourcey is a static
documentation generator that produces HTML sites from markdown pages, OpenAPI
specs, Doxygen XML, and MCP server snapshots.
What this skill does
By default, runx executes Sourcey as a governed mixed-runner skill:
- discover the bounded documentation scope, evidence, and plan
- author the bounded docs/config bundle
- write the source bundle deterministically under the runner's declared
workspace scopes
- build docs deterministically
- critique the built output in one bounded pass
- apply at most one bounded revision pass
- rebuild and verify the output deterministically
For already-configured projects, the same sourcey runner stays narrow: the
discover step can confirm existing config, the author/revise passes can return
empty bundles, and the deterministic tool steps still perform the build and
verification work.
A direct zero-input invocation targets the current workspace, so runx skill sourcey reaches bounded discovery immediately. A composed chain targeting a
different project should pass both project and repo_root explicitly so
discovery, authored-source writes, and deterministic builds stay on the same
workspace boundary.
For repository-backed projects, Sourcey owns two separate surfaces: committed
docs source and generated site output. Keep those separate. Do not mix emitted
HTML, search indexes, or OG assets back into the authored docs tree.
When to use this skill
- A project needs a maintainer-grade documentation site generated from real
repository evidence, existing docs, API specs, Doxygen XML, or MCP snapshots.
- A branded package or product needs Sourcey output with governed discovery,
bounded authoring, deterministic build, critique, revision, and receipt
proof.
- A workflow needs to separate authored docs source from generated site output
while preserving a reviewable receipt trail.
- A maintainer wants CI or deploy to rebuild docs without inventing scope,
prose, or information architecture at deploy time.
When not to use this skill
- To manufacture documentation when the repository evidence is too thin. Return
needs_more_evidence or needs_review instead of confident filler.
- To write generated HTML, search indexes, or Open Graph assets back into the
source docs tree.
- To run open-ended critique/revision loops or write outside the declared
workspace root.
- To document APIs by hand when an OpenAPI, Doxygen, or MCP source can be used
directly by Sourcey.
Documentation rules
Sourcey output should read like native project documentation that a maintainer
would stand behind:
- build from project evidence, but do not expose the evidence-gathering process
as page prose
- preserve the project's own terms, priorities, and level of ambition
- make fewer pages with real substance rather than many generic pages
- make a real developer action easier—install, evaluate, integrate, operate, or
contribute; a polished site with thin content is a failed run
- never use "generated by Sourcey", preview, adoption, migration, scaffold, or
demo framing unless the project itself uses that framing
- never describe pages as machine output, agent output, or AI-generated docs;
the site should read like the project maintainer wrote and stands behind it
- when publishing public docs, use a credible durable project, maintainer,
organization, product, or documentation home. Random personal domains,
placeholder parent sites, sandbox hosts, preview deploys, throwaway
subdomains, and unrelated novelty domains are not publication-quality homes
- if the repo evidence is too thin for a strong docs page, surface that as an
evidence gap instead of manufacturing confident filler
Canonical semantics
Complex runx skills share a reusable phase language:
scope
ingest
model
materialize
evaluate
revise
verify
ratify
The current Sourcey runner deliberately uses a bounded subset:
discover folds scope + ingest + model
- invoking the scoped runner is the operator's authorization to perform its
reversible local writes
author + write-docs + build form materialize
critique is evaluate
revise + write-revisions + rebuild form revise
verify is verify
The current slice uses exactly one bounded revision window. It never loops
until good and it never critiques indefinitely.
When docs_inputs is supplied explicitly, treat that as a bounded instruction
to use the existing config target. Do not overwrite the referenced config or
invent replacement docs files merely because repository inspection evidence is
thin. Missing evidence is not the same as missing files.
Procedure
- Inspect the current workspace by default, or the explicit project root supplied by a chain, and discover a bounded documentation plan from real project evidence.
- Author the bounded Sourcey source bundle.
- Persist that bundle deterministically inside
repo_root.
- Run
sourcey build deterministically with the discovered or authored config.
- Critique the built output in one bounded evaluation pass.
- Apply at most one bounded revision pass from that critique.
- Rebuild deterministically after the revision bundle is written.
- Verify the output directory contains
index.html.
- Inspect the receipt and generated site.
The deterministic build report should carry enough rendered evidence for an
external reviewer to reason about the site without hidden file access. At
minimum that means the generated file list plus index-page title, headings, and
an excerpt when index.html exists.
Discovery contract
discovery_report may include additional planning metadata, but the canonical
resolved docs inputs must live under:
discovery_report.discovered.brand_name
discovery_report.discovered.homepage_url
discovery_report.discovered.docs_inputs
Downstream deterministic build steps consume that nested discovered object.
Output schema
Sourcey build produces: HTML pages, sourcey.css, sourcey.js,
search-index.json, sitemap.xml, llms.txt, llms-full.txt, and
_og/ directory with generated Open Graph images.
The sealed package includes:
discovery_report:
discovered:
brand_name: string | null
homepage_url: string | null
docs_inputs: object | null
doc_bundle:
files: array
summary: string
sourcey_build_report:
generated_files: array
index_title: string
index_headings: array
index_excerpt: string
evaluation_report: object
revision_bundle:
files: array
summary: string
sourcey_verification_proof:
verified: boolean
index_path: string
receipt_notes:
authority: invoked runner with bounded workspace scopes
mutation: authored docs source writes only
Worked example
Input: a project contains README.md, package.json, and a partial docs/
tree, but no Sourcey config.
Output: decision: ready; Sourcey discovers the project name,
homepage, and docs inputs, writes a bounded docs/sourcey.config.ts plus only
the highest-value missing docs pages, builds to .sourcey/runx-docs, critiques
the rendered index.html, applies at most one revision bundle, verifies the
output, and seals a receipt with the build report and verification proof.
If the project evidence does not support a maintainer-grade site, the run stops
with needs_more_evidence or needs_review instead of producing filler.
Inputs
project: project root directory (default: the current workspace).
repo_root: filesystem root for authored-source writes (default: the current workspace). When a composed chain targets another project, pass both project and repo_root explicitly and keep them aligned.
brand_name: project name (discovered from package evidence if omitted).
homepage_url: project homepage (discovered from project evidence if omitted).
docs_inputs: structured docs inputs, e.g. {"mode":"config","config":"docs/sourcey.config.ts"} or {"mode":"openapi","spec":"openapi.yaml"}. Discovered if omitted and may point at authored config produced by the skill.
project_brief: optional grounded brief carrying brand cues, docs audit,
IA direction, and writing constraints. When present, the authored docs should
feel like native project docs rather than generic generated scaffolding.
output_dir: generated site output path (default: <project>/.sourcey/runx-docs).
sourcey_bin: explicit sourcey executable path (default: SOURCEY_BIN env or sourcey on PATH).
Repository Contract
- Keep authored docs source in the repository, usually under
docs/ when using
docs/sourcey.config.ts.
- Keep generated site output in
output_dir, separate from the source tree.
- The default generated output path is
<project>/.sourcey/runx-docs.
- Generated output should be gitignored unless the project explicitly chooses to
version release artifacts.
- CI or deploy may run deterministic
sourcey build from committed source.
- Deploy must not be the step where docs scope, prose, or IA is invented. Do
discovery, authoring, and review before deploy.
- For Astro host apps, prefer the first-class
sourcey/astro integration over
a separate prebuild script that writes into public/docs. Keep
docs/sourcey.config.ts and markdown/spec inputs as source; let astro dev
serve Sourcey through Vite and astro build write generated docs into the
final output under the configured route.
- For public publication, include enough proof for an external reviewer to
inspect the target project, source commit, Sourcey config or input source,
generated page list, deployment URL, parent domain, and durability of the
hosting choice.
Astro host pattern
Use this shape when the target already uses Astro and docs should live at a
path such as /docs:
import { defineConfig } from "astro/config";
import sourcey from "sourcey/astro";
export default defineConfig({
site: "https://example.com",
integrations: [
sourcey({
config: "./docs/sourcey.config.ts",
routeBase: "/docs",
}),
],
});
Do not add prebuild, build:docs, or committed public/docs artifacts for
this path unless the project explicitly cannot use Astro integrations. The
generated output remains reproducible build output, not authored source.
Config reference
import { defineConfig } from "sourcey";
export default defineConfig({
name: "Project Name",
theme: {
preset: "default", // "default" | "minimal" | "api-first"
colors: {
primary: "#hex", // required
light: "#hex", // optional, derived from primary
dark: "#hex", // optional, derived from primary
},
fonts: {
sans: "Inter", // optional
mono: "monospace", // optional
},
layout: {
sidebar: "18rem", // optional
toc: "19rem", // optional
content: "44rem", // optional
},
css: ["path/to/custom.css"], // optional
},
logo: "path/to/logo.png", // or { light, dark, href }
favicon: "path/to/favicon.ico",
repo: "https://github.com/org/repo",
editBranch: "main",
editBasePath: "docs", // path from repo root to docs source
codeSamples: ["curl", "javascript", "python"], // for OpenAPI tabs
navigation: {
tabs: [
// Markdown pages tab
{
tab: "Documentation",
slug: "", // empty = default tab
groups: [
{ group: "Getting Started", pages: ["introduction", "quickstart"] },
{ group: "Guides", pages: ["configuration", "deployment"] },
],
},
// OpenAPI tab
{
tab: "API Reference",
openapi: "path/to/openapi.yaml",
},
// Doxygen tab
{
tab: "C++ API",
doxygen: {
xml: "path/to/doxygen/xml",
language: "cpp", // "cpp" | "java"
groups: true, // use doxygen groups for nav
index: "auto", // "auto"|"rich"|"structured"|"flat"|"none"
},
},
// MCP tab
{
tab: "Tools",
mcp: "path/to/mcp.json",
},
],
},
navbar: {
links: [
{ type: "github", href: "https://github.com/org/repo" },
// types: github, twitter, discord, linkedin, youtube, slack,
// mastodon, bluesky, reddit, npm, link
],
primary: { type: "button", label: "Demo", href: "/demo" },
},
footer: {
links: [{ type: "github", href: "https://github.com/org/repo" }],
},
search: {
featured: ["introduction", "quickstart"], // top results when empty query
},
});
Page format
Pages are markdown files resolved relative to the config file directory.
If config is at docs/sourcey.config.ts, then page "quickstart" resolves
to docs/quickstart.md.
---
title: Page Title
description: One-line description for search and meta tags
---
Content here. Standard markdown with code blocks, tables, links.
Card Icon Contract
Sourcey card icons are Heroicons v2 outline names in kebab-case. The renderer
returns an empty icon for unknown names, so authoring must use exact names.
Known-good names for documentation cards include: academic-cap, arrow-path,
bell, bolt, book-open, chart-bar, check-circle, cloud-arrow-up,
code-bracket, command-line, cpu-chip, cube, document,
document-text, exclamation-triangle, globe-alt, key, lifebuoy,
light-bulb, lock-closed, magnifying-glass, map, rocket-launch,
server-stack, shield-check, sparkles, and wrench-screwdriver.
Invalid card icon names are a blocking quality issue. The build report includes
icon_validation; critique and revision must fix any
icon_validation.status: "invalid" result before the run is accepted.
Edge cases and stop conditions
- Only create tabs for content types the project actually has. Do not add an
OpenAPI tab if there is no spec file. Do not add a Doxygen tab without XML.
- Do not document APIs by hand when a spec file exists — use the spec tab.
- Keep navigation shallow: 1-2 tabs, 2-4 groups for most projects.
- Use project brand colors if identifiable. Otherwise use a neutral palette.
- Use only exact Heroicons v2 outline names for Sourcey card
icon
attributes; never invent icon names.
- When a grounded brief provides logo, favicon, color, or IA guidance, prefer
that over generic defaults.
- Match the project's existing voice and terminology.
- Never write docs that describe themselves as a preview, adoption, migration,
or tool-generated scaffold unless the repo's own evidence explicitly uses that
framing.
- Do not write generated HTML, search indexes, or OG assets into the authored
docs source tree.
- If
output_dir lives under the repo root, gitignore it or call out the
missing ignore rule as an operational gap.
- Build output may be regenerated in CI or deploy, but deploy must not author
or revise docs content.
- Public deployments must be durable and socially credible. Do not treat a
throwaway preview URL, unrelated personal domain, placeholder parent site, or
sandbox subdomain as a completed public docs home.
- Do not encode open-ended critique or revision behavior. Critique is one
bounded evaluation pass. Revision is at most one explicit bounded pass.
Agent task contracts
sourcey-discover
Inspect the target project and produce a bounded discovery_report for Sourcey. Prefer explicit
input values when supplied. Otherwise infer brand_name, homepage_url, and docs_inputs from real
project evidence such as package.json, README, existing docs, and specs. Do not invent APIs or
pages. When config does not already exist, propose a practical docs_inputs object pointing to
the config or spec path the next step should build from. Treat authored docs source and
generated site output as separate surfaces. Prefer committed docs source in the config-relative
docs tree and generated output under /.sourcey/runx-docs unless explicit inputs say
otherwise. Do not propose writing built HTML back into the docs source tree. If the chosen
output directory is inside the repo and not gitignored, record that as an operational gap. Treat
this as a bounded scope/ingest/model pass. Do not author docs, build the site, or propose
open-ended revision. When project_brief is supplied, treat it as grounded evidence about brand,
current docs quality, information architecture, and writing direction. Use it to resolve a
better documentation plan, but do not widen scope beyond the repo evidence and the brief's
stated priorities. When the brief includes an existing_surface inventory, carry it forward as a
real coverage requirement instead of treating it as optional context. discovery_report must use
this canonical shape: {
"discovered": {
"brand_name": string|null,
"homepage_url": string|null,
"docs_inputs": object|null
}
} Additional fields are allowed, but brand_name, homepage_url, and docs_inputs must live under discovery_report.discovered.
sourcey-author
Author a bounded Sourcey source bundle from the bounded discovery plan. doc_bundle must include
a files array of { path, contents } entries to write under the target project, plus a summary of
what was authored. When the project already has a complete Sourcey config and pages, keep the
bundle minimal. When config or pages are missing, create only the files required to build a
strong first documentation site grounded in the discovered evidence. If docs_inputs was supplied
explicitly and discovery did not establish that the referenced config or docs files are missing,
preserve the existing repo contents and return an empty files array rather than overwriting the
config with a weaker placeholder bundle. Lack of repository inspection evidence is not evidence
that the files are absent. Only write source docs, config, assets, and minimal supporting repo
metadata. Never write generated HTML, search indexes, or OG assets into the source docs tree.
When the bounded plan uses a generated output_dir under the repo root and the repo does not
already ignore it, include the minimal .gitignore change needed to ignore that build artifact.
This is one bounded materialize pass, not an open-ended iteration loop. When project_brief is
supplied, it is the quality bar:
- Use the brief's brand_system to set logo, favicon, colours, and
visual direction when the evidence supports it.
- Use the brief's current_docs_audit and information_architecture to
preserve what works and fill only the highest-value gaps.
- If the brief includes existing_surface.visible_paths, preserve a
maintainable equivalent of that visible docs footprint. Do not
drop notebook-backed examples, API reference sections, or other
current pages just because they were not called out as priority
pages.
- Use the brief's writing_directives to keep terminology, audience,
and tone native to the project.
- Never write docs that call themselves a preview, migration,
adoption, scaffold, or vendor-generated artifact unless the repo's
own evidence already uses those words.
- A maintainer should be able to read the result and believe it is
their project's docs, not a demo site. The generated site should
feel like a fuller, better version of the current docs surface,
not a smaller demo.
- Sourcey card icons must be exact Heroicons v2 outline kebab-case
names. Do not invent icon names. Known-good card icons include
academic-cap, arrow-path, bell, bolt, book-open, chart-bar,
check-circle, cloud-arrow-up, code-bracket, command-line,
cpu-chip, cube, document, document-text, exclamation-triangle,
globe-alt, key, lifebuoy, light-bulb, lock-closed,
magnifying-glass, map, rocket-launch, server-stack,
shield-check, sparkles, and wrench-screwdriver.
sourcey-critique
Evaluate the built Sourcey site against the discovered plan and the authored source bundle. Use
the build_report as the primary evidence packet for rendered output, especially generated_files,
index_title, index_headings, and index_excerpt. When that evidence is absent or thin, call it
out as an evidence gap rather than inventing site content. Produce one bounded evaluation_report
covering grounding, clarity, navigation quality, brand alignment, voice integrity, coverage, and
obvious gaps. Flag operational mistakes such as generated output living in source control
without intent or deploy-time authoring assumptions. Explicitly call out any wording that reads
like a preview, adoption pitch, migration pitch, or tool scaffolding instead of native project
docs. Treat build_report.icon_validation.status == "invalid" as a blocking quality failure: cite
invalid_icons and require exact Heroicons v2 outline replacements before passing the run. When
project_brief includes existing_surface.visible_page_count or visible_paths, compare the built
site against that inventory and treat coverage regression as a blocking quality failure. Do not
propose open-ended revision loops here.
sourcey-revise
Apply at most one bounded revision pass using the evaluation_report. revision_bundle must
include a files array of { path, contents } entries to update under the target project, plus a
summary of the deltas applied. If the first build is already strong, return an empty files array
and explain why. Do not open a second critique loop, do not widen scope beyond the discovered
plan, and do not turn generated site output into committed source. Prioritize fixing brand-fit
errors, generic vendor framing, shallow IA, and missing maintainer-grade coverage before making
cosmetic changes. If the brief or evaluation report shows that the current build is smaller than
the maintainer's existing visible docs surface, spend the revision pass on closing that coverage
gap first. If evaluation_report or build_report identifies invalid Sourcey card icons, replace
them with exact Heroicons v2 outline kebab-case names before making lower-priority prose edits.
1---2name: sourcey3description: Generate documentation for a project using Sourcey.4---56# Sourcey78Generate a documentation site for a project using Sourcey. Sourcey is a static9documentation generator that produces HTML sites from markdown pages, OpenAPI10specs, Doxygen XML, and MCP server snapshots.1112## What this skill does1314By default, runx executes Sourcey as a governed mixed-runner skill:15161. discover the bounded documentation scope, evidence, and plan172. author the bounded docs/config bundle183. write the source bundle deterministically under the runner's declared19 workspace scopes204. build docs deterministically215. critique the built output in one bounded pass226. apply at most one bounded revision pass237. rebuild and verify the output deterministically2425For already-configured projects, the same `sourcey` runner stays narrow: the26discover step can confirm existing config, the author/revise passes can return27empty bundles, and the deterministic tool steps still perform the build and28verification work.2930A direct zero-input invocation targets the current workspace, so `runx skill31sourcey` reaches bounded discovery immediately. A composed chain targeting a32different project should pass both `project` and `repo_root` explicitly so33discovery, authored-source writes, and deterministic builds stay on the same34workspace boundary.3536For repository-backed projects, Sourcey owns two separate surfaces: committed37docs source and generated site output. Keep those separate. Do not mix emitted38HTML, search indexes, or OG assets back into the authored docs tree.3940## When to use this skill4142- A project needs a maintainer-grade documentation site generated from real43 repository evidence, existing docs, API specs, Doxygen XML, or MCP snapshots.44- A branded package or product needs Sourcey output with governed discovery,45 bounded authoring, deterministic build, critique, revision, and receipt46 proof.47- A workflow needs to separate authored docs source from generated site output48 while preserving a reviewable receipt trail.49- A maintainer wants CI or deploy to rebuild docs without inventing scope,50 prose, or information architecture at deploy time.5152## When not to use this skill5354- To manufacture documentation when the repository evidence is too thin. Return55 `needs_more_evidence` or `needs_review` instead of confident filler.56- To write generated HTML, search indexes, or Open Graph assets back into the57 source docs tree.58- To run open-ended critique/revision loops or write outside the declared59 workspace root.60- To document APIs by hand when an OpenAPI, Doxygen, or MCP source can be used61 directly by Sourcey.6263## Documentation rules6465Sourcey output should read like native project documentation that a maintainer66would stand behind:6768- build from project evidence, but do not expose the evidence-gathering process69 as page prose70- preserve the project's own terms, priorities, and level of ambition71- make fewer pages with real substance rather than many generic pages72- make a real developer action easier—install, evaluate, integrate, operate, or73 contribute; a polished site with thin content is a failed run74- never use "generated by Sourcey", preview, adoption, migration, scaffold, or75 demo framing unless the project itself uses that framing76- never describe pages as machine output, agent output, or AI-generated docs;77 the site should read like the project maintainer wrote and stands behind it78- when publishing public docs, use a credible durable project, maintainer,79 organization, product, or documentation home. Random personal domains,80 placeholder parent sites, sandbox hosts, preview deploys, throwaway81 subdomains, and unrelated novelty domains are not publication-quality homes82- if the repo evidence is too thin for a strong docs page, surface that as an83 evidence gap instead of manufacturing confident filler8485## Canonical semantics8687Complex runx skills share a reusable phase language:8889- `scope`90- `ingest`91- `model`92- `materialize`93- `evaluate`94- `revise`95- `verify`96- `ratify`9798The current Sourcey runner deliberately uses a bounded subset:99100- `discover` folds `scope + ingest + model`101- invoking the scoped runner is the operator's authorization to perform its102 reversible local writes103- `author + write-docs + build` form `materialize`104- `critique` is `evaluate`105- `revise + write-revisions + rebuild` form `revise`106- `verify` is `verify`107108The current slice uses exactly one bounded revision window. It never loops109until good and it never critiques indefinitely.110111When `docs_inputs` is supplied explicitly, treat that as a bounded instruction112to use the existing config target. Do not overwrite the referenced config or113invent replacement docs files merely because repository inspection evidence is114thin. Missing evidence is not the same as missing files.115116## Procedure1171181. Inspect the current workspace by default, or the explicit project root supplied by a chain, and discover a bounded documentation plan from real project evidence.1192. Author the bounded Sourcey source bundle.1203. Persist that bundle deterministically inside `repo_root`.1214. Run `sourcey build` deterministically with the discovered or authored config.1225. Critique the built output in one bounded evaluation pass.1236. Apply at most one bounded revision pass from that critique.1247. Rebuild deterministically after the revision bundle is written.1258. Verify the output directory contains `index.html`.1269. Inspect the receipt and generated site.127128The deterministic build report should carry enough rendered evidence for an129external reviewer to reason about the site without hidden file access. At130minimum that means the generated file list plus index-page title, headings, and131an excerpt when `index.html` exists.132133## Discovery contract134135`discovery_report` may include additional planning metadata, but the canonical136resolved docs inputs must live under:137138- `discovery_report.discovered.brand_name`139- `discovery_report.discovered.homepage_url`140- `discovery_report.discovered.docs_inputs`141142Downstream deterministic build steps consume that nested `discovered` object.143144## Output schema145146Sourcey build produces: HTML pages, `sourcey.css`, `sourcey.js`,147`search-index.json`, `sitemap.xml`, `llms.txt`, `llms-full.txt`, and148`_og/` directory with generated Open Graph images.149150The sealed package includes:151152```yaml153discovery_report:154 discovered:155 brand_name: string | null156 homepage_url: string | null157 docs_inputs: object | null158doc_bundle:159 files: array160 summary: string161sourcey_build_report:162 generated_files: array163 index_title: string164 index_headings: array165 index_excerpt: string166evaluation_report: object167revision_bundle:168 files: array169 summary: string170sourcey_verification_proof:171 verified: boolean172 index_path: string173receipt_notes:174 authority: invoked runner with bounded workspace scopes175 mutation: authored docs source writes only176```177178## Worked example179180Input: a project contains `README.md`, `package.json`, and a partial `docs/`181tree, but no Sourcey config.182183Output: `decision: ready`; Sourcey discovers the project name,184homepage, and docs inputs, writes a bounded `docs/sourcey.config.ts` plus only185the highest-value missing docs pages, builds to `.sourcey/runx-docs`, critiques186the rendered `index.html`, applies at most one revision bundle, verifies the187output, and seals a receipt with the build report and verification proof.188189If the project evidence does not support a maintainer-grade site, the run stops190with `needs_more_evidence` or `needs_review` instead of producing filler.191192## Inputs193194- `project`: project root directory (default: the current workspace).195- `repo_root`: filesystem root for authored-source writes (default: the current workspace). When a composed chain targets another project, pass both `project` and `repo_root` explicitly and keep them aligned.196- `brand_name`: project name (discovered from package evidence if omitted).197- `homepage_url`: project homepage (discovered from project evidence if omitted).198- `docs_inputs`: structured docs inputs, e.g. `{"mode":"config","config":"docs/sourcey.config.ts"}` or `{"mode":"openapi","spec":"openapi.yaml"}`. Discovered if omitted and may point at authored config produced by the skill.199- `project_brief`: optional grounded brief carrying brand cues, docs audit,200 IA direction, and writing constraints. When present, the authored docs should201 feel like native project docs rather than generic generated scaffolding.202- `output_dir`: generated site output path (default: `<project>/.sourcey/runx-docs`).203- `sourcey_bin`: explicit sourcey executable path (default: `SOURCEY_BIN` env or `sourcey` on PATH).204205## Repository Contract206207- Keep authored docs source in the repository, usually under `docs/` when using208 `docs/sourcey.config.ts`.209- Keep generated site output in `output_dir`, separate from the source tree.210- The default generated output path is `<project>/.sourcey/runx-docs`.211- Generated output should be gitignored unless the project explicitly chooses to212 version release artifacts.213- CI or deploy may run deterministic `sourcey build` from committed source.214- Deploy must not be the step where docs scope, prose, or IA is invented. Do215 discovery, authoring, and review before deploy.216- For Astro host apps, prefer the first-class `sourcey/astro` integration over217 a separate prebuild script that writes into `public/docs`. Keep218 `docs/sourcey.config.ts` and markdown/spec inputs as source; let `astro dev`219 serve Sourcey through Vite and `astro build` write generated docs into the220 final output under the configured route.221- For public publication, include enough proof for an external reviewer to222 inspect the target project, source commit, Sourcey config or input source,223 generated page list, deployment URL, parent domain, and durability of the224 hosting choice.225226## Astro host pattern227228Use this shape when the target already uses Astro and docs should live at a229path such as `/docs`:230231```typescript232import { defineConfig } from "astro/config";233import sourcey from "sourcey/astro";234235export default defineConfig({236 site: "https://example.com",237 integrations: [238 sourcey({239 config: "./docs/sourcey.config.ts",240 routeBase: "/docs",241 }),242 ],243});244```245246Do not add `prebuild`, `build:docs`, or committed `public/docs` artifacts for247this path unless the project explicitly cannot use Astro integrations. The248generated output remains reproducible build output, not authored source.249250## Config reference251252```typescript253import { defineConfig } from "sourcey";254255export default defineConfig({256 name: "Project Name",257 theme: {258 preset: "default", // "default" | "minimal" | "api-first"259 colors: {260 primary: "#hex", // required261 light: "#hex", // optional, derived from primary262 dark: "#hex", // optional, derived from primary263 },264 fonts: {265 sans: "Inter", // optional266 mono: "monospace", // optional267 },268 layout: {269 sidebar: "18rem", // optional270 toc: "19rem", // optional271 content: "44rem", // optional272 },273 css: ["path/to/custom.css"], // optional274 },275 logo: "path/to/logo.png", // or { light, dark, href }276 favicon: "path/to/favicon.ico",277 repo: "https://github.com/org/repo",278 editBranch: "main",279 editBasePath: "docs", // path from repo root to docs source280 codeSamples: ["curl", "javascript", "python"], // for OpenAPI tabs281 navigation: {282 tabs: [283 // Markdown pages tab284 {285 tab: "Documentation",286 slug: "", // empty = default tab287 groups: [288 { group: "Getting Started", pages: ["introduction", "quickstart"] },289 { group: "Guides", pages: ["configuration", "deployment"] },290 ],291 },292 // OpenAPI tab293 {294 tab: "API Reference",295 openapi: "path/to/openapi.yaml",296 },297 // Doxygen tab298 {299 tab: "C++ API",300 doxygen: {301 xml: "path/to/doxygen/xml",302 language: "cpp", // "cpp" | "java"303 groups: true, // use doxygen groups for nav304 index: "auto", // "auto"|"rich"|"structured"|"flat"|"none"305 },306 },307 // MCP tab308 {309 tab: "Tools",310 mcp: "path/to/mcp.json",311 },312 ],313 },314 navbar: {315 links: [316 { type: "github", href: "https://github.com/org/repo" },317 // types: github, twitter, discord, linkedin, youtube, slack,318 // mastodon, bluesky, reddit, npm, link319 ],320 primary: { type: "button", label: "Demo", href: "/demo" },321 },322 footer: {323 links: [{ type: "github", href: "https://github.com/org/repo" }],324 },325 search: {326 featured: ["introduction", "quickstart"], // top results when empty query327 },328});329```330331## Page format332333Pages are markdown files resolved relative to the config file directory.334If config is at `docs/sourcey.config.ts`, then page `"quickstart"` resolves335to `docs/quickstart.md`.336337```markdown338---339title: Page Title340description: One-line description for search and meta tags341---342343Content here. Standard markdown with code blocks, tables, links.344```345346## Card Icon Contract347348Sourcey card icons are Heroicons v2 outline names in kebab-case. The renderer349returns an empty icon for unknown names, so authoring must use exact names.350351Known-good names for documentation cards include: `academic-cap`, `arrow-path`,352`bell`, `bolt`, `book-open`, `chart-bar`, `check-circle`, `cloud-arrow-up`,353`code-bracket`, `command-line`, `cpu-chip`, `cube`, `document`,354`document-text`, `exclamation-triangle`, `globe-alt`, `key`, `lifebuoy`,355`light-bulb`, `lock-closed`, `magnifying-glass`, `map`, `rocket-launch`,356`server-stack`, `shield-check`, `sparkles`, and `wrench-screwdriver`.357358Invalid card icon names are a blocking quality issue. The build report includes359`icon_validation`; critique and revision must fix any360`icon_validation.status: "invalid"` result before the run is accepted.361362## Edge cases and stop conditions363364- Only create tabs for content types the project actually has. Do not add an365 OpenAPI tab if there is no spec file. Do not add a Doxygen tab without XML.366- Do not document APIs by hand when a spec file exists — use the spec tab.367- Keep navigation shallow: 1-2 tabs, 2-4 groups for most projects.368- Use project brand colors if identifiable. Otherwise use a neutral palette.369- Use only exact Heroicons v2 outline names for Sourcey card `icon`370 attributes; never invent icon names.371- When a grounded brief provides logo, favicon, color, or IA guidance, prefer372 that over generic defaults.373- Match the project's existing voice and terminology.374- Never write docs that describe themselves as a preview, adoption, migration,375 or tool-generated scaffold unless the repo's own evidence explicitly uses that376 framing.377- Do not write generated HTML, search indexes, or OG assets into the authored378 docs source tree.379- If `output_dir` lives under the repo root, gitignore it or call out the380 missing ignore rule as an operational gap.381- Build output may be regenerated in CI or deploy, but deploy must not author382 or revise docs content.383- Public deployments must be durable and socially credible. Do not treat a384 throwaway preview URL, unrelated personal domain, placeholder parent site, or385 sandbox subdomain as a completed public docs home.386- Do not encode open-ended critique or revision behavior. Critique is one387 bounded evaluation pass. Revision is at most one explicit bounded pass.388389## Agent task contracts390391### `sourcey-discover`392393Inspect the target project and produce a bounded discovery_report for Sourcey. Prefer explicit394input values when supplied. Otherwise infer brand_name, homepage_url, and docs_inputs from real395project evidence such as package.json, README, existing docs, and specs. Do not invent APIs or396pages. When config does not already exist, propose a practical docs_inputs object pointing to397the config or spec path the next step should build from. Treat authored docs source and398generated site output as separate surfaces. Prefer committed docs source in the config-relative399docs tree and generated output under <project>/.sourcey/runx-docs unless explicit inputs say400otherwise. Do not propose writing built HTML back into the docs source tree. If the chosen401output directory is inside the repo and not gitignored, record that as an operational gap. Treat402this as a bounded scope/ingest/model pass. Do not author docs, build the site, or propose403open-ended revision. When project_brief is supplied, treat it as grounded evidence about brand,404current docs quality, information architecture, and writing direction. Use it to resolve a405better documentation plan, but do not widen scope beyond the repo evidence and the brief's406stated priorities. When the brief includes an existing_surface inventory, carry it forward as a407real coverage requirement instead of treating it as optional context. discovery_report must use408this canonical shape: {409 "discovered": {410 "brand_name": string|null,411 "homepage_url": string|null,412 "docs_inputs": object|null413 }414} Additional fields are allowed, but brand_name, homepage_url, and docs_inputs must live under discovery_report.discovered.415416### `sourcey-author`417418Author a bounded Sourcey source bundle from the bounded discovery plan. doc_bundle must include419a files array of { path, contents } entries to write under the target project, plus a summary of420what was authored. When the project already has a complete Sourcey config and pages, keep the421bundle minimal. When config or pages are missing, create only the files required to build a422strong first documentation site grounded in the discovered evidence. If docs_inputs was supplied423explicitly and discovery did not establish that the referenced config or docs files are missing,424preserve the existing repo contents and return an empty files array rather than overwriting the425config with a weaker placeholder bundle. Lack of repository inspection evidence is not evidence426that the files are absent. Only write source docs, config, assets, and minimal supporting repo427metadata. Never write generated HTML, search indexes, or OG assets into the source docs tree.428When the bounded plan uses a generated output_dir under the repo root and the repo does not429already ignore it, include the minimal .gitignore change needed to ignore that build artifact.430This is one bounded materialize pass, not an open-ended iteration loop. When project_brief is431supplied, it is the quality bar:432433- Use the brief's brand_system to set logo, favicon, colours, and434 visual direction when the evidence supports it.435- Use the brief's current_docs_audit and information_architecture to436 preserve what works and fill only the highest-value gaps.437- If the brief includes existing_surface.visible_paths, preserve a438 maintainable equivalent of that visible docs footprint. Do not439 drop notebook-backed examples, API reference sections, or other440 current pages just because they were not called out as priority441 pages.442- Use the brief's writing_directives to keep terminology, audience,443 and tone native to the project.444- Never write docs that call themselves a preview, migration,445 adoption, scaffold, or vendor-generated artifact unless the repo's446 own evidence already uses those words.447- A maintainer should be able to read the result and believe it is448 their project's docs, not a demo site. The generated site should449 feel like a fuller, better version of the current docs surface,450 not a smaller demo.451- Sourcey card icons must be exact Heroicons v2 outline kebab-case452 names. Do not invent icon names. Known-good card icons include453 academic-cap, arrow-path, bell, bolt, book-open, chart-bar,454 check-circle, cloud-arrow-up, code-bracket, command-line,455 cpu-chip, cube, document, document-text, exclamation-triangle,456 globe-alt, key, lifebuoy, light-bulb, lock-closed,457 magnifying-glass, map, rocket-launch, server-stack,458 shield-check, sparkles, and wrench-screwdriver.459460### `sourcey-critique`461462Evaluate the built Sourcey site against the discovered plan and the authored source bundle. Use463the build_report as the primary evidence packet for rendered output, especially generated_files,464index_title, index_headings, and index_excerpt. When that evidence is absent or thin, call it465out as an evidence gap rather than inventing site content. Produce one bounded evaluation_report466covering grounding, clarity, navigation quality, brand alignment, voice integrity, coverage, and467obvious gaps. Flag operational mistakes such as generated output living in source control468without intent or deploy-time authoring assumptions. Explicitly call out any wording that reads469like a preview, adoption pitch, migration pitch, or tool scaffolding instead of native project470docs. Treat build_report.icon_validation.status == "invalid" as a blocking quality failure: cite471invalid_icons and require exact Heroicons v2 outline replacements before passing the run. When472project_brief includes existing_surface.visible_page_count or visible_paths, compare the built473site against that inventory and treat coverage regression as a blocking quality failure. Do not474propose open-ended revision loops here.475476### `sourcey-revise`477478Apply at most one bounded revision pass using the evaluation_report. revision_bundle must479include a files array of { path, contents } entries to update under the target project, plus a480summary of the deltas applied. If the first build is already strong, return an empty files array481and explain why. Do not open a second critique loop, do not widen scope beyond the discovered482plan, and do not turn generated site output into committed source. Prioritize fixing brand-fit483errors, generic vendor framing, shallow IA, and missing maintainer-grade coverage before making484cosmetic changes. If the brief or evaluation report shows that the current build is smaller than485the maintainer's existing visible docs surface, spend the revision pass on closing that coverage486gap first. If evaluation_report or build_report identifies invalid Sourcey card icons, replace487them with exact Heroicons v2 outline kebab-case names before making lower-priority prose edits.