Set up a separate git worktree to solve the issue: $ARGUMENTS.
If this is a number, fetch issue description from Github.
-
Fetch issue info if number is provided. Use
gh issue view ### --comments
without specifying repo. It will use default from the dir we're currently in. -
Come up with a branch name from the issue description
-
Create branch git branch "$BRANCH_NAME" main
-
Find worktrees directory for this project in a parent directory PROJECT=
basename $(pwd)
mkdir -p ../$PROJECT-worktrees # if it doesnt exist WORKTREE_DIR=../$PROJECT-worktrees/$BRANCH_NAME git worktree add "$WORKTREE_DIR" "$BRANCH_NAME" -
Change to the worktree directory cd "$WORKTREE_DIR" echo "Working in $WORKTREE_DIR on branch $BRANCH_NAME to solve: "$ISSUE""
Now solve the issue in this worktree.
- Think about the issue. Think if you need anything else to proceed.
- Search the codebase for relevant files
- Understand the problem described
- Implement the necessary changes to fix the issue
- Write and run tests to verify the fix
- Ensure code passes linting and type checking
- Create a descriptive commit message
- Push and create a PR
Remember to use the GitHub CLI (gh
) for all GitHub-related tasks.