fluid-calendar
Copilot instructions996 starsChanged 4 months agoMITView on GitHub
These are repository-wide instructions for GitHub Copilot's coding agent. They are a condensed mirror of CLAUDE.md and openspec/project.md; when anything here is ambiguous or conflicts, CLAUDE.md is the source of truth. Keep this file in sync with it. FluidCalendar is an open-source alternative to Motion: intelligent task scheduling plus calendar management. It ships in two flavors from one codebase - a free self-hosted open source build and a hosted SAAS build with premium features (billing, advanced AI scheduling). Tech stack:…
- Installs packages
We split this copilot-instructions.md into the rules it gives an agent
10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Run a single test with npx jest path/to/file.test.ts or npx jest -t "name".
- Very specific: line 43
Do not run npm run format (it rewrites the whole repo).
- Very specific: line 70
All SAAS-only code goes in src/saas/.
- Very specific: line 76
Do not use .gitignore to hide SAAS files - exclusions belong in sync-repos.sh.
- Distinctive: line 78
When adding a feature, decide whether it is open-source, SAAS-only, or core-with-premium-enhancement.
- Very specific: line 83
Prisma client: import the singleton prisma from @/lib/prisma.
- Very specific: line 85
Dates: use the helpers in @/lib/date-utils for all date work (including new Date()).
- Very specific: line 88
Logging: use logger from @/lib/logger, never console.log.
- Very specific: line 95
shadcn/ui: add components with npx shadcn@latest add.
- Very specific: line 98
Keep changes minimal and scoped.
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Copilot Instructions for FluidCalendar
These are repository-wide instructions for GitHub Copilot's coding agent. They are a
condensed mirror of CLAUDE.md and openspec/project.md; when anything here is
ambiguous or conflicts, CLAUDE.md is the source of truth. Keep this file in sync
with it.
Overview
FluidCalendar is an open-source alternative to Motion: intelligent task scheduling plus calendar management. It ships in two flavors from one codebase - a free self-hosted open source build and a hosted SAAS build with premium features (billing, advanced AI scheduling).
Tech stack: Next.js 15 (App Router) - React 19 - TypeScript - Prisma + PostgreSQL - NextAuth.js (v4) - Zustand - TanStack Query - FullCalendar - Tailwind + shadcn/ui (Radix) - Zod - BullMQ + Redis (background jobs) - Stripe (SAAS billing).
Setup and commands
- Install with
npm install --legacy-peer-deps(React 19 peer-dep conflicts otherwise). Node version is pinned in.nvmrc(22.x).
npm run dev # Dev server (Next.js + Turbopack) on :3000
npm run build # Production build
npm run build:os # Open-source build (forces SAAS features off)
npm run type-check # tsc --noEmit
npm run lint # next lint (CI requires zero warnings)
npm run test:unit # Jest unit tests (Node env, src/**/__tests__/**/*.test.ts)
npm run test:e2e # Playwright e2e (needs a server on TEST_BASE_URL/localhost:3000)
npm run prisma:generate # Regenerate Prisma client after schema changesRun a single test with npx jest path/to/file.test.ts or npx jest -t "name".
Verification gate for any contribution (must all pass before review):
npm run type-check- cleannpm run lint- zero warnings (CI fails on any warning)npm run test:unit- green
Do not run npm run format (it rewrites the whole repo); rely on your editor's
Prettier integration for changed files. Husky's pre-commit hook runs npm run lint
and npm run type-check; a lint-staged config (eslint zero-warnings + prettier +
type-check on staged files) also exists in package.json.
Architecture
- Local-first calendar sync. External calendars (Google / Outlook / CalDAV) are
never read live in the UI; each provider syncs into our DB (
CalendarFeed+CalendarEvent) and the app always operates on local data. Provider logic lives insrc/lib/{google,outlook,caldav}-*.tsandsrc/lib/token-manager.ts. - Task scheduling engine (
src/services/scheduling/):TaskSchedulingServiceorchestrates auto-scheduling;TimeSlotManagerenumerates candidate slots;SlotScorerranks them;CalendarServiceImplchecks availability. - Task sync (
src/lib/task-sync/): one-way sync from external task providers using selective field sync (external-owned fields overwritten each sync; local-owned fields preserved). - Background jobs: BullMQ + Redis; all job code lives in
src/saas/jobs/(SAAS-only) and runs in a separate worker process. - State: small focused Zustand stores in
src/store/; server state via TanStack Query; command-palette (cmdk) commands insrc/lib/commands/.
SAAS vs open source (most important rule)
The private SAAS repo is the superset; the public open-source repo is generated from it
via scripts/sync-repos.sh. Getting this wrong leaks SAAS code into the public repo.
- All SAAS-only code goes in
src/saas/. - Route groups:
src/app/(saas)/,src/app/(open)/,src/app/(common)/. - File-extension convention:
*.saas.ts(x)compile only in the SAAS build,*.open.ts(x)only in open-source, plain files in both. Always give files in(saas)/(open)an explicit.saas/.openextension. - Feature-gate with
isSaasEnabled/isFeatureEnabled()fromsrc/lib/config.ts. - Do not use
.gitignoreto hide SAAS files - exclusions belong insync-repos.sh. - When adding a feature, decide whether it is open-source, SAAS-only, or core-with-premium-enhancement. If unsure, ask in the PR rather than guessing.
Code-style conventions
- Prisma client: import the singleton
prismafrom@/lib/prisma; nevernew PrismaClient(). Import Prisma types from@prisma/client. - Dates: use the helpers in
@/lib/date-utilsfor all date work (includingnew Date()); don't reach fordate-fns/date-fns-tzdirectly. - Calendar DB access: go through
@/lib/calendar-db.ts. - Logging: use
loggerfrom@/lib/logger, neverconsole.log. Define aLOG_SOURCEstring per file and pass it last:logger.error("msg", { error }, LOG_SOURCE). - API route handlers (Next 15):
paramsis a Promise -const { id } = await params;. - Admin-only: API routes use
requireAdminfrom@/lib/auth/api-auth; UI uses theuseAdminhook or the<AdminOnly>wrapper with<AccessDeniedMessage>. - shadcn/ui: add components with
npx shadcn@latest add; icons viareact-icons. - JSX text: escape quotes/apostrophes as
'/". - No em dashes in copy; use hyphens, commas, or rephrase.
- Keep changes minimal and scoped; don't refactor unrelated code. Don't remove
//todocomments; add them for deferred work. - Update
CHANGELOG.mdunder[Unreleased]for any user-facing change.
Where things live
src/services/scheduling/- task auto-scheduling enginesrc/lib/- providers, auth, date utils, config, commands, task-sync, db helperssrc/store/- Zustand storessrc/components/- feature-foldered UI (calendar, tasks, settings, auth, ...)src/app/api/- route handlersprisma/schema.prisma- Postgres schemasrc/saas/jobs/- BullMQ background jobs (SAAS, separate worker process)openspec/- OpenSpec proposals and specs for non-trivial changes
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/main-rule.mdcCursor rule
- implement-github-issueSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- review-merge-port-prSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

