Skip to content

Commit 0b2d0df

Browse files
committed
feat(docs): extend docs with AI skills
1 parent 14fb2ba commit 0b2d0df

30 files changed

Lines changed: 2169 additions & 5 deletions

File tree

AGENTS.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,19 @@ do not skip steps even when the previous stage was green.
151151
- **Nginx `types {}` in server scope replaces, not merges.** When adding `text/markdown
152152
md;` to serve the per-page companions, you must `include /etc/nginx/mime.types;` first
153153
in the same `server { … }` block, otherwise `.txt` (and everything else) regresses to
154-
`application/octet-stream`. `llms.txt` is `text/plain` per spec; the per-page
155-
companions are `text/markdown`.
154+
`application/octet-stream`. The per-page `.md` companions are `text/markdown`. `llms.txt`
155+
and `llms-index.txt` are **also** served as `text/markdown` despite the `.txt` extension
156+
(they are llmstxt.org-format markdown files, and the promo site's `Accept: text/markdown`
157+
content-negotiation 302 lands here -- Cloudflare's "Markdown for Agents" check at
158+
isitagentready.com rejects a `text/plain` final response). Achieved with a regex
159+
`location ~ ^/docs/llms(-index)?\.txt$ { types { } default_type text/markdown; }`
160+
override that empties the inherited MIME map for that one location so `default_type`
161+
wins. **The `/docs/` prefix matters**: the production Traefik route for the public
162+
`secutils.dev/llms.txt` (and `/llms-index.txt`) URLs carries an `addPrefix: /docs`
163+
middleware, so by the time the request reaches the docs nginx the URI is
164+
`/docs/llms.txt`. A bare `location = /llms.txt` will silently never match -- if you
165+
smoke-test this from inside the pod (e.g. `kubectl exec ... -- wget /llms.txt`), curl
166+
the **prefixed** path instead.
156167

157168
#### Docker (stages 4 & 10)
158169

components/secutils-docs/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,40 @@ Install all the required dependencies with `npm install` and run the UI in watch
88

99
The docs website should be accessible at http://localhost:7373.
1010

11+
## Agent skill files (`static/guides/.../SKILL.md`)
12+
13+
Alongside each `.mdx` guide we publish a hand-authored `SKILL.md` file at `static/guides/<area>/<name>/SKILL.md` that
14+
conforms to the [Cloudflare Agent Skills Discovery RFC v0.2.0](https://github.com/cloudflare/agent-skills-discovery-rfc).
15+
Docusaurus copies the `static/` tree verbatim into `build/`, so the file is served at
16+
`https://secutils.dev/docs/guides/<area>/<name>/SKILL.md` with `Content-Type: text/markdown`.
17+
18+
The promo site at https://secutils.dev aggregates these URLs into its `/.well-known/agent-skills/index.json` discovery
19+
document. The aggregator lives in a separate repository under `components/secutils-dev-webui/src/skills.source.json` and
20+
keys off each SKILL.md's frontmatter `name:` field. When adding or editing a SKILL.md here:
21+
22+
1. Use a unique `name:` slug (lowercased, hyphen-separated). It must match the corresponding entry in the promo repo's
23+
`skills.source.json`.
24+
2. Keep the YAML frontmatter minimal: `name:` and `description:` only. Use the folded scalar form (`description: >-`)
25+
for descriptions longer than one line.
26+
3. Author the body in clean Markdown. Avoid em-dashes, use commas instead. Do not wrap lines aggressively, aim for
27+
roughly 120 columns at sentence boundaries.
28+
4. After editing, ask the promo repo's maintainer to rerun `npm run regenerate-skills` so the agent-skills index picks
29+
up the new sha256 digest. The promo script defaults to reading the bytes from this repo through a sibling
30+
working-tree `localPath`, so the digest matches the file the docs build will serve.
31+
32+
When adding an entirely new SKILL.md, also add a corresponding entry (`name`, `description`, `url`, `localPath`) to
33+
`components/secutils-dev-webui/src/skills.source.json` in the promo repo and regenerate.
34+
35+
### "Skill" badge on the rendered guide
36+
37+
Every guide whose frontmatter declares `skill: true` automatically renders a small "Skill" pill in the top-right of the
38+
page that links to the companion SKILL.md (computed as`<page-permalink>/SKILL.md`). The badge mirrors the styling of the
39+
header pill used by the static tools at `tools.secutils.dev/*.html`, so the affordance is recognisable across both surfaces.
40+
41+
The implementation is a Docusaurus swizzle:
42+
43+
- `src/components/SkillBadge.tsx` / `.scss` - the standalone link/pill component.
44+
- `src/theme/DocItem/Content/index.tsx` - wraps the default `@theme-original/DocItem/Content` component, reads the
45+
current doc's `frontMatter` via `useDoc()`, and prepends the badge when `frontMatter.skill === true`.
46+
47+
When adding a new SKILL.md, remember to add `skill: true` to the sibling `.mdx` so the badge appears.

components/secutils-docs/config/nginx.conf

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ server {
66
# Re-include the global mime map so we can extend it with `.md` below without overriding the inherited
77
# types map (nginx's `types {}` directive in server scope replaces, not merges).
88
include /etc/nginx/mime.types;
9-
# Serve per-page `.md` companion files (generated by docusaurus-plugin-llms) with the spec-compliant
10-
# `text/markdown` content type so LLM crawlers and browsers render them as text instead of triggering a
11-
# download. `.txt` (used by `llms.txt` / `llms-index.txt`) already maps to `text/plain` via mime.types.
9+
10+
# Serve per-page `.md` companion files (generated by docusaurus-plugin-llms) with the spec-compliant `text/markdown`
11+
# content type so LLM crawlers and browsers render them as text instead of triggering a download. The `.txt` (used
12+
# by `llms.txt` / `llms-index.txt`) maps to `text/plain` via mime.types by default, but the two llmstxt.org files
13+
# are overridden in the `location = ...` block below to advertise `text/markdown` - their content IS markdown
14+
# despite the `.txt` extension, and Cloudflare's "Markdown for Agents" check (isitagentready.com) refuses
15+
# `text/plain` when an agent issued `Accept: text/markdown` and was redirected here from the main site's
16+
# `location = /` block.
1217
types {
1318
text/markdown md;
1419
}
@@ -19,6 +24,24 @@ server {
1924

2025
#access_log /var/log/nginx/host.access.log main;
2126

27+
# llmstxt.org files: override the inherited `.txt -> text/plain` MIME mapping with `text/markdown` so an agent that
28+
# asked for `Accept: text/markdown` on `/` (and got 302'd here by the promo nginx) sees the correct content type.
29+
# The `types { }` empties the inherited map for the location so `default_type` wins, this is the only safe way to
30+
# override a single extension without disturbing the rest of the types map. The location regex covers both
31+
# `llms.txt` and `llms-index.txt` in one block.
32+
#
33+
# The path prefix is `/docs/` because the production Traefik route for `secutils.dev/llms.txt` and
34+
# `secutils.dev/llms-index.txt` carries an `addPrefix: /docs` middleware (Docusaurus is configured with
35+
# `baseUrl: '/docs/'`, so all build output and every internal URL inside the docs container already lives under
36+
# `/docs/`). A literal `location = /llms.txt` block would never match because the docs nginx never sees a bare
37+
# `/llms.txt` URI - the rewrite happens at the edge before us.
38+
location ~ ^/docs/llms(-index)?\.txt$ {
39+
root /usr/share/nginx/html;
40+
types { }
41+
default_type text/markdown;
42+
try_files $uri =404;
43+
}
44+
2245
location / {
2346
root /usr/share/nginx/html;
2447
try_files $uri $uri/index.html $uri/ $uri.html =404;

components/secutils-docs/docs/guides/digital_certificates/certificate_templates.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sidebar_position: 1
33
sidebar_label: Certificate Templates
44
title: Digital Certificates ➔ Certificate templates
55
description: Learn how to create and use digital certificate templates in Secutils.dev.
6+
skill: true
67
---
78

89
import Steps from '@site/src/components/Steps';

components/secutils-docs/docs/guides/digital_certificates/private_keys.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sidebar_position: 2
33
sidebar_label: Private Keys
44
title: Digital Certificates ➔ Private keys
55
description: Learn how to create and use private keys in Secutils.dev.
6+
skill: true
67
---
78

89
import Steps from '@site/src/components/Steps';

components/secutils-docs/docs/guides/platform/api_keys.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sidebar_position: 2
33
sidebar_label: API Keys
44
title: API Keys
55
description: Create and manage API keys for programmatic access to the Secutils.dev API from scripts, CI pipelines, and AI agents.
6+
skill: true
67
---
78

89
import Steps from '@site/src/components/Steps';

components/secutils-docs/docs/guides/platform/deno_runtime.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sidebar_position: 2
33
sidebar_label: Deno Runtime
44
title: Deno Sandbox Runtime
55
description: Reference for the Deno Core APIs available in responder and tracker scripts.
6+
skill: true
67
---
78

89
import CodeBlock from '@theme/CodeBlock';

components/secutils-docs/docs/guides/platform/export_import.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sidebar_position: 3
33
sidebar_label: Export & Import
44
title: Export & Import Data
55
description: Export and import your Secutils.dev data for backup, migration, or configuration management.
6+
skill: true
67
---
78

89
import Steps from '@site/src/components/Steps';

components/secutils-docs/docs/guides/platform/secrets.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sidebar_position: 1
33
sidebar_label: Secrets
44
title: User Secrets
55
description: Store and manage encrypted secrets (API keys, tokens, credentials) for use in responder scripts, tracker scripts, and responder templates.
6+
skill: true
67
---
78

89
import Steps from '@site/src/components/Steps';

components/secutils-docs/docs/guides/platform/tags.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sidebar_position: 0
33
sidebar_label: Tags
44
title: Tags
55
description: Organize your responders, trackers, policies, certificates, scripts, and secrets with tags.
6+
skill: true
67
---
78

89
import Steps from '@site/src/components/Steps';

0 commit comments

Comments
 (0)