name: 'step-07-patterns' description: 'Design implementation patterns and novel architectural patterns for consistency'
workflow_path: '{installed_path}'
thisStepFile: './step-07-patterns.md' nextStepFile: './step-08-validation.md' workflowFile: '{workflow_path}/workflow.md' outputFile: '{output_folder}/game-architecture.md'
patternCategories: '{workflow_path}/pattern-categories.csv' engineKnowledge: '{workflow_path}/knowledge/{selected_engine}-engine.md'
advancedElicitationTask: 'skill:bmad-advanced-elicitation'
Progress: Step 7 of 9 - Next: Validation
Define implementation patterns that ensure multiple AI agents write compatible, consistent code. Also identify and design any novel patterns needed for unique game features.
{communication_language}stepsCompleted: [1, 2, 3, 4, 5, 6, 7] before loading next step"First, let's identify if your game needs any custom architectural patterns.
Novel patterns are needed when:
From your GDD, I identified these potentially novel concepts: {{list_of_unique_features}}
Do any of these need custom architectural patterns?"
For each novel pattern:
"Novel Pattern: {{pattern_name}}
Let's design this pattern together.
The challenge: {{what_makes_this_unique}}
Questions to answer:
Walk me through how you envision {{pattern_name}} working."
After user explains:
"Based on your description, here's the pattern design:
{{pattern_name}} Pattern
Components: {{component_list_with_responsibilities}}
Data Flow: {{sequence_or_diagram}}
State Management: {{state_approach}}
Example Usage:
}
{{code_example}}
Does this capture your vision?"
Consult {engineKnowledge} for engine-specific coding patterns, best practices, and common architectural patterns.
"Now let's define standard implementation patterns for consistency.
These patterns ensure all AI agents:
Let's go through each category."
"Component Communication
How should game objects communicate?
Options:
For game systems, what's your preferred approach?"
"Entity Creation
How should game entities (enemies, items, etc.) be created?
Options:
What's your entity creation approach?"
"State Transitions
How should entities handle state changes?
Options:
What state management pattern for entities?"
"Data Access
How should systems access game data?
Options:
How should data be accessed?"
Based on the conversation, prepare the content:
## Implementation Patterns
These patterns ensure consistent implementation across all AI agents.
{{if_novel_patterns}}
### Novel Patterns
#### {{novel_pattern_name}}
**Purpose:** {{what_it_solves}}
**Components:**
{{component_list}}
**Data Flow:**
{{flow_description}}
**Implementation Guide:**
```{{language}}
{{implementation_example}}
```
Usage: {{when_to_use}} {{/if_novel_patterns}}
Pattern: {{communication_pattern}}
Example:
}
{{communication_example}}
Creation: {{creation_pattern}}
Example:
}
{{creation_example}}
Pattern: {{state_pattern}}
Example:
}
{{state_example}}
Access: {{data_pattern}}
Example:
}
{{data_example}}
| Pattern | Convention | Enforcement |
|---|
{{consistency_rules_table}}
### 9. Present Content and Menu
Show the generated content to the user and present:
"I've documented all implementation patterns.
**Here's what I'll add to the document:**
[Show the complete markdown content from step 8]
**Patterns Defined:**
- {{count}} standard patterns
- {{novel_count}} novel patterns
**Validation Check:**
- Are examples clear enough for AI agents?
- Do patterns cover all major coding scenarios?
- Are novel patterns fully documented?
**Select an Option:**
[A] Advanced Elicitation - Explore alternative patterns
[P] Party Mode - Get perspectives on patterns
[C] Continue - Save this and move to Validation (Step 8 of 9)"
### 10. Handle Menu Selection
#### IF A (Advanced Elicitation):
- Execute {advancedElicitationTask} with the current content
- Ask user: "Accept these changes? (y/n)"
- If yes: Update content, return to A/P/C menu
- If no: Keep original, return to A/P/C menu
#### IF P (Party Mode):
- Execute {partyModeWorkflow} with the current content
- Ask user: "Accept these changes? (y/n)"
- If yes: Update content, return to A/P/C menu
- If no: Keep original, return to A/P/C menu
#### IF C (Continue):
- Append the final content to `{outputFile}`
- Update frontmatter: `stepsCompleted: [1, 2, 3, 4, 5, 6, 7]`
- Load `{nextStepFile}`
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [C continue option] is selected and [patterns content saved with frontmatter updated], will you then load and read fully `{nextStepFile}`.
---
## SYSTEM SUCCESS/FAILURE METRICS
### SUCCESS:
- Novel patterns identified and designed
- Standard patterns selected with examples
- Every pattern has concrete code examples
- Consistency rules documented
- A/P/C menu presented and handled correctly
- Frontmatter updated with stepsCompleted: [1, 2, 3, 4, 5, 6, 7]
### SYSTEM FAILURE:
- Patterns without concrete examples
- Novel patterns missing design documentation
- Vague patterns that allow inconsistency
- Not presenting A/P/C menu after patterns
- Proceeding without user selecting 'C'
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.