Alliance — AI + Human United Workflow

Alliance is a document-driven 7-phase workflow system where two AIs (Architect + Builder) and a Human (user) unite to systematically complete complex projects. Documents are generated at each phase, and at critical decision points, the Human intervenes directly to set the direction.

Overview

The Three-Party Alliance

Alliance unites three parties — Architect, Builder, and Human:

ParticipantDefault AIRoleStrength
ArchitectGeminiResearch, design, merging, auditing, report synthesisBroad-view design and analysis
BuilderClaudeCritique, rebuttal, implementation, fixing, report contributionPrecise code generation and execution
HumanUserP0 direction selection, P4 fix-or-stop decisionsStrategic judgment, final decision-making

The two AIs' roles shift depending on the phase. For example, in the P0 debate they take turns as Visionary and Critic personas, in P1 both serve as designers, and in P3 only the Builder implements. The Human makes key decisions after the AIs complete their debate and design work.

Key Features of Alliance

FeatureDescription
Document-CentricGenerates structured documents at every phase
Human CheckpointsUser intervention at critical decision points (P0, P4)
Role-Swapping DebateVisionary ↔ Critic roles swap in P0 to prevent bias
Parallel WorkBoth AIs work simultaneously in PR, P1, and P5, then merge
Auto-RollbackAutomatically rolls back to P1/P2 when design errors are found in P4

How Alliance Differs from Avalon3 / Colligi

AllianceAvalon3Colligi
ScaleLarge-scale projectsMedium-scaleAnalysis-focused
Phases7 phases6 stages5 stages
Human InvolvementCheckpoints includedNoneNone
DocumentsGenerated at every phaseConsensus documentAnalysis report
Best ForFull project developmentFeature/module developmentReview/analysis

7-Phase Pipeline

PR → P0 (Discovery) → P1 (Design) → P2 (Task Spec) → P3 (Implementation) → P4 (Audit) → P5 (Closure)
Alliance timeline — 7-phase progress bar

PR — Research (Parallel Research)

Both AIs investigate project-related information in parallel:

PR phase — parallel research in progress
OrderByDocumentDescription
1Architect + Builderresearch_gemini + research_claudeBoth AIs perform web research simultaneously
2Coordinatorresearch_summaryMerges both research results into one
Example search keywords: "[Title] best practices", "[Title] alternatives comparison", "[Title] common pitfalls"

P0 — Discovery (3-Round Role-Swapping Debate)

A 3-round debate establishes the project direction. The key feature is that roles swap in Round 2:

P0 phase — Visionary vs Critic debate bubbles
RoundArchitect (Gemini)Builder (Claude)Content
R1🔭 Visionary🔍 CriticArchitect presents 5–10 innovative ideas → Builder critiques with 3 failure reasons per idea
R2🔍 Critic (swapped)🔭 Visionary (swapped)Builder presents 3–5 improved alternatives → Architect validates feasibility and selects Top 3
R3SynthesizerArchitect synthesizes the full debate into 3 final candidates with pros/cons

Why role-swapping? Swapping prevents single-perspective bias. When the AI that was only a Visionary becomes the Critic, it can objectively see the weaknesses in ideas it originally proposed.

Human Checkpoint

Human Checkpoint sheet — direction selection

After P0 completes, the user selects the direction directly:

  • Choose from the 3 candidates that emerged during the debate
  • Or modify the direction yourself

Note: This is the core of Alliance. No matter how well the AIs debate, the final decision rests with the human.

P1 — Design (Parallel Design)

Both AIs draft designs simultaneously, then the results are merged:

P1 phase — architecture document generation log
OrderByDocumentDescription
1Architect + Builderdesign_draft_architect + design_draft_builderBoth draft design docs simultaneously (Architect: architecture perspective, Builder: implementation perspective)
2Architectdesign_mergeMerges both designs into the final design document

If a PLAN_ERROR is found in P4, the workflow rolls back to P1 to revise the design.

P2 — Task Spec (Detailed Specification)

Transforms the design into implementation-ready detailed specifications:

P2 phase — detailed task spec document
OrderByDocumentDescription
1Architecttask_specWrites detailed task specification from the design
2Buildertask_confirmed or task_queryConfirms the spec (or sends task_query if questions exist)
3Architect (optional)task_spec (revised)Revises spec if questions were raised

P3 — Implementation

Only the Builder (Claude) generates code based on the specifications:

P3 phase — code implementation progress log
  • Multi-file generation
  • Automatic project configuration file creation
  • Test code included
  • Automatic snapshot backup (before implementation)

The Architect does not participate in implementation because it serves as the auditor. Separating the designer from the implementer ensures objectivity in the P4 audit.

P4 — Audit (Audit + Rollback)

The Architect (Gemini) audits the quality of the generated code:

P4 phase — audit results (pass/fail)

Actions based on audit results:

ResultAction
PASSEDProceed to P5
CODE_ERROR (< 3 times)Builder fixes code → Architect re-audits
CODE_ERROR (≥ 3 times)Fix Checkpoint triggered → user decides
PLAN_ERROR (design flaw)Auto-rollback to P1 (Design) or P2 (Task Spec)

Fix Checkpoint

If code fixes fail 3 consecutive times, the user is asked to decide:

  • Continue Fixing — Attempt additional fixes
  • Proceed to P5 — Wrap up with the current state (force closure)
  • Stop Project — Stop the project entirely

Rollback Mechanism

When a PLAN_ERROR is detected, the workflow automatically rolls back based on the error type:

  • "design error" or ROLLBACK_P1 → Rolls back to P1 (Design)
  • "spec error" or ROLLBACK_P2 → Rolls back to P2 (Task Spec)

P5 — Closure (Parallel Reporting)

Both AIs write final reports simultaneously, then the results are merged:

P5 phase — completion report
OrderByDocumentDescription
1Architect + Builderfinal_report_sub_architect + final_report_sub_builderArchitect: design perspective report, Builder: implementation perspective report
2Architectfinal_report_mergedFinal report integrating both perspectives

Completion Report Sheet

Completion Report sheet — full result summary

When all phases are complete, the final report is displayed:

  • Elapsed time per phase
  • List of generated documents
  • List of generated code files
  • Overall project statistics

Document Naming Convention

All documents generated by Alliance follow this format:

SEQ-{number}_PHASE-{phase}_{doc_type}_{date}_{time}.md

Examples:

SEQ-001_PHASE-PR_goal_input_20250214_143022.md
SEQ-005_PHASE-P0_idea_pitch_20250214_150511.md
SEQ-010_PHASE-P1_design_draft_architect_20250214_163445.md

ComponentDescription
SEQ-XXXSequential document number (auto-incremented)
PHASE-{phase}Phase code (PR, P0, P1, P2, P3, P4, P5)
{doc_type}Document type (idea_pitch, design_draft_architect, etc.)
{date}_{time}Creation timestamp (YYYYMMDD_HHMMSS)

Alliance UI

Layout

Full Alliance layout (timeline + document viewer)
AreaDescription
Left Panel[Project \History] tab switcher, timeline, progress status, document bubbles
Right PanelContent viewer for the selected document
The top of the left panel contains a segmented tab:
  • Project tab: Progress status, timeline, and document bubbles for the currently running project
  • History tab: Past execution records with settings restoration and re-run capabilities

Timeline Panel

Timeline panel detail

Displayed elements:

  • Progress Bar — Visual 7-phase indicator
  • Current Status — Name of the running phase
  • Daemon Status — Running / Stopped / Error indicator
  • Document Bubbles — Chat-style document timeline
Document Bubble Information:
ElementDescription
Agent NameThe AI/role that generated the document
TimestampCreation time
Phase BadgeWhich phase the document belongs to
Content PreviewFirst few lines of the document

Document Viewer Panel

Document viewer — markdown-rendered document
  • Renders the full content of the selected document in markdown
  • Shows a placeholder guide when no document is selected

Action Buttons

Alliance action buttons (Start/Stop/Delete)
StateAvailable Actions
Not StartedStart new project, Delete
RunningStop daemon, Cancel project, Force reset
CompletedStart new project, Delete project
ErrorRetry, Force reset, Delete

History

Alliance automatically records history whenever an execution completes (or fails). Switch to the [Project | History] tab at the top of the left panel to view past execution records.

History Tab

History tab — execution record list

The history list shows the following information for each run:

  • Title and success/failure status icon
  • Phase reached (e.g., P5), elapsed time, document count
  • Description preview (when the item is selected)
  • Output directory path (when selected)

History Action Buttons

When a history entry is selected, action buttons appear at the bottom:

ButtonAction
Restore SettingsRestores the selected entry's title, description, and attachments to the Project tab (does not open a sheet)
Re-runRestores settings and opens the new project sheet for immediate re-execution (snapshot ON by default)
OpenOpens the output directory in Finder
Clear SelectionDeselects the current entry
Clear HistoryDeletes all history records

Restore Settings only restores the environment. When you later click "Start New Project" to open the sheet, the restored values will be pre-filled automatically. Re-run opens the sheet immediately for a quick restart.

Snapshot Integration

You can automatically create a snapshot when starting a new Alliance project:

New project sheet — snapshot creation checkbox
  • The new project sheet includes a "Create snapshot before starting" checkbox (default: ON)
  • When checked, a full project snapshot is automatically created before Alliance begins
  • The snapshot message includes the Alliance project title

Recommended: If you plan to run Alliance multiple times or expect large-scale changes, keep the snapshot option enabled so you can always restore to a previous state.

File Handling on Re-run

When starting a new project, previous run files are automatically cleaned up:

ItemBehavior
state.jsonOverwritten with new project data
docs/ folderPrevious document files auto-deleted, then new documents created
daemon.logAppended to
history.jsonPrevious execution records preserved (not deleted)

Fast Mode

For simple tasks (bug fixes, refactoring, tests, etc.), the PR and P0 phases are skipped and the workflow starts directly from P1:

ModeStarting PhaseBest For
Creative (default)PR (Research)New projects, large-scale features
FastP1 (Design)Bug fixes, refactoring, tests
Auto-detection keywords: bug, fix, refactoring, test

Colligi Analysis Document Integration

When you attach a Colligi analysis report to Alliance, keywords in the report (such as fix, test, refactor) can automatically trigger Fast mode, skipping PR and P0.

Regular input:     PR → P0 → P1 → P2 → P3 → P4 → P5  (7 phases)
Colligi input:        ──────→ P1 → P2 → P3 → P4 → P5  (5 phases)

Recommended Workflow: For large-scale projects, the most effective approach is a two-step workflow: First analyze with ColligiAttach the results to AllianceAutomated design through implementation.

File Attachments

You can attach .txt or .md files in the new project sheet:

New project sheet — file attachment UI
  • Use the + button in the Attachments area to add files
  • Only .txt and .md formats are supported
  • Multiple files can be attached simultaneously
  • Attached file contents are automatically merged into the project description and passed to the AI

Instead of copy-pasting a Colligi analysis report into the description field, you can simply attach it as a file for convenience.

Autonomous Mode

Autonomous mode badge display

When autonomous mode is enabled, Human Checkpoints and Fix Checkpoints are handled automatically:

  • At P0, the first option is automatically selected
  • At P4, automatic retry is performed

Warning: In autonomous mode, the entire pipeline runs without user intervention. It is recommended to disable this for important projects.

Autonomous mode setting: SettingsIntelligenceAutonomous Mode toggle

Safety Limits

LimitValueDescription
Max Iterations20Maximum total document processing cycles
Max Docs per Phase10Maximum documents generated in a single phase
CLI Timeout5 minutesMaximum time per AI CLI execution
Retries3Retries on connection errors (10-second intervals)
Infinite loop detection automatically stops execution and requests user intervention.

Output Location

{project}/
└── .projecthub/
    └── alliance/
        ├── state.json                                     # Workflow state
        ├── history.json                                   # Execution history
        ├── daemon.log                                     # Daemon log
        ├── daemon.pid                                     # Daemon process ID
        └── docs/
            ├── SEQ-001_PHASE-PR_goal_input_*.md          # Goal input
            ├── SEQ-002_PHASE-PR_research_gemini_*.md     # Architect research
            ├── SEQ-003_PHASE-PR_research_claude_*.md     # Builder research
            ├── SEQ-004_PHASE-PR_research_summary_*.md    # Research merge
            ├── SEQ-005_PHASE-P0_idea_pitch_*.md          # Idea pitch
            ├── SEQ-006_PHASE-P0_critical_review_*.md     # Critical review
            ├── ...                                        # (subsequent documents)
            └── SEQ-XXX_PHASE-P5_final_report_merged_*.md # Final report

Use Cases

Full Project Development

Build a Todo app.
Use a React + TypeScript + Supabase stack,
with user authentication, CRUD, and real-time sync features.

Alliance manages the entire development cycle from research through implementation and audit.

Large-Scale Refactoring

Convert the current project to a microservices architecture.
Analyze the existing monolith code and create a service decomposition plan.

Technology Migration

Migrate this project's JavaScript to TypeScript.
Convert incrementally without breaking existing functionality.

Next Steps

  • Avalon3 — Debate system suited for medium-scale tasks
  • Colligi — Collective intelligence for analysis-focused tasks
  • AI Agent — Quick single-AI code generation
  • Settings — AI provider and autonomous mode configuration