Provide example context items
## Problem/motivation It would be really helpful to provide (optional) example context items for this module. There is a mention of this in #3586175, but I wanted to open a separate issue for it because it might make sense to provide a recipe for example content items (similar to this for AI Guardrails: https://www.drupal.org/project/ai_recipe_guardrails_pii) As I'm learning to use the module, I find that I have to spin up an instance of https://www.drupalforge.org/template/driesnote-chicago in order to see some type of "vetted" examples. I think it would be really helpful for users new to the module to have access to various examples - from simple ones to more complex ones (like the ones in driesnote-chicago). -mike ## Solution Create a test module that includes the context items from the [Chicago Driesnote](https://github.com/fosterinteractive/c2026) Put it under tests/modules/ai_context_test_items ### Installation Note that you have to install test modules differently than regular modules: Modules under `tests/modules` are **not** discovered during normal site bootstrap. Enable test extension scanning in settings first: ```php $settings['extension_discovery_scan_tests'] = TRUE; ``` Put that in `settings.local.php` (or `settings.php` on a throwaway local site only — not production). Then enable with Drush: ```bash ddev exec drush en ai_context_test_scope -y ddev exec drush cr ``` That flow is documented in `tests/modules/ai_context_test_scope/README.md`. Disable when done: ```bash ddev exec drush pmu ai_context_test_scope -y ddev exec drush cr ``` ## Test modules in `ai_context` | Machine name | Purpose | |---|---| | `ai_context_test` | Fixed AI provider fixtures | | `ai_context_test_support` | Form alters for functional/JS tests | | `ai_context_scope_values_test` | Hook alter for scope values | | `ai_context_test_scope` | Extra scope plugin for manual/dev verification | ## Notes Maybe we should rename `ai_context_scope_values_test` to `ai_context_test_scope_values` at the same time.
issue