Workflow Overview

NikCLI supports various workflow patterns optimized for different development scenarios. These proven patterns help you maximize productivity while maintaining code quality and consistency.

Feature Development

End-to-end feature implementation workflows

Maintenance & Refactoring

Code improvement and optimization patterns

Bug Fixing

Systematic debugging and issue resolution

Project Setup

New project initialization and configuration

Development Workflow Patterns

1. Feature Development Workflow

1

Requirements Analysis

Start with clear feature requirements and planning
> /plan create "User authentication with social login"

πŸ“‹ Feature Analysis:
β”œβ”€β”€ Authentication methods (email, Google, GitHub)
β”œβ”€β”€ User registration and login flows
β”œβ”€β”€ Session management and security
β”œβ”€β”€ Password reset functionality
└── User profile management

Estimated complexity: Medium-High
Implementation time: 3-4 hours
2

Architecture Planning

Define technical architecture and approach
> Plan the technical implementation approach

πŸ—οΈ Architecture Plan:

Backend Components:
β”œβ”€β”€ User model with Mongoose/Prisma
β”œβ”€β”€ JWT authentication middleware
β”œβ”€β”€ OAuth integration (Passport.js)
β”œβ”€β”€ Email verification system
└── Password reset with secure tokens

Frontend Components:
β”œβ”€β”€ Authentication forms (login/register)
β”œβ”€β”€ Social login buttons
β”œβ”€β”€ Protected route wrapper
β”œβ”€β”€ User profile management
└── Authentication context/store
3

Implementation Phase

Execute the plan with coordinated development
> /auto "Implement the authentication system according to the plan"

πŸ€– Multi-agent execution:

Backend Agent:
β”œβ”€β”€ βœ… User model with validation
β”œβ”€β”€ βœ… JWT middleware setup
β”œβ”€β”€ πŸ”„ OAuth configuration
└── ⏳ Email service integration

Frontend Agent:
β”œβ”€β”€ βœ… Login/register forms
β”œβ”€β”€ πŸ”„ Social login integration
└── ⏳ Authentication context

Integration Agent:
β”œβ”€β”€ πŸ”„ API endpoint testing
└── ⏳ E2E flow validation
4

Testing & Validation

Comprehensive testing and quality assurance
> Add comprehensive tests for the authentication system

πŸ§ͺ Testing Implementation:

Unit Tests:
β”œβ”€β”€ User model validation
β”œβ”€β”€ JWT token generation/verification
β”œβ”€β”€ Password hashing functions
└── OAuth callback handling

Integration Tests:
β”œβ”€β”€ Login/logout flows
β”œβ”€β”€ Registration with email verification
β”œβ”€β”€ Password reset workflow
└── Social login integration

E2E Tests:
β”œβ”€β”€ Complete user journey
β”œβ”€β”€ Cross-browser compatibility
└── Mobile responsiveness
5

Documentation & Deployment

Finalize with documentation and deployment preparation
> Document the authentication system and prepare for deployment

πŸ“š Documentation:
β”œβ”€β”€ API endpoint documentation
β”œβ”€β”€ Frontend component usage
β”œβ”€β”€ Configuration guide
└── Security considerations

πŸš€ Deployment Prep:
β”œβ”€β”€ Environment variable setup
β”œβ”€β”€ Database migration scripts
β”œβ”€β”€ Security configuration
└── Monitoring setup

2. Bug Fix Workflow

Systematic approach to understanding the problem
> The user login is failing intermittently with 500 errors

πŸ” Bug Investigation Process:

1. Reproduce the Issue:
β”œβ”€β”€ Gather error logs and stack traces
β”œβ”€β”€ Identify reproduction steps
β”œβ”€β”€ Check environment differences
└── Document failure patterns

2. Root Cause Analysis:
β”œβ”€β”€ Database connection analysis
β”œβ”€β”€ Authentication middleware review
β”œβ”€β”€ Rate limiting investigation
└── Concurrent request handling

3. Impact Assessment:
β”œβ”€β”€ Affected user percentage
β”œβ”€β”€ Business impact analysis
β”œβ”€β”€ Temporary workaround options
└── Fix priority determination

3. Refactoring Workflow

Project Setup Patterns

Full-Stack Application Setup

1

Project Initialization

Set up the project structure and tooling
> /auto "Create a new full-stack TypeScript application with React frontend and Node.js backend"

πŸ—οΈ Project Structure Creation:

β”œβ”€β”€ client/ (React TypeScript)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── types/
β”‚   β”œβ”€β”€ public/
β”‚   └── package.json
β”‚
β”œβ”€β”€ server/ (Node.js TypeScript)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── types/
β”‚   └── package.json
β”‚
β”œβ”€β”€ shared/ (Common types and utilities)
β”œβ”€β”€ docker-compose.yml
└── README.md
2

Development Environment

Configure development tools and workflows
> Set up development environment with TypeScript, ESLint, Prettier, and testing

πŸ› οΈ Development Configuration:

Code Quality:
β”œβ”€β”€ TypeScript strict configuration
β”œβ”€β”€ ESLint with TypeScript rules
β”œβ”€β”€ Prettier formatting
β”œβ”€β”€ Husky pre-commit hooks
└── Lint-staged for optimized checks

Testing Setup:
β”œβ”€β”€ Vitest for unit testing
β”œβ”€β”€ Testing Library for React components
β”œβ”€β”€ Supertest for API testing
β”œβ”€β”€ Playwright for E2E testing
└── Coverage reporting configuration

Development Tools:
β”œβ”€β”€ Hot reload for both client and server
β”œβ”€β”€ Environment variable management
β”œβ”€β”€ Database setup with Docker
β”œβ”€β”€ API documentation with OpenAPI
└── Development scripts and aliases
3

CI/CD Pipeline

Automated testing and deployment pipeline
> Set up CI/CD pipeline with GitHub Actions

πŸš€ CI/CD Configuration:

Continuous Integration:
β”œβ”€β”€ Automated testing on pull requests
β”œβ”€β”€ Code quality checks (lint, format)
β”œβ”€β”€ Type checking validation
β”œβ”€β”€ Security vulnerability scanning
└── Build verification

Continuous Deployment:
β”œβ”€β”€ Staging environment deployment
β”œβ”€β”€ Production deployment with approval
β”œβ”€β”€ Database migration automation
β”œβ”€β”€ Health check validation
└── Rollback capability

Monitoring & Alerts:
β”œβ”€β”€ Application performance monitoring
β”œβ”€β”€ Error tracking and reporting
β”œβ”€β”€ Uptime monitoring
β”œβ”€β”€ Performance regression alerts
└── Security incident notifications

Microservices Architecture

Design microservices architecture
> Design a microservices architecture for an e-commerce platform

πŸ›οΈ Microservices Design:

Core Services:
β”œβ”€β”€ User Service (authentication, profiles)
β”œβ”€β”€ Product Service (catalog, inventory)
β”œβ”€β”€ Order Service (cart, checkout, orders)
β”œβ”€β”€ Payment Service (payment processing)
β”œβ”€β”€ Notification Service (email, SMS, push)
└── Analytics Service (tracking, reporting)

Infrastructure Services:
β”œβ”€β”€ API Gateway (routing, authentication)
β”œβ”€β”€ Service Discovery (Consul/Eureka)
β”œβ”€β”€ Configuration Service (centralized config)
β”œβ”€β”€ Logging Service (centralized logging)
└── Monitoring Service (metrics, health checks)

Communication Patterns:
β”œβ”€β”€ Synchronous: REST APIs for real-time operations
β”œβ”€β”€ Asynchronous: Message queues for event processing
β”œβ”€β”€ Event Sourcing: For audit trails and state reconstruction
└── CQRS: Separate read/write models for optimization

Team Collaboration Patterns

Code Review Workflow

Pair Programming with AI

Collaborative development with AI assistance
> Let's work together on implementing the payment processing feature

πŸ‘₯ Pair Programming Session:

Session Setup:
β”œβ”€β”€ Define clear objectives and scope
β”œβ”€β”€ Establish roles (driver/navigator)
β”œβ”€β”€ Set up shared development environment
β”œβ”€β”€ Prepare relevant documentation and resources
└── Configure AI assistant preferences

Development Process:
β”œβ”€β”€ Break down tasks into small chunks
β”œβ”€β”€ Implement incrementally with AI assistance
β”œβ”€β”€ Continuous testing and validation
β”œβ”€β”€ Regular refactoring and cleanup
└── Document decisions and learnings

Quality Assurance:
β”œβ”€β”€ Continuous code review
β”œβ”€β”€ Test-driven development approach
β”œβ”€β”€ Security consideration validation
β”œβ”€β”€ Performance impact assessment
└── Maintainability evaluation

Best Practices by Scenario

Feature Development

Structured Approach
  • Start with planning mode
  • Break into manageable phases
  • Use autonomous mode for implementation
  • Include comprehensive testing
Quality Gates
  • Code review checkpoints
  • Automated testing validation
  • Performance impact assessment
  • Security consideration review

Bug Fixing

Investigation First
  • Reproduce reliably
  • Understand root cause
  • Assess impact and urgency
  • Plan comprehensive fix
Prevention Focus
  • Add tests for the bug scenario
  • Implement monitoring/alerts
  • Document the issue and solution
  • Review related code areas

Refactoring

Safety First
  • Comprehensive test coverage
  • Incremental changes
  • Feature flags for gradual rollout
  • Rollback plan preparation
Value Focused
  • Clear improvement objectives
  • Measurable success criteria
  • Stakeholder communication
  • Documentation updates

New Projects

Foundation First
  • Solid project structure
  • Development tooling setup
  • CI/CD pipeline early
  • Documentation from start
Growth Oriented
  • Scalable architecture
  • Monitoring and observability
  • Security by design
  • Performance considerations

Workflow Customization

Custom Workflow Templates

Next Steps

Workflows are most effective when tailored to your team’s specific needs. Start with the provided templates and customize them based on your project requirements and team preferences.