# AI-Generated Rules Suggestions Template

**Generated on:** {{ timestamp }}  
**Project:** {{ project_name }}  
**Analysis Confidence:** {{ confidence_score }}/1.0

## Executive Summary

{{ executive_summary }}

## Detected Patterns

### Technology Stack
{% for tech in technology_stack %}
- **{{ tech }}**: {{ tech_details.get(tech, 'Detected in project') }}
{% endfor %}

### Architectural Patterns
{% for pattern in architectural_patterns %}
- **{{ pattern }}**: {{ pattern_descriptions.get(pattern, 'Pattern detected in codebase') }}
{% endfor %}

### Current Practices
{% for practice in current_practices %}
- {{ practice }}
{% endfor %}

{% if inconsistencies %}
### Inconsistencies Found
{% for inconsistency in inconsistencies %}
- ⚠️ **{{ inconsistency.type }}**: {{ inconsistency.description }}
  - **Impact**: {{ inconsistency.impact }}
  - **Suggested Fix**: {{ inconsistency.suggested_fix }}
{% endfor %}
{% endif %}

## Suggested Rules

### High Priority (Mandatory)
{% for suggestion in suggestions %}
{% if suggestion.suggested_rule.priority.value == 'mandatory' %}
#### {{ suggestion.suggested_rule.description }}

**Rule:** {{ suggestion.suggested_rule.content }}

**Category:** {{ suggestion.suggested_rule.category.value|title }}  
**Confidence:** {{ suggestion.confidence }}/1.0

**Reasoning:** {{ suggestion.reasoning }}

{% if suggestion.examples %}
**Examples:**
{% for example in suggestion.examples %}
- {{ example }}
{% endfor %}
{% endif %}

{% if suggestion.affected_files %}
**Affected Files:**
{% for file in suggestion.affected_files %}
- `{{ file }}`
{% endfor %}
{% endif %}

---
{% endif %}
{% endfor %}

### Medium Priority (Recommended)
{% for suggestion in suggestions %}
{% if suggestion.suggested_rule.priority.value == 'recommended' %}
#### {{ suggestion.suggested_rule.description }}

**Rule:** {{ suggestion.suggested_rule.content }}

**Category:** {{ suggestion.suggested_rule.category.value|title }}  
**Confidence:** {{ suggestion.confidence }}/1.0

**Reasoning:** {{ suggestion.reasoning }}

{% if suggestion.examples %}
**Examples:**
{% for example in suggestion.examples %}
- {{ example }}
{% endfor %}
{% endif %}

---
{% endif %}
{% endfor %}

### Low Priority (Optional)
{% for suggestion in suggestions %}
{% if suggestion.suggested_rule.priority.value == 'optional' %}
#### {{ suggestion.suggested_rule.description }}

**Rule:** {{ suggestion.suggested_rule.content }}

**Category:** {{ suggestion.suggested_rule.category.value|title }}  
**Confidence:** {{ suggestion.confidence }}/1.0

**Reasoning:** {{ suggestion.reasoning }}

---
{% endif %}
{% endfor %}

## Implementation Roadmap

### Phase 1: Critical Rules (Week 1-2)
{% for suggestion in suggestions %}
{% if suggestion.suggested_rule.priority.value == 'mandatory' and suggestion.confidence > 0.8 %}
- [ ] {{ suggestion.suggested_rule.description }}
{% endif %}
{% endfor %}

### Phase 2: Quality Improvements (Week 3-4)
{% for suggestion in suggestions %}
{% if suggestion.suggested_rule.priority.value == 'recommended' and suggestion.confidence > 0.7 %}
- [ ] {{ suggestion.suggested_rule.description }}
{% endif %}
{% endfor %}

### Phase 3: Nice-to-Have (Month 2)
{% for suggestion in suggestions %}
{% if suggestion.suggested_rule.priority.value == 'optional' or suggestion.confidence <= 0.7 %}
- [ ] {{ suggestion.suggested_rule.description }}
{% endif %}
{% endfor %}

## Rules File Template

Based on the analysis, here's a suggested rules file structure:

```yaml
# {{ project_name }} Development Rules
# Generated by AI Analysis on {{ timestamp }}

rules:
{% for suggestion in suggestions %}
  - description: |
      {{ suggestion.suggested_rule.description }}
    content: |
      {{ suggestion.suggested_rule.content }}
    category: "{{ suggestion.suggested_rule.category.value }}"
    priority: "{{ suggestion.suggested_rule.priority.value }}"
    # AI Confidence: {{ suggestion.confidence }}
    # Reasoning: {{ suggestion.reasoning }}
    
{% endfor %}
```

## Quality Metrics

### Current Project Health
- **Code Consistency**: {{ metrics.consistency_score }}/10
- **Documentation Coverage**: {{ metrics.documentation_score }}/10
- **Testing Maturity**: {{ metrics.testing_score }}/10
- **Security Awareness**: {{ metrics.security_score }}/10

### Expected Improvement with Rules
- **Code Consistency**: {{ metrics.projected_consistency }}/10 (+{{ metrics.consistency_improvement }})
- **Documentation Coverage**: {{ metrics.projected_documentation }}/10 (+{{ metrics.documentation_improvement }})
- **Testing Maturity**: {{ metrics.projected_testing }}/10 (+{{ metrics.testing_improvement }})
- **Security Awareness**: {{ metrics.projected_security }}/10 (+{{ metrics.security_improvement }})

## AI Analysis Details

### Analysis Method
- **Pattern Recognition**: Automated scanning of codebase structure and content
- **Best Practices Database**: Comparison against industry standards for detected technologies
- **Inconsistency Detection**: Identification of contradictory patterns within the codebase
- **Confidence Scoring**: Statistical analysis of pattern strength and clarity

### Limitations
- AI analysis is based on static code analysis and may miss runtime behaviors
- Suggestions are general best practices and may need project-specific adjustments
- Human review and validation is recommended for all suggestions
- Domain-specific requirements may not be fully captured

### Feedback Loop
To improve future suggestions, please provide feedback on:
- Which suggestions were most valuable
- Which suggestions were not applicable to your project
- Any critical rules that were missed by the analysis

## Next Steps

1. **Review Suggestions**: Carefully review each suggested rule for applicability
2. **Customize Rules**: Modify suggested rules to fit your specific requirements
3. **Prioritize Implementation**: Start with high-confidence, high-impact rules
4. **Team Discussion**: Discuss suggestions with your development team
5. **Gradual Rollout**: Implement rules gradually to minimize disruption
6. **Monitor Impact**: Track the impact of implemented rules on code quality

## Support

For questions about these suggestions or to provide feedback:
- Review the reasoning provided for each suggestion
- Consider the confidence scores when prioritizing
- Adapt rules to fit your team's workflow and requirements
- Use the suggested implementation phases as a starting point

---

*This analysis was generated by ProjectPrompt's AI Rules Suggester. Always review and validate suggestions before implementation.*
