You are generating a summary of THIS conversation - the development session you just completed.

## Context
- Issue/PR: #{{ISSUE_NUMBER}}
- Branch: {{BRANCH_NAME}}
- Loom Type: {{LOOM_TYPE}}


{{#if COMPACT_SUMMARIES}}

**CRITICAL: How to use the following section:** The summaries below are from earlier in this session, before the conversation was compacted to save context space. This content is no longer in your active conversation window, but represents work you did earlier. Use this to:
- Recall what was discussed, decided, and implemented before compaction
- Ensure your summary covers the FULL session, not just recent messages
- Avoid contradicting or repeating earlier decisions
- FAILURE TO USE THE "Previous Conversation Context" SECTION REPRESENTS A FAILURE OF YOUR TASK

## Previous Conversation Context - THIS SECTION CONTAINS CRITICAL INFO
------- BEGIN PREVIOUS CONTEXT ------

{{COMPACT_SUMMARIES}}

------- END PREVIOUS CONTEXT ------
{{/if}}

{{#if RECAP_DATA}}

## Session Recap - Key Context

**CRITICAL: The recap below contains high-signal context captured during this session.** Unlike the conversation transcript which includes all dialog, the recap contains only substantive information that was deliberately logged:

- **Decisions**: Choices that affect the codebase with rationale
- **Insights**: Discoveries that future developers need to know
- **Risks**: Things that could go wrong
- **Assumptions**: Bets being made about the implementation
- **Fixes**: Code review issues that were identified and resolved

When there are conflicts between the recap and conversation transcript, give weight to the most recent timestamp.

------- BEGIN SESSION RECAP ------

{{RECAP_DATA}}

------- END SESSION RECAP ------
{{/if}}

## Your Task

Reflect on THIS conversation (the one you're currently in){{#if COMPACT_SUMMARIES}} AND the previous context above{{/if}}{{#if RECAP_DATA}} AND the session recap above{{/if}}, and generate a concise summary focused on:

1. **Key Insights**: What important learnings emerged during implementation{{#if COMPACT_SUMMARIES}} INCLUDING the previous context above (THIS IS VERY IMPORTANT){{/if}}?
2. **Decisions Made**: What significant technical decisions were made and why?
3. **Challenges Encountered**: What obstacles were faced and how were they resolved?
4. **Mistakes and Corrections**: What mistakes were made and what was learned from them?

## Content Quality Guidelines

**CRITICAL: This summary is NOT a work log. It's knowledge capture for future developers and AI agents.**

The reader doesn't care about your internal process. They care about:

1. **Technical discoveries** - "The auth module depends on session middleware being initialized first"
2. **Design rationale** - "Chose retry pattern over circuit breaker because failure rate is low"
3. **Gotchas and edge cases** - "Empty arrays must be handled specially in the validator"
4. **Codebase knowledge** - "The legacy endpoint can't be removed until v3 migration completes"

**NEVER include in your summary:**
- Workflow phases you executed or skipped (enhancement, analysis, planning, implementation)
- Complexity classifications (TRIVIAL, SIMPLE, COMPLEX)
- Status updates ("tests pass", "build succeeded", "implementation complete")
- Git operations (commits made, branches created, rebases performed)
- Process reflection ("could have planned better", "spent time on X")
- Tool usage ("used grep to find", "ran the linter")

**Self-check before including content:** If it mentions "phase", "workflow", "SIMPLE/COMPLEX", "commit", "tests pass", "build", "lint", or describes what YOU did rather than what was LEARNED - it's process noise. Don't include it.

**Good vs Bad Examples:**

| BAD (process noise) | GOOD (technical insight) |
|---------------------|--------------------------|
| "Ran tests and they passed after fixing" | "The validator silently accepts null, causing downstream errors" |
| "Used the SIMPLE workflow since only 2 files changed" | "Config changes require server restart, no hot-reload support" |
| "Committed changes in 3 separate commits" | "Database constraints prevent orphaned records, no cleanup needed" |
| "Could have skipped the analysis phase" | "The caching layer assumes immutable data; TTL won't help for this use case" |

## Output Format

**CRITICAL: Your entire output will be posted DIRECTLY as a comment on the issue. Do NOT include:**
- Any meta-commentary about the summary (e.g., "This summary is ready to be posted...")
- Any preamble or introduction before the markdown
- Any explanation of what you're doing
- Any text after the closing `</details>` tag

**CRITICAL FORMAT REQUIREMENT:**
All comment content MUST use **GitHub-Flavored Markdown** syntax.
NEVER use Jira Wiki format - it will corrupt the output when converted.

| Do NOT use (Jira Wiki) | Use instead (Markdown) |
|------------------------|------------------------|
| `{code}...{code}` | ` ``` ` code blocks |
| `h1. Title` | `# Title` |
| `*bold*` | `**bold**` |
| `_italic_` | `*italic*` |
| `{quote}...{quote}` | `> ` blockquotes |
| `[link text\|url]` | `[link text](url)` |
| `-` or `*` at line start | `- ` (with space) for lists |

**Output ONLY the markdown content below, starting with `## iloom Session Summary` and ending with `</details>`.**

Structure it with key themes visible at the top, then detailed sections wrapped in collapsible tags:

```markdown
## iloom Session Summary

**Key Themes:**
- [Theme 1 - one sentence]
- [Theme 2 - one sentence]
- [Theme 3 - one sentence]

---

<details>
<summary>Session Details (click to expand)</summary>

### Key Insights
- [Insight 1]
- [Insight 2]

### Decisions Made
- [Decision and rationale]

### Challenges Resolved
- [Technical challenge and the insight gained, NOT "ran X command" or "tried Y approach"]

### Lessons Learned
- [Technical patterns discovered, codebase gotchas, design principles, reusable approaches]
- GOOD: "The ORM's lazy loading causes N+1 queries when iterating collections"
- BAD: "Should have run tests earlier" / "The build command is pnpm build"

</details>
```

Keep the visible themes section brief (3-5 bullet points, one sentence each). The detailed sections inside the collapsible can be more comprehensive. Focus on information that would help future developers or AI agents working on similar tasks.

**REMINDER: Output ONLY the markdown. No commentary before or after. Your response IS the comment.**

## VALIDATION CHECKLIST - FAILING THIS LIST MEANS FAILING THE TASK:
* Did you ouput ONLY the markdown with no commentary before or after?
{{#if COMPACT_SUMMARIES}}* Did you use the information in the "Previous Conversation Context" section?{{/if}}
{{#if RECAP_DATA}}* Did you incorporate the decisions, insights, risks, fixes, and assumptions from the "Session Recap" section?{{/if}}
* Did you avoid process noise? (No mentions of: workflow phases, complexity classifications, git commands, test/build results, or descriptions of what you DID vs what was LEARNED)

