task: #3621949 Document how to build a valid RSS feed display

Summary

A feed display added through ai_agents_views_create_view_display was not usable until its row style was fully configured - no prompt guidance existed for it at all. Worse, the generic "rss_fields" row style produces config that passes View::validate() while still not being valid RSS (HTML markup leaking into <title>/<link>, a non-RFC-2822 <pubDate>) unless every mapped field is exactly the right shape.

Not a code defect - both row types are individually valid display_options. Documents Drupal core's own working pattern: the dedicated "node_rss" row plugin (used by core's own frontpage.yml), which needs no field mapping at all, as the primary path in the system prompt, with "rss_fields" kept only as a documented, carefully-caveated fallback for entity types with no dedicated row plugin. Also explicitly warns against substituting "entity:node" for "node_rss" - a real substitution a live LLM made when told the correct plugin's name, which produces an even more broken feed than the rss_fields mistake.

Changes

  • config/install/ai_agents.ai_agent.views_agent.yml: adds a "Common Workflow: Add A Feed Display" system prompt section, verified against the real update_view_plugins tool and against Drupal core's own views.view.frontpage.yml.
  • tests/src/Kernel/Integration/ConfigureFeedDisplayTest.php (new): added testNodeRssRowStyleProducesValidFeed(), which builds a feed through the real tool chain and reads the actual rendered RSS XML - the only way this class of problem is caught, since validate() cannot tell a correctly-configured feed from a plausible-looking broken one.

Test plan

  • Confirmed the row-style guidance recommendation live against the real update_view_plugins tool before writing it into the prompt.
  • Confirmed the entity:node substitution mistake reproduces on the live agent without the explicit warning, and does not reproduce with it.
  • Full suite passes on this branch in isolation: 1/1 test, 21 assertions, no failures.
  • phpcs --standard=Drupal,DrupalPractice and phpstan analyse (module config, level 1) clean on the new test file.

Closes #3621949

AI-Generated: Yes (Used Claude Code to identify the gap while testing feed-display prompts against the shipped Views Agent, diagnose the correct pattern from Drupal core's own working RSS feed, verify the fix against the live agent across two further rounds of testing, and write the Integration test.)

Merge request reports

Loading