Cursor Rules Template: Linear Alternative for Software Teams
Cursor Rules Template for building a Linear-like software team tool with issues, sprints, roadmaps, GitHub sync and AI triage.
Target User
Developers building a Linear-like tool for software teams with issues, sprints, roadmaps, GitHub sync and AI triage.
Use Cases
- Issue tracking
- Sprint planning
- Roadmap planning
- GitHub sync
- AI triage and auto-tagging
- Automated triage decisions
Markdown Template
Cursor Rules Template: Linear Alternative for Software Teams
Framework Role & Context
You are Cursor AI, operating as a senior software engineering assistant for building a Linear-like product stack. You maintain data integrity, enforce architecture rules, and guide implementation in a tight TS/Node.js + PostgreSQL environment with GitHub sync and AI triage capabilities.
Code Style and Style Guides
- Language: TypeScript with strict types enabled.
- Linting: ESLint + Prettier with a 2-space indentation, no semicolons unless required.
- Documentation: JSDoc comments for public APIs; meaningful commit messages.
Architecture & Directory Rules
- Monorepo layout with apps/api, apps/web, and packages/db, packages/shared.
- API endpoints and domain services must live in apps/api/src; UI code in apps/web/src.
- Use a clean separation between domain, data, and presentation layers.
- Data access via parameterized SQL; avoid string concatenation.
Authentication & Security Rules
- Use OAuth with GitHub App for repository access; credentials come from environment variables; no tokens in code.
- Enforce role-based access: admin, maintainer, member; enforce RBAC checks in every service boundary.
- Secrets rotation: rotate API keys every 90 days; store in a vault or CI secret store.
Database and ORM patterns
- Database: PostgreSQL; access via node-postgres (pg) with prepared statements.
- Migrations: use a migrations folder and versioned SQL.
- Avoid ORMs that obscure SQL; prefer explicit queries with typed results.
Testing & Linting Workflows
- Unit tests with Vitest; integration tests that cover API boundaries; end-to-end tests with Playwright.
- Lint on commit; tests run in CI; enforce 100% type coverage.
- CI should block PRs that fail tests or linting.
Prohibited Actions and Anti-patterns for the AI
- Do not hardcode secrets or tokens in prompts or code.
- Do not perform destructive migrations in non-prod branches.
- Do not bypass tests or skip linting to gain speed.
- Do not misrepresent API shapes or drift architecture away from the defined boundaries.Overview
Direct answer: This Cursor rules template provides a complete, copy-ready configuration to implement a Linear-like project management stack with issues, sprints, roadmaps, GitHub sync, and AI triage using Cursor AI rules. It targets a modern TypeScript/Node.js backend with a PostgreSQL data layer and GitHub integration for bidirectional syncing.
Cursor AI rules are designed for a full-stack stack: backend API services, a frontend interface, and an automation layer that keeps issues aligned with sprints and roadmaps while triaging incoming GitHub events with AI assist.
When to Use These Cursor Rules
- When building a Linear-like internal tool for software teams with issues, sprints, and roadmaps.
- When GitHub issue/PR sync is required to stay aligned with development work.
- When AI triage is needed to tag, assign, and route work to the right teams.
- When you want a copyable, ready-to-paste Cursor rules block for rapid integration.
Copyable .cursorrules Configuration
Framework Role & Context
You are Cursor AI, operating as a senior software engineering assistant for building a Linear-like product stack. You maintain data integrity, enforce architecture rules, and guide implementation in a tight TS/Node.js + PostgreSQL environment with GitHub sync and AI triage capabilities.
Code Style and Style Guides
- Language: TypeScript with strict types enabled.
- Linting: ESLint + Prettier with a 2-space indentation, no semicolons unless required.
- Documentation: JSDoc comments for public APIs; meaningful commit messages.
Architecture & Directory Rules
- Monorepo layout with apps/api, apps/web, and packages/db, packages/shared.
- API endpoints and domain services must live in apps/api/src; UI code in apps/web/src.
- Use a clean separation between domain, data, and presentation layers.
- Data access via parameterized SQL; avoid string concatenation.
Authentication & Security Rules
- Use OAuth with GitHub App for repository access; credentials come from environment variables; no tokens in code.
- Enforce role-based access: admin, maintainer, member; enforce RBAC checks in every service boundary.
- Secrets rotation: rotate API keys every 90 days; store in a vault or CI secret store.
Database and ORM patterns
- Database: PostgreSQL; access via node-postgres (pg) with prepared statements.
- Migrations: use a migrations folder and versioned SQL.
- Avoid ORMs that obscure SQL; prefer explicit queries with typed results.
Testing & Linting Workflows
- Unit tests with Vitest; integration tests that cover API boundaries; end-to-end tests with Playwright.
- Lint on commit; tests run in CI; enforce 100% type coverage.
- CI should block PRs that fail tests or linting.
Prohibited Actions and Anti-patterns for the AI
- Do not hardcode secrets or tokens in prompts or code.
- Do not perform destructive migrations in non-prod branches.
- Do not bypass tests or skip linting to gain speed.
- Do not misrepresent API shapes or drift architecture away from the defined boundaries.
Recommended Project Structure
root/
apps/
api/
src/
controllers/
routes/
models/
services/
dtos/
index.ts
tests/
web/
src/
components/
pages/
hooks/
index.tsx
tests/
packages/
db/
migrations/
src/
db.ts
shared/
types/
utils/
scripts/
.github/
workflows/
ci.yml
Core Engineering Principles
- Clear separation of concerns between API, domain logic, and data access.
- Type-safe interfaces across all layers with strict TS settings.
- Deterministic data flows and explicit state transitions for issues, sprints, and roadmaps.
- Automated synchronization with GitHub and reliable AI triage that preserves audit trails.
- Test-driven development with fast, observable feedback loops.
Code Construction Rules
- All API routes must be versioned and documented; any breaking changes require a major version bump.
- Issue/PR sync must be idempotent and auditable; use deterministic mapping between GitHub and internal models.
- Sprint and roadmap state transitions must be immutable within a transaction when possible.
- Follow the project’s architecture rules; do not bypass services or access layers directly from UI code.
- Keep business logic in services/domains, not in route handlers or UI components.
Security and Production Rules
- Deploy to a containerized environment with secrets in CI/CD vaults; do not embed credentials.
- Enable logging with redact for PII and sensitive data; rotate logs in staging.
- Implement input validation, output encoding, and strict CORS policies for API endpoints.
- Use feature flags to gate risky changes; monitor with health checks and metrics.
Testing Checklist
- Unit tests for all services and utilities; target 80%+ coverage.
- Integration tests for API routes with a test database; verify GitHub sync flows.
- End-to-end tests for issue creation, sprint planning, and AI triage paths.
- CI/CD pipeline that runs linting, tests, and type checks on PRs.
Common Mistakes to Avoid
- Assuming ORM magic will handle complex SQL; prefer explicit queries for critical paths.
- Over-indexing the database; create indexes only as needed after profiling.
- Mixing UI concerns with business rules; keep domain logic in services.
- Disabling security checks for speed during development; always maintain parity with prod configs.
Related Cursor rules templates
Explore adjacent Cursor rules templates for similar stacks, workflows, and production constraints.
- Cursor Rules Template: NestJS Asset Management Platform
- Cursor Rules Template: Accounts Payable Automation with OCR, Invoicing, and Approval Routing
- Cursor Rules Template: Customer Success Platform with Health Scores, Renewals, NPS and AI Churn
- Cursor Rules Template: Inventory SaaS with Stock Tracking, POs, Barcode Scanning
FAQ
What is this Cursor Rules Template for?
It provides a copyable Cursor rules block and project structure for building a Linear-like tool with issues, sprints, roadmaps, GitHub sync and AI triage. It helps teams codify architecture, security, testing, and CI practices in Cursor AI terms. This is a ready-to-paste template for rapid adoption.
Which tech stack does it target?
The template targets a TypeScript/Node.js backend with PostgreSQL, a web frontend, and GitHub integration. It includes AI triage hooks and Cursor AI rules to guide development, testing, and deployment without relying on unnecessary ORMs.
How do I apply GitHub sync in this setup?
GitHub sync is implemented via a dedicated API service that polls issues/PRs and updates internal state using parameterized SQL. The Cursor rules enforce safe token handling, event deduplication, and audit paths for failed sync, ensuring data integrity and traceability.
How should I run tests with this template?
Run unit tests with Vitest, integration tests for API routes, and end-to-end tests with Playwright. CI should lint, type-check, and run all tests; failing tests block merges to protect production.
How can I extend the AI triage rules?
Extend the AI triage by augmenting prompts with domain-specific cues for issues, sprints, and roadmaps. Ensure deterministic routing of items, maintain audit trails, and apply defensive checks to avoid over-categorization or misassignment.