A GitHub Action that scans your codebase for .md requirements files and .feature Gherkin files to generate a comprehensive BDD (Behavior-Driven Development) implementation plan with checkboxes.
- Automatic Requirements Discovery: Scans all
.mdfiles for requirements, user stories, and acceptance criteria - Gherkin Feature Analysis: Parses
.featurefiles to understand existing BDD scenarios - Infrastructure Detection: Identifies infrastructure needs from documentation (Docker, databases, message queues, etc.)
- Framework Detection: Automatically detects test frameworks and programming languages in use
- Comprehensive Planning: Generates a detailed, phase-based implementation plan following BDD best practices
- Checkbox Tracking: Creates actionable tasks with checkboxes for progress tracking
- GitHub Issue Integration: Optionally creates a GitHub issue with the generated plan
The action generates a plan following this BDD workflow:
- Gherkin Creation: Create
.featurefiles from requirements if they don't exist - Test Implementation: Write tests based on Gherkin scenarios (assuming implementation exists)
- Implementation: Build the actual implementation to make tests pass
- Infrastructure: Set up Docker and required services
- CI/CD: Configure continuous integration and deployment
- Documentation: Create comprehensive documentation
- Quality Assurance: Perform final validation
Add to your workflow file (.github/workflows/bdd-plan.yml):
name: Generate BDD Plan
on:
workflow_dispatch:
push:
paths:
- '**/*.md'
- '**/*.feature'
jobs:
generate-plan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate BDD Implementation Plan
uses: your-username/bdd-plan-generator@v1
with:
create-issue: 'true'
issue-labels: 'bdd,implementation,plan'
scan-paths: '.'
output-file: 'bdd_implementation_plan.md'You can also run the generator directly:
# Install dependencies
pip install pyyaml markdown
# Run the generator
python generate_bdd_plan.py --scan-paths . --output bdd_plan.md| Input | Description | Required | Default |
|---|---|---|---|
create-issue |
Create a GitHub issue with the plan | No | true |
issue-labels |
Comma-separated labels for the issue | No | bdd,implementation,plan |
scan-paths |
Paths to scan for requirements | No | . |
output-file |
Name of the output plan file | No | bdd_implementation_plan.md |
| Output | Description |
|---|---|
plan-file |
Path to the generated plan file |
total-tasks |
Total number of tasks in the plan |
requirements-count |
Number of requirements found |
features-count |
Number of feature files found |
issue-number |
Issue number if created |
The action recognizes various requirement formats in markdown files:
As a user, I want to login with OAuth, so that I can access my account securely.## Acceptance Criteria
- User can login with Google OAuth
- User can login with GitHub OAuth
- Session persists across browser refreshes## Infrastructure
- PostgreSQL database for user data
- Redis for session storage
- Docker containers for all servicesThe action parses standard Gherkin .feature files:
Feature: User Authentication
As a user
I want to authenticate
So that I can access protected resources
Scenario: Successful login
Given I am on the login page
When I enter valid credentials
Then I should be redirected to the dashboardThe generated plan includes:
-
Phase 1: Gherkin Feature Creation
- Review existing requirements
- Create missing Gherkin features
-
Phase 2: Test Implementation
- Step definitions
- Test infrastructure
- Integration tests
- E2E tests
-
Phase 3: Implementation
- Domain models
- Business logic
- API endpoints
- UI components
- Data access layer
-
Phase 4: Infrastructure Setup
- Docker configuration
- Required services
- Database setup
- Message queues
- Monitoring
-
Phase 5: CI/CD Pipeline
- Continuous integration
- Continuous deployment
-
Phase 6: Documentation
- README
- API documentation
- Architecture diagrams
-
Phase 7: Quality Assurance
- Code review
- Performance tests
- Security audit
The action generates a markdown file with checkboxes:
# BDD Implementation Plan
## Phase 1: Gherkin Feature Creation
### 1.1 Review Existing Requirements
- [ ] Review requirement from `docs/requirements.md`
- Content: User authentication with OAuth
### 1.2 Create Missing Gherkin Features
- [ ] Create Gherkin feature for OAuth authentication
- [ ] Define Feature description
- [ ] Write Background (if applicable)
- [ ] Create Scenarios with Given/When/Then
- [ ] Add Examples for Scenario Outlines
## Phase 2: Test Implementation
### 2.1 Step Definitions
- [ ] Create step definition file
- [ ] Implement step: `I am on the login page`
- [ ] Implement step: `I click the OAuth login button`
...MIT