Agent workflows

Take ideas from concept to production with the five-stage AI workflow: plan, code, test, build, deploy — run automatically, guided, or manually.

Agent workflows

A workflow is a structured, AI-powered development pipeline that takes your idea from concept to production in five stages. Each stage automates repetitive work while leaving you in control — run the whole pipeline at once or trigger individual stages on demand.

Workflows build on the AI agents; to write requirements that produce good results, see Prompt engineering.

The five stages

StageWhat happens
PlanAI analyzes requirements, reviews the existing codebase, designs the architecture, and breaks the work into tasks
CodeGenerates components, implements business logic, adds API integrations, writes database queries
TestGenerates unit and integration tests, runs the suites, fixes failures, validates edge cases
BuildOptimizes and bundles code, minifies assets, produces a production build and deployment artifacts
DeployConfigures the deployment, sets environment variables, ships to production, verifies and monitors

Workflow modes

Automatic

The AI executes every stage autonomously and pauses only for your deployment approval.

vibecaas run --auto "Add user authentication with email and Google OAuth"

The pipeline plans the architecture, generates the auth components and API, creates and runs tests, builds an optimized bundle, and deploys to staging.

Guided

The AI proposes each step and you approve, modify, or reject it before moving on — present the plan, preview code changes, review test results, approve deployment. Guided mode is the best way to learn how the AI makes decisions.

Manual

Run individual stages yourself for full control:

vibecaas plan "Feature description"
vibecaas code --file src/Component.tsx
vibecaas test --coverage
vibecaas build --production
vibecaas deploy --env staging

Configuration

Customize workflow behavior with a config file in your project.

// .vibecaas/workflow.config.json
{
  "workflow": {
    "mode": "guided",
    "stages": {
      "plan": { "enabled": true, "autoApprove": false, "aiModel": "gpt-4" },
      "code": {
        "enabled": true,
        "autoApprove": false,
        "aiModel": "claude-3-opus",
        "codeStyle": "airbnb",
        "language": "typescript"
      },
      "test": { "enabled": true, "autoApprove": true, "framework": "jest", "coverage": 80 },
      "build": { "enabled": true, "autoApprove": true, "optimization": "production" },
      "deploy": { "enabled": true, "autoApprove": false, "environment": "staging", "provider": "vercel" }
    },
    "notifications": { "email": true, "slack": true, "onSuccess": true, "onFailure": true }
  }
}

You can enable or disable any stage, and set auto-approval per stage — for example auto-approve Test and Build but require manual sign-off on Code and Deploy.

Real-world examples

FeaturePlanCodeTestDeploy
Shopping cartDesign cart schema and APIImplement cart components and logicTest add/remove and checkoutStaging then production
OAuth loginChoose auth strategyCreate endpoints and middlewareTest login, logout, refreshConfigure OAuth in production
Payment APIReview API docsImplement client and handlersMock responses, test edge casesSet production credentials

Best practices

  • Start with planning. Always run the Plan stage first, even for small changes — it gives the AI context and avoids conflicts with existing code.
  • Work iteratively. Start with a basic implementation and refine over multiple runs rather than building everything at once.
  • Use feature branches. Run workflows on a branch first so you can test safely before merging to main.
  • Review generated code, especially for security-sensitive features like authentication or payments.

Next steps