Cursor rule
.cursor/rules/ADR.mdcArchitectural Decision Records
Cursor rules
Quality
50/100
Scores the file, not the repository.Length
1,253 words
27 headings · 1 code blocksRepository
47
— · pushed 336 days agoLast changed
3 days ago
First indexed 3 days ago.1234567# Architecture Decision Log89<!--10ADR_AGENT_PROTOCOL v1.01112You (the agent) manage this file as the single source of truth for all ADRs.1314INVARIANTS15- Keep this exact file structure and headings.16- All ADR entries use H2 headings: "## ADR-XXXX — <Title>" (4-digit zero-padded ID).17- Allowed Status values: Proposed | Accepted | Superseded18- Date format: YYYY-MM-DD19- New entries must be appended to the END of the file.20- The Index table between the INDEX markers must always reflect the latest state and be sorted by ID desc (newest on top).21- Each ADR MUST contain: Date, Status, Owner, Context, Decision, Consequences.22- Each ADR must include an explicit anchor `<a id="adr-XXXX"></a>` so links remain stable.2324HOW TO ADD A NEW ADR251) Read the whole file.262) Compute next ID:27 - Scan for headings matching: ^## ADR-(\d{4}) — .+$28 - next_id = (max captured number) + 1, left-pad to 4 digits.293) Create a new ADR section using the “New ADR Entry Template” below.30 - Place it AFTER the last ADR section in the file.31 - Add an `<a id="adr-XXXX"></a>` line immediately below the heading.324) Update the Index (between the INDEX markers):33 - Insert/replace the row for this ADR keeping the table sorted by ID descending.34 - Title in the Index MUST link to the anchor: [<Title>](#adr-XXXX)35 - If this ADR supersedes another: set “Supersedes” in this row, and update that older ADR:36 a) Change its Status to “Superseded”37 b) Add “Superseded by: ADR-XXXX” in its Consequences block38 c) Update the older ADR’s Index row “Superseded by” column to ADR-XXXX395) Validate before saving:40 - Exactly one heading exists for ADR-XXXX41 - All required fields are present and non-empty42 - Index contains a row for ADR-XXXX and remains properly sorted436) Concurrency resolution:44 - If a merge conflict or duplicate ID is detected after reading: recompute next_id from the current file state, rename your heading, anchor, and Index row accordingly, and retry once.4546COMMIT MESSAGE SUGGESTION47- "ADR-XXXX: <Short Title> — <Status>"4849END ADR_AGENT_PROTOCOL50-->5152## Index5354<!-- BEGIN:ADR_INDEX -->5556| ID | Title | Date | Status | Supersedes | Superseded by |57| ---- | ------------------------------------------------------------ | ---------- | -------- | ---------- | ------------- |58| 0004 | [Event-Driven Broker Architecture with Firestore](#adr-0004) | 2025-01-27 | Accepted | — | — |59| 0002 | [Monorepo Structure with Frontend and Backend](#adr-0002) | 2025-01-27 | Accepted | — | — |60| 0001 | [Full-Stack Firebase Template Architecture](#adr-0001) | 2025-01-27 | Accepted | — | — |6162<!-- END:ADR_INDEX -->6364---6566## New ADR Entry Template (copy for each new decision)6768> Replace placeholders, keep section headers. Keep prose concise.6970```7172## ADR-XXXX — \<Short, specific title>7374<a id="adr-XXXX"></a>75**Date**: YYYY-MM-DD76**Status**: Proposed | Accepted | Superseded77**Owner**: <Name>7879### Context8081<1–3 sentences: what changed or what forces drive this decision now>8283### Alternatives8485<Quick bullet list of alternatives considered, and why they were rejected.>8687### Decision8889\<Single clear decision in active voice; make it testable/verifiable>9091### Consequences9293* **Pros**: \<benefit 1>, \<benefit 2>94* **Cons / risks**: \<cost 1>, \<risk 1>95* **Supersedes**: ADR-NNNN (if any)96* **Superseded by**: ADR-MMMM (filled later if replaced)9798### (Optional) Compliance / Verification99100\<How we’ll check this is honored: tests, checks, fitness functions, runbooks>101102```103104---105106## ADR-0001 — Full-Stack Firebase Template Architecture107108<a id="adr-0001"></a>109**Date**: 2025-01-27 `110**Status**: Accepted111**Owner**: AI Agent112113### Context114115Modern web applications require both frontend and backend components with real-time data synchronization. Firebase provides a comprehensive platform for building full-stack applications, but setting up the architecture with best practices requires significant boilerplate code.116117### Alternatives118119- **Separate repositories**: Frontend and backend in different repos, harder to coordinate changes120- **Backend-only template**: Covers only server-side concerns, developers must handle frontend integration121- **Frontend-only template**: Limited to client-side Firebase SDK, missing serverless functions capabilities122- **Full-stack monorepo template**: Single template with both Next.js frontend and Python Firebase Functions123124### Decision125126Create a comprehensive full-stack Firebase template with:127128- Next.js 14 frontend with TypeScript and Material-UI129- Python Firebase Functions backend with broker architecture pattern130- Shared Firebase project configuration131- Integrated testing strategy for both frontend and backend132- Single repository with clear separation of concerns133134### Consequences135136- **Pros**: Complete starting point for Firebase projects, coordinated development, shared configuration137- **Cons / risks**: More complex initial setup, larger template size, requires knowledge of both frontend and backend138- **Supersedes**: —139- **Superseded by**: —140141### Compliance / Verification142143Template includes working examples for both frontend and backend. Firebase configuration shared between components. Documentation covers full development workflow.144145---146147## ADR-0002 — Monorepo Structure with Frontend and Backend148149<a id="adr-0002"></a>150**Date**: 2025-01-27151**Status**: Accepted152**Owner**: AI Agent153154### Context155156Full-stack Firebase applications need coordinated development between frontend (Next.js) and backend (Firebase Functions). The question was how to organize the code structure to support both independent development and shared configuration.157158### Alternatives159160- **Separate repositories**: Independent versioning but coordination overhead and duplicate configuration161- **Nested backend in frontend**: Simple structure but mixes concerns and complicates deployment162- **Side-by-side monorepo**: Clear separation with shared root configuration163164### Decision165166Implement side-by-side monorepo structure:167168- `/front/` - Next.js frontend application with its own package.json and dependencies169- `/back/` - Python Firebase Functions backend with its own requirements.txt and structure170- Root-level Firebase configuration (`firebase.json`, `firestore.rules`, `storage.rules`)171- Shared documentation in root README.md with component-specific READMEs172173### Consequences174175- **Pros**: Clear separation of concerns, independent tooling, shared Firebase configuration, coordinated documentation176- **Cons / risks**: Slightly more complex initial setup, need to manage two different development environments177- **Supersedes**: —178- **Superseded by**: —179180### Compliance / Verification181182Directory structure clearly separates frontend and backend. Firebase CLI recognizes backend functions source in configuration. Both components can be developed independently.183184---185186## ADR-0004 — Event-Driven Broker Architecture with Firestore187188<a id="adr-0004"></a>189**Date**: 2025-01-27190**Status**: Accepted191**Owner**: AI Agent192193### Context194195Modern full-stack applications require consistent data state between frontend and backend components. Traditional request-response patterns create tight coupling and require complex state synchronization logic. Real-time applications need immediate UI updates when data changes, regardless of the source of the change.196197### Alternatives198199- **Direct API communication**: Backend returns data directly to frontend, requires manual state management200- **Event streaming with external broker**: Use services like Redis Pub/Sub or RabbitMQ, adds infrastructure complexity201- **WebSocket connections**: Real-time but requires connection management and doesn't persist data202- **Firestore as event-driven broker**: Leverages built-in real-time capabilities and acts as single source of truth203204### Decision205206Implement event-driven broker architecture where Firestore serves as both the data store and event broker:207208- All data mutations flow through Firestore exclusively209- Backend functions save data to Firestore without returning responses to frontend210- Frontend subscribes to Firestore collections/documents using hooks for real-time updates211- Firestore acts as the single source of truth for both backend and frontend212- UI updates automatically through Firestore real-time listeners213214### Consequences215216- **Pros**: Eliminates data synchronization issues, automatic real-time updates, reduced coupling between frontend and backend, simplified state management, leverages Firebase's built-in capabilities217- **Cons / risks**: Increased Firestore read operations, requires proper security rules design, potential data consistency challenges with complex operations, network dependency for all data access218- **Supersedes**: —219- **Superseded by**: —220221### Compliance / Verification222223Backend functions must only perform Firestore writes without returning data responses. Frontend components must use Firestore hooks (useFirestore, real-time listeners) for all data access. No direct API data responses to frontend. All data mutations trigger UI updates through Firestore change events.224225---226
Also in agency-ai-solutions/nextjs-firebase-ai-coding-template
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| agency-ai-solutions/nextjs-firebase-ai-coding-template.cursor/rules/PRD.mdc · 47 | Cursor rules | database | 44/100 | 3 days ago | |
| agency-ai-solutions/nextjs-firebase-ai-coding-templateAGENTS.md · 47 | AGENTS.md | no sections | 16/100 | 3 days ago | |
| agency-ai-solutions/nextjs-firebase-ai-coding-templateback/.cursor/rules/ADR.mdc · 47 | Cursor rules | testtesting-strategygitdatabase | 52/100 | 3 days ago | |
| agency-ai-solutions/nextjs-firebase-ai-coding-templateback/.cursor/rules/backend-workflow.mdc · 47 | Cursor rules | teststyledo-notagent-behaviour | 69/100 | 3 days ago | |
| agency-ai-solutions/nextjs-firebase-ai-coding-templateback/.cursor/rules/folder-structure.mdc · 47 | Cursor rules | testarch | 52/100 | 3 days ago | |
| agency-ai-solutions/nextjs-firebase-ai-coding-templatefront/.cursor/rules/ADR.mdc · 47 | Cursor rules | teststylearchtypes+3 | 58/100 | 3 days ago | |
| agency-ai-solutions/nextjs-firebase-ai-coding-templatefront/.cursor/rules/folder-structure.mdc · 47 | Cursor rules | stylearchtypesapi+2 | 77/100 | 3 days ago | |
| agency-ai-solutions/nextjs-firebase-ai-coding-templatefront/.cursor/rules/workflow.mdc · 47 | Cursor rules | teststylesecurityapi+4 | 77/100 | 3 days ago |
Diff against .cursor/rules/PRD.mdc Diff against AGENTS.md Diff against back/.cursor/rules/ADR.mdc Diff against back/.cursor/rules/backend-workflow.mdc Diff against back/.cursor/rules/folder-structure.mdc Diff against front/.cursor/rules/ADR.mdc Diff against front/.cursor/rules/folder-structure.mdc Diff against front/.cursor/rules/workflow.mdc
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
