<!-- Generated by scripts/generate_ai_collab_docs.py. Edit metadata in that script. -->

# Cook Web Domain: c-utils

This file adds local guidance for `src/cook-web/src/c-utils`. Read the
repository root and `src/cook-web/AGENTS.md` first, then use this file for
domain-specific frontend ownership.

## Scope

- This domain owns legacy utility helpers for URLs, interaction payloads,
  markdown, audio, dates, and other shared `c`-experience transformations.

- Representative files in this subtree:
  `src/cook-web/src/c-utils/urlUtils.ts`,
  `src/cook-web/src/c-utils/interaction-user-input.ts`,
  `src/cook-web/src/c-utils/audio-utils.ts`,
  `src/cook-web/src/c-utils/lesson-feedback-interaction.ts`

- Keep durable frontend rules here only when they are more specific than the
  Cook Web-wide guidance in the parent directory.

- Use focused frontend verification around `src/cook-web/src/c-utils/` before
  widening to global type and lint checks.

## Do

- Start from the local entry files and preserve how `c-utils` currently
  separates route code, shared logic, state, and utilities.

- Keep shared parsing and serialization helpers centralized here so legacy
  pages do not drift on the same payload rules.

- Preserve interaction, lesson-feedback, and URL semantics because multiple
  skills and UI paths rely on them indirectly.

- Move repeated legacy transformation logic into this subtree instead of
  copying it into services or pages.

## Avoid

- Do not reimplement user-input serialization or lesson feedback parsing in
  multiple places when these helpers already exist.

- Do not change URL or routing helper semantics without checking the learner
  flow and deep-link behaviors together.

- Do not add one-off utility files when an existing helper can absorb the
  behavior more cleanly.

- Avoid pushing domain-local rules up to shared docs unless another frontend
  subtree truly depends on the same constraint.

## Commands

- `rg -n "c-utils" src/cook-web/src` to locate call sites before editing this
  subtree.

- `cd src/cook-web && npm run type-check` after TypeScript, store, hook,
  request, or route-contract changes.

- `cd src/cook-web && npm run lint` before closing the task when shared
  frontend code or route files changed.

- `cd src/cook-web && npm run test -- src/c-utils/` for focused Jest coverage
  when this subtree already has or gains tests.

## Tests

- Add or update focused tests closest to `src/cook-web/src/c-utils/` for the
  happy path and the most important regression or business-code error path.

- Rerun type-checking and linting when exported props, store fields, hook
  contracts, or route behavior move.

- When a domain depends on shared request or normalization helpers, update
  those tests or add new ones in the same task.

- Document skipped UI, browser, or provider-dependent verification in the task
  summary when local automation cannot cover it.

## Related Skills

- src/cook-web/skills/deep-link-lessonid-routing/SKILL.md

- src/cook-web/skills/interaction-user-input-defaults/SKILL.md

- src/cook-web/skills/listen-mode-audio-streaming/SKILL.md

- `src/cook-web/SKILL.md`

- `SKILL.md`

- Create a focused skill under `src/cook-web/skills/<topic>/SKILL.md` when the
  same debugging or migration workflow repeats.
