SkillsSync
Copilot instructions0 starsChanged 7 months agoMITView on GitHub
Session refresh runs in proxy.ts (root middleware equivalent); it also enforces redirect-to-login for protected path prefixes. Core types: Document, ExtractedSkill, UserGoal. Gemini accepts media (PDFs, images) directly; the helper functions generateText and generateTextFromMedia are provided in lib/openai.ts. Document lifecycle: upload → Supabase Storage (coursework bucket) → documents row (PROCESSING) → fire-and-forget POST /api/documents/analyze → row updated to COMPLETED or FAILED + skills inserted. Never call supabase.auth.getUser() directly in page components – use requireAuth() or getCurrentUser() from lib/supabase-auth.ts. Package manager: pnpm…
- Reads credentials
In this repository3 other files it gives its agents.
- public/llms-full.txtllms.txt
- public/llms.txtllms.txt
- frontend-designSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
All Supabase queries go through typed wrapper functions in lib/db.ts.
- Very specific: line 37
Document lifecycle: upload → Supabase Storage (coursework bucket) → documents row (PROCESSING) → fire-and-forget POST …
- Very specific: line 57
Never call supabase.auth.getUser() directly in page components – use requireAuth() or getCurrentUser() from lib/supabase-auth.ts.
- Very specific: line 82
Run locally with a Postgres connection string set in DATABASE_URL or SUPABASE_DB_URL:
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 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
SkillSync – Copilot Instructions
Project Overview
SkillSync is a Next.js 16 App Router application that lets users upload academic/professional documents, extract skills via AI, and track career goals. Stack: React 19, TypeScript (strict), Tailwind CSS 4, Supabase (auth + Postgres + storage), DeepSeek AI (via OpenAI-compatible SDK).
Architecture
Route Groups & Auth Flow
app/(dashboard)/– protected pages (dashboard, documents, skills, goals, profile). The group layout (app/(dashboard)/layout.tsx) callsrequireAuth()which redirects to/auth/loginif unauthenticated.app/auth/– public auth pages (login, register, reset-password, update-password, check-email).app/onboarding/– post-registration step; users are routed here after OAuth callback ifonboarding_completed = false.- Auth callback at
app/auth/callback/route.tsexchanges the code, checksgetUserGoal().onboardingCompleted, and routes to/dashboardor/onboarding.
Supabase Client Pattern
Three distinct clients – use the correct one for context:
| File | Use when |
lib/supabase/server.ts | Server Components, Route Handlers, Server Actions |
lib/supabase/client.ts | Client Components ("use client") – singleton pattern |
lib/supabase/proxy.ts | Middleware only (proxy.ts at root) |
Session refresh runs in proxy.ts (root middleware equivalent); it also enforces redirect-to-login for protected path prefixes.
Database Access Layer (lib/db.ts)
All Supabase queries go through typed wrapper functions in lib/db.ts. DB column names use snake_case; TypeScript types use camelCase. Every DB function uses an explicit mapping helper (e.g. mapDocumentFromDb, mapSkillFromDb). Always add a mapping helper when introducing a new table.
Core types: Document, ExtractedSkill, UserGoal.
AI Integration (lib/openai.ts)
The project uses Google Gemini (Generative AI) via the @google/generative-ai client in lib/openai.ts.
- Env var:
GEMINI_API_KEY(required) - Optional override:
GEMINI_MODEL(defaults togemini-2.0-flash)
Gemini accepts media (PDFs, images) directly; the helper functions generateText and generateTextFromMedia are provided in lib/openai.ts.
Document lifecycle: upload → Supabase Storage (coursework bucket) → documents row (PROCESSING) → fire-and-forget POST /api/documents/analyze → row updated to COMPLETED or FAILED + skills inserted.
Key Conventions
@/ Alias
@/* maps to the workspace root. Use @/lib/..., @/components/..., @/app/... throughout – never relative ../../ imports.
TypeScript Build
typescript.ignoreBuildErrors: true in next.config.mjs – builds succeed even with type errors. Fix type issues but don't rely on CI catching them.
UI Components
- Primitives live in
components/ui/(shadcn/ui pattern over Radix UI). - Forms use react-hook-form + zod (
lib/validations.ts). Password validation is shared between Zod schemas and a standalonelib/password-validation.tsused server-side in API routes. - Icons: lucide-react only.
Protected Route Check
// Server Component or layout
const user = await requireAuth() // redirects if unauthed; returns UserNever call supabase.auth.getUser() directly in page components – use requireAuth() or getCurrentUser() from lib/supabase-auth.ts.
Developer Workflow
pnpm dev # local dev server
pnpm build # production build (TS errors do NOT block)
pnpm lint # eslintPackage manager: pnpm (see pnpm-lock.yaml). Use pnpm add not npm install.
Environment Variables
NEXT_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY
GEMINI_API_KEY # Google Gemini API key (used by lib/openai.ts)
GEMINI_MODEL # optional, defaults to gemini-2.0-flash
NEXT_PUBLIC_APP_URL # used in upload route to self-call /api/documents/analyze
DATABASE_URL or SUPABASE_DB_URL # required for running local migrationsDatabase Schema
SQL migration scripts are in scripts/ and a simple runner is provided at scripts/run-migrations.mjs.
Run locally with a Postgres connection string set in DATABASE_URL or SUPABASE_DB_URL:
pnpm run db:migrateRLS is enabled on all tables; policies enforce auth.uid() = user_id. New tables must follow the same RLS pattern.
Tables: documents, extracted_skills, user_goals (see scripts/001_create_tables.sql, 003_create_user_goals.sql).
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.

