Cursor Rules Template: Tax Document Checklist Generator for Accounting Firms
Cursor Rules Template for building tax document checklist generators using Django and PostgreSQL. Includes a copyable .cursorrules block and stack-specific project structure.
Target User
Backend engineers and AI engineers building tax document automation for accounting firms using Django
Use Cases
- Automated tax document checklist generation
- Compliance-ready document templates
- Auditable document generation workflow
Markdown Template
Cursor Rules Template: Tax Document Checklist Generator for Accounting Firms
Framework: Django
Language: Python
Version: 3.11
Runtime: CPython
Stack: Django, PostgreSQL, Django REST Framework, Celery
Context: You are an AI assistant specialized in building tax document checklists for accounting firms. You operate within a Django project using PostgreSQL. Your outputs are deterministic, testable, and auditable. Do not request unnecessary permissions or access; keep secrets in environment vars.
CodeStyle: Black, isort
Architecture: Monorepo style with apps and api separated. Use Django apps: checklist, api, and workers. All data access via ORM; no raw SQL in business logic.
DirectoryRules: Project root contains manage.py, django_project, apps, api, templates, tests. Each app has models, serializers, views, and tests.
AuthenticationSecurity: DRF TokenAuthentication by default with HTTPS. CSRF enabled for session auth. Secrets stored in env vars; rotate keys regularly.
DatabaseORM: PostgreSQL with Django ORM. Models: Client, Engagement, TaxDocumentChecklist, TaxDocumentItem, TaxRule. Migrations used; schema migrations tracked.
TestingLinting: pytest-django for tests; pytest checks, flake8 or ruff for linting; pre-commit hooks enforce standards.
ProhibitedActionsAntiPatterns: Do not execute shell commands from prompts; do not bypass authentication; do not write raw SQL in business logic; avoid relying on mutable global state in AI prompts.Overview
Cursor rules configuration for building tax document checklist generators for accounting firms enables deterministic AI-assisted output using a Django + PostgreSQL stack. This Cursor Rules Template provides a complete, copyable .cursorrules configuration you can paste into your project root to guide Cursor AI through the tax domain, ensuring consistent document checklists and auditability.
When to Use These Cursor Rules
- When automating client tax document intake and checklist generation for CPA firms
- When modeling tax forms, schedules, and supporting documents in Django models
- When requiring auditable, repeatable outputs with verifiable prompts for Cursor AI
- When integrating with PostgreSQL-backed data stores and Django ORM patterns
Copyable .cursorrules Configuration
Framework: Django
Language: Python
Version: 3.11
Runtime: CPython
Stack: Django, PostgreSQL, Django REST Framework, Celery
Context: You are an AI assistant specialized in building tax document checklists for accounting firms. You operate within a Django project using PostgreSQL. Your outputs are deterministic, testable, and auditable. Do not request unnecessary permissions or access; keep secrets in environment vars.
CodeStyle: Black, isort
Architecture: Monorepo style with apps and api separated. Use Django apps: checklist, api, and workers. All data access via ORM; no raw SQL in business logic.
DirectoryRules: Project root contains manage.py, django_project, apps, api, templates, tests. Each app has models, serializers, views, and tests.
AuthenticationSecurity: DRF TokenAuthentication by default with HTTPS. CSRF enabled for session auth. Secrets stored in env vars; rotate keys regularly.
DatabaseORM: PostgreSQL with Django ORM. Models: Client, Engagement, TaxDocumentChecklist, TaxDocumentItem, TaxRule. Migrations used; schema migrations tracked.
TestingLinting: pytest-django for tests; pytest checks, flake8 or ruff for linting; pre-commit hooks enforce standards.
ProhibitedActionsAntiPatterns: Do not execute shell commands from prompts; do not bypass authentication; do not write raw SQL in business logic; avoid relying on mutable global state in AI prompts.
Recommended Project Structure
tax_project/
├── manage.py
├── tax_project/
│ ├── __init__.py
│ ├── settings.py
│ └── urls.py
├── apps/
│ ├── checklist/
│ │ ├── __init__.py
│ │ ├── models.py
│ │ ├── serializers.py
│ │ ├── views.py
│ │ ├── urls.py
│ │ └── tests/
│ └── api/
│ ├── serializers.py
│ ├── views.py
│ └── urls.py
├── templates/
├── requirements.txt
├── docker-compose.yml
└── Celeryfile
Core Engineering Principles
- Clear separation of concerns between data models, business rules, and presentation
- Data-driven rules with explicit inputs and outputs for Cursor AI
- Idempotent AI actions and deterministic outputs for auditability
- Privacy by design and least-privilege access to data
- Observability through structured logging, metrics, and test coverage
- Secure defaults and validated user input with strong type hints
Code Construction Rules
- Use Django ORM models with explicit field types and constraints
- All business logic in services modules, not in views or prompts
- Environment-based configuration; never store secrets in code
- API endpoints protected by DRF authentication and permission classes
- Migrations for all schema changes; tests should run against a test DB
- CI checks include lint, type checks, and unit tests
- Avoid hard-coded data; seed from fixtures or factories
Security and Production Rules
- HTTPS required; set SECURE_SSL_REDIRECT and CSRF protection
- Use Django's security middleware and content security policies
- Limit data exposure; return only necessary fields in APIs
- Rate limiting on API endpoints; monitor for anomalous requests
- Rotate credentials; store keys in a secrets manager or env
Testing Checklist
- Unit tests for models and serializers
- Integration tests for API endpoints using the Django test client
- End-to-end tests for the tax document checklist workflow
- Lint and type checks in CI; run pytest-django with coverage
- Static analysis to catch security and anti-patterns
Common Mistakes to Avoid
- Embedding business logic directly in views or prompts
- Relying on raw SQL for complex joins instead of ORM patterns
- Disabling CSRF or authentication for convenience in production
- Ignoring migrations and schema drift in production
- Skipping tests for critical tax workflow paths
Related implementation resources: AI Agent Use Case for Tax Advisors Using Client Documents to Identify Missing Tax Filing Information and Localized formatting to override LLM vocabulary biases.
FAQ
What is a Cursor Rules Template for Django tax checklist generators?
A Cursor Rules Template provides a structured copyable configuration that guides Cursor AI to generate tax document checklists within a Django PostgreSQL stack. It defines roles, style guides, architecture, and security practices so outputs are consistent, testable, and auditable.
Which stack is this template designed for?
This template targets Django with PostgreSQL, Django REST Framework for APIs, and Celery for background tasks. It emphasizes ORM usage, environment based configuration, and secure authentication suitable for accounting firm workflows.
How do I apply the .cursorrules block?
Copy the raw block under Copyable .cursorrules Configuration and paste it into the root of your Django project. Cursor AI will follow the defined rules to structure prompts, enforce style, and respect security constraints during generation.
What should I test to validate the generator?
Validate model integrity, API endpoints, and generated tax checklists. Include unit tests for models and serializers, integration tests for REST endpoints, and end-to-end tests for the full checklist workflow with realistic data.
What are common pitfalls to avoid?
Avoid embedding business logic in prompts, bypassing authentication, or writing raw SQL in core logic. Maintain migrations, use ORM efficiently, and ensure secret management and CI checks are in place.
How can I customize for a different tax jurisdiction or firm?
Extend the Django models and serializers to include jurisdiction, tax year, and client templates. Adjust Cursor Rules Template sections for prompts, data sources, and validation to reflect jurisdiction-specific requirements while keeping security and auditability intact.