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
| Stage | What happens |
|---|---|
| Plan | AI analyzes requirements, reviews the existing codebase, designs the architecture, and breaks the work into tasks |
| Code | Generates components, implements business logic, adds API integrations, writes database queries |
| Test | Generates unit and integration tests, runs the suites, fixes failures, validates edge cases |
| Build | Optimizes and bundles code, minifies assets, produces a production build and deployment artifacts |
| Deploy | Configures 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 stagingConfiguration
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
| Feature | Plan | Code | Test | Deploy |
|---|---|---|---|---|
| Shopping cart | Design cart schema and API | Implement cart components and logic | Test add/remove and checkout | Staging then production |
| OAuth login | Choose auth strategy | Create endpoints and middleware | Test login, logout, refresh | Configure OAuth in production |
| Payment API | Review API docs | Implement client and handlers | Mock responses, test edge cases | Set 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
- Write requirements that get better output with Prompt engineering.
- Understand the agents behind each stage in AI agents.
- Configure deployment targets in Deploying your app.