siesa-agents 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +83 -83
  2. package/bin/install.js +400 -400
  3. package/bin/prepare-publish.js +26 -26
  4. package/bin/restore-folders.js +26 -26
  5. package/bmad-core/agent-teams/team-all.yaml +15 -15
  6. package/bmad-core/agent-teams/team-fullstack.yaml +19 -19
  7. package/bmad-core/agent-teams/team-ide-minimal.yaml +11 -11
  8. package/bmad-core/agent-teams/team-no-ui.yaml +14 -14
  9. package/bmad-core/agents/analyst.md +84 -84
  10. package/bmad-core/agents/architect.md +94 -94
  11. package/bmad-core/agents/backend-agent.md +189 -189
  12. package/bmad-core/agents/bmad-master.md +110 -110
  13. package/bmad-core/agents/bmad-orchestrator.md +147 -147
  14. package/bmad-core/agents/dev.md +81 -81
  15. package/bmad-core/agents/frontend-agent.md +168 -168
  16. package/bmad-core/agents/pm.md +84 -84
  17. package/bmad-core/agents/po.md +79 -79
  18. package/bmad-core/agents/qa.md +91 -91
  19. package/bmad-core/agents/sm.md +65 -65
  20. package/bmad-core/agents/ux-expert.md +69 -69
  21. package/bmad-core/checklists/architect-checklist.md +440 -440
  22. package/bmad-core/checklists/backend-checklist.md +142 -142
  23. package/bmad-core/checklists/change-checklist.md +184 -184
  24. package/bmad-core/checklists/frontend-checklist.md +105 -105
  25. package/bmad-core/checklists/pm-checklist.md +372 -372
  26. package/bmad-core/checklists/po-master-checklist.md +434 -434
  27. package/bmad-core/checklists/story-dod-checklist.md +96 -96
  28. package/bmad-core/checklists/story-draft-checklist.md +155 -155
  29. package/bmad-core/core-config.yaml +22 -22
  30. package/bmad-core/data/backend-standards.md +439 -439
  31. package/bmad-core/data/bmad-kb.md +809 -809
  32. package/bmad-core/data/brainstorming-techniques.md +38 -38
  33. package/bmad-core/data/elicitation-methods.md +156 -156
  34. package/bmad-core/data/frontend-standards.md +323 -323
  35. package/bmad-core/data/technical-preferences.md +5 -5
  36. package/bmad-core/data/test-levels-framework.md +148 -148
  37. package/bmad-core/data/test-priorities-matrix.md +174 -174
  38. package/bmad-core/enhanced-ide-development-workflow.md +248 -248
  39. package/bmad-core/install-manifest.yaml +230 -230
  40. package/bmad-core/tasks/advanced-elicitation.md +119 -119
  41. package/bmad-core/tasks/apply-qa-fixes.md +150 -150
  42. package/bmad-core/tasks/brownfield-create-epic.md +162 -162
  43. package/bmad-core/tasks/brownfield-create-story.md +149 -149
  44. package/bmad-core/tasks/correct-course.md +72 -72
  45. package/bmad-core/tasks/create-brownfield-story.md +314 -314
  46. package/bmad-core/tasks/create-component.md +102 -102
  47. package/bmad-core/tasks/create-deep-research-prompt.md +280 -280
  48. package/bmad-core/tasks/create-doc.md +103 -103
  49. package/bmad-core/tasks/create-entity.md +132 -132
  50. package/bmad-core/tasks/create-feature.md +90 -90
  51. package/bmad-core/tasks/create-next-story.md +114 -114
  52. package/bmad-core/tasks/create-service.md +117 -117
  53. package/bmad-core/tasks/create-use-case.md +140 -140
  54. package/bmad-core/tasks/document-project.md +345 -345
  55. package/bmad-core/tasks/execute-checklist.md +88 -88
  56. package/bmad-core/tasks/facilitate-brainstorming-session.md +138 -138
  57. package/bmad-core/tasks/generate-ai-frontend-prompt.md +53 -53
  58. package/bmad-core/tasks/index-docs.md +175 -175
  59. package/bmad-core/tasks/kb-mode-interaction.md +77 -77
  60. package/bmad-core/tasks/nfr-assess.md +345 -345
  61. package/bmad-core/tasks/qa-gate.md +163 -163
  62. package/bmad-core/tasks/review-story.md +316 -316
  63. package/bmad-core/tasks/risk-profile.md +355 -355
  64. package/bmad-core/tasks/scaffold-backend.md +110 -110
  65. package/bmad-core/tasks/scaffold-frontend.md +78 -78
  66. package/bmad-core/tasks/shard-doc.md +187 -187
  67. package/bmad-core/tasks/test-design.md +176 -176
  68. package/bmad-core/tasks/trace-requirements.md +266 -266
  69. package/bmad-core/tasks/validate-next-story.md +136 -136
  70. package/bmad-core/templates/architecture-tmpl.yaml +662 -662
  71. package/bmad-core/templates/brainstorming-output-tmpl.yaml +156 -156
  72. package/bmad-core/templates/brownfield-architecture-tmpl.yaml +477 -477
  73. package/bmad-core/templates/brownfield-prd-tmpl.yaml +281 -281
  74. package/bmad-core/templates/competitor-analysis-tmpl.yaml +307 -307
  75. package/bmad-core/templates/front-end-architecture-tmpl.yaml +258 -258
  76. package/bmad-core/templates/front-end-spec-tmpl.yaml +350 -350
  77. package/bmad-core/templates/fullstack-architecture-tmpl.yaml +824 -824
  78. package/bmad-core/templates/market-research-tmpl.yaml +253 -253
  79. package/bmad-core/templates/prd-tmpl.yaml +203 -203
  80. package/bmad-core/templates/project-brief-tmpl.yaml +222 -222
  81. package/bmad-core/templates/qa-gate-tmpl.yaml +103 -103
  82. package/bmad-core/templates/story-tmpl.yaml +138 -138
  83. package/bmad-core/user-guide.md +530 -530
  84. package/bmad-core/utils/bmad-doc-template.md +327 -327
  85. package/bmad-core/utils/workflow-management.md +71 -71
  86. package/bmad-core/workflows/brownfield-fullstack.yaml +298 -298
  87. package/bmad-core/workflows/brownfield-service.yaml +188 -188
  88. package/bmad-core/workflows/brownfield-ui.yaml +198 -198
  89. package/bmad-core/workflows/greenfield-fullstack.yaml +241 -241
  90. package/bmad-core/workflows/greenfield-service.yaml +207 -207
  91. package/bmad-core/workflows/greenfield-ui.yaml +236 -236
  92. package/bmad-core/working-in-the-brownfield.md +606 -606
  93. package/claude/commands/BMad/agents/backend.md +187 -187
  94. package/claude/commands/BMad/agents/frontend.md +150 -150
  95. package/github/b-mad-expert.md +742 -742
  96. package/github/chatmodes/analyst.chatmode.md +89 -89
  97. package/github/chatmodes/architect.chatmode.md +97 -97
  98. package/github/chatmodes/backend.chatmode.md +194 -194
  99. package/github/chatmodes/bmad-master.chatmode.md +115 -115
  100. package/github/chatmodes/bmad-orchestrator.chatmode.md +152 -152
  101. package/github/chatmodes/dev.chatmode.md +86 -86
  102. package/github/chatmodes/frontend.chatmode.md +157 -157
  103. package/github/chatmodes/pm.chatmode.md +89 -89
  104. package/github/chatmodes/po.chatmode.md +84 -84
  105. package/github/chatmodes/qa.chatmode.md +96 -96
  106. package/github/chatmodes/sm.chatmode.md +70 -70
  107. package/github/chatmodes/ux-expert.chatmode.md +74 -74
  108. package/index.js +9 -9
  109. package/package.json +37 -37
  110. package/vscode/mcp.json +11 -11
  111. package/vscode/settings.json +12 -12
@@ -1,114 +1,114 @@
1
- <!-- Powered by BMAD™ Core -->
2
-
3
- # Create Next Story Task
4
-
5
- ## Purpose
6
-
7
- To identify the next logical story based on project progress and epic definitions, and then to prepare a comprehensive, self-contained, and actionable story file using the `Story Template`. This task ensures the story is enriched with all necessary technical context, requirements, and acceptance criteria, making it ready for efficient implementation by a Developer Agent with minimal need for additional research or finding its own context.
8
-
9
- ## SEQUENTIAL Task Execution (Do not proceed until current Task is complete)
10
-
11
- ### 0. Load Core Configuration and Check Workflow
12
-
13
- - Load `.bmad-core/core-config.yaml` from the project root
14
- - If the file does not exist, HALT and inform the user: "core-config.yaml not found. This file is required for story creation. You can either: 1) Copy it from GITHUB bmad-core/core-config.yaml and configure it for your project OR 2) Run the BMad installer against your project to upgrade and add the file automatically. Please add and configure core-config.yaml before proceeding."
15
- - Extract key configurations: `devStoryLocation`, `prd.*`, `architecture.*`, `workflow.*`
16
-
17
- ### 1. Identify Next Story for Preparation
18
-
19
- #### 1.1 Locate Epic Files and Review Existing Stories
20
-
21
- - Based on `prdSharded` from config, locate epic files (sharded location/pattern or monolithic PRD sections)
22
- - If `devStoryLocation` has story files, load the highest `{epicNum}.{storyNum}.story.md` file
23
- - **If highest story exists:**
24
- - Verify status is 'Done'. If not, alert user: "ALERT: Found incomplete story! File: {lastEpicNum}.{lastStoryNum}.story.md Status: [current status] You should fix this story first, but would you like to accept risk & override to create the next story in draft?"
25
- - If proceeding, select next sequential story in the current epic
26
- - If epic is complete, prompt user: "Epic {epicNum} Complete: All stories in Epic {epicNum} have been completed. Would you like to: 1) Begin Epic {epicNum + 1} with story 1 2) Select a specific story to work on 3) Cancel story creation"
27
- - **CRITICAL**: NEVER automatically skip to another epic. User MUST explicitly instruct which story to create.
28
- - **If no story files exist:** The next story is ALWAYS 1.1 (first story of first epic)
29
- - Announce the identified story to the user: "Identified next story for preparation: {epicNum}.{storyNum} - {Story Title}"
30
-
31
- ### 2. Gather Story Requirements and Previous Story Context
32
-
33
- - Extract story requirements from the identified epic file
34
- - If previous story exists, review Dev Agent Record sections for:
35
- - Completion Notes and Debug Log References
36
- - Implementation deviations and technical decisions
37
- - Challenges encountered and lessons learned
38
- - Extract relevant insights that inform the current story's preparation
39
-
40
- ### 3. Gather Architecture Context
41
-
42
- #### 3.1 Determine Architecture Reading Strategy
43
-
44
- - **If `architectureVersion: >= v4` and `architectureSharded: true`**: Read `{architectureShardedLocation}/index.md` then follow structured reading order below
45
- - **Else**: Use monolithic `architectureFile` for similar sections
46
-
47
- #### 3.2 Read Architecture Documents Based on Story Type
48
-
49
- **For ALL Stories:** tech-stack.md, unified-project-structure.md, coding-standards.md, testing-strategy.md
50
-
51
- **For Backend/API Stories, additionally:** data-models.md, database-schema.md, backend-architecture.md, rest-api-spec.md, external-apis.md
52
-
53
- **For Frontend/UI Stories, additionally:** frontend-architecture.md, components.md, core-workflows.md, data-models.md
54
-
55
- **For Full-Stack Stories:** Read both Backend and Frontend sections above
56
-
57
- #### 3.3 Extract Story-Specific Technical Details
58
-
59
- Extract ONLY information directly relevant to implementing the current story. Do NOT invent new libraries, patterns, or standards not in the source documents.
60
-
61
- Extract:
62
-
63
- - Specific data models, schemas, or structures the story will use
64
- - API endpoints the story must implement or consume
65
- - Component specifications for UI elements in the story
66
- - File paths and naming conventions for new code
67
- - Testing requirements specific to the story's features
68
- - Security or performance considerations affecting the story
69
-
70
- ALWAYS cite source documents: `[Source: architecture/{filename}.md#{section}]`
71
-
72
- ### 4. Verify Project Structure Alignment
73
-
74
- - Cross-reference story requirements with Project Structure Guide from `docs/architecture/unified-project-structure.md`
75
- - Ensure file paths, component locations, or module names align with defined structures
76
- - Document any structural conflicts in "Project Structure Notes" section within the story draft
77
-
78
- ### 5. Populate Story Template with Full Context
79
-
80
- - Create new story file: `{devStoryLocation}/{epicNum}.{storyNum}.story.md` using Story Template
81
- - Fill in basic story information: Title, Status (Draft), Story statement, Acceptance Criteria from Epic
82
- - **`Dev Notes` section (CRITICAL):**
83
- - CRITICAL: This section MUST contain ONLY information extracted from architecture documents. NEVER invent or assume technical details.
84
- - Include ALL relevant technical details from Steps 2-3, organized by category:
85
- - **Previous Story Insights**: Key learnings from previous story
86
- - **Data Models**: Specific schemas, validation rules, relationships [with source references]
87
- - **API Specifications**: Endpoint details, request/response formats, auth requirements [with source references]
88
- - **Component Specifications**: UI component details, props, state management [with source references]
89
- - **File Locations**: Exact paths where new code should be created based on project structure
90
- - **Testing Requirements**: Specific test cases or strategies from testing-strategy.md
91
- - **Technical Constraints**: Version requirements, performance considerations, security rules
92
- - Every technical detail MUST include its source reference: `[Source: architecture/{filename}.md#{section}]`
93
- - If information for a category is not found in the architecture docs, explicitly state: "No specific guidance found in architecture docs"
94
- - **`Tasks / Subtasks` section:**
95
- - Generate detailed, sequential list of technical tasks based ONLY on: Epic Requirements, Story AC, Reviewed Architecture Information
96
- - Each task must reference relevant architecture documentation
97
- - Include unit testing as explicit subtasks based on the Testing Strategy
98
- - Link tasks to ACs where applicable (e.g., `Task 1 (AC: 1, 3)`)
99
- - Add notes on project structure alignment or discrepancies found in Step 4
100
-
101
- ### 6. Story Draft Completion and Review
102
-
103
- - Review all sections for completeness and accuracy
104
- - Verify all source references are included for technical details
105
- - Ensure tasks align with both epic requirements and architecture constraints
106
- - Update status to "Draft" and save the story file
107
- - Execute `.bmad-core/tasks/execute-checklist` `.bmad-core/checklists/story-draft-checklist`
108
- - Provide summary to user including:
109
- - Story created: `{devStoryLocation}/{epicNum}.{storyNum}.story.md`
110
- - Status: Draft
111
- - Key technical components included from architecture docs
112
- - Any deviations or conflicts noted between epic and architecture
113
- - Checklist Results
114
- - Next steps: For Complex stories, suggest the user carefully review the story draft and also optionally have the PO run the task `.bmad-core/tasks/validate-next-story`
1
+ <!-- Powered by BMAD™ Core -->
2
+
3
+ # Create Next Story Task
4
+
5
+ ## Purpose
6
+
7
+ To identify the next logical story based on project progress and epic definitions, and then to prepare a comprehensive, self-contained, and actionable story file using the `Story Template`. This task ensures the story is enriched with all necessary technical context, requirements, and acceptance criteria, making it ready for efficient implementation by a Developer Agent with minimal need for additional research or finding its own context.
8
+
9
+ ## SEQUENTIAL Task Execution (Do not proceed until current Task is complete)
10
+
11
+ ### 0. Load Core Configuration and Check Workflow
12
+
13
+ - Load `.bmad-core/core-config.yaml` from the project root
14
+ - If the file does not exist, HALT and inform the user: "core-config.yaml not found. This file is required for story creation. You can either: 1) Copy it from GITHUB bmad-core/core-config.yaml and configure it for your project OR 2) Run the BMad installer against your project to upgrade and add the file automatically. Please add and configure core-config.yaml before proceeding."
15
+ - Extract key configurations: `devStoryLocation`, `prd.*`, `architecture.*`, `workflow.*`
16
+
17
+ ### 1. Identify Next Story for Preparation
18
+
19
+ #### 1.1 Locate Epic Files and Review Existing Stories
20
+
21
+ - Based on `prdSharded` from config, locate epic files (sharded location/pattern or monolithic PRD sections)
22
+ - If `devStoryLocation` has story files, load the highest `{epicNum}.{storyNum}.story.md` file
23
+ - **If highest story exists:**
24
+ - Verify status is 'Done'. If not, alert user: "ALERT: Found incomplete story! File: {lastEpicNum}.{lastStoryNum}.story.md Status: [current status] You should fix this story first, but would you like to accept risk & override to create the next story in draft?"
25
+ - If proceeding, select next sequential story in the current epic
26
+ - If epic is complete, prompt user: "Epic {epicNum} Complete: All stories in Epic {epicNum} have been completed. Would you like to: 1) Begin Epic {epicNum + 1} with story 1 2) Select a specific story to work on 3) Cancel story creation"
27
+ - **CRITICAL**: NEVER automatically skip to another epic. User MUST explicitly instruct which story to create.
28
+ - **If no story files exist:** The next story is ALWAYS 1.1 (first story of first epic)
29
+ - Announce the identified story to the user: "Identified next story for preparation: {epicNum}.{storyNum} - {Story Title}"
30
+
31
+ ### 2. Gather Story Requirements and Previous Story Context
32
+
33
+ - Extract story requirements from the identified epic file
34
+ - If previous story exists, review Dev Agent Record sections for:
35
+ - Completion Notes and Debug Log References
36
+ - Implementation deviations and technical decisions
37
+ - Challenges encountered and lessons learned
38
+ - Extract relevant insights that inform the current story's preparation
39
+
40
+ ### 3. Gather Architecture Context
41
+
42
+ #### 3.1 Determine Architecture Reading Strategy
43
+
44
+ - **If `architectureVersion: >= v4` and `architectureSharded: true`**: Read `{architectureShardedLocation}/index.md` then follow structured reading order below
45
+ - **Else**: Use monolithic `architectureFile` for similar sections
46
+
47
+ #### 3.2 Read Architecture Documents Based on Story Type
48
+
49
+ **For ALL Stories:** tech-stack.md, unified-project-structure.md, coding-standards.md, testing-strategy.md
50
+
51
+ **For Backend/API Stories, additionally:** data-models.md, database-schema.md, backend-architecture.md, rest-api-spec.md, external-apis.md
52
+
53
+ **For Frontend/UI Stories, additionally:** frontend-architecture.md, components.md, core-workflows.md, data-models.md
54
+
55
+ **For Full-Stack Stories:** Read both Backend and Frontend sections above
56
+
57
+ #### 3.3 Extract Story-Specific Technical Details
58
+
59
+ Extract ONLY information directly relevant to implementing the current story. Do NOT invent new libraries, patterns, or standards not in the source documents.
60
+
61
+ Extract:
62
+
63
+ - Specific data models, schemas, or structures the story will use
64
+ - API endpoints the story must implement or consume
65
+ - Component specifications for UI elements in the story
66
+ - File paths and naming conventions for new code
67
+ - Testing requirements specific to the story's features
68
+ - Security or performance considerations affecting the story
69
+
70
+ ALWAYS cite source documents: `[Source: architecture/{filename}.md#{section}]`
71
+
72
+ ### 4. Verify Project Structure Alignment
73
+
74
+ - Cross-reference story requirements with Project Structure Guide from `docs/architecture/unified-project-structure.md`
75
+ - Ensure file paths, component locations, or module names align with defined structures
76
+ - Document any structural conflicts in "Project Structure Notes" section within the story draft
77
+
78
+ ### 5. Populate Story Template with Full Context
79
+
80
+ - Create new story file: `{devStoryLocation}/{epicNum}.{storyNum}.story.md` using Story Template
81
+ - Fill in basic story information: Title, Status (Draft), Story statement, Acceptance Criteria from Epic
82
+ - **`Dev Notes` section (CRITICAL):**
83
+ - CRITICAL: This section MUST contain ONLY information extracted from architecture documents. NEVER invent or assume technical details.
84
+ - Include ALL relevant technical details from Steps 2-3, organized by category:
85
+ - **Previous Story Insights**: Key learnings from previous story
86
+ - **Data Models**: Specific schemas, validation rules, relationships [with source references]
87
+ - **API Specifications**: Endpoint details, request/response formats, auth requirements [with source references]
88
+ - **Component Specifications**: UI component details, props, state management [with source references]
89
+ - **File Locations**: Exact paths where new code should be created based on project structure
90
+ - **Testing Requirements**: Specific test cases or strategies from testing-strategy.md
91
+ - **Technical Constraints**: Version requirements, performance considerations, security rules
92
+ - Every technical detail MUST include its source reference: `[Source: architecture/{filename}.md#{section}]`
93
+ - If information for a category is not found in the architecture docs, explicitly state: "No specific guidance found in architecture docs"
94
+ - **`Tasks / Subtasks` section:**
95
+ - Generate detailed, sequential list of technical tasks based ONLY on: Epic Requirements, Story AC, Reviewed Architecture Information
96
+ - Each task must reference relevant architecture documentation
97
+ - Include unit testing as explicit subtasks based on the Testing Strategy
98
+ - Link tasks to ACs where applicable (e.g., `Task 1 (AC: 1, 3)`)
99
+ - Add notes on project structure alignment or discrepancies found in Step 4
100
+
101
+ ### 6. Story Draft Completion and Review
102
+
103
+ - Review all sections for completeness and accuracy
104
+ - Verify all source references are included for technical details
105
+ - Ensure tasks align with both epic requirements and architecture constraints
106
+ - Update status to "Draft" and save the story file
107
+ - Execute `.bmad-core/tasks/execute-checklist` `.bmad-core/checklists/story-draft-checklist`
108
+ - Provide summary to user including:
109
+ - Story created: `{devStoryLocation}/{epicNum}.{storyNum}.story.md`
110
+ - Status: Draft
111
+ - Key technical components included from architecture docs
112
+ - Any deviations or conflicts noted between epic and architecture
113
+ - Checklist Results
114
+ - Next steps: For Complex stories, suggest the user carefully review the story draft and also optionally have the PO run the task `.bmad-core/tasks/validate-next-story`
@@ -1,118 +1,118 @@
1
- # Create Backend Service (Bounded Context)
2
-
3
- ## Purpose
4
- Create a new bounded context/service within an existing microservice following hexagonal architecture and DDD principles.
5
-
6
- ## Task Configuration
7
- ```yaml
8
- elicit: true
9
- interactive: true
10
- required_params:
11
- - service_name
12
- - microservice_name
13
- - domain_entities
14
- - use_cases
15
- optional_params:
16
- - external_integrations
17
- - events
18
- ```
19
-
20
- ## Task Execution
21
-
22
- ### Step 1: Elicit Service Requirements
23
- Ask user for:
24
-
25
- **Service Name**: What is the bounded context name? (use kebab-case)
26
- **Microservice Name**: Which microservice will contain this service?
27
- **Domain Entities**: What are the main business entities? (e.g., Quote, Product, Customer)
28
- **Use Cases**: What are the main operations users can perform?
29
- **External Integrations**: Any external services this context needs to integrate with? (optional)
30
- **Domain Events**: Any domain events this context will publish/subscribe to? (optional)
31
-
32
- ### Step 2: Create Hexagonal Architecture Structure
33
- Generate the following structure:
34
-
35
- ```
36
- src/modules/{service-name}/
37
- ├── application/
38
- │ ├── ports/
39
- │ │ ├── repositories/
40
- │ │ │ └── {entity}.repository.interface.ts
41
- │ │ └── services/
42
- │ │ └── {external-service}.interface.ts
43
- │ ├── use-cases/
44
- │ │ ├── create-{entity}.use-case.ts
45
- │ │ ├── get-{entity}.use-case.ts
46
- │ │ ├── update-{entity}.use-case.ts
47
- │ │ └── delete-{entity}.use-case.ts
48
- │ ├── commands/
49
- │ │ └── create-{entity}.command.ts
50
- │ ├── queries/
51
- │ │ └── get-{entity}.query.ts
52
- │ └── dto/
53
- │ ├── create-{entity}.dto.ts
54
- │ └── {entity}.response.dto.ts
55
- ├── domain/
56
- │ ├── entities/
57
- │ │ └── {entity}.entity.ts
58
- │ ├── value-objects/
59
- │ │ └── {entity}-id.value-object.ts
60
- │ ├── aggregates/
61
- │ │ └── {entity}.aggregate.ts
62
- │ ├── events/
63
- │ │ └── {entity}-created.event.ts
64
- │ └── services/
65
- │ └── {entity}.domain-service.ts
66
- └── infrastructure/
67
- ├── repositories/
68
- │ └── prisma-{entity}.repository.ts
69
- ├── services/
70
- │ └── {external-service}.adapter.ts
71
- └── events/
72
- └── {entity}-event.handler.ts
73
- ```
74
-
75
- ### Step 3: Generate Domain Layer
76
- For each entity:
77
- - Create domain entity with business rules
78
- - Generate value objects for type safety
79
- - Create aggregates for consistency boundaries
80
- - Define domain events for side effects
81
- - Implement domain services for complex business logic
82
-
83
- ### Step 4: Generate Application Layer
84
- For each use case:
85
- - Create use case with dependency injection
86
- - Define command/query objects
87
- - Create DTOs for input/output
88
- - Implement application services
89
- - Define repository and service interfaces (ports)
90
-
91
- ### Step 5: Generate Infrastructure Layer
92
- - Implement Prisma repository adapters
93
- - Create external service adapters
94
- - Implement event handlers
95
- - Configure dependency injection
96
- - Setup database migrations for new entities
97
-
98
- ### Step 6: Generate API Layer
99
- - Create REST controllers
100
- - Add validation decorators
101
- - Configure Swagger documentation
102
- - Implement guards and middleware
103
- - Add error handling
104
-
105
- ### Step 7: Generate Tests
106
- - Unit tests for domain entities and services
107
- - Integration tests for use cases
108
- - Repository tests with test database
109
- - Controller tests with mocked dependencies
110
- - E2E tests for complete workflows
111
-
112
- ## Completion Criteria
113
- - Service follows hexagonal architecture patterns
114
- - All layers properly separated and tested
115
- - Prisma schema updated and migrated
116
- - API endpoints documented in Swagger
117
- - Tests cover all critical paths
1
+ # Create Backend Service (Bounded Context)
2
+
3
+ ## Purpose
4
+ Create a new bounded context/service within an existing microservice following hexagonal architecture and DDD principles.
5
+
6
+ ## Task Configuration
7
+ ```yaml
8
+ elicit: true
9
+ interactive: true
10
+ required_params:
11
+ - service_name
12
+ - microservice_name
13
+ - domain_entities
14
+ - use_cases
15
+ optional_params:
16
+ - external_integrations
17
+ - events
18
+ ```
19
+
20
+ ## Task Execution
21
+
22
+ ### Step 1: Elicit Service Requirements
23
+ Ask user for:
24
+
25
+ **Service Name**: What is the bounded context name? (use kebab-case)
26
+ **Microservice Name**: Which microservice will contain this service?
27
+ **Domain Entities**: What are the main business entities? (e.g., Quote, Product, Customer)
28
+ **Use Cases**: What are the main operations users can perform?
29
+ **External Integrations**: Any external services this context needs to integrate with? (optional)
30
+ **Domain Events**: Any domain events this context will publish/subscribe to? (optional)
31
+
32
+ ### Step 2: Create Hexagonal Architecture Structure
33
+ Generate the following structure:
34
+
35
+ ```
36
+ src/modules/{service-name}/
37
+ ├── application/
38
+ │ ├── ports/
39
+ │ │ ├── repositories/
40
+ │ │ │ └── {entity}.repository.interface.ts
41
+ │ │ └── services/
42
+ │ │ └── {external-service}.interface.ts
43
+ │ ├── use-cases/
44
+ │ │ ├── create-{entity}.use-case.ts
45
+ │ │ ├── get-{entity}.use-case.ts
46
+ │ │ ├── update-{entity}.use-case.ts
47
+ │ │ └── delete-{entity}.use-case.ts
48
+ │ ├── commands/
49
+ │ │ └── create-{entity}.command.ts
50
+ │ ├── queries/
51
+ │ │ └── get-{entity}.query.ts
52
+ │ └── dto/
53
+ │ ├── create-{entity}.dto.ts
54
+ │ └── {entity}.response.dto.ts
55
+ ├── domain/
56
+ │ ├── entities/
57
+ │ │ └── {entity}.entity.ts
58
+ │ ├── value-objects/
59
+ │ │ └── {entity}-id.value-object.ts
60
+ │ ├── aggregates/
61
+ │ │ └── {entity}.aggregate.ts
62
+ │ ├── events/
63
+ │ │ └── {entity}-created.event.ts
64
+ │ └── services/
65
+ │ └── {entity}.domain-service.ts
66
+ └── infrastructure/
67
+ ├── repositories/
68
+ │ └── prisma-{entity}.repository.ts
69
+ ├── services/
70
+ │ └── {external-service}.adapter.ts
71
+ └── events/
72
+ └── {entity}-event.handler.ts
73
+ ```
74
+
75
+ ### Step 3: Generate Domain Layer
76
+ For each entity:
77
+ - Create domain entity with business rules
78
+ - Generate value objects for type safety
79
+ - Create aggregates for consistency boundaries
80
+ - Define domain events for side effects
81
+ - Implement domain services for complex business logic
82
+
83
+ ### Step 4: Generate Application Layer
84
+ For each use case:
85
+ - Create use case with dependency injection
86
+ - Define command/query objects
87
+ - Create DTOs for input/output
88
+ - Implement application services
89
+ - Define repository and service interfaces (ports)
90
+
91
+ ### Step 5: Generate Infrastructure Layer
92
+ - Implement Prisma repository adapters
93
+ - Create external service adapters
94
+ - Implement event handlers
95
+ - Configure dependency injection
96
+ - Setup database migrations for new entities
97
+
98
+ ### Step 6: Generate API Layer
99
+ - Create REST controllers
100
+ - Add validation decorators
101
+ - Configure Swagger documentation
102
+ - Implement guards and middleware
103
+ - Add error handling
104
+
105
+ ### Step 7: Generate Tests
106
+ - Unit tests for domain entities and services
107
+ - Integration tests for use cases
108
+ - Repository tests with test database
109
+ - Controller tests with mocked dependencies
110
+ - E2E tests for complete workflows
111
+
112
+ ## Completion Criteria
113
+ - Service follows hexagonal architecture patterns
114
+ - All layers properly separated and tested
115
+ - Prisma schema updated and migrated
116
+ - API endpoints documented in Swagger
117
+ - Tests cover all critical paths
118
118
  - Dependencies properly injected