1.7 KiB
1.7 KiB
Antigravity State Management & Git Worktree Rules
State Tracking & Persistent Memory
- Long-term Knowledge (MCP): Use the MCP memory graph strictly for long-term, persistent facts such as architectural decisions, environment invariants, SSH mappings, and user preferences.
- Transient State (Git): Do NOT write transient task progress (e.g., "currently editing line 42") to MCP memory. Continue to use verbose, incremental local
gitcommits to track short-term state and maintain rollback safety.
Branching Strategy & Workflow (Git Worktrees)
- Architecture: This environment utilizes Git Bare repositories with worktrees (e.g., a
.baredirectory alongside branch directories likemaster,feature-x). - Navigation Rule (CRITICAL): NEVER attempt to run tests, execute git commands, or invoke subagents against the root project folder or the
.baredirectory. ALWAYS navigate into the specific active worktree directory (e.g.,cd project-name/master). - Never Modify Master Directly: Do NOT make code modifications or dirty the working tree of the
masterormaindirectories. - Isolated Worktrees: Before beginning a new task, create an isolated sibling worktree directory for a new feature branch.
- Example: From inside
master/, rungit worktree add ../feat-my-new-task -b feat-my-new-task.
- Example: From inside
- Standard Workflow: Change directory into the newly created worktree (
cd ../feat-my-new-task) and make all verbose incremental commits there. - Cleanup: Once the task is complete, squashed, pushed, and merged, delete the local worktree branch (
git worktree remove ../feat-my-new-task). - Initialization: If the project is not using a bare worktree layout, invoke the
setup-bare-worktreeskill first.