Skip to content

Commit bd6260d

Browse files
Improve varlock.dev agent readiness (#1028)
* Improve varlock.dev agent readiness - Add a Worker entrypoint that serves a short markdown 404 body to agents (static assets still served first; worker only runs on asset miss) - Enrich llms.txt with a description, when-to-use guidance, install commands, topic bundles, and discovery links - Emit site-wide schema.org JSON-LD (Organization, SoftwareApplication, WebSite) - Fix homepage heading outline - Publish MCP server card aliases (/.well-known/mcp.json, server-cards.json) and an ARD ai-catalog.json, generated by scripts/gen-well-known.ts - Add ai-catalog / llms.txt link hints in head, Link headers, and robots.txt - Add /about, /contact, /privacy pages and footer links - Update agent skills and docs to list the new discovery endpoints * Apply suggestion from @philmillman * Ignore wrangler local state in website package * Fix agent 404 content negotiation --------- Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
1 parent 9f5fc83 commit bd6260d

24 files changed

Lines changed: 851 additions & 101 deletions

File tree

bun.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/varlock-website/.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# build output
22
dist/
3+
# wrangler local state (wrangler dev)
4+
.wrangler/
35
# generated types
46
.astro/
5-
# generated agent-skills discovery tree (see scripts/gen-agent-skills.ts)
7+
# generated .well-known discovery files (see scripts/gen-well-known.ts)
68
public/.well-known/agent-skills/index.json
79
public/.well-known/agent-skills/varlock/
10+
public/.well-known/mcp.json
11+
public/.well-known/mcp/server-cards.json
12+
public/.well-known/ai-catalog.json
813

914
# dependencies
1015
node_modules/

packages/varlock-website/astro.config.ts

Lines changed: 94 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import robotsTxt from 'astro-robots-txt';
99
import starlightLlmsTxt from 'starlight-llms-txt';
1010
import partytown from '@astrojs/partytown';
1111
import remarkCustomHeaderId from 'remark-custom-header-id';
12+
import { outdent } from 'outdent';
1213

1314
import varlockAstroIntegration from '@varlock/astro-integration';
1415
import { ENV } from 'varlock/env';
@@ -130,10 +131,92 @@ export default defineConfig({
130131
Sidebar: '@/components/TabbedSidebar.astro',
131132
},
132133
customCss: ['@/styles/global.css'],
133-
plugins: [starlightLlmsTxt()],
134+
plugins: [
135+
starlightLlmsTxt({
136+
projectName: 'Varlock',
137+
description:
138+
'Varlock is an open source CLI and library for AI-safe .env files. A .env.schema declares and validates '
139+
+ 'environment variables, secrets are encrypted locally or loaded from external providers, and redaction plus a '
140+
+ 'credential proxy keep secret values away from logs, terminals, and AI agents.',
141+
details: outdent`
142+
When to use varlock:
143+
144+
- Managing .env files across development, CI, and production environments
145+
- Declaring env vars in a .env.schema with decorators like @type, @required, and @sensitive
146+
- Validating configuration at startup so misconfiguration fails early with clear errors
147+
- Encrypting local overrides in .env.local so nothing sensitive sits in plaintext
148+
- Loading secrets from 1Password, AWS, Azure, GCP, HashiCorp Vault, Infisical, Doppler, Bitwarden, and other providers via plugins
149+
- Redacting secret values from logs and console output at runtime
150+
- Giving AI coding agents full context on config (names, types, docs) without exposing secret values
151+
- Running agents and MCP servers behind the varlock proxy so they only ever see placeholder credentials
152+
- Scanning a repo for leaked secrets with \`varlock scan\`
153+
154+
Install:
155+
156+
\`\`\`bash
157+
npx varlock init # add to a JS/TS project
158+
npm install varlock # or add the dependency directly
159+
brew install dmno-dev/tap/varlock # standalone binary via Homebrew
160+
curl -sSfL https://varlock.dev/install.sh | sh -s # standalone binary via script
161+
\`\`\`
162+
163+
Common CLI commands: \`varlock init\`, \`varlock load\`, \`varlock run -- <cmd>\`, \`varlock encrypt\`, \`varlock scan\`, \`varlock proxy\`.
164+
165+
Every page on varlock.dev can be fetched as markdown by sending an \`Accept: text/markdown\` header. The docs are also searchable over MCP at https://docs.mcp.varlock.dev/mcp (streamable HTTP) and https://docs.mcp.varlock.dev/sse.
166+
`,
167+
optionalLinks: [
168+
{ label: 'GitHub repository', url: 'https://github.com/dmno-dev/varlock', description: 'source code, issues, and discussions' },
169+
{ label: 'npm package', url: 'https://www.npmjs.com/package/varlock' },
170+
{ label: 'Changelog', url: 'https://github.com/dmno-dev/varlock/blob/main/packages/varlock/CHANGELOG.md' },
171+
{ label: 'Docs MCP server card', url: 'https://varlock.dev/.well-known/mcp/server-card.json', description: 'MCP transports for searching these docs' },
172+
{ label: 'Agent skills index', url: 'https://varlock.dev/.well-known/agent-skills/index.json', description: 'SKILL.md files for coding agents' },
173+
{ label: 'Varlock skill (SKILL.md)', url: 'https://varlock.dev/.well-known/agent-skills/varlock/SKILL.md' },
174+
{ label: 'AI catalog (ARD)', url: 'https://varlock.dev/.well-known/ai-catalog.json' },
175+
{ label: 'Blog', url: 'https://varlock.dev/blog/' },
176+
{ label: 'Discord', url: 'https://chat.dmno.dev' },
177+
],
178+
customSets: [
179+
{
180+
label: 'Getting started and CLI reference',
181+
description: 'installation, core concepts, env-spec syntax, decorators, and every CLI command',
182+
paths: ['getting-started/**', 'reference/**', 'env-spec/**'],
183+
},
184+
{
185+
label: 'AI tools, MCP and proxy',
186+
description: 'using varlock with coding agents, MCP servers, and the credential proxy',
187+
paths: ['guides/ai-tools{,/**}', 'guides/mcp{,/**}', 'guides/proxy{,/**}'],
188+
},
189+
{
190+
label: 'Framework and language integrations',
191+
description: 'Next.js, Vite, Astro, Bun, Python, Go, Rust, Java, PHP, Docker, CI, and more',
192+
paths: ['integrations/**'],
193+
},
194+
{
195+
label: 'Secret provider plugins',
196+
description: '1Password, AWS, Azure, GCP, Vault, Infisical, Doppler, Bitwarden, Kubernetes, and other providers',
197+
paths: ['plugins/**'],
198+
},
199+
{
200+
label: 'Sandboxes',
201+
description: 'sandboxing recipes for running agents with the proxy',
202+
paths: ['sandboxes/**'],
203+
},
204+
],
205+
promote: ['getting-started/**', 'reference/cli/**'],
206+
exclude: ['sandboxes/**'],
207+
}),
208+
],
134209
head: [
135210
// add sitemap to head for discoverability
136211
{ tag: 'link', attrs: { rel: 'sitemap', href: '/sitemap-index.xml' } },
212+
// agent discovery hints
213+
{ tag: 'link', attrs: { rel: 'ai-catalog', href: '/.well-known/ai-catalog.json', type: 'application/json' } },
214+
{
215+
tag: 'link',
216+
attrs: {
217+
rel: 'alternate', href: '/llms.txt', type: 'text/markdown', title: 'llms.txt',
218+
},
219+
},
137220
// Open Graph and Twitter Card defaults (page-specific values override via head)
138221
{ tag: 'meta', attrs: { property: 'og:type', content: 'website' } },
139222
{ tag: 'meta', attrs: { property: 'og:site_name', content: 'Varlock' } },
@@ -169,9 +252,16 @@ export default defineConfig({
169252
},
170253
],
171254
transform(content) {
172-
const contentSignalLine = 'Content-Signal: ai-train=no, search=yes, ai-input=no';
173-
if (content.includes(contentSignalLine)) return content;
174-
return `${content.trimEnd()}\n${contentSignalLine}\n`;
255+
const extraLines = [
256+
'Content-Signal: ai-train=no, search=yes, ai-input=no',
257+
// Agentic Resource Discovery manifest
258+
'Agentmap: https://varlock.dev/.well-known/ai-catalog.json',
259+
];
260+
let out = content.trimEnd();
261+
for (const line of extraLines) {
262+
if (!out.includes(line)) out += `\n${line}`;
263+
}
264+
return `${out}\n`;
175265
},
176266
}),
177267
partytown({

packages/varlock-website/package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
"type": "module",
55
"version": "0.0.1",
66
"scripts": {
7-
"gen:agent-skills": "bun run scripts/gen-agent-skills.ts",
8-
"dev": "bun run gen:agent-skills && astro dev",
9-
"start": "bun run gen:agent-skills && astro dev",
10-
"build": "bun run gen:agent-skills && astro build",
7+
"gen:well-known": "bun run scripts/gen-well-known.ts",
8+
"dev": "bun run gen:well-known && astro dev",
9+
"start": "bun run gen:well-known && astro dev",
10+
"build": "bun run gen:well-known && astro build",
1111
"build:cloudflare": "turbo build --filter=@varlock/astro-integration && varlock load && turbo build",
1212
"preview": "astro preview",
13-
"astro": "astro"
13+
"astro": "astro",
14+
"test": "vitest",
15+
"test:ci": "vitest --run"
1416
},
1517
"dependencies": {
1618
"@iconify/vue": "^5.0.0",
@@ -32,6 +34,7 @@
3234
"devDependencies": {
3335
"@varlock/astro-integration": "workspace:*",
3436
"varlock": "workspace:*",
37+
"vitest": "catalog:",
3538
"wrangler": "^4.93.0"
3639
},
3740
"engines": {

packages/varlock-website/public/.well-known/agent-skills/varlock-agent-readiness/SKILL.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ Use this skill to discover machine-readable metadata published by varlock.dev.
44

55
## Discovery locations
66

7-
- API Catalog: `https://varlock.dev/.well-known/api-catalog`
8-
- MCP Server Card: `https://varlock.dev/.well-known/mcp/server-card.json`
7+
- Docs index for agents: `https://varlock.dev/llms.txt` (topic bundles are linked from it under `/_llms-txt/`; full and abridged dumps at `/llms-full.txt` and `/llms-small.txt`)
8+
- AI catalog (ARD manifest): `https://varlock.dev/.well-known/ai-catalog.json`
9+
- API Catalog (RFC 9727 linkset): `https://varlock.dev/.well-known/api-catalog`
10+
- MCP Server Card: `https://varlock.dev/.well-known/mcp/server-card.json` (aliases: `/.well-known/mcp.json`, `/.well-known/mcp/server-cards.json`)
911
- Skills index: `https://varlock.dev/.well-known/agent-skills/index.json`
12+
- Sitemap: `https://varlock.dev/sitemap-index.xml`
1013

1114
## Guidance
1215

13-
1. Start from the skills index and verify digest integrity.
14-
2. Follow API catalog relations to find service documentation and descriptors.
15-
3. Use Link response headers on the homepage for bootstrap discovery.
16+
1. Start from `llms.txt` for a summary of what varlock is and when to use it, then follow the topic bundle you need.
17+
2. Start from the skills index and verify digest integrity before loading a SKILL.md.
18+
3. Follow API catalog relations to find service documentation and descriptors.
19+
4. Use Link response headers on the homepage for bootstrap discovery.
20+
5. Any docs page returns markdown when requested with `Accept: text/markdown`. Missing paths return a 404 with a short markdown body listing recovery links.
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Varlock Docs Search
22

3-
Use this skill to discover and answer questions about varlock documentation with the remote MCP service.
3+
Use this skill to discover and answer questions about varlock documentation with the remote MCP service or the llms.txt bundles.
44

55
## Endpoints
66

77
- Streamable HTTP: `https://docs.mcp.varlock.dev/mcp`
88
- SSE: `https://docs.mcp.varlock.dev/sse`
9+
- Server card: `https://varlock.dev/.well-known/mcp/server-card.json`
10+
- Docs index: `https://varlock.dev/llms.txt` (links topic bundles, `/llms-full.txt`, and `/llms-small.txt`)
911

1012
## Guidance
1113

1214
1. Use the MCP tool to search docs by feature keywords.
13-
2. Prefer official varlock.dev links in responses.
14-
3. Return concise, implementation-focused answers.
15+
2. If MCP is unavailable, read `llms.txt` and fetch the relevant topic bundle instead of the full dump.
16+
3. Prefer official varlock.dev links in responses.
17+
4. Return concise, implementation-focused answers.

packages/varlock-website/public/.well-known/mcp/server-card.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"$schema": "https://modelcontextprotocol.io/schemas/2025-03-26/server-card.json",
33
"serverInfo": {
44
"name": "Varlock docs MCP",
5-
"version": "0.0.1"
5+
"version": "1.0.0",
6+
"description": "Search and read the varlock documentation. No authentication required.",
7+
"documentationUrl": "https://varlock.dev/guides/mcp/docs-mcp/"
68
},
79
"transports": [
810
{

packages/varlock-website/public/_headers

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,32 @@
77
Link: </guides/mcp>; rel="service-doc"
88
Link: </.well-known/mcp/server-card.json>; rel="describedby"
99
Link: </.well-known/agent-skills/index.json>; rel="describedby"
10+
Link: </.well-known/ai-catalog.json>; rel="ai-catalog"
11+
Link: </llms.txt>; rel="alternate"; type="text/markdown"
12+
13+
/llms.txt
14+
Link: </.well-known/ai-catalog.json>; rel="ai-catalog"
1015

1116
/.well-known/api-catalog
1217
Content-Type: application/linkset+json; charset=utf-8
18+
Access-Control-Allow-Origin: *
19+
20+
/.well-known/mcp.json
21+
Content-Type: application/json; charset=utf-8
22+
Access-Control-Allow-Origin: *
23+
24+
/.well-known/mcp/*
25+
Content-Type: application/json; charset=utf-8
26+
Access-Control-Allow-Origin: *
27+
28+
/.well-known/ai-catalog.json
29+
Content-Type: application/json; charset=utf-8
30+
Access-Control-Allow-Origin: *
31+
Cache-Control: public, max-age=3600
32+
33+
/.well-known/agent-skills/index.json
34+
Access-Control-Allow-Origin: *
1335

1436
/.well-known/agent-skills/*/SKILL.md
1537
Content-Type: text/markdown; charset=utf-8
38+
Access-Control-Allow-Origin: *

packages/varlock-website/scripts/gen-agent-skills.ts

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)