Agent instructions: mandatory feature set (SEO, GEO, R2, Turnstile, forms) enforced by audits
- AGENT.md §0b: one table of everything every site must have (SEO meta/maps,
JSON-LD, llms.txt + llms-full, Markdown, MCP, AI bots, R2, panel forms,
Turnstile, consent, security, ops, system pages, zero hardcodes), the
forbidden replacements (own forms, nodemailer, reCAPTCHA, hand-written
JSON-LD, static SEO files, raw S3) and an `ipal-audit-skip:` escape hatch that
needs a recorded client decision.
- ipal-audit: "missing: …" errors for every mandatory item and for plugin
replacements; ipal-seo-check: runtime GEO checks (llms, Markdown, MCP,
JSON-LD, AI bots, health). Both verified on bare and complete fixtures.
- Skills (setup, site, form, upgrade, audit, seo-check) and PROGRAMISTA.md
wire the full set from step one; GEO is no longer "optional".
- Fix: createProxy({ markdown: true }) lets /md/... through — multilingual
sites redirected /md/pl/x to /pl/md/pl/x, so the documented Markdown route
never worked — and handles Accept: text/markdown.
- createContentHelpers({ markdownAlternate: true }) adds the text/markdown
alternate link in generatePageMetadata.
- JSDoc/docs JSON-LD examples use JsonLdGraph; docs/CHANGELOG.md for 1.9.0.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -8,6 +8,7 @@ import type { I18nConfig } from '../i18n/index.js'
|
||||
import type { PageMetadata, RobotsOptions, RobotsRules, SitemapEntry, SitemapStyleOptions } from '../seo/index.js'
|
||||
|
||||
import { getArchiveEntries, resolveRoute as resolveRouteRaw } from '../content/index.js'
|
||||
import { MARKDOWN_PREFIX, markdownHref } from '../content/markdownNegotiation.js'
|
||||
import { buildRobots, buildSitemapEntries, createPageMetadata, createSitemapRouteHandler } from '../seo/index.js'
|
||||
|
||||
type CreateContentHelpersArgs = {
|
||||
@@ -29,6 +30,14 @@ type CreateContentHelpersArgs = {
|
||||
* handlers — they need the locale list to emit hreflang.
|
||||
*/
|
||||
i18n?: I18nConfig
|
||||
/**
|
||||
* Advertise each page's Markdown version from generatePageMetadata:
|
||||
* `<link rel="alternate" type="text/markdown" href="/md/pl/o-nas">` (GEO —
|
||||
* agents find the clean version without guessing). `true` uses the '/md'
|
||||
* prefix, a string sets another one. Needs the matching Markdown route
|
||||
* (content.md). Indexable pages only.
|
||||
*/
|
||||
markdownAlternate?: boolean | string
|
||||
/** Pages collection slug. Defaults to 'pages'. */
|
||||
pagesSlug?: string
|
||||
/**
|
||||
@@ -77,6 +86,7 @@ export function createContentHelpers({
|
||||
config,
|
||||
content,
|
||||
i18n,
|
||||
markdownAlternate,
|
||||
pagesSlug = 'pages',
|
||||
robots: robotsOptions,
|
||||
settingsSlug = 'site-settings',
|
||||
@@ -154,7 +164,15 @@ export function createContentHelpers({
|
||||
},
|
||||
settingsSlug,
|
||||
})
|
||||
return pageMetadata({ slug: segments, locale, page, payload: await getCachedPayload() })
|
||||
const meta = await pageMetadata({ slug: segments, locale, page, payload: await getCachedPayload() })
|
||||
const canonical = meta.alternates?.canonical
|
||||
if (!markdownAlternate || !canonical || meta.robots?.index === false) {return meta}
|
||||
const prefix = typeof markdownAlternate === 'string' ? markdownAlternate : MARKDOWN_PREFIX
|
||||
const pathname = new URL(canonical, 'http://localhost').pathname
|
||||
return {
|
||||
...meta,
|
||||
alternates: { ...meta.alternates, types: { ...meta.alternates?.types, 'text/markdown': markdownHref(pathname, prefix) } },
|
||||
}
|
||||
}
|
||||
|
||||
/** ID of the page assigned as 404 — the relation isn't localized, so one read serves every locale. */
|
||||
|
||||
Reference in New Issue
Block a user