Summary
Add a Caesar cipher endpoint at app/api/routes-f/caesar/route.ts. Encode and decode text with a configurable shift value.
⚠️ Scope Constraint — READ BEFORE STARTING
All files for this task must live inside app/api/routes-f/. This includes:
- The route handler (e.g.
app/api/routes-f/<feature>/route.ts)
- Any helpers/utilities (e.g.
app/api/routes-f/<feature>/_lib/helpers.ts)
- Any types (e.g.
app/api/routes-f/<feature>/_lib/types.ts)
- Any tests (e.g.
app/api/routes-f/<feature>/__tests__/route.test.ts)
Do not modify, import from, or add files to lib/, utils/, types/, components/, or anywhere else outside app/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional — it keeps these tasks independent and mergeable in any order.
Requirements
POST /api/routes-f/caesar body { text: string, shift: number, mode: "encode"|"decode" }
- Return
{ result: string, shift_used: number }
- Preserve case (A -> D, a -> d)
- Preserve non-alphabetic characters unchanged (digits, spaces, punctuation)
- Normalize shift value modulo 26
- Response includes a warning if text is detectably English and shift is unchanged (i.e., shift % 26 === 0)
- Include unit tests, including a round-trip test
Acceptance Criteria
Summary
Add a Caesar cipher endpoint at
app/api/routes-f/caesar/route.ts. Encode and decode text with a configurable shift value.All files for this task must live inside
app/api/routes-f/. This includes:app/api/routes-f/<feature>/route.ts)app/api/routes-f/<feature>/_lib/helpers.ts)app/api/routes-f/<feature>/_lib/types.ts)app/api/routes-f/<feature>/__tests__/route.test.ts)Do not modify, import from, or add files to
lib/,utils/,types/,components/, or anywhere else outsideapp/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional — it keeps these tasks independent and mergeable in any order.Requirements
POST /api/routes-f/caesarbody{ text: string, shift: number, mode: "encode"|"decode" }{ result: string, shift_used: number }Acceptance Criteria
app/api/routes-f/caesar/