# Report - Quality and Progress Report Generation Utility

You are the reporting utility for the Infinite Agentic Loop ecosystem. Your purpose is to generate comprehensive quality and progress reports for generated iterations.

## Chain-of-Thought Report Generation Process

Let's think through report generation step by step:

### Step 1: Define Report Scope
Understand what report is needed:
1. **Report Purpose**
   - Executive summary for stakeholders?
   - Detailed analysis for developers?
   - Quality assessment for validation?
   - Historical comparison for trends?

2. **Report Audience**
   - Technical users who want details?
   - Non-technical users who need summaries?
   - Decision-makers who need recommendations?
   - Archival documentation?

3. **Time Period**
   - Single generation session?
   - Multiple sessions over time?
   - Since last report?
   - All-time comprehensive?

### Step 2: Data Collection
Systematically gather report data:

**Generation Data:**
1. **Iteration Inventory**
   - Use Glob to find all output files
   - Count total iterations
   - Identify file types
   - Note creation dates

2. **Specification Reference**
   - Read spec file
   - Extract requirements
   - Identify quality criteria
   - Note uniqueness constraints

**Quality Data:**
3. **Test Results** (if available)
   - Run `/test-output` if not already done
   - Collect pass/fail statistics
   - Gather quality scores
   - Note common issues

4. **Pattern Analysis**
   - Run `/analyze` if not already done
   - Collect theme diversity data
   - Identify pattern distributions
   - Note structural consistency

**Performance Data:**
5. **Execution Metrics**
   - File creation timestamps
   - Generation duration
   - Wave information
   - Resource usage

### Step 3: Quantitative Analysis
Calculate key metrics:

**Completion Metrics:**
- Total iterations generated
- Iterations per specification
- Generation success rate = successful / attempted
- Average generation time per iteration

**Quality Metrics:**
- Test pass rate = passed / total
- Average quality score = sum(scores) / count
- Quality standard deviation = spread of scores
- Excellent iteration count (score >= 90)

**Diversity Metrics:**
- Unique themes count
- Theme distribution evenness
- Variation coefficient
- Duplication rate = duplicates / total

**Efficiency Metrics:**
- Iterations per hour
- Average file size
- Storage efficiency
- Context utilization

**Trend Metrics:**
- Quality trend = (recent_avg - early_avg) / early_avg
- Speed trend = (recent_speed - early_speed) / early_speed
- Success rate trend over time

### Step 4: Qualitative Analysis
Assess non-numeric qualities:

**Content Quality:**
1. **Creativity Assessment**
   - How innovative are iterations?
   - Do they show progression?
   - Is there creative diversity?
   - Any standout examples?

2. **Technical Quality**
   - Code correctness
   - Structure adherence
   - Best practices followed
   - Professional polish

3. **Usability Quality**
   - User-facing clarity
   - Documentation completeness
   - Ease of understanding
   - Practical applicability

**Pattern Quality:**
4. **Theme Coherence**
   - Are themes well-executed?
   - Is variation meaningful?
   - Are there theme gaps?
   - Is progression logical?

5. **Structural Consistency**
   - Do iterations follow patterns?
   - Are standards maintained?
   - Is quality consistent?
   - Any structural drift?

### Step 5: Comparative Analysis
Contextualize performance:

**Specification Compliance:**
- How well do outputs match spec requirements?
- Which requirements fully met?
- Which requirements partially met?
- Which requirements missed?

**Historical Comparison:**
- How does this compare to previous runs?
- Is quality improving over time?
- Are there regression patterns?
- What's the trajectory?

**Best Practice Alignment:**
- Industry standards met?
- Quality benchmarks achieved?
- Best practices followed?
- Professional grade attained?

### Step 6: Issue Identification
Categorize problems and concerns:

**Quality Issues:**
1. **Critical Issues** - Block usage
   - Spec violations
   - Technical errors
   - Incomplete outputs

2. **Moderate Issues** - Degrade quality
   - Inconsistencies
   - Minor spec deviations
   - Quality variations

3. **Minor Issues** - Polish opportunities
   - Style inconsistencies
   - Documentation gaps
   - Enhancement opportunities

**Pattern Issues:**
4. **Diversity Issues**
   - Theme exhaustion
   - Unintended duplication
   - Narrow variation range

5. **Consistency Issues**
   - Structural variations
   - Quality fluctuations
   - Standard deviations

### Step 7: Insight Generation
Synthesize findings into actionable insights:

**Success Factors:**
- What contributed to high-quality iterations?
- What patterns worked well?
- What approaches should continue?

**Improvement Opportunities:**
- Where is quality lacking?
- What patterns need work?
- What could be enhanced?

**Recommendations:**
- Specific actions to improve quality
- Spec refinements to consider
- Process improvements to implement

### Step 8: Report Formatting
Structure information for clarity:
1. **Executive Summary** - Key findings at-a-glance
2. **Quantitative Analysis** - Metrics and statistics
3. **Qualitative Assessment** - Content and pattern quality
4. **Comparative Analysis** - Context and benchmarks
5. **Issues and Risks** - Problems identified
6. **Insights and Recommendations** - Actionable guidance
7. **Appendices** - Supporting details

## Command Format

```
/report [output_dir] [spec_file] [options]
```

**Arguments:**
- `output_dir`: Directory containing outputs to report on
- `spec_file`: Specification file used for generation
- `options`: (optional) Report type: summary, detailed, executive, technical

## Report Structure

```markdown
# Generation Report: [Output Directory]

**Report Date:** [timestamp]
**Report Type:** [Summary / Detailed / Executive / Technical]
**Generation Specification:** [spec file name]

---

## Executive Summary

### Key Findings
1. **[Finding 1]** - [brief description]
2. **[Finding 2]** - [brief description]
3. **[Finding 3]** - [brief description]

### Overall Assessment
- **Quality Rating:** [Excellent / Good / Acceptable / Needs Improvement]
- **Spec Compliance:** [Fully Compliant / Mostly Compliant / Partial / Non-Compliant]
- **Recommendation:** [Approve / Conditional / Revise / Reject]

### Critical Statistics
- Total Iterations: X
- Pass Rate: Y%
- Average Quality: Z/100
- Generation Period: [date range]

---

## Quantitative Analysis

### Completion Metrics
| Metric | Value | Target | Status |
|--------|-------|--------|--------|
| Total Iterations | X | Y | ✓/✗ |
| Success Rate | X% | Y% | ✓/✗ |
| Avg Time/Iteration | X min | Y min | ✓/✗ |

### Quality Metrics
| Metric | Value | Benchmark | Assessment |
|--------|-------|-----------|------------|
| Test Pass Rate | X% | 90% | [Good/Fair/Poor] |
| Avg Quality Score | X/100 | 80/100 | [Good/Fair/Poor] |
| Excellent Count | X | Y | [Good/Fair/Poor] |
| Quality Std Dev | X | <10 | [Good/Fair/Poor] |

### Diversity Metrics
| Metric | Value | Assessment |
|--------|-------|------------|
| Unique Themes | X | [High/Medium/Low] |
| Theme Distribution | [Evenness score] | [Even/Skewed] |
| Duplication Rate | X% | [Low/Medium/High] |

### Efficiency Metrics
| Metric | Value |
|--------|-------|
| Iterations/Hour | X |
| Avg File Size | Y KB |
| Total Storage | Z MB |
| Context Utilization | A% |

### Trend Analysis
| Metric | Trend | Change |
|--------|-------|--------|
| Quality | ↗/→/↘ | +X% |
| Speed | ↗/→/↘ | +Y% |
| Success Rate | ↗/→/↘ | +Z% |

---

## Qualitative Assessment

### Content Quality

#### Creativity
**Rating:** [Excellent / Good / Acceptable / Lacking]

**Observations:**
- [Observation 1]
- [Observation 2]
- [Observation 3]

**Standout Examples:**
- [filename] - [what makes it excellent]
- [filename] - [what makes it excellent]

#### Technical Quality
**Rating:** [Excellent / Good / Acceptable / Lacking]

**Strengths:**
- [Strength 1]
- [Strength 2]

**Weaknesses:**
- [Weakness 1]
- [Weakness 2]

#### Usability Quality
**Rating:** [Excellent / Good / Acceptable / Lacking]

**User-Facing Strengths:**
- [Strength 1]
- [Strength 2]

**User-Facing Concerns:**
- [Concern 1]
- [Concern 2]

### Pattern Quality

#### Theme Coherence
**Assessment:** [Strong / Moderate / Weak]

**Themes Explored:**
1. [Theme 1] - X iterations - [well-executed / needs work]
2. [Theme 2] - Y iterations - [well-executed / needs work]
3. [Theme 3] - Z iterations - [well-executed / needs work]

**Theme Gaps:**
- [Gap 1] - [opportunity description]
- [Gap 2] - [opportunity description]

#### Structural Consistency
**Assessment:** [Highly Consistent / Mostly Consistent / Inconsistent]

**Consistency Strengths:**
- [Strength 1]
- [Strength 2]

**Consistency Issues:**
- [Issue 1] - affects X iterations
- [Issue 2] - affects Y iterations

---

## Comparative Analysis

### Specification Compliance

#### Fully Met Requirements
- [Requirement 1] - [evidence]
- [Requirement 2] - [evidence]

#### Partially Met Requirements
- [Requirement 1] - [gap description]
- [Requirement 2] - [gap description]

#### Unmet Requirements
[None] OR:
- [Requirement 1] - [why not met]

**Overall Compliance Score:** X/100

### Historical Comparison

#### Previous Generation Comparison
| Metric | Current | Previous | Change |
|--------|---------|----------|--------|
| Total Iterations | X | Y | +Z |
| Avg Quality | A | B | +C |
| Pass Rate | D% | E% | +F% |

**Trends:**
- Quality is [improving/stable/declining]
- Efficiency is [improving/stable/declining]
- Consistency is [improving/stable/declining]

### Benchmark Comparison

#### Industry Benchmarks
| Standard | Target | Achieved | Status |
|----------|--------|----------|--------|
| Quality Floor | 70/100 | X/100 | ✓/✗ |
| Pass Rate | 85% | Y% | ✓/✗ |
| Diversity Index | 0.7 | Z | ✓/✗ |

---

## Issues and Risks

### Critical Issues (Require Immediate Action)
[None Identified] OR:
1. **[Issue Title]**
   - **Severity:** Critical
   - **Affected:** [scope]
   - **Impact:** [consequences]
   - **Root Cause:** [analysis]
   - **Remediation:** [specific steps]
   - **Priority:** High

### Moderate Issues (Address Soon)
[None Identified] OR:
1. **[Issue Title]**
   - **Severity:** Moderate
   - **Affected:** [scope]
   - **Impact:** [consequences]
   - **Recommendation:** [suggested fix]
   - **Priority:** Medium

### Minor Issues (Enhancement Opportunities)
1. **[Issue Title]**
   - **Severity:** Minor
   - **Opportunity:** [description]
   - **Benefit:** [if addressed]
   - **Priority:** Low

### Risk Assessment
| Risk | Likelihood | Impact | Mitigation |
|------|------------|--------|------------|
| [Risk 1] | High/Med/Low | High/Med/Low | [strategy] |
| [Risk 2] | High/Med/Low | High/Med/Low | [strategy] |

---

## Insights and Recommendations

### Key Insights

#### Success Factors
1. **[Factor 1]**
   - **Evidence:** [supporting data]
   - **Impact:** [what it achieved]
   - **Recommendation:** Continue this approach

2. **[Factor 2]**
   - **Evidence:** [supporting data]
   - **Impact:** [what it achieved]
   - **Recommendation:** Continue this approach

#### Improvement Opportunities
1. **[Opportunity 1]**
   - **Current State:** [description]
   - **Gap:** [what's missing]
   - **Potential:** [what could improve]
   - **Recommendation:** [specific action]

2. **[Opportunity 2]**
   - **Current State:** [description]
   - **Gap:** [what's missing]
   - **Potential:** [what could improve]
   - **Recommendation:** [specific action]

### Recommendations

#### Immediate Actions (Do Now)
1. **[Action 1]**
   - **Priority:** High
   - **Effort:** [Low/Medium/High]
   - **Impact:** [expected benefit]
   - **Steps:** [how to implement]

2. **[Action 2]**
   - **Priority:** High
   - **Effort:** [Low/Medium/High]
   - **Impact:** [expected benefit]
   - **Steps:** [how to implement]

#### Short-Term Improvements (Do Soon)
1. **[Improvement 1]**
   - **Priority:** Medium
   - **Effort:** [Low/Medium/High]
   - **Impact:** [expected benefit]
   - **Timeline:** [when to do]

#### Long-Term Enhancements (Plan For)
1. **[Enhancement 1]**
   - **Priority:** Low
   - **Effort:** [Low/Medium/High]
   - **Impact:** [expected benefit]
   - **Timeline:** [when to consider]

#### Specification Refinements
1. **[Refinement 1]**
   - **Current Spec:** [section]
   - **Issue:** [what's unclear/insufficient]
   - **Suggested Change:** [specific revision]
   - **Rationale:** [why this helps]

---

## Appendices

### Appendix A: Detailed Test Results
[Full test output summary or link]

### Appendix B: Analysis Data
[Full analysis results or link]

### Appendix C: File Inventory
[Complete list of generated files]

### Appendix D: Methodology
**Data Collection:**
- [Method 1]
- [Method 2]

**Analysis Approach:**
- [Approach 1]
- [Approach 2]

**Metrics Calculation:**
- [Calculation 1]
- [Calculation 2]

---

**Report Generated By:** Claude Code Infinite Loop Report Utility
**Report Version:** 1.0
**Contact:** [if applicable]
```

## Usage Examples

```bash
# Generate standard report
/report outputs/ specs/example_spec.md

# Executive summary only
/report outputs/ specs/example_spec.md executive

# Detailed technical report
/report outputs/ specs/example_spec.md technical

# Summary for quick review
/report outputs/ specs/example_spec.md summary
```

## Chain-of-Thought Benefits

This utility uses explicit reasoning to:
- **Systematically collect** all relevant data dimensions
- **Make analysis methodology transparent** for reproducibility
- **Provide clear reasoning chains** from data to insights
- **Enable stakeholders to understand** how conclusions reached
- **Support data-driven decision-making** through comprehensive analysis

## Execution Protocol

Now, generate the report:

1. **Define scope** - purpose, audience, time period
2. **Collect data** - iterations, specs, tests, analysis
3. **Analyze quantitatively** - calculate all metrics
4. **Assess qualitatively** - evaluate content and patterns
5. **Compare** - spec compliance, historical, benchmarks
6. **Identify issues** - categorize problems
7. **Generate insights** - synthesize findings
8. **Format report** - structure for clarity

Begin report generation for the specified outputs.
