Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- **Markdown Formatting**: In Markdown files (docs, prompts, READMEs) write **one line per paragraph** (soft-wrap) — do not hard-wrap prose at ~80 columns. Let the editor wrap; only insert a real line break to start a new paragraph or list item. Tables, code blocks, and ASCII diagrams are exempt.
- **Common UI Primitives**: Before creating UI elements, inspect `apps/web/src/components/Common` and use or extend a suitable component. Treat each component's exported props and implementation as its current contract. Always use `<Button>` instead of a custom native `<button>`; use `<TextInput>` for styled text-like form controls; reserve the low-level `<Input>` for intentionally caller-styled inputs. Native inputs remain appropriate for non-text controls such as checkbox, radio, range, color, and file inputs. Keep feature-specific UI colocated when it is only used by that feature.
- **Reuse Before Implementing**: Before adding or changing hooks, helpers, services, business logic, or non-trivial components, search for existing similar implementations first. Prefer reusing, extending, or extracting shared code over creating parallel implementations with slightly different behavior. For implementation tasks, briefly mention what was reused or why a new canonical implementation was necessary.
- **Filesystem Path Safety**: Resolve untrusted path segments with `resolveDirectChildPath()` or `safeJoin()` from `apps/server/src/utils/fs.ts`; never rely on filename sanitization, direct path construction, or ad hoc checks. These helpers use CodeQL-recognized `path.resolve` and root-prefix validation.
- **Pre-PR CI Checks**: Before handing a pull request off for review, run the repository-level `pnpm typecheck`, `pnpm format`, and `pnpm lint:fix` scripts. Review and commit any formatter or linter changes, then rerun validation affected by those changes.
- **API Endpoints**: When adding or modifying any HTTP / SSE endpoint (route file, web `api/*.ts` helper, or shared wire type), follow the rules in `docs/architecture/api-design.md`. In particular: define the contract once in `packages/shared/src/types/api/*` (zod schema + `z.infer` type), validate every server input via `safeParse`, never define wire types inside `apps/server` or `apps/web`, and keep the web bundle zod-free by importing schemas as `import type` only.
- **Color Usage**: Always use the semantic design tokens defined in `apps/web/src/index.css` — never use raw hex values, Tailwind default palette colors (e.g., `gray-500`, `blue-600`), or ShadCN aliases (`bg-card`, `text-muted-foreground`) in new components. Use `text-fg-default` / `text-fg-muted` / `text-fg-subtle` for text, `bg-surface` / `bg-bg-default` / `bg-hover` / `bg-inverse` for backgrounds, `text-fg-inverse` for text on dark surfaces, `border-edge-default` for borders, and status tokens (`text-info`, `text-danger`, `text-success`, `text-warning`) for semantic states. Treat the token declarations in `apps/web/src/index.css` as the source of truth.
Expand Down
Loading
Loading