Thread-Based Multi-Agent Engineering

Ghost
Protocol

Agents execute autonomously, leave clean results, disappear. Named specialists running disciplined execution patterns for GitHub Copilot.

ghost-protocol
$ ghost-protocol init
# Routing to EECOM + Chain Thread...
ย 
C-THREAD: Payment System | Phase 1/4 | Agent: EECOM
CURRENT PHASE: Stripe integration
STATUS: Complete
HANDOFF TO: CAPCOM โ€” webhook contracts ready
ย 
# CHECKPOINT: Approve and continue to Phase 2? [Y/n]

The Problem

AI agents are powerful.
Unstructured AI agents are chaos.

Without structure, you get four failure modes. Ghost Protocol eliminates all of them.

๐Ÿ’ฅ

Scope Creep

Agent expands beyond what you asked
Thread patterns enforce scope limits and escalation triggers

๐Ÿง 

Lost Context

Agent forgets decisions from 20 messages ago
Agent history files and team decisions persist across sessions

๐Ÿ‘๏ธ

No Visibility

You don't know what the agent decided or why
Structured output, decision logging, Scribe session archive

๐Ÿšง

No Quality Gate

Work ships without structured review
Core Four framework, Review Thread, agent-specific quality checks

The Team

8 named specialists.
Each with a charter, a history, and opinions.

Not generic bots wearing hats. Each agent has defined expertise, boundaries, and a persistent memory of past work.

FlightLead / Architect

The one who sees the whole board. Refuses to let tactical wins create strategic debt. Evaluates trade-offs, coordinates big work, kills features to protect architecture.

Patterns:FusionBigReview

EECOMCore Developer

Ships working code. Three lines of duplication beats a premature abstraction. Pragmatic, code-first, treats "it compiles" as different from "it works."

Patterns:BaseChainLongZero

FIDOQuality Owner

The gatekeeper. 80% coverage is the floor, not the ceiling. Prefers integration tests over mocks. Will block a merge if tests are missing.

Patterns:ReviewStatusZero (verify)

ProceduresPrompt Engineer

The architect of agent behavior. Treats every word in a charter like a line of code. If an agent has to ask for help, the prompt failed.

Patterns:Big (design)Base

PAODocs / DevRel

If the docs are wrong, the feature doesn't exist. Allergic to jargon. Inline code examples are worth a thousand words.

Patterns:BaseChain (docs phase)

CAPCOMIntegration Specialist

The translator between your code and the outside world. Every API call gets a timeout, every webhook gets idempotency, every response gets validated.

Patterns:ChainBigBase

RETROSecurity

The paranoid one. Justifiably so. Assumes every input is hostile. Will block a merge over a missing CSRF token. "We'll add auth later" is the most dangerous sentence.

Patterns:ReviewBaseChain

ScribeSession Logger

The team's memory. Invisible until you need the receipts. Runs in the background after every thread. If it wasn't logged, it didn't happen.

Patterns:Background (always)

Execution Patterns

9 thread patterns.
Pick the shape, not just the prompt.

Each pattern defines how work is structured: checkpoints, parallelism, phases, verification loops. The right pattern prevents scope creep before it starts.

Base Thread

Single Task

One agent, one task, one review. The fundamental unit. Bug fix, small feature, isolated change.

Checkpoints: Start + End

P-Thread

Parallel

3-5 agents work simultaneously on independent sub-tasks. No shared files, no cross-talk, integration after.

Checkpoints: Start + End

C-Thread

Chain

Sequential phases with human review between each. Different agents can own different phases with explicit handoffs.

Checkpoints: Between every phase

L-Thread

Long Duration

Extended autonomous work with task tracking and self-checkpoints. Plan upfront, execute with breadcrumbs, escalate when needed.

Checkpoints: Optional self-checkpoints

B-Thread

Big / Hierarchical

Flight coordinates a tree of specialist agents with dependencies. Design Review before launch, contracts between agents.

Checkpoints: Start + End

F-Thread

Fusion / Competitive

2-3 agents compete with different strategies. Flight evaluates, user picks the winner. For when the right approach is uncertain.

Checkpoints: Start + Selection + End

Z-Thread

Zero-Touch

Fully autonomous. Agent self-verifies through tests. FIDO must approve test coverage first. Max 3 self-fix attempts before escalation.

Checkpoints: End only

Review Thread

Quality Gate

Post-execution evaluation using the Core Four framework. GREEN / YELLOW / RED rating. FIDO leads, RETRO checks security.

Rating: GREEN ยท YELLOW ยท RED

Status Thread

Metrics Dashboard

Thread metrics, agent utilization, optimization suggestions. Read-only. Run at session end for continuous improvement.

Mode: Read-only analysis

Dual Routing

Every task gets a who and a how.

The coordinator selects the specialist agent AND the execution pattern. Not one or the other. Both.

You say

โ€œFix the pagination bug. Off-by-one error returning 9 items instead of 10.โ€

AgentEECOM
PatternBase Thread

โ†’ EECOM executes a scoped fix, presents for review

You say

โ€œImplement auth system. Phase 1: schema. Phase 2: API. Phase 3: frontend. Phase 4: tests.โ€

AgentEECOM โ†’ CAPCOM โ†’ EECOM โ†’ FIDO
PatternChain Thread

โ†’ Sequential phases with explicit handoffs, human review between each

You say

โ€œEvaluate WebSocket vs SSE vs polling for real-time dashboard updates.โ€

AgentFlight (leads)
PatternFusion Thread

โ†’ 3 strategies compete, Flight evaluates, you pick the winner

Quality Framework

The Core Four.

Every thread is evaluated against four dimensions. No hand-waving. Scored 1-5 with evidence.

Context

Does the work show understanding of the codebase? Existing patterns followed? Dependencies considered?

CODEBASE AWARE

Model

Right capability level applied? Simple task = simple approach. No over-engineering, no under-engineering.

RIGHT-SIZED

Prompt

Work aligns with original request? No scope drift? Ambiguities resolved correctly?

SCOPE CHECK

Tools

Appropriate tools used? Tests written and run? Linting checked? Right thread pattern selected?

VERIFIED

Why Ghost Protocol

The best of both worlds.

Squad solved โ€œwho.โ€ Thread Engineering solved โ€œhow.โ€ Ghost Protocol solves both.

CapabilitySquadThread EngineeringGhost Protocol
Named specialist agentsYesNoYes
Structured execution patternsNo9 patterns9 patterns
Persistent agent memoryYesStatelessYes
Human checkpointsAd hocPer-patternPer-pattern
Quality frameworkReviewer gatesCore FourCore Four + agent review
Dual routing (who + how)Who onlyHow onlyWho + How
Ceremonies (retros, design review)YesNoYes, auto-triggered

Get Started

One command. A team that
executes and disappears.

terminal
$ git clone https://github.com/lloydpilapil/ghost-protocol.git
$ cd ghost-protocol
$ chmod +x install.sh
$ ./install.sh /path/to/your/project
ย 
Ghost Protocol installed successfully!
ย 
# Or just copy the files manually:
$ cp -r .ghost-protocol /your/project/
$ cp copilot/instructions.md /your/project/.github/copilot-instructions.md