Skip to content

Add operating-method, code-change-discipline, and ship-and-recover rules#319

Open
Sharrmavishal wants to merge 2 commits into
PatrickJS:mainfrom
Sharrmavishal:add-operating-kit-rules
Open

Add operating-method, code-change-discipline, and ship-and-recover rules#319
Sharrmavishal wants to merge 2 commits into
PatrickJS:mainfrom
Sharrmavishal:add-operating-kit-rules

Conversation

@Sharrmavishal

@Sharrmavishal Sharrmavishal commented Jun 22, 2026

Copy link
Copy Markdown

Three project-agnostic Cursor rules from operating-kit, a portable self-installing operating method for Claude Code and Cursor.

Rules added:

operating-method.mdc (alwaysApply: true)
Builder + strategic-vetting persona with hard gates: permission discipline, production-mutation pre-flight (Backup/Ownership/Blast-radius/Mechanism/Memory), scratch-test before prod, milestone gate, verify-don't-infer. References playbooks in docs/claude/ for teams that want the full context.

code-change-discipline.mdc (auto-attached on code globs)
Re-read the whole function before editing, treat bugs as hypotheses before fixing, stop and consolidate after 3 edits to one file, scan field-notes before deploying.

ship-and-recover.mdc (on-demand)
Deploy discipline: test > build > deploy > verify-live. Incident recovery: stabilize > confirm recovery point > recover one change at a time > verify > root-cause > mechanical fix > postmortem.

All three are project-agnostic and work standalone or alongside the full kit. The globs in code-change-discipline.mdc cover common source extensions and should be tuned per project.

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added new “operating method” guidance with non-skippable safety gates for permission discipline, production change pre-flights, scratch testing, and milestone evidence before marking work complete.
    • Added an automated code-change discipline rule that standardizes how edits are reviewed and how write/risk tracking is performed.
  • Documentation

    • Added a ship-and-recover playbook covering deployment sequencing (test → build → deploy → verify-live) and a step-by-step production incident response process, including checks for silent deploy failures and gated high-risk changes.

Three project-agnostic Cursor rules from operating-kit:
- operating-method: builder + strategic-vetting persona with hard gates, always-on
- code-change-discipline: re-read before edit, bug-as-hypothesis, 3-edit stop rule
- ship-and-recover: deploy discipline and production incident recovery

Each rule references playbooks in docs/claude/ for the full context.
Source: https://github.com/Sharrmavishal/operating-kit

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9c61f8ae-129c-4d5f-8ed8-fe35006a5af8

📥 Commits

Reviewing files that changed from the base of the PR and between a560f0d and 52c101b.

📒 Files selected for processing (3)
  • rules/code-change-discipline.mdc
  • rules/operating-method.mdc
  • rules/ship-and-recover.mdc
✅ Files skipped from review due to trivial changes (3)
  • rules/operating-method.mdc
  • rules/ship-and-recover.mdc
  • rules/code-change-discipline.mdc

📝 Walkthrough

Walkthrough

Three new Cursor MDC rule files are added: operating-method.mdc defines an always-on persona with seven hard-gate requirements; code-change-discipline.mdc provides a glob-triggered pre-edit checklist; and ship-and-recover.mdc documents deployment sequencing and incident recovery steps.

Changes

Cursor Operating Rules

Layer / File(s) Summary
Core operating-method rule
rules/operating-method.mdc
Defines the always-on builder + strategic-vetting persona and enumerates seven non-skippable hard gates: permission discipline, production write pre-flight, scratch-test-on-copy, mechanical safety/least-privilege, milestone evidence gate, verify-don't-infer, and blocked-response format. References related playbooks and a project-context document.
Code-change discipline checklist
rules/code-change-discipline.mdc
Adds a glob-triggered (non-always-on) rule with a pre-edit checklist: re-read whole function, treat bugs as hypotheses, stop and consolidate after three edits to the same file, trace writes to readers before semantic changes, and scan field-notes before deploy or build trust.
Ship-and-recover deployment/incident protocol
rules/ship-and-recover.mdc
Introduces a rule scoped to deploy/incident contexts defining the test → build → deploy → verify-live sequence, a five-step incident recovery flow, and an explicit pause-and-propose escalation gate for high-risk areas (crash paths, data, schema, auth, billing, prod state).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested reviewers

  • PatrickJS

Poem

🐇 Hop, hop, before you ship—
re-read the whole function, don't let bugs slip!
Three edits and pause, consolidate right,
trace writes to their readers in morning's first light.
Deploy only after the pre-flight is done,
and field-notes are scanned before trusting the run! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and clearly describes the main change: adding three new rules (operating-method, code-change-discipline, and ship-and-recover) to the repository.
Description check ✅ Passed The description covers all key template sections: a clear summary, contribution type (new rules), value explanation, file listing, and quality checklist items with appropriate formatting and detail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rules/operating-method.mdc`:
- Around line 28-36: The references to `@docs/claude/operating-principles.md`,
`@docs/claude/vigilance-protocol.md`, `@docs/claude/multi-model-collaboration.md`,
`@docs/claude/field-notes.md`, and `@docs/claude/incident-response.md` in the
operating-method.mdc file point to files that do not exist in the repository
since there is no docs/ directory. Either remove these broken references
entirely from the "Full playbooks" section, or replace them with references to
actual existing documentation or resources that are available in the repository.
Ensure all references in operating-method.mdc, ship-and-recover.mdc, and
code-change-discipline.mdc are consistent and point to valid locations.

In `@rules/ship-and-recover.mdc`:
- Around line 3-4: The rule file has an empty globs field while alwaysApply is
set to false, which violates the rule-frontmatter contract. Fix this by either
adding non-empty glob patterns to the globs field to specify when the rule
should trigger on-demand, or change alwaysApply to true if the rule is intended
to always be active.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8e5fc498-d9e3-48dd-8439-99bfca896187

📥 Commits

Reviewing files that changed from the base of the PR and between b044f95 and a560f0d.

📒 Files selected for processing (3)
  • rules/code-change-discipline.mdc
  • rules/operating-method.mdc
  • rules/ship-and-recover.mdc

Comment thread rules/operating-method.mdc Outdated
Comment thread rules/ship-and-recover.mdc Outdated
…dd globs to ship-and-recover

- Replace all @docs/claude/* references with direct GitHub URLs to the
  operating-kit source repo, since those files don't exist in this repo.
  The local @docs/ references apply when operating-kit is installed in
  a project; standalone these rules work without them.
- Add CI/deployment file globs to ship-and-recover.mdc to satisfy the
  frontmatter contract (alwaysApply: false requires non-empty globs).
  Globs cover GitHub Actions, Dockerfile, docker-compose, Makefile,
  and deploy/release scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant