Good first issue: add react-router-v7 stack budget preset (React Router v7 + TypeScript + Vite)

Open
#72 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@ferronatin is already working on this.

Since Nov 22, 2026.

  • #73 by @ferronatin — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
18/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
react, typescript, vite
Domain
devtools

Research direction

Start with the strict presetSchema in src/presets.ts and an existing preset such as presets/sveltekit.yaml to see the allowed keys. Create presets/react-router-v7.yaml, then run npx vitest run tests/unit/presets.test.ts and npm test. Pull request #73 is already open against this issue, so check with the maintainers before starting.

Written by the indexing model from the issue text.

Description

enhancement good first issue help wanted
Summary

Add a curated stack preset at presets/react-router-v7.yaml for React Router v7 + TypeScript + Vite. Once it ships in a release, users can apply it with:

npx @framy2/ctxwise preset react-router-v7 --with-guidance

This writes ctxwise.budget.yaml plus starter AGENTS.md and CLAUDE.md files built from the preset rules.

Schema

Presets are parsed by the strict Zod presetSchema in src/presets.ts. Unknown keys (for example id, title, summary, or guidance) are rejected and fail npm test.

Key Type Notes
name string Must equal the file name without .yaml
stack string Human-readable stack label
description string One sentence
budget.maxKnownTokens positive integer Total known startup-context budget
budget.maxContributorTokens positive integer Largest single contributor; keep it below maxKnownTokens
budget.unknown warn or fail Optional, defaults to warn
recommendedMcpServers string[] Optional, defaults to []
rules string[] At least one rule
Starter template

This template already passes presetSchema. Treat the rules as a starting point and refine them into 4-5 concise, verifiable rules (roughly 100-200 tokens in total) based on your own experience with the stack.

name: react-router-v7
stack: React Router v7 + TypeScript + Vite
description: Lean context budget and route loader/action, typegen, and server-module rules for React Router v7 apps.
budget:
  maxKnownTokens: 2600
  maxContributorTokens: 950
  unknown: warn
recommendedMcpServers:
  - playwright
  - github
rules:
  - "Load route data in `loader` and mutate through `action` + `<Form>`/`useFetcher` instead of ad-hoc `useEffect` fetches, and return `data()` with explicit HTTP status codes."
  - "Use generated `./+types/<route>` `Route.LoaderArgs`, `Route.ActionArgs`, and `Route.ComponentProps` types instead of hand-typing loader payloads."
  - "Keep database clients, auth checks, and secrets strictly inside `.server.ts` modules and server `loader`/`action` functions; never import server-only code into client components."
  - "Validate every `action` `formData()` or request payload with a schema (e.g. Zod) and handle errors with route-level `ErrorBoundary` exports."
  - "Run `npx react-router typegen`, `tsc --noEmit`, the test suite, and `npm run build` before marking any task complete."

References: presets/nextjs-typescript.yaml, presets/sveltekit.yaml.

Steps
  1. Fork and clone the repository, then run npm ci (Node.js 20+).
  2. Create presets/react-router-v7.yaml.
  3. Validate:
    npx vitest run tests/unit/presets.test.ts   # loads and schema-validates every presets/*.yaml
    npx prettier --check presets/react-router-v7.yaml
    npm test
    
  4. Optional end-to-end check: run npm run build, create an empty scratch directory outside the repository, then run node dist/cli.js preset react-router-v7 --with-guidance --project <scratch-dir>. Confirm that <scratch-dir>/ctxwise.budget.yaml contains maxKnownTokens: 2600, then delete the scratch directory.
  5. Open a pull request that links and closes this issue (Closes #<issue-number>).
Acceptance criteria
  • presets/react-router-v7.yaml uses only the keys listed above and npm test passes.
  • name is react-router-v7 and does not duplicate an existing preset or alias in PRESET_ALIASES.
  • Rules are specific to React Router v7 + TypeScript + Vite, actionable, and contain no secrets, personal paths, or product claims.
  • npx prettier --check presets/react-router-v7.yaml passes.
Dominant language
TypeScript
Stars
6
Forks
1
Avg merge
1d 13h
Merged PRs (30d)
23

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FramY2/ctxwise

All issues in FramY2/ctxwise

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.