This commit is contained in:
eddiesoehnel committed 2026-07-25 13:12:23 -06:00
1 parent ca73bd5690
commit e1d8deb861
23 files changed
+1238 -6

No files matched your search

@@ -0,0 +1,45 @@
# Skill: AI Catalog Materialization
## Contract
Create `public/.well-known/ai-catalog.json` as the small, public capability-discovery layer for the site.
The catalog must:
- follow AI Catalog schema version 1.0;
- identify the publishing domain;
- advertise only resources that are actually public and agent-usable;
- point to each resource's native public URL instead of duplicating it;
- remain separate from `ai-index.json`, which catalogs site knowledge rather than capabilities.
## Inputs
Read:
- `README.md`
- `public/ai-index.json`
- existing public agent, API, MCP, skill, and dataset manifests
- existing `public/.well-known/ai-catalog.json`, if present
## Materialize
Run:
```bash
python skills-scripts/build_discovery_files.py
```
Add an entry only when its public URL exists or the build process creates it. Do not invent endpoints, authentication, trust claims, attestations, or capabilities.
For this base builder, advertise `ai-index.json` as an AI-readable knowledge dataset. Add MCP servers, agents, APIs, packaged skills, or nested catalogs only when a converted site actually publishes them.
## Validate
Confirm that:
- the file is valid JSON at `/.well-known/ai-catalog.json`;
- `specVersion` is supported by the current schema;
- every entry has `identifier`, `displayName`, `type`, and exactly one of `url` or inline `data`;
- identifiers are stable, domain-anchored `urn:air` values;
- `representativeQueries` contains 2-5 realistic queries;
- every advertised URL is public and accurate.
+58 -1
View File
@@ -6,6 +6,7 @@ Outputs:
- public/llms.txt
- public/agents.md
- public/skills.md
- public/.well-known/ai-catalog.json
- public/.well-known/security.txt
- public/.well-known/agent-card.json
"""
@@ -18,6 +19,7 @@ import re
from dataclasses import dataclass
from datetime import date, datetime, timezone
from pathlib import Path
from urllib.parse import urlparse
from xml.etree import ElementTree as ET
@@ -28,6 +30,7 @@ SKILLS_ROOT = REPO_ROOT / "skills-scripts"
HUGO_PUBLIC = REPO_ROOT / "hugo-html-builder" / "public"
SITE_URL = "https://indx.earth"
SITE_DOMAIN = urlparse(SITE_URL).netloc
SITE_TITLE = "iNDX Earth"
PUBLISHER = "Eddie Soehnel"
SECURITY_CONTACT = "https://indx.earth/#contact-us"
@@ -298,6 +301,7 @@ def build_llms_txt(entries: list[SitemapEntry]) -> str:
"",
"## Machine-Readable URLs",
f"- {SITE_URL}/ai-index.json",
f"- {SITE_URL}/.well-known/ai-catalog.json",
f"- {SITE_URL}/sitemap.xml",
"- /data/open/pages/**/chunks.json",
"- /data/open/pages/**/qa.json",
@@ -327,6 +331,7 @@ Canonical site: {SITE_URL}/
## Retrieval Policy
- Use `{SITE_URL}/.well-known/ai-catalog.json` to discover public agent-usable resources.
- Start with `{SITE_URL}/ai-index.json` to understand resources, artifacts, access type, and retrieval priority.
- Use `{SITE_URL}/sitemap.xml` for canonical human-facing URLs.
- Use `/data/open/pages/**/chunks.json` for semantic retrieval and `/data/open/pages/**/qa.json` for question-answer and workflow hints.
@@ -343,6 +348,7 @@ Canonical site: {SITE_URL}/
## Useful Entry Points
- `{SITE_URL}/.well-known/ai-catalog.json`
- `{SITE_URL}/ai-index.json`
- `{SITE_URL}/llms.txt`
{useful_urls}
@@ -375,6 +381,7 @@ def build_agent_card_json() -> str:
"contact": SECURITY_CONTACT,
"license": f"{SITE_URL}/wiki/license/",
"discovery": {
"ai_catalog": f"{SITE_URL}/.well-known/ai-catalog.json",
"ai_index": f"{SITE_URL}/ai-index.json",
"sitemap": f"{SITE_URL}/sitemap.xml",
"llms": f"{SITE_URL}/llms.txt",
@@ -394,6 +401,33 @@ def build_agent_card_json() -> str:
return json.dumps(payload, indent=2, ensure_ascii=False) + "\n"
def build_ai_catalog_json() -> str:
payload = {
"specVersion": "1.0",
"host": {
"displayName": SITE_TITLE,
"identifier": SITE_DOMAIN,
"documentationUrl": f"{SITE_URL}/",
},
"entries": [
{
"identifier": f"urn:air:{SITE_DOMAIN}:dataset:ai-index",
"displayName": "iNDX AI-Readable Knowledge Index",
"type": "application/json",
"url": f"{SITE_URL}/ai-index.json",
"description": "Discovery and routing metadata for public iNDX content and semantic artifacts.",
"tags": ["knowledge", "structured-content", "semantic-retrieval"],
"capabilities": ["KnowledgeDiscovery", "SemanticArtifactRouting"],
"representativeQueries": [
"What public knowledge and structured content are available from iNDX?",
"Where can I retrieve iNDX semantic chunks and question-answer artifacts?",
],
}
],
}
return json.dumps(payload, indent=2, ensure_ascii=False) + "\n"
def skill_title_from_file(path: Path) -> str:
if path.suffix == ".py":
return path.name
@@ -406,6 +440,7 @@ def skill_title_from_file(path: Path) -> str:
def skill_summary_from_file(path: Path) -> str:
known_summaries = {
"ai-catalog-materialization-skill.md": "Create the public ARD ai-catalog.json capability manifest without duplicating the site's knowledge index.",
"ai-index-discovery-materialization-skill.md": "Create the machine-readable ai-index.json discovery and routing layer from markdown, chunks.json, qa.json, and existing index structure.",
"author-content-structuring-skill.md": "Add lightweight semantic structure, front matter, chunk markers, and stable identifiers to human-authored markdown content.",
"cis-guided-semantic-chunk-generation-skill.md": "Create chunks.json semantic retrieval artifacts using the project-selected subset of the CIS envelope.",
@@ -484,10 +519,31 @@ def validate_outputs() -> None:
raise RuntimeError("sitemap.xml is missing changefreq or priority fields")
if f"Sitemap: {SITE_URL}/sitemap.xml" not in read_text(PUBLIC_ROOT / "robots.txt"):
raise RuntimeError("robots.txt does not reference sitemap.xml")
for filename in ("llms.txt", "agents.md", "skills.md", ".well-known/security.txt", ".well-known/agent-card.json"):
for filename in (
"llms.txt",
"agents.md",
"skills.md",
".well-known/ai-catalog.json",
".well-known/security.txt",
".well-known/agent-card.json",
):
path = PUBLIC_ROOT / filename
if not path.exists() or path.stat().st_size == 0:
raise RuntimeError(f"{filename} was not created")
ai_catalog = json.loads(read_text(PUBLIC_ROOT / ".well-known" / "ai-catalog.json"))
if ai_catalog.get("specVersion") != "1.0" or not ai_catalog.get("entries"):
raise RuntimeError("ai-catalog.json is missing its supported specVersion or entries")
for entry in ai_catalog["entries"]:
required = {"identifier", "displayName", "type"}
if not required.issubset(entry):
raise RuntimeError("ai-catalog.json entry is missing required fields")
if not entry["identifier"].startswith(f"urn:air:{SITE_DOMAIN}:"):
raise RuntimeError("ai-catalog.json entry identifier is not anchored to the site domain")
if ("url" in entry) == ("data" in entry):
raise RuntimeError("ai-catalog.json entry must contain exactly one of url or data")
queries = entry.get("representativeQueries", [])
if not 2 <= len(queries) <= 5:
raise RuntimeError("ai-catalog.json entry must contain 2-5 representativeQueries")
for filename in SITEMAP_ROOT_HELPER_FILES:
path = PUBLIC_ROOT / filename
if path.exists() and f"<loc>{SITE_URL}/{filename}</loc>" not in sitemap_text:
@@ -501,6 +557,7 @@ def main() -> None:
write_text(PUBLIC_ROOT / "llms.txt", build_llms_txt(entries))
write_text(PUBLIC_ROOT / "agents.md", build_agents_md(entries))
write_text(PUBLIC_ROOT / "skills.md", build_skills_md())
write_text(PUBLIC_ROOT / ".well-known" / "ai-catalog.json", build_ai_catalog_json())
write_text(PUBLIC_ROOT / ".well-known" / "security.txt", build_security_txt())
write_text(PUBLIC_ROOT / ".well-known" / "agent-card.json", build_agent_card_json())
validate_outputs()
@@ -9,6 +9,7 @@ Using this skill, reference the current README.md process document, existing pub
- `public/llms.txt`
- `public/agents.md`
- `public/skills.md`
- `public/.well-known/ai-catalog.json`
---
@@ -22,6 +23,7 @@ This skill guarantees:
- `llms.txt` gives LLMs a concise, plain-text entry point into the site, important URLs, and machine-readable artifacts.
- `agents.md` gives autonomous agents safe retrieval, crawling, and usage guidance grounded in public files.
- `skills.md` lists project skills and deterministic scripts that produce or validate this website.
- `.well-known/ai-catalog.json` advertises actual public, agent-usable resources without duplicating `ai-index.json`.
- Existing discovery files are read before replacement when present, so format and project-specific intent can be preserved where appropriate.
- No credentials, secrets, private endpoints, or unsupported claims are added.
@@ -31,6 +33,7 @@ Read these first:
- `README.md`
- Existing `public/robots.txt`, `public/sitemap.xml`, `public/llms.txt`, `public/agents.md`, `public/skills.md` if they exist
- Existing `public/.well-known/ai-catalog.json` if it exists
- `public/ai-index.json`
- `content/**/*.md`
- `public/data/open/pages/**/chunks.json`
@@ -121,7 +124,11 @@ Create `public/skills.md` listing project skills and deterministic scripts in `s
This is a public inventory, not internal secrets or implementation logs.
### Phase 7: Validation
### Phase 7: AI Catalog
Apply `ai-catalog-materialization-skill.md` to create `public/.well-known/ai-catalog.json`.
### Phase 8: Validation
Validate:
@@ -131,6 +138,7 @@ Validate:
- sitemap includes `/ai-index.json`, `/llms.txt`, and `/skills.md` after the human-facing HTML URLs when those files exist
- `robots.txt` references the sitemap
- `llms.txt`, `agents.md`, and `skills.md` exist and are non-empty
- `.well-known/ai-catalog.json` parses and advertises only real public resources
- no credentials or private paths are present
## Anti-Patterns
@@ -142,5 +150,6 @@ Do not:
- invent crawler policies that belong in Cloudflare
- duplicate full chunks, QA records, or ai-index contents in `llms.txt` or `agents.md`
- treat `sitemap.xml` as a substitute for `ai-index.json`
- treat `ai-catalog.json` as a replacement for `ai-index.json`
- include `robots.txt`, `sitemap.xml`, operational endpoints, or `/healthz/` as index targets
- hand-edit generated files without also updating the builder script when the change should persist