{#
  Expected variables:
  - project_name: str
  - timestamp: str
  - total_days: int
  - session_count: int
  - phases: list of {id: str, name: str, days: int, objective: str,
                     tasks: [{day: int, files: [str], scope: str}],
                     sessions: [{files: [str], estimate: str}],
                     gates: [str], verification_command?: str, rollback_action?: str}
  - result_library: str
  - install_command: str
  - additional_deps?: [{name: str, purpose: str, install: str}]
  - target_coverage?: int (default 80)
  - dependency_graph?: str
  - notes?: str
#}
# Invar Onboarding Roadmap

> Project: {{ project_name }}
> Generated: {{ timestamp }}
> Based on: docs/invar-onboard-assessment.md

## Overview

| Metric | Value |
|--------|-------|
| Total Phases | {{ phases | length }} |
| Total Days | {{ total_days }} |
| Agent Sessions | {{ session_count }} |

---

{% for phase in phases %}
## Phase {{ loop.index }}: {{ phase.name }} ({{ phase.days }} days)

### Objective

{{ phase.objective }}

### Tasks

| Day | Files | Scope |
|-----|-------|-------|
{% for task in phase.tasks %}
| {{ task.day }} | {{ task.files | join(", ") }} | {{ task.scope }} |
{% endfor %}

### Sessions

| Session | Files | Estimated |
|---------|-------|-----------|
{% for session in phase.sessions %}
| {{ phase.id }}.{{ loop.index }} | {{ session.files | join(", ") }} | {{ session.estimate }} |
{% endfor %}

### Gate Checklist

{% for gate in phase.gates %}
- [ ] {{ gate }}
{% endfor %}

### Verification

```bash
{{ phase.verification_command | default("invar guard") }}
```

---

{% endfor %}

## Rollback Strategy

| Phase | Rollback Point | Recovery Action |
|-------|----------------|-----------------|
{% for phase in phases %}
| {{ loop.index }} | Pre-{{ phase.name }} | {{ phase.rollback_action | default("Revert " + phase.name + " changes") }} |
{% endfor %}

## Session Guidelines

### Context Limits

Each agent session should:
- Focus on 2-3 files maximum
- Complete within 1 context window
- End with successful `invar guard`

### Handoff Protocol

1. **Before session end:**
   - Commit all changes
   - Update this roadmap (mark completed)
   - Document any deviations

2. **Session start:**
   - Read assessment and this roadmap
   - Review previous session's changes
   - Verify Guard passes before proceeding

### Emergency Procedures

| Situation | Action |
|-----------|--------|
| Guard fails after changes | Revert to last passing commit |
| Unexpected dependency | Add to blockers, pause phase |
| Scope creep detected | Stop, update assessment |

## Progress Tracking

### Phase Status

| Phase | Status | Started | Completed | Notes |
|-------|--------|---------|-----------|-------|
{% for phase in phases %}
| {{ loop.index }}. {{ phase.name }} | ⬜ Pending | - | - | |
{% endfor %}

### Session Log

| Session | Date | Duration | Files Changed | Guard | Notes |
|---------|------|----------|---------------|-------|-------|
| - | - | - | - | - | - |

## Dependencies

### External Libraries

| Library | Purpose | Install Command |
|---------|---------|-----------------|
| {{ result_library }} | Result types | {{ install_command }} |
{% for dep in additional_deps %}
| {{ dep.name }} | {{ dep.purpose }} | {{ dep.install }} |
{% endfor %}

### Internal Dependencies

```
{{ dependency_graph | default("No complex internal dependencies.") }}
```

## Success Criteria

### Phase Completion

Each phase is complete when:
1. All tasks checked off
2. Gate checklist passed
3. `invar guard` passes
4. E2E tests still pass (if applicable)

### Project Completion

Project migration complete when:
- [ ] All phases completed
- [ ] Full `invar guard` passes
- [ ] Contract coverage > {{ target_coverage | default(80) }}%
- [ ] All Core functions have doctests
- [ ] Shell functions return Result types

## Notes

{{ notes | default("No additional notes.") }}

---

*Generated by /invar-onboard*
