noindex tooling, content/noindex/component/testing guidelines for agents

- IPAL_NOINDEX=1: whole-site noindex for staging (robots Disallow /, robots
  meta noindex,nofollow, X-Robots-Tag via buildSecurityHeaders).
- Markdown mirrors and llms files: X-Robots-Tag noindex; Markdown adds a
  Link rel=canonical to the HTML page.
- buildNoindexField refuses noindex on the homepage and archive pages.
- AGENT.md §0c: writing pages for Google and AI (structure, answer-first,
  facts, E-E-A-T, entity consistency, sameAs, aiSummary, meta) and a
  when-to-noindex table (legal pages stay indexed by default; drafts instead
  of noindexed pages; staging via env).
- AGENT.md §6.0: ten component rules (small, Button styled once, buttons as
  '+ Add Button' array, variants, panel clarity); audit warns on buttons
  styled inside sections.
- AGENT.md §8a + smoke.spec.template.ts: what to test in a client project;
  PROGRAMISTA §8.1a: how the plugin itself is tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-16 03:13:44 +02:00
co-authored by Claude Opus 5.5
parent 8e2dd28b83
commit f7466cf77f
13 changed files with 314 additions and 10 deletions
@@ -1,3 +1,5 @@
import { isSiteNoindex } from '../seo/siteNoindex.js'
/**
* A single HTTP header, in the shape Next.js next.config headers() expects.
*/
@@ -116,6 +118,11 @@ export function buildSecurityHeaders(args: BuildSecurityHeadersArgs = {}): Secur
headers.push({ key: 'Cross-Origin-Opener-Policy', value: coop })
}
// Staging / preview (IPAL_NOINDEX=1): keep every response out of search engines.
if (isSiteNoindex()) {
headers.push({ key: 'X-Robots-Tag', value: 'noindex, nofollow' })
}
// Merge additional: same-key entries override the defaults above.
for (const extra of additional) {
const i = headers.findIndex((h) => h.key.toLowerCase() === extra.key.toLowerCase())