---
estimated_steps: 14
estimated_files: 2
skills_used: []
---

# T01: Enrich CreatorTechniqueItem with summary, topic_tags, key_moment_count

Extend the backend schema and query so the creator detail endpoint returns enriched technique data needed for the featured card and restyled grid.

## Steps

1. Read `backend/schemas.py` and add three fields to `CreatorTechniqueItem`:
   - `summary: str | None = None`
   - `topic_tags: list[str] | None = None`
   - `key_moment_count: int = 0`

2. Read `backend/routers/creators.py` (the creator detail endpoint around line 140-175). Update the technique query to also select `TechniquePage.summary` and `TechniquePage.topic_tags`. For `key_moment_count`, add a correlated subquery: `select(func.count(KeyMoment.id)).where(KeyMoment.technique_page_id == TechniquePage.id).correlate(TechniquePage).scalar_subquery().label('key_moment_count')`. Pass all new fields when constructing `CreatorTechniqueItem` instances.

3. Verify the schema loads: `cd backend && python -c "from schemas import CreatorTechniqueItem; print(CreatorTechniqueItem.model_fields.keys())"`

## Must-Haves

- [ ] `CreatorTechniqueItem` has `summary`, `topic_tags`, `key_moment_count` fields
- [ ] Creator detail endpoint query selects summary, topic_tags, and computes key_moment_count
- [ ] Existing fields (title, slug, topic_category, created_at) unchanged

## Verification

- `cd backend && python -c "from schemas import CreatorTechniqueItem; fields = list(CreatorTechniqueItem.model_fields.keys()); assert 'summary' in fields and 'topic_tags' in fields and 'key_moment_count' in fields, f'Missing fields: {fields}'; print('OK:', fields)"`

## Inputs

- ``backend/schemas.py` — current CreatorTechniqueItem with title, slug, topic_category, created_at`
- ``backend/routers/creators.py` — creator detail endpoint with technique query`
- ``backend/models.py` — TechniquePage model with summary, topic_tags columns and KeyMoment relationship`

## Expected Output

- ``backend/schemas.py` — CreatorTechniqueItem with 3 new fields: summary, topic_tags, key_moment_count`
- ``backend/routers/creators.py` — enriched technique query with summary, topic_tags, key_moment_count subquery`

## Verification

cd backend && python -c "from schemas import CreatorTechniqueItem; fields = list(CreatorTechniqueItem.model_fields.keys()); assert 'summary' in fields and 'topic_tags' in fields and 'key_moment_count' in fields; print('OK')"
