Skip to content

Practical patterns, starters & CLI tools for loop engineering with AI coding agents. Design systems that prompt and orchestrate agents (inspired by Addy Osmani and Boris Cherny). Includes loop-audit, loop-init, loop-cost.

feat(examples): add Cursor post-merge cleanup doc (#268)

Muhammad Zeshan Malik09dbcaf9c3c4
diff --git a/examples/README.md b/examples/README.md
index fa4b6ab..7f09e12 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -26,7 +26,7 @@ Start with [primitives-matrix.md](../docs/primitives-matrix.md) to map capabilit
| Daily Triage | [grok/daily-triage.md](./grok/daily-triage.md) | [claude-code/daily-triage.md](./claude-code/daily-triage.md) | [codex/daily-triage.md](./codex/daily-triage.md) | [openclaw/daily-triage.md](./openclaw/daily-triage.md) | [cursor/daily-triage.md](./cursor/daily-triage.md) | [windsurf/daily-triage.md](./windsurf/daily-triage.md) | [opencode/daily-triage.md](./opencode/daily-triage.md) | [hermes/daily-triage.md](./hermes/daily-triage.md) | [github-actions/daily-triage.yml](./github-actions/daily-triage.yml) |
| PR Babysitter | [grok/pr-babysitter.md](./grok/pr-babysitter.md) | [claude-code/pr-babysitter.md](./claude-code/pr-babysitter.md) | [codex/pr-babysitter.md](./codex/pr-babysitter.md) | [openclaw/pr-babysitter.md](./openclaw/pr-babysitter.md) | [cursor/pr-babysitter.md](./cursor/pr-babysitter.md) | [windsurf/pr-babysitter.md](./windsurf/pr-babysitter.md) | [opencode/pr-babysitter.md](./opencode/pr-babysitter.md) | [hermes/pr-babysitter.md](./hermes/pr-babysitter.md) | [github-actions/pr-babysitter.yml](./github-actions/pr-babysitter.yml) |
| CI Sweeper | [grok/ci-sweeper.md](./grok/ci-sweeper.md) | [claude-code/ci-sweeper.md](./claude-code/ci-sweeper.md) | [codex/ci-sweeper.md](./codex/ci-sweeper.md) | [openclaw/ci-sweeper.md](./openclaw/ci-sweeper.md) | — | — | [opencode/ci-sweeper.md](./opencode/ci-sweeper.md) | — | [github-actions/ci-sweeper.yml](./github-actions/ci-sweeper.yml) |
-| Post-Merge Cleanup | [grok/post-merge-cleanup.md](./grok/post-merge-cleanup.md) | [claude-code/post-merge-cleanup.md](./claude-code/post-merge-cleanup.md) | [codex/post-merge-cleanup.md](./codex/post-merge-cleanup.md) | [openclaw/post-merge-cleanup.md](./openclaw/post-merge-cleanup.md) | — | — | [opencode/post-merge-cleanup.md](./opencode/post-merge-cleanup.md) | — | [github-actions/post-merge-cleanup.yml](./github-actions/post-merge-cleanup.yml) |
+| Post-Merge Cleanup | [grok/post-merge-cleanup.md](./grok/post-merge-cleanup.md) | [claude-code/post-merge-cleanup.md](./claude-code/post-merge-cleanup.md) | [codex/post-merge-cleanup.md](./codex/post-merge-cleanup.md) | [openclaw/post-merge-cleanup.md](./openclaw/post-merge-cleanup.md) | [cursor/post-merge-cleanup.md](./cursor/post-merge-cleanup.md) | — | [opencode/post-merge-cleanup.md](./opencode/post-merge-cleanup.md) | — | [github-actions/post-merge-cleanup.yml](./github-actions/post-merge-cleanup.yml) |
| Dependency Sweeper | [grok/dependency-sweeper.md](./grok/dependency-sweeper.md) | [claude-code/dependency-sweeper.md](./claude-code/dependency-sweeper.md) | [codex/dependency-sweeper.md](./codex/dependency-sweeper.md) | [openclaw/dependency-sweeper.md](./openclaw/dependency-sweeper.md) | [cursor/dependency-sweeper.md](./cursor/dependency-sweeper.md) | — | [opencode/dependency-sweeper.md](./opencode/dependency-sweeper.md) | — | [github-actions/dependency-sweeper.yml](./github-actions/dependency-sweeper.yml) |
| Changelog Drafter | [grok/changelog-drafter.md](./grok/changelog-drafter.md) | [claude-code/changelog-drafter.md](./claude-code/changelog-drafter.md) | [codex/changelog-drafter.md](./codex/changelog-drafter.md) | [openclaw/changelog-drafter.md](./openclaw/changelog-drafter.md) | — | — | [opencode/changelog-drafter.md](./opencode/changelog-drafter.md) | — | [github-actions/changelog-drafter.yml](./github-actions/changelog-drafter.yml) |
| Issue Triage | [grok/issue-triage.md](./grok/issue-triage.md) | [claude-code/issue-triage.md](./claude-code/issue-triage.md) | [codex/issue-triage.md](./codex/issue-triage.md) | [openclaw/issue-triage.md](./openclaw/issue-triage.md) | — | — | [opencode/issue-triage.md](./opencode/issue-triage.md) | — | [github-actions/issue-triage.yml](./github-actions/issue-triage.yml) |
diff --git a/examples/cursor/README.md b/examples/cursor/README.md
index 03168aa..479ccc2 100644
--- a/examples/cursor/README.md
+++ b/examples/cursor/README.md
@@ -8,6 +8,7 @@ Copy-pasteable loop patterns for Cursor, using **Automations** (cloud cron) or m
| Constraints | Every loop run (before triage) | Low | [constraints.md](constraints.md) |
| PR Babysitter | On cadence (Automation or manual) | Medium | [pr-babysitter.md](pr-babysitter.md) |
| Dependency Sweeper | 6h report, patch-only after tuning | Medium | [dependency-sweeper.md](dependency-sweeper.md) |
+| Post-Merge Cleanup | 1d (Automation or manual) | Low | [post-merge-cleanup.md](post-merge-cleanup.md) |
No `loop-init --tool cursor` yet — copy `SKILL.md` + `STATE.md` from any starter (e.g. `starters/minimal-loop`), then follow the example to wire scheduling.
diff --git a/examples/cursor/post-merge-cleanup.md b/examples/cursor/post-merge-cleanup.md
new file mode 100644
index 0000000..921dee5
--- /dev/null
+++ b/examples/cursor/post-merge-cleanup.md
@@ -0,0 +1,67 @@
+# Post-Merge Cleanup — Cursor (Automations / Agent)
+
+This is a practical, copy-pasteable example of a post-merge cleanup loop using Cursor.
+
+Cursor has no native `/loop` scheduler. Map the loop to a **Cloud Automation** (cron) or trigger manually in Agent chat on cadence.
+
+## Automation prompt (week one — report only)
+
+In Cursor → Automations, create a job with a prompt like:
+
+```text
+Run the post-merge-scan skill on recent merges to main in the last 48h.
+Update post-merge-state.md.
+Do not modify source code or open PRs in week one — report only.
+Flag anything ambiguous or high-risk for human review in post-merge-state.md.
+```
+
+Or invoke manually in Agent chat with the same prompt on your chosen cadence.
+
+## Progression
+
+- **Week one — report only.** Just update `post-merge-state.md`. Review it manually before making changes.
+- **Add docs-only/low-risk fixes.** Extend the automation to draft minimal fixes (documentation updates, comment fixes, or simple lint corrections) in an isolated worktree for allowlisted low-risk files.
+- **Add verifier approval.** Use a separate verifier agent/step to ensure docs-only/low-risk fixes are correct before committing/pushing.
+- **Add ticket integration.** Wire ticket/issue creation via GitHub/Linear MCP for larger architectural tasks that shouldn't be auto-fixed.
+
+## Requirements
+
+- `post-merge-state.md` in the repo root (copy from [post-merge-state.md.example](../../starters/post-merge-cleanup/post-merge-state.md.example))
+- The `post-merge-scan` skill in `.cursor/skills/post-merge-scan/SKILL.md` (copy from `starters/post-merge-cleanup/.claude/skills/post-merge-scan/SKILL.md` or similar)
+- A `verifier` skill in `.cursor/skills/verifier/SKILL.md` (copy from `templates/SKILL.md.verifier`) for L2 docs-only fixes
+- Cloud Automation for unattended cadence — manual Agent chat works for week one
+
+## Example post-merge-state.md
+
+```markdown
+# Post-Merge Cleanup State — Project X
+Last run: 2026-07-06 23:00 UTC
+Status: report-only (week 1)
+
+## Pending Cleanup (from recent merges)
+- [ ] PR #456 merged — update API docs for new user fields
+ Source: commit def4567, line 82 in docs/api.md
+ Risk: low | Effort: small
+- [ ] PR #452 merged — clean up deprecated config warning message
+ Source: commit abc1234, line 12 in config/settings.ts
+ Risk: low | Effort: small
+
+## Completed (last 14d)
+- (none)
+
+## Deferred (human decision)
+- PR #448 merged — database schema refactor deferred; ticket ENG-1005 created
+
+## Denylist paths
+- auth/
+- payments/
+- infra/
+```
+
+## Notes
+
+- Run off-peak (overnight / off-hours) to avoid colliding with active development branch builds.
+- Combine with `.cursor/rules/` for always-on constraints across all Agent sessions.
+- See [patterns/post-merge-cleanup.md](../../patterns/post-merge-cleanup.md) and [starters/post-merge-cleanup/](../../starters/post-merge-cleanup/) for the full pattern spec.
+
+See the [primitives matrix](../../docs/primitives-matrix.md) for how Cursor maps to the same six-part loop shape.