Implement filesystem-based inter-process communication without requiring a message broker.
Overall low risk: this is a prompt-only skill/pattern description and is marked open-source, with no secrets and no remote endpoints. The main caution is that it instructs local file-based inter-process communication and working-directory reads/writes.
No secrets, tokens, or environment variables are required; nothing suggests credential collection or misuse.
No remote host is declared, and there is no indication of user data being sent to external services.
The material describes file-based IPC patterns that may involve local inter-process communication and async bridging, but there is no sign of extra system privileges or arbitrary code execution.
It reads and writes working-directory files such as events.jsonl, state.json, and request/response files, which is normal local file access; no overbroad access is described.
The source is a GitHub open-source repository and the material is inspectable, but the license is unspecified, stars are 0, and maintenance status is unknown, so supply-chain confidence is only moderate.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "file-ipc-patterns" skill from askskill: 1. Download https://raw.githubusercontent.com/microsoft/amplifier-bundle-skills/main/skills/file-ipc-patterns/SKILL.md 2. Save it as ~/.claude/skills/file-ipc-patterns/SKILL.md 3. Reload skills and tell me it's ready
Design a communication scheme for two local processes using append-only JSONL event logs. Include the event schema, producer and consumer flow, deduplication strategy, file rotation advice, and Python example code.
A practical JSONL IPC design with field definitions, workflow guidance, and example code.
I need one process to keep writing the latest state while another reads it at any time without seeing partial data. Design an atomic snapshot pattern using temp files plus rename, and include recovery and cross-platform considerations.
An atomic write pattern, reader contract, fault-tolerance guidance, and implementation examples.
Design an asynchronous request-response mechanism without a message broker: clients write request files and the server creates response files. Include naming rules, timeout handling, concurrency isolation, status tracking, and sample pseudocode.
A file-pair asynchronous communication pattern with directory structure, timing behavior, and pseudocode.
Problem: You have multiple processes (a web server and a container worker, or a host process and a spawned subprocess) that need to exchange messages and stream events. They don't share memory, and you don't want the complexity of a message broker.
Approach: Use the filesystem as the message bus. JSON files as request/response pairs, JSONL append-only logs as event streams, and atomic state.json snapshots for current status. Bridge async code with asyncio.Future objects that resolve when response files appear.
Pattern proven in production across multiple Python CLI tools and web services.
state.json snapshotThe EventEmitter writes two complementary files:
events.jsonl — append-only, one JSON object per line, flushed immediately so tail -f worksstate.json — atomic overwrite of current status, always a complete snapshotdef emit(self, event_type: str, *, phase=None, data=None) -> None:
"""Append a structured event to events.jsonl. Flushes immediately."""
record = {
"schema_version": SCHEMA_VERSION,
"timestamp": datetime.now(UTC).isoformat(),
"instance_id": self._instance_id,
"event_type": event_type,
"phase": phase,
"data": data if data is not None else {},
}
line = json.dumps(record, separators=(",", ":")) + "\n"
with self._lock, (self._work_dir / "events.jsonl").open("a") as fh:
fh.write(line)
fh.flush() # immediate for tail -f
The state snapshot uses atomic write:
def update_state(self, **kwargs) -> None:
"""Overwrite state.json atomically via os.replace."""
snapshot = {
"instance_id": self._instance_id,
"updated_at": datetime.now(UTC).isoformat(),
**kwargs,
}
target = self._work_dir / "state.json"
fd, tmp_path = tempfile.mkstemp(dir=self._work_dir, prefix=".state-", suffix=".tmp")
try:
with os.fdopen(fd, "w") as fh:
json.dump(snapshot, fh)
Path(tmp_path).replace(target) # atomic on POSIX
except Exception:
Path(tmp_path).unlink(missing_ok=True)
raise
Why two files: events.jsonl is the complete history (for replay, debugging, SSE streaming). state.json is the current status (for quick reads without scanning the entire log).
Input requests use a file-per-request convention:
async def request_input(self, request_id, schema):
"""Write a human-input request file and return a Future for the response."""
# Validate request_id to prevent path traversal
safe_name = Path(request_id).name
if not safe_name or safe_name != request_id:
raise ValueError(f"Invalid request_id: {request_id!r}")
input_requests_dir = self._work_dir / "input-requests"
input_requests_dir.mkdir(parents=True, exist_ok=True)
request_data = {
"request_id": request_id,
"schema": schema,
"requested_at": datetime.now(UTC).isoformat(),
}
request_file = input_requests_dir / f"{safe_name}.json"
request_file.write_text(json.dumps(request_data, indent=2))
# Create an asyncio.Future that will be resolved when the response arrives
loop = asyncio.get_running_loop()
future = loop.create_future()
self._pending_futures[request_id] = future
return future
asyncio.Future + file watcher for async request/responseThe request creates a Future. When the response arrives (via an API call from the UI), the Future is resolved thread-safely:
def resolve_input_request(self, request_id, payload):
"""Resolve the pending Future for the given request_id."""
future = self._pending_futures.pop(request_id, None)
if future is None:
return
…
Safely orchestrate Docker tasks and build reproducible development stack environments.
Convert skills from other AI coding assistants into Amplifier-native SKILL.md files.
Review code changes for reuse, quality, and efficiency, then fix issues.
Research, plan, and execute large code changes with parallel PR-producing agents.
Get skeptical, practical guidance on architecture, legacy refactors, and tooling decisions.
Build HTTP service patterns with lifecycle hooks, WebSockets, SSE, and proxying.
Enable local message routing and coordination between AI coding agents.
Securely perform cross-platform filesystem operations with encoding and path handling.
Design robust config and state file handling with safe defaults and crash recovery.
Enhanced filesystem MCP tool for searching, reading, editing, deleting, and running commands.
Use MCP for file operations and text generation with OpenAI-compatible models.
Safely read, write, search, and manage files in a sandboxed environment.