Skip to content

AI Assistance

Scoutify ships a two-tier AI documentation mechanism so any AI assistant can access current, version-pinned documentation and scaffold correct code — without hallucinating removed config keys or invalid APIs.

Scoutify v2.0.0 removed five config keys (icon_prefix, types, classes, colors, modal.ui) that throw a RuntimeException on boot if present. AI assistants trained on older content will generate code using these keys. The AI mechanism grounds every supported client against the live v2 documentation.

Two static files are published to the Scoutify docs site on every build:

FilePurpose
llms.txtCurated index: project summary, antipattern list, page index
llms-full.txtFull corpus: all documentation pages (~58 KB)

Any AI client that supports fetching a URL can use these:

https://matheusmarnt.github.io/scoutify/llms.txt
https://matheusmarnt.github.io/scoutify/llms-full.txt

Paste either URL into your AI chat context, or configure your client to fetch it automatically.

@matheusmarnt/scoutify-mcp is a Model Context Protocol server that exposes 8 tools: 4 documentation tools and 4 PHP scaffolding tools. It fetches docs from the static files above with a 1-hour local cache.

Terminal window
claude mcp add scoutify -- npx -y @matheusmarnt/scoutify-mcp

Verify the server is registered:

Terminal window
claude mcp list

Confirm the server starts correctly:

Terminal window
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | npx -y @matheusmarnt/scoutify-mcp

Expected output: JSON listing 8 tools.


ToolInputWhat it returns
search_docsquery: string, limit?: numberTop matching snippets from full corpus, ranked by term frequency. Each result includes slug, title, 200-char snippet, and canonical URL.
get_pageslug: stringFull body of one documentation page (e.g. usage/customization).
list_pages(none)All available pages: slug, title, group. Use to discover what topics are covered.
get_antipatterns(none)Structured list of 13 antipatterns with severity, rule description, and fix hint.
ToolInputWhat it generates
scaffold_searchable_modelclassName, fields[], titleField, subtitleField, routeName, typeKeyPHP class stub implementing GloballySearchable with toSearchableArray() and globalSearchResult().
scaffold_visibility_ruleclassName, strategy, role?, permission?HasGlobalSearchVisibility implementation. See strategies below.
scaffold_theme_configtypes[]?, themeOverrides?, uiFlags?ScoutifyServiceProvider::boot() body using Scoutify::types(), Scoutify::theme(), Scoutify::configureUi().
validate_snippetcode: stringLint result: list of violations with ID, severity, line number, message, and fix hint.

scaffold_visibility_rule accepts one of five strategies:

StrategyGenerated rule
guests-allowedvisibleToGuests()->orWhenAuthenticated()->policy('view')
auth-onlywhenAuthenticated()->policy('view')
spatie-rolewhenAuthenticated()->role('<role>')
spatie-permissionwhenAuthenticated()->permission('<permission>')
callbackwhenAuthenticated()->using(fn ($user, $record) => /* TODO */)

The validate_snippet tool checks PHP and Blade code against 13 known antipatterns:

Rule IDPatternWhy it fails
legacy_config_icon_prefix'icon_prefix' =>Removed in v2 — throws RuntimeException on boot
legacy_config_types_array'types' => [Removed in v2 — throws RuntimeException on boot
legacy_config_classes'classes' =>Removed in v2 — throws RuntimeException on boot
legacy_config_colors'colors' =>Removed in v2 — throws RuntimeException on boot
legacy_config_modal_ui'modal' => ['ui' =>Removed in v2 — throws RuntimeException on boot
nonexistent_key_theme'theme' => in config contextNever existed in any version
nonexistent_key_i18n'i18n' =>Never existed in any version
nonexistent_key_behavior'behavior' =>Never existed in any version
nonexistent_key_min_query_length'min_query_length' =>Never existed in any version
button_in_anchor<a ...><buttonHTML5 invalid — interactive content inside interactive content
alpine_prevent_with_guard@x.prevent="if (.prevent fires before the expression — guard is ineffective

Use in your AI workflow:

1. scaffold_theme_config(...) → generates boot() stub
2. validate_snippet(generated_code) → confirms zero violations
3. Paste into your ServiceProvider

Once the MCP server is installed, you can use natural language:

  • “Search Scoutify docs for visibility rules” → calls search_docs
  • “Get the customization page from Scoutify docs” → calls get_page with slug usage/customization
  • “What Scoutify antipatterns should I avoid?” → calls get_antipatterns
  • “Scaffold a GloballySearchable Post model with title and body fields” → calls scaffold_searchable_model
  • “Validate this Scoutify config snippet” → calls validate_snippet

The static files rebuild automatically on every npm run build in docs-site/ via the astro:build:done hook. No manual step needed — deploying the docs site is sufficient.

The MCP server fetches from the deployed static files with a 1-hour ETag-based cache. New documentation is available to AI clients within 1 hour of a docs deploy.