brainstack

engineer-brain — Command Reference

A living system that learns how you work, what you focus on, where you’re growing, and where you should push further. Produces actionable output for daily syncs and quarterly reviews.

Data Sources

  1. Git history across repos in your workspace
  2. GitHub activity via gh (authored PRs, reviews, releases/tags) — often more accurate than local commits alone
  3. BRAIN.md — the living document (located in the platform-specific directory or core/BRAIN.md)
  4. Session/conversation history (platform-specific: Cursor transcripts, Claude projects, etc.)
  5. Jira — Cursor: Atlassian MCP (marketplace plugin, required for sync). Other platforms: jira.sh when JIRA_URL, JIRA_EMAIL, and JIRA_API_TOKEN are set.
  6. Linear / other trackers (if integration available)

Critical: Standup-relevant work is frequently not in authored git commits. Reviews, releases, demos, meetup/office-hours prep, and design-feedback work must be pulled from GitHub/tracker/transcripts/BRAIN — not inferred from git log --author alone.


Commands

These commands can be invoked differently depending on your platform:


sync (daily standup helper)

Generate today’s standup notes.

Scope: Current team and current role only. Only include work from team repos / team activities in this workspace. Never reference past roles or personal/side projects — this is for your team’s standup thread. Repos listed in PERSONAL_REPOS inside scan.sh are excluded from team standup scope.

Schedule: Workdays only (Monday–Friday). If today is Monday, “yesterday” means last Friday. If today is a weekend, skip — standups don’t happen on weekends.

  1. Determine the lookback window based on the day of week:
    • Monday: Friday only — ignore weekend; 3-day scan, filter to Friday
    • Tuesday–Friday: scan last 1 day
    • Saturday/Sunday: tell the user “No standup today — it’s the weekend.” and stop.
      bash <path-to-scripts>/scan.sh "$HOME/path/to/workspace" [1 or 3]
      
  2. Also gather non-commit signals (scan.sh emits these when gh is authenticated and GH_OWNERS / RELEASE_REPOS are configured):
    • Authored PRs updated in the window
    • Reviews given in the window
    • Recent releases on configured repos
    • BRAIN.md upcoming events

2a. Calendar signal (gcal, optional but preferred when available):

2b. Jira signal (required on every sync):

2c. Platform note: Atlassian MCP is Cursor-only. Claude Code, Copilot, Windsurf, Aider, and Continue.dev use jira.sh for the Jira signal — see ONBOARDING.md Step 5.

  1. Read BRAIN.md for sprint context, active tickets, and scheduled team events (Upcoming Events table — the fallback when gcal isn’t configured).

  2. Generate standup notes as concise prose bullets, not a dump of every commit hash: ```
    1. What I worked on yesterday:
      • [Group related work into 1–3 readable bullets: reviews, features/tickets, releases, demos]
      • [Prefer impact language: “released X upstream”, “got TICKET ready for review”]
    2. What I plan on working on today:
      • [Carry-forward from open PRs + tracker In Progress/Review + BRAIN events]
      • [Include release follow-ups, meetup/demo prep, active review queue when relevant]
    3. Blockers:
      • None ```
  3. If the user corrects a sync (pastes their real standup, etc.), treat that as ground truth: update BRAIN.md sprint context, note missed signal types, and improve scanner config when the gap is systemic. Do not argue with the correction.

update (refresh the brain)

Re-scan everything and update BRAIN.md.

  1. Run the full scan for the last 30 days:
    bash <path-to-scripts>/scan.sh "$HOME/path/to/workspace" 30
    
  2. Read the current BRAIN.md.

  3. For each section in BRAIN.md, update with fresh data:
    • Active Repositories: re-count commits, update last-active dates
    • Expertise Map: reclassify based on new commits and file patterns
    • Work Patterns: recalculate commit type distribution and velocity
    • Current Sprint Context: update active branches and recent achievements
    • Growth Areas: check if any previous gaps have been addressed
    • Learning Log: add entries for new technologies or patterns encountered
    • Quarterly Template: append new accomplishments
  4. Write the updated BRAIN.md back.

  5. Print a summary of what changed: ```

    Brain Updated — [DATE]

    • X new commits since last update
    • New expertise signal: [if any new repo or tech area]
    • Velocity trend: [up/down/stable]
    • Growth checklist: X/Y items addressed ```

quarterly (performance review prep)

Generate quarterly performance review content.

Scope: Current quarter only (last 3 months), current team only. Only include work done in repos in this workspace. Do NOT reference past roles, past teams, or personal/side projects.

  1. Determine the current quarter boundaries and scan for that period:
    bash <path-to-scripts>/scan.sh "$HOME/path/to/workspace" 90
    
  2. Read BRAIN.md for context.

  3. Produce a structured quarterly document:
    ## Quarterly Review — [QUARTER] [YEAR]
    ### Team: [Your team name]
    
    ### Key Accomplishments
    [For each merged PR in the quarter, summarize impact in business language]
    [Group by theme: Security, Quality, DevEx, Performance, Features]
    
    ### Technical Impact (Numbers)
    - PRs merged: X across Y repos
    - Lines of code: +X / -Y
    - Test coverage added: X test files, Y test cases
    - Issues resolved: X
    
    ### Growth & Learning
    [What new skills were developed this quarter]
    [What areas did you stretch into]
    [Presentations, demos, knowledge sharing events]
    
    ### Cross-Team Collaboration
    [Repos contributed to beyond primary]
    [Reviews done for other team members]
    
    ### Goals for Next Quarter
    [Based on gap analysis from BRAIN.md growth roadmap]
    [Aligned with team priorities]
    

reflect (pattern analysis and feedback)

Analyze current patterns and provide actionable feedback.

  1. Run the scan for the last 30 days.
  2. Read BRAIN.md.
  3. Analyze and report:

    ## Reflection — [DATE]
    
    ### What You're Doing Well
    [Cite specific commits and patterns]
    
    ### Habit Observations
    - Work hours pattern: [when you're most productive]
    - Commit frequency: [daily average, consistency]
    - PR size tendency: [small/medium/large, recommendation]
    - Fix-to-feature ratio: [current ratio, ideal ratio]
    
    ### Blind Spots
    [Repos you have cloned but haven't touched]
    [Types of work you consistently skip]
    [Skills on your growth list that haven't progressed]
    
    ### Recommendations
    1. [Specific, actionable suggestion with reasoning]
    2. [Specific, actionable suggestion with reasoning]
    3. [Specific, actionable suggestion with reasoning]
    

jira (assigned tasks from Jira)

Fetch your assigned Jira issues, grouped by status.

Preferred in Cursor: Atlassian MCP (plugin-atlassian-atlassian) — see ONBOARDING.md Step 3 (installed copy: .engineer-brain/ONBOARDING.md or .cursor/skills/engineer-brain/ONBOARDING.md).

CLI fallback (terminals / non-MCP platforms):

Usage: jira [filter] [days]

Filters:

  1. Run:
    bash <path-to-scripts>/jira.sh [filter] [days]
    
  2. Display the output directly.

Required env vars: JIRA_URL, JIRA_EMAIL, JIRA_API_TOKEN

Integration with other commands:

scan (raw data refresh)

Just run the scanner and display results.

  1. Parse optional [days] argument (default: 7) and optional --json.
  2. Run:
    # Human / AI-readable text (default)
    bash <path-to-scripts>/scan.sh "$HOME/path/to/workspace" [days]
    
    # Structured JSON for dashboard, CI, or jq (#3) — requires python3
    bash <path-to-scripts>/scan.sh "$HOME/path/to/workspace" [days] --json
    bash <path-to-scripts>/scan.sh --json "$HOME/path/to/workspace" [days]
    
  3. Display the output directly (text), or pipe JSON to jq / a consumer:
    bash <path-to-scripts>/scan.sh "$HOME/path/to/workspace" 7 --json | jq '.velocity'
    

JSON notes: same sections as text mode (commits, branches, uncommitted, type_breakdown, files_touched, velocity, github). Personal repos stay in commits with "personal": true but are excluded from team velocity / type breakdown / files — matching text mode. See architecture.md.

doctor (brain health check)

Check the health and completeness of your engineering brain.

  1. Run the doctor script:
    bash <path-to-scripts>/doctor.sh "$HOME/path/to/workspace"
    
  2. Display the output directly to the user. Do not modify, summarize, or reformat the report.
  3. If the overall score is below 80%, suggest the user run engineer-brain update to improve data freshness.

watch (PR digest across repos)

Scan GitHub repos for open PRs and generate a prioritized digest.

Scope: All GitHub repos in the workspace (or specified repos). Requires the gh CLI to be installed and authenticated (gh auth login).

Usage: watch [--repos owner/repo,...] [--stale-days N] [--loop N]

Flags:

  1. Run:
    bash <path-to-scripts>/watch.sh "$HOME/path/to/workspace" [--repos ...] [--stale-days N] [--loop N]
    
  2. Display the output directly.

The script classifies each PR into buckets:

Output includes PR size labels (S/M/L/XL based on lines changed), age, idle time, author, and labels.

Integration with other commands:

gcal (calendar signal — read-only)

Google Calendar integration used mainly by sync (see step 2a above), but callable standalone. Generic and independent of Team Brain / Jira keys.

One-time setup: bash core/scripts/gcal.sh authorize --client-secrets <path> — see mcp/gcal/README.md.

Usage:

bash core/scripts/gcal.sh status                      # config status, no secrets
bash core/scripts/gcal.sh today [--json]               # today's events
bash core/scripts/gcal.sh upcoming [days] [--json]     # next N days (default 7)
bash core/scripts/gcal.sh range <since> <until> [--json]
bash core/scripts/gcal.sh calendars [--json]

If the platform supports MCP, prefer the gcal MCP server (mcp/gcal/) — same underlying client, agent-native tool calls (status, today, upcoming, events_range, list_calendars, authorize_instructions).


Hard Rules


Jira/Tracker Comment Formats

When asked to write a comment for a ticket tracker, use one of two formats:

short (default — quick status update)

Hi team,

[One-liner update summarizing the status, action taken, or decision made.]

Thank you!

in-depth (detailed update with structure)

Hi team,

**Updates:**
- [Update point 1]
- [Update point 2]
- [Update point 3]

**Next Steps:**
- [Action item 1]
- [Action item 2]
- [Action item 3]

Thank you!

Rules:


Auto-Learning Rules

When running update, apply these heuristics to evolve the brain:

Expertise Classification

Pattern Detection

Feedback Loop

After each update, compare current state against previous state:


Integration Points