DEV Community

Pavan Kumar Sadashiv
Pavan Kumar Sadashiv

Posted on

Antigravity Rules

Please strictly adhere to the following rules and protocol for all GitLab issue resolution and Merge Request tasks in this conversation:


Antigravity Rules: Solving GitLab Issues & MRs

Core GitLab Workflow

  1. Fetch Context First: Use the GitLab MCP server tools to read the full issue description, labels, and discussion comments before writing any code.
  2. Plan Mode First: Always produce an implementation plan artifact for approval before modifying files or creating branches.
  3. Branch Isolation: Never commit to main or master. Always create a dedicated branch (e.g., fix/issue-<id>-<slug> or feature/issue-<id>) or use an isolated Git worktree.
  4. Link Issues & MRs: Always link issues in commit messages and MR descriptions (e.g., Closes #<issue_id>) to enable automatic issue closing upon merge.

🚫 Avoid These Practices

  1. Coding Blindly: Starting implementation without fetching the latest issue comments or discussion context from GitLab.
  2. Working on main / master: Making edits or pushing direct commits to protected branches.
  3. Manual Dumps: Pasting full CI logs, issue threads, or schemas into chat when MCP tools can read them directly.
  4. Vibe Merging: Merging or opening final MRs without local unit tests, linting, or checking CI pipeline status.
  5. Leaking Secrets: Committing tokens, GitLab PATs, or CI variables.
  6. Unrequested Scope Drift: Refactoring unrelated components while fixing a specific issue.
  7. One Giant Session: Trying to bundle multiple unrelated GitLab issues in one run.

✅ Follow These Instead

  1. Plan Mode: Explicitly break down the issue into actionable tasks (Root Cause Analysis -> Fix Strategy -> Test Plan).
  2. GitLab MCP Integration: Query issues, pipelines, and MR diffs directly via MCP tools.
  3. Subagents for Investigation: Use subagents for deep log/code searches to preserve context window space.
  4. Git Worktrees: Use isolated worktrees for multi-issue tasks to prevent stash/branch conflicts.
  5. Pre-commit Checks: Run local linters, formatters, and test suites prior to pushing.
  6. /code-review Before MR: Run /code-review on local diffs to verify quality before MR creation.
  7. Draft MR Strategy: Open a Draft MR (Draft: Fix issue #...) early for visibility.
  8. Automated CI Verification: Check .gitlab-ci.yml and verify pipeline health before marking MRs ready.

📋 Standard GitLab Issue Resolution Protocol

For every assigned issue:

  1. Fetch: Read full issue context via GitLab MCP.
  2. Branch: git checkout -b issue-<number>-<title>.
  3. Plan: Present the fix strategy, impacted files, and test plan for approval.
  4. Implement: Apply minimal, surgical changes matching existing codebase style.
  5. Test: Run unit/integration tests locally to verify the fix.
  6. Review: Run /code-review to validate diff cleanliness.
  7. Push & MR: Push the branch and create an MR targeting main containing Closes #<issue_id>.

Please acknowledge receipt of these rules and confirm you will follow this protocol for any upcoming GitLab tasks.

Top comments (0)