From ae55527b839c57527a2b0118960b026dfb1a904f Mon Sep 17 00:00:00 2001 From: artylobos Date: Sun, 3 May 2026 02:20:58 +1000 Subject: [PATCH] feat: add .cursor/rules/echo_rules.mdc to echo-start templates Adds tailored Cursor rules for each template type: - Next.js (App Router) rules for next, next-chat, next-image, next-video, assistant-ui, authjs, nextjs-api-key - React (Vite) rules for react, react-chat, react-image - CLI rules for echo-cli Closes #636 --- .../assistant-ui/.cursor/rules/echo_rules.mdc | 27 +++++++++++++++++++ templates/authjs/.cursor/rules/echo_rules.mdc | 27 +++++++++++++++++++ .../echo-cli/.cursor/rules/echo_rules.mdc | 19 +++++++++++++ .../next-chat/.cursor/rules/echo_rules.mdc | 27 +++++++++++++++++++ .../next-image/.cursor/rules/echo_rules.mdc | 27 +++++++++++++++++++ .../.cursor/rules/echo_rules.mdc | 27 +++++++++++++++++++ templates/next/.cursor/rules/echo_rules.mdc | 27 +++++++++++++++++++ .../.cursor/rules/echo_rules.mdc | 27 +++++++++++++++++++ .../react-chat/.cursor/rules/echo_rules.mdc | 22 +++++++++++++++ .../react-image/.cursor/rules/echo_rules.mdc | 22 +++++++++++++++ templates/react/.cursor/rules/echo_rules.mdc | 22 +++++++++++++++ 11 files changed, 274 insertions(+) create mode 100644 templates/assistant-ui/.cursor/rules/echo_rules.mdc create mode 100644 templates/authjs/.cursor/rules/echo_rules.mdc create mode 100644 templates/echo-cli/.cursor/rules/echo_rules.mdc create mode 100644 templates/next-chat/.cursor/rules/echo_rules.mdc create mode 100644 templates/next-image/.cursor/rules/echo_rules.mdc create mode 100644 templates/next-video-template/.cursor/rules/echo_rules.mdc create mode 100644 templates/next/.cursor/rules/echo_rules.mdc create mode 100644 templates/nextjs-api-key-template/.cursor/rules/echo_rules.mdc create mode 100644 templates/react-chat/.cursor/rules/echo_rules.mdc create mode 100644 templates/react-image/.cursor/rules/echo_rules.mdc create mode 100644 templates/react/.cursor/rules/echo_rules.mdc diff --git a/templates/assistant-ui/.cursor/rules/echo_rules.mdc b/templates/assistant-ui/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..f20d62085 --- /dev/null +++ b/templates/assistant-ui/.cursor/rules/echo_rules.mdc @@ -0,0 +1,27 @@ +--- +description: Echo template rules for Next.js projects (App Router). +globs: "**/*.{ts,tsx,js,jsx,md,mdx,json}" +alwaysApply: true +--- + +# Echo + Next.js template rules + +## Project shape +- This is a Next.js (App Router) project. +- Prefer React Server Components where appropriate; only add `"use client"` when needed. + +## API routes +- API routes live under `app/api/**/route.ts`. +- Keep handlers small; factor reusable logic into `lib/`. + +## Env configuration +- Never invent API keys. Use values from `.env.local` / `.env.example`. +- When documenting setup, update README and keep `.env.example` in sync. + +## TypeScript + lint +- Keep types strict and avoid `any`. +- Prefer `zod` or existing validators in the template when validating inputs. + +## Echo integration +- When wiring Echo endpoints, keep the `/api/echo/*` surface consistent with the template. +- Avoid breaking changes to request/response shapes. diff --git a/templates/authjs/.cursor/rules/echo_rules.mdc b/templates/authjs/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..f20d62085 --- /dev/null +++ b/templates/authjs/.cursor/rules/echo_rules.mdc @@ -0,0 +1,27 @@ +--- +description: Echo template rules for Next.js projects (App Router). +globs: "**/*.{ts,tsx,js,jsx,md,mdx,json}" +alwaysApply: true +--- + +# Echo + Next.js template rules + +## Project shape +- This is a Next.js (App Router) project. +- Prefer React Server Components where appropriate; only add `"use client"` when needed. + +## API routes +- API routes live under `app/api/**/route.ts`. +- Keep handlers small; factor reusable logic into `lib/`. + +## Env configuration +- Never invent API keys. Use values from `.env.local` / `.env.example`. +- When documenting setup, update README and keep `.env.example` in sync. + +## TypeScript + lint +- Keep types strict and avoid `any`. +- Prefer `zod` or existing validators in the template when validating inputs. + +## Echo integration +- When wiring Echo endpoints, keep the `/api/echo/*` surface consistent with the template. +- Avoid breaking changes to request/response shapes. diff --git a/templates/echo-cli/.cursor/rules/echo_rules.mdc b/templates/echo-cli/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..962e0b151 --- /dev/null +++ b/templates/echo-cli/.cursor/rules/echo_rules.mdc @@ -0,0 +1,19 @@ +--- +description: Echo template rules for Node.js CLI projects. +globs: "**/*.{ts,js,md,json}" +alwaysApply: true +--- + +# Echo CLI template rules + +## Runtime +- This is a Node.js CLI. +- Prefer small pure functions and keep side-effects near the entrypoint. + +## Config + secrets +- Never invent API keys. Read configuration from `.env.local` or other documented config files. +- Do not log secrets. + +## UX +- CLI output should be concise and actionable. +- Always return non-zero exit codes on failure. diff --git a/templates/next-chat/.cursor/rules/echo_rules.mdc b/templates/next-chat/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..f20d62085 --- /dev/null +++ b/templates/next-chat/.cursor/rules/echo_rules.mdc @@ -0,0 +1,27 @@ +--- +description: Echo template rules for Next.js projects (App Router). +globs: "**/*.{ts,tsx,js,jsx,md,mdx,json}" +alwaysApply: true +--- + +# Echo + Next.js template rules + +## Project shape +- This is a Next.js (App Router) project. +- Prefer React Server Components where appropriate; only add `"use client"` when needed. + +## API routes +- API routes live under `app/api/**/route.ts`. +- Keep handlers small; factor reusable logic into `lib/`. + +## Env configuration +- Never invent API keys. Use values from `.env.local` / `.env.example`. +- When documenting setup, update README and keep `.env.example` in sync. + +## TypeScript + lint +- Keep types strict and avoid `any`. +- Prefer `zod` or existing validators in the template when validating inputs. + +## Echo integration +- When wiring Echo endpoints, keep the `/api/echo/*` surface consistent with the template. +- Avoid breaking changes to request/response shapes. diff --git a/templates/next-image/.cursor/rules/echo_rules.mdc b/templates/next-image/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..f20d62085 --- /dev/null +++ b/templates/next-image/.cursor/rules/echo_rules.mdc @@ -0,0 +1,27 @@ +--- +description: Echo template rules for Next.js projects (App Router). +globs: "**/*.{ts,tsx,js,jsx,md,mdx,json}" +alwaysApply: true +--- + +# Echo + Next.js template rules + +## Project shape +- This is a Next.js (App Router) project. +- Prefer React Server Components where appropriate; only add `"use client"` when needed. + +## API routes +- API routes live under `app/api/**/route.ts`. +- Keep handlers small; factor reusable logic into `lib/`. + +## Env configuration +- Never invent API keys. Use values from `.env.local` / `.env.example`. +- When documenting setup, update README and keep `.env.example` in sync. + +## TypeScript + lint +- Keep types strict and avoid `any`. +- Prefer `zod` or existing validators in the template when validating inputs. + +## Echo integration +- When wiring Echo endpoints, keep the `/api/echo/*` surface consistent with the template. +- Avoid breaking changes to request/response shapes. diff --git a/templates/next-video-template/.cursor/rules/echo_rules.mdc b/templates/next-video-template/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..f20d62085 --- /dev/null +++ b/templates/next-video-template/.cursor/rules/echo_rules.mdc @@ -0,0 +1,27 @@ +--- +description: Echo template rules for Next.js projects (App Router). +globs: "**/*.{ts,tsx,js,jsx,md,mdx,json}" +alwaysApply: true +--- + +# Echo + Next.js template rules + +## Project shape +- This is a Next.js (App Router) project. +- Prefer React Server Components where appropriate; only add `"use client"` when needed. + +## API routes +- API routes live under `app/api/**/route.ts`. +- Keep handlers small; factor reusable logic into `lib/`. + +## Env configuration +- Never invent API keys. Use values from `.env.local` / `.env.example`. +- When documenting setup, update README and keep `.env.example` in sync. + +## TypeScript + lint +- Keep types strict and avoid `any`. +- Prefer `zod` or existing validators in the template when validating inputs. + +## Echo integration +- When wiring Echo endpoints, keep the `/api/echo/*` surface consistent with the template. +- Avoid breaking changes to request/response shapes. diff --git a/templates/next/.cursor/rules/echo_rules.mdc b/templates/next/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..f20d62085 --- /dev/null +++ b/templates/next/.cursor/rules/echo_rules.mdc @@ -0,0 +1,27 @@ +--- +description: Echo template rules for Next.js projects (App Router). +globs: "**/*.{ts,tsx,js,jsx,md,mdx,json}" +alwaysApply: true +--- + +# Echo + Next.js template rules + +## Project shape +- This is a Next.js (App Router) project. +- Prefer React Server Components where appropriate; only add `"use client"` when needed. + +## API routes +- API routes live under `app/api/**/route.ts`. +- Keep handlers small; factor reusable logic into `lib/`. + +## Env configuration +- Never invent API keys. Use values from `.env.local` / `.env.example`. +- When documenting setup, update README and keep `.env.example` in sync. + +## TypeScript + lint +- Keep types strict and avoid `any`. +- Prefer `zod` or existing validators in the template when validating inputs. + +## Echo integration +- When wiring Echo endpoints, keep the `/api/echo/*` surface consistent with the template. +- Avoid breaking changes to request/response shapes. diff --git a/templates/nextjs-api-key-template/.cursor/rules/echo_rules.mdc b/templates/nextjs-api-key-template/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..f20d62085 --- /dev/null +++ b/templates/nextjs-api-key-template/.cursor/rules/echo_rules.mdc @@ -0,0 +1,27 @@ +--- +description: Echo template rules for Next.js projects (App Router). +globs: "**/*.{ts,tsx,js,jsx,md,mdx,json}" +alwaysApply: true +--- + +# Echo + Next.js template rules + +## Project shape +- This is a Next.js (App Router) project. +- Prefer React Server Components where appropriate; only add `"use client"` when needed. + +## API routes +- API routes live under `app/api/**/route.ts`. +- Keep handlers small; factor reusable logic into `lib/`. + +## Env configuration +- Never invent API keys. Use values from `.env.local` / `.env.example`. +- When documenting setup, update README and keep `.env.example` in sync. + +## TypeScript + lint +- Keep types strict and avoid `any`. +- Prefer `zod` or existing validators in the template when validating inputs. + +## Echo integration +- When wiring Echo endpoints, keep the `/api/echo/*` surface consistent with the template. +- Avoid breaking changes to request/response shapes. diff --git a/templates/react-chat/.cursor/rules/echo_rules.mdc b/templates/react-chat/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..d7b1d2d78 --- /dev/null +++ b/templates/react-chat/.cursor/rules/echo_rules.mdc @@ -0,0 +1,22 @@ +--- +description: Echo template rules for React (Vite) projects. +globs: "**/*.{ts,tsx,js,jsx,md,mdx,json}" +alwaysApply: true +--- + +# Echo + React template rules + +## Project shape +- This is a React + Vite project. +- Prefer colocating UI components under `src/components`. + +## Env configuration +- Never invent API keys. Use values from `.env.local` / `.env.example`. +- Keep `.env.example` up to date. + +## TypeScript +- Avoid `any`; prefer explicit types. + +## Echo integration +- If adding API calls, keep them in a small client module (e.g. `src/lib/echo.ts`). +- Handle network errors and show useful UI fallbacks. diff --git a/templates/react-image/.cursor/rules/echo_rules.mdc b/templates/react-image/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..d7b1d2d78 --- /dev/null +++ b/templates/react-image/.cursor/rules/echo_rules.mdc @@ -0,0 +1,22 @@ +--- +description: Echo template rules for React (Vite) projects. +globs: "**/*.{ts,tsx,js,jsx,md,mdx,json}" +alwaysApply: true +--- + +# Echo + React template rules + +## Project shape +- This is a React + Vite project. +- Prefer colocating UI components under `src/components`. + +## Env configuration +- Never invent API keys. Use values from `.env.local` / `.env.example`. +- Keep `.env.example` up to date. + +## TypeScript +- Avoid `any`; prefer explicit types. + +## Echo integration +- If adding API calls, keep them in a small client module (e.g. `src/lib/echo.ts`). +- Handle network errors and show useful UI fallbacks. diff --git a/templates/react/.cursor/rules/echo_rules.mdc b/templates/react/.cursor/rules/echo_rules.mdc new file mode 100644 index 000000000..d7b1d2d78 --- /dev/null +++ b/templates/react/.cursor/rules/echo_rules.mdc @@ -0,0 +1,22 @@ +--- +description: Echo template rules for React (Vite) projects. +globs: "**/*.{ts,tsx,js,jsx,md,mdx,json}" +alwaysApply: true +--- + +# Echo + React template rules + +## Project shape +- This is a React + Vite project. +- Prefer colocating UI components under `src/components`. + +## Env configuration +- Never invent API keys. Use values from `.env.local` / `.env.example`. +- Keep `.env.example` up to date. + +## TypeScript +- Avoid `any`; prefer explicit types. + +## Echo integration +- If adding API calls, keep them in a small client module (e.g. `src/lib/echo.ts`). +- Handle network errors and show useful UI fallbacks.