|
1 | | -## Repo CI / Deploy Note |
2 | | -- Vercel Preview/Prod: `NEXT_PUBLIC_CONVEX_URL` is set automatically by the Convex deploy step. If it's undefined, the Convex deploy is failing (debug that first). |
3 | | -- Pre-push sanity: `bun x ultracite fix`, `bun x ultracite check`, `bun run check-types`, `bun run build`, and `cd packages/backend && bunx convex codegen && bun run test`. |
4 | | -- don't create new branches unless asked |
5 | | ---- |
6 | | - |
7 | | -# Working Preferences |
8 | | - |
9 | | -## Communication |
10 | | -- succinct; no filler; fragments OK |
11 | | -- facts first; show evidence (commands + exit codes) |
12 | | - |
13 | | -## Engineering |
14 | | -- ship small, testable increments |
15 | | -- readable > clever |
16 | | -- skimmable code; split files at ~400 lines |
17 | | -- descriptive names; long OK |
18 | | -- docstrings: skip or "why" only |
19 | | -- latest packages; `bun install` |
20 | | - |
21 | | -## Languages |
22 | | -- TypeScript first |
23 | | -- Go OK for utilities |
24 | | -- avoid Python |
25 | | - |
26 | | -## Workflow |
27 | | -- commit + push often (small commits) |
28 | | -- delete obsolete docs/experiments |
29 | | -- use `gh` for GitHub issues/PRs instead of web UI |
30 | | - |
31 | | -## Linting |
32 | | -- `bun x ultracite fix` format |
33 | | -- `bun x ultracite check` verify |
34 | | - |
35 | | -## Repo |
36 | | -- Turborepo + bun workspaces |
37 | | -- `apps/web/` Next.js frontend |
38 | | -- `packages/backend/` Convex functions |
39 | | -- `bun run dev` all apps |
40 | | -- `bun run build` builds |
41 | | - |
42 | | -## Testing |
43 | | -Priority: API > E2E > manual/verification > unit (last resort) |
44 | | - |
45 | | -1. **API tests** - for true public APIs (none currently) |
46 | | -2. **E2E tests** - primary method; UI flows |
47 | | -3. **Manual Verification** - for fixes where CI tests add low value; use checklist + log analysis |
48 | | - |
49 | | -Never mock HTTP; `convex-test` mocks Convex backend only. Verify functional intent/behavior over code coverage. |
50 | | - |
51 | | -## Test Planning |
52 | | -Outline scenarios upfront. Create `.ts` (for E2E) or a manual checklist (for verification) with description comment - confirm approach before implementing. |
53 | | - |
54 | | -For manual verification, structure the checklist and log requirements so they could be automated via an LLM (e.g. "analyze logs for X abnormality"). Add results/logs to issue comments. |
55 | | - |
56 | | -## Stagehand E2E |
57 | | -Location: `tests/e2e/` | Stagehand 3 TS via OpenRouter |
58 | | - |
59 | | -Models: |
60 | | -- `google/gemini-2.5-flash-lite` general |
61 | | -- `google/gemini-3-flash-preview` complex |
62 | | - |
63 | | -Guidelines: |
64 | | -- prompt-first; avoid brittle selectors |
65 | | -- start dev server locally |
66 | | -- `STAGEHAND_TARGET_URL` for preview regression |
67 | | - |
68 | | -## Adding Tests |
69 | | -1. Create `.ts` in `tests/e2e/` |
70 | | -2. Add scenario comment at top |
71 | | -3. Confirm approach first |
72 | | -4. Run locally before commit; preview after deploy |
| 1 | +## Repo Constraints |
| 2 | +- **Branches**: only one active branch other than main at a time (cleanup or recommend cleanup if found in violation) |
| 3 | +- **Vercel**: `NEXT_PUBLIC_CONVEX_URL` is automatic. If undefined, Convex deploy failed. |
| 4 | +- **Pre-push**: `bun x ultracite fix`, `bun run check-types`, `bun run build`, and `cd packages/backend && bun run test`. |
| 5 | + |
| 6 | +## Preferences |
| 7 | +- **Communication**: Succinct; fragments OK; facts first; show evidence (commands + exit codes). |
| 8 | +- **Engineering**: `readable > clever`; long descriptive names OK; split files at ~400 lines. |
| 9 | + |
| 10 | +## Testing Strategy |
| 11 | +- **Priority**: API > E2E > manual/verification. |
| 12 | +- **API (Convex)**: `packages/backend/convex/*.test.ts`. Never mock HTTP; verify functional intent. |
| 13 | +- **E2E (Stagehand)**: Prompt-first selectors; avoid brittle CSS. Use `STAGEHAND_TARGET_URL` for previews. |
| 14 | +- **Authenticated local E2E**: When a flow requires WorkOS sign-in, use `SKETCHI_E2E_EMAIL` and `SKETCHI_E2E_PASSWORD` from local env files instead of ad hoc credentials. |
| 15 | +- **Local auth/editor overrides**: For local WorkOS + Convex verification, prefer `SKETCHI_ADMIN_SUBJECTS` / `SKETCHI_ICON_LIBRARY_EDITOR_SUBJECTS` in addition to email allowlists. Local Convex identities may not include email claims even when the user is signed in. |
| 16 | +- **UI verification**: For any UI/E2E-affecting change, run a targeted local verification against the real app before finishing. Prefer `agent-browser` for the interaction path and `d3k` for browser/server log review; at minimum run the real dev server with `bun run dev` and verify the affected flow there. |
| 17 | +- **Manual**: Checklist + log analysis (`venom.log` or Convex logs). |
73 | 18 |
|
74 | 19 | ## Memory |
75 | | -- Use .memory/ directory to store any temporary artifacts. |
76 | | -- This directory is gitignored, so it will not be committed to the repository, but it is intentionally configured to be visible to codex. |
| 20 | +- Use `.memory/` for temporary artifacts (gitignored but visible to tools). |
0 commit comments