foreground-chains

Orchestrates multi-agent CLI workflows with file-based handoff and observable overlay sessions.

39|5|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/nicobailon/pi-foreground-chains --skill foreground-chains-nicobailon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foreground-chains
Source: https://github.com/nicobailon/pi-foreground-chains
Command: npx skills add https://github.com/nicobailon/pi-foreground-chains --skill foreground-chains-nicobailon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Coordinating multiple AI coding agents on a single task is opaque and error-prone: agents pause mid-task waiting for input, terminal output gets truncated, and users lose visibility into what each step is doing. This Skill chains scout, planner, worker, and reviewer agents with file-based handoff so every step runs in an observable overlay the user can watch or take over. ## Core Features & Use Cases - Four-role agent chain: Runs Scout (codebase recon), Planner (implementation plan), Worker (code changes), and Reviewer (validation and fixes) using different CLI agents like cursor-agent, pi, and codex. - File-based handoff: Passes structured artifacts (context.md, plan.md, impl.md) through a shared chain directory, with a single progress.md log every agent appends to. - Auto-continue handling: Detects when agents pause with prompts like "Should I continue?" and automatically sends input to keep them working, while respecting user takeover. - Use Case: Ask pi to implement a feature; it scouts the codebase for relevant code, generates a plan, implements all tasks with auto-continue, then reviews and fixes issues, leaving a complete progress log. ## Quick Start Ask pi to run a foreground chain that scouts the codebase, plans, implements, and reviews a feature you describe, then read the progress.md file it produces.

Frequently Asked Questions about foreground-chains

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

FAQPage Schema
How do I chain multiple AI coding agents together?

Use file-based handoff through a shared chain directory: each agent writes structured output (context.md, plan.md, impl.md) that the next agent reads. Every agent also appends to a single progress.md file so the main agent can read the complete chain history at the end.

How do I stop codex from pausing mid-task with questions?

Disable auto-exit on the interactive shell session, poll the output for waiting patterns like "Should I continue" or "Shall I proceed", and send "continue" as input. Alternatively, use auto-approval flags such as codex --full-auto or aider --yes-always when supported.

What is required to run foreground agent chains in pi?

The pi-interactive-shell extension must be installed first via npx pi-interactive-shell, since the chain runs each agent in hands-free overlay sessions. You also need the underlying CLI agents (cursor-agent, pi, codex) available on your system.

What happens if the user types while an agent is running?

The session status changes to user-takeover and the orchestration loop stops sending input, waiting until the user finishes. The chain only resumes auto-continue behavior when the session returns to a running state.

Can I run multiple scout agents in parallel?

Yes, create progress.md before starting the parallel sessions to avoid race conditions, then have each scout append its own section. Poll both session IDs alternately until both report exited before starting the planner step.