feat(analyzer): add agent-skill-exposure + migrate to Vitest with pilot coverage#20
Merged
feat(analyzer): add agent-skill-exposure + migrate to Vitest with pilot coverage#20
Conversation
Scores whether a page declares its interactive affordances as callable tools an agent can use: Schema.org Action markup (with target and query-input/object), MCP / WebMCP / ai-plugin discovery via link/meta/ header, OpenAPI service-description links, microdata itemprop, and a fallback form-structure score (labels, autocomplete tokens, semantic input types, meaningful name attrs, accessible form name, submit text). Wired as optional behind --include-agent-skills. Refactored the dispatcher to per-factor opt-in so --include-geo no longer silently enables every optional factor, and --factors <optional-id> now works standalone. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move the test runner from node:test (tsx --test) to Vitest and port the existing 23 tests unchanged. Build out pilot coverage for the three most critical analyzers — structured-data (weight 12), ai- readable-content (weight 10) and agent-skill-exposure — with an HTML or auxiliary-state fixture per scoring branch: - structured-data: no/malformed/empty JSON-LD, base credit, each priority type (LocalBusiness/FAQPage/Service/HowTo), nested @graph, deeply-nested Action-type regression, @type arrays, shallow/medium/ strong depth buckets, recommendation composition. - ai-readable-content: every auxiliary state (ok/missing/timeout/ unreachable/not-html) for llms.txt and llms-full.txt, depth bonuses, robots/sitemap states, head-link variants, full-stack clamp. - agent-skill-exposure: Action well-formed / partial / missing, multi-Action, nested potentialAction, MCP via link/meta/Link-header across mcp/webmcp/ai-plugin, OpenAPI link variants, microdata thresholds, strong/partial/weak forms, hidden-only form ignored, mixed-quality multi-form averaging, full-stack composition. Total: 84 tests (was 23). E2E suite stays on tsx --test. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent-skill-exposureanalyzer (weight 6): scores whether a page declares its interactive affordances as tools an AI agent can invoke — Schema.orgActionmarkup (withtarget+query-input/object), MCP / WebMCP / ai-plugin discovery (via<link>,<meta>, orLinkheader), OpenAPI service-description links, microdataitemprop, and a fallback form-structure score (label coverage,autocompletetokens, semantic input types, meaningfulnameattrs, form accessible name, submit text). Wired behind--include-agent-skills.--include-geono longer silently enables every optional factor, and--factors <optional-id>now works standalone (previously returned an empty set).pnpm testnow runsvitest run, with atest:watchscript. All 23 existing tests ported unchanged. E2E suite stays ontsx --test.structured-data(weight 12) — 19 tests covering JSON-LD absence/malformed, priority types individually and together, nested@graph, deeply-nested detection,@typearrays, every depth bucket, and recommendation composition.ai-readable-content(weight 10) — 20 tests covering every auxiliary state (ok/missing/timeout/unreachable/not-html) for llms.txt and llms-full.txt, depth bonuses, robots/sitemap branches, head-link variants, and a full-stack clamp check.agent-skill-exposure— 28 tests covering Action well-formed/partial/missing, multi-Action, nested potentialAction, every MCP discovery path (link/meta/header × mcp/webmcp/ai-plugin), OpenAPI link variants, microdata thresholds, strong/partial/weak forms, hidden-only form exclusion, mixed-quality multi-form averaging, and end-to-end composition.Total: 84 tests (was 23). Typecheck, lint, and build all clean.
Test plan
pnpm test— 84 passingpnpm run typecheckpnpm lintpnpm run buildnode bin/aeo-audit.js <url> --include-agent-skillson a real page🤖 Generated with Claude Code