agentleFS
JustineDevsJustineDevs/Collection/.cursor/rules/production.mdc

Collection / rules

Cursor rule1 starsChanged 10 months agoMITView on GitHub

The standard way for production teams to connect frontend and backend branches and ensure integration before merging to main is to use temporary integration or "test" branches for local verification, automated testing, and code review.

  • Deletes or force-pushes

The file

We split this production.mdc into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 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.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If conflicts arise, they are resolved in the integration branch.

    line 13
  2. Distinctive:

    Code Review: Before merging into main, peer reviews ensure protocol alignment, documented API contracts, and integration readiness (API …

    line 19
  3. Distinctive:

    After passing all checks, the integration branch is merged into main.

    line 23
  4. Very specific:

    If issues are found post-merge, the main branch can be reset or reverted safely to its previous state using Git commands like git reset …

    line 24
  5. Distinctive:

    Use integration/testing branches to validate code before impacting production.

    line 29
  6. Distinctive:

    Keep clear API documentation so both frontend and backend teams know how data should flow, reducing integration bugs.

    line 31
  7. Distinctive:

    After merging to main, monitor for regressions and have a rollback plan (using Git reset/revert).

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
production.mdc
---
alwaysApply: true
description:The standard way for production teams to connect frontend and backend branches and ensure integration before merging to main is to use temporary integration or "test" branches for local verification, automated testing, and code review. 
---

Here’s how these roles and branches typically connect in Git workflows:

### How Frontend and Backend Branches Connect

- Each team (frontend, backend) works on their own branch, e.g., `frontend` and `backend`—sometimes even separate repositories.
- To test if the frontend and backend integrate correctly, a developer creates a new integration branch, e.g., `integration-test` or `merge-preview`, locally or on the remote.
- Both `frontend` and `backend` branches are merged into this integration branch. This is where manual, unit, and automated integration (E2E, CI/CD) tests are run against the combined codebase.
- If conflicts arise, they are resolved in the integration branch. No work goes to `main` (or `production`) until all issues are resolved and tested.

### Ensuring Frontend/Backend Work Together

- **Automated Testing:** Continuous Integration (CI) jobs can run post-merge checks on the integration branch. Common strategies include spinning up containers for both services to test the API/UI interactions.
- **Manual Verification:** Local testing is performed on the integration branch, running both frontend and backend servers to verify UI/API flows and features. This can include mock API servers if the backend is not updated, or stubbing endpoints.
- **Code Review:** Before merging into `main`, peer reviews ensure protocol alignment, documented API contracts, and integration readiness (API endpoints, response formats, environment variables).

### Merging to Main (Production)

- After passing all checks, the integration branch is merged into `main`.
- If issues are found post-merge, the main branch can be reset or reverted safely to its previous state using Git commands like `git reset --hard origin/main`.
- For large teams, feature branches (backend or frontend-specific) may queue merges through a shared development/staging branch before entering the main branch, following workflows like GitHub Flow, Trunk-Based, or GitFlow.

### Key Best Practices

- Use integration/testing branches to validate code before impacting production.
- Automate as much of the integration testing as possible via CI/CD, incorporating both unit and e2e tests.
- Keep clear API documentation so both frontend and backend teams know how data should flow, reducing integration bugs.
- After merging to main, monitor for regressions and have a rollback plan (using Git reset/revert).

This approach minimizes disruption, ensures frontend and backend work correctly together, and maintains production quality by catching integration bugs before merging to the main branch.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.