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
+18
View File
@@ -615,6 +615,24 @@ wersji z czerwonymi testami. `prepare` buduje paczkę przy instalacji z gita.
Przed commitem: `pnpm typecheck && pnpm lint && pnpm test:int` (to samo puszcza CI
w `.gitea/workflows/ci.yml` na każdy push i PR).
### 8.1a Testy pluginu
`test/` (poza `src`, nie trafia do `dist`), vitest: `pnpm test:int` (raz), `pnpm test:watch`.
| Rodzaj | Gdzie | Dla czego |
|---|---|---|
| jednostkowe | `test/<moduł>.test.ts` | czyste funkcje: ścieżki, metadata, robots, CSP, parsery (godziny, Markdown), walidacja |
| z atrapą Payloada | `test/helpers.ts` → `fakePayload()` | logika na Local API bez bazy: `submitForm`, Turnstile, MCP, IndexNow |
| integracyjne | `test/integration.test.ts`, `test/drafts.test.ts` — **prawdziwy Payload + SQLite w pamięci** | dostęp (access), hooki, schemat pól, drafty, globale — wszystko, czego atrapa nie odda |
| kontrakt pakietu | `test/exports.test.ts` | każda ścieżka `@intecion/ipal-kit/…` z docs istnieje w `exports` |
Zasady: **każdy naprawiony błąd = test regresyjny** (sprawdź, że na starym kodzie pada);
zero sieci (`vi.spyOn(globalThis, 'fetch')`); env przez `vi.stubEnv` + `unstubAllEnvs`;
`server-only` mockowane (`vi.mock('server-only', () => ({}))`); test zmiany zachowania
widocznej dla projektów → wpis w `docs/CHANGELOG.md`. Skrypty skilli (`audit.sh`,
`seo-check.mjs`, `cookie-scan.mjs`) testujesz na atrapie strony/projektu w scratchpadzie:
pusty projekt (same błędy) i kompletny (0 błędów). CI (`.gitea/workflows/ci.yml`) puszcza
typecheck, lint, testy i build na każdy push.
### 8.2 package.json pluginu
- `"files": ["dist", "docs", "bin"]` — **docs i komenda `ipal-skills` jadą w pakiecie**; agenci w projektach
czytają `node_modules/@intecion/ipal-kit/docs/agent/AGENT.md`. Bez `docs` nie mają nic.