πŸ“‹ Workflow Guide

What is this? Ranex makes you follow 5 steps when building features. This guide explains each step.
Why? To prevent AI from writing bad code or skipping important steps.


🎯 The Big Idea

Think of building software like building a house:

  1. Requirements = What kind of house do you want?
  2. Design = Draw the blueprints
  3. Implementation = Actually build it
  4. Review = Inspection
  5. Maintenance = Fix things that break

Ranex prevents AI from building (coding) before you have blueprints (specs).

Ranex workflow context shown in terminal

Ranex context - showing architecture rules and workflow phase information


πŸ“ Phase 1: Requirements

"What am I building?"

What You Do

Write down what you want in plain English. No code!

What AI Can Do

  • βœ… Help you write requirements
  • βœ… Ask clarifying questions
  • ❌ Cannot write code

Commands

ranex task start my-feature    # Start here
ranex task status              # Check current phase

Example Requirements File

# πŸ“ What I Want: Shopping Cart

## The Goal

Let users add products to a cart and checkout.

## User Stories

- As a shopper, I want to add items to my cart
- As a shopper, I want to see my cart total
- As a shopper, I want to checkout and pay

## Rules

- Maximum 99 of each item
- Cart expires after 30 days
- Free shipping over $50

πŸ’‘ Tip: Write like you're explaining to a friend. Be specific about numbers, limits, and rules.


πŸ“ Phase 2: Design

"How will it work?"

What You Do

Plan the technical details. What files? What database tables? What APIs?

What AI Can Do

  • βœ… Help you plan architecture
  • βœ… Suggest database schemas
  • ❌ Still cannot write code

Commands

ranex task design    # Move to Design phase

Example Design File

# πŸ“ How It Works: Shopping Cart

## Files I Need

- `app/features/cart/routes.py` - API endpoints
- `app/features/cart/service.py` - Logic
- `app/features/cart/models.py` - Database

## API Endpoints

- POST /cart/add - Add item
- GET /cart - View cart
- DELETE /cart/item - Remove item
- POST /cart/checkout - Pay

## Database Tables

- Cart: id, user_id, created_at
- CartItem: id, cart_id, product_id, quantity

πŸ’‘ Tip: Don't know the technical details? Ask your AI! "Help me design a shopping cart system" - it can plan, just not code yet.


πŸ’» Phase 3: Implementation

"Let's build it!"

What You Do

Tell AI to write code. Review what it creates.

What AI Can Do

  • βœ… Write code! πŸŽ‰
  • βœ… Create files
  • βœ… Write tests
  • ❌ Cannot ignore your requirements
  • ❌ Cannot break architecture rules

Commands

ranex task build    # Unlock coding!
ranex scan          # Check for problems
ranex arch          # Verify structure

The Moment of Truth

$ ranex task build

βœ… Phase: Implementation
βœ… Code generation: ENABLED
βœ… Requirements: docs/specs/001_shopping-cart_reqs.md
βœ… Design: docs/specs/002_shopping-cart_design.md

AI can now write code based on your specifications!

πŸŽ‰ Now you can ask AI: "Build the shopping cart feature based on my specs"


πŸ” Phase 4: Review

"Did we build it right?"

What You Do

Test everything. Check for bugs. Get feedback.

What AI Can Do

  • βœ… Fix bugs
  • βœ… Refactor code
  • ❌ Cannot add new features
  • ❌ Cannot change the original plan

Commands

ranex govern check    # Full validation
ranex scan            # Security check

Review Checklist

  • All features from requirements work
  • No security warnings from ranex scan
  • Code follows the design
  • Tests pass

πŸ”§ Phase 5: Maintenance

"Keep it running"

What You Do

Monitor for issues. Apply updates. Fix bugs as they appear.

What AI Can Do

  • βœ… Fix bugs
  • βœ… Update packages
  • βœ… Security patches
  • ❌ Cannot add major new features (start a new task for that)

πŸ—ΊοΈ Visual Map

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                              β”‚
β”‚  πŸ“ REQUIREMENTS ──→ πŸ“ DESIGN ──→ πŸ’» IMPLEMENTATION        β”‚
β”‚     "What?"            "How?"        "Build it!"            β”‚
β”‚     (no code)          (no code)     (CODE ENABLED!)        β”‚
β”‚                                           β”‚                  β”‚
β”‚                                           β–Ό                  β”‚
β”‚                        πŸ”§ MAINTENANCE ←── πŸ” REVIEW         β”‚
β”‚                          "Fix bugs"       "Test it"         β”‚
β”‚                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‹ Command Cheat Sheet

What You WantCommand
Start a new featureranex task start feature-name
Move to Designranex task design
Start codingranex task build
Where am I?ranex task status
Check for problemsranex scan
Full validationranex govern check

❓ Common Questions

"Why is AI locked?"

You're in Requirements or Design phase. Complete your specs, then run ranex task build to unlock.

"Can I skip phases?"

Yes, with ranex task build --force, but you lose Ranex's protection. Not recommended!

"What if I need to change requirements later?"

Just edit the markdown files. Ranex re-reads them each time.

"How do I start over?"

Delete the .ranex/workflow.toml file and run ranex task start again.


⏭️ Next Steps

β†’ CLI Commands - All 22 commands explained
β†’ MCP Tools - How AI assistants connect to Ranex
β†’ Installation - Set up Ranex