Remix make-demo
Create or revise demos in the Remix repository. Use when adding a new demo under demos/, updating an existing demo, or reviewing demo code to ensure it showcases Remix packages, strong code hygiene, and production-quality patterns.
install
source · Clone the upstream repo
git clone https://github.com/remix-run/remix
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/remix-run/remix "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.agents/skills/make-demo" ~/.claude/skills/remix-run-remix-make-demo && rm -rf "$T"
manifest:
.agents/skills/make-demo/SKILL.mdsource content
Make Demo
Overview
Demos in this repository are not throwaway prototypes. They are durable code artifacts that should teach people and other agents how to write Remix code well.
A good demo should:
- exercise Remix framework behavior in a realistic way
- push the target APIs through meaningful edge cases and composition points
- model clean structure, naming, and accessibility
- be code that a reader could adapt into a real application
Workflow
- Read the target APIs and at least one or two existing demos before writing new code.
- Choose a focused scenario that exists to demonstrate Remix behavior, not a generic app shell.
- Build the demo under
using the same conventions as the existing demos.demos/<name>/ - Treat the code as a reference artifact, not as temporary sample code.
- Validate the demo locally before finishing.
Rules
- Use Remix library packages for the demo's framework behavior. Do not introduce unrelated routers, component frameworks, state managers, or middleware stacks that distract from the Remix patterns being demonstrated.
- Treat each demo as its own pnpm workspace consumer. Give it a normal
withpackage.json
as a dependency when appropriate, and import from package exports such asremix
instead of reaching back intoremix/component
with relative imports.packages/ - Keep any non-Remix dependency incidental to the runtime environment only. If a database driver, asset bundler, or type package is needed, it should support the demo rather than define its architecture.
- Demos should push Remix to its limits in a focused way. Prefer realistic edge cases, composition, streaming, middleware, routing, navigation, forms, or request-handling scenarios over toy examples.
- When demos use
, prefer idiomatic Remix component patterns. Use normal JSX composition and built-in styling/mixin props such asremix/component
orcss={...}
andmix={css(...)}
instead of dropping down to manual DOM mutation or ad hoc class management.mix={[...]} - When a demo uses
JSX, configure that demo'sremix/component
withtsconfig.json
,jsx: "react-jsx"
, andjsxImportSource: "remix/component"
. Do not addpreserveSymlinks: true
entries that point back intopaths
. The goal is for TypeScript to resolvepackages/remix/src
through the demo's ownremix
view, not through repo-relative source paths.node_modules - For HTML responses rendered with
, prefer a tiny localremix/component
helper that callsrender()
and wraps it withrenderToStream(...)
fromcreateHtmlResponse(...)
instead of manually building HTMLremix/response/html
headers or wrapping the stream yourself.Response - Prefer direct use of Remix and package APIs in demo code. Do not add custom wrappers around simple calls like
,session.get()
,session.set()
,session.flash()
,session.unset()
, orredirect()
unless the wrapper adds real domain logic, reusable policy, or a genuinely clearer abstraction.context.get(...) - Demo code must have good hygiene. Use clear names, small focused modules, explicit control flow, and accessible markup. Avoid hacks, dead code, unexplained shortcuts, or patterns that would be poor examples for users to copy.
- Make the demo teach good patterns. Assume readers and future agents will study it as an example of how Remix code should be written in this repository.
- All demo servers should use port
.44100 - Demo servers should handle
andSIGINT
cleanly by closing the server and exiting.SIGTERM
Typical Structure
Use only the files the scenario needs, but prefer this shape:
demos/<name>/package.json
when the demo has TypeScript or JSX sourcedemos/<name>/tsconfig.jsondemos/<name>/server.tsdemos/<name>/README.mddemos/<name>/app/
when serving built assets or other static filesdemos/<name>/public/
Remix Application Layout
When a demo is a real application, prefer a uniform Remix application layout instead of inventing a new structure for each demo.
Root layout
Use these root directories consistently:
for runtime application codeapp/
for database artifacts such as migrations and local SQLite filesdb/
for shared test helpers, fixtures, and any true cross-application integration teststest/
for static files served as-ispublic/
for runtime scratch files such as sessions, uploads, and cachestmp/
App layout
Inside
app/, organize code by responsibility:
for all controller-owned features, with folders such ascontrollers/
,controllers/home/
, orcontrollers/auth/
, each with acontrollers/account/
entrypoint and the UI it ownscontroller.tsx
for reusable cross-feature UI primitives used by those controllerscontrollers/ui/
for runtime data definitions such as table schema and setup helpers used by the application at startupdata/
for request-layer concerns such as auth, database injection, sessions, and other request lifecycle setupmiddleware/
for shared runtime support code that does not clearly belong to one of the other app layersutils/
Naming and ownership rules
- Keep controllers thin. They should read request context, talk to the database or other runtime services, and return a response.
- Put each controller in its controller feature folder as
. Do not split controller files across the app root and feature folders.controller.tsx - When one controller owns nested child controllers, model that hierarchy with nested feature directories on disk. Avoid flattened files such as
when the parent already lives atsignup-controller.tsx
; preferauth/controller.tsx
.auth/signup/controller.tsx - If a component or helper is only used by one controller feature, keep it in that controller feature folder instead of
.controllers/ui/ - Use
only for reusable UI primitives. Do not create a genericcontrollers/ui/
dumping ground.app/components/ - Do not create a generic
dumping ground.app/lib/ - Avoid feature barrel files such as
. Import feature modules directly.index.ts - If a helper is shared only by controllers, keep it under
.controllers/ - If a helper is part of request or session setup, keep it under
.middleware/ - Keep table definitions, row types, and runtime database setup in
.app/data/ - Keep database artifacts such as migrations and SQLite files in
.db/ - Use
only for genuinely cross-layer support code. Prefer a topic-specific name likeutils/
over catch-all names likeutils/external-auth.ts
orhelpers.ts
.misc.ts - Co-locate tests with the app modules they cover whenever those tests primarily exercise one implementation file or one small feature area.
- Use the root
directory only for shared test code, fixtures, and truly broad integration coverage that does not belong to a single app module.test/
Example layout
demos/<name>/ app/ router.ts router.test.ts routes.ts controllers/ render.tsx home/ controller.tsx login-page.tsx auth/ controller.tsx signup/ controller.tsx resolve-external-auth.ts account/ controller.tsx account-page.tsx ui/ auth-card.tsx document.tsx form-field.tsx notice.tsx icons.tsx design-system.ts styles.ts data/ schema.ts setup.ts setup.test.ts middleware/ auth.ts database.ts session.ts utils/ auth-session.ts auth-session.test.ts password-hash.ts external-auth.ts db/ migrations/ app.sqlite test/ fixtures/ helpers.ts public/ tmp/
README Expectations
- Explain what the demo proves or teaches.
- Document how to run it locally.
- Point out the key Remix APIs or patterns being demonstrated.
- Keep code examples and imports aligned with repo guidance: use
package exports where available.remix
Validation
- Run
when the demo defines a typecheck script.pnpm -C demos/<name> typecheck - Run
when the demo defines tests.pnpm -C demos/<name> test - Smoke-test the demo server locally when behavior depends on live requests or browser interaction.
- Run
before finishing.pnpm run lint