fix: make /catch-up branch-aware and layered, with product-focused next step

Rework the /catch-up decision tree from mutually-exclusive cases into
complementary layers. It now determines whether the current branch is the
repo's default branch and builds context accordingly: on a feature branch
it reads enough of the branch's own commits to grasp the intent and checks
the branch's PR even when there are uncommitted changes (so in-progress
work is understood as part of the larger effort); on the default branch it
lightly skims recent commits. Uncommitted changes remain the focal point
but are interpreted through that context.

The suggested next step now favors continuing the actual work over
housekeeping — since running catch-up implies the user stepped away and
the work is likely unfinished, push/PR/checks are only a fallback. Updates
the Magic Prompts settings descriptions across locales to match.
This commit is contained in:
Bohdan Triapitsyn
2026-05-30 02:04:32 +03:00
parent 6cd71bdfe5
commit b3f519858a
9 changed files with 20 additions and 17 deletions
@@ -1696,7 +1696,7 @@ export const settingsDict = {
'settings.magicPrompts.page.group.sessionFeaturePlan.title': 'Feature Planning',
'settings.magicPrompts.page.group.sessionFeaturePlan.description': 'Prompts used by the /plan-feature slash command: visible user message + hidden instructions. Runs a guided dialogue that researches the code and asks clarifying questions in small batches before producing an implementation plan.',
'settings.magicPrompts.page.group.sessionCatchUp.title': 'Catch Up',
'settings.magicPrompts.page.group.sessionCatchUp.description': 'Prompts used by the /catch-up slash command: visible user message + hidden instructions. Inspects git state and branches on it — reconstructs intent from an in-progress diff, checks an open PR\'s review state, or summarizes recent commits.',
'settings.magicPrompts.page.group.sessionCatchUp.description': 'Prompts used by the /catch-up slash command: visible user message + hidden instructions. Builds branch-aware context — the branch\'s commits, its PR, and uncommitted work together — to understand what you were doing, then gives a warm orientation and a product-focused next step.',
'settings.magicPrompts.page.group.sessionDebug.title': 'Debugging',
'settings.magicPrompts.page.group.sessionDebug.description': 'Prompts used by the /debug slash command: visible user message + hidden instructions. Runs a guided root-cause investigation — captures the symptom, forms hypotheses, checks them against the code, and confirms the cause before proposing a fix.',
'settings.magicPrompts.page.group.sessionWeigh.title': 'Weigh Options',
@@ -1663,7 +1663,7 @@ export const settingsDict = {
"settings.magicPrompts.page.group.sessionFeaturePlan.title": "Planificación de funciones",
"settings.magicPrompts.page.group.sessionFeaturePlan.description": "Prompts usados por el comando /plan-feature: mensaje visible del usuario + instrucciones ocultas. Ejecuta un diálogo guiado que investiga el código y hace preguntas aclaratorias en lotes pequeños antes de producir un plan de implementación.",
"settings.magicPrompts.page.group.sessionCatchUp.title": "Ponerse al día",
"settings.magicPrompts.page.group.sessionCatchUp.description": "Prompts usados por el comando /catch-up: mensaje visible del usuario + instrucciones ocultas. Inspecciona el estado de git y, según él, reconstruye la intención a partir de un diff en curso, revisa el estado de revisión de un PR abierto o resume los commits recientes.",
"settings.magicPrompts.page.group.sessionCatchUp.description": "Prompts usados por el comando /catch-up: mensaje visible del usuario + instrucciones ocultas. Construye contexto según la rama — los commits de la rama, su PR y el trabajo sin confirmar juntos — para entender qué estabas haciendo, y luego da una orientación cálida y un siguiente paso centrado en el producto.",
"settings.magicPrompts.page.group.sessionDebug.title": "Depuración",
"settings.magicPrompts.page.group.sessionDebug.description": "Prompts usados por el comando /debug: mensaje visible del usuario + instrucciones ocultas. Ejecuta una investigación guiada de la causa raíz: captura el síntoma, formula hipótesis, las verifica contra el código y confirma la causa antes de proponer una solución.",
"settings.magicPrompts.page.group.sessionWeigh.title": "Comparar enfoques",
@@ -1663,7 +1663,7 @@ export const settingsDict = {
'settings.magicPrompts.page.group.sessionFeaturePlan.title': '기능 계획',
'settings.magicPrompts.page.group.sessionFeaturePlan.description': '/plan-feature slash command에서 사용하는 프롬프트입니다: 표시 사용자 메시지 + 숨겨진 지침. 코드를 조사하고 작은 묶음으로 명확화 질문을 한 뒤 구현 계획을 만드는 가이드 대화를 실행합니다.',
'settings.magicPrompts.page.group.sessionCatchUp.title': '따라잡기',
'settings.magicPrompts.page.group.sessionCatchUp.description': '/catch-up slash command에서 사용하는 프롬프트입니다: 표시 사용자 메시지 + 숨겨진 지침. git 상태를 확인하고 그에 따라 진행 중인 diff에서 의도구성하거나, 열린 PR의 리뷰 상태를 확인하거나, 최근 커밋을 요약합니다.',
'settings.magicPrompts.page.group.sessionCatchUp.description': '/catch-up slash command에서 사용하는 프롬프트입니다: 표시 사용자 메시지 + 숨겨진 지침. 브랜치의 커밋, PR, 커밋되지 않은 작업을 함께 보는 브랜치 기반 컨텍스트를 구성해 무엇을 하고 있었는지 이해한 뒤, 따뜻한 방향 안내와 제품 중심의 다음 단계를 제시합니다.',
'settings.magicPrompts.page.group.sessionDebug.title': '디버깅',
'settings.magicPrompts.page.group.sessionDebug.description': '/debug slash command에서 사용하는 프롬프트입니다: 표시 사용자 메시지 + 숨겨진 지침. 근본 원인 조사를 단계적으로 진행합니다 — 증상을 파악하고 가설을 세워 코드와 대조하며, 수정안을 제시하기 전에 원인을 확정합니다.',
'settings.magicPrompts.page.group.sessionWeigh.title': '옵션 비교',
@@ -282,7 +282,7 @@ export const settingsDict = {
'settings.magicPrompts.page.group.sessionFeaturePlan.title': 'Planowanie funkcji',
'settings.magicPrompts.page.group.sessionFeaturePlan.description': 'Prompty używane przez polecenie /plan-feature: widoczna wiadomość użytkownika + ukryte instrukcje. Uruchamia prowadzony dialog, który bada kod i zadaje pytania doprecyzowujące w małych partiach przed utworzeniem planu implementacji.',
'settings.magicPrompts.page.group.sessionCatchUp.title': 'Nadrobienie kontekstu',
'settings.magicPrompts.page.group.sessionCatchUp.description': 'Prompty używane przez polecenie /catch-up: widoczna wiadomość użytkownika + ukryte instrukcje. Sprawdza stan git i w zależności od niego — odtwarza zamiar z trwającego diffa, sprawdza stan recenzji otwartego PR-a lub podsumowuje ostatnie commity.',
'settings.magicPrompts.page.group.sessionCatchUp.description': 'Prompty używane przez polecenie /catch-up: widoczna wiadomość użytkownika + ukryte instrukcje. Buduje kontekst zależny od gałęzi — commity gałęzi, jej PR i niezatwierdzone zmiany razem — aby zrozumieć, nad czym pracowałeś, a następnie daje ciepłą orientację i produktowy następny krok.',
'settings.magicPrompts.page.group.sessionDebug.title': 'Debugowanie',
'settings.magicPrompts.page.group.sessionDebug.description': 'Prompty używane przez polecenie /debug: widoczna wiadomość użytkownika + ukryte instrukcje. Prowadzi badanie pierwotnej przyczyny — rejestruje objaw, formułuje hipotezy, sprawdza je w kodzie i potwierdza przyczynę przed zaproponowaniem poprawki.',
'settings.magicPrompts.page.group.sessionWeigh.title': 'Rozważanie opcji',
@@ -1663,7 +1663,7 @@ export const settingsDict = {
"settings.magicPrompts.page.group.sessionFeaturePlan.title": "Planejamento de funcionalidade",
"settings.magicPrompts.page.group.sessionFeaturePlan.description": "Prompts usados pelo comando /plan-feature: mensagem visível do usuário + instruções ocultas. Executa um diálogo guiado que investiga o código e faz perguntas de esclarecimento em pequenos lotes antes de produzir um plano de implementação.",
"settings.magicPrompts.page.group.sessionCatchUp.title": "Retomada de contexto",
"settings.magicPrompts.page.group.sessionCatchUp.description": "Prompts usados pelo comando /catch-up: mensagem visível do usuário + instruções ocultas. Inspeciona o estado do git e, com base nisso, reconstrói a intenção a partir de um diff em andamento, verifica o estado de revisão de um PR aberto ou resume os commits recentes.",
"settings.magicPrompts.page.group.sessionCatchUp.description": "Prompts usados pelo comando /catch-up: mensagem visível do usuário + instruções ocultas. Constrói um contexto ciente da branch — os commits da branch, seu PR e o trabalho não confirmado juntos — para entender o que você estava fazendo, e então dá uma orientação acolhedora e um próximo passo focado no produto.",
"settings.magicPrompts.page.group.sessionDebug.title": "Depuração",
"settings.magicPrompts.page.group.sessionDebug.description": "Prompts usados pelo comando /debug: mensagem visível do usuário + instruções ocultas. Executa uma investigação guiada da causa raiz: captura o sintoma, formula hipóteses, verifica-as no código e confirma a causa antes de propor uma correção.",
"settings.magicPrompts.page.group.sessionWeigh.title": "Comparar abordagens",
@@ -1663,7 +1663,7 @@ export const settingsDict = {
"settings.magicPrompts.page.group.sessionFeaturePlan.title": "Планування фічі",
"settings.magicPrompts.page.group.sessionFeaturePlan.description": "Промпти, які використовуються командою /plan-feature: видиме повідомлення користувача + приховані інструкції. Запускає кероване діалогове планування — досліджує код і ставить уточнюючі запитання невеликими батчами, перш ніж скласти план імплементації.",
"settings.magicPrompts.page.group.sessionCatchUp.title": "Повернення в контекст",
"settings.magicPrompts.page.group.sessionCatchUp.description": "Промпти, які використовуються командою /catch-up: видиме повідомлення користувача + приховані інструкції. Перевіряє стан git і залежно від нього — відновлює задум із незавершеного diff, перевіряє стан рев'ю відкритого PR або підсумовує останні коміти.",
"settings.magicPrompts.page.group.sessionCatchUp.description": "Промпти, які використовуються командою /catch-up: видиме повідомлення користувача + приховані інструкції. Будує контекст з урахуванням гілки — коміти гілки, її PR і незакомічену роботу разом — щоб зрозуміти, що ти робив, а тоді дає теплу орієнтацію й продуктовий наступний крок.",
"settings.magicPrompts.page.group.sessionDebug.title": "Дебаг",
"settings.magicPrompts.page.group.sessionDebug.description": "Промпти, які використовуються командою /debug: видиме повідомлення користувача + приховані інструкції. Веде кероване дослідження першопричини — фіксує симптом, формує гіпотези, перевіряє їх по коду й підтверджує причину перш ніж пропонувати фікс.",
"settings.magicPrompts.page.group.sessionWeigh.title": "Зважування варіантів",
@@ -1663,7 +1663,7 @@ export const settingsDict = {
'settings.magicPrompts.page.group.sessionFeaturePlan.title': '功能规划',
'settings.magicPrompts.page.group.sessionFeaturePlan.description': '由 /plan-feature 斜杠命令使用的提示词:可见用户消息 + 隐藏说明。运行引导式对话,先调研代码并分小批提出澄清问题,然后生成实现计划。',
'settings.magicPrompts.page.group.sessionCatchUp.title': '快速回顾',
'settings.magicPrompts.page.group.sessionCatchUp.description': '由 /catch-up 斜杠命令使用的提示词:可见用户消息 + 隐藏说明。检查 git 状态并据此处理——从进行中的 diff 还原意图、查看已开启 PR 的评审状态,或总结最近的提交。',
'settings.magicPrompts.page.group.sessionCatchUp.description': '由 /catch-up 斜杠命令使用的提示词:可见用户消息 + 隐藏说明。结合分支的提交、PR 以及未提交的改动,建立与分支相关的上下文,理解你之前在做什么,然后给出温和的导览和以产品为中心的下一步。',
'settings.magicPrompts.page.group.sessionDebug.title': '调试',
'settings.magicPrompts.page.group.sessionDebug.description': '由 /debug 斜杠命令使用的提示词:可见用户消息 + 隐藏说明。引导式排查根本原因——记录症状、提出假设、对照代码验证,并在提出修复方案前确认原因。',
'settings.magicPrompts.page.group.sessionWeigh.title': '权衡方案',
@@ -1584,7 +1584,7 @@
'settings.magicPrompts.page.group.sessionFeaturePlan.title': '功能規劃',
'settings.magicPrompts.page.group.sessionFeaturePlan.description': '由 /plan-feature 斜線命令使用的提示詞:可見使用者訊息 + 隱藏說明。執行引導式對話,先調研程式碼並分小批提出釐清問題,然後產生實作計畫。',
'settings.magicPrompts.page.group.sessionCatchUp.title': '快速回顧',
'settings.magicPrompts.page.group.sessionCatchUp.description': '由 /catch-up 斜線命令使用的提示詞:可見使用者訊息 + 隱藏說明。檢查 git 狀態並據此處理——從進行中的 diff 還原意圖、查看已開啟 PR 的審查狀態,或總結最近的提交。',
'settings.magicPrompts.page.group.sessionCatchUp.description': '由 /catch-up 斜線命令使用的提示詞:可見使用者訊息 + 隱藏說明。結合分支的提交、PR 以及未提交的變更,建立與分支相關的上下文,理解你之前在做什麼,然後給出溫和的導覽和以產品為中心的下一步。',
'settings.magicPrompts.page.group.sessionDebug.title': '除錯',
'settings.magicPrompts.page.group.sessionDebug.description': '由 /debug 斜線命令使用的提示詞:可見使用者訊息 + 隱藏說明。引導式排查根本原因——記錄症狀、提出假設、對照程式碼驗證,並在提出修復方案前確認原因。',
'settings.magicPrompts.page.group.sessionWeigh.title': '權衡方案',
+12 -9
View File
@@ -624,23 +624,26 @@ Respond in the same language the user uses.`,
title: 'Catch Up Instructions',
group: 'Session',
description: 'Hidden instructions attached to the /catch-up command. Inspects git state and branches on it: in-progress diff, open PR review state, or recent commits.',
template: `The user is returning to this project and wants to quickly get their bearings — a warm, natural "here's where you are and where to pick up", not a status report. Investigate the actual repository state first, then orient them conversationally. Do not assume; check.
template: `The user is returning to this project after stepping away and wants to quickly get their bearings — a warm, natural "here's where you are and where to pick up", not a status report. Investigate the actual repository state first, then orient them conversationally. Do not assume; check.
Quietly inspect git state first: the current branch, uncommitted changes (status and diff), and recent commits. Do this work silently the user wants the takeaway, not a play-by-play of the commands you ran.
Quietly inspect git state first, and do this work silently the user wants the takeaway, not a play-by-play of the commands you ran. Look at: the current branch and whether it is the repo's default branch (main/master, or whatever this repo uses), uncommitted changes (status and diff), recent commits, and where the branch stands relative to its remote.
Then orient them based on what you find:
Build context in LAYERS they combine, they are not either/or. Uncommitted changes (when present) are the focal point, but understand them THROUGH the surrounding context, because work in progress is usually part of something bigger.
1. Working tree has uncommitted changes They were in the middle of something. From the diff, work out what they were doing and why, what looks done versus still in progress, and where they likely left off. Open with that ("Looks like you were in the middle of X…"), then point to the natural next step to pick it back up.
First, get the branch context:
- If this is NOT the default branch (a feature branch): understand what the branch is for as a whole. Read its recent commits and their diffs not all of them, just enough, going back until the intent and how it is being implemented become clear. Also check whether the branch has its OWN open pull request, even when there are uncommitted changes the PR explains what the current diff is in service of (continuing the feature, or addressing review feedback) and helps you judge whether the work looks finished or still mid-flight. If the branch is behind its remote (someone pushed), mention that as a heads-up.
- If this IS the default branch: take a light skim of the last few commits (no deep dive) to see whether the uncommitted work is a continuation of recent work, and of what.
2. Working tree is clean AND the current branch has its OWN open pull request Briefly cover that PR's state: is it approved, are there requested changes, unresolved comments, or failing checks? Surface anything still open so they know what to continue from. If you can't access the PR, say so in one line and move on.
Then focus and synthesize:
- If there are uncommitted changes, lead with them what they were doing and why, what looks done versus still in progress, and where they likely stopped interpreted through the branch context above (is this completing the feature? addressing review? a new direction?). Open with that, e.g. "Looks like you were in the middle of X…".
- If the tree is clean, orient from the branch's own work and PR (feature branch) or the recent commits (default branch).
3. Working tree is clean and the current branch has no open PR of its own Simply recap what was done recently and the direction it's heading, then suggest a natural next move. Do NOT bring up pull requests at all in this case.
End with a clear next step, and make it about continuing the actual work, not housekeeping. The fact that they ran this command means they stepped away if the work were finished they would most likely have shipped it already, so assume there is more to do and point to the substantive next piece ("next you'd wire X into Y and handle Z"). Only suggest housekeeping pushing, opening a PR, running checks when there is genuinely nothing left to build, or when it is truly the most useful thing to do next.
Hard rules:
- Only ever discuss the CURRENT branch and its own work. Never mention unrelated branches, other people's PRs, review requests assigned to the user, or PRs that belong to other branches that is noise here.
- Don't pad with git mechanics the user doesn't need (exact commit counts, "ahead of origin by N", remote-tracking detail) unless it is genuinely the single most useful thing to say.
Keep it short, friendly, and scannable a couple of sentences of orientation plus a clear next step. Write like a teammate catching them up, not a CI summary.
- Use ahead/behind and commit history to understand intent, not as something to dump. Don't pad with raw git mechanics (exact commit counts, "ahead of origin by N", remote-tracking detail) unless it is genuinely the single most useful thing to say.
- Depth goes into your understanding, not the length of the reply. Keep the output short, friendly, and scannable a couple of sentences of orientation plus a clear next step. Write like a teammate catching them up, not a CI summary.
Respond in the same language the user uses.`,
},