GitHub Copilot instructions for Lujanita chatbot development following Spec-Driven Development methodology with BDD and Model Context Protocol integration
Development instructions for the Lujanita chatbot following GitHub's Spec-Driven Development (SDD) toolkit. This project implements a conversational automation platform for Lujan de Cuyo Express with React frontend, Java Spring Boot BFF, and Odoo backend integration via Model Context Protocol (MCP).
**Important**: MCP stands for "Model Context Protocol" (not "Model Content Protocol"). Always use correct terminology.
**STOP** - Before writing any code, verify specification exists in `/specs/NNN-feature/`:
```
/specs/NNN-feature-name/
├── spec.md # User stories, FR-XXX requirements, acceptance criteria
├── plan.md # Architecture decisions
├── research.md # Technology evaluation
├── data-model.md # Entity schemas and MCP/Odoo relationships
└── tasks.md # Task breakdown with test-first approach
```
**If specification doesn't exist** → Create it first using `.github/prompts/speckit.*.prompt.md`
**AFTER creating `spec.md` and BEFORE implementing code**:
1. Use `.github/prompts/speckit.gherkin.prompt.md` to generate feature files
2. Each User Story must produce a Gherkin feature file in the appropriate layer:
- React Widget → `apps/widget/features/`
- BFF (Java) → `apps/middleware/features/`
- Orchestration services → `apps/services/features/`
3. Each feature file MUST include:
- Jira tags (`@JIRA:LUJ-XXX`)
- Priority tags (`@P1`, `@P2`, `@P3`)
- Requirement tags (`@FR-XXX`)
- Executable Given-When-Then scenarios
4. Create Jira issue "BDD: <Feature Short Name>" with:
- Path to `spec.md`
- List of created feature files + paths
- Scenario and tag counts
- Initial command (must fail): e.g., `cd apps/widget && npm run test:bdd -- features/chatbot.feature`
5. Comment on original business issue: "Gherkin feature generated at: <paths>; see BDD issue: LUJ-XYZ"
Example Gherkin:
```gherkin
@JIRA:LUJ-2
@P1
Feature: Odoo order reception
As Lujanita assistant I need to query confirmed orders in Odoo via MCP
@smoke @FR-001
Scenario: Get confirmed order
Given a confirmed order exists in Odoo
When Lujanita queries the order by ID
Then respond with status, date and contact details
```
Read in this order:
1. `/specs/NNN-feature/spec.md` - Business requirements
2. Gherkin feature files - Acceptance criteria
3. This file - General project patterns
4. `.github/copilot-knowledge/` - Specific technical patterns
5. `/docs/` - Reference documentation (Odoo, MCP, internal flows)
**A. Implement Step Definitions (BDD Tests - MUST FAIL)**
```bash
cd apps/widget && npm run test:bdd # MUST FAIL - steps undefined
cd apps/middleware && mvn test -Dcucumber.filter.tags="@bdd" # MUST FAIL - steps undefined
```
**B. Implement Minimal Code**
```bash
cd apps/widget && npm run test:unit # Vitest + Testing Library
cd apps/middleware && mvn test # JUnit + WireMock for Odoo/MCP + Ollama
```
**C. Verify Tests Pass**
```bash
cd apps/widget && npm run test:bdd && npm run test
cd apps/middleware && mvn test -Dcucumber.filter.tags="@bdd" && mvn test
```
**D. Refactor and Commit**
```bash
git add .
git commit -m "feat(LUJ-XXX): Implement [feature] with BDD tests"
```
**Location**: `.github/copilot-knowledge/`
| Article | When to Read |
|---------|-------------|
| **widget-patterns.md** | React components, i18n, chat hooks |
| **middleware-patterns.md** | BFF↔MCP↔Ollama integration, Spring Boot, HTTP clients |
| **testing-guide.md** | BDD/Unit testing strategy |
| **contracts-mcp.md** | MCP contracts between BFF and Odoo |
**Usage**: Reference specific articles in prompts, e.g., "Implement step following middleware-patterns.md"
```
apps/
widget/ # React Widget + Vite (port 4173)
middleware/ # Java Spring Boot BFF + Cucumber (port 9000)
services/ # Additional orchestrations
packages/
contracts/ # MCP definitions, shared DTOs
ui/ # Shared components (if applicable)
platform/
odoo/ # MCP server configuration in Odoo
```
```
Is it shared between widget and BFF?
├─ YES → packages/
│ ├─ MCP Contracts → packages/contracts/
│ └─ UI Components → packages/ui/
└─ NO → apps/
├─ Conversation UI → apps/widget/
├─ BFF/REST API → apps/middleware/
```
```java
import lombok.Data;
@Data
public class MyDTO {
private String name;
private int age;
}
```
```
┌──────────┐
│ E2E │ Critical conversation scenarios
├──────────┤
│ Integr. │ MCP contracts and Odoo/LLM calls
├──────────┤
│ Unit │ Hooks, Java services, reducers
└──────────┘
```
```bash
cd apps/widget && npm run test # Unit tests
cd apps/widget && npm run test:bdd # BDD tests
cd apps/middleware && mvn test # Unit/Integration tests
cd apps/middleware && mvn testBdd # BDD tests
```
1. Write tests before implementation
2. Every BDD step must be used in CI
3. MCP contracts must have mocks in `packages/contracts/mocks/`
1. Create `/specs/NNN-feature/` (spec, plan, data-model, tasks)
2. Generate Gherkin feature files (widget/BFF)
3. Write failing tests
4. Implement minimum code to pass
5. Update documentation
1. Define DTO in `packages/contracts/src`
2. Document in `data-model.md`
3. Add compatibility tests (Java + TypeScript)
4. Publish mocks in `packages/contracts/mocks/`
1. Verify specification exists (`/specs/`)
2. Read relevant knowledge base articles
3. Generate failing BDD/Unit tests
4. Implement following established patterns
5. Suggest validation commands (`npm run test`, `mvn test`, etc.)
| Task | Command |
|------|---------|
| Setup widget | `cd apps/widget && npm install` |
| Setup BFF | `cd apps/middleware && mvn clean install` |
| Run widget tests | `npm run test` |
| Run BFF tests | `mvn test` |
| Run widget BDD | `npm run test:bdd` |
| Run BFF BDD | `mvn testBdd` |
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/lujanita-spec-driven-development/raw