Skip to content

feat(library): pure menu picker with filters and diversification #28

Description

@tomiloki

Context

Phase 4 del re-design. Función pura que selecciona 3-5 templates según objetivos del usuario, contexto de check-in, y completions recientes. Cero LLM, 100% determinística para tests.

Spec & Plan

  • Spec: `docs/superpowers/specs/2026-05-08-habitquest-reimagination-design.md` (sección 4.4)
  • Plan: `docs/superpowers/plans/2026-05-08-habitquest-reimagination.md` (Phase 4)

Deliverables

  • `lib/ai/library-picker.ts` con `pickMenu()` y `mapGoalsToCategories()`
  • `tests/library-picker.test.ts`

Comportamiento

  1. Filtra por categorías relevantes a los goals del usuario
  2. Si `checkIn.energy='low'`: solo `intensity='low'`
  3. Si `checkIn.timeAvailable='short'`: solo `duration <= 15`
  4. Excluye nombres en `recentCompletions` (últimos 3 días)
  5. Cap de 2 items por categoría (diversidad)
  6. Devuelve entre 3 y 5 items
  7. Shuffle determinístico (seed para tests)

Acceptance

7+ tests verdes, todos los filtros cubiertos.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions