@silverassist/agents-toolkit 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,6 +14,7 @@ Reusable AI agent prompts for development workflows — supports **GitHub Copilo
14
14
  - ✅ **Global Install**: Install once for all projects with `--global`
15
15
  - ✅ **Modular Partials**: Reusable prompt fragments
16
16
  - ✅ **Customizable**: Easy to extend and modify
17
+ - ✅ **PostToolUse Hooks**: Automated validation and formatting after Copilot edits
17
18
  - ✅ **CLI Tool**: Quick installation in any project
18
19
 
19
20
  ## Installation
@@ -257,6 +258,7 @@ npx @silverassist/agents-toolkit@latest install [options]
257
258
  | `--instructions-only` | Only install instructions and instructions file |
258
259
  | `--partials-only` | Only install partials |
259
260
  | `--skills-only` | Only install skills |
261
+ | `--hooks-only` | Only install hooks (PostToolUse validation scripts) |
260
262
  | `--dry-run` | Show what would be installed without making changes |
261
263
 
262
264
  **Examples:**
@@ -384,6 +386,39 @@ Specialized knowledge guides for domain-specific patterns:
384
386
 
385
387
  **Codex** — skills are stored in `.github/skills/` and can be referenced from `AGENTS.md` and task context.
386
388
 
389
+ ## Hooks
390
+
391
+ PostToolUse hooks run automatically after GitHub Copilot edits files. They provide real-time validation and formatting without manual intervention.
392
+
393
+ | Hook | Trigger | Description |
394
+ |------|---------|-------------|
395
+ | `validate-tsx` | `*.tsx` in `components/` | Validates kebab-case folders, `index.tsx` naming, default export, and Props interface |
396
+ | `lint-format` | `*.ts, *.tsx, *.js, *.jsx, *.css` | Runs ESLint `--fix` and Prettier `--write` on the modified file |
397
+
398
+ Hooks are installed to:
399
+
400
+ - **Project** (default): `.github/hooks/`
401
+ - **Global** (`--global`): `~/.copilot/hooks/`
402
+
403
+ ```
404
+ .github/hooks/ # or ~/.copilot/hooks/ for global
405
+ ├── validate-tsx.json # Hook config (PostToolUse trigger)
406
+ ├── lint-format.json # Hook config (PostToolUse trigger)
407
+ └── scripts/
408
+ ├── validate-tsx.sh # Validation logic (exit 1 = warning)
409
+ └── lint-format.sh # Auto-fix logic (always exit 0)
410
+ ```
411
+
412
+ Install only hooks:
413
+
414
+ ```bash
415
+ # Project-level (hooks apply to this project only)
416
+ npx @silverassist/agents-toolkit@latest install --hooks-only
417
+
418
+ # Global (hooks apply to all Copilot sessions)
419
+ npx @silverassist/agents-toolkit@latest install --hooks-only --global
420
+ ```
421
+
387
422
  ## Agent Instructions Files
388
423
 
389
424
  ### AGENTS.md (Copilot/Codex Agent)
package/bin/cli.js CHANGED
@@ -286,14 +286,16 @@ function getInstallScope(options = {}) {
286
286
  partialsOnly = false,
287
287
  skillsOnly = false,
288
288
  instructionsOnly = false,
289
+ hooksOnly = false,
289
290
  } = options;
290
291
 
291
- const hasSpecificFlag = promptsOnly || partialsOnly || skillsOnly || instructionsOnly;
292
+ const hasSpecificFlag = promptsOnly || partialsOnly || skillsOnly || instructionsOnly || hooksOnly;
292
293
 
293
294
  return {
294
295
  shouldInstallPrompts: !hasSpecificFlag || promptsOnly || partialsOnly,
295
296
  shouldInstallInstructions: !hasSpecificFlag || instructionsOnly,
296
297
  shouldInstallSkills: !hasSpecificFlag || skillsOnly,
298
+ shouldInstallHooks: !hasSpecificFlag || hooksOnly,
297
299
  };
298
300
  }
299
301
 
@@ -301,6 +303,37 @@ function getChangeCount(result, dryRun) {
301
303
  return dryRun ? result.planned : result.written;
302
304
  }
303
305
 
306
+ function installHooks({ targetDir, force = false, dryRun = false }) {
307
+ const hooksSrc = path.join(TEMPLATES_DIR, 'shared', 'hooks');
308
+ const hooksDest = path.join(targetDir, 'hooks');
309
+
310
+ if (!fs.existsSync(hooksSrc)) {
311
+ warn('No hooks templates found — skipping');
312
+ return { written: 0, skipped: 0, planned: 0 };
313
+ }
314
+
315
+ // Copy hook JSON configs and scripts
316
+ const result = copyDir(hooksSrc, hooksDest, { force, dryRun });
317
+
318
+ // Make scripts executable (non-dry-run only)
319
+ if (!dryRun) {
320
+ const scriptsDir = path.join(hooksDest, 'scripts');
321
+ if (fs.existsSync(scriptsDir)) {
322
+ const scripts = fs.readdirSync(scriptsDir).filter(f => f.endsWith('.sh'));
323
+ for (const script of scripts) {
324
+ const scriptPath = path.join(scriptsDir, script);
325
+ fs.chmodSync(scriptPath, 0o755);
326
+ }
327
+ }
328
+ }
329
+
330
+ if (!dryRun && result.written > 0) {
331
+ success(`Installed ${result.written} hook files`);
332
+ }
333
+
334
+ return result;
335
+ }
336
+
304
337
  function ensureConfigFile({ dryRun = false, global = false } = {}) {
305
338
  const configDir = global ? getHomeDir() : process.cwd();
306
339
  const configPath = path.join(configDir, '.agents-toolkit.json');
@@ -495,6 +528,12 @@ function installGitBasedTarget(options = {}, target = 'copilot') {
495
528
  }
496
529
  }
497
530
 
531
+ if (scope.shouldInstallHooks) {
532
+ info('Installing hooks...');
533
+ const hooksResult = installHooks({ targetDir, force, dryRun });
534
+ totalChanges += getChangeCount(hooksResult, dryRun);
535
+ }
536
+
498
537
  const configResult = ensureConfigFile({ dryRun, global: isGlobal });
499
538
  totalChanges += getChangeCount(configResult, dryRun);
500
539
 
@@ -715,6 +754,17 @@ function list() {
715
754
  console.log(` • ${s}`);
716
755
  });
717
756
  }
757
+
758
+ console.log('');
759
+ log('Hooks:', 'cyan');
760
+ const hooksDir = path.join(TEMPLATES_DIR, 'shared', 'hooks');
761
+ if (fs.existsSync(hooksDir)) {
762
+ const hooks = fs.readdirSync(hooksDir)
763
+ .filter(f => f.endsWith('.json'));
764
+ hooks.forEach(h => {
765
+ console.log(` • ${h.replace('.json', '')}`);
766
+ });
767
+ }
718
768
  console.log('');
719
769
  }
720
770
 
@@ -745,6 +795,7 @@ function showHelp() {
745
795
  console.log(' --instructions-only Only install instructions');
746
796
  console.log(' --partials-only Only install partials');
747
797
  console.log(' --skills-only Only install skills');
798
+ console.log(' --hooks-only Only install hooks (PostToolUse validation scripts)');
748
799
  console.log(' --dry-run Show what would be installed');
749
800
 
750
801
  console.log('');
@@ -821,6 +872,7 @@ function parseArgs() {
821
872
  partialsOnly: flags.includes('--partials-only'),
822
873
  skillsOnly: flags.includes('--skills-only'),
823
874
  instructionsOnly: flags.includes('--instructions-only'),
875
+ hooksOnly: flags.includes('--hooks-only'),
824
876
  dryRun: flags.includes('--dry-run'),
825
877
  claude: flags.includes('--claude'),
826
878
  codex: flags.includes('--codex'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silverassist/agents-toolkit",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "Reusable AI agent prompts for development workflows with Jira integration — supports GitHub Copilot, Claude Code, and Codex",
5
5
  "author": "Santiago Ramirez",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
package/src/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * @module @silverassist/agents-toolkit
4
4
  */
5
5
 
6
- export const VERSION = "2.1.0";
6
+ export const VERSION = "2.3.0";
7
7
 
8
8
  export const PROMPTS = {
9
9
  workflow: [
@@ -37,8 +37,11 @@ export const SKILLS = [
37
37
  "component-architecture",
38
38
  "domain-driven-design",
39
39
  "testing-patterns",
40
+ "ai-seo-optimization",
40
41
  ];
41
42
 
43
+ export const HOOKS = ["validate-tsx", "lint-format"];
44
+
42
45
  // Claude Code equivalents
43
46
  export const CLAUDE_COMMANDS = [
44
47
  "analyze-ticket",
@@ -0,0 +1,11 @@
1
+ {
2
+ "hooks": {
3
+ "PostToolUse": [
4
+ {
5
+ "type": "command",
6
+ "command": "scripts/lint-format.sh",
7
+ "timeout": 30
8
+ }
9
+ ]
10
+ }
11
+ }
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env bash
2
+ # lint-format.sh — PostToolUse hook for VS Code Copilot
3
+ # Runs eslint --fix and prettier --write on files modified by the agent.
4
+ # This ensures agent-generated code follows project formatting standards.
5
+ # Exit 0 = pass (always), diagnostics printed to stderr.
6
+
7
+ set -uo pipefail
8
+
9
+ FILE="${COPILOT_FILE:-}"
10
+
11
+ if [[ -z "$FILE" ]]; then
12
+ exit 0
13
+ fi
14
+
15
+ # Only process TypeScript, JavaScript, and CSS files
16
+ case "$FILE" in
17
+ *.ts|*.tsx|*.js|*.jsx|*.css) ;;
18
+ *) exit 0 ;;
19
+ esac
20
+
21
+ # Resolve to absolute path to prevent infinite loop in directory walk
22
+ if [[ "$FILE" != /* ]]; then
23
+ FILE="$(cd "$(dirname "$FILE")" && pwd)/$(basename "$FILE")"
24
+ fi
25
+
26
+ # File must exist
27
+ if [[ ! -f "$FILE" ]]; then
28
+ exit 0
29
+ fi
30
+
31
+ # Find project root (look for package.json)
32
+ DIR="$(dirname "$FILE")"
33
+ PROJECT_ROOT=""
34
+ while [[ "$DIR" != "/" ]]; do
35
+ if [[ -f "$DIR/package.json" ]]; then
36
+ PROJECT_ROOT="$DIR"
37
+ break
38
+ fi
39
+ DIR="$(dirname "$DIR")"
40
+ done
41
+
42
+ if [[ -z "$PROJECT_ROOT" ]]; then
43
+ exit 0
44
+ fi
45
+
46
+ # Resolve tool paths
47
+ ESLINT="$PROJECT_ROOT/node_modules/.bin/eslint"
48
+ PRETTIER="$PROJECT_ROOT/node_modules/.bin/prettier"
49
+
50
+ # Run ESLint --fix (only on TS/JS files)
51
+ case "$FILE" in
52
+ *.ts|*.tsx|*.js|*.jsx)
53
+ if [[ -x "$ESLINT" ]]; then
54
+ "$ESLINT" --fix "$FILE" || true
55
+ fi
56
+ ;;
57
+ esac
58
+
59
+ # Run Prettier --write
60
+ if [[ -x "$PRETTIER" ]]; then
61
+ "$PRETTIER" --write "$FILE" || true
62
+ fi
63
+
64
+ exit 0
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env bash
2
+ # validate-tsx.sh — PostToolUse hook for VS Code Copilot
3
+ # Validates that TSX component files follow project conventions.
4
+ # Exit 0 = pass, Exit 1 = fail (shown as warning to Copilot).
5
+
6
+ set -euo pipefail
7
+
8
+ # Only run when a .tsx file was modified
9
+ FILE="${COPILOT_FILE:-}"
10
+
11
+ if [[ -z "$FILE" ]]; then
12
+ exit 0
13
+ fi
14
+
15
+ if [[ "$FILE" != *.tsx ]]; then
16
+ exit 0
17
+ fi
18
+
19
+ # Only validate files inside components/ directories
20
+ if [[ "$FILE" != *"/components/"* ]]; then
21
+ exit 0
22
+ fi
23
+
24
+ ERRORS=()
25
+
26
+ # --- Rule 1: Component must be inside a folder with index.tsx ---
27
+ BASENAME=$(basename "$FILE")
28
+ DIRNAME=$(basename "$(dirname "$FILE")")
29
+
30
+ if [[ "$BASENAME" != "index.tsx" && "$DIRNAME" != "__tests__" ]]; then
31
+ ERRORS+=("Component files must be named index.tsx inside a kebab-case folder (found: $BASENAME)")
32
+ fi
33
+
34
+ # --- Rule 2: Parent folder must be kebab-case ---
35
+ if [[ "$BASENAME" == "index.tsx" ]]; then
36
+ if [[ ! "$DIRNAME" =~ ^[a-z][a-z0-9]*(-[a-z0-9]+)*$ ]]; then
37
+ ERRORS+=("Component folder must be kebab-case (found: $DIRNAME)")
38
+ fi
39
+ fi
40
+
41
+ # --- Rule 3: Must have a default export function (PascalCase) ---
42
+ if [[ "$BASENAME" == "index.tsx" ]] && [[ -f "$FILE" ]]; then
43
+ if ! grep -qE "^export default function [A-Z]" "$FILE"; then
44
+ ERRORS+=("Component must use 'export default function PascalName' pattern")
45
+ fi
46
+ fi
47
+
48
+ # --- Rule 4: Props interface should exist for non-trivial components ---
49
+ if [[ "$BASENAME" == "index.tsx" ]] && [[ -f "$FILE" ]]; then
50
+ # Check if there are props being destructured
51
+ if grep -qE "^export default function [A-Z][a-zA-Z]+\(" "$FILE"; then
52
+ # If it has props (not empty parens), check for interface
53
+ if grep -qE "^export default function [A-Z][a-zA-Z]+\(\{" "$FILE"; then
54
+ if ! grep -qE "^(export )?(interface|type) [A-Z][a-zA-Z]+Props" "$FILE"; then
55
+ ERRORS+=("Components with props should define a Props interface (e.g., interface ComponentNameProps)")
56
+ fi
57
+ fi
58
+ fi
59
+ fi
60
+
61
+ # --- Rule 5: No relative imports (must use @/ prefix) ---
62
+ if [[ -f "$FILE" ]]; then
63
+ if grep -qE "^import .+ from ['\"]\.\.?/" "$FILE" || grep -qE "^import ['\"]\.\.?/" "$FILE"; then
64
+ ERRORS+=("Relative imports found. Use absolute imports with @/ prefix instead of ./ or ../")
65
+ fi
66
+ fi
67
+
68
+ # --- Report ---
69
+ if [[ ${#ERRORS[@]} -gt 0 ]]; then
70
+ echo "⚠️ TSX validation issues in: $FILE"
71
+ for err in "${ERRORS[@]}"; do
72
+ echo " • $err"
73
+ done
74
+ exit 1
75
+ fi
76
+
77
+ exit 0
@@ -0,0 +1,11 @@
1
+ {
2
+ "hooks": {
3
+ "PostToolUse": [
4
+ {
5
+ "type": "command",
6
+ "command": "scripts/validate-tsx.sh",
7
+ "timeout": 30
8
+ }
9
+ ]
10
+ }
11
+ }
@@ -0,0 +1,107 @@
1
+ ---
2
+ agent: agent
3
+ description: Run a comprehensive AI SEO optimization audit on the current project. Checks agent-friendly UX, E-E-A-T signals, content quality, technical SEO, and structured data.
4
+ ---
5
+
6
+ # AI SEO Optimization Audit
7
+
8
+ Run a comprehensive audit of this project for Google AI Search visibility and browser agent readiness.
9
+
10
+ ## Context
11
+
12
+ Use the `ai-seo-optimization` skill as reference for all criteria. This audit follows Google's official AI Optimization Guide (May 2026).
13
+
14
+ ## Audit Steps
15
+
16
+ ### 1. Technical Baseline
17
+
18
+ > **Scope**: The checks below use Next.js App Router terminology (Server Components, `generateMetadata`). For non-Next.js projects, adapt to the equivalent patterns (e.g., SSR/SSG for content rendering, `<meta>` tags for metadata).
19
+
20
+ Check the following in the codebase:
21
+
22
+ - [ ] Pages use Server Components or SSR (content is rendered server-side, not client-only)
23
+ - [ ] No `nosnippet` or `data-nosnippet` on key content
24
+ - [ ] Metadata (title, description, OpenGraph) is set for all pages
25
+ - [ ] Canonical tags are properly set (no duplicates)
26
+ - [ ] XML sitemap exists and includes all valuable pages
27
+ - [ ] `robots.txt` doesn't block critical resources
28
+
29
+ ### 2. Agent-Friendly UX
30
+
31
+ Audit components for:
32
+
33
+ - [ ] No `<div onClick>` patterns (must use `<button>` or `<a>`)
34
+ - [ ] All `<input>` elements have associated `<label htmlFor>`
35
+ - [ ] Heading hierarchy is correct (`h1` → `h2` → `h3`, no skips)
36
+ - [ ] Skip-to-content link exists as first focusable element
37
+ - [ ] Interactive elements have `cursor: pointer`
38
+ - [ ] No ghost overlays blocking interactive elements
39
+ - [ ] All interactive elements have accessible names
40
+
41
+ ### 3. E-E-A-T Signals (YMYL Sites)
42
+
43
+ Check for existence of:
44
+
45
+ - [ ] Author pages with credentials and `Person` schema
46
+ - [ ] About/Mission page with team information
47
+ - [ ] Methodology or "How we rate" page
48
+ - [ ] Data source disclosures
49
+ - [ ] Contact information easily accessible
50
+ - [ ] Privacy policy and terms linked from all pages
51
+ - [ ] Content dates (published/modified) visible
52
+
53
+ ### 4. Content Quality Assessment
54
+
55
+ Review top landing pages for:
56
+
57
+ - [ ] Unique data or insights not available elsewhere
58
+ - [ ] First-hand experience signals
59
+ - [ ] Expert commentary with attribution
60
+ - [ ] Interactive tools or calculators
61
+ - [ ] No thin/commodity content on indexed pages
62
+
63
+ ### 5. Structured Data Validation
64
+
65
+ Check JSON-LD implementation:
66
+
67
+ - [ ] `LocalBusiness` on community/location pages (with address, geo, priceRange)
68
+ - [ ] `Person` on author pages (with knowsAbout, jobTitle)
69
+ - [ ] `Article` on blog posts (with author, datePublished, dateModified)
70
+ - [ ] `BreadcrumbList` on all pages
71
+ - [ ] `Organization` on homepage
72
+ - [ ] No validation errors (test with Rich Results Test)
73
+
74
+ ### 6. Performance & Core Web Vitals
75
+
76
+ - [ ] LCP < 2.5s on key templates
77
+ - [ ] CLS < 0.1 (no layout shifts)
78
+ - [ ] INP < 200ms (responsive interactions)
79
+ - [ ] Images have explicit dimensions
80
+ - [ ] Fonts use `display: swap`
81
+
82
+ ## Output Format
83
+
84
+ Provide results as:
85
+
86
+ ```markdown
87
+ ## AI SEO Audit Results — [Project Name]
88
+
89
+ ### Score Summary
90
+ | Area | Status | Score |
91
+ |------|--------|-------|
92
+ | Technical Baseline | 🟢/🟡/🔴 | X/Y |
93
+ | Agent-Friendly UX | 🟢/🟡/🔴 | X/Y |
94
+ | E-E-A-T Signals | 🟢/🟡/🔴 | X/Y |
95
+ | Content Quality | 🟢/🟡/🔴 | X/Y |
96
+ | Structured Data | 🟢/🟡/🔴 | X/Y |
97
+ | Performance | 🟢/🟡/🔴 | X/Y |
98
+
99
+ ### Critical Issues (Fix Immediately)
100
+ - ...
101
+
102
+ ### Improvements (High Impact)
103
+ - ...
104
+
105
+ ### Recommendations (Nice to Have)
106
+ - ...
107
+ ```
@@ -0,0 +1,354 @@
1
+ ---
2
+ name: ai-seo-optimization
3
+ description: Optimize websites for Google's generative AI features and browser agents. Use when asked to "optimize for AI search", "AI overview", "agent-friendly audit", "E-E-A-T assessment", "AI SEO", "generative search optimization", or "audit accessibility for agents".
4
+ ---
5
+
6
+ # AI SEO Optimization Skill
7
+
8
+ Comprehensive guide for optimizing Next.js sites for Google's generative AI features (AI Overviews, AI Mode) and emerging browser agent interactions.
9
+
10
+ > **Source**: [Google AI Optimization Guide](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide) (May 2026)
11
+ > **Companion**: [Build Agent-Friendly Websites](https://web.dev/articles/ai-agent-site-ux) (April 2026)
12
+
13
+ ---
14
+
15
+ ## Core Principle
16
+
17
+ **AI Search optimization IS SEO.** There is no separate "AEO" or "GEO" discipline. Google's AI features use the same Search index, the same ranking signals, and the same content quality assessments. If your page is well-optimized for Search, it's well-optimized for AI features.
18
+
19
+ ---
20
+
21
+ ## 1. How Google's AI Features Discover Content
22
+
23
+ Google's generative AI features use **Retrieval-Augmented Generation (RAG)**:
24
+
25
+ 1. User query triggers **query fan-out** (multiple sub-queries)
26
+ 2. Each sub-query retrieves pages from the **existing Search index**
27
+ 3. AI synthesizes answers from retrieved content
28
+ 4. Citations link back to source pages
29
+
30
+ **Requirements for inclusion:**
31
+ - Page MUST be indexed (verify in Search Console)
32
+ - Page MUST allow snippets (no `nosnippet` meta directive)
33
+ - Content MUST be server-rendered (not client-only JavaScript)
34
+ - Content MUST be accessible to Googlebot (no login walls for indexed content)
35
+
36
+ ---
37
+
38
+ ## 2. Agent-Friendly UX Audit Checklist
39
+
40
+ Browser agents (Google's Mariner, OpenAI's Operator, etc.) interact with sites through three channels:
41
+
42
+ 1. **Screenshots** — Vision model identifies elements visually
43
+ 2. **HTML/DOM** — Understands nesting, hierarchy, relationships
44
+ 3. **Accessibility tree** — Roles, names, states of interactive elements
45
+
46
+ ### Semantic HTML
47
+
48
+ - [ ] All clickable elements use `<button>` or `<a href>` (NEVER `<div onClick>` or `<span onClick>`)
49
+ - [ ] All form inputs have associated `<label htmlFor="id">` (not just placeholder text)
50
+ - [ ] Heading hierarchy is logical (`h1` > `h2` > `h3`, no skips)
51
+ - [ ] Lists use `<ul>`/`<ol>`/`<li>` (not styled divs)
52
+ - [ ] Tables use `<table>` with `<th>` headers for tabular data
53
+ - [ ] Navigation uses `<nav>` with proper `aria-label`
54
+ - [ ] Main content wrapped in `<main>`
55
+ - [ ] Sections use `<section>` or `<article>` with headings
56
+
57
+ ### Accessibility Tree
58
+
59
+ - [ ] All interactive elements have accessible names (visible text, `aria-label`, or `aria-labelledby`)
60
+ - [ ] ARIA roles used ONLY when semantic HTML isn't available
61
+ - [ ] Skip-to-content link is first focusable element
62
+ - [ ] Focus order matches visual order (`tabindex` not misused)
63
+ - [ ] Modal dialogs use `<dialog>` or proper `role="dialog"` with focus trapping
64
+ - [ ] Dynamic content changes announced via `aria-live` regions
65
+
66
+ ### Visual Stability
67
+
68
+ - [ ] No layout shifts after load (CLS < 0.1)
69
+ - [ ] Interactive elements have stable positions (no jumping during scroll)
70
+ - [ ] No transparent overlays blocking clickable elements (ghost overlays)
71
+ - [ ] All actionable elements meet minimum target size of 24×24 CSS px (WCAG 2.2 SC 2.5.8)
72
+ - [ ] Images have explicit `width` and `height` (prevent layout shift)
73
+
74
+ ### CSS Signals for Agents
75
+
76
+ - [ ] `cursor: pointer` on all clickable elements (strong actionability signal)
77
+ - [ ] Focus indicators visible on keyboard navigation (`:focus-visible` styles)
78
+ - [ ] Interactive states are distinct (`:hover`, `:active`, `:focus`)
79
+ - [ ] Disabled elements have `pointer-events: none` and `opacity` reduction
80
+ - [ ] No `display: none` on elements that should be accessible to screen readers
81
+
82
+ ### Form Accessibility (Critical for Agent Interactions)
83
+
84
+ - [ ] Every `<input>` has an associated `<label>` with `htmlFor`
85
+ - [ ] Required fields marked with `aria-required="true"` or `required` attribute
86
+ - [ ] Error messages linked with `aria-describedby`
87
+ - [ ] Form groups use `<fieldset>` with `<legend>`
88
+ - [ ] Submit buttons have clear text (not just icons)
89
+ - [ ] Autocomplete attributes set for common fields (`name`, `email`, `tel`, `address-*`)
90
+
91
+ ---
92
+
93
+ ## 3. E-E-A-T Assessment (Critical for YMYL Sites)
94
+
95
+ For sites dealing with health, finance, safety, or life decisions (Your Money or Your Life), E-E-A-T signals are critical for AI citation.
96
+
97
+ ### Experience
98
+
99
+ - [ ] Content demonstrates first-hand knowledge (not aggregated summaries)
100
+ - [ ] Real user reviews and testimonials with attribution
101
+ - [ ] Case studies or examples from actual experience
102
+ - [ ] Visual evidence (photos, videos) of real experiences
103
+
104
+ ### Expertise
105
+
106
+ - [ ] Author credentials displayed clearly (degrees, certifications, years of experience)
107
+ - [ ] Author pages exist with `Person` schema and `knowsAbout` properties
108
+ - [ ] Content reviewed by subject matter experts (editorial review notice)
109
+ - [ ] Specialized terminology used correctly with explanations for lay readers
110
+
111
+ ### Authoritativeness
112
+
113
+ - [ ] About page with team credentials, methodology, and mission
114
+ - [ ] Clear data source disclosures ("Where our data comes from")
115
+ - [ ] "How we rate" or methodology explanation pages
116
+ - [ ] Institutional authority signals (partnerships, certifications, media mentions)
117
+ - [ ] Consistent NAP (Name, Address, Phone) across web presence
118
+
119
+ ### Trustworthiness
120
+
121
+ - [ ] Contact information easily findable (not buried in footer only)
122
+ - [ ] Privacy policy and terms of service accessible from all pages
123
+ - [ ] Transparent pricing when applicable (no hidden fees)
124
+ - [ ] Content is accurate and up-to-date (publish/update dates visible)
125
+ - [ ] Corrections policy or update log for changed information
126
+ - [ ] HTTPS enforced, security headers properly configured
127
+
128
+ ---
129
+
130
+ ## 4. Non-Commodity Content Criteria
131
+
132
+ Google's AI features prefer content that provides unique value. Assess content against these criteria:
133
+
134
+ ### Non-Commodity Content (Google Favors)
135
+
136
+ - **Unique data analysis** from proprietary sources (not publicly available datasets)
137
+ - **First-hand experiences** and detailed reviews with specific details
138
+ - **Expert-led insights** that go beyond commonly available information
139
+ - **Original research** with methodology and reproducible findings
140
+ - **Interactive tools** and calculators with unique logic
141
+ - **Comparison data** that requires effort to compile (pricing, availability)
142
+ - **Local knowledge** that can't be found without physical presence
143
+
144
+ ### Commodity Content (Avoid or Upgrade)
145
+
146
+ - ❌ "X Tips for [topic]" without unique insights (generic listicles)
147
+ - ❌ Summaries of information freely available elsewhere
148
+ - ❌ Generic advice easily produced by any AI model
149
+ - ❌ Content created primarily for keyword targeting
150
+ - ❌ Thin pages with minimal original value
151
+ - ❌ Automatically generated content without expert review
152
+
153
+ ### Content Upgrade Strategy
154
+
155
+ For existing commodity content, improve by adding:
156
+ 1. **Unique data points** from proprietary sources
157
+ 2. **Expert commentary** with attribution
158
+ 3. **Real examples** with specifics (names, dates, outcomes)
159
+ 4. **Interactive elements** (calculators, comparison tools)
160
+ 5. **Original media** (photographs, diagrams, video)
161
+
162
+ ---
163
+
164
+ ## 5. Technical SEO for AI Discovery
165
+
166
+ ### Indexing & Crawlability
167
+
168
+ - [ ] All key pages indexed (verify in Google Search Console)
169
+ - [ ] No accidental `noindex` directives on important pages
170
+ - [ ] No `nosnippet` or `data-nosnippet` blocking content extraction
171
+ - [ ] `robots.txt` doesn't block critical resources
172
+ - [ ] Crawl budget optimized (no low-value pages wasting crawl resources)
173
+ - [ ] XML sitemap includes all valuable pages (updated automatically)
174
+
175
+ ### Server-Side Rendering
176
+
177
+ - [ ] Critical content renders on server (not client-only JavaScript)
178
+ - [ ] Dynamic content accessible without user interaction
179
+ - [ ] No infinite scroll hiding content from crawlers
180
+ - [ ] Metadata generated server-side (`generateMetadata` in Next.js)
181
+
182
+ ### URL & Content Structure
183
+
184
+ - [ ] Canonical tags correctly set (prevent duplicate content confusion)
185
+ - [ ] Internal linking connects related content (topic clusters)
186
+ - [ ] Breadcrumb navigation with schema markup
187
+ - [ ] Clean URL structure reflecting content hierarchy
188
+ - [ ] Pagination handled with view-all option or clear next/previous links (note: `rel="next"`/`rel="prev"` is no longer used as a Google indexing signal)
189
+
190
+ ### Performance & Page Experience
191
+
192
+ - [ ] Core Web Vitals in "Good" range (LCP < 2.5s, INP < 200ms, CLS < 0.1)
193
+ - [ ] HTTPS enforced with valid certificate
194
+ - [ ] No intrusive interstitials blocking content
195
+ - [ ] Mobile-friendly (responsive design)
196
+ - [ ] Font loading doesn't cause layout shift (`display: swap`)
197
+
198
+ ---
199
+
200
+ ## 6. Structured Data Patterns
201
+
202
+ Structured data helps Google understand content relationships. While NOT required for AI features, it improves overall search presence.
203
+
204
+ ### LocalBusiness (Community/Location Pages)
205
+
206
+ ```json
207
+ {
208
+ "@context": "https://schema.org",
209
+ "@type": "LocalBusiness",
210
+ "name": "Community Name",
211
+ "address": {
212
+ "@type": "PostalAddress",
213
+ "streetAddress": "123 Main St",
214
+ "addressLocality": "City",
215
+ "addressRegion": "FL",
216
+ "postalCode": "33101"
217
+ },
218
+ "geo": { "@type": "GeoCoordinates", "latitude": 25.76, "longitude": -80.19 },
219
+ "telephone": "+1-555-0100",
220
+ "priceRange": "$$-$$$",
221
+ "openingHours": "Mo-Su 00:00-24:00",
222
+ "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.5", "reviewCount": "28" },
223
+ "sameAs": ["https://g.page/community", "https://facebook.com/community"]
224
+ }
225
+ ```
226
+
227
+ ### Person (Author/Expert Pages)
228
+
229
+ ```json
230
+ {
231
+ "@context": "https://schema.org",
232
+ "@type": "Person",
233
+ "name": "Author Name",
234
+ "jobTitle": "Senior Care Advisor",
235
+ "knowsAbout": ["Assisted Living", "Memory Care", "VA Benefits"],
236
+ "sameAs": ["https://linkedin.com/in/author"],
237
+ "worksFor": { "@type": "Organization", "name": "Company Name" }
238
+ }
239
+ ```
240
+
241
+ ### Article (Blog/Resource Posts)
242
+
243
+ ```json
244
+ {
245
+ "@context": "https://schema.org",
246
+ "@type": "Article",
247
+ "headline": "Article Title",
248
+ "author": { "@type": "Person", "name": "Author", "url": "/about/authors/slug" },
249
+ "datePublished": "2026-01-15",
250
+ "dateModified": "2026-05-01",
251
+ "publisher": { "@type": "Organization", "name": "Site Name" }
252
+ }
253
+ ```
254
+
255
+ ### FAQPage (FAQ Sections)
256
+
257
+ ```json
258
+ {
259
+ "@type": "FAQPage",
260
+ "mainEntity": [
261
+ {
262
+ "@type": "Question",
263
+ "name": "What is the cost of assisted living?",
264
+ "acceptedAnswer": {
265
+ "@type": "Answer",
266
+ "text": "The average cost varies by state..."
267
+ }
268
+ }
269
+ ]
270
+ }
271
+ ```
272
+
273
+ ---
274
+
275
+ ## 7. What NOT to Do (Mythbusting)
276
+
277
+ These are explicitly confirmed as **unnecessary or harmful** by Google:
278
+
279
+ | ❌ Don't Do This | Why |
280
+ |------------------|-----|
281
+ | Create `llms.txt` files | Google doesn't treat them specially |
282
+ | "Chunk" content into tiny pieces | Google handles multi-topic pages fine |
283
+ | Rewrite content "for AI" (AEO/GEO) | AI understands synonyms and natural language |
284
+ | Seek inauthentic brand mentions | Spam systems detect and penalize this |
285
+ | Overfocus on structured data alone | Helpful but NOT required for AI features |
286
+ | Create separate pages for query variations | Violates scaled content abuse policy |
287
+ | Add special "AI-readable" Markdown files | Standard HTML is the input format |
288
+ | Use hidden text for AI consumption | Cloaking violation |
289
+ | Stuff keywords "for LLM training" | Spam — same old rules apply |
290
+ | Disallow AI crawlers (GPTBot, etc.) | Google uses Googlebot only — blocking others has no effect on Google AI |
291
+
292
+ ---
293
+
294
+ ## 8. Implementation Priorities
295
+
296
+ ### Quick Wins (< 1 day each)
297
+
298
+ 1. Add `cursor: pointer` CSS for all interactive elements
299
+ 2. Add skip-to-content link to root layout
300
+ 3. Verify no `nosnippet` directives on key pages
301
+ 4. Check all forms have proper `<label>` associations
302
+ 5. Verify heading hierarchy on top landing pages
303
+
304
+ ### Medium Effort (1-3 days each)
305
+
306
+ 1. Semantic HTML audit of all components (replace `<div onClick>`)
307
+ 2. Author/expert page creation with Person schema
308
+ 3. "About Our Data" / methodology page
309
+ 4. Image alt text quality audit and improvement
310
+ 5. Internal linking optimization
311
+
312
+ ### High Effort (1+ week each)
313
+
314
+ 1. Non-commodity content strategy and execution
315
+ 2. Interactive tools (calculators, comparison widgets)
316
+ 3. Comprehensive accessibility audit and remediation
317
+ 4. E-E-A-T content enrichment across all page types
318
+ 5. Video/media content creation
319
+
320
+ ---
321
+
322
+ ## 9. Audit Workflow
323
+
324
+ When asked to audit a site for AI optimization, follow this order:
325
+
326
+ 1. **Technical baseline** — Verify indexing, SSR, canonical tags, Core Web Vitals
327
+ 2. **Agent-friendly audit** — Run through Section 2 checklist on key templates
328
+ 3. **E-E-A-T assessment** — Evaluate Section 3 for YMYL compliance
329
+ 4. **Content quality** — Assess top pages against Section 4 criteria
330
+ 5. **Structured data** — Validate existing schema, identify gaps
331
+ 6. **Recommendations** — Prioritize by impact/effort ratio
332
+
333
+ ---
334
+
335
+ ## 10. Monitoring & Measurement
336
+
337
+ | Metric | Tool | What to Track |
338
+ |--------|------|---------------|
339
+ | AI Overview appearances | Google Search Console → Search Appearance | Citation frequency |
340
+ | Organic CTR from AI features | GSC filtered by AI appearance type | Click-through trends |
341
+ | Core Web Vitals | PageSpeed Insights / CrUX | All "Good" status |
342
+ | Structured data validity | Rich Results Test | 0 errors, 0 warnings |
343
+ | Accessibility score | Lighthouse CI | 95+ target |
344
+ | Index coverage | GSC → Indexing | No regressions |
345
+
346
+ ---
347
+
348
+ ## References
349
+
350
+ - [Google AI Optimization Guide](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide)
351
+ - [Build Agent-Friendly Websites](https://web.dev/articles/ai-agent-site-ux)
352
+ - [Creating Helpful, Reliable, People-First Content](https://developers.google.com/search/docs/fundamentals/creating-helpful-content)
353
+ - [Google Search Quality Rater Guidelines](https://services.google.com/fh/files/misc/hsw-sqrg.pdf)
354
+ - [Universal Commerce Protocol (UCP)](https://ucp.dev/latest/)