# Bashi Starter Reference

> Not auto-loaded. Read on demand for architecture details.

## Architecture Primitives

| Primitive | What It Is |
|-----------|-----------|
| **Command** | A user-facing entry point (e.g., `/run-project`). Reads state, executes logic, updates state. |
| **State** | `STATE.md` tracks what's done, in progress, and next. Single source of truth. |
| **Event** | A signal that something happened. Events trigger skills. Processed FIFO. |
| **Skill** | A packaged workflow with inputs, outputs, procedure, and definition of done. |
| **Registry** | `REGISTRY.md` maps skill triggers to skill folders. The orchestrator's lookup table. |
| **Rule** | A policy file that governs behavior across all agents (routing, context, consent). |
| **Agent** | A specialized AI role with a mission, constraints, and owned skills. |
| **Knowledge** | Persistent project files (decisions, glossary, open questions) that survive sessions. |

## Dispatch Chain

```
Events --> Skills (REGISTRY) --> Agents (routing rules)
```

1. The orchestrator checks for unprocessed events in EVENTS.md.
2. It looks up the event type in REGISTRY.md to find a matching skill.
3. If a skill matches: execute it. If not: fall back to routing rules.
4. After execution: update STATE.md, move event to Processed.

## Command Reference

| Command | Purpose |
|---------|---------|
| `/start` | See where you are and what to do next |
| `/capture-idea` | Describe what you want to build |
| `/run-project` | Execute the next task from the queue |
| `/setup` | Initialize state files for a new project |
| `/status` | Quick project dashboard |
| `/save` | Save progress for later sessions |

## Agents

| Agent | Role |
|-------|------|
| Orchestrator | Routes tasks, maintains state, processes events |
| Builder | Writes frontend code |
| Reviewer | Reviews code quality |

## Skills

| ID | Name | Owner | Trigger |
|----|------|-------|---------|
| SKL-0001 | Plan From Idea | Orchestrator | IDEA_CAPTURED |
| SKL-0003 | PRD to Tasks | Orchestrator | PRD_UPDATED |
| SKL-0004 | PRD Writing | Orchestrator | PRD_CREATION_REQUESTED |
| SKL-0005 | Frontend Development | Builder | FRONTEND_TASK_READY |
| SKL-0016 | Code Review | Reviewer | CODE_REVIEW_REQUESTED |
| SKL-0021 | Deployment | Builder | DEPLOYMENT_REQUESTED |

## The Pipeline

```
/capture-idea --> /run-project (planning) --> /run-project (building) --> /save
```

1. Capture your idea with `/capture-idea`
2. Run `/run-project` to generate a PRD and task queue
3. Run `/run-project` repeatedly to execute tasks one by one
4. Run `/save` to checkpoint your progress between sessions
