Add branch and folder hygiene to issue-flow commands (#31)#38
Merged
Conversation
Issue #31 reported two recurring pain points: local issue branches end up "several commits ahead of main" after squash-merged PRs, and .issueflows/01-current-issues/ accumulates stale issue files. Extend the three existing slash commands (and their matching skills) so the assistant helps with both without introducing new commands: - /issue-start now runs a non-destructive branch-status preflight (fetch --prune, current branch, ahead/behind vs default, stale-branch warning) and then auto-moves every issueNN_* group in 01-current-issues that is NOT the focus issue to 02-partly-solved-issues or 03-solved-issues based on whether a status file contains - [x] Done. - /issue-close replaces the old "branch reminder" with an explicit post-merge cleanup: detect merge via gh pr view, offer git switch <default> && git pull --ff-only && git fetch --prune, then ask once (one consolidated yes/no) before git branch -d on every local branch already reachable from the default (squash-merged ones included). -D is never used automatically. Step 4 clarifies syncing via git pull --ff-only so unrelated history cannot sneak in silently. - /issue-init gains a branch-status preflight paragraph and an archived-issue guard: re-opening an issue already sitting in 02-/03- requires an extra explicit confirmation. Also update the workflow doc with a new "Branch and folder hygiene" section, remove a duplicated "Agent Skills (optional)" block, and extend the workspace rules with "Branch hygiene" and "Folder hygiene" subsections. Re-rendered the project's own .cursor/ and docs/ scaffold from the updated templates. Added regression assertions in tests/test_templating.py for the new headings. Full suite: 35 passed. Closes #31 Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #31: issue branches ending up "several commits ahead of main" after squash-merges, and stale files piling up in
.issueflows/01-current-issues/.Extends the three existing slash commands (and matching skills / workspace rules / workflow doc) without adding any new commands:
/issue-start: non-destructive branch-status preflight (git fetch --prune, current branch, ahead/behind vs default, stale-branch warning) plus an auto-safe sweep that moves everyissueNN_*group in01-current-issues/other than the focus issue to03-solved-issues/(if a status file contains- [x] Done) or02-partly-solved-issues/./issue-close: replaces the old "branch reminder" with an explicit post-merge cleanup. Detects merge status viagh pr view; on merged, offersgit switch <default> && git pull --ff-only && git fetch --pruneand then asks once (one consolidated yes/no) before runninggit branch -don every local branch already reachable fromorigin/<default>, including squash-merged ones detected viagit cherry.-Dis never used automatically. Step 4 now usesgit pull --ff-onlyso unrelated history can't sneak in./issue-init: adds a branch-status preflight paragraph and an archived-issue guard — re-opening an issue already archived in02-/03-requires a second explicit confirmation..issueflows/01-current-issues/" subsections so these habits stick outside the three commands.tests/test_templating.pyfor the new headings; full suite 35 passed.All behavior stays "auto-safe": file moves happen automatically based on the
- [x] Donecheckbox, but any destructive git action (branch delete, force ops) still requires an explicit confirmation.Test plan
uv run pytest(35 passed, including 4 new regression tests)uv run scripts/update_issueflow_setup.pyre-renders 9 scaffold files without error/issue-closeon a branch that points at this merged PR and verify the post-merge cleanup flow (switch to main, pull --ff-only, fetch --prune, single confirm beforegit branch -d) works end to end.Closes #31
Made with Cursor