How to share agentic coding artifacts with your teammates

Maybe it’s just me, but it feels like most of the agentic coding tools out there are single-player. An individual developer engages in a coding session with one or more agents, and the non-code “exhaust” (scratch files, harness-generated session docs) stays on the local machine. Oh sure, the code gets checked into a team-visible repo, and git commit body should list all the key changes. But are teammates losing out on the “thinking” that went on during that individual coding session? Maybe those core details are in a requirements/design doc somewhere, assuming people still write those! But how are teams of developers collaborating nowadays with all this agentic coding going on? Are we sharing those session-level artifacts and creating a team “brain”?

I wondered if there was an easy way to take my Google Antigravity session artifacts and make them part of my commits. By default, any session/conversation docs—implementation plans, walkthroughs, chat transcripts—live in a machine folder. But I want those dragged into my local project folder so that they’re automatically pulled into commits, and thus visible to teammates. Then, teammates can use their own harness to understand my thinking or how I arrived at a certain decision for my code contribution.

So I wrote an agent skill. It includes a Python script that explicitly moves the files when the coding session is done. The script does a git add of those files, including the full (and summary) session transcript. Specific to Antigravity, you might also build a sidecar, or something that runs in the background and continuously works. But this was a simpler choice.

Let’s walk through the key bits. And then I’ll show it in action.

In a hidden .agents folder, I’ve got an AGENTS.md file, a skills folder that contains a skill named team-sync, and then a SKILL.md along with a Python script used by the skill.

We’ll start with the SKILL.md. It fires up as the agent finishes artifacts, and when explicitly triggered by the user.

---
name: team-sync
description: Synchronizes local Antigravity conversation history, transcripts, and artifacts (including a light summary) to the project repository for team sharing.
---

# Team-Sync Custom Skill

Use this skill to archive and upload your conversation's transcripts, artifacts, and a "light" human-readable summary into the Git repository, allowing other team members to quickly catch up on your agent steps, decisions, and outcomes.

## When to Use
* Call this skill when a coding task, implementation plan, or refactoring conversation has finished successfully.
* Run it before opening a Pull Request so that reviewers can inspect the execution logs and the conversation summary.

## Instructions for the Agent
1. **Generate the Light Transcript (`summary.md`):**
   Create a file named `summary.md` in your local brain directory. The summary must follow this structure:

   ```markdown
   # Conversation Summary: [Objective/Topic]
   * **Date:** [Current Date]
   * **Conversation ID:** [ANTIGRAVITY_CONVERSATION_ID]

   ## TL;DR
   [A 1-2 sentence high-level summary of what was accomplished]

   ## Key Decisions & Rationale
   * **Decision:** [e.g., Using Python's shutil instead of bash commands]
     * **Why:** [e.g., Cross-platform safety and better permission handling]

   ## Most Interesting Event / "Aha" Moment
   [Capture any major back-and-forth conversation, user course corrections, pivot points, or model/user "aha" moments that defined the flow of this conversation.]

   ## Scope of Changes
   * **Files Modified/Created:** [List of files]
   * **Verification:** [How the changes were validated, command outputs, etc.]

   ## Learnings & Gotchas for the Team
   * [Any lessons learned about the API, codebase, or environment that others should know]
   ```

2. **Verify Environment:**
   Ensure `ANTIGRAVITY_CONVERSATION_ID` is set in the environment.

3. **Execute Sync Script:**
   Run the sync helper script:
   ```bash
   python3 .agents/skills/team-sync/scripts/sync.py
   ```
   *Note: Because `sync.py` automatically copies all `.md` files, your newly created `summary.md` will be synced to the workspace repository automatically.*

4. **Report Status:**
   Confirm to the user that the summary and files have been successfully synced.

The Python script does the work of actually copying files from Antigravity’s “brain” folder into my local project folder.

#!/usr/bin/env python3
import os
import sys
import shutil
import subprocess
from pathlib import Path

def get_project_root() -> Path:
    # Find project root by looking for .agents or .git starting from CWD
    current = Path.cwd().resolve()
    for parent in [current] + list(current.parents):
        if (parent / ".agents").is_dir() or (parent / ".git").is_dir():
            return parent
    return current

def find_most_recent_conversation(brain_root: Path) -> str:
    """Finds the most recently modified conversation subdirectory in the brain cache."""
    if not brain_root.is_dir():
        return None
    
    subdirs = []
    for p in brain_root.iterdir():
        # Conversation directories are 36-char UUIDs (plus optional custom name directories)
        if p.is_dir() and p.name != "scratch":
            try:
                mtime = p.stat().st_mtime
                subdirs.append((mtime, p.name))
            except OSError:
                continue
                
    if not subdirs:
        return None
    
    # Sort by modification time, newest first
    subdirs.sort(key=lambda x: x[0], reverse=True)
    return subdirs[0][1]

def check_git_installed() -> bool:
    """Checks if git command-line tool is installed and available in PATH."""
    return shutil.which("git") is not None

def main():
    print("=== Antigravity Team Sync ===")
    
    home_dir = Path.home()
    brain_root = home_dir / ".gemini" / "antigravity" / "brain"
    
    # 1. Retrieve conversation ID from environment or fallback
    conv_id = os.environ.get("ANTIGRAVITY_CONVERSATION_ID")
    if not conv_id:
        print("Notice: ANTIGRAVITY_CONVERSATION_ID env variable is not set.", file=sys.stderr)
        print("Attempting to auto-detect the most recent local conversation...", file=sys.stderr)
        conv_id = find_most_recent_conversation(brain_root)
        
        if not conv_id:
            print("ERROR: Could not locate any local conversation histories.", file=sys.stderr)
            sys.exit(1)
        print(f"Auto-detected conversation: {conv_id}")
    else:
        print(f"Active Conversation ID: {conv_id}")
    
    # 2. Define source paths
    source_brain_dir = brain_root / conv_id
    if not source_brain_dir.is_dir():
        print(f"ERROR: Local conversation directory not found at: {source_brain_dir}", file=sys.stderr)
        sys.exit(1)
        
    # 3. Define target paths
    proj_root = get_project_root()
    target_history_dir = proj_root / ".antigravity" / "history" / conv_id
    
    print(f"Source Directory: {source_brain_dir}")
    print(f"Target Directory: {target_history_dir}")
    
    # Create target directory
    try:
        target_history_dir.mkdir(parents=True, exist_ok=True)
    except PermissionError:
        print(f"ERROR: Permission denied. Cannot write to target directory: {target_history_dir}", file=sys.stderr)
        sys.exit(1)
    except Exception as e:
        print(f"ERROR: Failed to create target directory: {e}", file=sys.stderr)
        sys.exit(1)
    
    # 4. Copy Artifacts (markdown files and media in the main directory)
    copied_count = 0
    for file_path in source_brain_dir.iterdir():
        if file_path.is_file() and file_path.suffix in [".md", ".png", ".jpg", ".jpeg", ".gif", ".mp4", ".mov"]:
            try:
                shutil.copy2(file_path, target_history_dir / file_path.name)
                print(f"-> Copied file: {file_path.name}")
                copied_count += 1
            except PermissionError:
                print(f"Warning: Permission denied copying file {file_path.name}")
            except Exception as e:
                print(f"Warning: Failed to copy {file_path.name}: {e}")
            
    # 5. Copy Transcripts
    logs_dir = source_brain_dir / ".system_generated" / "logs"
    transcript_copied = False
    if logs_dir.is_dir():
        for log_file in ["transcript.jsonl", "transcript_full.jsonl"]:
            source_log = logs_dir / log_file
            if source_log.is_file():
                try:
                    shutil.copy2(source_log, target_history_dir / log_file)
                    print(f"-> Copied log: {log_file}")
                    transcript_copied = True
                except PermissionError:
                    print(f"Warning: Permission denied copying log {log_file}")
                except Exception as e:
                    print(f"Warning: Failed to copy log {log_file}: {e}")
                
    if not transcript_copied:
        print("Warning: No transcript files found in the conversation logs.")
        
    # 6. Git Synchronization
    git_dir = proj_root / ".git"
    if git_dir.is_dir():
        if not check_git_installed():
            print("\nWarning: Git repository detected, but git executable is not available in your PATH. Skipping Git commit.")
            print("Sync completed successfully!")
            return
            
        try:
            print("\nStaging files in Git...")
            subprocess.run(["git", "add", str(target_history_dir)], check=True, cwd=proj_root)
            print("Conversation history and transcripts staged in Git successfully!")
            print("You can now commit these staged history files together with your code updates.")
        except subprocess.CalledProcessError as e:
            print(f"\nWarning: Git command failed with error code {e.returncode}.", file=sys.stderr)
            print("Your files have been successfully copied locally, but could not be staged automatically in Git.", file=sys.stderr)
    else:
        print("\nNote: Not a Git repository (or .git not found). Skipping Git commit.")
        
    print("\nSync completed successfully!")

if __name__ == "__main__":
    main()

And finally, my AGENTS.md is quite simple and tells my harness when to mirror the core coding session artifacts.

# Team Customization Rules

These rules govern how Antigravity agents operate within this project repository to facilitate seamless team collaboration.

## 1. Artifact Mirroring
To ensure that all design decisions, test verifications, and walkthroughs are visible to the team during code reviews:
* **Mirroring Rule:** Whenever you create or modify an artifact (such as `implementation_plan.md`, `task.md`, or `walkthrough.md`) in the local user cache directory (`~/.gemini/antigravity/brain/<conversation-id>`), you MUST copy or write a duplicate version of that file to the workspace under `.antigravity/history/<conversation-id>/`.
* **Git Commits:** These mirrored documents should be staged and committed to Git alongside the source code changes.

## 2. Conversation Telemetry & Syncing
* If the user or agent needs to share the raw execution logs, terminal outputs, and thinking transcripts of a conversation:
  * Run the `team-sync` skill at the end of the session.
  * This will execute the `sync.py` script to collect the finalized `transcript.jsonl` and copy it to the same `.antigravity/history/<conversation-id>/` directory.

This .agents folder could be part of some shared Git project or project-bootstrapping script. Here’s an example of how to use it.

I created a local directory for my new coding project. Maybe I’m the first one on my team working on it. After copying the .agents folder into that directory, and running a git init, I opened Google Antigravity and started a new session/conversation. Notice that my Antigravity settings for this project shows the skill and agent rules loaded up automatically.

At this point, I just did my work like always. I used Antigravity to build a Dart and Flutter-based web app for my fictitious hotel chain. I built this (and packaged it) over three distinct coding sessions.

As each session went along, I noticed the session artifacts (like implementation plans and walkthroughs) showing up in the .antigravity folder within my project directory. And I ended each session with a request to run the team-sync skill. That ensured that my final chat transcript(s) showed up too.

Let’s imagine that I’ve pushed all my changes into a team-shared repo. The next developer(s) can pull down the app code, along with the session history. Maybe they’re curious about how we arrived at our deployment choice. For example:

Review the summary transcripts in this project and help me understand how the team decided to deploy to Cloud Run instead of Kubernetes.

The result? The transcript summary is consulted and the developer sees the results of the conversation and trade-offs factored in.

These key architectural decisions should be in other stateful artifacts like design docs. But given how fast teams are running now, the “requirements” are sprinkled throughout the code, test plans, session artifacts, and upfront docs.

Maybe I’m solving a temporary problem and within weeks, all these coding tools will make it super easy to create a shared “brain” for software teams. But for now, I like that agent skills make it easy to extend Antigravity this way. How are you thinking about sharing “thinking” among your developers?

Comments

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.