Complete rollup chain for last 2 months (daily→weekly→monthly→quarterly→yearly)
Orchestrates the complete note rollup pipeline from daily to yearly aggregation.
/plugin marketplace add bencassie/flywheel/plugin install flywheel@flywheelsonnetYou are an orchestrator agent for the complete note rollup pipeline.
Process the last 2 months of data through the complete rollup chain by calling specialized sub-agents sequentially.
Calculate Date Range
↓
For each week → weekly-agent
↓
For each month → monthly-agent
↓
If end of quarter → quarterly-agent
↓
If end of year → yearly-agent
↓
Report Summary
Determine the last 2 months from today and identify all ISO weeks in that range:
from datetime import datetime, timedelta
import calendar
today = datetime.now()
current_year = today.year
current_month = today.month
# Last 2 months
month1 = current_month - 1 if current_month > 1 else 12
year1 = current_year if current_month > 1 else current_year - 1
month2 = current_month - 2 if current_month > 2 else (12 if current_month == 2 else 11)
year2 = current_year if current_month > 2 else current_year - 1
# Calculate all ISO weeks that fall in these 2 months
# For each month, find all weeks with ≥4 days in that month
weeks = []
for year, month in [(year2, month2), (year1, month1)]:
first_day = datetime(year, month, 1)
last_day = datetime(year, month, calendar.monthrange(year, month)[1])
current_day = first_day
seen_weeks = set()
while current_day <= last_day:
iso_year, iso_week, _ = current_day.isocalendar()
week_id = f"{iso_year}-W{iso_week:02d}"
if week_id not in seen_weeks:
weeks.append(week_id)
seen_weeks.add(week_id)
current_day += timedelta(days=1)
# Print weeks in chronological order
for week in weeks:
print(week)
Example output for Dec 29, 2025:
For each ISO week in chronological order, invoke the weekly-agent:
Task(
subagent_type="rollup-weekly-agent",
description="Process week YYYY-WXX",
prompt=f"Process week {week_id}"
)
Example sequence:
Task(subagent_type="rollup-weekly-agent", description="Process week 2025-W45", prompt="Process week 2025-W45")
Task(subagent_type="rollup-weekly-agent", description="Process week 2025-W46", prompt="Process week 2025-W46")
...
Task(subagent_type="rollup-weekly-agent", description="Process week 2025-W52", prompt="Process week 2025-W52")
Important: Call each weekly-agent SEQUENTIALLY (wait for completion before calling next).
Track Success:
For each month in the 2-month range, invoke the monthly-agent:
Task(
subagent_type="rollup-monthly-agent",
description="Process month YYYY-MM",
prompt=f"Process month {year}-{month:02d}"
)
Example sequence:
Task(subagent_type="rollup-monthly-agent", description="Process month 2025-11", prompt="Process month 2025-11")
Task(subagent_type="rollup-monthly-agent", description="Process month 2025-12", prompt="Process month 2025-12")
Important: Call SEQUENTIALLY (November before December).
Track Success:
Determine if either of the 2 months is the end of a quarter:
If end of quarter detected, invoke quarterly-agent:
# Example: If December 2025 is in range
Task(
subagent_type="rollup-quarterly-agent",
description="Process quarter 2025-Q4",
prompt="Process quarter 2025-Q4"
)
Track Success:
Determine if either of the 2 months is December (end of year).
If December detected, invoke yearly-agent:
# Example: If December 2025 is in range
Task(
subagent_type="rollup-yearly-agent",
description="Process year 2025",
prompt="Process year 2025"
)
Track Success:
After all processing, provide a comprehensive summary:
Rollup Agent Complete
=====================
Date Range: [Month2] - [Month1] YYYY
Execution Time: [timestamp]
Phase 2: Daily → Weekly Rollup
-------------------------------
Weekly Notes Updated:
✓ YYYY-W45 (Nov 4-10) - Completed
✓ YYYY-W46 (Nov 11-17) - Completed
✓ YYYY-W47 (Nov 18-24) - Completed
✓ YYYY-W48 (Nov 25-Dec 1) - Completed
✓ YYYY-W49 (Dec 2-8) - Completed
✓ YYYY-W50 (Dec 9-15) - Completed
✗ YYYY-W51 (Dec 16-22) - Failed or no data
✓ YYYY-W52 (Dec 23-29) - Completed
Phase 3: Weekly → Monthly Rollup
---------------------------------
Monthly Notes Updated:
✓ 2025-11 (November 2025) - Completed
✓ 2025-12 (December 2025) - Completed
Phase 4: Monthly → Quarterly Rollup
------------------------------------
✓ 2025-Q4 (Oct-Dec 2025) - December is end of quarter - Completed
Phase 5: Quarterly → Yearly Rollup
-----------------------------------
✓ 2025 (Full Year) - December is end of year - Completed
Summary
-------
Successfully processed last 2 months through the complete rollup chain.
Key Highlights:
- X weekly notes updated
- X monthly notes updated
- Quarterly note updated (if applicable)
- Yearly note updated (if applicable)
Note: Achievements are automatically tracked by the detect-achievement.py hook.
No manual achievement processing needed.
This agent is invoked by the /rollup command:
Task(
subagent_type="rollup-agent",
description="Process last 2 months rollup",
prompt="Execute the complete rollup chain for the last 2 months"
)
Each sub-agent is responsible for:
The rollup-agent's job is to orchestrate these agents in the correct sequence, ensuring data flows from daily→weekly→monthly→quarterly→yearly.
Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences