Use when working in a shared relayfile virtual filesystem with other agents - covers reading/writing files with metadata, discovering other agents' work, conflict handling, ACL permissions, and real-time collaboration patterns
Use when working in a shared relayfile virtual filesystem with other agents - covers reading/writing files with metadata, discovering other agents' work, conflict handling, ACL permissions, and real-time collaboration patterns
Relayfile Shared Workspace
Overview
You are working in a shared virtual filesystem powered by relayfile. Multiple agents read and write files here concurrently. Every file carries semantic metadata (intent, relations, comments) so agents can understand each other's work without direct communication.
When to Use This Skill
You see a mounted relayfile directory or RELAYFILE_URL env var
You're told you're working in a shared/collaborative workspace
Multiple agents are operating on the same codebase simultaneously
You need to coordinate work without a central orchestrator
Quick Start
Environment
# These should be set in your environment
RELAYFILE_URL=http://127.0.0.1:8080 # or https://api.relayfile.dev
RELAYFILE_TOKEN=<your-jwt>
RELAYFILE_WORKSPACE=<workspace-id>
The Basics
Files sync automatically through the mount daemon. You can read and write files normally on the local filesystem. But to collaborate effectively, use the API for metadata.
Before You Write: Check for Other Agents' Work
Always check before writing to a file someone else may be working on.
# Read a file with its metadata
curl -s "$RELAYFILE_URL/v1/workspaces/$RELAYFILE_WORKSPACE/fs/file?path=/src/auth.ts" \
-H "Authorization: Bearer " \
-H
$RELAYFILE_TOKEN
"X-Correlation-Id: check-1"
Response includes semantic metadata:
{"path":"/src/auth.ts","revision":"rev_42","content":"...","semantics":{"properties":{"author":"agent-alpha","intent":"implementing JWT validation","status":"in-progress"},"relations":["task-123","epic-auth"],"comments":["Blocked on key rotation design"]}}
Read the intent and status before editing. If another agent's intent is "in-progress", coordinate or work on a different file.
Writing Files with Intent
When you write, always include metadata so other agents understand what you're doing and why.
Before starting work on a file, claim it by writing a stub with status: in-progress:
# Claim the file
curl -X PUT ".../fs/file?path=/src/new-feature.ts" \
-H "If-Match: 0" \
-d '{"content":"// WIP","semantics":{"properties":{"author":"me","intent":"implementing feature X","status":"in-progress"}}}'# Do your work...# Update with final content
curl -X PUT ".../fs/file?path=/src/new-feature.ts" \
-H "If-Match: rev_1" \
-d '{"content":"// Final implementation","semantics":{"properties":{"author":"me","intent":"implemented feature X","status":"complete"}}}'
Pattern 2: Query-Then-Act
Before implementing, check what exists:
# What's related to my task?
curl ".../fs/query?relation=task-123"# What's the current state of the module I'm about to change?
curl ".../fs/file?path=/src/auth.ts"# Who else is working in this area?
curl ".../fs/query?property.status=in-progress&path=/src/"
Pattern 3: Leave Breadcrumbs
When you make a decision that affects other agents, leave it in the metadata:
{"semantics":{"comments":["Changed from REST to WebSocket for real-time updates - see /docs/adr-003.md","This breaks the old polling client in /src/poll-client.ts"]}}
Pattern 4: Bulk Seeding
When creating many files at once (scaffolding, migrations):