{"agent":"claude","input":"Find and fix the N+1 queries on this Wagtail site's listing pages. Read bakerydemo/settings/base.py and settings/test.py, AGENTS.md, bakerydemo/blog/models.py, bakerydemo/breads/models.py, bakerydemo/base/models.py, the templates under bakerydemo/templates/blog, breads, base and includes/card, and bakerydemo/base/tests/test_home_page.py first. Using DJANGO_SETTINGS_MODULE=bakerydemo.settings.test, write WagtailPageTestCase tests that build a BlogIndexPage with several published BlogPage children that each have an image, two live authors and tags, and a BreadsIndexPage with several BreadPage children that each have an image, origin and bread type, clear the cache, and count the queries of a GET to each index and to the home page with CaptureQueriesContext at two different row counts. For every count that grows with the rows, fix it at the queryset or the method with select_related, prefetch_related, Prefetch with a filtered queryset, prefetch_renditions, or a value computed once, and use {% with %} in a template where a method is called twice. Pin each fixed page with assertNumQueries at the larger row count in bakerydemo/<app>/tests/. Run ./manage.py test with the test settings, ./manage.py makemigrations --check --noinput and make lint-server. Do not change fixtures, do not add django-debug-toolbar to INSTALLED_APPS, and do not change model fields. Open a pull request with a table of each page's query count before and after at both row counts, why each query went away, and how to test it.","resources":[{"url":"https://github.com/your-org/your-app"}]}