golid / rules
Cursor rule40 starsChanged 6 months agoMITView on GitHub
Use parallel subagents when auditing or editing 5+ independent files, the user asks to run in parallel, or plan-execution-loop dispatches parallel implement subagents
- Deletes or force-pushes
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository44 other files it gives its agents.
- .cursor/rules/audit-bugs.mdcCursor rule
- .cursor/rules/audit-codebase.mdcCursor rule
- .cursor/rules/ci-workflow.mdcCursor rule
- .cursor/rules/codebase-standards.mdcCursor rule
- .cursor/rules/common-commands.mdcCursor rule
- .cursor/rules/deploy-infra.mdcCursor rule
- .cursor/rules/document-module.mdcCursor rule
- .cursor/rules/dynamic-image-endpoints.mdcCursor rule
- .cursor/rules/dynamic-image-http.mdcCursor rule
- .cursor/rules/external-api.mdcCursor rule
- .cursor/rules/feature-flags.mdcCursor rule
- .cursor/rules/frontend-components-advanced.mdcCursor rule
- .cursor/rules/frontend-components.mdcCursor rule
- .cursor/rules/frontend-forms.mdcCursor rule
- .cursor/rules/frontend-lib.mdcCursor rule
- .cursor/rules/git-commits.mdcCursor rule
- .cursor/rules/go-handler.mdcCursor rule
- .cursor/rules/go-service-errors.mdcCursor rule
- .cursor/rules/go-service.mdcCursor rule
- .cursor/rules/iteration-surface.mdcCursor rule
- .cursor/rules/job-queue.mdcCursor rule
- .cursor/rules/observability.mdcCursor rule
- .cursor/rules/openapi.mdcCursor rule
- .cursor/rules/plan-execution-loop.mdcCursor rule
- .cursor/rules/plan-feature-execution.mdcCursor rule
- .cursor/rules/plan-feature.mdcCursor rule
- .cursor/rules/plan-infra.mdcCursor rule
- .cursor/rules/planning-standards.mdcCursor rule
- .cursor/rules/refactor-large-files.mdcCursor rule
- .cursor/rules/rename-tool.mdcCursor rule
- .cursor/rules/seed-data.mdcCursor rule
- .cursor/rules/slice-and-ship.mdcCursor rule
- .cursor/rules/solidjs-data-fetching.mdcCursor rule
- .cursor/rules/solidjs-pages.mdcCursor rule
- .cursor/rules/solidstart-routing.mdcCursor rule
- .cursor/rules/sql-migrations.mdcCursor rule
- .cursor/rules/sse-realtime.mdcCursor rule
- .cursor/rules/workflow-routing.mdcCursor rule
- .cursor/rules/write-rules.mdcCursor rule
- .cursor/rules/write-tests-e2e.mdcCursor rule
- .cursor/rules/write-tests-frontend.mdcCursor rule
- .cursor/rules/write-tests-frontend-workflow.mdcCursor rule
- .cursor/rules/write-tests.mdcCursor rule
- .cursor/rules/write-tests-planning.mdcCursor rule
The file
We split this parallel-subagents.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
- Distinctive: line 16
When a task involves auditing or editing 5+ independent files, prefer parallel subagents over sequential tool calls.
- Very specific: line 40
Before dispatching, rg the plans/specs for file paths each subagent will touch.
- Distinctive: line 52
Use the fast model for mechanical renames.
- Distinctive: line 56
If subagents will branch, commit, or otherwise touch git state:
- Very specific: line 67
Run verification searches (rg) to confirm all changes applied and no regressions introduced.
- Distinctive: line 68
If cherry-picking: build, vet, lint, and run the full test suite (not just touched packages) — cross-cutting refactors silently break …
- Distinctive: line 71
If a subagent failed due to content mismatch, read the file and fix manually.
≈ “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.
Files
--- description: Use parallel subagents when auditing or editing 5+ independent files, the user asks to run in parallel, or plan-execution-loop dispatches parallel implement subagents alwaysApply: false --- # Parallel Subagents for Multi-File Operations > **Thesis:** Sequential edits across many files waste time and lose context. Split independent work across subagents, verify after completion. ## When to invoke - **5+ independent files** — auditing or editing across many files with no ordering dependencies between them - **User request** — the user explicitly asks to run work in parallel or use subagents - **Plan parallel slices** — `plan-execution-loop` dispatches parallel implement subagents for a multi-file slice When a task involves **auditing or editing 5+ independent files**, prefer parallel subagents over sequential tool calls. If changes have ordering dependencies, keep dependent steps sequential. ## When to parallelize - **Audits**: searching for patterns, checking consistency, or reviewing code across 5+ files - **Edits**: renaming, fixing stale references, or applying the same pattern across 5+ files - **Mixed**: audit first (parallel), then edit (parallel) based on findings ## How to split work Group files by **independence** — changes that don't depend on each other go in separate subagents. Max 4 concurrent subagents. Good splits: - By layer: Docker/infra files | source code | documentation | config - By concern: backend changes | frontend changes Bad splits: - Putting a TSX file and its CSS file in different subagents (coordinated rename) - Splitting a function definition from its callers ## Pre-flight: predict shared-file collisions Before dispatching, `rg` the plans/specs for file paths each subagent will touch. Flag any file appearing in 2+ subagents — typically `openapi.yaml`, module `spec.md` files, shared type files (`frontend/src/lib/api.ts`, `frontend/src/lib/constants.ts`), barrels, `internal/wire/routes.go`. These cause cherry-pick conflicts. For each shared file, decide upfront: which subagent owns which section? Tell each subagent explicitly to make **additive** edits (new sections, new contiguous blocks) and **not restructure** unrelated content. Textual diffs that touch different lines in the same file merge cleanly; restructured files do not. ## Subagent instructions Each subagent prompt must include: 1. The exact files to read/edit 2. The specific changes to make (before/after values, line numbers if known) 3. "Read each file before editing to verify exact content" Use the fast model for mechanical renames; default model for changes requiring judgment. ## When subagents will commit code If subagents will branch, commit, or otherwise touch git state: - **Worktree isolation is mandatory.** Each subagent gets its own `git worktree`. NEVER let a subagent operate directly in the parent repo (e.g., `/workspace`). - **Forbid destructive git ops on the parent repo.** Explicitly tell every subagent: do NOT run `git reset --hard`, `git clean -fd`, `git stash drop`, or `git checkout --force` outside their assigned worktree. A previous incident lost uncommitted user edits this way. - **Forbid `git add -A`** — subagents must explicitly add only the files they changed, so untracked user state in the parent isn't accidentally swept in. - **Isolate cross-cutting touches in a final commit.** When two subagents both edit shared files (openapi, specs, barrels), instruct each to put those edits in one dedicated final commit. Conflicts then land in one focused commit instead of mixed in with functional changes — much faster to resolve. This is the one legitimate exception to the "one logical change per commit" rule in `git-commits` — see "Parallel Shared-File Exception" there for what qualifies and what doesn't. Name it `chore: sweep-up shared-file edits from <batch-name>` and list the per-feature mapping in the body. - **Cherry-pick order matters when collisions are expected.** Land the smaller / more additive branch first; the larger restructure second. The restructuring commit then carries the burden of merging the smaller changes into its new layout. - **Cherry-pick ONE commit at a time when bringing back a worktree branch.** Bulk `git cherry-pick A B C D ...` will sometimes fail at commit 3+ with a phantom `Your local changes to the following files would be overwritten by merge` error against files that are demonstrably clean (`git status` shows nothing, `git diff HEAD` is empty). The bulk run aborts and silently rolls back commits that already landed, leaving a partial state that builds with mysterious missing-method errors. A simple loop (`for sha in A B C D ...; do git cherry-pick $sha; done`) avoids this entirely. ## After subagents complete 1. Run verification searches (`rg`) to confirm all changes applied and no regressions introduced. 2. If cherry-picking: build, vet, lint, and run the full test suite (not just touched packages) — cross-cutting refactors silently break unrelated callers. 3. Clean up worktrees and feature branches (`git worktree remove`, `git branch -D`) once changes are landed. Stale worktrees confuse future subagent dispatches. If a subagent failed due to content mismatch, read the file and fix manually.
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
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.

