> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scriptonia.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow Guide

> A complete guide to Scriptonia’s 6-stage workflow: from idea to blueprint.

## Complete Workflow Overview

The workflow is **linear and session-based**.

* One `sessionId` ties all six stages
* You move forward only
* Each stage depends on the previous
* You cannot skip or reorder

```
Idea → Intent → Platform → Payment → Execution → Completion
  │       │         │          │          │           │
  │       │         │          │          │           └─ Summary, ZIP, optional GitHub
  │       │         │          │          └─ X402 agents generate blueprint + ZIP
  │       │         │          └─ Solana or Dodo confirms payment
  │       │         └─ User selects platform (Website, Web App, Android, iOS)
  │       └─ AI refines requirements from your answers
  └─ AI analyzes idea and returns clarifying questions
```

**What you provide:**

* An idea
* Answers to questions
* A platform choice
* Payment

**What you receive:**

* ZIP with README
* PRD
* PLAN
* Specs
* LLM prompts
* Infra notes
* `meta/github_push.yaml`
* Optionally pushed to GitHub

***

## Stage-by-Stage Breakdown

***

### Stage 1 — Idea (`/`)

**Input**

* Natural-language idea
* One or two sentences
* Can include core features

**AI**

* **IdeaProcessor**
* Analyzes scope, complexity, features
* Generates clarifying questions

**Output**

* Analysis summary
* Feature hints
* Complexity
* Clarifying questions (typically 3–5)

**Next**

* Taken to **Intent** with idea and questions in context

**Example**

* *“A Solana wallet for beginners with simple send/receive and token list.”*
* Analysis + questions about:
  * Target users
  * Must-have vs nice-to-have
  * Platform preference

***

### Stage 2 — Intent (`/intent`)

**Input**

* Answers to clarifying questions (in chat)

**AI**

* **IntentAnalyzer**
* Merges idea + answers into a structured spec

**Output**

* Refined title
* Description
* Feature list
* Target audience
* Tech requirements

Requirements are **locked** for Platform, Execution, and Completion.

**Next**

* Taken to **Platform**

**Example**

* “Teams 5–20”
* “Must-have: assignees, due dates, list view; Nice: Kanban”
* “Web first”
* Refined PRD-style requirements

***

### Stage 3 — Platform (`/platform`)

**Input**

* Selection of one platform

**AI**

* **PlatformSelector**
* Recommends options with:
  * Tech stack
  * Cost (\$SOL)
  * Timeline (seconds)
  * Agents

**Output**

* Chosen platform
* Cost
* Execution timeline

Stored for Payment and Execution.

**Next**

* Taken to **Payment**

**Options**

| Platform            | Best for                                 | Execution time (typical) |
| :------------------ | :--------------------------------------- | :----------------------- |
| **Website**         | Landing pages, marketing, static content | \~45 s                   |
| **Web Application** | Dashboards, SaaS, tools with auth/DB     | \~75 s                   |
| **Android**         | Native Android, Play Store               | \~100 s                  |
| **iOS**             | Native iOS, App Store                    | \~100 s                  |

***

### Stage 4 — Payment (`/payment`)

**Input**

* **Solana:** connect wallet, sign transfer
* **Dodo:** complete card / UPI checkout

**System**

* Validates balance (Solana)
* Processes Dodo checkout and webhook

**Output**

* Payment confirmation:
  * `transactionSig` (Solana)
  * `dodoPaymentId` (Dodo)
* Workflow marked paid

**Next**

* Redirect to **Execution** with:
  * `sessionId`
  * `platform`
  * Payment proof

**Notes**

* Solana: Phantom or AppKit;  SOL (devnet fallback)
* Dodo: Hosted checkout; webhook at `/api/dodo/webhook`

***

### Stage 5 — Execution (`/execution`)

**Input**

* None from you
* Uses Idea, Intent, Platform from the session

**AI**

* **X402 Orchestrator**
  * Product Manager (PRD, PLAN)
  * UX Designer (structure, components)
  * Frontend Dev (specs, prompts)
  * Backend Dev (specs, prompts)
  * DevOps Engineer (hosting, infra)
  * Technical Writer (docs)
* Coordination via **A2A (Agent-to-Agent)**

**Output**

* Full project structure
* Markdown
* Prompts
* Infra
* ZIP generated and stored (`ZipFile` / `Workflow`)

**Next**

* Taken to **Completion**

Progress is shown on the page.

***

### Stage 6 — Completion (`/completion`)

**Input**

* Optional: connect GitHub and trigger **Push to GitHub**

**System**

* Displays summary
* Serves **Download ZIP**
* GitHub upload via OAuth (if configured)

**Output**

* Summary
* ZIP download
* Optional GitHub repo with project files

**Next**

* End of workflow

***

## Timeline Expectations

| Stage          | Typical duration   | Notes                                  |
| :------------- | :----------------- | :------------------------------------- |
| **Idea**       | 5–15 s             | Depends on AI model and idea length    |
| **Intent**     | 5–15 s             | Depends on number of answers and model |
| **Platform**   | 5–10 s             | AI recommendation + your click         |
| **Payment**    | 10 s – 2 min       | Solana or Dodo                         |
| **Execution**  | Platform-dependent | See below                              |
| **Completion** | \< 5 s             | Summary + ZIP                          |

***

### Execution time by platform

| Platform            | Typical execution time |
| :------------------ | :--------------------- |
| **Website**         | \~45 s                 |
| **Web Application** | \~75 s                 |
| **Android**         | \~100 s                |
| **iOS**             | \~100 s                |

ZIP generation is included in Execution.

***

### End-to-end (idea → ZIP)

* **Website:** \~2–3 min
* **Web Application:** \~2.5–4 min
* **Android / iOS:** \~3–4.5 min

***

## Best Practices

***

### Idea

* Be specific enough to scope
* Name one or two core features
* Avoid very broad ideas

***

### Intent

* Answer every question
* Separate must-have vs nice-to-have
* State platform preference if you have one

***

### Platform

* **Website** — Fastest execution
* **Web Application** — Auth, DB, API
* **Android / iOS** — Native or app-store distribution

***

### Payment

* **Solana (testing):** `NEXT_PUBLIC_SOLANA_NETWORK=devnet`
* **Dodo (local):** Use a tunnel so webhook reaches `/api/dodo/webhook`

***

### Execution and Completion

* Do not close the tab during Execution
* Download the ZIP on Completion
* Ensure `GITHUB_CALLBACK_URL` matches your environment
