- Implemented `resolveApiAssetUrl` function to normalize asset URLs based on API base. - Updated `MedialibImage` component to utilize new asset URL resolution and added support for alt text and class properties. - Enhanced image loading behavior with improved width measurement and focal point handling. - Added placeholder image handling and improved accessibility with alt text. - Introduced new test script for auditing broken links in skill documentation. - Expanded seeded test content to include medialib entries and updated related tests for pagebuilder previews. - Improved global setup and teardown logging for clarity on seeded content management.
5.3 KiB
name, description
| name | description |
|---|---|
| mongodb-and-indexes | Design MongoDB prerequisites and index strategy for tibi website projects. Covers replica-set requirements, collection index modeling, text/search index implications, index auto-management on reload, and operator checks for persistence, backups, and regeneration-sensitive features. |
mongodb-and-indexes
When to use this skill
Use this skill when:
- a project moves beyond simple demo data and needs deliberate MongoDB design
- collections need unique, text, sparse, or compound indexes
- search, audit, or larger datasets introduce operational database requirements
- operators need clarity about replica-set, persistence, or backup assumptions
Goal
Give later agents one place for MongoDB prerequisites and index strategy.
This skill exists because tibi projects do not just “use MongoDB”. They rely on config-driven indexes, reload-time index reconciliation, and environment choices that can help or break production behavior.
Source of truth
Use these sources when implementing or reviewing MongoDB/index decisions:
tibi-server/docs/02-configuration.mdtibi-server/docs/04-collections.mdtibi-server/docs/12-deployment.md- active project/server config
MongoDB prerequisites
Current upstream deployment requirements include:
- MongoDB 4.4+
- replica set for transactions
That means later agents should not promise production-like behavior while ignoring the actual database topology.
For this starter family, check explicitly:
- which MongoDB version is targeted
- whether the environment runs as a replica set
- where persistent data lives
- how backup and restore are expected to work
Index ownership model
Indexes can be defined in two places.
Field-level indexes
Use for simple per-field indexes:
fields:
- name: email
type: string
index:
- single
- unique
Available field-level flags include:
singleuniquetextsparse
Collection-level indexes
Use for compound or more explicit index definitions:
indexes:
- name: category_publish_date
key:
- category
- -publishDate
background: true
- name: title_text
key:
- $text:title
defaultLanguage: german
Use collection-level indexes when:
- sort patterns span multiple fields
- uniqueness depends on more than one field
- you need text-index language control
- the index needs a stable explicit name
Important auto-management behavior
On project setup or reload:
- configured indexes are created
- indexes present in MongoDB but no longer in config are dropped
_id_is never dropped
This is a critical workflow fact.
Do not treat indexes as one-off manual DBA work while also expecting config reload to stay authoritative. In this stack, the YAML config owns the intended index state.
Search and index interplay
Some search modes depend directly on index strategy:
mode: textrequires a text index- explicit text search can use field-level
index: [text]or collection-level$text:indexes - regex fallback can become expensive without deliberate field/index choices
- enrichment-based modes such as
ngramandvectoradd_searchdata and may require regeneration workflows rather than classic MongoDB indexes alone
Keep classic indexes and search config aligned. Search should not be modeled in isolation from database cost and reload behavior.
Query shape matters
Before adding indexes, inspect the real access patterns:
- which fields appear in permission filters
- which fields appear in list sorting
- which fields appear in frequent admin or public lookups
- whether uniqueness is a real business rule or only a nice-to-have
Index design should follow concrete read and write patterns, not schema aesthetics.
Operational decisions
At project-delivery level, document these choices explicitly:
- MongoDB version and topology
- replica-set availability
- persistence location for database and uploads
- backup/restore responsibility
- whether audit/search features introduce extra operational expectations
If these decisions are absent, later agents tend to over-focus on schema YAML while missing the operator-critical data layer.
Anti-patterns
- adding indexes without checking actual query or sort behavior
- relying on manual indexes that the config will later drop
- enabling text search without provisioning the needed text index
- treating replica-set requirements as optional trivia
- shipping production projects without a backup and restore story
Verification checklist
After MongoDB/index-related changes, verify all of these:
- the target environment satisfies MongoDB version and replica-set needs
- configured indexes match real query, sort, and uniqueness requirements
- project reload succeeds after index changes
- text/search features have the required index support
- persistence and backup assumptions are documented
What an LLM should inspect first
When asked to design or review the data layer on this starter, inspect in this order:
tibi-server/docs/12-deployment.mdtibi-server/docs/02-configuration.mdtibi-server/docs/04-collections.md- current collection YAML for indexes/search
- actual query, sort, audit, and search requirements
This keeps index design tied to real runtime behavior and not just to field definitions.