bigpowers / rules
Cursor rule252 starsChanged 3 months agoMITView on GitHub
Create an isolated Git worktree/branch or Jujutsu workspace, then verify a clean test baseline before code. Use when starting a feature or task.
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 repository165 other files it gives its agents.
- docs/AGENTS.mdAGENTS.md
- website/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- website/CLAUDE.mdCLAUDE.md
- .cursor/rules/align-grid.mdcCursor rule
- .cursor/rules/assess-impact.mdcCursor rule
- .cursor/rules/audit-code.mdcCursor rule
- .cursor/rules/audit-plan.mdcCursor rule
- .cursor/rules/build-epic.mdcCursor rule
- .cursor/rules/change-request.mdcCursor rule
- .cursor/rules/commit-message.mdcCursor rule
- .cursor/rules/compose-workflow.mdcCursor rule
- .cursor/rules/context7-mcp.mdcCursor rule
- .cursor/rules/craft-skill.mdcCursor rule
- .cursor/rules/deepen-architecture.mdcCursor rule
- .cursor/rules/define-language.mdcCursor rule
- .cursor/rules/define-success.mdcCursor rule
- .cursor/rules/delegate-task.mdcCursor rule
- .cursor/rules/deploy.mdcCursor rule
- .cursor/rules/design-interface.mdcCursor rule
- .cursor/rules/develop-tdd.mdcCursor rule
- .cursor/rules/diagnose-root.mdcCursor rule
- .cursor/rules/diagnose-stall.mdcCursor rule
- .cursor/rules/dispatch-agents.mdcCursor rule
- .cursor/rules/edit-document.mdcCursor rule
- .cursor/rules/elaborate-spec.mdcCursor rule
- .cursor/rules/enforce-first.mdcCursor rule
- .cursor/rules/evolve-skill.mdcCursor rule
- .cursor/rules/execute-plan.mdcCursor rule
- .cursor/rules/extract-design.mdcCursor rule
- .cursor/rules/find-way.mdcCursor rule
- .cursor/rules/fix-bug.mdcCursor rule
- .cursor/rules/gate-trace.mdcCursor rule
- .cursor/rules/generate-allure-report.mdcCursor rule
- .cursor/rules/grill-me.mdcCursor rule
- .cursor/rules/grill-with-docs.mdcCursor rule
- .cursor/rules/guard-git.mdcCursor rule
- .cursor/rules/harden-vps.mdcCursor rule
- .cursor/rules/hook-commits.mdcCursor rule
- .cursor/rules/inspect-quality.mdcCursor rule
- .cursor/rules/investigate-bug.mdcCursor rule
- .cursor/rules/maintain-wiki.mdcCursor rule
- .cursor/rules/map-codebase.mdcCursor rule
- .cursor/rules/migrate-spec.mdcCursor rule
- .cursor/rules/model-domain.mdcCursor rule
- .cursor/rules/orchestrate-project.mdcCursor rule
- .cursor/rules/organize-workspace.mdcCursor rule
- .cursor/rules/plan-refactor.mdcCursor rule
- .cursor/rules/plan-release.mdcCursor rule
- .cursor/rules/plan-tests.mdcCursor rule
- .cursor/rules/plan-work.mdcCursor rule
- .cursor/rules/publish-package.mdcCursor rule
- .cursor/rules/quick-fix.mdcCursor rule
- .cursor/rules/release-branch.mdcCursor rule
- .cursor/rules/request-review.mdcCursor rule
- .cursor/rules/research-first.mdcCursor rule
- .cursor/rules/reset-baseline.mdcCursor rule
- .cursor/rules/respond-review.mdcCursor rule
- .cursor/rules/run-benchmark.mdcCursor rule
- .cursor/rules/run-evals.mdcCursor rule
- The first 60 shown.
The file
We split this kickoff-branch.mdc into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 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.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Create an isolated Git worktree or Jujutsu workspace before code.
- Distinctive: line 23
Ask if not already known: "What's the name of this feature or task?" Use it as the branch name slug (kebab-case, max 40 chars).
- Very specific: line 27
Read state.yaml vcs.kind. For jj, do not run the Git blocks below: verify with jj status and jj log -r '::@' -n 5, create isolation with jj …
- Very specific: line 68
If not on $DEFAULT after checkout, stop and fix before continuing.
- Distinctive: line 72
Before creating the worktree, verify the target environment is clean:
- Very specific: line 86
Directory exists: If ../<task-slug> already exists, ask the user if they want to use it or delete it.
- Very specific: line 87
Branch exists: If the branch exists but no worktree is attached, ask to use the existing branch (git worktree add ../<task-slug> …
- Distinctive: line 98
If the user prefers a branch without a worktree:
- Distinctive: line 122
If locked: abort. If unlocked: entry added, proceed.
- Very specific: line 124
Run Preflight (from CLAUDE.md Commands table, or BP_PREFLIGHT from bash scripts/bp-read-agents.sh) and confirm green before writing any …
- Very specific: line 138
If Preflight is red, stop — route to quick-fix or fix-bug.
≈ “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: "Create an isolated Git worktree/branch or Jujutsu workspace, then verify a clean test baseline before code. Use when starting a feature or task."
alwaysApply: false
---
# story: e51s03
# story: e20s03
# story: e82s02
# Kickoff Branch
> **HARD GATE** — Direct Git work on `main`/`master` or reuse of an unrelated Jujutsu change is prohibited. Create a feature branch/worktree or Jujutsu workspace/change.
>
> **HARD GATE** — Do NOT proceed with development until **Preflight** passes on the default branch. Red Preflight blocks branch creation and all forward work — invoke `quick-fix` or `fix-bug` per CONVENTIONS § Discovered Defects.
Create an isolated Git worktree or Jujutsu workspace before code. **Preflight must be green** first — solo-default owns the whole tree.
## Process
### 1. Confirm task name
Ask if not already known: "What's the name of this feature or task?" Use it as the branch name slug (kebab-case, max 40 chars).
### 2. Select the VCS procedure
Read `state.yaml` `vcs.kind`. For `jj`, do not run the Git blocks below: verify with `jj status` and `jj log -r '::@' -n 5`, create isolation with `jj workspace add ../<task-slug> -r @`, then run `jj -R ../<task-slug> describe -m "feat: <task>"`. Record the new stable change ID. For `git`, continue below.
### 2a. Anchor Git on the default branch (main or master)
> **HARD GATE** — Git kickoff MUST start from an updated, clean default branch in the **primary** repository root (not a linked worktree).
```bash
# Detect default branch
DEFAULT=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo main)
git checkout "$DEFAULT"
git pull --ff-only origin "$DEFAULT" # skip if no remote
git status # working tree MUST be clean
git log --oneline -5
```
**Spec-only pre-kickoff** — before enforcing the clean-tree gate, check whether dirty files are spec artifacts:
```bash
DIRTY=$(git status --porcelain | awk '{print $2}')
NON_SPEC=$(echo "$DIRTY" | grep -v '^specs/' || true)
if [ -z "$DIRTY" ]; then
: # clean — proceed
elif [ -z "$NON_SPEC" ]; then
# spec-only dirty tree — offer auto-commit
echo "Dirty spec artifacts: $(echo $DIRTY | tr '\n' ' ')"
read -p "Commit spec artifacts before kickoff? [Y/n]: " CONFIRM
CONFIRM=${CONFIRM:-Y}
if [[ "$CONFIRM" =~ ^[Yy] ]]; then
git add specs/
git commit -m "chore(state): checkpoint before kickoff"
fi
else
echo "Dirty tree: $NON_SPEC (not a spec artifact). Stash or commit before proceeding."
exit 1
fi
```
- **Spec artifacts** match `specs/` — state.yaml, epics YAMLs, execution-status.yaml, etc.
- **Non-spec dirty files** (src/, scripts/, SKILL.md, …) still enforce the full clean-tree gate.
- If not on `$DEFAULT` after checkout, stop and fix before continuing.
### 3. Git pre-flight & conflict resolution
Before creating the worktree, verify the target environment is clean:
```bash
# 1. Check for existing directory
ls -d ../<task-slug> 2>/dev/null
# 2. Check for existing branch
git branch --list <task-slug>
# 3. Check for "ghost" worktrees (metadata exists but directory is gone)
git worktree list | grep "<task-slug>"
```
**Handling Conflicts:**
- **Directory exists:** If `../<task-slug>` already exists, ask the user if they want to use it or delete it.
- **Branch exists:** If the branch exists but no worktree is attached, ask to use the existing branch (`git worktree add ../<task-slug> <task-slug>`) or delete it.
- **Ghost worktree:** If `git worktree list` shows the path but the directory is missing, run `git worktree prune` to clear the stale metadata. `bash scripts/cleanup-worktrees.sh` does this plus reports any worktree whose branch is already merged or deleted — advisory only, it prints the `git worktree remove`/`git branch -d` commands rather than running them, so review before acting.
### 4. Create Git worktree + branch
```bash
# From the main repo root (not another worktree)
git worktree add ../<task-slug> -b <task-slug>
cd ../<task-slug>
```
If the user prefers a branch without a worktree:
```bash
git checkout -b <task-slug>
```
### 4. Verify clean baseline
> **HARD GATE (e39s02):** Acquire story lock in `specs/agent-locks.yaml` before running tests.
```bash
LOCK="specs/agent-locks.yaml"; STORY="<story-id>"
if [ -f "$LOCK" ]; then
python3 -c "
import yaml,sys,datetime
d=yaml.safe_load(open('$LOCK'))or{'locks':[]}
for l in d['locks']:
if l['story_id']=='$STORY':print(f'LOCKED by {l[\"locked_by\"]} at {l[\"locked_at\"]}');sys.exit(1)
d['locks'].append({'story_id':'$STORY','locked_by':'agent: build-epic','locked_at':datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ'),'files_touched':[]})
yaml.dump(d,open('$LOCK','w'),default_flow_style=False)
print(f'LOCK ACQUIRED: $STORY')
"
fi
```
If locked: abort. If unlocked: entry added, proceed.
Run **Preflight** (from `CLAUDE.md` Commands table, or `BP_PREFLIGHT` from `bash scripts/bp-read-agents.sh`) and confirm green before writing any code:
```bash
# Preflight — project's full local verification stack
# bigpowers example:
npm run compliance && bash scripts/run-verification-gates.sh
# Or project-specific from CLAUDE.md / AGENTS.md
```
- [ ] Preflight passes (all chained gates green)
- [ ] No type errors (`npm run typecheck` or equivalent, if not in Preflight)
- [ ] No lint errors (`npm run lint` or equivalent, if not in Preflight)
If Preflight is red, **stop** — route to `quick-fix` or `fix-bug`. Fix before kickoff continues.
### 5. Confirm readiness
Report: `✓ Preflight green` + branch + worktree. Suggest next: `develop-tdd` or `execute-plan`.
## Handoff
Gate: READY -> next: develop-tdd
Writes: state.yaml handoff.next_skill = develop-tdd
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.

