A comprehensive Node.js project template designed for AI-first development with BDD/TDD workflow support. This template provides a solid foundation with modern tooling, MCP (Model Context Protocol) integrations, comprehensive testing frameworks (Vitest & Cucumber), and development best practices.
- AI-First Development: Optimized for AI-assisted coding with MCP integrations
- BDD/TDD Workflow: Comprehensive Behavior-Driven and Test-Driven Development workflow
- BDD Support: Cucumber integration with Gherkin syntax for acceptance tests
- TDD Support: Vitest for unit testing with comprehensive coverage
- GitHub Integration: Access and manipulate GitHub issues and pull requests
- Jira Integration: Create and edit Jira stories and tasks
- Memory Tools: AI memory and documentation management with
llm-mem - Documentation Coverage: CLI tool for documentation coverage reports
- Modern Tooling: TypeScript, ESLint, Prettier, Vitest, and Cucumber
- Clean Code Standards: Built-in linting and formatting rules
- Node.js: Version 24.3.0 or higher
- pnpm: Version 10.15.0 or higher (Installation Guide)
- SSH Key: Working SSH key setup for GitHub (preferably without passphrase)
-
Create a new repository from this template:
- Click the "Use this template" button on GitHub
- Choose "Create a new repository"
- Name your new repository and configure settings
- Click "Create repository from template"
-
Clone your new repository:
git clone <your-new-repo-url> cd <your-repo-name> pnpm install
-
Build packages:
pnpm run build
-
Configure MCP tools:
- Create
.env.github-mcpbased on.env.github-mcp.examplein the.cursordirectory - Update
mcp.jsonwith your repository details
- Create
-
Enable MCPs in Cursor:
- Configure the MCP servers in your Cursor settings
- Restart Cursor to activate the integrations
| Script | Description |
|---|---|
pnpm dev |
Start development server with hot reload |
pnpm build |
Build the project for production |
pnpm start |
Start the production server |
pnpm test |
Run TDD test suite (Vitest) |
pnpm test:bdd |
Run BDD test suite (Cucumber) |
pnpm test:all |
Run both TDD and BDD tests |
pnpm test:coverage |
Run tests with coverage report |
pnpm test:full |
Run complete validation (tests + linting + type checking + formatting) |
pnpm lint |
Run ESLint |
pnpm lint:fix |
Fix ESLint issues automatically |
pnpm format |
Format code with Prettier |
pnpm type-check |
Run TypeScript type checking |
pnpm doc:coverage |
Generate documentation coverage report |
pnpm deps:check |
Check for outdated dependencies |
pnpm deps:update |
Update all dependencies to latest versions |
node-ai-wf/
βββ .cursor/ # Cursor IDE configuration
β βββ commands/ # BDD/TDD workflow commands
β βββ modes/ # Agent mode templates
β βββ rules/ # Code standards and rules
β βββ mcp.json # MCP server configuration
βββ docs/ # Documentation
β βββ db/ # Memory database (FlexSearch)
β βββ md/ # Markdown documentation
βββ features/ # BDD feature files (Cucumber)
β βββ *.feature # Gherkin feature files
β βββ README.md # BDD documentation
βββ src/ # Source code
β βββ examples/ # Example code and utilities
β β βββ math.ts # Math utility examples
β β βββ string-utils.ts # String utility examples
β β βββ logger.ts # Logging utility examples
β β βββ README.md # Examples documentation
β βββ index.ts # Main entry point
β βββ logger.ts # Winston logging setup
βββ tests/ # Test suite
β βββ steps/ # BDD step definitions
β β βββ *.steps.ts # Cucumber step definitions
β β βββ README.md # Step definition docs
β βββ setup.ts # Test configuration
β βββ *.test.ts # TDD unit tests
β βββ README.md # Testing documentation
βββ reports/ # Test reports
β βββ cucumber-report.html # BDD HTML report
β βββ cucumber-report.json # BDD JSON report
βββ scripts/ # Utility scripts
βββ package.json # Project configuration
βββ tsconfig.json # TypeScript configuration
βββ eslint.config.js # ESLint configuration
βββ vitest.config.ts # Vitest configuration
βββ cucumber.config.cjs # Cucumber configuration
This template includes example code in the /src/examples/ directory to demonstrate:
- Code Structure: How to organize utility modules and functions
- Testing Patterns: Comprehensive test examples for different scenarios
- TypeScript Usage: Type-safe development patterns and best practices
- Node.js Patterns: Common Node.js development patterns and utilities
math.ts- Math utility functions (add, subtract, multiply, divide, power, factorial)string-utils.ts- String manipulation utilities (capitalize, reverse, isPalindrome, etc.)logger.ts- Winston-based logging setup and utilities
- Reference: Use examples as reference for structuring your own modules
- Testing: Examples are fully tested to demonstrate testing patterns
- Coverage: Example files are excluded from coverage reporting (they're just templates)
- Customization: Modify or remove examples based on your project needs
Note: When you run
pnpm test:coverage, the coverage report will show 0% initially since only example code exists. Once you add your own production code to/src/(outside the examples directory), coverage will measure your actual code.
This template implements a comprehensive testing strategy combining Behavior-Driven Development (BDD) and Test-Driven Development (TDD):
- Framework: Vitest for fast, isolated unit tests
- Location:
tests/*.test.tsfiles - Purpose: Test individual functions and modules in isolation
- Pattern: Red-Green-Refactor cycle
- Run:
pnpm test
- Framework: Cucumber with TypeScript step definitions
- Location:
- Feature files:
features/*.feature(Gherkin syntax) - Step definitions:
tests/steps/*.steps.ts
- Feature files:
- Purpose: Test user stories and acceptance criteria from business perspective
- Pattern: Given-When-Then scenarios
- Run:
pnpm test:bdd
- Run both:
pnpm test:all(TDD + BDD) - Full validation:
pnpm test:full(tests + linting + type checking + formatting) - Reports: Generated in
reports/directory
This template includes a comprehensive BDD/TDD development workflow optimized for LLM execution. The workflow combines Behavior-Driven Development (BDD) and Test-Driven Development (TDD) practices with memory-based knowledge management.
The workflow follows a systematic approach from project planning to pull requests, focusing on one user story at a time and leveraging AI memory tools for context and documentation.
| Command | Purpose | Description |
|---|---|---|
wf0-define-goal |
Project Planning | Define project vision, requirements, user personas, and MVP scope |
wf0a-create-threatmodel |
Threat Modeling | Create threat model documentation for security assessment foundation |
wf1-create-agent-mode |
Agent Configuration | Create AI agent personality and technical expertise profile |
wf2-create-user-stories |
Story Creation | Generate user stories from project goals and create them in Jira or GitHub |
wf3-translate-to-bdd |
BDD Translation | Convert user stories into detailed BDD scenarios with Gherkin syntax |
wf4a-plan-architecture |
Architecture Design | Design system architecture, interfaces, and data models |
wf4b-plan-implementation |
Implementation Planning | Create detailed implementation plan with testing strategy |
wf5-write-bdd-steps |
BDD Step Definitions | Implement reusable BDD step definitions in TypeScript |
wf6-write-unit-tests |
Unit Test Implementation | Create comprehensive unit test suite with Vitest |
wf7-write-implementation |
Code Implementation | Implement features following TDD principles (green phase) |
wf7a-validate-implementation |
Implementation Validation | Validate implementation with BDD tests, unit tests, formatting, and linting |
wf8-review-implementation |
Code Review | Comprehensive code review and quality assessment |
wf8a-refactor |
Code Refactoring | Improve code quality based on review findings |
wf9-security-review |
Security Assessment | Comprehensive security vulnerability assessment |
wf9a-refactor-security |
Security Hardening | Address security issues identified in security review |
wf10-write-documentation |
Documentation | Create comprehensive documentation for humans and LLMs |
wf11-create-pull-request |
PR Creation | Package implementation for review and integration |
Commands are used directly in the Cursor chat interface:
- Open Cursor IDE with your project
- Start a chat with the AI assistant
- Type the command using the "/" prefix followed by the filename:
- For initial commands:
wf0-define-goal,wf1-create-agent-mode - For story-specific commands:
wf3-translate-to-bdd github issue 123
- For initial commands:
- Follow the Instructions: Each command provides detailed step-by-step guidance
- AI Integration: Commands work seamlessly with MCP tools for GitHub, Jira, and memory management
/wf0-define-goal- Start project planning/wf1-create-agent-mode- Create custom AI agent mode/wf2-create-user-stories- Create user stories in Jira or GitHub/wf3-translate-to-bdd github issue 123- Translate story #123 to BDD scenarios/wf4a-plan-architecture github issue 123- Plan architecture for story #123/wf4b-plan-implementation github issue 123- Plan implementation for story #123/wf5-write-bdd-steps github issue 123- Implement BDD step definitions for story #123/wf6-write-unit-tests github issue 123- Write unit tests for story #123/wf7-write-implementation github issue 123- Implement code for story #123/wf7a-validate-implementation github issue 123- Validate implementation for story #123/wf8-review-implementation github issue 123- Review code for story #123/wf9-security-review github issue 123- Review security for story #123/wf10-write-documentation github issue 123- Write documentation for story #123/wf11-create-pull-request github issue 123- Create PR for story #123
The commands follow these principles:
- One user story at a time: Focus on completing one user story before moving to the next
- BDD-first approach: Start with user stories, translate to BDD scenarios, then implement
- Memory-driven: Use MCP memory tools for architectural decisions, documentation, and context
- Quality gates: Built-in review and validation steps ensure code quality
- LLM-optimized: Each step designed for effective LLM execution
- Start with
wf0-define-goalto establish your project vision and user personas - Use
wf1-create-agent-modeto create a specialized AI agent for your project - Run
wf2-create-user-storiesto generate and create user stories in Jira or GitHub - Select a story and run
wf3-translate-to-bddto convert it to BDD scenarios - Follow the sequence through architecture, implementation, testing, and review
- Complete the cycle with
wf7a-validate-implementation,wf8-review-implementation, andwf11-create-pull-request
The workflow leverages MCP memory tools to store and retrieve:
- DEF: Project definitions, goals, user personas, and MVP scope
- ADR: Architecture Decision Records with governance and rationale
- ARC: Story-specific architectural decisions and component design
- IMP: Implementation plans, testing strategies, and development approaches
- DOC: Code documentation, business logic, edge cases, and API guides
- SEC: Security assessments, vulnerability analysis, and best practices
This template includes pre-configured agent modes in the .cursor/modes/ directory that you can use to create specialized AI assistants for different aspects of development. These files serve as templates that you manually copy into Cursor's custom agent system.
Note: For detailed information about Cursor agent modes, see the official Cursor documentation.
| Mode | Purpose | Description |
|---|---|---|
prompt-engineer |
Prompt Engineering | World-class prompt engineering expertise with cutting-edge techniques and methodologies |
- Open Cursor IDE with your project
- Access Agent Settings: Go to Settings β Agents
- Create Custom Agent: Click "Create Agent" or "New Agent"
- Copy Agent Prompt: Copy the content from
.cursor/modes/prompt-engineer.md - Paste into Agent: Paste the content into the agent's system prompt field
- Save and Name: Give your agent a descriptive name and save
- Select Agent: Choose your custom agent from the agent selector in chat
You can create your own agent modes by:
- Create a new file in
.cursor/modes/directory (for template storage) - Define the agent persona with specific expertise and communication style
- Include domain knowledge relevant to your project needs
- Set clear guidelines for how the agent should behave
- Copy the content from your
.cursor/modes/file - Create Custom Agent in Cursor Settings β Agents
- Paste the content into the agent's system prompt field
- Save and test the agent in Cursor chat
# Your Custom Agent Mode
You are now a [SPECIALIZED ROLE] with expertise in [DOMAIN].
## Core Principles
- [Key principles the agent should follow]
## Expertise Areas
- [Specific areas of knowledge]
## Communication Style
- [How the agent should communicate]
## Success Metrics
- [What defines success for this agent]- Specialized Expertise: Each mode focuses on specific aspects of development
- Consistent Behavior: Agents maintain consistent personas across conversations
- Domain Knowledge: Pre-loaded with relevant technical knowledge
- Customizable: Create modes tailored to your project's specific needs
- Team Alignment: Standardized approaches across team members
When you create a repository from this GitHub template, it creates a completely independent copy with no automatic connection to pull updates. Here are the main approaches to get template updates:
This is the most flexible approach:
-
Add the template repo as a remote:
git remote add template https://github.com/original-owner/template-repo.git
-
Fetch the latest changes:
git fetch template
-
Merge or cherry-pick changes:
# To merge all changes from template's main branch git merge template/main # Or to cherry-pick specific commits git cherry-pick <commit-hash>
-
Resolve conflicts and push:
git push origin main
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
- MCP not working: Ensure your
.env.github-mcpfile is properly configured - Build failures: Run
pnpm installandpnpm run buildto ensure all dependencies are installed - Test failures: Run
pnpm test:allto run both TDD and BDD tests - Type errors: Run
pnpm type-checkto identify TypeScript issues - Linting errors: Run
pnpm lint:fixto automatically fix common issues - BDD test issues: Check the
features/directory for Gherkin syntax errors
- Check the Issues page
- Review the documentation in the
docs/directory - Ensure you're using the correct Node.js and pnpm versions
- Contact Olli Blum for assistance