gateway-agent

Coordinate worker agents through an append-only CSV project ledger.

Updated Dec 20, 2025
One-click install
npx skills add https://github.com/koala-man-64/helpful-scripts --skill gateway-agent-koala-man-64
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gateway-agent
Source: https://github.com/koala-man-64/helpful-scripts/tree/main/exports/codex-skills/repo-local/gateway-agent
Command: npx skills add https://github.com/koala-man-64/helpful-scripts --skill gateway-agent-koala-man-64

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? When multiple autonomous agents work on the same project, they can overwrite each other's files, duplicate work, or lose track of task ownership. This Skill makes the agent act as a single gateway that records all claims, heartbeats, blockers, handoffs, and completions in one append-only CSV ledger, so folder ownership and task state stay consistent. ## Core Features & Use Cases - Append-only ledger writes: A helper script creates the CSV header, normalizes folder paths, generates task and run IDs, and enforces single-line fields and UTC timestamps. - Conflict and stale-lease handling: Overlapping non-stale claims produce a conflict event, while expired leases are reclaimed with a stale_reclaim event before a new claim is recorded. - State snapshots: A snapshot command derives current active, blocked, stale, handoff, closed, and conflict states plus folder ownership from the latest row per task. - Use Case: A dispatcher agent assigns a worker to the python folder with an exclusive claim, receives heartbeats every 15 minutes, records a blocker when a fixture is missing, and closes the task with done when the work completes. ## Quick Start Ask the agent to claim a folder for a task in your project root using the gateway ledger, then send heartbeat, progress, blocked, handoff, or done updates with the same task ID until the work is closed.

Frequently Asked Questions about gateway-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I coordinate multiple AI agents working on the same codebase?▼

Use a single gateway agent that writes all worker updates to one append-only CSV ledger. Workers claim folders with an access mode, send heartbeats to renew leases, and the gateway records conflicts or stale reclaims instead of letting agents overwrite each other.

How do I claim a folder for a worker agent in the ledger?▼

Run the gateway_ledger.py append command with --status claim, --folder, --access-mode, and --summary against the project root. The script generates task_id and run_id, sets the lease expiry, and writes either a claim or a conflict event.

What happens when two agents claim the same folder?▼

If an overlapping non-stale claim has an incompatible access mode, the script appends a conflict event instead of the claim. Read coexists only with read, shared only with shared, and exclusive conflicts with every other active claim.

How are expired agent leases handled in the ledger?▼

When a new claim overlaps an active task whose lease_expires_at_utc has passed, the script first appends a stale_reclaim event for the expired task and then records the new claim. The default lease window is 15 minutes.

Can worker agents write directly to the ledger CSV?▼

No. The operating rules require that only the gateway agent writes to the ledger, always through the helper script, and that historical rows are never rewritten or deleted. Workers send updates that the gateway translates into ledger events.