agentleFS
leonardsellemleonardsellem/readwise-vector-db/.cursor/rules/git_strategy.mdc

readwise-vector-db / rules

Cursor rule24 starsChanged 17 months agoMITView on GitHub

- Branch-per-Task (BPT) strategy - For every Taskmaster task create a dedicated branch: task-<id>-<slug> (e.g. task-17-api-metrics-fix). - Base the branch on master (or the active feature tag’s branch if using tags).

  • Commits and pushes

The file

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

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask the user for “OK to commit & push?” before every commit.

    line 13
  2. Very specific:

    If *yes*: git commit -m "<Conventional Commit>" then git push -u origin <branch>.

    line 14
  3. Distinctive:

    If *no*: keep refining until approval.

    line 15
  4. Very specific:

    Use Conventional Commits (feat:, fix:, docs:, chore:, …).

    line 19
  5. Distinctive:

    Keep branch up-to-date via git pull --rebase origin master.

    line 44
  6. Distinctive:

    If a feature spans several Taskmaster tasks:

    line 48
  7. Very specific:

    Create an umbrella branch feature/<name> forked from master.

    line 49
  8. Distinctive:

    Only CI/CD or release scripts create annotated tags (git tag -a vX.Y.Z -m ...).

    line 57
  9. Distinctive:

    Keep CHANGELOG updated via Changesets if public releases are cut.

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 7,111 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
git_strategy.mdc
---
description:
globs:
alwaysApply: true
---
- **Branch-per-Task (BPT) strategy**
  - For every Taskmaster task create a dedicated branch:
    `task-<id>-<slug>` (e.g. `task-17-api-metrics-fix`).
  - Base the branch on `master` (or the active feature tag’s branch if using tags).

- **Explicit confirmation before committing**
  - Stage (`git add -A`) **only after tests pass locally**.
  - Ask the user for “OK to commit & push?” before every commit.
    - If *yes*: `git commit -m "<Conventional Commit>"` then `git push -u origin <branch>`.
    - If *no*: keep refining until approval.

- **Atomic, Conventional Commits**
  - One logical change per commit; do not mix refactors with new features.
  - Use Conventional Commits (`feat:`, `fix:`, `docs:`, `chore:`, …).
  - Include Task ID in the footer:
    ```
    feat(api): add /metrics endpoint

    Task: #12
    ```

- **Pull-Request & Merge rules**
  - Open a PR as soon as the first commit is pushed (draft OK).
  - CI must be green (lint, type-check, tests, coverage ≥90 %) before PR can be marked ready.
  - At least one approving review required.
  - **Squash-merge** into `master` to keep history linear; PR title becomes squash commit.

- **CI/CD pipeline tie-ins**
  - `push` or `pull_request` on any branch triggers the **CI matrix** (`.github/workflows/ci.yml`):
    1. Ruff / Black / Mypy linters
    2. Pytest + coverage gate (≥90 %)
    3. Optional perf job (`make perf`) on nightly cron
  - `push` on `master` (post-merge) additionally:
    - Builds & pushes the Docker image to GHCR
    - Uploads nightly `pg_dump` backup artifacts
  - Semantic version tag (`v*.*.*`) triggers Vercel/Supabase deploy workflow when those features land (Task 18).

- **Rebasing & Syncing**
  - Keep branch up-to-date via `git pull --rebase origin master`.
  - Resolve conflicts locally; re-run full test suite before pushing.

- **Large / risky features**
  - If a feature spans several Taskmaster tasks:
    - Create an umbrella branch `feature/<name>` forked from `master`.
    - Open PR targeting `master`, then stack task branches on top and merge sequentially.

- **Emergency fixes**
  - Branch from `master` → `hotfix/<issue>`
    - Fast-track through CI; reviewers may approve retrospectively if blocking production.

- **Tag discipline**
  - Only CI/CD or release scripts create annotated tags (`git tag -a vX.Y.Z -m ...`).

- **Pre-commit hooks (guard rails)**
  - `poetry run pre-commit install` on first clone.
  - Hooks block pushes that violate formatting or lint rules.

- **Documentation & traceability**
  - Link PRs to Taskmaster tasks (`Fixes TM-#<id>`) so the bot can automatically close them.
  - Keep CHANGELOG updated via Changesets if public releases are cut.

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.