git_strategy

A set of Git rules for managing each Taskmaster task on its own branch and using a controlled commit and pull-request process.

In plain words
What is it for?
Creating task branches, writing focused Conventional Commits, opening pull requests, checking CI results, requiring review, and squash-merging into the main branch.
Why use it?
It prevents unrelated changes from being mixed together and keeps commits, reviews, tests, and merges consistent. It also requires confirmation before changes are committed and pushed.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/leonardsellem/readwise-vector-db/git_strategy
Clone the repo
git clone --depth 1 https://github.com/leonardsellem/readwise-vector-db

Made for: Cursor.

Per session 718 This file is loaded in full into every session.
When invoked 718 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00718 $0.00718
Opus 5 $0.00359 $0.00359
Sonnet 5 $0.00144 $0.00144
Haiku 4.5 $0.00072 $0.00072

Measured 2d ago against content hash bc84e9d05bf7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git_strategy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/git_strategy.mdc · 66 lines

What it actually says

  • 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 masterhotfix/<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.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 66 lines · 718 tokens per session scan A bc84e9d05bf7

Subscribe to this mod's changes

git_strategy is a cursor rule published in the GitHub repository leonardsellem/readwise-vector-db (24 stars, last pushed 1y ago), licensed MIT. It adds 718 tokens to every session, about $0.0036 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.