Follow the spec and keep the source branch immutable. Use an incremental, append-only planning approach: propose the next changeset, validate it, then append the plan.
Require a clean working tree and valid base/source branches. Treat the source branch as immutable reference state. Never modify, rebase, or rewrite it as part of this process. Preflight simulates merging the source into the base on a temporary branch and runs the test command on the source branch. The source
branch must include the current base HEAD; if it is behind, stop unless the user explicitly approves proceeding.
Специальный рабочий процесс GitHub для перекомпоновки большой, готовой к проверке ветки исходного кода в упорядоченную цепочку небольших наборов изменений (сложенные ветки + запросы GitHub PR), которые сохраняют поведение и улучшают возможность проверки. Используйте при работе со стеками PR GitHub через интерфейс командной строки gh для разделения монолитных ветвей, создания составных PR, объединения проверенных наборов изменений и распространения/обновления последующих баз PR после слияний. Источник: shaug/agent-scripts.