gsd-task-manager
Copilot instructions26 starsChanged 2 months agoMITView on GitHub
This guide enables AI coding agents to work productively in the GSD Task Manager codebase. Follow these project-specific conventions and workflows for best results.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- branch-preflightSkill
- cleaning-up-merged-branchesSkill
- diagnoseSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- improve-codebase-architectureSkill
- inkwell-retrofitSkill
- open-knowledgeSkill
- pb-collectionSkill
- reviewable-pr-slicingSkill
- setup-matt-pocock-skillsSkill
- shadcnSkill
- shipSkill
- source-command-build-nextSkill
- source-command-qcheckSkill
- source-command-triage-prsSkill
- to-issuesSkill
- verify-frontend-changeSkill
- branch-preflightSkill
- claude-code-primitivesSkill
- cleaning-up-merged-branchesSkill
- inkwell-retrofitSkill
- pb-collectionSkill
- reviewable-pr-slicingSkill
- verify-frontend-changeSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
21 rules. About 0 are common, 5 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Next.js 16 App Router: All routes in app/. Matrix view: app/(matrix)/page.tsx.
- Very specific: line 9
Client-side only: No server rendering. All components use "use client".
- Very specific: line 25
Pure analytics functions: All metric calculations in lib/analytics/ are side-effect-free for testability and composability.
- Very specific: line 33
Dialogs: All use Radix UI Dialog primitive.
- Very specific: line 50
20 Tools: Read (7), Write (5), Analytics (5), System (3).
- Very specific: line 81
Strict mode: Always. Next.js typed routes enabled.
- Very specific: line 83
Imports: Use @/ alias for all internal imports (configured in tsconfig.json).
- Very specific: line 87
Dark Mode: Use next-themes. Classes: dark:bg-gray-900 etc.
- Very specific: line 90
Live reactivity: Use useLiveQuery() from dexie-react-hooks for real-time updates.
- Very specific: line 91
Validation: Always validate with Zod schemas before persisting to IndexedDB.
- Very specific: line 92
Error handling: Use try/catch with structured logging (lib/logger.ts).
- Very specific: line 93
Toast notifications: Use toast.error() / toast.success() from sonner for user-facing messages.
- Very specific: line 97
Circular dependencies: Always validate with wouldCreateCircularDependency() (BFS algorithm in lib/dependencies.ts) before adding …
- Very specific: line 98
Transaction-based bulk ops: Use db.transaction('rw', [...tables], async () => { ...
- Distinctive: line 105
Optimize for the next developer: Write code easy to maintain and understand.
- Distinctive: line 110
YAGNI: Don't build for hypothetical future needs.
- Very specific: line 130
Conventional Commits: Use feat:, fix:, docs:, test:, etc.
- Distinctive: line 136
Client-side only: No server rendering or network dependencies (except optional sync).
- Very specific: line 137
Manifest & Icons: Update public/manifest.json, icons, and public/sw.js together.
- Distinctive: line 138
Data: All user data stays local by default.
- Distinctive: line 150
Feedback Welcome: If any section is unclear or missing, please provide feedback to improve these instructions.
≈ “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
Copilot Instructions for GSD Task Manager
This guide enables AI coding agents to work productively in the GSD Task Manager codebase. Follow these project-specific conventions and workflows for best results.
Architecture Overview
Core Stack
- Next.js 16 App Router: All routes in
app/. Matrix view:app/(matrix)/page.tsx. Dashboard:app/(dashboard)/dashboard/page.tsx. PWA install:app/(pwa)/install/page.tsx. - Client-side only: No server rendering. All components use
"use client". - Data Layer: IndexedDB via Dexie v4 (
lib/db.ts, current schema v13). CRUD inlib/tasks.ts. Live queries viauseTasks()hook (lib/use-tasks.ts). - Quadrant System: Tasks classified by
urgent/importantbooleans → 4 quadrants. Logic inlib/quadrants.ts. - Schema Validation: Zod schemas in
lib/schema.tsfor all data types.
Database Schema (v13)
- Tables:
tasks,archivedTasks,smartViews,notificationSettings,syncQueue,syncMetadata,deviceInfo,archiveSettings,syncHistory,appPreferences - Task Fields: Core (id, title, description, urgent, important, quadrant, completed, completedAt, dueDate, createdAt, updatedAt) + Advanced (recurrence, tags, subtasks, dependencies, notifyBefore, snoozedUntil, estimatedMinutes, timeSpent, timeEntries)
- Indexes: Performance-critical indexes on
quadrant,completed,dueDate,completedAt,createdAt,updatedAt,*tags,*dependencies,notificationSent - Migrations: Schema changes always require migration in
lib/db.ts. SeeDATABASE_ARCHITECTURE.mdfor full ERD. - Schema change checklist: Zod schema changes typically require updates in three places:
lib/constants/schema.ts(add/update limits),taskDraftSchemainlib/schema.ts, andtaskRecordImportSchemainlib/schema.ts(a separate definition that uses.strip()— not derived from the draft schema for validation rules).
Key Architectural Decisions
- PocketBase cloud sync: Optional cloud sync via self-hosted PocketBase server. Tasks stored as plaintext (user owns the server). OAuth authentication with Google/GitHub.
- Last-write-wins conflict resolution: Conflicts resolved using
client_updated_attimestamps. BFS algorithm prevents circular dependencies in task graph. - Modular components: Large files split into <300 line modules. Example:
lib/sync/has 20+ focused modules vs monolithic sync engine. - Pure analytics functions: All metric calculations in
lib/analytics/are side-effect-free for testability and composability. - Transaction-based batch operations:
lib/bulk-operations.tsensures atomicity (all-or-nothing) for multi-task updates.
Component Patterns
UI Components
- Primitives (
components/ui/): shadcn-style components (button, dialog, input, etc.). No size prop on buttons—use variant: "primary" | "subtle" | "ghost". - Domain Components:
matrix-board/(modular orchestration),matrix-column.tsx,task-card.tsx,task-form/(modular form with validation hook). - Dialogs: All use Radix UI Dialog primitive. Example:
import-dialog.tsx,bulk-tag-dialog.tsx. - Hooks: Custom hooks like
useTasks(),useViewTransition(),useSmartViewShortcuts()encapsulate complex logic.
Smart Views & Command Palette
- Smart Views: Saved filter configurations (
smartViewstable). Pin up to 5 in header with keyboard shortcuts (1-9, 0=clear). - Command Palette: Global ⌘K/Ctrl+K shortcut (
command-palette.tsx). Includes quick actions, navigation, and search. - Settings: Single consolidated dialog (
components/settings/settings-dialog.tsx) with iOS-style grouped sections (Appearance, Notifications, Cloud Sync, Archive, Data & Storage, About). Opened directly from the header gear icon — no intermediate "quick" panel.
Sync Architecture
- Frontend:
lib/sync/with modular architecture:pb-sync-engine.ts(push/pull),pb-realtime.ts(SSE subscriptions),pb-auth.ts(OAuth),pocketbase-client.ts(SDK singleton),task-mapper.ts(field mapping),sync-coordinator.ts(orchestrator). - Backend: Self-hosted PocketBase server at
https://api.vinny.io(AWS EC2). OAuth with Google/GitHub. API rules enforce per-user data isolation. - Realtime: PocketBase SSE (Server-Sent Events) for instant cross-device updates with echo filtering via
device_id. - Device-local fields:
notificationSent,lastNotificationAt, andsnoozedUntilare device-local state — never overwritten from remote on sync pull.pocketBaseToTaskRecord()accepts an optionalexistingLocalparameter; callers must pass the existing local task to preserve these fields.
MCP Server Integration
- Purpose: Enable Claude Desktop to access/analyze tasks via natural language.
- Location:
packages/mcp-server/(standalone npm package, Node.js 18+). - 20 Tools: Read (7), Write (5), Analytics (5), System (3). All write operations support
dryRunmode. - Config:
~/Library/Application Support/Claude/claude_desktop_config.jsonwithGSD_POCKETBASE_URL,GSD_AUTH_TOKEN.
Developer Workflows
Essential Commands
bun install— Install deps (generatesbun.lock)bun dev— Dev server at http://localhost:3000bun typecheck— TypeScript type checking (no emit)bun lint— ESLint with Next.js configbun run test— Vitest CI mode (notbun test— that invokes bun's built-in runner, not Vitest)bun run test -- tests/data/tasks.test.ts— Run a single test filebun run test -- -t "test name pattern"— Run tests matching a name patternbun run test:watch— Vitest watch modebun run test -- --coverage— Coverage report (target: ≥80% statements/lines/functions, ≥75% branches)bun run build— Production build (includes typecheck)bun run export— Static export for S3/CloudFront
CloudFront Deployment
- Why: S3 doesn't auto-serve
index.htmlfor directory paths. Need CloudFront Function for SPA routing. - Deploy:
./scripts/deploy-cloudfront-function.shafter adding new App Router routes. - Full Deploy:
bun run deploy(builds, syncs to S3, invalidates CloudFront)
MCP Server Development
- Build:
npm run buildinpackages/mcp-server/ - Test:
npm test(unit tests with dry-run validation) - CLI:
gsd-mcp setup(interactive config),gsd-mcp validate(config validation)
Coding Conventions
TypeScript & Naming
- Strict mode: Always. Next.js typed routes enabled.
- Naming: PascalCase for components/types, camelCase for functions/variables, kebab-case for files/folders.
- Imports: Use
@/alias for all internal imports (configured intsconfig.json).
Styling
- Tailwind: Group classes by layout → spacing → color. Shared utilities in
app/globals.css. - Dark Mode: Use
next-themes. Classes:dark:bg-gray-900etc.
Patterns to Follow
- Live reactivity: Use
useLiveQuery()fromdexie-react-hooksfor real-time updates. - Validation: Always validate with Zod schemas before persisting to IndexedDB. Use
.safeParse()(not.parse()) on all user-input paths. - Error handling: Use
try/catchwith structured logging (lib/logger.ts). Sanitize secrets in logs. - Toast notifications: Use
toast.error()/toast.success()fromsonnerfor user-facing messages. Do not use the legacyuseToast()hook fromcomponents/ui/toast.tsx— it has a different API and is being phased out. Never usewindow.alert(). - Structured logging:
createLogger()requires a value from theLogContextunion type inlib/logger.ts(e.g.,'UI','IMPORT','SYNC_ENGINE','TASK_CRUD'). Check the type definition before adding a new logger — add a new literal to the union if needed. - Keyboard shortcuts: Global shortcuts in
lib/shortcuts.ts. Component-level shortcuts useuseEffectwith event listeners. - Recurring tasks: Auto-create next instance on completion via
handleRecurrence()inlib/tasks.ts. - Circular dependencies: Always validate with
wouldCreateCircularDependency()(BFS algorithm inlib/dependencies.ts) before adding dependencies. - Transaction-based bulk ops: Use
db.transaction('rw', [...tables], async () => { ... })for atomicity.
Coding Standards & Philosophy
Core Principles
- Favor simplicity over cleverness: Clear, readable code > complex solutions. Optimize only when needed.
- Start minimal and iterate: Build smallest working solution first, then enhance.
- Optimize for the next developer: Write code easy to maintain and understand.
- Descriptive naming: Clear names that express intent (no abbreviations unless standard).
- Small, focused functions: Each function does one thing well. Max 20-30 lines. Early returns + guard clauses.
- Comment "why" not "what": Code should be self-documenting. Comments explain reasoning or non-obvious logic.
- DRY, but not prematurely: Extract after seeing repetition 3+ times. Avoid over-abstraction.
- YAGNI: Don't build for hypothetical future needs.
- Composition over inheritance: Build functionality by combining simple pieces.
Quality Checklist
- Can a new team member understand this code in 5 minutes?
- Are names self-explanatory?
- Is the happy path clear and error handling robust?
- Is there unnecessary complexity or cleverness?
- Does it solve the actual problem without extra features?
Testing
Test Structure
- UI tests:
tests/ui/with@testing-library/reactand@testing-library/jest-dom - Data tests:
tests/data/for persistence logic - Coverage targets: 80% statements/lines/functions, 75% branches
- Key patterns: Mock IndexedDB with
fake-indexeddb. Test keyboard shortcuts. Cover offline scenarios.
Commit & PRs
- Conventional Commits: Use
feat:,fix:,docs:,test:, etc. Reference issues (e.g.,Fixes #123). - PRs: Explain motivation, solution, and tests. Include screenshots for UI changes. Link to spec docs (
CLAUDE.md,TECHNICAL.md). - Rebase: Rebase before review. Wait for green lint/test/build status.
PWA & Privacy
- Client-side only: No server rendering or network dependencies (except optional sync).
- Manifest & Icons: Update
public/manifest.json, icons, andpublic/sw.jstogether. Test withbun run export. - Data: All user data stays local by default. Export/import via JSON. Sync is opt-in via self-hosted PocketBase.
References
- Product Scope:
CLAUDE.md(features, architecture decisions, development notes) - Technical Details:
TECHNICAL.md(stack, data layer, component structure, key patterns) - Contribution Standards:
coding-standards.md(agentic behavior, solution quality, reflection) - Database:
DATABASE_ARCHITECTURE.md(ERD, schema migrations, indexing strategy) - Features:
GSD_FEATURES_GUIDE.md(user-facing feature guide)
Feedback Welcome: If any section is unclear or missing, please provide feedback to improve these instructions.
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.

