# Firm Brain Sync

> Syncs the FirmBrain folder with the team's shared GitHub repo. Use when the user says "pull," "push," "sync the brain," "save my changes," or "get the latest from the team."

- Skill: `irfad7/firm-brain-sync` (Agent Skill)
- Install (CLI): `npx skillmds@latest add irfad7/firm-brain-sync`
- Raw SKILL.md: https://api.skillmd.com/api/skills/irfad7/firm-brain-sync/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: irfad7 (https://skillmd.com/u/irfad7)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/irfad7/firm-brain-sync

---


# Firm Brain Sync

A wrapper around `git pull` and `git push` so attorneys never have to learn git.

## What this skill does

When the user says one of these:

- **"pull"** / **"sync"** / **"get the latest"** → run `git pull origin main`, summarize what changed
- **"push"** / **"save my changes"** / **"share with the team"** → stage, commit, push the user's changes
- **"status"** / **"what's changed"** → run `git status` and report in plain English

## How to run a PULL

```bash
cd "$FIRMBRAIN_PATH"
git fetch origin
git pull origin main
```

After pulling:

1. Run `git log -p HEAD@{1}..HEAD --stat` to see what changed since their last pull
2. Report in plain English: "Your teammate Aliza added 2 new matter notes and updated the disqualifier list. Pulled."
3. List the changed files with one-line descriptions

If there's a merge conflict, **stop and ask the user**. Don't auto-resolve. Tell them which files conflict and what to do (usually: "open the file, look for `<<<<<<< HEAD`, pick which version to keep, save, then push").

## How to run a PUSH

```bash
cd "$FIRMBRAIN_PATH"
git status
```

1. If clean (no changes), say: "Nothing to push. Your brain is already in sync."
2. If there are changes:
   - Run `git add .`
   - Generate a commit message that summarizes the changes in plain English. Look at what files changed and what was added.
     - New matter note → `add notes for {matter-id}`
     - Edited skill → `update {skill-name} skill: {one-line reason}`
     - New template → `add {template-name} template`
     - Voice update → `tighten voice rules: {what changed}`
   - Run `git commit -m "{message}"`
   - Run `git push origin main`
3. Report back: "Pushed. Your teammates will see this on their next pull."

## How to run a STATUS

```bash
cd "$FIRMBRAIN_PATH"
git status
git log origin/main..HEAD --oneline
git log HEAD..origin/main --oneline
```

Report:

- What's changed locally (uncommitted)
- What's committed but not pushed
- What's been pushed by teammates but not pulled

In plain English: "You have 2 unsaved changes. Aliza has 1 new change you haven't pulled yet."

## Configuration

The skill reads `$FIRMBRAIN_PATH` from the environment. If not set, defaults to the current folder.

Each attorney configures this once during setup — usually in a `.env` file at the root of their FirmBrain folder, or via the firm's onboarding script.

## Never do

- Never `git push --force`
- Never `git reset --hard` without explicit user confirmation
- Never delete files the user didn't explicitly ask to delete
- Never resolve merge conflicts automatically — always ask
- Never commit `.env` files or anything in `secrets/`

## When something breaks

If `git pull` fails with "Please commit your changes or stash them before you merge":

1. Run `git status` to see what's modified
2. Ask the user: "You have local changes that haven't been pushed yet. Do you want to (1) push your changes first, (2) stash them and pull, or (3) discard them?"
3. Wait for their answer. Don't guess.

If `git push` fails with "Updates were rejected":

1. Run `git pull origin main --rebase`
2. Then retry `git push`
3. If still failing, stop and report to the user — there may be a real conflict.

